main_2020_edit.js 2.5 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723
  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. })
  6206. }
  6207. function I(e, t) {
  6208. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6209. $(".gui-floor-icon").hide(),
  6210. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6211. $(".gui-floor-icon").show(),
  6212. $(".gui-floor-title").hide()),
  6213. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6214. $(".gui-floor-number").text(se.FLOOR_ALL),
  6215. $(".floorChoice").removeClass("active"),
  6216. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6217. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6218. $(".floorChoice").removeClass("active"),
  6219. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6220. }
  6221. function E() {
  6222. var e = $("#player").width() - 20
  6223. , t = $("#scroller")
  6224. , i = $("#drawer")
  6225. , n = $(".pinBottom");
  6226. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6227. i.addClass("noScroll"),
  6228. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6229. i.toggleClass("noScroll"),
  6230. n.toggleClass("noScroll"))
  6231. }
  6232. function _(e) {
  6233. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6234. e = e || 0,
  6235. Ae = !1,
  6236. window.setTimeout(function() {
  6237. Ae || (!0,
  6238. $("#gui-spinner").stop(!0, !0).show())
  6239. }
  6240. .bind(this), e)
  6241. }(M.modelComponentLoadSpinnerDelay)
  6242. }
  6243. function b(e, t) {
  6244. for (var i = []; e; )
  6245. i.push(e),
  6246. e = e.parentNode;
  6247. for (; t && -1 === i.indexOf(t); )
  6248. t = t.parentNode;
  6249. return t
  6250. }
  6251. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6252. Oe("../util/ajax"),
  6253. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6254. Oe("../util/camera"),
  6255. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6256. 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"),
  6257. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6258. Oe("../enum/PathDisplayMode"),
  6259. Oe("../enum/DirectorEvents"),
  6260. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6261. Oe("../enum/WarpStyle"),
  6262. Oe("../enum/AlignmentType"),
  6263. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6264. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6265. coBrand: {
  6266. visible: !0,
  6267. elements: [".co-brand", "#loaderCoBrand"]
  6268. },
  6269. help: {
  6270. visible: !0,
  6271. elements: [".nav-help", "#nav-help"]
  6272. },
  6273. tourControls: {
  6274. visible: !0,
  6275. elements: [".next", ".previous", "#play"]
  6276. },
  6277. highlight: {
  6278. visible: !0,
  6279. elements: ["#drawer", "#pullTab"]
  6280. },
  6281. share: {
  6282. visible: !0,
  6283. elements: [".socialButton", "#share"]
  6284. },
  6285. fullScreen: {
  6286. visible: !0,
  6287. elements: ["#gui-fullscreen"]
  6288. },
  6289. floors: {
  6290. visible: !0,
  6291. elements: [".gui-floor"]
  6292. }
  6293. }, Ie = (g = document.getElementById("drawer"),
  6294. function() {
  6295. $("#player").height() < 400 && g.classList.contains("open") && l()
  6296. }
  6297. ), Ee = (f = document.getElementById("meta-info"),
  6298. function() {
  6299. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6300. }
  6301. ), _e = (i = document.getElementById("meta-info"),
  6302. s = document.getElementById("interaction-modal"),
  6303. u = $("#drawer").eq(0),
  6304. d = $(".gui-floor").eq(0),
  6305. p = $(".vr-popup").eq(0),
  6306. function(e) {
  6307. switch (e) {
  6308. case "info":
  6309. we(),
  6310. Te(),
  6311. Ie(),
  6312. Me(),
  6313. Re(),
  6314. xe(),
  6315. Pe();
  6316. break;
  6317. case "terms":
  6318. be(),
  6319. Te(),
  6320. Se(),
  6321. Me(),
  6322. Re(),
  6323. xe(),
  6324. Pe();
  6325. break;
  6326. case "help":
  6327. be(),
  6328. we(),
  6329. Me(),
  6330. Re(),
  6331. xe(),
  6332. Pe();
  6333. break;
  6334. case "vr":
  6335. be(),
  6336. we(),
  6337. Me(),
  6338. Re(),
  6339. Te(),
  6340. Pe(),
  6341. t(p) && Se();
  6342. break;
  6343. case "highlights":
  6344. Ee(),
  6345. we(),
  6346. Me(),
  6347. Re();
  6348. break;
  6349. case "share":
  6350. be(),
  6351. we(),
  6352. Te(),
  6353. Re(),
  6354. xe(),
  6355. Pe();
  6356. break;
  6357. case "floor":
  6358. we(),
  6359. Me(),
  6360. xe();
  6361. break;
  6362. case "view":
  6363. Re(),
  6364. Me(),
  6365. we(),
  6366. xe();
  6367. break;
  6368. case "tour":
  6369. case "move":
  6370. we(),
  6371. Me(),
  6372. Re(),
  6373. xe();
  6374. break;
  6375. case "resize":
  6376. be(),
  6377. Ie(),
  6378. Re();
  6379. break;
  6380. case "tag":
  6381. we(),
  6382. Te(),
  6383. Me(),
  6384. Re(),
  6385. xe()
  6386. }
  6387. }
  6388. );
  6389. function be() {
  6390. i.classList.contains("expand") && z.toggleMeta(!0)
  6391. }
  6392. function we() {
  6393. W.hide()
  6394. }
  6395. function Te() {
  6396. U.close()
  6397. }
  6398. function xe() {
  6399. X.dismiss()
  6400. }
  6401. function Se() {
  6402. u.hasClass("open") && l()
  6403. }
  6404. function Me() {
  6405. K.hide()
  6406. }
  6407. function Re() {
  6408. d.hasClass("open") && d.removeClass("open")
  6409. }
  6410. function Pe() {
  6411. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6412. }
  6413. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6414. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6415. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6416. setTimeout(function() {
  6417. $(".icon:visible").hide().show(0)
  6418. }, 100)
  6419. }),
  6420. $("#gui-fullscreen").find("a").on("click", function(e) {
  6421. y(e),
  6422. S.requestFullscreen($("body")[0]),
  6423. R.track("showcase_gui", {
  6424. gui_action: "click_enter_fullscreen",
  6425. interaction_source: "gui"
  6426. })
  6427. }),
  6428. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6429. y(e),
  6430. S.exitFullscreen(),
  6431. R.track("showcase_gui", {
  6432. gui_action: "click_exit_fullscreen",
  6433. interaction_source: "gui"
  6434. })
  6435. }),
  6436. $(window).on("resize", function(e) {
  6437. var t = e.target.innerHeight
  6438. , i = e.target.innerWidth;
  6439. t === o && i === a || (Ce.highlight.visible && E(),
  6440. _e("resize"),
  6441. $(".pinTop.right").removeClass("hideUnderMeta"),
  6442. n(),
  6443. o = t,
  6444. a = i)
  6445. }).resize(),
  6446. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6447. $("#pullTab").on("click", function(e) {
  6448. y(e),
  6449. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6450. gui_action: "hide_highlight_reel"
  6451. }),
  6452. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6453. gui_action: "show_highlight_reel"
  6454. }),
  6455. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6456. l()
  6457. }),
  6458. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6459. $("#hotList").on("click", function(e) {
  6460. y(e);
  6461. var t = $("#hotListWrap")[0];
  6462. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6463. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6464. this.classList.add("active"))
  6465. }),
  6466. $("#hotListContent ul").on("mouseover", function(e) {
  6467. y(e);
  6468. var t = e.target
  6469. , i = document.getElementById("hotListWrap");
  6470. if ("SPAN" === t.tagName) {
  6471. var n = t.parentElement.parentElement;
  6472. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6473. } else if ("LI" === t.tagName) {
  6474. n = t.parentElement;
  6475. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6476. } else
  6477. i.style.width = ""
  6478. }),
  6479. $("#hotListContent ul").on("click", function(e) {
  6480. y(e),
  6481. this.preElem && this.preElem.classList.remove("active"),
  6482. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6483. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6484. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6485. e.target.hot && e.target.hot.examine(!0),
  6486. this.preElem = e.target)
  6487. }),
  6488. $("#hotListClose").on("click", function(e) {
  6489. y(e),
  6490. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6491. $("#hotListContent ul .active").removeClass("active"),
  6492. $("#hotList")[0].classList.remove("active")
  6493. })),
  6494. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6495. $("#more-menu-button").on("click", function(e) {
  6496. y(e),
  6497. $("#more-menu").toggleClass("open")
  6498. }),
  6499. Le.exports.init = function(s, l, c, e, t, i, n) {
  6500. var r;
  6501. x = n,
  6502. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6503. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6504. F.init(),
  6505. D.init(s, i),
  6506. ce.init(s, l, e),
  6507. $(".icon").on("mouseover", function() {
  6508. l.player && l.player.reticule.hide()
  6509. }),
  6510. function(e, t) {
  6511. var i = t.player;
  6512. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6513. y(e),
  6514. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6515. R.track("USER", {
  6516. event_type: "showcase_gui",
  6517. gui_action: "click_inside_mode_button"
  6518. }),
  6519. t.changeMode(ie.PANORAMA)
  6520. }),
  6521. $("#gui-modes-outside").find("a").on("click", function(e) {
  6522. y(e),
  6523. R.track("showcase_gui", {
  6524. gui_action: "click_outside_mode_button"
  6525. }),
  6526. t.changeMode(pe)
  6527. }),
  6528. $("#gui-modes-floorplan").on("click", function(e) {
  6529. y(e),
  6530. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6531. gui_action: "click_floorplan_mode_button"
  6532. }),
  6533. t.changeMode(ie.FLOORPLAN))
  6534. }),
  6535. $("#gui-modes-dollhouse").on("click", function(e) {
  6536. y(e),
  6537. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6538. gui_action: "click_dollhouse_mode_button"
  6539. }),
  6540. t.changeMode(ie.DOLLHOUSE))
  6541. })
  6542. }(0, l),
  6543. function(e, t) {
  6544. $("#play").on("mousedown touchstart", function(e) {
  6545. y(e),
  6546. _e("tour"),
  6547. q.play(),
  6548. R.trackAlways("showcase_gui", {
  6549. gui_action: "play_highlights"
  6550. })
  6551. }),
  6552. window.startAndPlay = function(e) {
  6553. _e("tour"),
  6554. q.play(),
  6555. R.trackAlways("showcase_gui", {
  6556. gui_action: "play_highlights"
  6557. })
  6558. }
  6559. ,
  6560. $("#pause").on("mousedown touchstart", function(e) {
  6561. y(e),
  6562. q.pause(),
  6563. R.trackAlways("showcase_gui", {
  6564. gui_action: "pause_highlights"
  6565. })
  6566. }),
  6567. $("#gui-zoomin").find("a").on("click", function(e) {
  6568. y(e),
  6569. t.player.zoomInIncrementally()
  6570. }),
  6571. $("#gui-zoomout").find("a").on("click", function(e) {
  6572. y(e),
  6573. t.player.zoomOutIncrementally()
  6574. })
  6575. }(0, l),
  6576. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6577. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6578. function() {
  6579. _e("share"),
  6580. V.open(r)
  6581. }
  6582. )),
  6583. K.on(ae.CLOSED, V.reset)),
  6584. 0 < s.heroLocations.length ? function(e, i, t) {
  6585. var n = 100 / (fe = e.heroLocations.length) + "%"
  6586. , r = $("#thumb-container")
  6587. , o = $("#progressBar");
  6588. $("#status").find(".totalSteps").text(fe);
  6589. for (var a = 0; a < fe; a++) {
  6590. var s = e.heroLocations[a]
  6591. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6592. if(s.heroLocations){//有子项,选第一张截图
  6593. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6594. }else{
  6595. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6596. }
  6597. if (l.attr("data-index", a),
  6598. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6599. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6600. s.name) {
  6601. var c = $('<div class="overlay"></div>').text(s.name);
  6602. l.prepend(c)
  6603. }
  6604. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6605. var h = e.panos.get(s.panoId)
  6606. , 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>';
  6607. l.prepend(u)
  6608. }
  6609. r.append(l),
  6610. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6611. }
  6612. T = 144 * fe,
  6613. 111 * fe,
  6614. $(".thumbImg").on("mouseover", function() {
  6615. !function(e) {
  6616. return e.describe().inTransition
  6617. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6618. }),
  6619. $(".thumbImg").on("mouseout", function() {
  6620. i.clearPath()
  6621. }),
  6622. $(".thumbImg").on("click", function(e) {
  6623. y(e);
  6624. var t = $(this);
  6625. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6626. R.trackAlways("showcase_gui", {
  6627. gui_action: "click_highlight"
  6628. }),
  6629. i.goToHighlight([t.data("index"),0])//改
  6630. }),
  6631. $(".previous").find("a").on("click", function(e) {
  6632. y(e),
  6633. R.trackAlways("showcase_gui", {
  6634. gui_action: "prev_highlight"
  6635. }),
  6636. i.prevHighlight()
  6637. }),
  6638. $(".next").find("a").on("click", function(e) {
  6639. y(e),
  6640. R.trackAlways("showcase_gui", {
  6641. gui_action: "next_highlight"
  6642. }),
  6643. i.nextHighlight()
  6644. }),
  6645. $("#drawer").on("mouseleave", function(t) {
  6646. var i;
  6647. y(t);
  6648. try {
  6649. i = new MouseEvent("mouseup",{
  6650. clientX: t.clientX,
  6651. clientY: t.clientY,
  6652. screenX: t.screenX,
  6653. screenY: t.screenY
  6654. })
  6655. } catch (e) {
  6656. (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)
  6657. }
  6658. document.dispatchEvent(i)
  6659. }),
  6660. (w = new Sly($("#scrollFrame"),{
  6661. horizontal: !0,
  6662. itemNav: "centered",
  6663. smart: !0,
  6664. scrollTrap: !0,
  6665. scrollBy: 1,
  6666. mouseDragging: !0,
  6667. touchDragging: !0,
  6668. speed: 300,
  6669. dragHandle: !0,
  6670. dynamicHandle: !0,
  6671. clickBar: !0,
  6672. scrollBar: $("#scroller"),
  6673. activateOn: null
  6674. }).init()).on("active", function(e, t) {
  6675. t,
  6676. _e("tour"),
  6677. $(".step").removeClass("active"),
  6678. $("#status").find(".curIdx").text(t + 1);
  6679. for (var i = 0; i <= t; i++)
  6680. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6681. }),
  6682. E()
  6683. //add :
  6684. let scrollFrame = $(w.frame)
  6685. scrollFrame.on("wheel.sly", function() {
  6686. lastMoveScrollTime = Date.now()
  6687. })
  6688. let dragstart
  6689. /* scrollFrame.on("pointerdown", function() {
  6690. dragstart = true
  6691. })
  6692. scrollFrame.on("pointerup", function() {
  6693. dragstart = false
  6694. }) */
  6695. scrollFrame.on("pointermove", function() {
  6696. //if(dragstart){
  6697. lastMoveScrollTime = Date.now()
  6698. //}
  6699. })
  6700. }(s, l, c) : (Ce.highlight.visible = !1,
  6701. Ce.tourControls.visible = !1),
  6702. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6703. function() {
  6704. var n;
  6705. document.body.addEventListener("mousedown", function(e) {
  6706. n = 0 === e.button || 1 === e.which ? e.target : null
  6707. }, !0),
  6708. document.body.addEventListener("mouseup", function(t) {
  6709. n !== t.target && (n = b(n, t.target));
  6710. var e = document.getElementById("gui-parent");
  6711. if (b(e, n) !== e && (n = null),
  6712. n) {
  6713. var i;
  6714. try {
  6715. i = new MouseEvent("click",t)
  6716. } catch (e) {
  6717. (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)
  6718. }
  6719. i.syntheticClick = !0,
  6720. n.dispatchEvent(i),
  6721. n = null
  6722. }
  6723. }, !0),
  6724. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6725. e.syntheticClick || (e.stopPropagation(),
  6726. "A" === e.target.nodeName && e.preventDefault())
  6727. }, !0)
  6728. }(),
  6729. A(c),
  6730. C(s, t),
  6731. s.on("floor.changed", I),
  6732. s.on("waiting", function(e) {
  6733. _(e)
  6734. }
  6735. .bind(this, s)),
  6736. s.on("waiting-done", function(e) {
  6737. _(e)
  6738. }
  6739. .bind(this, s)),
  6740. c.on(re.ModeChanged, function(e, t) {
  6741. A(c),
  6742. v(l, c),
  6743. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6744. U.updateMode(t)
  6745. }),
  6746. e.on(oe.Move, _e.bind(this, "move")),
  6747. c.on(re.Ready, function() {
  6748. O.init(e, c, c.tagManager, l),
  6749. c.on(re.ModeChanged, function(e, t) {
  6750. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6751. })
  6752. }),
  6753. c.on(re.PanoChosen, function(e, t) {
  6754. A(c, t),
  6755. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6756. }),
  6757. V.on(k.CLOSE, function(e) {
  6758. switch (e) {
  6759. case "vr-modal":
  6760. X.dismiss();
  6761. break;
  6762. case "share-modal":
  6763. K.hide();
  6764. break;
  6765. case "terms-modal":
  6766. W.hide()
  6767. }
  6768. });
  6769. var lastMoveScrollTime = 0;//add
  6770. 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();
  6771. l.on("update.controls", function() {
  6772. var e, t, i, n = l.describe();
  6773. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6774. u.show()),
  6775. n.tourInProgress && (d.forEach(function(e) {
  6776. e.classList.add("playing")
  6777. }),
  6778. p.addClass("playing"),
  6779. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6780. u.hide()),
  6781. n.tourInProgress || (q.stopTour(),
  6782. d.forEach(function(e) {
  6783. e.classList.remove("playing")
  6784. }),
  6785. p.removeClass("playing"),
  6786. f.removeClass("playing"))),
  6787. null !== n.currentItem) {
  6788. var r, o;
  6789. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6790. n.onTheBus ? (r = "active",
  6791. o = "recent") : (o = "active",
  6792. r = "recent");
  6793. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6794. for (e = 0; e < s.heroLocations.length; e += 1)
  6795. i = g.eq(e),
  6796. t = m.eq(e),
  6797. i.removeClass(o),
  6798. t.removeClass(o),
  6799. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6800. t.addClass(r),
  6801. // 如果一段时间内用户不拖拽滚动scroll,才focus回这个item
  6802. (Date.now() - lastMoveScrollTime > 2000) && w.activate(e)
  6803. ): n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6804. t.addClass(r)) : (i.removeClass(r),
  6805. t.removeClass(r))
  6806. } else
  6807. for (e = 0; e < s.heroLocations.length; e += 1)
  6808. i = g.eq(e),
  6809. t = m.eq(e),
  6810. i.removeClass("active recent"),
  6811. t.removeClass("active recent");
  6812. v(l, c)
  6813. }),
  6814. document.addEventListener("keydown", function(e) {
  6815. switch (R.updateInteraction(oe.InteractionKey),
  6816. e.which) {
  6817. case te.ZERO:
  6818. M.debug && s.toggleAlpha();
  6819. break;
  6820. case te.NINE:
  6821. M.debug && B.toggle();
  6822. break;
  6823. case te.ONE:
  6824. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6825. break;
  6826. case te.TWO:
  6827. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6828. break;
  6829. case te.THREE:
  6830. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6831. break;
  6832. case te.FOUR:
  6833. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6834. break;
  6835. case te.SPACE:
  6836. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6837. break;
  6838. case te.RETURN:
  6839. M.debug && s.toggleExplodeUp();
  6840. break;
  6841. case te.P:
  6842. !function(e) {
  6843. me.gui || (me.gui = function(e) {
  6844. var t = new he.GUI;
  6845. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6846. e.setSweepVisibility(M.showSweeps)
  6847. }),
  6848. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6849. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6850. M.transition.flySpeed = 0,
  6851. t.__controllers.forEach(function(e) {
  6852. e.updateDisplay()
  6853. })
  6854. }),
  6855. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6856. $(t.__closeButton).hide(),
  6857. t
  6858. }(me.model)),
  6859. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6860. }(!me.visible);
  6861. break;
  6862. case te.U:
  6863. !function(e) {
  6864. ve.gui || (ve.gui = function(t, i) {
  6865. function e() {
  6866. var e = i.toJSON();
  6867. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6868. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6869. }
  6870. var n = {}
  6871. , r = new he.GUI({
  6872. autoPlace: !0,
  6873. width: "60%"
  6874. });
  6875. return e(),
  6876. i.on(re.ViewChanged, e),
  6877. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6878. r.domElement.id = "datLinks",
  6879. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6880. if (!S.detectSafari()) {
  6881. var t = document.createElement("button");
  6882. t.classList.add("btn-deep-link"),
  6883. t.innerText = se.MENU_COPY,
  6884. e.nextSibling.appendChild(t);
  6885. var n = function() {
  6886. alert(se.LINK_ALERT_COPY),
  6887. t.hide()
  6888. };
  6889. t.addEventListener("click", function(e) {
  6890. try {
  6891. var t = e.target.parentNode.childNodes[0];
  6892. t.select();
  6893. var i = document.execCommand("copy");
  6894. t.blur(),
  6895. i || n()
  6896. } catch (e) {
  6897. n()
  6898. }
  6899. })
  6900. }
  6901. }),
  6902. $(r.__closeButton).hide(),
  6903. r
  6904. }(ve.model, ve.player)),
  6905. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6906. }(!ve.visible);
  6907. break;
  6908. case te.X:
  6909. M.debug && s.toggleExplode();
  6910. break;
  6911. case te.PLUSEQUALS:
  6912. l.player.activatePersistentZooming(!0),
  6913. O.hideUi();
  6914. break;
  6915. case te.DASHUNDERSCORE:
  6916. l.player.activatePersistentZooming(!1),
  6917. O.hideUi();
  6918. break;
  6919. case te.SEVEN:
  6920. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6921. break;
  6922. case te.EIGHT:
  6923. l.player.decreaseZoomSpeed();
  6924. break;
  6925. case te.NINE:
  6926. l.player.increaseZoomSpeed()
  6927. }
  6928. return c && c.reticule.hide(),
  6929. !0
  6930. }
  6931. .bind(this)),
  6932. document.addEventListener("keyup", function(e) {
  6933. switch (e.which) {
  6934. case te.PLUSEQUALS:
  6935. l.player.deactivatePersistentZooming();
  6936. break;
  6937. case te.DASHUNDERSCORE:
  6938. l.player.deactivatePersistentZooming()
  6939. }
  6940. }
  6941. .bind(this)),
  6942. function(e) {
  6943. me = {
  6944. gui: null,
  6945. visible: !1,
  6946. model: e
  6947. }
  6948. }(s),
  6949. function(e, t) {
  6950. ve = {
  6951. gui: null,
  6952. visible: !1,
  6953. model: e,
  6954. player: t
  6955. }
  6956. }(s, l.player),
  6957. function(e) {
  6958. function t(e, i) {
  6959. $(e).find("a").each(function(e, t) {
  6960. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6961. t.style.pointerEvents = i ? "auto" : "none"
  6962. })
  6963. }
  6964. e.on(de.ZoomMax, function() {
  6965. t("#gui-zoomin", !1),
  6966. t("#gui-zoomout", !0)
  6967. }),
  6968. e.on(de.ZoomMin, function() {
  6969. t("#gui-zoomin", !0),
  6970. t("#gui-zoomout", !1)
  6971. }),
  6972. e.on(de.ZoomIn, function() {
  6973. t("#gui-zoomout", !0)
  6974. }),
  6975. e.on(de.ZoomOut, function() {
  6976. t("#gui-zoomin", !0)
  6977. }),
  6978. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6979. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6980. }(c),
  6981. P.setAutoPlay(s.heroCount()),
  6982. U.init(c, i.mode),
  6983. U.on(H.OPENED, _e.bind(this, "help")),
  6984. W.init(),
  6985. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6986. function() {
  6987. _e("terms"),
  6988. V.open(o)
  6989. }
  6990. )),
  6991. W.on(j.CLOSED, V.reset),
  6992. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6993. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6994. M.profiling.enabled && B.show(),
  6995. q.init(l)
  6996. }
  6997. ,
  6998. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6999. function a() {
  7000. o.setLoadingStartTime(),
  7001. function() {
  7002. function e(e) {
  7003. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7004. }
  7005. $("body").css("touch-action", "none"),
  7006. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7007. var t = document.getElementById("terms-text")
  7008. , i = document.getElementById("more-help-wrapper")
  7009. , n = (document.getElementById("navigation-help-wrapper"),
  7010. document.getElementById("help-dialog"),
  7011. document.getElementById("tag-billboards"));
  7012. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7013. passive: !1
  7014. }),
  7015. document.body.addEventListener("DOMMouseScroll", e)),
  7016. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7017. e.stopPropagation()
  7018. })
  7019. }(),
  7020. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7021. l()) : function(e) {
  7022. L.show(e),
  7023. c()
  7024. }(l)
  7025. }
  7026. var s = $.Deferred()
  7027. , l = s.resolve.bind(s);
  7028. ye = !0,
  7029. _(e);
  7030. e.data.player_options && function(e) {
  7031. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7032. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7033. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7034. }(e.data.player_options),
  7035. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7036. se.localizeGUI();
  7037. !function(i) {
  7038. function e(e, t) {
  7039. return !!i.player_options[e] && i[t || e]
  7040. }
  7041. $(".model-title").text(i.name);
  7042. var t = M.pageTitle;
  7043. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7044. document.title = t,
  7045. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7046. delay: {
  7047. show: 50,
  7048. hide: 0
  7049. },
  7050. trigger: "hover",
  7051. html: !1,
  7052. viewport: {
  7053. selector: "body",
  7054. padding: 10
  7055. }
  7056. }),
  7057. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7058. z.populate({
  7059. name: e("model_name", "name"),
  7060. coBrand: e("presented_by"),
  7061. description: e("model_summary", "summary") || "暂无内容",
  7062. contactName: e("contact_name"),
  7063. address: e("address"),
  7064. phone: e("contact_phone"),
  7065. formattedPhone: i.formatted_contact_phone,
  7066. email: e("contact_email"),
  7067. url: e("external_url"),
  7068. socialSharing: i.enable_social_sharing && i.is_public
  7069. })
  7070. }(e.data);
  7071. r || $(".quick").addClass("hidden");
  7072. n ? (R.impression(),
  7073. a()) : (o.setWaitingStartTime(),
  7074. N.show(r, a))
  7075. return s
  7076. }
  7077. ,
  7078. Le.exports.endLoading = function(e, t, i) {
  7079. var n = t.player;
  7080. function r() {
  7081. i.dismissExaminedTag(),
  7082. i.disableHovering()
  7083. }
  7084. $("#gui-thumb").fadeOut(2500),
  7085. L.hide(function() {
  7086. ye = !1
  7087. }),
  7088. Y.init(e, i),
  7089. z.finishSetup(Object.keys(e.tags).length),
  7090. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7091. X.on(Z.OPENED, r),
  7092. K.on(ae.OPENED, r),
  7093. U.on(H.OPENED, r),
  7094. W.on(j.OPENED, r);
  7095. var o = i.enableHovering.bind(i);
  7096. if (X.on(Z.CLOSED, o),
  7097. K.on(ae.CLOSED, o),
  7098. U.on(H.CLOSED, o),
  7099. W.on(j.CLOSED, o),
  7100. M.labels.enabled && Object.keys(e.labels).length,
  7101. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7102. I(e.currentFloor, n.mode)),
  7103. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7104. h(e, t)),
  7105. c(),
  7106. v(t, t.player),
  7107. $("#gui").fadeIn(1500),
  7108. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7109. l(),
  7110. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7111. }, 2e3),
  7112. !S.isMobile())
  7113. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7114. $(a[s]).addClass("hasHover");
  7115. _(e),
  7116. z.setupToggling(),
  7117. window.editHotPanel && editHotPanel(),
  7118. function() {
  7119. var i = $("#pullTab")
  7120. , e = {
  7121. bottom: {
  7122. "border-bottom-left-radius": "10px",
  7123. "border-bottom-right-radius": "10px"
  7124. },
  7125. top: {
  7126. "border-top-left-radius": "10px",
  7127. "border-top-right-radius": "10px"
  7128. }
  7129. }
  7130. , t = {
  7131. bottom: {
  7132. "border-top-right-radius": "10px",
  7133. "border-bottom-right-radius": "10px"
  7134. },
  7135. top: {
  7136. "border-bottom-left-radius": "10px",
  7137. "border-top-left-radius": "10px"
  7138. }
  7139. };
  7140. function n(e, t) {
  7141. $("#gui-modes-map > div:visible:last").css(e),
  7142. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7143. }
  7144. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7145. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7146. }()
  7147. $(".toolRight a").removeClass('hasHover')
  7148. }
  7149. ,
  7150. Le.exports.onProgress = function(e) {
  7151. L.progress(e)
  7152. }
  7153. }
  7154. ).call(this, "/js/gui/gui.js")
  7155. }
  7156. , {
  7157. "../analytics": 4,
  7158. "../controls/serializer": 14,
  7159. "../enum/AlignmentType": 17,
  7160. "../enum/BlackoutStyle": 18,
  7161. "../enum/ControlEvents": 21,
  7162. "../enum/DirectorEvents": 23,
  7163. "../enum/Keys": 30,
  7164. "../enum/PathDiscardMode": 38,
  7165. "../enum/PathDisplayMode": 39,
  7166. "../enum/PlayerEvents": 40,
  7167. "../enum/VROption": 47,
  7168. "../enum/Vectors": 50,
  7169. "../enum/Viewmode": 51,
  7170. "../enum/WarpStyle": 52,
  7171. "../enum/ZoomEvents": 53,
  7172. "../lib/dat.gui": 93,
  7173. "../localization/localize": 108,
  7174. "../tag/Media/MediaEvent": 131,
  7175. "../objects/Snapshot": 153,
  7176. "../settings": 166,
  7177. "../util/ajax": 181,
  7178. "../util/browser": 182,
  7179. "../util/camera": 183,
  7180. "../util/logger": 189,
  7181. "../util/showcase": 193,
  7182. "../util/transitions": 195,
  7183. "./closer/ModalCloserEvent": 61,
  7184. "./closer/modalCloser": 62,
  7185. "./help/HelpEvent": 66,
  7186. "./help/help": 67,
  7187. "./helpManager": 68,
  7188. "./immersiveMode": 69,
  7189. "./konami": 70,
  7190. "./landingScreen": 71,
  7191. "./loadingScreen": 72,
  7192. "./memoryUsage": 73,
  7193. "./playButton": 74,
  7194. "./populateModal": 75,
  7195. "./sharing/ShareEvents": 76,
  7196. "./sharing/modal": 77,
  7197. "./terms/TermsEvent": 78,
  7198. "./terms/terms": 79,
  7199. "./title/TitleEvents": 80,
  7200. "./title/tagToggle": 81,
  7201. "./title/titleBar": 82,
  7202. "./tourInteraction": 84,
  7203. "./vr/vrEvent": 85,
  7204. "./vr/vrModal": 87,
  7205. "./webvr/WebVrEvent": 88,
  7206. "./webvr/webVRgui": 89,
  7207. three: 217
  7208. }],
  7209. 66: [function(e, t, i) {
  7210. "use strict";
  7211. t.exports = Object.freeze({
  7212. OPENED: "help.opened",
  7213. CLOSED: "help.closed"
  7214. })
  7215. }
  7216. , {}],
  7217. 67: [function(e, t, i) {
  7218. "use strict";
  7219. function n() {
  7220. p.on("click", function(e) {
  7221. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7222. setTimeout(function() {
  7223. x = !1
  7224. }, h.help.modalStayDuration),
  7225. S.emit(l.OPENED),
  7226. f.addClass("open " + T),
  7227. p.addClass("open"),
  7228. o(),
  7229. r(),
  7230. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7231. v.classList.add("fadeIn")))
  7232. }),
  7233. E.on("click", function(e) {
  7234. S.close()
  7235. }),
  7236. C.on("click", function(e) {
  7237. T && T !== a.TRANSITIONING && (o(),
  7238. r())
  7239. }),
  7240. I.on("click", function(e) {
  7241. o(),
  7242. I.addClass("underline-tab"),
  7243. c.fill(b, s.MORE_HELP),
  7244. f.addClass("more-help")
  7245. })
  7246. }
  7247. function r() {
  7248. C.addClass("underline-tab"),
  7249. c.fill(_, s.NAVIGATION, T),
  7250. f.addClass(T)
  7251. }
  7252. function o() {
  7253. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7254. A.forEach(function(e) {
  7255. e.classList.remove("underline-tab")
  7256. })
  7257. }
  7258. var a = e("../../enum/Viewmode")
  7259. , s = e("../../enum/HelpModalType")
  7260. , l = e("./HelpEvent")
  7261. , c = (e("../helpManager"),
  7262. e("./../populateModal"))
  7263. , h = e("../../settings")
  7264. , u = e("../../util/common")
  7265. , d = e("events").EventEmitter
  7266. , p = $(".footer-help").eq(0)
  7267. , f = $("#help-dialog").eq(0)
  7268. , g = document.querySelector("#quick-logo")
  7269. , m = document.querySelector("#loaderCoBrand")
  7270. , v = document.querySelector("#help-dialog")
  7271. , y = document.querySelector(".footer")
  7272. , A = $(".help-tabs").children().toArray()
  7273. , C = $(".navigation-tab").eq(0)
  7274. , I = $(".more-help-tab").eq(0)
  7275. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7276. f.find(".close").eq(0))
  7277. , _ = f.find(".interactions").toArray()
  7278. , b = f.find(".ui-instructions").toArray()
  7279. , w = a.PANORAMA
  7280. , T = a.PANORAMA
  7281. , x = !1
  7282. , S = {
  7283. init: function(e, t) {
  7284. w = T = t,
  7285. [v, m, g, y].forEach(function(e) {
  7286. e.classList.add(c.deviceType)
  7287. }),
  7288. n()
  7289. },
  7290. close: function() {
  7291. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7292. p.removeClass("open"),
  7293. f.removeClass("open"),
  7294. v.classList.contains("fadeIn"))) {
  7295. v.classList.remove("fadeIn");
  7296. var e = T === a.TRANSITIONING ? w : T;
  7297. c.clear(_, s.NAVIGATION, e)
  7298. }
  7299. },
  7300. updateMode: function(e) {
  7301. w = T,
  7302. T = e
  7303. }
  7304. };
  7305. u.extendObject(S, d.prototype),
  7306. t.exports = S
  7307. }
  7308. , {
  7309. "../../enum/HelpModalType": 28,
  7310. "../../enum/Viewmode": 51,
  7311. "../../settings": 166,
  7312. "../../util/common": 185,
  7313. "../helpManager": 68,
  7314. "./../populateModal": 75,
  7315. "./HelpEvent": 66,
  7316. events: 202
  7317. }],
  7318. 68: [function(s, l, e) {
  7319. (function(e) {
  7320. "use strict";
  7321. var t = s("../util/browser")
  7322. , i = s("./../util/logger")
  7323. , n = s("./../settings")
  7324. , r = new i(e)
  7325. , o = function() {
  7326. var t;
  7327. try {
  7328. return t = window.localStorage.getItem("visitCount") || "0",
  7329. t = (parseFloat(t) + 1).toString(),
  7330. window.localStorage.setItem("visitCount", t),
  7331. r.debug("visitCount = " + t),
  7332. t
  7333. } catch (e) {
  7334. t = "1",
  7335. r.debug("couldn't set local storage")
  7336. }
  7337. }()
  7338. , a = !1;
  7339. l.exports = {
  7340. isHelpDisabled: function() {
  7341. return "0" === t.valueFromHash("help", null) || a
  7342. },
  7343. isLargeHelpEnabled: function() {
  7344. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7345. },
  7346. isSmallHelpEnabled: function() {
  7347. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7348. },
  7349. isHelpEnabled: function() {
  7350. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7351. },
  7352. setAutoPlay: function(e) {
  7353. a = 0 <= n.warp.auto && 1 < e
  7354. }
  7355. }
  7356. }
  7357. ).call(this, "/js/gui/helpManager.js")
  7358. }
  7359. , {
  7360. "../util/browser": 182,
  7361. "./../settings": 166,
  7362. "./../util/logger": 189
  7363. }],
  7364. 69: [function(e, t, i) {
  7365. "use strict";
  7366. function r(e) {
  7367. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7368. T = !0,
  7369. h.close(),
  7370. function(e) {
  7371. !n(e) && S ? v.forEach(function(e) {
  7372. e.classList.remove("drawerOpen"),
  7373. e.classList.add("duringTour")
  7374. }) : C.hasClass("open") ? v.forEach(function(e) {
  7375. e.classList.remove("duringTour"),
  7376. e.classList.add("drawerOpen")
  7377. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7378. e.classList.add("fadeOut")
  7379. })
  7380. }(e),
  7381. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7382. C.hasClass("playing") || (y.forEach(function(e) {
  7383. e.classList.add("detectHover")
  7384. }),
  7385. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7386. }
  7387. function o() {
  7388. C.hasClass("playing") || (clearTimeout(x),
  7389. x = setTimeout(a, c.immersive.timeToShowAgain))
  7390. }
  7391. function a() {
  7392. clearTimeout(x),
  7393. T = !1,
  7394. m.forEach(function(e) {
  7395. e.classList.remove("drawerOpen")
  7396. }),
  7397. S || v.forEach(function(e) {
  7398. e.classList.remove("duringTour")
  7399. }),
  7400. y.forEach(function(e) {
  7401. e.classList.remove("detectHover")
  7402. })
  7403. }
  7404. function s() {
  7405. T ? a() : r(),
  7406. M = !0,
  7407. setTimeout(function() {
  7408. M = !1
  7409. }, c.immersive.uiStayDuration)
  7410. }
  7411. function n(e) {
  7412. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7413. }
  7414. var l = e("../util/browser")
  7415. , c = e("../settings")
  7416. , h = e("./help/help")
  7417. , u = e("../enum/tagEvents")
  7418. , d = e("../enum/ControlEvents")
  7419. , p = e("../enum/PlayerEvents")
  7420. , f = e("../enum/DirectorEvents")
  7421. , g = (p = e("../enum/PlayerEvents"),
  7422. e("../enum/Viewmode"))
  7423. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7424. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7425. , y = $("#hover-bottom, #hover-top").toArray()
  7426. , A = ($("#pullTab").eq(0),
  7427. $("#playHead").eq(0),
  7428. $(".pinBottom-container").eq(0))
  7429. , C = $("#drawer").eq(0)
  7430. , I = $("#drawer-container").eq(0)
  7431. , E = $("#meta-info").eq(0)
  7432. , _ = $(".pinTop.left").eq(0)
  7433. , b = $("#player").eq(0)
  7434. , w = document.getElementById("pullTab")
  7435. , T = !1
  7436. , x = null
  7437. , S = !1
  7438. , M = !1
  7439. , R = null
  7440. , P = !1;
  7441. t.exports.init = function(e, t, i, n) {
  7442. (function(t, i, e, n) {
  7443. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7444. t.controls[e].on(d.Move, r),
  7445. t.controls[e].on(d.LongTap, s)
  7446. }),
  7447. b.on("mousewheel DOMMouseScroll", r),
  7448. e.on(u.TagActivated, r),
  7449. e.on(u.TagNavigation, r),
  7450. i.on(p.FlyingEnded, o),
  7451. i.on(p.ModeChanging, function(e, t) {
  7452. P = t !== g.PANORAMA && e !== g.PANORAMA
  7453. }),
  7454. i.on(p.ModeChanged, function(e, t) {
  7455. R = i.mode,
  7456. t !== g.TRANSITIONING ? a() : r("modeChange")
  7457. }),
  7458. n.on(f.TourStart, function() {
  7459. S = !0,
  7460. r()
  7461. }),
  7462. n.on(f.TourEnd, function() {
  7463. S = !1,
  7464. a()
  7465. }),
  7466. n.on(f.ActionInterrupted, function() {
  7467. S = !1
  7468. }),
  7469. w.addEventListener("touchend", function() {
  7470. $("#pullTab").hasClass("opened") && !S && a()
  7471. }, !0)
  7472. }
  7473. )(e, t, i, n),
  7474. l.isMobile() ? (y.forEach(function(e) {
  7475. e.classList.add("mobile")
  7476. }),
  7477. A.click(a)) : (y.forEach(function(e) {
  7478. e.addEventListener("mouseleave", function() {
  7479. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7480. }, !0)
  7481. }),
  7482. b.mouseleave(function() {
  7483. y[0].classList.contains("detectHover") && a()
  7484. })),
  7485. R = t.mode
  7486. }
  7487. ,
  7488. t.exports.hideUi = r,
  7489. t.exports.resetDrawer = function() {
  7490. I.hasClass("duringTour") || (S = !1,
  7491. r("gui"),
  7492. a())
  7493. }
  7494. }
  7495. , {
  7496. "../enum/ControlEvents": 21,
  7497. "../enum/DirectorEvents": 23,
  7498. "../enum/tagEvents": 32,
  7499. "../enum/PlayerEvents": 40,
  7500. "../enum/Viewmode": 51,
  7501. "../settings": 166,
  7502. "../util/browser": 182,
  7503. "./help/help": 67
  7504. }],
  7505. 70: [function(i, n, e) {
  7506. (function(e) {
  7507. "use strict";
  7508. var t = i("./../util/logger")
  7509. , o = i("./../settings")
  7510. , a = i("./debug")
  7511. , s = i("./../util/common")
  7512. , l = (i("./gui"),
  7513. new t(e));
  7514. o.console && $("body").append('<div id="debug-console"></div>'),
  7515. n.exports.init = function(i, n, r) {
  7516. l.debug("konami has the modelInstance");
  7517. var t = [];
  7518. $(window).on("keydown", function(e) {
  7519. t.push(e.which),
  7520. t.length > o.secretPanelWord.length && t.shift(),
  7521. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7522. o.debug = !0)
  7523. }),
  7524. $(window).on("keydown", function e(t) {
  7525. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7526. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7527. })
  7528. }
  7529. }
  7530. ).call(this, "/js/gui/konami.js")
  7531. }
  7532. , {
  7533. "./../settings": 166,
  7534. "./../util/common": 185,
  7535. "./../util/logger": 189,
  7536. "./debug": 63,
  7537. "./gui": 65
  7538. }],
  7539. 71: [function(e, t, i) {
  7540. "use strict";
  7541. function r() {
  7542. s.clear(m, l.LANDING[v]),
  7543. g.removeClass("fadeIn")
  7544. }
  7545. var o = e("../settings")
  7546. , a = (e("./help/help"),
  7547. e("./helpManager"))
  7548. , s = e("./populateModal")
  7549. , l = e("../enum/HelpModalType")
  7550. , n = e("../enum/Viewmode")
  7551. , c = e("../enum/DirectorEvents")
  7552. , h = e("../enum/PlayerEvents")
  7553. , u = $("#quick-blackout").eq(0)
  7554. , d = $("#quick-logo").eq(0)
  7555. , p = $(".quick-brand").toArray()
  7556. , f = $("#loaderCoBrand").eq(0)
  7557. , g = $("#interaction-modal").eq(0)
  7558. , m = g.find(".interaction").toArray()
  7559. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7560. "");
  7561. t.exports.delayLanding = function(e) {
  7562. var t = $.Deferred();
  7563. e || t.resolve();
  7564. var i = o.startupFlyinDelay;
  7565. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7566. setTimeout(t.resolve.bind(t), i),
  7567. t
  7568. }
  7569. ,
  7570. t.exports.showMessage = function(e, t, i) {
  7571. var n = 0;
  7572. o.quickstart.enabled && (function(e) {
  7573. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7574. d.before(f),
  7575. p = $(".quick-brand").toArray()), */
  7576. u.addClass("fadeOut")
  7577. /* setTimeout(function() {
  7578. p.forEach(function(e) {
  7579. e.classList.add("fadeIn")
  7580. })
  7581. }, o.quickstart.showTextDelay),
  7582. setTimeout(function() {
  7583. p.forEach(function(e) {
  7584. e.classList.add("fadeOut")
  7585. })
  7586. }, o.quickstart.fadeOutDelay) */
  7587. }(i),
  7588. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7589. function(e, t) {
  7590. setTimeout(function() {
  7591. if (a.isHelpEnabled()) {
  7592. if (t(),
  7593. s.init(),
  7594. g.addClass("fadeIn landing " + s.deviceType),
  7595. a.isSmallHelpEnabled())
  7596. return void g.addClass("small");
  7597. s.fill(m, l.LANDING[v]),
  7598. g.addClass(v)
  7599. }
  7600. }, e);
  7601. var i = {
  7602. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7603. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7604. }
  7605. , n = $(".nav-icon .icon");
  7606. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7607. function r(e) {
  7608. e.on("click", function() {
  7609. var e = null;
  7610. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7611. i.length < e || e < 1)
  7612. return !1;
  7613. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7614. "data-page": e,
  7615. src: i.mobile[e - 1]
  7616. }) : n.attr({
  7617. "data-page": e,
  7618. src: i.pc[e - 1]
  7619. })
  7620. })
  7621. }
  7622. r($(".next-button")),
  7623. r($(".prev-button"))
  7624. }(n, function() {
  7625. e.once(h.Move, r),
  7626. t.once(c.TourStart, r)
  7627. })
  7628. }
  7629. ,
  7630. t.exports.init = function(e, t) {
  7631. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7632. }
  7633. ,
  7634. t.exports.dismissModal = r
  7635. }
  7636. , {
  7637. "../enum/DirectorEvents": 23,
  7638. "../enum/HelpModalType": 28,
  7639. "../enum/PlayerEvents": 40,
  7640. "../enum/Viewmode": 51,
  7641. "../settings": 166,
  7642. "./help/help": 67,
  7643. "./helpManager": 68,
  7644. "./populateModal": 75
  7645. }],
  7646. 72: [function(e, t, i) {
  7647. "use strict";
  7648. var n = e("./circleLoader").circleLoader;
  7649. t.exports = {
  7650. element: $("#gui-loading"),
  7651. hide: function(e) {
  7652. n.done(),
  7653. this.element.fadeOut(1500, e)
  7654. },
  7655. show: function(e) {
  7656. this.element.fadeIn(500, function() {
  7657. this.element.css("display", "table"),
  7658. e && e()
  7659. }
  7660. .bind(this))
  7661. },
  7662. progress: function(e) {
  7663. n.set(e)
  7664. }
  7665. }
  7666. }
  7667. , {
  7668. "./circleLoader": 60
  7669. }],
  7670. 73: [function(e, t, i) {
  7671. "use strict";
  7672. var n = e("../settings")
  7673. , r = $("#memory-info")
  7674. , o = r.find("#memory-gpu")
  7675. , a = !1;
  7676. t.exports = {
  7677. show: function() {
  7678. n.profiling.enabled && (r.show(),
  7679. a = !0)
  7680. },
  7681. hide: function() {
  7682. r.hide(),
  7683. a = !1
  7684. },
  7685. toggle: function() {
  7686. a ? this.hide() : this.show()
  7687. },
  7688. update: function(e) {
  7689. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7690. }
  7691. }
  7692. }
  7693. , {
  7694. "../settings": 166
  7695. }],
  7696. 74: [function(e, t, i) {
  7697. "use strict";
  7698. e("../util/browser"),
  7699. e("../analytics");
  7700. e("../settings"),
  7701. t.exports = {
  7702. show: function(e, t) {
  7703. $("#gui-message").fadeOut(500, function() {
  7704. t()
  7705. })
  7706. }
  7707. }
  7708. }
  7709. , {
  7710. "../analytics": 4,
  7711. "../settings": 166,
  7712. "../util/browser": 182
  7713. }],
  7714. 75: [function(e, t, i) {
  7715. "use strict";
  7716. function n(e, t, i, n) {
  7717. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7718. }
  7719. var r = e("../util/browser")
  7720. , o = e("../localization/localize")
  7721. , a = e("../enum/HelpModalType")
  7722. , s = (e("../enum/HelpModalSize"),
  7723. e("../enum/Viewmode"));
  7724. t.exports = {
  7725. init: function() {
  7726. if (!this.hasInitialized) {
  7727. this.hasInitialized = !0,
  7728. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7729. this.assets = {},
  7730. this.assets[a.LANDING[s.PANORAMA]] = {
  7731. desktop: {
  7732. left: {
  7733. "top-info": o.ROTATE,
  7734. "big-image": "images/nav_help_mouse_drag_left.png",
  7735. keyboard: "images/nav_help_keyboard_left_right.png"
  7736. },
  7737. middle: {
  7738. "top-info": o.MOVE,
  7739. "big-image": "images/nav_help_mouse_click.png",
  7740. keyboard: "images/nav_help_keyboard_up_down.png"
  7741. },
  7742. right: {
  7743. "top-info": o.ZOOM,
  7744. "big-image": "images/nav_help_mouse_zoom.png",
  7745. keyboard: "images/nav_help_zoom_keys.png"
  7746. }
  7747. },
  7748. mobile: {
  7749. left: {
  7750. "top-info": o.ROTATE,
  7751. "big-image": "images/nav_help_gesture_drag.png"
  7752. },
  7753. middle: {
  7754. "top-info": o.MOVE,
  7755. "big-image": "images/nav_help_gesture_tap.png"
  7756. },
  7757. right: {
  7758. "top-info": o.ZOOM,
  7759. "big-image": "images/nav_help_gesture_pinch.png"
  7760. }
  7761. }
  7762. },
  7763. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7764. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7765. desktop: {
  7766. left: {
  7767. "top-info": o.ROTATE,
  7768. "big-image": "images/nav_help_mouse_drag_left.png",
  7769. keyboard: "images/nav_help_keyboard_left_right.png"
  7770. },
  7771. middle: {
  7772. "top-info": o.MOVE,
  7773. "big-image": "images/nav_help_mouse_position_right.png"
  7774. }
  7775. },
  7776. mobile: {
  7777. left: {
  7778. "top-info": o.ROTATE,
  7779. "big-image": "images/nav_help_gesture_drag.png"
  7780. },
  7781. middle: {
  7782. "top-info": o.MOVE,
  7783. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7784. }
  7785. }
  7786. },
  7787. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7788. desktop: {
  7789. left: {
  7790. "top-info": o.MOVE,
  7791. "big-image": "images/nav_help_mouse_position_left.png"
  7792. },
  7793. middle: {
  7794. "top-info": o.ROTATE,
  7795. "big-image": "images/nav_help_mouse_drag_right.png",
  7796. keyboard: "images/nav_help_keyboard_left_right.png"
  7797. }
  7798. },
  7799. mobile: {
  7800. left: {
  7801. "top-info": o.MOVE,
  7802. "big-image": "images/nav_help_gesture_position.png"
  7803. },
  7804. middle: {
  7805. "top-info": o.ROTATE,
  7806. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7807. }
  7808. }
  7809. };
  7810. var e = {
  7811. "top-info": o.INSIDE,
  7812. "big-image": "images/nav_help_click_inside.png",
  7813. keyboard: "images/nav_help_inside_key.png"
  7814. };
  7815. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7816. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7817. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7818. var t = {
  7819. "top-info": o.INSIDE,
  7820. "big-image": "images/nav_help_tap_inside.png"
  7821. };
  7822. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7823. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7824. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7825. this.assets[a.NAVIGATION] = {},
  7826. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7827. desktop: {
  7828. left: {
  7829. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7830. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7831. "big-image": "images/nav_help_mouse_drag_left.png",
  7832. keyboard: "images/nav_help_keyboard_left_right.png"
  7833. },
  7834. middle: {
  7835. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7836. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7837. "big-image": "images/nav_help_mouse_click.png",
  7838. keyboard: "images/nav_help_keyboard_up_down.png"
  7839. },
  7840. right: {
  7841. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7842. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7843. "big-image": "images/nav_help_mouse_zoom.png",
  7844. keyboard: "images/nav_help_zoom_keys.png"
  7845. }
  7846. },
  7847. mobile: {
  7848. left: {
  7849. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7850. "big-image": "images/nav_help_gesture_drag.png"
  7851. },
  7852. middle: {
  7853. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7854. "big-image": "images/nav_help_gesture_tap.png"
  7855. },
  7856. right: {
  7857. "top-info": o.HELP_MOBILE_3,
  7858. "big-image": "images/nav_help_gesture_pinch.png"
  7859. }
  7860. }
  7861. },
  7862. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7863. desktop: {
  7864. left: {
  7865. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7866. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7867. "big-image": "images/nav_help_mouse_drag_left.png",
  7868. keyboard: "images/nav_help_keyboard_all.png"
  7869. },
  7870. middle: {
  7871. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7872. "big-image": "images/nav_help_mouse_position_right.png"
  7873. },
  7874. right: {
  7875. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7876. "big-image": "images/nav_help_mouse_zoom.png"
  7877. }
  7878. },
  7879. mobile: {
  7880. left: {
  7881. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7882. "big-image": "images/nav_help_gesture_drag.png"
  7883. },
  7884. middle: {
  7885. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7886. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7887. },
  7888. right: {
  7889. "top-info": o.HELP_MOBILE_3,
  7890. "big-image": "images/nav_help_gesture_pinch.png"
  7891. }
  7892. }
  7893. },
  7894. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7895. desktop: {
  7896. left: {
  7897. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7898. "big-image": "images/nav_help_mouse_position_left.png"
  7899. },
  7900. middle: {
  7901. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7902. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7903. "big-image": "images/nav_help_mouse_drag_right.png",
  7904. keyboard: "images/nav_help_keyboard_left_right.png"
  7905. },
  7906. right: {
  7907. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7908. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7909. "big-image": "images/nav_help_mouse_zoom.png",
  7910. keyboard: "images/nav_help_keyboard_up_down.png"
  7911. }
  7912. },
  7913. mobile: {
  7914. left: {
  7915. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7916. "big-image": "images/nav_help_gesture_position.png"
  7917. },
  7918. middle: {
  7919. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7920. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7921. },
  7922. right: {
  7923. "top-info": o.HELP_MOBILE_3,
  7924. "big-image": "images/nav_help_gesture_pinch.png"
  7925. }
  7926. }
  7927. },
  7928. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7929. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7930. "top-info": o.HELP_DESKTOP_360_2A,
  7931. "bottom-info": o.HELP_DESKTOP_360_2B,
  7932. "big-image": "images/nav_help_click_inside.png",
  7933. keyboard: "images/nav_help_inside_key.png"
  7934. },
  7935. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7936. "top-info": o.HELP_MOBILE_360_2,
  7937. "big-image": "images/nav_help_tap_inside.png"
  7938. },
  7939. this.assets[a.MORE_HELP] = {
  7940. desktop: {
  7941. "more-help-hlr": {
  7942. "top-info": o.HELP_MORE_HLR_A,
  7943. "big-image": "images/nav_help_expand.svg",
  7944. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7945. },
  7946. "more-help-dollhouse": {
  7947. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7948. "big-image": "images/nav_help_dollhouse.svg",
  7949. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7950. },
  7951. "more-help-floors": {
  7952. "top-info": o.HELP_MORE_FLOORS_A,
  7953. "big-image": "images/nav_help_floor picker.svg",
  7954. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7955. },
  7956. "more-help-tag": {
  7957. "top-info": o.HELP_MORE_TAG_A,
  7958. "big-image": "images/nav_help_tag.svg",
  7959. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7960. },
  7961. "more-help-zoom": {
  7962. "top-info": o.HELP_MORE_ZOOM_A,
  7963. "big-image": "images/nav_help_zoom.svg",
  7964. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7965. },
  7966. "more-help-tour": {
  7967. "top-info": o.HELP_MORE_TOUR_A,
  7968. "big-image": "images/nav_help_play.png",
  7969. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7970. },
  7971. "more-help-inside": {
  7972. "top-info": o.HELP_MORE_INSIDE_A,
  7973. "big-image": "images/nav_help_inside.svg",
  7974. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7975. },
  7976. "more-help-vr": {
  7977. "top-info": o.HELP_MORE_VR_A,
  7978. "big-image": "images/nav_help_vr.svg",
  7979. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7980. },
  7981. "more-help-360": {
  7982. "top-info": o.HELP_MORE_360_A,
  7983. "big-image": "images/nav_help_360.svg",
  7984. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7985. },
  7986. "more-help-fullscreen": {
  7987. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7988. "big-image": "images/nav_help_fullscreen.svg",
  7989. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7990. }
  7991. },
  7992. mobile: {
  7993. "more-help-hlr": {
  7994. "top-info": o.HELP_MORE_HLR_A,
  7995. "big-image": "images/nav_help_expand.svg",
  7996. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7997. },
  7998. "more-help-dollhouse": {
  7999. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8000. "big-image": "images/nav_help_dollhouse.svg",
  8001. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8002. },
  8003. "more-help-floors": {
  8004. "top-info": o.HELP_MORE_FLOORS_A,
  8005. "big-image": "images/nav_help_floor picker.svg",
  8006. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8007. },
  8008. "more-help-tag": {
  8009. "top-info": o.HELP_MORE_TAG_A,
  8010. "big-image": "images/nav_help_tag.svg",
  8011. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8012. },
  8013. "more-help-tour": {
  8014. "top-info": o.HELP_MORE_TOUR_A,
  8015. "big-image": "images/nav_help_play.png",
  8016. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8017. },
  8018. "more-help-inside": {
  8019. "top-info": o.HELP_MORE_INSIDE_A,
  8020. "big-image": "images/nav_help_inside.svg",
  8021. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8022. },
  8023. "more-help-vr": {
  8024. "top-info": o.HELP_MORE_VR_A,
  8025. "big-image": "images/webvr.svg",
  8026. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8027. },
  8028. "more-help-360": {
  8029. "top-info": o.HELP_MORE_360_A,
  8030. "big-image": "images/nav_help_360.svg",
  8031. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8032. }
  8033. }
  8034. },
  8035. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8036. desktop: {
  8037. left: {
  8038. "top-info": o.ROTATE,
  8039. "big-image": "images/nav_help_mouse_drag_left.png",
  8040. keyboard: "images/nav_help_keyboard_left_right.png"
  8041. },
  8042. middle: {
  8043. "top-info": o.MOVE,
  8044. "big-image": "images/nav_help_mouse_click.png",
  8045. keyboard: "images/nav_help_keyboard_up_down.png"
  8046. },
  8047. right: {
  8048. "top-info": o.PLAY,
  8049. "big-image": "images/Desktop-help-play-button.svg",
  8050. keyboard: "images/Desktop-help-spacebar-2.svg"
  8051. }
  8052. },
  8053. mobile: {
  8054. left: {
  8055. "top-info": o.ROTATE,
  8056. "big-image": "images/nav_help_gesture_drag.png"
  8057. },
  8058. middle: {
  8059. "top-info": o.MOVE,
  8060. "big-image": "images/nav_help_gesture_tap.png"
  8061. },
  8062. right: {
  8063. "top-info": o.PLAY,
  8064. "big-image": "images/mobile-help-play-button.svg"
  8065. }
  8066. }
  8067. },
  8068. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8069. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8070. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8071. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8072. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8073. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8074. }
  8075. },
  8076. fill: function(e, t, i) {
  8077. n.call(this, e, t, i, !0)
  8078. },
  8079. clear: function(e, t, i) {
  8080. n.call(this, e, t, i, !1)
  8081. }
  8082. }
  8083. }
  8084. , {
  8085. "../enum/HelpModalSize": 27,
  8086. "../enum/HelpModalType": 28,
  8087. "../enum/Viewmode": 51,
  8088. "../localization/localize": 108,
  8089. "../util/browser": 182
  8090. }],
  8091. 76: [function(e, t, i) {
  8092. "use strict";
  8093. t.exports = Object.freeze({
  8094. OPENED: "share.open",
  8095. CLOSED: "share.closed",
  8096. LINK_CLICKED: "share.linked"
  8097. })
  8098. }
  8099. , {}],
  8100. 77: [function(e, t, i) {
  8101. "use strict";
  8102. function n(n) {
  8103. function e(e, t) {
  8104. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8105. I.emit(l.LINK_CLICKED, {
  8106. channel: n
  8107. }),
  8108. window.open(C[n], "shareWindow", i)
  8109. }
  8110. switch (n) {
  8111. case A.FACEBOOK:
  8112. e(580, 420);
  8113. break;
  8114. case A.TWITTER:
  8115. e(550, 440);
  8116. break;
  8117. case A.MAIL:
  8118. I.emit(l.LINK_CLICKED, {
  8119. channel: "email"
  8120. }),
  8121. window.open(C[n], "_blank");
  8122. break;
  8123. case A.LINKEDIN:
  8124. }
  8125. }
  8126. function r(e) {
  8127. I.emit(l.LINK_CLICKED, {
  8128. channel: "copylink"
  8129. });
  8130. var t = document.createRange();
  8131. t.selectNodeContents(v);
  8132. var i = window.getSelection();
  8133. i.removeAllRanges(),
  8134. i.addRange(t),
  8135. document.execCommand("copy"),
  8136. y.classList.remove("hidden"),
  8137. v.classList.add("highlighted")
  8138. }
  8139. function o(e) {
  8140. e && (e.stopPropagation(),
  8141. e.target === v) || (window.getSelection().removeAllRanges(),
  8142. v.classList.remove("highlighted"),
  8143. y.classList.add("hidden"))
  8144. }
  8145. var a = e("../../util/browser")
  8146. , s = e("../../localization/localize")
  8147. , l = e("./ShareEvents")
  8148. , c = e("../../util/common")
  8149. , h = e("events").EventEmitter
  8150. , u = document.getElementById("sharing")
  8151. , d = document.getElementById("share-modal")
  8152. , p = document.getElementById("share-close")
  8153. , f = document.getElementById("facebook-share")
  8154. , g = document.getElementById("twitter-share")
  8155. , m = document.getElementById("mail-share")
  8156. , v = document.getElementById("share-url-text")
  8157. , y = document.getElementById("copy-success")
  8158. , A = Object.freeze({
  8159. FACEBOOK: "facebook",
  8160. TWITTER: "twitter",
  8161. MAIL: "mail",
  8162. LINKEDIN: "linkedin"
  8163. })
  8164. , C = {};
  8165. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8166. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8167. C[A.MAIL] = "mailto:?subject=";
  8168. var I = {
  8169. init: function(e) {
  8170. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8171. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8172. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8173. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8174. u.addEventListener("click", this.toggle.bind(this)),
  8175. p.addEventListener("click", this.hide.bind(this)),
  8176. v.addEventListener("click", r),
  8177. d.addEventListener("click", o),
  8178. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8179. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8180. m.addEventListener("click", n.bind(this, A.MAIL)),
  8181. v.textContent = window.location.href + "&utm_source=4",
  8182. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8183. u.classList.remove("hidden")
  8184. },
  8185. show: function() {
  8186. this.emit(l.OPENED),
  8187. d.classList.add("fadeIn")
  8188. },
  8189. hide: function() {
  8190. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8191. document.selection && document.selection.empty(),
  8192. window.getSelection().removeAllRanges(),
  8193. o(),
  8194. d.classList.remove("fadeIn"))
  8195. },
  8196. toggle: function() {
  8197. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8198. }
  8199. };
  8200. c.extendObject(I, h.prototype),
  8201. t.exports = I
  8202. }
  8203. , {
  8204. "../../localization/localize": 108,
  8205. "../../util/browser": 182,
  8206. "../../util/common": 185,
  8207. "./ShareEvents": 76,
  8208. events: 202
  8209. }],
  8210. 78: [function(e, t, i) {
  8211. "use strict";
  8212. t.exports = Object.freeze({
  8213. OPENED: "terms.opened",
  8214. CLOSED: "terms.closed"
  8215. })
  8216. }
  8217. , {}],
  8218. 79: [function(e, t, i) {
  8219. "use strict";
  8220. var n = e("./TermsEvent")
  8221. , r = e("../../localization/localize")
  8222. , o = e("../../analytics")
  8223. , a = e("../../util/ajax")
  8224. , s = e("../../util/common")
  8225. , l = e("events").EventEmitter
  8226. , c = document.getElementById("terms-modal")
  8227. , h = {
  8228. init: function() {
  8229. $(".footer-terms").on("click", function(e) {
  8230. e.preventDefault(),
  8231. this.show()
  8232. }
  8233. .bind(this)),
  8234. $("#terms-modal .close").on("click", this.hide.bind(this))
  8235. },
  8236. show: function() {
  8237. this.emit(n.OPENED),
  8238. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8239. var t = $("#terms-text").html(e);
  8240. o.track("showcase_gui", {
  8241. gui_action: "click_terms_button",
  8242. interaction_source: "gui"
  8243. }),
  8244. t.find("a").attr("target", "_blank")
  8245. }).fail(function() {
  8246. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8247. }),
  8248. c.classList.add("fadeIn")
  8249. },
  8250. hide: function(e) {
  8251. e && e.preventDefault(),
  8252. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8253. c.classList.remove("fadeIn")
  8254. }
  8255. };
  8256. s.extendObject(h, l.prototype),
  8257. t.exports = h
  8258. }
  8259. , {
  8260. "../../analytics": 4,
  8261. "../../localization/localize": 108,
  8262. "../../util/ajax": 181,
  8263. "../../util/common": 185,
  8264. "./TermsEvent": 78,
  8265. events: 202
  8266. }],
  8267. 80: [function(e, t, i) {
  8268. "use strict";
  8269. t.exports = Object.freeze({
  8270. OPEN_INFO: "title.open.info",
  8271. CLOSE_INFO: "title.close.info",
  8272. SHOW_INFO: "title.show.info",
  8273. HIDE_INFO: "title.hide.info",
  8274. LINK_CLICKED: "title.link.click",
  8275. CONTACT_LINK_CLICKED: "title.contact.click",
  8276. ORIGIN_LINK_CLICKED: "title.origin.click"
  8277. })
  8278. }
  8279. , {}],
  8280. 81: [function(e, t, i) {
  8281. "use strict";
  8282. var o = e("../../settings");
  8283. t.exports.init = function(e, t) {
  8284. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8285. function e(e) {
  8286. t.shouldShowtags = "show" === this.value,
  8287. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8288. }
  8289. document.getElementById("tag-toggles").classList.remove("hidden"),
  8290. document.getElementById("radio-tag-show").checked = !0;
  8291. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8292. n[r].addEventListener("change", e)
  8293. }(e, t)
  8294. }
  8295. }
  8296. , {
  8297. "../../settings": 166
  8298. }],
  8299. 82: [function(S, M, e) {
  8300. (function(e) {
  8301. "use strict";
  8302. function i(e) {
  8303. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8304. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8305. _.appendChild(function(e) {
  8306. var t = document.createElement("a");
  8307. return t.id = "url",
  8308. t.target = "_blank",
  8309. t.href = e,
  8310. t.innerText = e,
  8311. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8312. t
  8313. }(e)),
  8314. b.forEach(function(e) {
  8315. e.classList.add("share-link")
  8316. }),
  8317. 0))
  8318. }
  8319. function s(e, t) {
  8320. var i = e
  8321. , n = t;
  8322. return function(e, t) {
  8323. i.push(t || n, e)
  8324. }
  8325. }
  8326. var l = S("../../util/browser")
  8327. , t = S("../../util/common")
  8328. , n = S("../../util/logger")
  8329. , r = S("../../localization/localize")
  8330. , o = S("./titleBarSettings")
  8331. , c = S("../../settings")
  8332. , a = S("./TitleEvents")
  8333. , h = S("events").EventEmitter
  8334. , u = new n(e)
  8335. , d = document.querySelector(".pinTop.left")
  8336. , p = document.getElementsByClassName("title-container")[0]
  8337. , f = document.getElementById("title-toggle").querySelector("i")
  8338. , g = document.getElementById("meta-info-wrapper")
  8339. , m = document.getElementById("meta-info")
  8340. , v = document.getElementById("meta-description")
  8341. , y = document.getElementsByClassName("contact-info")[0]
  8342. , A = document.getElementById("contact-data")
  8343. , C = document.getElementById("addressTxt")
  8344. , I = document.getElementById("tag-toggles")
  8345. , E = document.getElementById("share-origin")
  8346. , _ = document.getElementById("share-link-wrapper")
  8347. , b = [m, g, p]
  8348. , w = !1
  8349. , T = !1
  8350. , x = {
  8351. populate: function(e) {
  8352. if (function(e, t) {
  8353. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8354. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8355. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8356. document.getElementById("gui-name").classList.add("noCoBrand"),
  8357. document.getElementById("cobrandTitle").classList.add("hidden")),
  8358. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8359. !1)
  8360. }(DATA.name, e.coBrand)) {
  8361. if (function(e) {
  8362. e ? (w = !0,
  8363. v.innerHTML = e) : v.classList.add("hidden")
  8364. }(e.description),
  8365. function(e, t, i, n) {
  8366. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8367. w = !0;
  8368. var r = []
  8369. , o = s(r, "<br>");
  8370. if (e && o('<span id="contactName">' + e + "</span>"),
  8371. t) {
  8372. var a = n || t;
  8373. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8374. }
  8375. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8376. r[0] = "",
  8377. A.innerHTML = r.join("")
  8378. } else
  8379. y.classList.add("hidden")
  8380. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8381. function(e) {
  8382. if ("string" == typeof e)
  8383. try {
  8384. e = JSON.parse(e)
  8385. } catch (e) {
  8386. return u.warn("Unable to parse address data"),
  8387. C.parentElement.classList.add("hidden")
  8388. }
  8389. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8390. w = !0;
  8391. var t = []
  8392. , i = s(t, " ");
  8393. e.address_1 && i(e.address_1),
  8394. e.address_2 && i(e.address_2),
  8395. e.city && i(e.city, ", "),
  8396. e.state && i(e.state, ", "),
  8397. e.zip && i(e.zip, e.state ? " " : ", "),
  8398. t[0] = "",
  8399. C.innerText = t.join("")
  8400. } else
  8401. C.parentElement.classList.add("hidden")
  8402. }(e.address),
  8403. w) {
  8404. var t = document.createElement("br");
  8405. I.insertBefore(t, I.firstElementChild)
  8406. }
  8407. e.socialSharing && c.share.enabled && (T = i(e.url))
  8408. }
  8409. },
  8410. finishSetup: function(e) {
  8411. w = w || !!e,
  8412. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8413. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8414. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8415. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8416. }),
  8417. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8418. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8419. contact_type: e.getAttribute("id")
  8420. }))
  8421. }),
  8422. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8423. },
  8424. toggleMeta: function(e, t) {
  8425. var i = document.getElementById("model-title");
  8426. t && t.preventDefault();
  8427. var n = m.classList.contains("expand");
  8428. e && !n || (n ? (b.forEach(function(e) {
  8429. e.classList.remove("expand")
  8430. }),
  8431. this.emit(a.CLOSE_INFO),
  8432. i.classList.remove("expand")) : (b.forEach(function(e) {
  8433. e.classList.add("expand")
  8434. }),
  8435. i.classList.add("expand"),
  8436. this.emit(a.OPEN_INFO)))
  8437. },
  8438. setupToggling: function() {
  8439. g.style.height = m.offsetHeight + "px",
  8440. m.addEventListener("transitionend", function() {
  8441. g.style.height = m.offsetHeight + "px"
  8442. })
  8443. },
  8444. toggleTitle: function(e) {
  8445. e && e.preventDefault(),
  8446. d.classList.contains("closed") ? (d.classList.add("open"),
  8447. f.classList.remove("icon-dpad-right"),
  8448. f.classList.add("icon-dpad-left"),
  8449. this.emit(a.SHOW_INFO),
  8450. setTimeout(function() {
  8451. d.classList.remove("closed"),
  8452. d.classList.remove("open")
  8453. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8454. f.classList.remove("icon-dpad-left"),
  8455. f.classList.add("icon-dpad-right"),
  8456. this.emit(a.HIDE_INFO))
  8457. }
  8458. };
  8459. t.extendObject(x, h.prototype),
  8460. M.exports = x
  8461. }
  8462. ).call(this, "/js/gui/title/titleBar.js")
  8463. }
  8464. , {
  8465. "../../localization/localize": 108,
  8466. "../../settings": 166,
  8467. "../../util/browser": 182,
  8468. "../../util/common": 185,
  8469. "../../util/logger": 189,
  8470. "./TitleEvents": 80,
  8471. "./titleBarSettings": 83,
  8472. events: 202
  8473. }],
  8474. 83: [function(e, t, i) {
  8475. "use strict";
  8476. t.exports = Object.freeze({
  8477. minTooltipCharacters: 19,
  8478. removeAnimationClasses: 500
  8479. })
  8480. }
  8481. , {}],
  8482. 84: [function(e, t, i) {
  8483. "use strict";
  8484. function n() {
  8485. v.playTour(),
  8486. y && clearTimeout(y),
  8487. c(),
  8488. E.removeClass("fadeIn")
  8489. }
  8490. function r() {
  8491. A.classList.contains("playing") && (v.stopTour(),
  8492. E.addClass("fadeIn"),
  8493. setTimeout(function() {
  8494. E.removeClass("fadeIn")
  8495. }, h.tourInteraction.showPauseButton),
  8496. M || (clearTimeout(y),
  8497. y = setTimeout(s, h.tourInteraction.showModal)),
  8498. setTimeout(function() {
  8499. A.classList.remove("playing")
  8500. }, h.tourInteraction.allowNextClick))
  8501. }
  8502. function o() {
  8503. v.tourInProgress && (v.stopTour(),
  8504. v.endTourProgress(),
  8505. A.classList.remove("playing"))
  8506. }
  8507. function a() {
  8508. _.is(":visible") ? n() : r()
  8509. }
  8510. function s() {//去掉导览结束时的提示
  8511. /* if (!h.tourInteraction.disabled) {
  8512. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8513. T.addClass("fadeIn tour " + p.deviceType);
  8514. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8515. if (!h.tourInteraction.smallModal)
  8516. 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,
  8517. p.fill(x, g.TOUR_INTERACTION[e]),
  8518. T.addClass(e);
  8519. T.addClass(t)
  8520. } */
  8521. }
  8522. function l(e, t) {
  8523. if (t) {
  8524. if($.contains($('.toolRight')[0],t.target))return //add 防止编辑时input 空格开始导览
  8525. var i = "keydown" === t.type
  8526. , n = t.which === u.SPACE || v.tourIsPlaying;
  8527. i && n || e || (M = !0),
  8528. v.atEndOfTour() && c(),
  8529. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8530. c(),
  8531. t.which !== u.SPACE && o()),
  8532. i && n && a()
  8533. }
  8534. }
  8535. function c() {
  8536. T.removeClass("fadeIn")
  8537. }
  8538. var h = (e("../util/browser"),
  8539. e("../settings"))
  8540. , u = e("../enum/Keys")
  8541. , d = e("../enum/Viewmode")
  8542. , p = (e("./helpManager"),
  8543. e("./populateModal"))
  8544. , f = e("../enum/DirectorEvents")
  8545. , g = e("../enum/HelpModalType")
  8546. , m = e("../enum/HelpModalSize")
  8547. , v = null
  8548. , y = null
  8549. , A = document.getElementById("pause-overlay")
  8550. , C = document.getElementById("player")
  8551. , I = document.getElementById("gui")
  8552. , E = $("#pause-icon").eq(0)
  8553. , _ = $("#play").eq(0)
  8554. , b = $("#playHead").eq(0)
  8555. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8556. , T = $("#interaction-modal").eq(0)
  8557. , x = $("#interaction-modal .interaction").toArray()
  8558. , S = ["touchstart", "mousedown", "pointerdown"]
  8559. , M = !1;
  8560. t.exports.init = function(e) {
  8561. v = e,
  8562. S.forEach(function(t) {
  8563. C.addEventListener(t, l.bind(this, !1), !0),
  8564. I.addEventListener(t, l.bind(this, !0), !0),
  8565. A.addEventListener(t, r, !0),
  8566. w.forEach(function(e) {
  8567. e.addEventListener(t, o, !0)
  8568. }),
  8569. $("#drawer img").on(t, o)
  8570. }),
  8571. document.addEventListener("keydown", l.bind(this, !1), !0),
  8572. v.on(f.TourStart, function() {
  8573. A.classList.add("playing")
  8574. })
  8575. }
  8576. ,
  8577. t.exports.play = n,
  8578. t.exports.pause = r,
  8579. t.exports.pauseWithoutCTA = o,
  8580. t.exports.togglePlay = a,
  8581. t.exports.stopTour = function() {
  8582. b.hasClass("playing") && (clearTimeout(y),
  8583. v.atEndOfTour() ? (A.classList.remove("playing"),
  8584. s()) : E.removeClass("fadeIn"))
  8585. }
  8586. ,
  8587. t.exports.dismissModal = c
  8588. }
  8589. , {
  8590. "../enum/DirectorEvents": 23,
  8591. "../enum/HelpModalSize": 27,
  8592. "../enum/HelpModalType": 28,
  8593. "../enum/Keys": 30,
  8594. "../enum/Viewmode": 51,
  8595. "../settings": 166,
  8596. "../util/browser": 182,
  8597. "./helpManager": 68,
  8598. "./populateModal": 75
  8599. }],
  8600. 85: [function(e, t, i) {
  8601. "use strict";
  8602. t.exports = Object.freeze({
  8603. OPENED: "vr.modal.opened",
  8604. LAUNCH: "vr.modal.launch",
  8605. CLOSED: "vr.modal.closed",
  8606. NEXT: "vr.modal.next",
  8607. PREV: "vr.modal.prev",
  8608. STORE: "vr.modal.store",
  8609. falseICECHOSEN: "vr.modal.device"
  8610. })
  8611. }
  8612. , {}],
  8613. 86: [function(e, t, i) {
  8614. "use strict";
  8615. var h = e("../../util/browser")
  8616. , u = e("../../enum/VRApps")
  8617. , n = e("../../enum/VRPlatforms")
  8618. , d = e("../../util/ajax")
  8619. , p = e("../../settings")
  8620. , r = {};
  8621. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8622. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8623. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8624. u) {
  8625. var a = u[o];
  8626. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8627. }
  8628. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8629. "https://" + s);
  8630. t.exports.init = function(e, t, o) {
  8631. function a(e, t, i, n) {
  8632. function r() {
  8633. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8634. }
  8635. 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()
  8636. }
  8637. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8638. , l = g + "/vr/dlist/?ret=" + s
  8639. , c = g + "/vr/show/?ret=" + s;
  8640. switch (e) {
  8641. case n.IOS:
  8642. !function(t, e, i, n) {
  8643. var r = a(t, e, i, n)
  8644. , o = {
  8645. responseType: "json",
  8646. data: {
  8647. branch_key: p.appConfig.branch_key,
  8648. data: {
  8649. m: e,
  8650. full_url: r,
  8651. $desktop_url: "",
  8652. $og_app_id: "331853976762864119",
  8653. $og_title: i,
  8654. $og_description: n,
  8655. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8656. $canonical_url: window.location.href
  8657. }
  8658. }
  8659. };
  8660. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8661. f[t] = e.url
  8662. }).fail(function(e) {
  8663. f[t] = e
  8664. }
  8665. .bind(this, r))
  8666. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8667. break;
  8668. default:
  8669. !function(e, t, i) {
  8670. for (var n in u) {
  8671. var r = u[n]
  8672. , o = a(r, e, t, i);
  8673. f[r] = o
  8674. }
  8675. }(t.sid, t.name, t.summary)
  8676. }
  8677. }
  8678. ,
  8679. t.exports.launch = function(e) {
  8680. var t = f[e];
  8681. window.open(t, "_blank")
  8682. }
  8683. ,
  8684. t.exports.launchStore = function(e) {
  8685. var t = r[e];
  8686. window.open(t, "_blank")
  8687. }
  8688. }
  8689. , {
  8690. "../../enum/VRApps": 46,
  8691. "../../enum/VRPlatforms": 49,
  8692. "../../settings": 166,
  8693. "../../util/ajax": 181,
  8694. "../../util/browser": 182
  8695. }],
  8696. 87: [function(e, t, i) {
  8697. "use strict";
  8698. function c(e) {
  8699. var t;
  8700. switch (e) {
  8701. case y.IOS:
  8702. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8703. case y.Android:
  8704. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8705. }
  8706. return !1
  8707. }
  8708. function h(e) {
  8709. switch (e) {
  8710. case y.Android:
  8711. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8712. x.filter(".gearvr").off().on("click", q.gear),
  8713. n(k, U, "logo-button", "same-line");
  8714. break;
  8715. case y.UnsupportedAndroid:
  8716. n("", H, "", "");
  8717. break;
  8718. case y.IOS:
  8719. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8720. n(k, "", "logo-button", "");
  8721. break;
  8722. case y.Desktop:
  8723. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8724. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8725. n(k, U, "logo-button", "same-line"),
  8726. Q.cardboard()
  8727. }
  8728. }
  8729. function u(e) {
  8730. $(".p1, .p2, .p3").hide(),
  8731. l.insertAfter(T),
  8732. w.removeClass("front-page"),
  8733. w.removeClass("details-page"),
  8734. w.removeClass("lastPage"),
  8735. x.removeClass("logo-button"),
  8736. x.removeClass("same-line"),
  8737. T.removeClass("headsetOptions"),
  8738. S.attr("src", ""),
  8739. S.filter(".second").removeClass("gear"),
  8740. S.css("display", "inline-block"),
  8741. S.off(),
  8742. M.filter(".second").css("display", ""),
  8743. O.css("display", "none"),
  8744. $(".p" + (e + 1) + _).show(),
  8745. S.filter(".third").insertBefore(M.filter(".third"))
  8746. }
  8747. function n(e, t, i, n) {
  8748. w.addClass("front-page"),
  8749. S.filter(".first").attr("src", e),
  8750. S.filter(".second").attr("src", t),
  8751. x.filter(".first").addClass(i),
  8752. x.filter(".second").addClass(i),
  8753. x.addClass(n),
  8754. ".show-desktop" === _ && T.insertAfter(l)
  8755. }
  8756. function r(e, t, i) {
  8757. T.addClass("headsetOptions"),
  8758. x.off(),
  8759. S.filter(".second").attr("src", t),
  8760. O.css("display", "block"),
  8761. M.filter(".second").css("display", "none"),
  8762. O.on("click", function() {
  8763. u(b.Title),
  8764. h(y.Desktop)
  8765. }),
  8766. e && (X.emit(C.falseICECHOSEN, {
  8767. name: v.GearVR
  8768. }),
  8769. S.filter(".first").attr("src", e),
  8770. S.filter(".second").addClass("gear"),
  8771. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8772. Q.gearvr()),
  8773. i && (X.emit(C.falseICECHOSEN, {
  8774. name: v.Cardboard
  8775. }),
  8776. S.filter(".third").attr("src", i),
  8777. S.filter(".third").show(),
  8778. S.filter(".third").insertAfter(S.filter(".second")),
  8779. S.filter(".third").addClass("link"),
  8780. S.filter(".second").addClass("link"),
  8781. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8782. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8783. Q.cardboard())
  8784. }
  8785. function d(e, t) {
  8786. switch (t) {
  8787. case y.IOS:
  8788. j = W,
  8789. Y = G;
  8790. break;
  8791. case y.Desktop:
  8792. e === b.Cardboard ? (j = N,
  8793. Y = B,
  8794. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8795. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8796. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8797. Y = "");
  8798. break;
  8799. default:
  8800. Y = e === b.Cardboard ? (j = H,
  8801. G) : (j = V,
  8802. z)
  8803. }
  8804. }
  8805. function p(e, t, i) {
  8806. w.find(".inner").addClass("details-page"),
  8807. w.addClass("details-page"),
  8808. S.filter(".first").attr("src", e),
  8809. S.filter(".second").attr("src", t),
  8810. S.filter(".third").attr("src", i)
  8811. }
  8812. function f() {
  8813. var e = 1 < g.aspectRatio() && g.isMobile();
  8814. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8815. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8816. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8817. }
  8818. var g = e("../../util/browser")
  8819. , m = e("./vrLink")
  8820. , v = e("../../enum/VRApps")
  8821. , y = e("../../enum/VRPlatforms")
  8822. , A = e("../../enum/VRPages")
  8823. , C = e("./vrEvent")
  8824. , o = (e("../../settings"),
  8825. e("../../constants"))
  8826. , I = e("../../localization/localize")
  8827. , a = e("../../util/common")
  8828. , s = e("events").EventEmitter
  8829. , E = 0
  8830. , _ = null
  8831. , b = A.standard
  8832. , w = $(".vr-popup")
  8833. , l = w.find(".vr-popup-body")
  8834. , T = w.find(".vr-images")
  8835. , x = w.find(".img-container")
  8836. , S = w.find(".vr-sm-image")
  8837. , M = x.find(".vr-img-caption")
  8838. , R = $(".vr-buttons").find(".prev-button")
  8839. , P = $(".vr-buttons").find(".next-button")
  8840. , O = T.find(".front-close")
  8841. , L = $(".vr-page")
  8842. , D = w.find("img")
  8843. , N = "images/apple-store.png"
  8844. , F = "images/badge-oculus.png"
  8845. , B = "images/badge-cardboard.png"
  8846. , V = "images/logo-samsung.png"
  8847. , k = "images/headset-cardboard.png"
  8848. , U = "images/headset-gearvr.png"
  8849. , H = "images/ico-android-robot.png"
  8850. , z = "images/ico-gearvr.png"
  8851. , G = "images/ico-vr.png"
  8852. , W = "images/apple-logo-white.svg"
  8853. , j = null
  8854. , Y = null
  8855. , q = {}
  8856. , X = {
  8857. init: function(e, t) {
  8858. function i(e) {
  8859. X.emit(C.STORE, {
  8860. type: e
  8861. }),
  8862. m.launchStore(e)
  8863. }
  8864. function n(e) {
  8865. switch (e !== b.pageCount && (u(e),
  8866. L.text(e + 1 + " / " + b.pageCount)),
  8867. e) {
  8868. case b.Title:
  8869. R.css("display", "none"),
  8870. P.text(a[e]),
  8871. h(r);
  8872. break;
  8873. case b.Cardboard:
  8874. R.css("display", "block"),
  8875. P.text(a[e]),
  8876. x.filter(".cardboard").off(),
  8877. x.filter(".gearvr").off(),
  8878. d(e, r),
  8879. p(k, j, Y);
  8880. break;
  8881. case b.Gear:
  8882. P.text(a[e]),
  8883. d(e, r),
  8884. w.addClass("lastPage"),
  8885. p(U, j, Y);
  8886. break;
  8887. case b.pageCount:
  8888. w.removeClass("fadeIn"),
  8889. X.emit(C.CLOSED)
  8890. }
  8891. D.filter("[src='']").hide()
  8892. }
  8893. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8894. _ = ".show-supported",
  8895. y.Android) : (w.addClass("unsupported"),
  8896. _ = ".show-unsupported",
  8897. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8898. _ = ".show-ios",
  8899. b = A.ios,
  8900. y.IOS) : (w.addClass("desktop"),
  8901. _ = ".show-desktop",
  8902. y.Desktop);
  8903. function o(e) {
  8904. X.emit(C.LAUNCH, {
  8905. vr_platform: r,
  8906. vr_app: e
  8907. }),
  8908. m.launch(e)
  8909. }
  8910. m.init(r, e, t),
  8911. r !== y.Desktop && w.addClass("mobile"),
  8912. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8913. q.gear = o.bind(this, v.GearVR),
  8914. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8915. f(),
  8916. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8917. $(_).show();
  8918. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8919. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8920. r === y.IOS && (a.splice(1, 1),
  8921. s.splice(1, 1)),
  8922. $("#vr").on("click", function(e) {
  8923. e.preventDefault(),
  8924. window.vrEnabled || (window.vrEnabled = !0,
  8925. this.classList.add("active"),
  8926. $("#gui div").not("#vrOff").addClass("vrHide"),
  8927. $("#vrOffImg").css({
  8928. display: "inline-block"
  8929. }))
  8930. }),
  8931. $("#vrOff").on("click", function() {
  8932. window.vrEnabled = !1,
  8933. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8934. $("#vrOffImg").css({
  8935. display: "none"
  8936. }),
  8937. $("#player canvas").css({
  8938. width: "",
  8939. height: ""
  8940. }),
  8941. $("#vr").removeClass("active")
  8942. });
  8943. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8944. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8945. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8946. $("span.modelLink").text(l),
  8947. R.on("click", function(e) {
  8948. X.emit(C.PREV),
  8949. n(--E)
  8950. }),
  8951. P.on("click", function(e) {
  8952. P.text(),
  8953. X.emit(C.NEXT, {
  8954. nextAction: s[E]
  8955. }),
  8956. n(++E)
  8957. }),
  8958. w.find(".close").on("click", X.dismiss)
  8959. },
  8960. dismiss: function() {
  8961. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8962. X.emit(C.CLOSED))
  8963. },
  8964. isDeviceSupported: c
  8965. };
  8966. a.extendObject(X, s.prototype),
  8967. $(window).resize(f);
  8968. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8969. K = M.filter(".first").find(".gearvr"),
  8970. {
  8971. cardboard: function() {
  8972. K.addClass("hidden"),
  8973. Z.removeClass("hidden")
  8974. },
  8975. gearvr: function() {
  8976. Z.addClass("hidden"),
  8977. K.removeClass("hidden")
  8978. }
  8979. });
  8980. t.exports = X
  8981. }
  8982. , {
  8983. "../../constants": 8,
  8984. "../../enum/VRApps": 46,
  8985. "../../enum/VRPages": 48,
  8986. "../../enum/VRPlatforms": 49,
  8987. "../../localization/localize": 108,
  8988. "../../settings": 166,
  8989. "../../util/browser": 182,
  8990. "../../util/common": 185,
  8991. "./vrEvent": 85,
  8992. "./vrLink": 86,
  8993. events: 202
  8994. }],
  8995. 88: [function(e, t, i) {
  8996. "use strict";
  8997. t.exports = Object.freeze({
  8998. OPENED: "webvr.modal.opened",
  8999. SHOW_TERMS: "webvr.footer.show.terms"
  9000. })
  9001. }
  9002. , {}],
  9003. 89: [function(B, V, e) {
  9004. (function(e) {
  9005. "use strict";
  9006. function a() {
  9007. function t() {
  9008. p.isPresenting || (r.info("exiting webVR"),
  9009. c("webvr_exit_app"),
  9010. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9011. window.removeEventListener("vrdisplaypresentchange", t))
  9012. }
  9013. r.info("Headset mounted"),
  9014. u.suspend();
  9015. var e = document.createElement("canvas");
  9016. for (e.getContext("webgl"),
  9017. e.className = "webvr-canvas",
  9018. document.bgColor = "#000",
  9019. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9020. document.body.removeChild(document.body.firstChild);
  9021. document.body.appendChild(e),
  9022. c("webvr_enter_app"),
  9023. p.requestPresent([{
  9024. source: e,
  9025. predistorted: !0
  9026. }]).catch(function(e) {
  9027. r.error("Failed to present: " + e),
  9028. c("webvr_exit_calibrate"),
  9029. t()
  9030. }),
  9031. d.then(function() {
  9032. window.dispatchEvent(new Event("vrapp-start"))
  9033. }),
  9034. window.addEventListener("vrdisplaypresentchange", t)
  9035. }
  9036. function s() {
  9037. c("webvr_modal_close"),
  9038. _.find(".enter-button").off("click", a),
  9039. E.fadeOut(g.guiAnimationSpeed, function() {
  9040. _.toggleClass("hidden", !1),
  9041. b.toggleClass("hidden", !0),
  9042. f.exitFullscreen()
  9043. }),
  9044. I.fadeIn(g.guiAnimationSpeed)
  9045. }
  9046. function t() {
  9047. M.toggleClass("hidden", !0),
  9048. S.toggleClass("hidden", !1)
  9049. }
  9050. function l() {
  9051. _.toggleClass("hidden"),
  9052. b.toggleClass("hidden")
  9053. }
  9054. function c(e) {
  9055. var t = f.isLandscape() ? "landscape" : "portrait";
  9056. i.trackAlways("showcase_gui", {
  9057. gui_action: e,
  9058. orientation: t
  9059. })
  9060. }
  9061. function h() {
  9062. var e = f.isLandscape();
  9063. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9064. }
  9065. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9066. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9067. 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 = {
  9068. init: function(e, t, i, n) {
  9069. function r(e) {
  9070. e.preventDefault(),
  9071. o(e.currentTarget.id)
  9072. }
  9073. function o(i) {
  9074. F[i](),
  9075. Object.keys(F).map(function(e, t) {
  9076. $("#" + e).toggleClass("tabs-underlined", e === i)
  9077. })
  9078. }
  9079. p = i,
  9080. u = t,
  9081. y.init(m.Android, e, n),
  9082. h(),
  9083. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9084. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9085. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9086. w.filter(".device-headset-side").attr("src", R),
  9087. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9088. $("#vr").on("click", function(e) {
  9089. e.preventDefault(),
  9090. c("click_webvr_button"),
  9091. E.is(":hidden") && (N.emit(A.OPENED),
  9092. I.fadeOut(g.guiAnimationSpeed),
  9093. E.fadeIn(g.guiAnimationSpeed),
  9094. function() {
  9095. if (!d) {
  9096. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9097. d = new Promise(function(e, t) {
  9098. var i = document.createElement("script");
  9099. i.type = "text/javascript",
  9100. i.src = n,
  9101. i.onload = e,
  9102. document.head.appendChild(i)
  9103. }
  9104. )
  9105. }
  9106. _.find(".enter-button").on("click", a)
  9107. }())
  9108. }),
  9109. $(".webvr-popup .close").on("click", function(e) {
  9110. e.preventDefault(),
  9111. _.hasClass("hidden") ? (c("webvr_help_close"),
  9112. l()) : s()
  9113. }),
  9114. $("#tabcardboard").on("click", r),
  9115. $("#tabdaydream").on("click", r),
  9116. $("#tabnative").on("click", r),
  9117. $(".webvr-popup .open-with-app").on("click", function(e) {
  9118. e.preventDefault(),
  9119. c("webvr_learn_more"),
  9120. o("tabnative"),
  9121. l()
  9122. }),
  9123. $(".webvr-popup .help").on("click", function(e) {
  9124. e.preventDefault(),
  9125. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9126. l()
  9127. }),
  9128. $(".webvr-popup .terms").on("click", function(e) {
  9129. e.preventDefault(),
  9130. c("webvr_click_terms"),
  9131. s(),
  9132. N.emit(A.SHOW_TERMS)
  9133. }),
  9134. T.on("click", function(e) {
  9135. e.preventDefault(),
  9136. c(D),
  9137. window.open(L, "_blank")
  9138. }),
  9139. x.on("click", function(e) {
  9140. e.preventDefault(),
  9141. c("webvr_phone_link"),
  9142. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9143. }),
  9144. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9145. e.preventDefault(),
  9146. c("webvr_cardboard_link"),
  9147. y.launch(v.CardboardAndroid)
  9148. }),
  9149. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9150. e.preventDefault(),
  9151. c("webvr_oculus_link"),
  9152. y.launch(v.GearVR)
  9153. })
  9154. }
  9155. }, F = {
  9156. tabcardboard: function() {
  9157. w.filter(".device-headset").attr("src", R),
  9158. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9159. L = "https://vr.google.com/cardboard/get-cardboard/",
  9160. D = "webvr_cardboard_link",
  9161. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9162. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9163. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9164. t()
  9165. },
  9166. tabdaydream: function() {
  9167. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9168. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9169. L = P,
  9170. D = O,
  9171. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9172. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9173. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9174. t()
  9175. },
  9176. tabnative: function() {
  9177. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9178. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9179. M.toggleClass("hidden", !1),
  9180. S.toggleClass("hidden", !0)
  9181. }
  9182. };
  9183. n.extendObject(N, o.prototype),
  9184. $(window).resize(h),
  9185. V.exports = N
  9186. }
  9187. ).call(this, "/js/gui/webvr/webVRgui.js")
  9188. }
  9189. , {
  9190. "../../analytics": 4,
  9191. "../../constants": 8,
  9192. "../../enum/VRApps": 46,
  9193. "../../enum/VRPlatforms": 49,
  9194. "../../localization/localize": 108,
  9195. "../../settings": 166,
  9196. "../../util/browser": 182,
  9197. "../../util/common": 185,
  9198. "../../util/logger": 189,
  9199. "./../gui": 65,
  9200. "./../vr/vrLink": 86,
  9201. "./WebVrEvent": 88,
  9202. events: 202
  9203. }],
  9204. 90: [function(e, t, i) {
  9205. "use strict";
  9206. function n(e, t, i, n, r) {
  9207. this.floorId = n || 0 === n ? n : -1,
  9208. this.roomId = r || "",
  9209. this.labelId = e,
  9210. this.position = (new o.Vector3).copy(t),
  9211. this.text = i
  9212. }
  9213. var o = e("three")
  9214. , r = e("../util/browser");
  9215. n.prototype.build = function() {
  9216. var e = window.document.createElement("div");
  9217. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9218. var t = window.document.createElement("div");
  9219. t.setAttribute("class", "gui-floorplan-label-text");
  9220. var i = window.document.createTextNode(this.text);
  9221. t.appendChild(i),
  9222. e.appendChild(t),
  9223. window.document.body.appendChild(e),
  9224. this.labelGui = e,
  9225. this.textBlock = t,
  9226. $(this.labelGui).hide();
  9227. var n = window.getComputedStyle(this.labelGui);
  9228. this.initialTransform = n.transform || n.webkitTransform
  9229. }
  9230. ,
  9231. t.exports = n
  9232. }
  9233. , {
  9234. "../util/browser": 182,
  9235. three: 217
  9236. }],
  9237. 91: [function(e, t, i) {
  9238. "use strict";
  9239. function n() {
  9240. this.player = null,
  9241. this.modelManager = null,
  9242. this.container = null
  9243. }
  9244. var c, o, r = e("three"), a = (e("../util/common"),
  9245. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9246. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9247. e("../util/transitions"),
  9248. e("../util/lerp"),
  9249. e("../util/browser"));
  9250. n.prototype.init = function(e, t, i) {
  9251. this.player = e,
  9252. this.modelManager = t,
  9253. this.container = i,
  9254. this.updateModel(),
  9255. this.bindEvents()
  9256. }
  9257. ,
  9258. n.prototype.bindEvents = function() {
  9259. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9260. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9261. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9262. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9263. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9264. }
  9265. ,
  9266. n.prototype.updateModel = function() {
  9267. this.model = this.modelManager.getActiveModel()
  9268. }
  9269. ,
  9270. n.prototype.handlePlayerViewChanged = function() {
  9271. this.updateLabelVisibility(),
  9272. this.updateLabelDisplay()
  9273. }
  9274. ,
  9275. n.prototype.getLabelsForFloor = function(t, i) {
  9276. return (i = i || []).length = 0,
  9277. this.model.labels.forEach(function(e) {
  9278. this.labelVisibleForFloor(e, t) && i.push(e)
  9279. }
  9280. .bind(this)),
  9281. i
  9282. }
  9283. ,
  9284. n.prototype.getLabelsForCurrentFloor = function(e) {
  9285. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9286. }
  9287. ,
  9288. n.prototype.labelVisibleForFloor = function(e, t) {
  9289. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9290. if (!this.model.showingLabels || !e.labelGui || !i)
  9291. return !1;
  9292. var n = e.floorId === this.model.floors.size() - 1;
  9293. return this.model.allFloorsVisible ? n : e.floorId === t
  9294. }
  9295. ,
  9296. n.prototype.updateLabelVisibility = function(e) {
  9297. this.model.labels.forEach(function(e) {
  9298. 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)
  9299. }
  9300. .bind(this))
  9301. }
  9302. ,
  9303. n.prototype.showAllLabels = function(t, i) {
  9304. this.model.labels.forEach(function(e) {
  9305. this.showLabel(e, t, i)
  9306. }
  9307. .bind(this))
  9308. }
  9309. ,
  9310. n.prototype.hideAllLabels = function(t, i) {
  9311. this.model.labels.forEach(function(e) {
  9312. this.hideLabel(e, t, i)
  9313. }
  9314. .bind(this))
  9315. }
  9316. ,
  9317. n.prototype.showLabel = function(e, t, i) {
  9318. this.model.showingLabels && (e.visible || (e.visible = !0,
  9319. e.labelGui.style.display = "block",
  9320. e.labelGui.style.opacity = 0,
  9321. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9322. }
  9323. ,
  9324. n.prototype.hideLabel = function(e, t, i) {
  9325. e.visible && (e.visible = !1,
  9326. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9327. }
  9328. ,
  9329. n.prototype.supportedMode = function() {
  9330. return this.player.mode === h.FLOORPLAN
  9331. }
  9332. ,
  9333. n.prototype.updateLabelDisplay = (new r.Vector3,
  9334. new r.Vector3,
  9335. o = [],
  9336. function() {
  9337. var e = this.player.getLabelScaleFactor()
  9338. , t = 1.2 * (1 - e) + .6
  9339. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9340. this.getLabelsForCurrentFloor(o);
  9341. for (var n = 0; n < o.length; n++) {
  9342. var r = o[n];
  9343. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9344. 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)
  9345. }
  9346. }
  9347. ),
  9348. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9349. new r.Vector3,
  9350. function(e, t, i, n, r) {
  9351. t.style.fontSize = 100 * r + "%";
  9352. var o = .5 * $("#player").width()
  9353. , a = .5 * $("#player").height();
  9354. c.copy(i),
  9355. c.project(this.player.camera);
  9356. var s = c.x * o + o
  9357. , l = -c.y * a + a;
  9358. s -= e.offsetWidth / 2,
  9359. l -= e.offsetHeight / 2,
  9360. e.style.left = s + "px",
  9361. e.style.top = l + "px"
  9362. }
  9363. ),
  9364. n.prototype.handleStartInside = function(e) {
  9365. this.updateLabelVisibility()
  9366. }
  9367. ,
  9368. n.prototype.handleStartOutside = function() {
  9369. this.updateLabelVisibility()
  9370. }
  9371. ,
  9372. t.exports = n
  9373. }
  9374. , {
  9375. "../enum/DirectorEvents": 23,
  9376. "../enum/ModelManagerEvents": 33,
  9377. "../enum/PlayerEvents": 40,
  9378. "../enum/Viewmode": 51,
  9379. "../enum/WarpStyle": 52,
  9380. "../settings": 166,
  9381. "../util/browser": 182,
  9382. "../util/common": 185,
  9383. "../util/lerp": 188,
  9384. "../util/transitions": 195,
  9385. three: 217
  9386. }],
  9387. 92: [function(e, t, i) {
  9388. "use strict";
  9389. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9390. if (null == this)
  9391. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9392. if ("function" != typeof e)
  9393. throw new TypeError("predicate must be a function");
  9394. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9395. if (t = i[o],
  9396. e.call(r, t, o, i))
  9397. return o;
  9398. return -1
  9399. }
  9400. ),
  9401. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9402. value: function(e) {
  9403. if (null == this)
  9404. throw new TypeError('"this" is null or not defined');
  9405. var t = Object(this)
  9406. , i = t.length >>> 0;
  9407. if ("function" != typeof e)
  9408. throw new TypeError("predicate must be a function");
  9409. for (var n = arguments[1], r = 0; r < i; ) {
  9410. var o = t[r];
  9411. if (e.call(n, o, r, t))
  9412. return o;
  9413. r++
  9414. }
  9415. }
  9416. })
  9417. }
  9418. , {}],
  9419. 93: [function(e, t, i) {
  9420. "use strict";
  9421. 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 || {};
  9422. function te() {
  9423. this.backgroundElement = document.createElement("div"),
  9424. r.extend(this.backgroundElement.style, {
  9425. backgroundColor: "rgba(0,0,0,0.8)",
  9426. top: 0,
  9427. left: 0,
  9428. display: "none",
  9429. zIndex: "1000",
  9430. opacity: 0,
  9431. WebkitTransition: "opacity 0.2s linear"
  9432. }),
  9433. n.makeFullscreen(this.backgroundElement),
  9434. this.backgroundElement.style.position = "fixed",
  9435. this.domElement = document.createElement("div"),
  9436. r.extend(this.domElement.style, {
  9437. position: "fixed",
  9438. display: "none",
  9439. zIndex: "1001",
  9440. opacity: 0,
  9441. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9442. }),
  9443. document.body.appendChild(this.backgroundElement),
  9444. document.body.appendChild(this.domElement);
  9445. var e = this;
  9446. n.bind(this.backgroundElement, "click", function() {
  9447. e.hide()
  9448. })
  9449. }
  9450. function ie(e, t, i) {
  9451. Object.defineProperty(e, t, {
  9452. get: function() {
  9453. return "RGB" === this.__state.space || re(this, t, i),
  9454. this.__state[t]
  9455. },
  9456. set: function(e) {
  9457. "RGB" !== this.__state.space && (re(this, t, i),
  9458. this.__state.space = "RGB"),
  9459. this.__state[t] = e
  9460. }
  9461. })
  9462. }
  9463. function ne(e, t) {
  9464. Object.defineProperty(e, t, {
  9465. get: function() {
  9466. return "HSV" === this.__state.space || oe(this),
  9467. this.__state[t]
  9468. },
  9469. set: function(e) {
  9470. "HSV" !== this.__state.space && (oe(this),
  9471. this.__state.space = "HSV"),
  9472. this.__state[t] = e
  9473. }
  9474. })
  9475. }
  9476. function re(e, t, i) {
  9477. if ("HEX" === e.__state.space)
  9478. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9479. else {
  9480. if ("HSV" !== e.__state.space)
  9481. throw "Corrupted color state";
  9482. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9483. }
  9484. }
  9485. function oe(e) {
  9486. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9487. l.extend(e.__state, {
  9488. s: t.s,
  9489. v: t.v
  9490. }),
  9491. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9492. }
  9493. function ae() {
  9494. if (this.__state = o.apply(this, arguments),
  9495. !1 === this.__state)
  9496. throw "Failed to interpret color arguments";
  9497. this.__state.a = this.__state.a || 1
  9498. }
  9499. function se(e) {
  9500. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9501. }
  9502. function le(e, t) {
  9503. this.initialValue = e[t],
  9504. this.domElement = document.createElement("div"),
  9505. this.object = e,
  9506. this.property = t,
  9507. this.__onChange = void 0,
  9508. this.__onFinishChange = void 0
  9509. }
  9510. (t.exports = ee).gui = ee.gui || {},
  9511. ee.utils = ee.utils || {},
  9512. ee.controllers = ee.controllers || {},
  9513. ee.dom = ee.dom || {},
  9514. ee.color = ee.color || {},
  9515. ee.utils.css = {
  9516. load: function(e, t) {
  9517. var i = (t = t || document).createElement("link");
  9518. i.type = "text/css",
  9519. i.rel = "stylesheet",
  9520. i.href = e,
  9521. t.getElementsByTagName("head")[0].appendChild(i)
  9522. },
  9523. inject: function(e, t) {
  9524. t = t || document;
  9525. var i = document.createElement("style");
  9526. i.type = "text/css",
  9527. i.innerHTML = e,
  9528. t.getElementsByTagName("head")[0].appendChild(i)
  9529. }
  9530. },
  9531. ee.utils.common = (Q = Array.prototype.forEach,
  9532. J = Array.prototype.slice,
  9533. {
  9534. BREAK: {},
  9535. extend: function(i) {
  9536. return this.each(J.call(arguments, 1), function(e) {
  9537. for (var t in e)
  9538. this.isUndefined(e[t]) || (i[t] = e[t])
  9539. }, this),
  9540. i
  9541. },
  9542. defaults: function(i) {
  9543. return this.each(J.call(arguments, 1), function(e) {
  9544. for (var t in e)
  9545. this.isUndefined(i[t]) && (i[t] = e[t])
  9546. }, this),
  9547. i
  9548. },
  9549. compose: function() {
  9550. var i = J.call(arguments);
  9551. return function() {
  9552. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9553. e = [i[t].apply(this, e)];
  9554. return e[0]
  9555. }
  9556. },
  9557. each: function(e, t, i) {
  9558. if (e)
  9559. if (Q && e.forEach && e.forEach === Q)
  9560. e.forEach(t, i);
  9561. else if (e.length === e.length + 0) {
  9562. for (var n = 0, r = e.length; n < r; n++)
  9563. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9564. return
  9565. } else
  9566. for (var n in e)
  9567. if (t.call(i, e[n], n) === this.BREAK)
  9568. return
  9569. },
  9570. defer: function(e) {
  9571. setTimeout(e, 0)
  9572. },
  9573. toArray: function(e) {
  9574. return e.toArray ? e.toArray() : J.call(e)
  9575. },
  9576. isUndefined: function(e) {
  9577. return void 0 === e
  9578. },
  9579. isNull: function(e) {
  9580. return null === e
  9581. },
  9582. isNaN: function(e) {
  9583. return e != e
  9584. },
  9585. isArray: Array.isArray || function(e) {
  9586. return e.constructor === Array
  9587. }
  9588. ,
  9589. isObject: function(e) {
  9590. return e === Object(e)
  9591. },
  9592. isNumber: function(e) {
  9593. return e === e + 0
  9594. },
  9595. isString: function(e) {
  9596. return e === e + ""
  9597. },
  9598. isBoolean: function(e) {
  9599. return !1 === e || !0 === e
  9600. },
  9601. isFunction: function(e) {
  9602. return "[object Function]" === Object.prototype.toString.call(e)
  9603. }
  9604. }),
  9605. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9606. onChange: function(e) {
  9607. return this.__onChange = e,
  9608. this
  9609. },
  9610. onFinishChange: function(e) {
  9611. return this.__onFinishChange = e,
  9612. this
  9613. },
  9614. setValue: function(e) {
  9615. return this.object[this.property] = e,
  9616. this.__onChange && this.__onChange.call(this, e),
  9617. this.updateDisplay(),
  9618. this
  9619. },
  9620. getValue: function() {
  9621. return this.object[this.property]
  9622. },
  9623. updateDisplay: function() {
  9624. return this
  9625. },
  9626. isModified: function() {
  9627. return this.initialValue !== this.getValue()
  9628. }
  9629. }),
  9630. le),
  9631. ee.dom.dom = function(c) {
  9632. function i(e) {
  9633. if ("0" === e || c.isUndefined(e))
  9634. return 0;
  9635. var t = e.match(n);
  9636. return c.isNull(t) ? 0 : parseFloat(t[1])
  9637. }
  9638. var h = {};
  9639. c.each({
  9640. HTMLEvents: ["change"],
  9641. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9642. KeyboardEvents: ["keydown"]
  9643. }, function(e, t) {
  9644. c.each(e, function(e) {
  9645. h[e] = t
  9646. })
  9647. });
  9648. var n = /(\d+(\.\d+)?)px/
  9649. , r = {
  9650. makeSelectable: function(e, t) {
  9651. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9652. return !1
  9653. }
  9654. : function() {}
  9655. ,
  9656. e.style.MozUserSelect = t ? "auto" : "none",
  9657. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9658. e.unselectable = t ? "on" : "off")
  9659. },
  9660. makeFullscreen: function(e, t, i) {
  9661. c.isUndefined(t) && (t = !0),
  9662. c.isUndefined(i) && (i = !0),
  9663. e.style.position = "absolute",
  9664. t && (e.style.left = 0,
  9665. e.style.right = 0),
  9666. i && (e.style.top = 0,
  9667. e.style.bottom = 0)
  9668. },
  9669. fakeEvent: function(e, t, i, n) {
  9670. i = i || {};
  9671. var r = h[t];
  9672. if (!r)
  9673. throw new Error("Event type " + t + " not supported.");
  9674. var o = document.createEvent(r);
  9675. switch (r) {
  9676. case "MouseEvents":
  9677. var a = i.x || i.clientX || 0
  9678. , s = i.y || i.clientY || 0;
  9679. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9680. break;
  9681. case "KeyboardEvents":
  9682. var l = o.initKeyboardEvent || o.initKeyEvent;
  9683. c.defaults(i, {
  9684. cancelable: !0,
  9685. ctrlKey: !1,
  9686. altKey: !1,
  9687. shiftKey: !1,
  9688. metaKey: !1,
  9689. keyCode: void 0,
  9690. charCode: void 0
  9691. }),
  9692. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9693. break;
  9694. default:
  9695. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9696. }
  9697. c.defaults(o, n),
  9698. e.dispatchEvent(o)
  9699. },
  9700. bind: function(e, t, i, n) {
  9701. return n = n || !1,
  9702. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9703. r
  9704. },
  9705. unbind: function(e, t, i, n) {
  9706. return n = n || !1,
  9707. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9708. r
  9709. },
  9710. addClass: function(e, t) {
  9711. if (void 0 === e.className)
  9712. e.className = t;
  9713. else if (e.className !== t) {
  9714. var i = e.className.split(/ +/);
  9715. -1 == i.indexOf(t) && (i.push(t),
  9716. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9717. }
  9718. return r
  9719. },
  9720. removeClass: function(e, t) {
  9721. if (t)
  9722. if (void 0 === e.className)
  9723. ;
  9724. else if (e.className === t)
  9725. e.removeAttribute("class");
  9726. else {
  9727. var i = e.className.split(/ +/)
  9728. , n = i.indexOf(t);
  9729. -1 != n && (i.splice(n, 1),
  9730. e.className = i.join(" "))
  9731. }
  9732. else
  9733. e.className = void 0;
  9734. return r
  9735. },
  9736. hasClass: function(e, t) {
  9737. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9738. },
  9739. getWidth: function(e) {
  9740. var t = getComputedStyle(e);
  9741. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9742. },
  9743. getHeight: function(e) {
  9744. var t = getComputedStyle(e);
  9745. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9746. },
  9747. getOffset: function(e) {
  9748. var t = {
  9749. left: 0,
  9750. top: 0
  9751. };
  9752. if (e.offsetParent)
  9753. for (; t.left += e.offsetLeft,
  9754. t.top += e.offsetTop,
  9755. e = e.offsetParent; )
  9756. ;
  9757. return t
  9758. },
  9759. isActive: function(e) {
  9760. return e === document.activeElement && (e.type || e.href)
  9761. }
  9762. };
  9763. return r
  9764. }(ee.utils.common),
  9765. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9766. X = ee.dom.dom,
  9767. Z = ee.utils.common,
  9768. (K = function(e, t, i) {
  9769. K.superclass.call(this, e, t);
  9770. var n = this;
  9771. if (this.__select = document.createElement("select"),
  9772. Z.isArray(i)) {
  9773. var r = {};
  9774. Z.each(i, function(e) {
  9775. r[e] = e
  9776. }),
  9777. i = r
  9778. }
  9779. Z.each(i, function(e, t) {
  9780. var i = document.createElement("option");
  9781. i.innerHTML = t,
  9782. i.setAttribute("value", e),
  9783. n.__select.appendChild(i)
  9784. }),
  9785. this.updateDisplay(),
  9786. X.bind(this.__select, "change", function() {
  9787. var e = this.options[this.selectedIndex].value;
  9788. n.setValue(e)
  9789. }),
  9790. this.domElement.appendChild(this.__select)
  9791. }
  9792. ).superclass = q,
  9793. Z.extend(K.prototype, q.prototype, {
  9794. setValue: function(e) {
  9795. var t = K.superclass.prototype.setValue.call(this, e);
  9796. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9797. t
  9798. },
  9799. updateDisplay: function() {
  9800. return this.__select.value = this.getValue(),
  9801. K.superclass.prototype.updateDisplay.call(this)
  9802. }
  9803. }),
  9804. K),
  9805. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9806. j = ee.utils.common,
  9807. (Y = function(e, t, i) {
  9808. Y.superclass.call(this, e, t),
  9809. i = i || {},
  9810. this.__min = i.min,
  9811. this.__max = i.max,
  9812. this.__step = i.step,
  9813. 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,
  9814. this.__precision = se(this.__impliedStep)
  9815. }
  9816. ).superclass = W,
  9817. j.extend(Y.prototype, W.prototype, {
  9818. setValue: function(e) {
  9819. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9820. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9821. Y.superclass.prototype.setValue.call(this, e)
  9822. },
  9823. min: function(e) {
  9824. return this.__min = e,
  9825. this
  9826. },
  9827. max: function(e) {
  9828. return this.__max = e,
  9829. this
  9830. },
  9831. step: function(e) {
  9832. return this.__step = e,
  9833. this.__impliedStep = e,
  9834. this.__precision = se(e),
  9835. this
  9836. }
  9837. }),
  9838. Y),
  9839. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9840. H = ee.dom.dom,
  9841. z = ee.utils.common,
  9842. (G = function(e, t, i) {
  9843. function n() {
  9844. var e = parseFloat(s.__input.value);
  9845. z.isNaN(e) || s.setValue(e)
  9846. }
  9847. function r(e) {
  9848. var t = a - e.clientY;
  9849. s.setValue(s.getValue() + t * s.__impliedStep),
  9850. a = e.clientY
  9851. }
  9852. function o() {
  9853. H.unbind(window, "mousemove", r),
  9854. H.unbind(window, "mouseup", o)
  9855. }
  9856. this.__truncationSuspended = !1,
  9857. G.superclass.call(this, e, t, i);
  9858. var a, s = this;
  9859. this.__input = document.createElement("input"),
  9860. this.__input.setAttribute("type", "text"),
  9861. H.bind(this.__input, "change", n),
  9862. H.bind(this.__input, "blur", function() {
  9863. n(),
  9864. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9865. }),
  9866. H.bind(this.__input, "mousedown", function(e) {
  9867. H.bind(window, "mousemove", r),
  9868. H.bind(window, "mouseup", o),
  9869. a = e.clientY
  9870. }),
  9871. H.bind(this.__input, "keydown", function(e) {
  9872. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9873. this.blur(),
  9874. s.__truncationSuspended = !1)
  9875. }),
  9876. this.updateDisplay(),
  9877. this.domElement.appendChild(this.__input)
  9878. }
  9879. ).superclass = U,
  9880. z.extend(G.prototype, U.prototype, {
  9881. updateDisplay: function() {
  9882. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9883. var i = Math.pow(10, t);
  9884. return Math.round(e * i) / i
  9885. }(this.getValue(), this.__precision),
  9886. G.superclass.prototype.updateDisplay.call(this)
  9887. }
  9888. }),
  9889. G),
  9890. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9891. F = ee.dom.dom,
  9892. B = ee.utils.css,
  9893. V = ee.utils.common,
  9894. (k = function(e, t, i, n, r) {
  9895. function o(e) {
  9896. e.preventDefault();
  9897. var t = F.getOffset(s.__background)
  9898. , i = F.getWidth(s.__background);
  9899. return s.setValue(function(e, t, i, n, r) {
  9900. return n + (e - t) / (i - t) * (r - n)
  9901. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9902. !1
  9903. }
  9904. function a() {
  9905. F.unbind(window, "mousemove", o),
  9906. F.unbind(window, "mouseup", a),
  9907. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9908. }
  9909. k.superclass.call(this, e, t, {
  9910. min: i,
  9911. max: n,
  9912. step: r
  9913. });
  9914. var s = this;
  9915. this.__background = document.createElement("div"),
  9916. this.__foreground = document.createElement("div"),
  9917. F.bind(this.__background, "mousedown", function(e) {
  9918. F.bind(window, "mousemove", o),
  9919. F.bind(window, "mouseup", a),
  9920. o(e)
  9921. }),
  9922. F.addClass(this.__background, "slider"),
  9923. F.addClass(this.__foreground, "slider-fg"),
  9924. this.updateDisplay(),
  9925. this.__background.appendChild(this.__foreground),
  9926. this.domElement.appendChild(this.__background)
  9927. }
  9928. ).superclass = N,
  9929. k.useDefaultStyles = function() {
  9930. 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}")
  9931. }
  9932. ,
  9933. V.extend(k.prototype, N.prototype, {
  9934. updateDisplay: function() {
  9935. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9936. return this.__foreground.style.width = 100 * e + "%",
  9937. k.superclass.prototype.updateDisplay.call(this)
  9938. }
  9939. }),
  9940. k),
  9941. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9942. O = ee.dom.dom,
  9943. L = ee.utils.common,
  9944. (D = function(e, t, i) {
  9945. D.superclass.call(this, e, t);
  9946. var n = this;
  9947. this.__button = document.createElement("div"),
  9948. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9949. O.bind(this.__button, "click", function(e) {
  9950. return e.preventDefault(),
  9951. n.fire(),
  9952. !1
  9953. }),
  9954. O.addClass(this.__button, "button"),
  9955. this.domElement.appendChild(this.__button)
  9956. }
  9957. ).superclass = P,
  9958. L.extend(D.prototype, P.prototype, {
  9959. fire: function() {
  9960. this.__onChange && this.__onChange.call(this),
  9961. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9962. this.getValue().call(this.object)
  9963. }
  9964. }),
  9965. D),
  9966. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9967. S = ee.dom.dom,
  9968. M = ee.utils.common,
  9969. (R = function(e, t) {
  9970. R.superclass.call(this, e, t);
  9971. var i = this;
  9972. this.__prev = this.getValue(),
  9973. this.__checkbox = document.createElement("input"),
  9974. this.__checkbox.setAttribute("type", "checkbox"),
  9975. S.bind(this.__checkbox, "change", function() {
  9976. i.setValue(!i.__prev)
  9977. }, !1),
  9978. this.domElement.appendChild(this.__checkbox),
  9979. this.updateDisplay()
  9980. }
  9981. ).superclass = x,
  9982. M.extend(R.prototype, x.prototype, {
  9983. setValue: function(e) {
  9984. var t = R.superclass.prototype.setValue.call(this, e);
  9985. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9986. this.__prev = this.getValue(),
  9987. t
  9988. },
  9989. updateDisplay: function() {
  9990. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9991. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9992. R.superclass.prototype.updateDisplay.call(this)
  9993. }
  9994. }),
  9995. R),
  9996. ee.color.toString = (T = ee.utils.common,
  9997. function(e) {
  9998. if (1 == e.a || T.isUndefined(e.a)) {
  9999. for (var t = e.hex.toString(16); t.length < 6; )
  10000. t = "0" + t;
  10001. return "#" + t
  10002. }
  10003. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10004. }
  10005. ),
  10006. ee.color.interpret = (I = ee.color.toString,
  10007. E = ee.utils.common,
  10008. w = [{
  10009. litmus: E.isString,
  10010. conversions: {
  10011. THREE_CHAR_HEX: {
  10012. read: function(e) {
  10013. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10014. return null !== t && {
  10015. space: "HEX",
  10016. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10017. }
  10018. },
  10019. write: I
  10020. },
  10021. SIX_CHAR_HEX: {
  10022. read: function(e) {
  10023. var t = e.match(/^#([A-F0-9]{6})$/i);
  10024. return null !== t && {
  10025. space: "HEX",
  10026. hex: parseInt("0x" + t[1].toString())
  10027. }
  10028. },
  10029. write: I
  10030. },
  10031. CSS_RGB: {
  10032. read: function(e) {
  10033. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10034. return null !== t && {
  10035. space: "RGB",
  10036. r: parseFloat(t[1]),
  10037. g: parseFloat(t[2]),
  10038. b: parseFloat(t[3])
  10039. }
  10040. },
  10041. write: I
  10042. },
  10043. CSS_RGBA: {
  10044. read: function(e) {
  10045. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10046. return null !== t && {
  10047. space: "RGB",
  10048. r: parseFloat(t[1]),
  10049. g: parseFloat(t[2]),
  10050. b: parseFloat(t[3]),
  10051. a: parseFloat(t[4])
  10052. }
  10053. },
  10054. write: I
  10055. }
  10056. }
  10057. }, {
  10058. litmus: E.isNumber,
  10059. conversions: {
  10060. HEX: {
  10061. read: function(e) {
  10062. return {
  10063. space: "HEX",
  10064. hex: e,
  10065. conversionName: "HEX"
  10066. }
  10067. },
  10068. write: function(e) {
  10069. return e.hex
  10070. }
  10071. }
  10072. }
  10073. }, {
  10074. litmus: E.isArray,
  10075. conversions: {
  10076. RGB_ARRAY: {
  10077. read: function(e) {
  10078. return 3 == e.length && {
  10079. space: "RGB",
  10080. r: e[0],
  10081. g: e[1],
  10082. b: e[2]
  10083. }
  10084. },
  10085. write: function(e) {
  10086. return [e.r, e.g, e.b]
  10087. }
  10088. },
  10089. RGBA_ARRAY: {
  10090. read: function(e) {
  10091. return 4 == e.length && {
  10092. space: "RGB",
  10093. r: e[0],
  10094. g: e[1],
  10095. b: e[2],
  10096. a: e[3]
  10097. }
  10098. },
  10099. write: function(e) {
  10100. return [e.r, e.g, e.b, e.a]
  10101. }
  10102. }
  10103. }
  10104. }, {
  10105. litmus: E.isObject,
  10106. conversions: {
  10107. RGBA_OBJ: {
  10108. read: function(e) {
  10109. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10110. space: "RGB",
  10111. r: e.r,
  10112. g: e.g,
  10113. b: e.b,
  10114. a: e.a
  10115. }
  10116. },
  10117. write: function(e) {
  10118. return {
  10119. r: e.r,
  10120. g: e.g,
  10121. b: e.b,
  10122. a: e.a
  10123. }
  10124. }
  10125. },
  10126. RGB_OBJ: {
  10127. read: function(e) {
  10128. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10129. space: "RGB",
  10130. r: e.r,
  10131. g: e.g,
  10132. b: e.b
  10133. }
  10134. },
  10135. write: function(e) {
  10136. return {
  10137. r: e.r,
  10138. g: e.g,
  10139. b: e.b
  10140. }
  10141. }
  10142. },
  10143. HSVA_OBJ: {
  10144. read: function(e) {
  10145. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10146. space: "HSV",
  10147. h: e.h,
  10148. s: e.s,
  10149. v: e.v,
  10150. a: e.a
  10151. }
  10152. },
  10153. write: function(e) {
  10154. return {
  10155. h: e.h,
  10156. s: e.s,
  10157. v: e.v,
  10158. a: e.a
  10159. }
  10160. }
  10161. },
  10162. HSV_OBJ: {
  10163. read: function(e) {
  10164. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10165. space: "HSV",
  10166. h: e.h,
  10167. s: e.s,
  10168. v: e.v
  10169. }
  10170. },
  10171. write: function(e) {
  10172. return {
  10173. h: e.h,
  10174. s: e.s,
  10175. v: e.v
  10176. }
  10177. }
  10178. }
  10179. }
  10180. }],
  10181. function() {
  10182. b = !1;
  10183. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10184. return E.each(w, function(e) {
  10185. if (e.litmus(i))
  10186. return E.each(e.conversions, function(e, t) {
  10187. if (_ = e.read(i),
  10188. !1 === b && !1 !== _)
  10189. return (b = _).conversionName = t,
  10190. _.conversion = e,
  10191. E.BREAK
  10192. }),
  10193. E.BREAK
  10194. }),
  10195. b
  10196. }
  10197. ),
  10198. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10199. function y(e, t, i, n) {
  10200. if (void 0 === t[i])
  10201. throw new Error("Object " + t + ' has no property "' + i + '"');
  10202. var r;
  10203. if (n.color)
  10204. r = new g(t,i);
  10205. else {
  10206. var o = [t, i].concat(n.factoryArgs);
  10207. r = c.apply(e, o)
  10208. }
  10209. n.before instanceof h && (n.before = n.before.__li),
  10210. C(e, r),
  10211. m.addClass(r.domElement, "c");
  10212. var a = document.createElement("span");
  10213. m.addClass(a, "property-name"),
  10214. a.innerHTML = r.property;
  10215. var s = document.createElement("div");
  10216. s.appendChild(a),
  10217. s.appendChild(r.domElement);
  10218. var l = A(e, s, n.before);
  10219. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10220. m.addClass(l, typeof r.getValue()),
  10221. function(t, i, n) {
  10222. if (n.__li = i,
  10223. n.__gui = t,
  10224. v.extend(n, {
  10225. options: function(e) {
  10226. return 1 < arguments.length ? (n.remove(),
  10227. y(t, n.object, n.property, {
  10228. before: n.__li.nextElementSibling,
  10229. factoryArgs: [v.toArray(arguments)]
  10230. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10231. y(t, n.object, n.property, {
  10232. before: n.__li.nextElementSibling,
  10233. factoryArgs: [e]
  10234. })) : void 0
  10235. },
  10236. name: function(e) {
  10237. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10238. n
  10239. },
  10240. listen: function() {
  10241. return n.__gui.listen(n),
  10242. n
  10243. },
  10244. remove: function() {
  10245. return n.__gui.remove(n),
  10246. n
  10247. }
  10248. }),
  10249. n instanceof f) {
  10250. var r = new p(n.object,n.property,{
  10251. min: n.__min,
  10252. max: n.__max,
  10253. step: n.__step
  10254. });
  10255. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10256. var t = n[e]
  10257. , i = r[e];
  10258. n[e] = r[e] = function() {
  10259. var e = Array.prototype.slice.call(arguments);
  10260. return t.apply(n, e),
  10261. i.apply(r, e)
  10262. }
  10263. }),
  10264. m.addClass(i, "has-slider"),
  10265. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10266. } else if (n instanceof p) {
  10267. var e = function(e) {
  10268. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10269. y(t, n.object, n.property, {
  10270. before: n.__li.nextElementSibling,
  10271. factoryArgs: [n.__min, n.__max, n.__step]
  10272. })) : e
  10273. };
  10274. n.min = v.compose(e, n.min),
  10275. n.max = v.compose(e, n.max)
  10276. } else
  10277. n instanceof u ? (m.bind(i, "click", function() {
  10278. m.fakeEvent(n.__checkbox, "click")
  10279. }),
  10280. m.bind(n.__checkbox, "click", function(e) {
  10281. e.stopPropagation()
  10282. })) : n instanceof d ? (m.bind(i, "click", function() {
  10283. m.fakeEvent(n.__button, "click")
  10284. }),
  10285. m.bind(i, "mouseover", function() {
  10286. m.addClass(n.__button, "hover")
  10287. }),
  10288. m.bind(i, "mouseout", function() {
  10289. m.removeClass(n.__button, "hover")
  10290. })) : n instanceof g && (m.addClass(i, "color"),
  10291. n.updateDisplay = v.compose(function(e) {
  10292. return i.style.borderLeftColor = n.__color.toString(),
  10293. e
  10294. }, n.updateDisplay),
  10295. n.updateDisplay());
  10296. n.setValue = v.compose(function(e) {
  10297. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10298. e
  10299. }, n.setValue)
  10300. }(e, l, r),
  10301. e.__controllers.push(r),
  10302. r
  10303. }
  10304. function A(e, t, i) {
  10305. var n = document.createElement("li");
  10306. return t && n.appendChild(t),
  10307. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10308. e.onResize(),
  10309. n
  10310. }
  10311. function C(e, t) {
  10312. var i = e.getRoot()
  10313. , n = i.__rememberedObjects.indexOf(t.object);
  10314. if (-1 != n) {
  10315. var r = i.__rememberedObjectIndecesToControllers[n];
  10316. if (void 0 === r && (r = {},
  10317. i.__rememberedObjectIndecesToControllers[n] = r),
  10318. r[t.property] = t,
  10319. i.load && i.load.remembered) {
  10320. var o, a = i.load.remembered;
  10321. if (a[e.preset])
  10322. o = a[e.preset];
  10323. else {
  10324. if (!a[T])
  10325. return;
  10326. o = a[T]
  10327. }
  10328. if (o[n] && void 0 !== o[n][t.property]) {
  10329. var s = o[n][t.property];
  10330. t.initialValue = s,
  10331. t.setValue(s)
  10332. }
  10333. }
  10334. }
  10335. }
  10336. function I(e, t) {
  10337. return document.location.href + "." + t
  10338. }
  10339. function l(e, t) {
  10340. e.domElement.style.width = t + "px",
  10341. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10342. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10343. }
  10344. function a(r, o) {
  10345. var a = {};
  10346. return v.each(r.__rememberedObjects, function(e, t) {
  10347. var i = {}
  10348. , n = r.__rememberedObjectIndecesToControllers[t];
  10349. v.each(n, function(e, t) {
  10350. i[t] = o ? e.initialValue : e.getValue()
  10351. }),
  10352. a[t] = i
  10353. }),
  10354. a
  10355. }
  10356. function E(e, t, i) {
  10357. var n = document.createElement("option");
  10358. n.innerHTML = t,
  10359. n.value = t,
  10360. e.__preset_select.appendChild(n),
  10361. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10362. }
  10363. function _(e, t) {
  10364. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10365. i.innerHTML = t ? i.value + "*" : i.value
  10366. }
  10367. 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");
  10368. var b, w, T = "Default", x = function() {
  10369. try {
  10370. return "localStorage"in window && null !== window.localStorage
  10371. } catch (e) {
  10372. return !1
  10373. }
  10374. }(), S = !0, s = !1, M = [], R = function(t) {
  10375. var i = this;
  10376. this.domElement = document.createElement("div"),
  10377. this.__ul = document.createElement("ul"),
  10378. this.domElement.appendChild(this.__ul),
  10379. m.addClass(this.domElement, "dg"),
  10380. this.__folders = {},
  10381. this.__controllers = [],
  10382. this.__rememberedObjects = [],
  10383. this.__rememberedObjectIndecesToControllers = [],
  10384. this.__listening = [],
  10385. t = t || {},
  10386. t = v.defaults(t, {
  10387. autoPlace: !0,
  10388. width: R.DEFAULT_WIDTH
  10389. }),
  10390. t = v.defaults(t, {
  10391. resizable: t.autoPlace,
  10392. hideable: t.autoPlace
  10393. }),
  10394. v.isUndefined(t.load) ? t.load = {
  10395. preset: T
  10396. } : t.preset && (t.load.preset = t.preset),
  10397. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10398. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10399. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10400. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10401. if (Object.defineProperties(this, {
  10402. parent: {
  10403. get: function() {
  10404. return t.parent
  10405. }
  10406. },
  10407. scrollable: {
  10408. get: function() {
  10409. return t.scrollable
  10410. }
  10411. },
  10412. autoPlace: {
  10413. get: function() {
  10414. return t.autoPlace
  10415. }
  10416. },
  10417. preset: {
  10418. get: function() {
  10419. return i.parent ? i.getRoot().preset : t.load.preset
  10420. },
  10421. set: function(e) {
  10422. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10423. function(e) {
  10424. for (var t = 0; t < e.__preset_select.length; t++)
  10425. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10426. }(this),
  10427. i.revert()
  10428. }
  10429. },
  10430. width: {
  10431. get: function() {
  10432. return t.width
  10433. },
  10434. set: function(e) {
  10435. t.width = e,
  10436. l(i, e)
  10437. }
  10438. },
  10439. name: {
  10440. get: function() {
  10441. return t.name
  10442. },
  10443. set: function(e) {
  10444. t.name = e,
  10445. a && (a.innerHTML = t.name)
  10446. }
  10447. },
  10448. closed: {
  10449. get: function() {
  10450. return t.closed
  10451. },
  10452. set: function(e) {
  10453. t.closed = e,
  10454. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10455. this.onResize(),
  10456. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10457. }
  10458. },
  10459. load: {
  10460. get: function() {
  10461. return t.load
  10462. }
  10463. },
  10464. useLocalStorage: {
  10465. get: function() {
  10466. return r
  10467. },
  10468. set: function(e) {
  10469. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10470. localStorage.setItem(I(0, "isLocal"), e))
  10471. }
  10472. }
  10473. }),
  10474. v.isUndefined(t.parent)) {
  10475. if (t.closed = !1,
  10476. m.addClass(this.domElement, R.CLASS_MAIN),
  10477. m.makeSelectable(this.domElement, !1),
  10478. x && r) {
  10479. i.useLocalStorage = !0;
  10480. var o = localStorage.getItem(I(0, "gui"));
  10481. o && (t.load = JSON.parse(o))
  10482. }
  10483. this.__closeButton = document.createElement("div"),
  10484. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10485. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10486. this.domElement.appendChild(this.__closeButton),
  10487. m.bind(this.__closeButton, "click", function() {
  10488. i.closed = !i.closed
  10489. })
  10490. } else {
  10491. void 0 === t.closed && (t.closed = !0);
  10492. var a = document.createTextNode(t.name);
  10493. m.addClass(a, "controller-name");
  10494. var s = A(i, a);
  10495. m.addClass(this.__ul, R.CLASS_CLOSED),
  10496. m.addClass(s, "title"),
  10497. m.bind(s, "click", function(e) {
  10498. return e.preventDefault(),
  10499. i.closed = !i.closed,
  10500. !1
  10501. }),
  10502. t.closed || (this.closed = !1)
  10503. }
  10504. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10505. m.addClass(w, "dg"),
  10506. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10507. document.body.appendChild(w),
  10508. S = !1),
  10509. w.appendChild(this.domElement),
  10510. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10511. this.parent || l(i, t.width)),
  10512. m.bind(window, "resize", function() {
  10513. i.onResize()
  10514. }),
  10515. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10516. i.onResize()
  10517. }),
  10518. m.bind(this.__ul, "transitionend", function() {
  10519. i.onResize()
  10520. }),
  10521. m.bind(this.__ul, "oTransitionEnd", function() {
  10522. i.onResize()
  10523. }),
  10524. this.onResize(),
  10525. t.resizable && function(t) {
  10526. function e(e) {
  10527. return e.preventDefault(),
  10528. r = e.clientX,
  10529. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10530. m.bind(window, "mousemove", i),
  10531. m.bind(window, "mouseup", n),
  10532. !1
  10533. }
  10534. function i(e) {
  10535. return e.preventDefault(),
  10536. t.width += r - e.clientX,
  10537. t.onResize(),
  10538. r = e.clientX,
  10539. !1
  10540. }
  10541. function n() {
  10542. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10543. m.unbind(window, "mousemove", i),
  10544. m.unbind(window, "mouseup", n)
  10545. }
  10546. var r;
  10547. t.__resize_handle = document.createElement("div"),
  10548. v.extend(t.__resize_handle.style, {
  10549. width: "6px",
  10550. marginLeft: "-3px",
  10551. height: "200px",
  10552. cursor: "ew-resize",
  10553. position: "absolute"
  10554. }),
  10555. m.bind(t.__resize_handle, "mousedown", e),
  10556. m.bind(t.__closeButton, "mousedown", e),
  10557. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10558. }(this),
  10559. n = function() {
  10560. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10561. }
  10562. ,
  10563. this.saveToLocalStorageIfPossible = n,
  10564. i.getRoot(),
  10565. t.parent || ((e = i.getRoot()).width += 1,
  10566. v.defer(function() {
  10567. e.width -= 1
  10568. }))
  10569. };
  10570. return R.toggleHide = function() {
  10571. s = !s,
  10572. v.each(M, function(e) {
  10573. e.domElement.style.zIndex = s ? -999 : 999,
  10574. e.domElement.style.opacity = s ? 0 : 1
  10575. })
  10576. }
  10577. ,
  10578. R.CLASS_AUTO_PLACE = "a",
  10579. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10580. R.CLASS_MAIN = "main",
  10581. R.CLASS_CONTROLLER_ROW = "cr",
  10582. R.CLASS_TOO_TALL = "taller-than-window",
  10583. R.CLASS_CLOSED = "closed",
  10584. R.CLASS_CLOSE_BUTTON = "close-button",
  10585. R.CLASS_DRAG = "drag",
  10586. R.DEFAULT_WIDTH = 245,
  10587. R.TEXT_CLOSED = "Close Controls",
  10588. R.TEXT_OPEN = "Open Controls",
  10589. m.bind(window, "keydown", function(e) {
  10590. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10591. }, !1),
  10592. v.extend(R.prototype, {
  10593. add: function(e, t) {
  10594. return y(this, e, t, {
  10595. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10596. })
  10597. },
  10598. addColor: function(e, t) {
  10599. return y(this, e, t, {
  10600. color: !0
  10601. })
  10602. },
  10603. remove: function(e) {
  10604. this.__ul.removeChild(e.__li),
  10605. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10606. var t = this;
  10607. v.defer(function() {
  10608. t.onResize()
  10609. })
  10610. },
  10611. destroy: function() {
  10612. this.autoPlace && w.removeChild(this.domElement)
  10613. },
  10614. addFolder: function(e) {
  10615. if (void 0 !== this.__folders[e])
  10616. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10617. var t = {
  10618. name: e,
  10619. parent: this
  10620. };
  10621. t.autoPlace = this.autoPlace,
  10622. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10623. t.load = this.load.folders[e]);
  10624. var i = new R(t);
  10625. this.__folders[e] = i;
  10626. var n = A(this, i.domElement);
  10627. return m.addClass(n, "folder"),
  10628. i
  10629. },
  10630. open: function() {
  10631. this.closed = !1
  10632. },
  10633. close: function() {
  10634. this.closed = !0
  10635. },
  10636. onResize: function() {
  10637. var t = this.getRoot();
  10638. if (t.scrollable) {
  10639. var e = m.getOffset(t.__ul).top
  10640. , i = 0;
  10641. v.each(t.__ul.childNodes, function(e) {
  10642. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10643. }),
  10644. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10645. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10646. t.__ul.style.height = "auto")
  10647. }
  10648. t.__resize_handle && v.defer(function() {
  10649. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10650. }),
  10651. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10652. },
  10653. remember: function() {
  10654. 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>'),
  10655. this.parent)
  10656. throw new Error("You can only call remember on a top level GUI.");
  10657. var t = this;
  10658. v.each(Array.prototype.slice.call(arguments), function(e) {
  10659. 0 == t.__rememberedObjects.length && function(i) {
  10660. var e = i.__save_row = document.createElement("li");
  10661. m.addClass(i.domElement, "has-save"),
  10662. i.__ul.insertBefore(e, i.__ul.firstChild),
  10663. m.addClass(e, "save-row");
  10664. var t = document.createElement("span");
  10665. t.innerHTML = "&nbsp;",
  10666. m.addClass(t, "button gears");
  10667. var n = document.createElement("span");
  10668. n.innerHTML = "Save",
  10669. m.addClass(n, "button"),
  10670. m.addClass(n, "save");
  10671. var r = document.createElement("span");
  10672. r.innerHTML = "New",
  10673. m.addClass(r, "button"),
  10674. m.addClass(r, "save-as");
  10675. var o = document.createElement("span");
  10676. o.innerHTML = "Revert",
  10677. m.addClass(o, "button"),
  10678. m.addClass(o, "revert");
  10679. var a = i.__preset_select = document.createElement("select");
  10680. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10681. E(i, t, t == i.preset)
  10682. }) : E(i, T, !1),
  10683. m.bind(a, "change", function() {
  10684. for (var e = 0; e < i.__preset_select.length; e++)
  10685. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10686. i.preset = this.value
  10687. }),
  10688. e.appendChild(a),
  10689. e.appendChild(t),
  10690. e.appendChild(n),
  10691. e.appendChild(r),
  10692. e.appendChild(o),
  10693. x) {
  10694. var s = document.getElementById("dg-save-locally")
  10695. , l = document.getElementById("dg-local-explain");
  10696. s.style.display = "block";
  10697. var c = document.getElementById("dg-local-storage");
  10698. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10699. var h = function() {
  10700. l.style.display = i.useLocalStorage ? "block" : "none"
  10701. };
  10702. h(),
  10703. m.bind(c, "change", function() {
  10704. i.useLocalStorage = !i.useLocalStorage,
  10705. h()
  10706. })
  10707. }
  10708. var u = document.getElementById("dg-new-constructor");
  10709. m.bind(u, "keydown", function(e) {
  10710. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10711. }),
  10712. m.bind(t, "click", function() {
  10713. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10714. b.show(),
  10715. u.focus(),
  10716. u.select()
  10717. }),
  10718. m.bind(n, "click", function() {
  10719. i.save()
  10720. }),
  10721. m.bind(r, "click", function() {
  10722. var e = prompt("Enter a new preset name.");
  10723. e && i.saveAs(e)
  10724. }),
  10725. m.bind(o, "click", function() {
  10726. i.revert()
  10727. })
  10728. }(t),
  10729. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10730. }),
  10731. this.autoPlace && l(this, this.width)
  10732. },
  10733. getRoot: function() {
  10734. for (var e = this; e.parent; )
  10735. e = e.parent;
  10736. return e
  10737. },
  10738. getSaveObject: function() {
  10739. var i = this.load;
  10740. return i.closed = this.closed,
  10741. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10742. i.remembered || (i.remembered = {}),
  10743. i.remembered[this.preset] = a(this)),
  10744. i.folders = {},
  10745. v.each(this.__folders, function(e, t) {
  10746. i.folders[t] = e.getSaveObject()
  10747. }),
  10748. i
  10749. },
  10750. save: function() {
  10751. this.load.remembered || (this.load.remembered = {}),
  10752. this.load.remembered[this.preset] = a(this),
  10753. _(this, !1),
  10754. this.saveToLocalStorageIfPossible()
  10755. },
  10756. saveAs: function(e) {
  10757. this.load.remembered || (this.load.remembered = {},
  10758. this.load.remembered[T] = a(this, !0)),
  10759. this.load.remembered[e] = a(this),
  10760. this.preset = e,
  10761. E(this, e, !0),
  10762. this.saveToLocalStorageIfPossible()
  10763. },
  10764. revert: function(t) {
  10765. v.each(this.__controllers, function(e) {
  10766. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10767. }, this),
  10768. v.each(this.__folders, function(e) {
  10769. e.revert(e)
  10770. }),
  10771. t || _(this.getRoot(), !1)
  10772. },
  10773. listen: function(e) {
  10774. var t = 0 == this.__listening.length;
  10775. this.__listening.push(e),
  10776. t && function e(t) {
  10777. 0 != t.length && r(function() {
  10778. e(t)
  10779. }),
  10780. v.each(t, function(e) {
  10781. e.updateDisplay()
  10782. })
  10783. }(this.__listening)
  10784. }
  10785. }),
  10786. R
  10787. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10788. u = ee.controllers.NumberControllerBox,
  10789. d = ee.controllers.NumberControllerSlider,
  10790. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10791. y = ee.dom.dom,
  10792. A = ee.utils.common,
  10793. (C = function(e, t) {
  10794. function i() {
  10795. n.setValue(n.__input.value)
  10796. }
  10797. C.superclass.call(this, e, t);
  10798. var n = this;
  10799. this.__input = document.createElement("input"),
  10800. this.__input.setAttribute("type", "text"),
  10801. y.bind(this.__input, "keyup", i),
  10802. y.bind(this.__input, "change", i),
  10803. y.bind(this.__input, "blur", function() {
  10804. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10805. }),
  10806. y.bind(this.__input, "keydown", function(e) {
  10807. 13 === e.keyCode && this.blur()
  10808. }),
  10809. this.updateDisplay(),
  10810. this.domElement.appendChild(this.__input)
  10811. }
  10812. ).superclass = v,
  10813. A.extend(C.prototype, v.prototype, {
  10814. updateDisplay: function() {
  10815. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10816. C.superclass.prototype.updateDisplay.call(this)
  10817. }
  10818. }),
  10819. C),
  10820. f = ee.controllers.FunctionController,
  10821. g = ee.controllers.BooleanController,
  10822. m = ee.utils.common,
  10823. function(e, t) {
  10824. var i = e[t];
  10825. 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,{
  10826. min: arguments[2],
  10827. max: arguments[3]
  10828. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10829. }
  10830. ), 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) {
  10831. function f(t, i, n, r) {
  10832. t.style.background = "",
  10833. p.each(o, function(e) {
  10834. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10835. })
  10836. }
  10837. var g = function(e, t) {
  10838. function i(e) {
  10839. a(e),
  10840. h.bind(window, "mousemove", a),
  10841. h.bind(window, "mouseup", n)
  10842. }
  10843. function n() {
  10844. h.unbind(window, "mousemove", a),
  10845. h.unbind(window, "mouseup", n)
  10846. }
  10847. function r() {
  10848. var e = d(this.value);
  10849. !1 !== e ? (l.__color.__state = e,
  10850. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10851. }
  10852. function o() {
  10853. h.unbind(window, "mousemove", s),
  10854. h.unbind(window, "mouseup", o)
  10855. }
  10856. function a(e) {
  10857. e.preventDefault();
  10858. var t = h.getWidth(l.__saturation_field)
  10859. , i = h.getOffset(l.__saturation_field)
  10860. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10861. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10862. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10863. 1 < n ? n = 1 : n < 0 && (n = 0),
  10864. l.__color.v = r,
  10865. l.__color.s = n,
  10866. l.setValue(l.__color.toOriginal()),
  10867. !1
  10868. }
  10869. function s(e) {
  10870. e.preventDefault();
  10871. var t = h.getHeight(l.__hue_field)
  10872. , i = h.getOffset(l.__hue_field)
  10873. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10874. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10875. l.__color.h = 360 * n,
  10876. l.setValue(l.__color.toOriginal()),
  10877. !1
  10878. }
  10879. g.superclass.call(this, e, t),
  10880. this.__color = new u(this.getValue()),
  10881. this.__temp = new u(0);
  10882. var l = this;
  10883. this.domElement = document.createElement("div"),
  10884. h.makeSelectable(this.domElement, !1),
  10885. this.__selector = document.createElement("div"),
  10886. this.__selector.className = "selector",
  10887. this.__saturation_field = document.createElement("div"),
  10888. this.__saturation_field.className = "saturation-field",
  10889. this.__field_knob = document.createElement("div"),
  10890. this.__field_knob.className = "field-knob",
  10891. this.__field_knob_border = "2px solid ",
  10892. this.__hue_knob = document.createElement("div"),
  10893. this.__hue_knob.className = "hue-knob",
  10894. this.__hue_field = document.createElement("div"),
  10895. this.__hue_field.className = "hue-field",
  10896. this.__input = document.createElement("input"),
  10897. this.__input.type = "text",
  10898. this.__input_textShadow = "0 1px 1px ",
  10899. h.bind(this.__input, "keydown", function(e) {
  10900. 13 === e.keyCode && r.call(this)
  10901. }),
  10902. h.bind(this.__input, "blur", r),
  10903. h.bind(this.__selector, "mousedown", function(e) {
  10904. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10905. h.removeClass(l.__selector, "drag")
  10906. })
  10907. });
  10908. var c = document.createElement("div");
  10909. p.extend(this.__selector.style, {
  10910. width: "122px",
  10911. height: "102px",
  10912. padding: "3px",
  10913. backgroundColor: "#222",
  10914. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10915. }),
  10916. p.extend(this.__field_knob.style, {
  10917. position: "absolute",
  10918. width: "12px",
  10919. height: "12px",
  10920. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10921. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10922. borderRadius: "12px",
  10923. zIndex: 1
  10924. }),
  10925. p.extend(this.__hue_knob.style, {
  10926. position: "absolute",
  10927. width: "15px",
  10928. height: "2px",
  10929. borderRight: "4px solid #fff",
  10930. zIndex: 1
  10931. }),
  10932. p.extend(this.__saturation_field.style, {
  10933. width: "100px",
  10934. height: "100px",
  10935. border: "1px solid #555",
  10936. marginRight: "3px",
  10937. display: "inline-block",
  10938. cursor: "pointer"
  10939. }),
  10940. p.extend(c.style, {
  10941. width: "100%",
  10942. height: "100%",
  10943. background: "none"
  10944. }),
  10945. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10946. p.extend(this.__hue_field.style, {
  10947. width: "15px",
  10948. height: "100px",
  10949. display: "inline-block",
  10950. border: "1px solid #555",
  10951. cursor: "ns-resize"
  10952. }),
  10953. function(e) {
  10954. e.style.background = "",
  10955. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10956. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10957. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10958. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10959. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10960. }(this.__hue_field),
  10961. p.extend(this.__input.style, {
  10962. outline: "none",
  10963. textAlign: "center",
  10964. color: "#fff",
  10965. border: 0,
  10966. fontWeight: "bold",
  10967. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10968. }),
  10969. h.bind(this.__saturation_field, "mousedown", i),
  10970. h.bind(this.__field_knob, "mousedown", i),
  10971. h.bind(this.__hue_field, "mousedown", function(e) {
  10972. s(e),
  10973. h.bind(window, "mousemove", s),
  10974. h.bind(window, "mouseup", o)
  10975. }),
  10976. this.__saturation_field.appendChild(c),
  10977. this.__selector.appendChild(this.__field_knob),
  10978. this.__selector.appendChild(this.__saturation_field),
  10979. this.__selector.appendChild(this.__hue_field),
  10980. this.__hue_field.appendChild(this.__hue_knob),
  10981. this.domElement.appendChild(this.__input),
  10982. this.domElement.appendChild(this.__selector),
  10983. this.updateDisplay()
  10984. };
  10985. g.superclass = e,
  10986. p.extend(g.prototype, e.prototype, {
  10987. updateDisplay: function() {
  10988. var t = d(this.getValue());
  10989. if (!1 !== t) {
  10990. var i = !1;
  10991. p.each(u.COMPONENTS, function(e) {
  10992. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10993. return i = !0,
  10994. {}
  10995. }, this),
  10996. i && p.extend(this.__color.__state, t)
  10997. }
  10998. p.extend(this.__temp.__state, this.__color.__state),
  10999. this.__temp.a = 1;
  11000. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11001. , n = 255 - e;
  11002. p.extend(this.__field_knob.style, {
  11003. marginLeft: 100 * this.__color.s - 7 + "px",
  11004. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11005. backgroundColor: this.__temp.toString(),
  11006. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11007. }),
  11008. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11009. this.__temp.s = 1,
  11010. this.__temp.v = 1,
  11011. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11012. p.extend(this.__input.style, {
  11013. backgroundColor: this.__input.value = this.__color.toString(),
  11014. color: "rgb(" + e + "," + e + "," + e + ")",
  11015. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11016. })
  11017. }
  11018. });
  11019. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11020. return g
  11021. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11022. a = ee.color.math = {
  11023. hsv_to_rgb: function(e, t, i) {
  11024. var n = Math.floor(e / 60) % 6
  11025. , r = e / 60 - Math.floor(e / 60)
  11026. , o = i * (1 - t)
  11027. , a = i * (1 - r * t)
  11028. , s = i * (1 - (1 - r) * t)
  11029. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11030. return {
  11031. r: 255 * l[0],
  11032. g: 255 * l[1],
  11033. b: 255 * l[2]
  11034. }
  11035. },
  11036. rgb_to_hsv: function(e, t, i) {
  11037. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11038. return 0 == o ? {
  11039. h: NaN,
  11040. s: 0,
  11041. v: 0
  11042. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11043. (n /= 6) < 0 && (n += 1),
  11044. {
  11045. h: 360 * n,
  11046. s: a / o,
  11047. v: o / 255
  11048. })
  11049. },
  11050. rgb_to_hex: function(e, t, i) {
  11051. var n = this.hex_with_component(0, 2, e);
  11052. return n = this.hex_with_component(n, 1, t),
  11053. this.hex_with_component(n, 0, i)
  11054. },
  11055. component_from_hex: function(e, t) {
  11056. return e >> 8 * t & 255
  11057. },
  11058. hex_with_component: function(e, t, i) {
  11059. return i << (c = 8 * t) | e & ~(255 << c)
  11060. }
  11061. },
  11062. s = ee.color.toString,
  11063. l = ee.utils.common,
  11064. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11065. l.extend(ae.prototype, {
  11066. toString: function() {
  11067. return s(this)
  11068. },
  11069. toOriginal: function() {
  11070. return this.__state.conversion.write(this)
  11071. }
  11072. }),
  11073. ie(ae.prototype, "r", 2),
  11074. ie(ae.prototype, "g", 1),
  11075. ie(ae.prototype, "b", 0),
  11076. ne(ae.prototype, "h"),
  11077. ne(ae.prototype, "s"),
  11078. ne(ae.prototype, "v"),
  11079. Object.defineProperty(ae.prototype, "a", {
  11080. get: function() {
  11081. return this.__state.a
  11082. },
  11083. set: function(e) {
  11084. this.__state.a = e
  11085. }
  11086. }),
  11087. Object.defineProperty(ae.prototype, "hex", {
  11088. get: function() {
  11089. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11090. this.__state.hex
  11091. },
  11092. set: function(e) {
  11093. this.__state.space = "HEX",
  11094. this.__state.hex = e
  11095. }
  11096. }),
  11097. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11098. window.setTimeout(e, 1e3 / 60)
  11099. }
  11100. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11101. r = ee.utils.common,
  11102. te.prototype.show = function() {
  11103. var e = this;
  11104. this.backgroundElement.style.display = "block",
  11105. this.domElement.style.display = "block",
  11106. this.domElement.style.opacity = 0,
  11107. this.domElement.style.webkitTransform = "scale(1.1)",
  11108. this.layout(),
  11109. r.defer(function() {
  11110. e.backgroundElement.style.opacity = 1,
  11111. e.domElement.style.opacity = 1,
  11112. e.domElement.style.webkitTransform = "scale(1)"
  11113. })
  11114. }
  11115. ,
  11116. te.prototype.hide = function() {
  11117. var e = this
  11118. , t = function() {
  11119. e.domElement.style.display = "none",
  11120. e.backgroundElement.style.display = "none",
  11121. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11122. n.unbind(e.domElement, "transitionend", t),
  11123. n.unbind(e.domElement, "oTransitionEnd", t)
  11124. };
  11125. n.bind(this.domElement, "webkitTransitionEnd", t),
  11126. n.bind(this.domElement, "transitionend", t),
  11127. n.bind(this.domElement, "oTransitionEnd", t),
  11128. this.backgroundElement.style.opacity = 0,
  11129. this.domElement.style.opacity = 0,
  11130. this.domElement.style.webkitTransform = "scale(1.1)"
  11131. }
  11132. ,
  11133. te.prototype.layout = function() {
  11134. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11135. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11136. }
  11137. ,
  11138. te), ee.dom.dom, ee.utils.common)
  11139. }
  11140. , {}],
  11141. 94: [function(e, t, i) {
  11142. (function(J) {
  11143. "use strict";
  11144. function i(e) {
  11145. function t(e, t) {
  11146. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11147. for (var a = 1; a <= e[o]; a++)
  11148. r[t[n]] = [],
  11149. r[t[n]][0] = i,
  11150. r[t[n]][1] = o,
  11151. n++,
  11152. i++;
  11153. i *= 2
  11154. }
  11155. return r
  11156. }
  11157. function _(e) {
  11158. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11159. t & 1 << i && (B |= 1 << V),
  11160. i--,
  11161. --V < 0 && (255 == B ? (b(255),
  11162. b(0)) : b(B),
  11163. V = 7,
  11164. B = 0)
  11165. }
  11166. function b(e) {
  11167. F.push(e)
  11168. }
  11169. function w(e) {
  11170. b(e >> 8 & 255),
  11171. b(255 & e)
  11172. }
  11173. function T(e, t, i, n, r) {
  11174. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11175. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11176. for (h = 0; h < 8; ++h) {
  11177. i = e[d],
  11178. n = e[d + 1],
  11179. r = e[d + 2],
  11180. o = e[d + 3],
  11181. a = e[d + 4],
  11182. s = e[d + 5],
  11183. l = e[d + 6];
  11184. var p = i + (c = e[d + 7])
  11185. , f = i - c
  11186. , g = n + l
  11187. , m = n - l
  11188. , v = r + s
  11189. , y = r - s
  11190. , A = o + a
  11191. , C = o - a
  11192. , I = p + A
  11193. , E = p - A
  11194. , _ = g + v
  11195. , b = g - v;
  11196. e[d] = I + _,
  11197. e[d + 4] = I - _;
  11198. var w = .707106781 * (b + E);
  11199. e[d + 2] = E + w,
  11200. e[d + 6] = E - w;
  11201. var T = .382683433 * ((I = C + y) - (b = m + f))
  11202. , x = .5411961 * I + T
  11203. , S = 1.306562965 * b + T
  11204. , M = .707106781 * (_ = y + m)
  11205. , R = f + M
  11206. , P = f - M;
  11207. e[d + 5] = P + x,
  11208. e[d + 3] = P - x,
  11209. e[d + 1] = R + S,
  11210. e[d + 7] = R - S,
  11211. d += 8
  11212. }
  11213. for (h = d = 0; h < 8; ++h) {
  11214. i = e[d],
  11215. n = e[d + 8],
  11216. r = e[d + 16],
  11217. o = e[d + 24],
  11218. a = e[d + 32],
  11219. s = e[d + 40],
  11220. l = e[d + 48];
  11221. var O = i + (c = e[d + 56])
  11222. , L = i - c
  11223. , D = n + l
  11224. , N = n - l
  11225. , F = r + s
  11226. , B = r - s
  11227. , V = o + a
  11228. , k = o - a
  11229. , U = O + V
  11230. , H = O - V
  11231. , z = D + F
  11232. , G = D - F;
  11233. e[d] = U + z,
  11234. e[d + 32] = U - z;
  11235. var W = .707106781 * (G + H);
  11236. e[d + 16] = H + W,
  11237. e[d + 48] = H - W;
  11238. var j = .382683433 * ((U = k + B) - (G = N + L))
  11239. , Y = .5411961 * U + j
  11240. , q = 1.306562965 * G + j
  11241. , X = .707106781 * (z = B + N)
  11242. , Z = L + X
  11243. , K = L - X;
  11244. e[d + 40] = K + Y,
  11245. e[d + 24] = K - Y,
  11246. e[d + 8] = Z + q,
  11247. e[d + 56] = Z - q,
  11248. d++
  11249. }
  11250. for (h = 0; h < 64; ++h)
  11251. u = e[h] * t[h],
  11252. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11253. return Q
  11254. }(e, t), c = 0; c < 64; ++c)
  11255. A[C[c]] = l[c];
  11256. var h = A[0] - i;
  11257. i = A[0],
  11258. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11259. _(v[o]));
  11260. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11261. ;
  11262. if (0 == u)
  11263. return _(a),
  11264. i;
  11265. for (var d, p = 1; p <= u; ) {
  11266. for (var f = p; 0 == A[p] && p <= u; ++p)
  11267. ;
  11268. var g = p - f;
  11269. if (16 <= g) {
  11270. d = g >> 4;
  11271. for (var m = 1; m <= d; ++m)
  11272. _(s);
  11273. g &= 15
  11274. }
  11275. o = 32767 + A[p],
  11276. _(r[(g << 4) + y[o]]),
  11277. _(v[o]),
  11278. p++
  11279. }
  11280. return 63 != u && _(a),
  11281. i
  11282. }
  11283. function x(e) {
  11284. if (e <= 0 && (e = 1),
  11285. 100 < e && (e = 100),
  11286. i != e) {
  11287. (function(e) {
  11288. 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++) {
  11289. var n = u((t[i] * e + 50) / 100);
  11290. n < 1 ? n = 1 : 255 < n && (n = 255),
  11291. O[C[i]] = n
  11292. }
  11293. 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++) {
  11294. var a = u((r[o] * e + 50) / 100);
  11295. a < 1 ? a = 1 : 255 < a && (a = 255),
  11296. L[C[o]] = a
  11297. }
  11298. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11299. for (var h = 0; h < 8; h++)
  11300. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11301. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11302. l++
  11303. }
  11304. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11305. i = e
  11306. }
  11307. }
  11308. var S, M, R, P, i, u = (Math.round,
  11309. 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];
  11310. this.encode = function(e, t) {
  11311. var i = ((new Date).getTime(),
  11312. t.quality);
  11313. i && x(i),
  11314. F = new Array,
  11315. B = 0,
  11316. V = 7,
  11317. w(65496),
  11318. w(65504),
  11319. w(16),
  11320. b(74),
  11321. b(70),
  11322. b(73),
  11323. b(70),
  11324. b(0),
  11325. b(1),
  11326. b(1),
  11327. b(0),
  11328. w(1),
  11329. w(1),
  11330. b(0),
  11331. b(0),
  11332. function() {
  11333. w(65499),
  11334. w(132),
  11335. b(0);
  11336. for (var e = 0; e < 64; e++)
  11337. b(O[e]);
  11338. b(1);
  11339. for (var t = 0; t < 64; t++)
  11340. b(L[t])
  11341. }(),
  11342. function(e, t) {
  11343. w(65472),
  11344. w(17),
  11345. b(8),
  11346. w(t),
  11347. w(e),
  11348. b(3),
  11349. b(1),
  11350. b(17),
  11351. b(0),
  11352. b(2),
  11353. b(17),
  11354. b(1),
  11355. b(3),
  11356. b(17),
  11357. b(1)
  11358. }(e.width, e.height),
  11359. function() {
  11360. w(65476),
  11361. w(418),
  11362. b(0);
  11363. for (var e = 0; e < 16; e++)
  11364. b(G[e + 1]);
  11365. for (var t = 0; t <= 11; t++)
  11366. b(W[t]);
  11367. b(16);
  11368. for (var i = 0; i < 16; i++)
  11369. b(j[i + 1]);
  11370. for (var n = 0; n <= 161; n++)
  11371. b(Y[n]);
  11372. b(1);
  11373. for (var r = 0; r < 16; r++)
  11374. b(q[r + 1]);
  11375. for (var o = 0; o <= 11; o++)
  11376. b(X[o]);
  11377. b(17);
  11378. for (var a = 0; a < 16; a++)
  11379. b(Z[a + 1]);
  11380. for (var s = 0; s <= 161; s++)
  11381. b(K[s])
  11382. }(),
  11383. w(65498),
  11384. w(12),
  11385. b(3),
  11386. b(1),
  11387. b(0),
  11388. b(2),
  11389. b(17),
  11390. b(3),
  11391. b(17),
  11392. b(0),
  11393. b(63),
  11394. b(0);
  11395. var n = 0
  11396. , r = 0
  11397. , o = 0;
  11398. B = 0,
  11399. V = 7,
  11400. this.encode.displayName = "_encode_";
  11401. 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; ) {
  11402. for (a = 0; a < A; ) {
  11403. for (u = h = A * C + a,
  11404. d = -1,
  11405. f = p = 0; f < 64; f++)
  11406. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11407. v <= C + p && (u -= A * (C + 1 + p - v)),
  11408. A <= a + d && (u -= a + d - A + 4),
  11409. s = g[u++],
  11410. l = g[u++],
  11411. c = g[u++],
  11412. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11413. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11414. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11415. n = T(k, D, n, S, R),
  11416. r = T(U, N, r, M, P),
  11417. o = T(H, N, o, M, P),
  11418. a += 32
  11419. }
  11420. C += I
  11421. }
  11422. if (0 <= V) {
  11423. var E = [];
  11424. E[1] = V + 1,
  11425. E[0] = (1 << V + 1) - 1,
  11426. _(E)
  11427. }
  11428. return w(65497),
  11429. new J(F)
  11430. }
  11431. ,
  11432. (new Date).getTime(),
  11433. e = e || 50,
  11434. function() {
  11435. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11436. n[t] = e(t)
  11437. }(),
  11438. S = t(G, W),
  11439. M = t(q, X),
  11440. R = t(j, Y),
  11441. P = t(Z, K),
  11442. function() {
  11443. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11444. for (var n = e; n < t; n++)
  11445. y[32767 + n] = i,
  11446. v[32767 + n] = [],
  11447. v[32767 + n][1] = i,
  11448. v[32767 + n][0] = n;
  11449. for (var r = -(t - 1); r <= -e; r++)
  11450. y[32767 + r] = i,
  11451. v[32767 + r] = [],
  11452. v[32767 + r][1] = i,
  11453. v[32767 + r][0] = t - 1 + r;
  11454. e <<= 1,
  11455. t <<= 1
  11456. }
  11457. }(),
  11458. function() {
  11459. for (var e = 0; e < 256; e++)
  11460. z[e] = 19595 * e,
  11461. z[e + 256 >> 0] = 38470 * e,
  11462. z[e + 512 >> 0] = 7471 * e + 32768,
  11463. z[e + 768 >> 0] = -11059 * e,
  11464. z[e + 1024 >> 0] = -21709 * e,
  11465. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11466. z[e + 1536 >> 0] = -27439 * e,
  11467. z[e + 1792 >> 0] = -5329 * e
  11468. }(),
  11469. x(e),
  11470. (new Date).getTime()
  11471. }
  11472. t.exports.encode = function(e, t) {
  11473. return (t = t || {}).quality = t.quality || 50,
  11474. {
  11475. data: new i(t.quality).encode(e, t),
  11476. width: e.width,
  11477. height: e.height
  11478. }
  11479. }
  11480. }
  11481. ).call(this, e("buffer").Buffer)
  11482. }
  11483. , {
  11484. buffer: 198
  11485. }],
  11486. 95: [function(e, t, i) {
  11487. "use strict";
  11488. !function() {
  11489. if ("performance"in window == 0 && (window.performance = {}),
  11490. Date.now = Date.now || function() {
  11491. return (new Date).getTime()
  11492. }
  11493. ,
  11494. "now"in window.performance == 0) {
  11495. var e = Date.now();
  11496. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11497. window.performance.now = function() {
  11498. return Date.now() - e
  11499. }
  11500. }
  11501. }()
  11502. }
  11503. , {}],
  11504. 96: [function(e, t, i) {
  11505. "use strict";
  11506. var a = e("three");
  11507. a.EffectComposer = function(e, t) {
  11508. if (this.renderer = e,
  11509. void 0 === t) {
  11510. var i = {
  11511. minFilter: a.LinearFilter,
  11512. magFilter: a.LinearFilter,
  11513. format: a.RGBAFormat,
  11514. stencilBuffer: !1
  11515. }
  11516. , n = e.getSize();
  11517. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11518. }
  11519. this.renderTarget1 = t,
  11520. this.renderTarget2 = t.clone(),
  11521. this.writeBuffer = this.renderTarget1,
  11522. this.readBuffer = this.renderTarget2,
  11523. this.passes = [],
  11524. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11525. this.copyPass = new a.ShaderPass(a.CopyShader)
  11526. }
  11527. ,
  11528. a.EffectComposer.prototype = {
  11529. swapBuffers: function() {
  11530. var e = this.readBuffer;
  11531. this.readBuffer = this.writeBuffer,
  11532. this.writeBuffer = e
  11533. },
  11534. addPass: function(e) {
  11535. this.passes.push(e)
  11536. },
  11537. insertPass: function(e, t) {
  11538. this.passes.splice(t, 0, e)
  11539. },
  11540. render: function(e) {
  11541. this.writeBuffer = this.renderTarget1,
  11542. this.readBuffer = this.renderTarget2;
  11543. var t, i, n = !1, r = this.passes.length;
  11544. for (i = 0; i < r; i++)
  11545. if ((t = this.passes[i]).enabled) {
  11546. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11547. t.needsSwap) {
  11548. if (n) {
  11549. var o = this.renderer.context;
  11550. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11551. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11552. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11553. }
  11554. this.swapBuffers()
  11555. }
  11556. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11557. }
  11558. },
  11559. reset: function(e) {
  11560. if (void 0 === e) {
  11561. var t = this.renderer.getSize();
  11562. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11563. }
  11564. this.renderTarget1.dispose(),
  11565. this.renderTarget2.dispose(),
  11566. this.renderTarget1 = e,
  11567. this.renderTarget2 = e.clone(),
  11568. this.writeBuffer = this.renderTarget1,
  11569. this.readBuffer = this.renderTarget2
  11570. },
  11571. setSize: function(e, t) {
  11572. this.renderTarget1.setSize(e, t),
  11573. this.renderTarget2.setSize(e, t)
  11574. this.passes.forEach(a=>{//add for TransitionPass
  11575. a.setSize && a.setSize(e, t)
  11576. })
  11577. }
  11578. }
  11579. }
  11580. , {
  11581. three: 217
  11582. }],
  11583. 97: [function(e, t, i) {
  11584. "use strict";
  11585. var n = e("three");
  11586. n.MaskPass = function(e, t) {
  11587. this.scene = e,
  11588. this.camera = t,
  11589. this.enabled = !0,
  11590. this.clear = !0,
  11591. this.needsSwap = !1,
  11592. this.inverse = !1
  11593. }
  11594. ,
  11595. n.MaskPass.prototype = {
  11596. render: function(e, t, i, n) {
  11597. var r, o, a = e.context;
  11598. a.colorMask(!1, !1, !1, !1),
  11599. a.depthMask(!1),
  11600. o = this.inverse ? (r = 0,
  11601. 1) : (r = 1,
  11602. 0),
  11603. a.enable(a.STENCIL_TEST),
  11604. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11605. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11606. a.clearStencil(o),
  11607. e.render(this.scene, this.camera, i, this.clear),
  11608. e.render(this.scene, this.camera, t, this.clear),
  11609. a.colorMask(!0, !0, !0, !0),
  11610. a.depthMask(!0),
  11611. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11612. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11613. }
  11614. },
  11615. n.ClearMaskPass = function() {
  11616. this.enabled = !0
  11617. }
  11618. ,
  11619. n.ClearMaskPass.prototype = {
  11620. render: function(e, t, i, n) {
  11621. var r = e.context;
  11622. r.disable(r.STENCIL_TEST)
  11623. }
  11624. }
  11625. }
  11626. , {
  11627. three: 217
  11628. }],
  11629. 98: [function(e, t, i) {
  11630. "use strict";
  11631. var o = e("three");
  11632. o.RenderPass = function(e, t, i, n, r) {
  11633. this.scene = e,
  11634. this.camera = t,
  11635. this.overrideMaterial = i,
  11636. this.clearColor = n,
  11637. this.clearAlpha = void 0 !== r ? r : 1,
  11638. this.oldClearColor = new o.Color,
  11639. this.oldClearAlpha = 1,
  11640. this.enabled = !0,
  11641. this.clear = !0,
  11642. this.needsSwap = !1
  11643. }
  11644. ,
  11645. o.RenderPass.prototype = {
  11646. render: function(e, t, i, n) {
  11647. this.scene.overrideMaterial = this.overrideMaterial,
  11648. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11649. this.oldClearAlpha = e.getClearAlpha(),
  11650. e.setClearColor(this.clearColor, this.clearAlpha)),
  11651. e.render(this.scene, this.camera, i, this.clear),
  11652. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11653. this.scene.overrideMaterial = null
  11654. }
  11655. }
  11656. }
  11657. , {
  11658. three: 217
  11659. }],
  11660. 99: [function(e, t, i) {
  11661. "use strict";
  11662. var n = e("three");
  11663. n.ShaderPass = function(e, t) {
  11664. this.textureID = void 0 !== t ? t : "tDiffuse",
  11665. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11666. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11667. this.material = new n.ShaderMaterial({
  11668. defines: e.defines || {},
  11669. uniforms: this.uniforms,
  11670. vertexShader: e.vertexShader,
  11671. fragmentShader: e.fragmentShader
  11672. })),
  11673. this.renderToScreen = !1,
  11674. this.enabled = !0,
  11675. this.needsSwap = !0,
  11676. this.clear = !1,
  11677. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11678. this.scene = new n.Scene,
  11679. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11680. this.scene.add(this.quad)
  11681. }
  11682. ,
  11683. n.ShaderPass.prototype = {
  11684. render: function(e, t, i, n) {
  11685. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11686. this.quad.material = this.material,
  11687. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11688. }
  11689. }
  11690. }
  11691. , {
  11692. three: 217
  11693. }],
  11694. 100: [function(e, t, i) {
  11695. "use strict";
  11696. e("three").CopyShader = {
  11697. uniforms: {
  11698. tDiffuse: {
  11699. type: "t",
  11700. value: null
  11701. },
  11702. opacity: {
  11703. type: "f",
  11704. value: 1
  11705. }
  11706. },
  11707. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11708. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11709. }
  11710. }
  11711. , {
  11712. three: 217
  11713. }],
  11714. 101: [function(e, t, i) {
  11715. "use strict";
  11716. e("three").HorizontalBlurShader = {
  11717. uniforms: {
  11718. tDiffuse: {
  11719. type: "t",
  11720. value: null
  11721. },
  11722. h: {
  11723. type: "f",
  11724. value: 1 / 512
  11725. }
  11726. },
  11727. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11728. 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")
  11729. }
  11730. }
  11731. , {
  11732. three: 217
  11733. }],
  11734. 102: [function(e, t, i) {
  11735. "use strict";
  11736. e("three").VerticalBlurShader = {
  11737. uniforms: {
  11738. tDiffuse: {
  11739. type: "t",
  11740. value: null
  11741. },
  11742. v: {
  11743. type: "f",
  11744. value: 1 / 512
  11745. }
  11746. },
  11747. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11748. 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")
  11749. }
  11750. }
  11751. , {
  11752. three: 217
  11753. }],
  11754. 103: [function(e, t, i) {
  11755. "use strict";
  11756. var z = e("three");
  11757. !function() {
  11758. if ("performance"in window == 0 && (window.performance = {}),
  11759. "now"in window.performance == 0) {
  11760. var e = Date.now();
  11761. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11762. window.performance.now = function() {
  11763. return Date.now() - e
  11764. }
  11765. }
  11766. }(),
  11767. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11768. var t, i = this.extensions, n = this.context;
  11769. if (e === z.RepeatWrapping)
  11770. return n.REPEAT;
  11771. if (e === z.ClampToEdgeWrapping)
  11772. return n.CLAMP_TO_EDGE;
  11773. if (e === z.MirroredRepeatWrapping)
  11774. return n.MIRRORED_REPEAT;
  11775. if (e === z.NearestFilter)
  11776. return n.NEAREST;
  11777. if (e === z.NearestMipMapNearestFilter)
  11778. return n.NEAREST_MIPMAP_NEAREST;
  11779. if (e === z.NearestMipMapLinearFilter)
  11780. return n.NEAREST_MIPMAP_LINEAR;
  11781. if (e === z.LinearFilter)
  11782. return n.LINEAR;
  11783. if (e === z.LinearMipMapNearestFilter)
  11784. return n.LINEAR_MIPMAP_NEAREST;
  11785. if (e === z.LinearMipMapLinearFilter)
  11786. return n.LINEAR_MIPMAP_LINEAR;
  11787. if (e === z.UnsignedByteType)
  11788. return n.UNSIGNED_BYTE;
  11789. if (e === z.UnsignedShort4444Type)
  11790. return n.UNSIGNED_SHORT_4_4_4_4;
  11791. if (e === z.UnsignedShort5551Type)
  11792. return n.UNSIGNED_SHORT_5_5_5_1;
  11793. if (e === z.UnsignedShort565Type)
  11794. return n.UNSIGNED_SHORT_5_6_5;
  11795. if (e === z.ByteType)
  11796. return n.BYTE;
  11797. if (e === z.ShortType)
  11798. return n.SHORT;
  11799. if (e === z.UnsignedShortType)
  11800. return n.UNSIGNED_SHORT;
  11801. if (e === z.IntType)
  11802. return n.INT;
  11803. if (e === z.UnsignedIntType)
  11804. return n.UNSIGNED_INT;
  11805. if (e === z.FloatType)
  11806. return n.FLOAT;
  11807. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11808. return t.HALF_FLOAT_OES;
  11809. if (e === z.AlphaFormat)
  11810. return n.ALPHA;
  11811. if (e === z.RGBFormat)
  11812. return n.RGB;
  11813. if (e === z.RGBAFormat)
  11814. return n.RGBA;
  11815. if (e === z.LuminanceFormat)
  11816. return n.LUMINANCE;
  11817. if (e === z.LuminanceAlphaFormat)
  11818. return n.LUMINANCE_ALPHA;
  11819. if (e === z.AddEquation)
  11820. return n.FUNC_ADD;
  11821. if (e === z.SubtractEquation)
  11822. return n.FUNC_SUBTRACT;
  11823. if (e === z.ReverseSubtractEquation)
  11824. return n.FUNC_REVERSE_SUBTRACT;
  11825. if (e === z.ZeroFactor)
  11826. return n.ZERO;
  11827. if (e === z.OneFactor)
  11828. return n.ONE;
  11829. if (e === z.SrcColorFactor)
  11830. return n.SRC_COLOR;
  11831. if (e === z.OneMinusSrcColorFactor)
  11832. return n.ONE_MINUS_SRC_COLOR;
  11833. if (e === z.SrcAlphaFactor)
  11834. return n.SRC_ALPHA;
  11835. if (e === z.OneMinusSrcAlphaFactor)
  11836. return n.ONE_MINUS_SRC_ALPHA;
  11837. if (e === z.DstAlphaFactor)
  11838. return n.DST_ALPHA;
  11839. if (e === z.OneMinusDstAlphaFactor)
  11840. return n.ONE_MINUS_DST_ALPHA;
  11841. if (e === z.DstColorFactor)
  11842. return n.DST_COLOR;
  11843. if (e === z.OneMinusDstColorFactor)
  11844. return n.ONE_MINUS_DST_COLOR;
  11845. if (e === z.SrcAlphaSaturateFactor)
  11846. return n.SRC_ALPHA_SATURATE;
  11847. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11848. if (e === z.RGB_S3TC_DXT1_Format)
  11849. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11850. if (e === z.RGBA_S3TC_DXT1_Format)
  11851. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11852. if (e === z.RGBA_S3TC_DXT3_Format)
  11853. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11854. if (e === z.RGBA_S3TC_DXT5_Format)
  11855. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11856. }
  11857. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11858. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11859. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11860. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11861. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11862. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11863. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11864. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11865. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11866. }
  11867. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11868. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11869. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11870. if (e === z.MinEquation)
  11871. return t.MIN_EXT;
  11872. if (e === z.MaxEquation)
  11873. return t.MAX_EXT
  11874. }
  11875. return 0
  11876. }
  11877. ,
  11878. z.WebGLState = function(l, i, c) {
  11879. var n = this
  11880. , r = new z.Vector4
  11881. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11882. , o = new Uint8Array(e)
  11883. , a = new Uint8Array(e)
  11884. , s = new Uint8Array(e)
  11885. , t = {}
  11886. , h = null
  11887. , u = null
  11888. , d = null
  11889. , p = null
  11890. , f = null
  11891. , g = null
  11892. , m = null
  11893. , v = null
  11894. , y = !1
  11895. , A = null
  11896. , C = null
  11897. , I = null
  11898. , E = null
  11899. , _ = null
  11900. , b = null
  11901. , w = null
  11902. , T = null
  11903. , x = null
  11904. , S = null
  11905. , M = null
  11906. , R = null
  11907. , P = null
  11908. , O = null
  11909. , L = null
  11910. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11911. , N = void 0
  11912. , F = {}
  11913. , B = new z.Vector4
  11914. , V = null
  11915. , k = null
  11916. , U = new z.Vector4
  11917. , H = new z.Vector4;
  11918. this.init = function() {
  11919. this.clearColor(0, 0, 0, 1),
  11920. this.clearDepth(1),
  11921. this.clearStencil(0),
  11922. this.enable(l.DEPTH_TEST),
  11923. l.depthFunc(l.LEQUAL),
  11924. l.frontFace(l.CCW),
  11925. l.cullFace(l.BACK),
  11926. this.enable(l.CULL_FACE),
  11927. this.enable(l.BLEND),
  11928. l.blendEquation(l.FUNC_ADD),
  11929. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11930. }
  11931. ,
  11932. this.initAttributes = function() {
  11933. for (var e = 0, t = o.length; e < t; e++)
  11934. o[e] = 0
  11935. }
  11936. ,
  11937. this.enableAttribute = function(e) {
  11938. o[e] = 1,
  11939. 0 === a[e] && (l.enableVertexAttribArray(e),
  11940. a[e] = 1),
  11941. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11942. s[e] = 0)
  11943. }
  11944. ,
  11945. this.enableAttributeAndDivisor = function(e, t, i) {
  11946. o[e] = 1,
  11947. 0 === a[e] && (l.enableVertexAttribArray(e),
  11948. a[e] = 1),
  11949. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11950. s[e] = t)
  11951. }
  11952. ,
  11953. this.disableUnusedAttributes = function() {
  11954. for (var e = 0, t = a.length; e < t; e++)
  11955. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11956. a[e] = 0)
  11957. }
  11958. ,
  11959. this.enable = function(e) {
  11960. !0 !== t[e] && (l.enable(e),
  11961. t[e] = !0)
  11962. }
  11963. ,
  11964. this.disable = function(e) {
  11965. !1 !== t[e] && (l.disable(e),
  11966. t[e] = !1)
  11967. }
  11968. ,
  11969. this.getCompressedTextureFormats = function() {
  11970. if (null === h && (h = [],
  11971. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11972. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11973. h.push(e[t]);
  11974. return h
  11975. }
  11976. ,
  11977. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11978. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11979. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11980. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11981. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11982. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11983. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11984. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11985. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11986. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11987. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11988. u = e,
  11989. y = s),
  11990. e === z.CustomBlending ? (r = r || t,
  11991. o = o || i,
  11992. a = a || n,
  11993. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11994. d = t,
  11995. g = r),
  11996. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11997. p = i,
  11998. f = n,
  11999. m = o,
  12000. v = a)) : v = m = g = f = p = d = null
  12001. }
  12002. ,
  12003. this.setDepthFunc = function(e) {
  12004. if (A !== e) {
  12005. if (e)
  12006. switch (e) {
  12007. case z.NeverDepth:
  12008. l.depthFunc(l.NEVER);
  12009. break;
  12010. case z.AlwaysDepth:
  12011. l.depthFunc(l.ALWAYS);
  12012. break;
  12013. case z.LessDepth:
  12014. l.depthFunc(l.LESS);
  12015. break;
  12016. case z.LessEqualDepth:
  12017. l.depthFunc(l.LEQUAL);
  12018. break;
  12019. case z.EqualDepth:
  12020. l.depthFunc(l.EQUAL);
  12021. break;
  12022. case z.GreaterEqualDepth:
  12023. l.depthFunc(l.GEQUAL);
  12024. break;
  12025. case z.GreaterDepth:
  12026. l.depthFunc(l.GREATER);
  12027. break;
  12028. case z.NotEqualDepth:
  12029. l.depthFunc(l.NOTEQUAL);
  12030. break;
  12031. default:
  12032. l.depthFunc(l.LEQUAL)
  12033. }
  12034. else
  12035. l.depthFunc(l.LEQUAL);
  12036. A = e
  12037. }
  12038. }
  12039. ,
  12040. this.setDepthTest = function(e) {
  12041. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12042. }
  12043. ,
  12044. this.setDepthWrite = function(e) {
  12045. C !== e && (l.depthMask(e),
  12046. C = e)
  12047. }
  12048. ,
  12049. this.setColorWrite = function(e) {
  12050. I !== e && (l.colorMask(e, e, e, e),
  12051. I = e)
  12052. }
  12053. ,
  12054. this.setStencilFunc = function(e, t, i) {
  12055. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12056. _ = e,
  12057. b = t,
  12058. w = i)
  12059. }
  12060. ,
  12061. this.setStencilOp = function(e, t, i) {
  12062. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12063. T = e,
  12064. x = t,
  12065. S = i)
  12066. }
  12067. ,
  12068. this.setStencilTest = function(e) {
  12069. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12070. }
  12071. ,
  12072. this.setStencilWrite = function(e) {
  12073. E !== e && (l.stencilMask(e),
  12074. E = e)
  12075. }
  12076. ,
  12077. this.setFlipSided = function(e) {
  12078. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12079. M = e)
  12080. }
  12081. ,
  12082. this.setLineWidth = function(e) {
  12083. e !== R && (l.lineWidth(e),
  12084. R = e)
  12085. }
  12086. ,
  12087. this.setPolygonOffset = function(e, t, i) {
  12088. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12089. !e || P === t && O === i || (l.polygonOffset(t, i),
  12090. P = t,
  12091. O = i)
  12092. }
  12093. ,
  12094. this.getScissorTest = function() {
  12095. return L
  12096. }
  12097. ,
  12098. this.setScissorTest = function(e) {
  12099. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12100. }
  12101. ,
  12102. this.activeTexture = function(e) {
  12103. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12104. N !== e && (l.activeTexture(e),
  12105. N = e)
  12106. }
  12107. ,
  12108. this.bindTexture = function(e, t) {
  12109. void 0 === N && n.activeTexture();
  12110. var i = F[N];
  12111. void 0 === i && (i = {
  12112. type: void 0,
  12113. texture: void 0
  12114. },
  12115. F[N] = i),
  12116. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12117. i.type = e,
  12118. i.texture = t)
  12119. }
  12120. ,
  12121. this.compressedTexImage2D = function() {
  12122. try {
  12123. l.compressedTexImage2D.apply(l, arguments)
  12124. } catch (e) {
  12125. console.error(e)
  12126. }
  12127. }
  12128. ,
  12129. this.texImage2D = function() {
  12130. try {
  12131. l.texImage2D.apply(l, arguments)
  12132. } catch (e) {
  12133. console.error(e)
  12134. }
  12135. }
  12136. ,
  12137. this.clearColor = function(e, t, i, n) {
  12138. r.set(e, t, i, n),
  12139. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12140. B.copy(r))
  12141. }
  12142. ,
  12143. this.clearDepth = function(e) {
  12144. V !== e && (l.clearDepth(e),
  12145. V = e)
  12146. }
  12147. ,
  12148. this.clearStencil = function(e) {
  12149. k !== e && (l.clearStencil(e),
  12150. k = e)
  12151. }
  12152. ,
  12153. this.scissor = function(e) {
  12154. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12155. U.copy(e))
  12156. }
  12157. ,
  12158. this.viewport = function(e) {
  12159. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12160. H.copy(e))
  12161. }
  12162. ,
  12163. this.reset = function() {
  12164. for (var e = 0; e < a.length; e++)
  12165. 1 === a[e] && (l.disableVertexAttribArray(e),
  12166. a[e] = 0);
  12167. t = {},
  12168. N = void 0,
  12169. F = {},
  12170. M = E = C = I = u = h = null
  12171. }
  12172. }
  12173. }
  12174. , {
  12175. three: 217
  12176. }],
  12177. 104: [function(a, h, e) {
  12178. (function(i, e) {
  12179. "use strict";
  12180. function t(e) {
  12181. this.urls = e;
  12182. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12183. this.builder = n.loadProto(t),
  12184. this.decoder = this.builder.build("binary_mesh")
  12185. }
  12186. var s = a("three")
  12187. , n = a("protobufjs")
  12188. , r = a("../util/logger")
  12189. , o = (a("../util/common"),
  12190. a("../util/ajax"))
  12191. , l = a("../objects/Chunk")
  12192. , c = new r(e);
  12193. t.prototype = {
  12194. constructor: t,
  12195. load: function(t, i, n, r) {
  12196. return c.time("download"),
  12197. o.get(t, {
  12198. responseType: "arraybuffer"
  12199. }).done(function(e) {
  12200. c.timeEnd("download"),
  12201. this.parse(e, t, i, n, r)
  12202. }
  12203. .bind(this)).fail(r)
  12204. },
  12205. parse: function(e, t, i, n, r) {
  12206. var o = this.readProtobuf(e);
  12207. if (!o)
  12208. return r();
  12209. try {
  12210. c.time("convert to webgl"),
  12211. this.convertProtobufToSceneObject(o, t, i, n, r),
  12212. c.timeEnd("convert to webgl")
  12213. } catch (e) {
  12214. return c.error("failed parsing .dam"),
  12215. c.error(e.message),
  12216. r()
  12217. }
  12218. },
  12219. readProtobuf: function(e) {
  12220. var t;
  12221. try {
  12222. c.time("parse proto"),
  12223. t = this.decoder.decode(e),
  12224. c.timeEnd("parse proto")
  12225. } catch (e) {
  12226. return c.error("failed parsing proto for .dam"),
  12227. c.error(e.message),
  12228. null
  12229. }
  12230. return t
  12231. },
  12232. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12233. if (0 === e.chunk.length)
  12234. return c.warn("No chunks in damfile..."),
  12235. t([]);
  12236. var o = new s.Matrix4;
  12237. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12238. var a = e.chunk.map(function(e) {
  12239. var t = new s.BufferGeometry;
  12240. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12241. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12242. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12243. t.applyMatrix(o),
  12244. t.computeBoundingBox(),
  12245. new l({
  12246. geometry: t,
  12247. textureName: e.material_name,
  12248. name: e.chunk_name,
  12249. meshUrl: i
  12250. })
  12251. });
  12252. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12253. r())
  12254. }
  12255. },
  12256. h.exports = t
  12257. }
  12258. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12259. }
  12260. , {
  12261. "../objects/Chunk": 144,
  12262. "../util/ajax": 181,
  12263. "../util/common": 185,
  12264. "../util/logger": 189,
  12265. buffer: 198,
  12266. protobufjs: 214,
  12267. three: 217
  12268. }],
  12269. 105: [function(n, r, e) {
  12270. (function(e) {
  12271. "use strict";
  12272. var t = (n("three"),
  12273. n("../settings"),
  12274. n("../util/browser"),
  12275. n("./DamLoader"))
  12276. , i = n("../util/logger")
  12277. , u = (n("../ab"),
  12278. new i(e));
  12279. r.exports = {
  12280. getLoaders: function() {
  12281. return [["_50k", ".dam", t], ["", ".dam", t]]
  12282. },
  12283. load: function(e, t, i, n, r, o) {
  12284. var a = this.getLoaders()[o = o || 0];
  12285. if (a) {
  12286. var s = a[0]
  12287. , l = a[1]
  12288. , c = new a[2](t)
  12289. , h = t.get(e + s + l);
  12290. h ? (u.debug("Trying " + s + l),
  12291. c.load(h, i, n, function() {
  12292. this.load(e, t, i, n, r, ++o)
  12293. }
  12294. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12295. this.load(e, t, i, n, r, ++o))
  12296. } else
  12297. r && r("No suitable model file found...")
  12298. }
  12299. }
  12300. }
  12301. ).call(this, "/js/loaders/ModelLoader.js")
  12302. }
  12303. , {
  12304. "../ab": 3,
  12305. "../settings": 166,
  12306. "../util/browser": 182,
  12307. "../util/logger": 189,
  12308. "./DamLoader": 104,
  12309. three: 217
  12310. }],
  12311. 106: [function(i, n, e) {
  12312. (function(e) {
  12313. "use strict";
  12314. var l = i("../util/common")
  12315. , c = i("../util/texture")
  12316. , h = i("../util/browser")
  12317. , t = i("../util/logger")
  12318. , u = i("../settings")
  12319. , d = new t(e);
  12320. n.exports = {
  12321. load: function(i, n) {
  12322. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12323. return $.when();
  12324. var r = l.countUnique(i.chunks.map(function(e) {
  12325. return e.textureName
  12326. }))
  12327. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12328. , t = "_50k" == e ? "high" : "low";
  12329. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12330. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12331. t = "low"));
  12332. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12333. , a = $.Deferred()
  12334. , s = 0;
  12335. return i.chunks.forEach(function(e) {
  12336. if (!e.material.map && e.textureName) {
  12337. var t = i.urls.get(o + e.textureName);
  12338. e.setTextureMap(c.load(t, function(e, t) {
  12339. e || (n.push(t),
  12340. s++,
  12341. a.notify(s, r),
  12342. s === r && a.resolve())
  12343. }
  12344. .bind(this, c.isLoaded(t))))
  12345. }
  12346. }),
  12347. a.promise()
  12348. }
  12349. }
  12350. }
  12351. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12352. }
  12353. , {
  12354. "../settings": 166,
  12355. "../util/browser": 182,
  12356. "../util/common": 185,
  12357. "../util/logger": 189,
  12358. "../util/texture": 194
  12359. }],
  12360. 107: [function(s, l, e) {
  12361. (function(n, e) {
  12362. "use strict";
  12363. function t(e) {
  12364. this.model = e,
  12365. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12366. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12367. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12368. , i = r.loadProto(t);
  12369. this.decoder = i.build("VisionModeldata")
  12370. }
  12371. var r = s("protobufjs")
  12372. , i = s("../util/ajax")
  12373. , o = (s("../util/common"),
  12374. s("../util/math"))
  12375. , a = new (s("../util/logger"))(e);
  12376. t.prototype.load = function() {
  12377. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12378. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12379. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12380. $.when([]))
  12381. }
  12382. ,
  12383. t.prototype.loadVisionModelData = function() {
  12384. return i.get(this.modelDataPath, {
  12385. responseType: "arraybuffer"
  12386. }).then(function(e) {
  12387. var t;
  12388. try {
  12389. t = this.decoder.decode(e)
  12390. } catch (e) {
  12391. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12392. this.loadSweepLocationsCSV()
  12393. }
  12394. var i = t.sweepLocations.map(function(e) {
  12395. return {
  12396. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12397. position: {
  12398. x: e.pose.translation.x,
  12399. y: e.pose.translation.y,
  12400. z: e.pose.translation.z
  12401. },
  12402. quaternion: {
  12403. x: e.pose.rotation.x,
  12404. y: e.pose.rotation.y,
  12405. z: e.pose.rotation.z,
  12406. w: e.pose.rotation.w
  12407. },
  12408. puck: {
  12409. x: e.puck.x,
  12410. y: e.puck.y,
  12411. z: e.puck.z
  12412. },
  12413. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  12414. neighbours: e.visibles,
  12415. alignmentType: e.alignment_type
  12416. }
  12417. }).map(function(e) {
  12418. return e.position = o.convertVisionVector(e.position),
  12419. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12420. e.puck = o.convertVisionVector(e.puck),
  12421. e
  12422. });
  12423. return i.forEach(function(e) {
  12424. /* if(e.neighbours.find(a=>a==-1)){
  12425. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12426. } */
  12427. e.neighbours = e.neighbours.filter(e=>i[e])
  12428. e.neighbours = e.neighbours.map(function(e) {
  12429. return i[e].uuid
  12430. })
  12431. }),
  12432. i
  12433. }
  12434. .bind(this), function() {
  12435. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12436. this.loadSweepLocationsCSV()
  12437. }
  12438. .bind(this))
  12439. }
  12440. ,
  12441. t.prototype.loadSweepLocationsCSV = function() {
  12442. return i.get(this.sweepLocationsPath).then(function(e) {
  12443. return e.split("\n").map(function(e) {
  12444. return e.split(", ")
  12445. }).filter(function(e) {
  12446. return 1 < e.length
  12447. }).map(function(e) {
  12448. return {
  12449. uuid: e[0],
  12450. position: {
  12451. x: parseFloat(e[1]),
  12452. y: parseFloat(e[2]),
  12453. z: parseFloat(e[3])
  12454. },
  12455. quaternion: {
  12456. x: parseFloat(e[4]),
  12457. y: parseFloat(e[5]),
  12458. z: parseFloat(e[6]),
  12459. w: parseFloat(e[7])
  12460. }
  12461. }
  12462. }).map(function(e) {
  12463. return e.position = o.convertVisionVector(e.position),
  12464. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12465. e
  12466. })
  12467. }).fail(function() {
  12468. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12469. })
  12470. }
  12471. ,
  12472. l.exports = t
  12473. }
  12474. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12475. }
  12476. , {
  12477. "../util/ajax": 181,
  12478. "../util/common": 185,
  12479. "../util/logger": 189,
  12480. "../util/math": 190,
  12481. buffer: 198,
  12482. protobufjs: 214
  12483. }],
  12484. 108: [function(s, l, e) {
  12485. (function(e) {
  12486. "use strict";
  12487. function t() {
  12488. this.locale = null
  12489. }
  12490. var i = s("../settings")
  12491. , n = s("../util/common")
  12492. , r = s("../util/logger")
  12493. , o = s("../enum/Locale")
  12494. , a = new r(e);
  12495. t.prototype.init = function() {
  12496. var e;
  12497. switch (i.languageTag) {
  12498. case null:
  12499. case "en":
  12500. case o.EN_US:
  12501. this.locale = o.EN_US,
  12502. e = s("./strings-en-US");
  12503. break;
  12504. case "es":
  12505. case o.ES_MX:
  12506. this.locale = o.ES_MX,
  12507. e = s("./strings-es-MX");
  12508. break;
  12509. case "fr":
  12510. case o.FR_FR:
  12511. this.locale = o.FR_FR,
  12512. e = s("./strings-fr-FR");
  12513. break;
  12514. case "de":
  12515. case o.DE_DE:
  12516. this.locale = o.DE_DE,
  12517. e = s("./strings-de-DE");
  12518. break;
  12519. case "ru":
  12520. case o.RU_RU:
  12521. this.locale = o.RU_RU,
  12522. e = s("./strings-ru-RU");
  12523. break;
  12524. case "cn":
  12525. case o.CN_CN:
  12526. this.locale = o.CN_CN,
  12527. e = s("./strings-cn-CN");
  12528. break;
  12529. case "jp":
  12530. case o.JP_JP:
  12531. this.locale = o.JP_JP,
  12532. e = s("./strings-jp-JP");
  12533. break;
  12534. default:
  12535. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12536. this.locale = o.EN_US,
  12537. e = s("./strings-en-US")
  12538. }
  12539. a.info("Using locale '" + this.locale + "'"),
  12540. n.extendObject(this, e)
  12541. }
  12542. ,
  12543. t.prototype.localizeGUI = function() {
  12544. var e = document.querySelector("#gui-parent");
  12545. this.localizeTree(e),
  12546. this.localizeLoadingText()
  12547. }
  12548. ,
  12549. t.prototype.localizeLoadingText = function() {
  12550. document.querySelector("#help-dialog").classList.add(this.locale),
  12551. document.querySelector("#interaction-modal").classList.add(this.locale),
  12552. document.querySelector("#gui").classList.add(this.locale)
  12553. }
  12554. ,
  12555. t.prototype.localizeTree = function(e) {
  12556. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12557. if (e.nodeType === Node.TEXT_NODE)
  12558. (t = e.data.match(n)) && (i = t[1],
  12559. e.data = this.localizeText(i) || i);
  12560. else if (e.nodeType === Node.ELEMENT_NODE) {
  12561. var r = e.getAttribute("title");
  12562. r && ((t = r.match(n)) && (i = t[1],
  12563. e.setAttribute("title", this.localizeText(i) || i)))
  12564. }
  12565. for (e = e.firstChild; e; )
  12566. this.localizeTree(e),
  12567. e = e.nextSibling
  12568. }
  12569. ,
  12570. t.prototype.localizeText = function(e) {
  12571. var t = this[e];
  12572. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12573. t = s("./strings-en-US")[e]),
  12574. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12575. t
  12576. }
  12577. ,
  12578. l.exports = new t
  12579. }
  12580. ).call(this, "/js/localization/localize.js")
  12581. }
  12582. , {
  12583. "../enum/Locale": 31,
  12584. "../settings": 166,
  12585. "../util/common": 185,
  12586. "../util/logger": 189,
  12587. "./strings-cn-CN": 109,
  12588. "./strings-de-DE": 110,
  12589. "./strings-en-US": 111,
  12590. "./strings-es-MX": 112,
  12591. "./strings-fr-FR": 113,
  12592. "./strings-jp-JP": 114,
  12593. "./strings-ru-RU": 115
  12594. }],
  12595. 109: [function(e, t, i) {
  12596. "use strict";
  12597. t.exports = {
  12598. PAGE_TITLE: "",
  12599. LOADING: "正在加载",
  12600. PRESENTED_BY_CAPS: "呈现者:",
  12601. POWERED_BY: "技术支持:",
  12602. POWERED_BY_CAPS: "技术支持:",
  12603. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12604. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12605. PRESENTED_BY: "呈现者:",
  12606. MORE: "更多 ",
  12607. LESS: "更少 ",
  12608. TAG_CONTENT: "tag™ 内容",
  12609. SHOW: "显示",
  12610. HIDE: "隐藏",
  12611. DOLLHOUSE: "场景屋",
  12612. FLOOR_PLAN: "楼层平面图",
  12613. OPEN_HIGHLIGHTS: "打开精彩片段",
  12614. CLOSE_HIGHLIGHTS: "关闭",
  12615. PREVIOUS: "上一个",
  12616. PLAY: "播放",
  12617. PAUSE: "暂停",
  12618. NEXT: "下一个",
  12619. EXPLORE_3D_SPACE: "探索 3D 空间",
  12620. VIEW_DOLLHOUSE: "观看场景屋",
  12621. SOCIAL_SHARING: "分享这个空间",
  12622. VIEW_IN_VR: "以 VR 观看",
  12623. VIEW_FULLSCREEN: "全屏观看",
  12624. EXIT_FULLSCREEN: " 退出全屏",
  12625. ZOOM_IN: "放大",
  12626. ZOOM_OUT: "缩小",
  12627. FLOOR_NAME: "楼层",
  12628. FLOOR_ALL: "ALL",
  12629. FLOOR_Lang: ["Floor", ""],
  12630. TERMS: "条款",
  12631. PORT_TERMS: "port 条款",
  12632. TERMS_OF_USE: "使用条款",
  12633. CLOSE_TERMS: "关闭",
  12634. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12635. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12636. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12637. WEBVR_ENTER_WEBVR: "进入 VR",
  12638. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12639. WEBVR_LEARN_MORE: "了解更多",
  12640. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12641. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12642. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12643. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12644. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12645. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12646. VR_LEARN_MORE_CAPS: "了解更多",
  12647. VR_PREVIOUS_CAPS: "上一个’,",
  12648. VR_NEXT_CAPS: "下一个",
  12649. VR_GOT_IT_CAPS: "明白了",
  12650. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12651. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12652. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12653. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12654. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12655. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12656. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12657. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12658. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12659. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12660. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12661. VR_APP: "port VR 应用程序",
  12662. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12663. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12664. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12665. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12666. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12667. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12668. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12669. VR_ANDROID_DVICES: "Android 设备",
  12670. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12671. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12672. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12673. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12674. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12675. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12676. VR_DOWNLOAD_HERE: "在此下载",
  12677. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12678. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12679. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12680. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12681. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12682. SHARE_TO: "分享到",
  12683. SHARE_LINK: "直接链接",
  12684. SHARE_EXPLORE: "探索",
  12685. SHARE_AT: "在",
  12686. SHARE_WITH: "使用",
  12687. SHARE_3D: "以 3D",
  12688. SHARE_COPIED: "已复制!",
  12689. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12690. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12691. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12692. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12693. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12694. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12695. ERROR_GENERIC_ACTIONS_3: " 或",
  12696. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12697. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12698. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12699. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12700. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12701. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12702. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12703. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12704. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12705. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12706. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12707. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12708. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12709. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12710. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12711. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12712. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12713. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12714. LINK_TO_LOCATION: "地点链接",
  12715. MENU_COPY: "复制",
  12716. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12717. ROTATE: "旋转",
  12718. MOVE: "移动",
  12719. INSIDE: "内部",
  12720. ZOOM: "缩放",
  12721. HELP: "小帮手",
  12722. HELP_NAVIGATION_TAB: "导航",
  12723. HELP_MORE_HELP_TAB: "更多帮助",
  12724. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12725. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12726. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12727. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12728. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12729. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12730. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12731. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12732. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12733. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12734. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12735. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12736. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12737. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12738. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12739. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12740. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12741. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12742. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12743. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12744. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12745. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12746. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12747. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12748. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12749. HELP_MORE_HLR_A: "精彩片段集锦",
  12750. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12751. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12752. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12753. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12754. HELP_MORE_FLOORS_A: "楼层选择器",
  12755. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12756. HELP_MORE_TAG_A: "tag™ 贴文",
  12757. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12758. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12759. HELP_MORE_ZOOM_A: "缩放控件",
  12760. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12761. HELP_MORE_TOUR_A: "导览控件",
  12762. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12763. HELP_MORE_INSIDE_A: "内部视图",
  12764. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12765. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12766. HELP_MORE_VR_A: "VR 模式",
  12767. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12768. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12769. HELP_MORE_360_A: "360° 视图",
  12770. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12771. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12772. HELP_MORE_FULLSCREEN_A: "全屏",
  12773. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12774. CLOSE: "关闭"
  12775. }
  12776. }
  12777. , {}],
  12778. 110: [function(e, t, i) {
  12779. "use strict";
  12780. t.exports = {
  12781. PAGE_TITLE: "",
  12782. LOADING: "Lädt",
  12783. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12784. POWERED_BY: "Angetrieben von",
  12785. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12786. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12787. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12788. PRESENTED_BY: "Präsentiert von ",
  12789. MORE: "Mehr ",
  12790. LESS: "Weniger ",
  12791. TAG_CONTENT: "tag™ Inhalt",
  12792. SHOW: "Anzeigen",
  12793. HIDE: "Verbergen",
  12794. DOLLHOUSE: "Puppenhaus",
  12795. FLOOR_PLAN: "Grundriss",
  12796. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12797. CLOSE_HIGHLIGHTS: "Schließen",
  12798. PREVIOUS: "Vorheriges",
  12799. PLAY: "Abspielen",
  12800. PAUSE: "Pausieren",
  12801. NEXT: "Nächstes",
  12802. EXPLORE_3D_SPACE: "Innenraum betreten",
  12803. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12804. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12805. VIEW_IN_VR: "In VR ansehen",
  12806. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12807. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12808. ZOOM_IN: "Vergrößern",
  12809. ZOOM_OUT: "Verkleinern",
  12810. FLOOR_NAME: "Etage ",
  12811. FLOOR_ALL: "Alle",
  12812. TERMS: "Bedingungen",
  12813. PORT_TERMS: "port Bedingungen",
  12814. TERMS_OF_USE: "Nutzungsbedingungen",
  12815. TERMS_TEXT_FILE: "terms-de-DE.html",
  12816. CLOSE_TERMS: "Schließen",
  12817. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12818. HELP: "Hilfe",
  12819. HELP_NAVIGATION_TAB: "Navigation",
  12820. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12821. CLOSE: "Schließen",
  12822. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12823. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12824. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12825. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12826. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12827. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12828. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12829. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12830. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12831. 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.",
  12832. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12833. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12834. 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.",
  12835. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12836. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12837. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12838. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12839. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12840. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12841. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12842. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12843. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12844. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12845. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12846. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12847. HELP_MORE_HLR_A: "Liste das Highlight",
  12848. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12849. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12850. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12851. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12852. HELP_MORE_FLOORS_A: "Etage auswählen",
  12853. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12854. HELP_MORE_TAG_A: "tag™ Posts",
  12855. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12856. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12857. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12858. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12859. HELP_MORE_TOUR_A: "Tour Steuerung",
  12860. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12861. HELP_MORE_INSIDE_A: "Innenansicht",
  12862. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12863. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12864. HELP_MORE_VR_A: "VR Modus",
  12865. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12866. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12867. HELP_MORE_360_A: "360° Views Ansicht ",
  12868. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12869. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12870. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12871. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12872. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12873. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12874. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12875. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12876. WEBVR_LEARN_MORE: "Mehr Infos",
  12877. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12878. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12879. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12880. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12881. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12882. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12883. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12884. VR_APP: "port VR App",
  12885. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12886. 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",
  12887. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12888. VR_APP_FOR_ANDROID: "port VR app für Android",
  12889. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12890. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12891. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12892. VR_PREVIOUS_CAPS: "ZURÜCK",
  12893. VR_NEXT_CAPS: "WEITER",
  12894. VR_GOT_IT_CAPS: "VERSTANDEN",
  12895. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12896. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12897. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12898. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12899. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12900. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12901. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12902. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12903. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12904. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12905. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12906. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12907. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12908. VR_ANDROID_DVICES: "Android Geräte",
  12909. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12910. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12911. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12912. VR_DOWNLOAD_HERE: "Hier runterladen",
  12913. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12914. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12915. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12916. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12917. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12918. SHARE_TO: "Teilen auf",
  12919. SHARE_LINK: "Direkter Link",
  12920. SHARE_EXPLORE: "Umsehen",
  12921. SHARE_AT: "auf",
  12922. SHARE_WITH: "mit",
  12923. SHARE_3D: "in 3D",
  12924. SHARE_COPIED: "Kopiert!",
  12925. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12926. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12927. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12928. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12929. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12930. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12931. ERROR_GENERIC_ACTIONS_3: " oder ",
  12932. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12933. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12934. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12935. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12936. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12937. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12938. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12939. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12940. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12941. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12942. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12943. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12944. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12945. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12946. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12947. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12948. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12949. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12950. LINK_TO_LOCATION: "Link zu",
  12951. MENU_COPY: "Kopieren",
  12952. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12953. ROTATE: "Drehen",
  12954. INSIDE: "Drinnen",
  12955. MOVE: "Bewegen",
  12956. ZOOM: "Vergrößern"
  12957. }
  12958. }
  12959. , {}],
  12960. 111: [function(e, t, i) {
  12961. "use strict";
  12962. t.exports = {
  12963. PAGE_TITLE: "",
  12964. LOADING: "Loading",
  12965. PRESENTED_BY_CAPS: "PRESENTED BY",
  12966. POWERED_BY: "powered by ",
  12967. POWERED_BY_CAPS: "POWERED BY",
  12968. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12969. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12970. PRESENTED_BY: "Presented by ",
  12971. MORE: "More ",
  12972. LESS: "Less ",
  12973. TAG_CONTENT: "tag™ Content",
  12974. SHOW: "Show",
  12975. HIDE: "Hide",
  12976. DOLLHOUSE: "Dollhouse",
  12977. FLOOR_PLAN: "Floor plan",
  12978. OPEN_HIGHLIGHTS: "Open Highlights",
  12979. CLOSE_HIGHLIGHTS: "Close",
  12980. PREVIOUS: "Previous",
  12981. PLAY: "Play",
  12982. PAUSE: "Pause",
  12983. NEXT: "Next",
  12984. EXPLORE_3D_SPACE: "Explore 3D Space",
  12985. VIEW_DOLLHOUSE: "View dollhouse",
  12986. SOCIAL_SHARING: "Share this Space",
  12987. VIEW_IN_VR: "View in VR",
  12988. VIEW_FULLSCREEN: "全屏",
  12989. EXIT_FULLSCREEN: "退出全屏",
  12990. ZOOM_IN: "Zoom in",
  12991. ZOOM_OUT: "Zoom out",
  12992. FLOOR_NAME: "Floor ",
  12993. FLOOR_ALL: "全部",
  12994. TERMS: "Terms",
  12995. PORT_TERMS: "port terms",
  12996. TERMS_OF_USE: "Terms of Use",
  12997. TERMS_TEXT_FILE: "terms-en-US.html",
  12998. CLOSE_TERMS: "Close",
  12999. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13000. HELP: "Help",
  13001. HELP_NAVIGATION_TAB: "Navigation",
  13002. HELP_MORE_HELP_TAB: "More Help",
  13003. CLOSE: "Close",
  13004. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13005. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13006. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13007. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13008. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13009. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13010. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13011. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13012. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13013. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13014. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13015. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13016. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13017. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13018. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13019. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13020. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13021. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13022. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13023. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13024. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13025. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13026. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13027. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13028. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13029. HELP_MORE_HLR_A: "Highlight Reel",
  13030. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13031. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13032. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13033. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13034. HELP_MORE_FLOORS_A: "Floor Selector",
  13035. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13036. HELP_MORE_TAG_A: "tag™ Posts",
  13037. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13038. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13039. HELP_MORE_ZOOM_A: "Zoom Controls",
  13040. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13041. HELP_MORE_TOUR_A: "Tour Controls",
  13042. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13043. HELP_MORE_INSIDE_A: "Inside View",
  13044. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13045. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13046. HELP_MORE_VR_A: "VR Mode",
  13047. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13048. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13049. HELP_MORE_360_A: "360° Views",
  13050. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13051. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13052. HELP_MORE_FULLSCREEN_A: "Full screen",
  13053. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13054. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13055. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13056. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13057. WEBVR_ENTER_WEBVR: "ENTER VR",
  13058. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13059. WEBVR_LEARN_MORE: "Learn more",
  13060. WEBVR_VIEW_SPACE: "View Space in VR",
  13061. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13062. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13063. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13064. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13065. VR_PREVIOUS_CAPS: "PREVIOUS",
  13066. VR_NEXT_CAPS: "NEXT",
  13067. VR_GOT_IT_CAPS: "GOT IT",
  13068. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13069. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13070. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13071. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13072. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13073. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13074. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13075. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13076. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13077. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13078. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13079. VR_APP: "port VR App",
  13080. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13081. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13082. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13083. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13084. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13085. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13086. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13087. VR_ANDROID_DVICES: "Android Devices",
  13088. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13089. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13090. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13091. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13092. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13093. VR_APP_OPEN: "Open with the port VR app instead",
  13094. VR_DOWNLOAD_HERE: "Download here",
  13095. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13096. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13097. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13098. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13099. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13100. SHARE_TO: "Share to",
  13101. SHARE_LINK: "Direct Link",
  13102. SHARE_EXPLORE: "Explore ",
  13103. SHARE_AT: "at",
  13104. SHARE_WITH: "with",
  13105. SHARE_3D: " in 3D",
  13106. SHARE_COPIED: "Copied!",
  13107. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13108. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13109. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13110. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13111. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13112. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13113. ERROR_GENERIC_ACTIONS_3: " or ",
  13114. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13115. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13116. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13117. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13118. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13119. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13120. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13121. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13122. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13123. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13124. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13125. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13126. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13127. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13128. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13129. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13130. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13131. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13132. LINK_TO_LOCATION: "Link to location",
  13133. MENU_COPY: "Copy",
  13134. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13135. ROTATE: "Rotate",
  13136. INSIDE: "Inside",
  13137. MOVE: "Move",
  13138. ZOOM: "Zoom"
  13139. }
  13140. }
  13141. , {}],
  13142. 112: [function(e, t, i) {
  13143. "use strict";
  13144. t.exports = {
  13145. PAGE_TITLE: "",
  13146. LOADING: "Cargando",
  13147. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13148. POWERED_BY: "potenciando por ",
  13149. POWERED_BY_CAPS: "POTENCIADO POR ",
  13150. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13151. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13152. PRESENTED_BY: "Presentado por ",
  13153. MORE: "Más ",
  13154. LESS: "Menos ",
  13155. TAG_CONTENT: "Contenido de tag™",
  13156. SHOW: "Mostrar",
  13157. HIDE: "Ocultar",
  13158. DOLLHOUSE: "Dollhouse",
  13159. FLOOR_PLAN: "Planos",
  13160. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13161. CLOSE_HIGHLIGHTS: "Cerrar",
  13162. PREVIOUS: "Anterior",
  13163. PLAY: "Play",
  13164. PAUSE: "Pausa",
  13165. NEXT: "Siguiente",
  13166. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13167. VIEW_DOLLHOUSE: "Ver dollhouse",
  13168. SOCIAL_SHARING: "Compartir este espacio",
  13169. VIEW_IN_VR: "Ver en realidad virtual",
  13170. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13171. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13172. ZOOM_IN: "Acercar",
  13173. ZOOM_OUT: "Alejar",
  13174. FLOOR_NAME: "Piso ",
  13175. FLOOR_ALL: "Todas",
  13176. TERMS: "Condiciones",
  13177. PORT_TERMS: "port términos de uso",
  13178. TERMS_OF_USE: "Términos de uso",
  13179. TERMS_TEXT_FILE: "terms-es-MX.html",
  13180. CLOSE_TERMS: "Cerrar",
  13181. 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.",
  13182. HELP: "Ayuda",
  13183. HELP_NAVIGATION_TAB: "Navegación",
  13184. HELP_MORE_HELP_TAB: "Más Ayuda",
  13185. CLOSE: "Cerrar",
  13186. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13187. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13188. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13189. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13190. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13191. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13192. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13193. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13194. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13195. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13196. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13197. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13198. 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.",
  13199. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13200. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13201. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13202. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13203. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13204. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13205. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13206. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13207. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13208. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13209. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13210. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13211. HELP_MORE_HLR_A: "Galería destacada",
  13212. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13213. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13214. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13215. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13216. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13217. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13218. HELP_MORE_TAG_A: "tag™ Posts",
  13219. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13220. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13221. HELP_MORE_ZOOM_A: "Controles de zoom",
  13222. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13223. HELP_MORE_TOUR_A: "Controles de recorrido",
  13224. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13225. HELP_MORE_INSIDE_A: "Vista interior",
  13226. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13227. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13228. HELP_MORE_VR_A: "Modo de realidad virtual",
  13229. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13230. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13231. HELP_MORE_360_A: "360° Views",
  13232. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13233. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13234. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13235. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13236. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13237. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13238. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13239. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13240. WEBVR_LEARN_MORE: "Más información",
  13241. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13242. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13243. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13244. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13245. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13246. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13247. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13248. VR_APP: "port VR App",
  13249. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13250. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13251. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13252. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13253. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13254. VR_PREVIOUS_CAPS: "ANTERIOR",
  13255. VR_NEXT_CAPS: "SIGUIENTE",
  13256. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13257. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13258. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13259. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13260. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13261. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13262. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13263. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13264. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13265. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13266. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13267. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13268. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13269. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13270. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13271. VR_ANDROID_DVICES: "Dispositivos Android",
  13272. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13273. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13274. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13275. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13276. VR_DOWNLOAD_HERE: "Descargar aquí",
  13277. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13278. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13279. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13280. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13281. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13282. SHARE_TO: "Compartir en",
  13283. SHARE_LINK: "Enlace directo",
  13284. SHARE_EXPLORE: "Explorar ",
  13285. SHARE_AT: "en",
  13286. SHARE_WITH: "con",
  13287. SHARE_3D: " en 3D",
  13288. SHARE_COPIED: "¡Copiado!",
  13289. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13290. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13291. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13292. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13293. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13294. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13295. ERROR_GENERIC_ACTIONS_3: " o ",
  13296. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13297. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13298. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13299. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13300. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13301. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13302. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13303. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13304. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13305. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13306. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13307. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13308. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13309. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13310. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13311. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13312. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13313. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13314. LINK_TO_LOCATION: "Enlace a la ubicación",
  13315. MENU_COPY: "Copiar",
  13316. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13317. ROTATE: "Girar",
  13318. INSIDE: "Interior",
  13319. MOVE: "Moverse",
  13320. ZOOM: "Acercar o alejar"
  13321. }
  13322. }
  13323. , {}],
  13324. 113: [function(e, t, i) {
  13325. "use strict";
  13326. t.exports = {
  13327. PAGE_TITLE: "",
  13328. LOADING: "Chargement",
  13329. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13330. POWERED_BY: "alimenté par ",
  13331. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13332. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13333. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13334. PRESENTED_BY: "Présenté par ",
  13335. MORE: "Plus ",
  13336. LESS: "Moins ",
  13337. TAG_CONTENT: "Contenu tag™",
  13338. SHOW: "Montrer",
  13339. HIDE: "Cacher",
  13340. DOLLHOUSE: "Dollhouse",
  13341. FLOOR_PLAN: "Plan de sol",
  13342. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13343. CLOSE_HIGHLIGHTS: "Fermer",
  13344. PREVIOUS: "Précédent",
  13345. PLAY: "Lecture",
  13346. PAUSE: "Pause",
  13347. NEXT: "Suivant",
  13348. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13349. VIEW_DOLLHOUSE: "Voir dollhouse",
  13350. SOCIAL_SHARING: "Partager cet espace",
  13351. VIEW_IN_VR: "Voir en VR",
  13352. VIEW_FULLSCREEN: "Plein écran",
  13353. EXIT_FULLSCREEN: "Fermer plein écran",
  13354. ZOOM_IN: "Zoom avant",
  13355. ZOOM_OUT: "Zoom arrière",
  13356. FLOOR_NAME: "Étage ",
  13357. FLOOR_ALL: "Tous",
  13358. TERMS: "Mentions légales",
  13359. PORT_TERMS: "port mentions légales",
  13360. TERMS_OF_USE: "Conditions d'utilisation",
  13361. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13362. CLOSE_TERMS: "Fermer",
  13363. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13364. HELP: "Aide",
  13365. HELP_NAVIGATION_TAB: "Navigation",
  13366. HELP_MORE_HELP_TAB: "Aide",
  13367. CLOSE: "Fermer",
  13368. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13369. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13370. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13371. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13372. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13373. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13374. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13375. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13376. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13377. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13378. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13379. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13380. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13381. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13382. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13383. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13384. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13385. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13386. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13387. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13388. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13389. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13390. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13391. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13392. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13393. HELP_MORE_HLR_A: "Carrousel",
  13394. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13395. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13396. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13397. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13398. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13399. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13400. HELP_MORE_TAG_A: "tag™ Posts",
  13401. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13402. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13403. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13404. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13405. HELP_MORE_TOUR_A: "Commandes de la visite",
  13406. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13407. HELP_MORE_INSIDE_A: "Vue intérieure",
  13408. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13409. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13410. HELP_MORE_VR_A: "Mode RV",
  13411. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13412. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13413. HELP_MORE_360_A: "Vues 360°",
  13414. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13415. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13416. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13417. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13418. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13419. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13420. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13421. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13422. WEBVR_LEARN_MORE: "En savoir plus",
  13423. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13424. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13425. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13426. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13427. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13428. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13429. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13430. VR_NEXT_CAPS: "SUIVANT",
  13431. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13432. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13433. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13434. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13435. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13436. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13437. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13438. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13439. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13440. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13441. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13442. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13443. VR_APP: "port VR App",
  13444. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13445. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13446. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13447. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13448. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13449. 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",
  13450. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13451. VR_ANDROID_DVICES: "Appareils Android",
  13452. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13453. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13454. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13455. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13456. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13457. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13458. VR_DOWNLOAD_HERE: "Télécharger ici",
  13459. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13460. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13461. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13462. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13463. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13464. SHARE_TO: "Partager sur",
  13465. SHARE_LINK: "Lien direct",
  13466. SHARE_EXPLORE: "Explorer ",
  13467. SHARE_AT: "à",
  13468. SHARE_WITH: "avec",
  13469. SHARE_3D: " en 3D",
  13470. SHARE_COPIED: "Copié!",
  13471. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13472. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13473. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13474. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13475. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13476. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13477. ERROR_GENERIC_ACTIONS_3: " ou ",
  13478. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13479. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13480. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13481. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13482. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13483. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13484. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13485. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13486. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13487. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13488. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13489. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13490. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13491. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13492. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13493. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13494. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13495. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13496. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13497. MENU_COPY: "Copie",
  13498. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13499. ROTATE: "Faire pivoter",
  13500. INSIDE: "Intérieure",
  13501. MOVE: "Se déplacer",
  13502. ZOOM: "Zoom"
  13503. }
  13504. }
  13505. , {}],
  13506. 114: [function(e, t, i) {
  13507. "use strict";
  13508. t.exports = {
  13509. PAGE_TITLE: "",
  13510. LOADING: "読み込み中",
  13511. PRESENTED_BY_CAPS: "PRESENTED BY",
  13512. POWERED_BY: "powered by",
  13513. POWERED_BY_CAPS: "POWERED BY",
  13514. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13515. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13516. PRESENTED_BY: "Presented by ",
  13517. MORE: "全て表示 ",
  13518. LESS: "閉じる ",
  13519. TAG_CONTENT: "tag™コンテンツ ",
  13520. SHOW: "表示",
  13521. HIDE: "非表示",
  13522. DOLLHOUSE: "ドールハウス",
  13523. FLOOR_PLAN: "フロアプラン",
  13524. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13525. CLOSE_HIGHLIGHTS: "閉じる",
  13526. PREVIOUS: "前へ",
  13527. PLAY: "再生",
  13528. PAUSE: "一時停止",
  13529. NEXT: "次へ",
  13530. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13531. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13532. SOCIAL_SHARING: "このSpaceを共有する",
  13533. VIEW_IN_VR: "VRで表示",
  13534. VIEW_FULLSCREEN: "フルスクリーン表示",
  13535. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13536. ZOOM_IN: "ズームイン",
  13537. ZOOM_OUT: "ズームアウト",
  13538. FLOOR_NAME: "フロア ",
  13539. FLOOR_ALL: "すべて",
  13540. TERMS: "規約",
  13541. PORT_TERMS: "port規約",
  13542. TERMS_OF_USE: "利用規約",
  13543. CLOSE_TERMS: "閉じる",
  13544. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13545. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13546. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13547. WEBVR_ENTER_WEBVR: "VRに入る",
  13548. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13549. WEBVR_LEARN_MORE: "もっと詳しく",
  13550. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13551. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13552. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13553. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13554. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13555. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13556. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13557. VR_PREVIOUS_CAPS: "前へ",
  13558. VR_NEXT_CAPS: "次へ",
  13559. VR_GOT_IT_CAPS: "了解",
  13560. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13561. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13562. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13563. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13564. VR_WHAT_YOU_NEED: "必要なもの",
  13565. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13566. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13567. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13568. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13569. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13570. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13571. VR_APP: "port VRアプリ",
  13572. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13573. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13574. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13575. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13576. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13577. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13578. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13579. VR_ANDROID_DVICES: "Androidデバイス",
  13580. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13581. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13582. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13583. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13584. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13585. VR_APP_OPEN: "port VRアプリで開く",
  13586. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13587. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13588. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13589. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13590. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13591. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13592. SHARE_TO: "共有先",
  13593. SHARE_LINK: "ダイレクトリンク",
  13594. SHARE_EXPLORE: "探索",
  13595. SHARE_AT: "場所",
  13596. SHARE_WITH: "使用アプリ",
  13597. SHARE_3D: "3Dで",
  13598. SHARE_COPIED: "コピーされました!",
  13599. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13600. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13601. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13602. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13603. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13604. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13605. ERROR_GENERIC_ACTIONS_3: "または",
  13606. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13607. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13608. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13609. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13610. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13611. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13612. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13613. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13614. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13615. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13616. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13617. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13618. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13619. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13620. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13621. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13622. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13623. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13624. LINK_TO_LOCATION: "ロケーションへのリンク",
  13625. MENU_COPY: "コピー",
  13626. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13627. ROTATE: "回転",
  13628. MOVE: "移動",
  13629. INSIDE: "内側",
  13630. ZOOM: "ズーム",
  13631. HELP: "ヘルプ",
  13632. HELP_NAVIGATION_TAB: "ナビゲーション",
  13633. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13634. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13635. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13636. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13637. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13638. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13639. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13640. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13641. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13642. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13643. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13644. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13645. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13646. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13647. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13648. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13649. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13650. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13651. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13652. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13653. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13654. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13655. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13656. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13657. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13658. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13659. HELP_MORE_HLR_A: "ハイライト",
  13660. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13661. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13662. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13663. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13664. HELP_MORE_FLOORS_A: "フロアセレクター",
  13665. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13666. HELP_MORE_TAG_A: "tag™ Posts",
  13667. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13668. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13669. HELP_MORE_ZOOM_A: "ズームコントロール",
  13670. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13671. HELP_MORE_TOUR_A: "ツアーコントロール",
  13672. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13673. HELP_MORE_INSIDE_A: "内側ビュー",
  13674. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13675. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13676. HELP_MORE_VR_A: "VRモード",
  13677. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13678. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13679. HELP_MORE_360_A: "360° Views",
  13680. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13681. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13682. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13683. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13684. CLOSE: "閉じる"
  13685. }
  13686. }
  13687. , {}],
  13688. 115: [function(e, t, i) {
  13689. "use strict";
  13690. t.exports = {
  13691. PAGE_TITLE: "",
  13692. LOADING: "Загрузка",
  13693. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13694. POWERED_BY: "разработано на платформе ",
  13695. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13696. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13697. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13698. PRESENTED_BY: "Представлено ",
  13699. MORE: "Больше ",
  13700. LESS: "Меньше ",
  13701. TAG_CONTENT: "tag™ Контент",
  13702. SHOW: "Показать",
  13703. HIDE: "Скрыть",
  13704. DOLLHOUSE: "Dollhouse",
  13705. FLOOR_PLAN: "Планировка",
  13706. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13707. CLOSE_HIGHLIGHTS: "Закрыть",
  13708. PREVIOUS: "Предыдущий",
  13709. PLAY: "Воспроизвести",
  13710. PAUSE: "Пауза",
  13711. NEXT: "Следующий",
  13712. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13713. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13714. SOCIAL_SHARING: "Поделиться этой моделью",
  13715. VIEW_IN_VR: "Посмотреть в VR",
  13716. VIEW_FULLSCREEN: "Полный экран",
  13717. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13718. ZOOM_IN: "Увеличить",
  13719. ZOOM_OUT: "Уменьшить",
  13720. FLOOR_NAME: "Этаж ",
  13721. FLOOR_ALL: "Все",
  13722. TERMS: "Условия",
  13723. PORT_TERMS: "Правила пользования",
  13724. TERMS_OF_USE: "Условия использования",
  13725. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13726. CLOSE_TERMS: "Закрыть",
  13727. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13728. HELP: "Помощь",
  13729. HELP_NAVIGATION_TAB: "Навигация",
  13730. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13731. CLOSE: "Закрыть",
  13732. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13733. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13734. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13735. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13736. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13737. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13738. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13739. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13740. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13741. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13742. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13743. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13744. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13745. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13746. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13747. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13748. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13749. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13750. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13751. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13752. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13753. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13754. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13755. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13756. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13757. HELP_MORE_HLR_A: "Фотоколлаж",
  13758. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13759. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13760. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13761. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13762. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13763. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13764. HELP_MORE_TAG_A: "tag™ Posts",
  13765. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13766. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13767. HELP_MORE_ZOOM_A: "Масштаб",
  13768. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13769. HELP_MORE_TOUR_A: "Управление Туром",
  13770. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13771. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13772. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13773. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13774. HELP_MORE_VR_A: "Режим VR",
  13775. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13776. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13777. HELP_MORE_360_A: "360° Views",
  13778. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13779. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13780. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13781. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13782. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13783. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13784. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13785. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13786. WEBVR_LEARN_MORE: "Узнать больше",
  13787. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13788. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13789. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13790. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13791. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13792. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13793. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13794. VR_APP: "port VR App",
  13795. VR_APP_OPEN: "Или открыть через приложение port VR",
  13796. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13797. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13798. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13799. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13800. VR_VIEW_SPACE: "Запустить модель в VR",
  13801. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13802. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13803. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13804. VR_GOT_IT_CAPS: "ЯСНО",
  13805. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13806. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13807. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13808. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13809. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13810. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13811. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13812. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13813. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13814. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13815. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13816. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13817. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13818. VR_ANDROID_DVICES: "Android устройства",
  13819. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13820. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13821. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13822. VR_DOWNLOAD_HERE: "Скачать здесь",
  13823. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13824. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13825. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13826. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13827. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13828. SHARE_TO: "Поделиться",
  13829. SHARE_LINK: "Прямая ссылка",
  13830. SHARE_EXPLORE: "просмотреть",
  13831. SHARE_AT: "на",
  13832. SHARE_WITH: "с",
  13833. SHARE_3D: "в 3D",
  13834. SHARE_COPIED: "Скопировано!",
  13835. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13836. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13837. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13838. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13839. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13840. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13841. ERROR_GENERIC_ACTIONS_3: " или ",
  13842. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13843. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13844. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13845. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13846. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13847. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13848. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13849. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13850. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13851. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13852. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13853. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13854. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13855. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13856. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13857. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13858. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13859. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13860. LINK_TO_LOCATION: "Ссылка на местоположение",
  13861. MENU_COPY: "Копировать",
  13862. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13863. ROTATE: "Вращать",
  13864. MOVE: "Передвигаться",
  13865. INSIDE: "Вид изнутри",
  13866. ZOOM: "Масштаб"
  13867. }
  13868. }
  13869. , {}],
  13870. 116: [function(r, e, t) {
  13871. (function(i) {
  13872. "use strict";
  13873. function re(e) {
  13874. console.log("e1:" + e),
  13875. e = Math.round(.4 * e * 100),
  13876. console.log("e2:" + e);
  13877. var t = $(".progressbar");
  13878. t.find(".bar").css("width", e + "%"),
  13879. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13880. t.find(".perc").text(e + "%")
  13881. }
  13882. $("#gui-loading").fadeIn(200),
  13883. re(.1);
  13884. var e = g_version ? "modeldata.js" : "someData.json";
  13885. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13886. dataType: "json"
  13887. }).done(function(e) {
  13888. var t = matcher(e);
  13889. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13890. t.user = {
  13891. is_authenticated: !1,
  13892. 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"]
  13893. }
  13894. try{//处理一下导览数据
  13895. t.model.images = t.model.images.filter(e=>{
  13896. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  13897. if(e.locations)e.locations = e.locations.filter(e=>e)
  13898. if(e.locations && e.locations.length == 0)return;
  13899. return e
  13900. })
  13901. }catch(e){console.log(e) }
  13902. window.editTool = new EditTools()
  13903. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  13904. window.DATA = t
  13905. t.model.summary = t.summary
  13906. t.model.name = t.name
  13907. for(let i in t){
  13908. t[i] == "false" && (t[i] = false)
  13909. }
  13910. re(.7),
  13911. function() {
  13912. function y(e) {
  13913. t.update(e)
  13914. }
  13915. function A(e, t) {
  13916. ne.error(t),
  13917. n.error(t),
  13918. N.report(e, "error-" + t)
  13919. }
  13920. function C(e, t, i) {
  13921. try {
  13922. e.start(t)
  13923. } catch (e) {
  13924. throw ne.warn(e.message),
  13925. function(e) {
  13926. var t = O.details();
  13927. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13928. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13929. N.report(e, "error-webgl-generic"))
  13930. }(i.sid),
  13931. e
  13932. }
  13933. }
  13934. function I(e) {
  13935. e.stopPropagation(),
  13936. e.preventDefault()
  13937. }
  13938. window.DATA.hoticon && (g_HotImage = {
  13939. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13940. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13941. });
  13942. if (window.DATA.backgroundMusic) {
  13943. if(window.isLocal){
  13944. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  13945. }else{
  13946. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  13947. }
  13948. $("#volume").show();
  13949. }else if (g_version === "one"){
  13950. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  13951. $("#volume").show();
  13952. }
  13953. //隐藏公司logo
  13954. window.DATA.loadlogo && showLogo();
  13955. r("./lib/three75-shim"),
  13956. r("./lib/array-polyfill"),
  13957. r("./lib/performance-polyfill"),
  13958. r("./lib/shaders/CopyShader.js"),
  13959. r("./lib/shaders/HorizontalBlurShader.js"),
  13960. r("./lib/shaders/VerticalBlurShader.js"),
  13961. r("./lib/postprocessing/EffectComposer.js"),
  13962. r("./lib/postprocessing/RenderPass.js"),
  13963. r("./lib/postprocessing/MaskPass.js"),
  13964. r("./lib/postprocessing/ShaderPass.js"),
  13965. window.Promise || (window.Promise = r("promise-polyfill"));
  13966. var E = r("three")
  13967. , _ = r("three")
  13968. , b = (r("./util/sentry"),
  13969. r("./player"))
  13970. , w = r("./director")
  13971. , T = r("./controls/CameraControls")
  13972. , x = r("./model/ModelManager")
  13973. , S = r("./DisplayController")
  13974. , M = r("./label/LabelDisplayController")
  13975. , R = r("./enum/Viewmode")
  13976. , e = r("./util/logger")
  13977. , P = r("./showcase")
  13978. , O = r("./util/browser")
  13979. , L = r("./settings")
  13980. , D = r("./gui/gui")
  13981. , n = r("./gui/error")
  13982. , N = r("./analytics")
  13983. , F = r("./util/transitions")
  13984. , B = r("./effects")
  13985. , V = r("./objects/Skybox")
  13986. , k = (r("./util/common"),
  13987. r("./util/PanoramaCollection"),
  13988. r("./util/math"),
  13989. r("./util/showcase"))
  13990. , U = r("./util/camera")
  13991. , H = (r("./objects/Panorama"),
  13992. r("./cameras/PanoramaCamera"),
  13993. r("./preloaders"))
  13994. , z = r("events").EventEmitter
  13995. , G = r("./featureflags")
  13996. , W = (r("./util/lerp"),
  13997. r("./util/ajax"),
  13998. r("./ab"))
  13999. , j = r("./sdk/automation.js")
  14000. , Y = r("./scene/SceneRenderer")
  14001. , q = r("./scene/QuickstartManager")
  14002. , X = r("./tile/QualityManager.js")
  14003. , Z = r("./localization/localize")
  14004. , K = r("./tag/tagManager")
  14005. , Q = r("./tile/TileDownloader")
  14006. , J = r("./tile/PanoRenderer")
  14007. , ee = (r("./enum/PanoSizeClass"),
  14008. r("./enum/PanoramaEvents"),
  14009. r("./enum/SceneRendererEvents"))
  14010. , t = r("./gui/memoryUsage")
  14011. , te = r("./enum/RenderLayers")
  14012. , ie = r("./TimingData")
  14013. , ne = new e(i);
  14014. e.level = L.logLevel,
  14015. e.consoleEnabled = L.console,
  14016. function() {
  14017. var e = window.number//k.getModelIDFromQueryString();
  14018. if (!e)
  14019. return A(null, "loading-failed");
  14020. var t = k.parseSidUrl(e)
  14021. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14022. , n = {
  14023. panoElementsToLoad: 6,
  14024. modelElementsToLoad: 0,
  14025. totalElementsLoaded: 0,
  14026. totalElementsToLoad: 0,
  14027. totalPercentageLoaded: 0,
  14028. progressCallback: null
  14029. }
  14030. , r = document.getElementById("player")
  14031. , o = L.quickstart.enabled
  14032. , a = null
  14033. , s = null
  14034. , l = null
  14035. , c = null
  14036. , h = null
  14037. , u = null
  14038. , d = null
  14039. , p = null
  14040. , f = null
  14041. , g = null
  14042. , m = null
  14043. , v = new ie;
  14044. !function(e) {
  14045. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14046. z.defaultMaxListeners = 1e3,
  14047. function(e) {
  14048. e.addEventListener("dragenter", I, !1),
  14049. e.addEventListener("dragover", I, !1)
  14050. }(e),
  14051. O.valueFromHash("title", !0) || $(document).ready(function() {
  14052. $(".model-title").hide()
  14053. })
  14054. }(r),
  14055. function(e) {
  14056. return G.loadFeatureFlags(e).done(function(e) {
  14057. G.updateDependentSettings(e, L)
  14058. })
  14059. }({
  14060. urlBase: t.urlBase
  14061. }).then(function() {
  14062. return Z.init(),
  14063. function(e, t) {
  14064. var i = P.getModel({
  14065. url: t,
  14066. floors: O.valueFromHash("f", !0),
  14067. autoload: !1
  14068. });
  14069. return $.when(i, y).then(null, function(e) {
  14070. return this
  14071. })
  14072. }(0, e)
  14073. }).then(function(e) {
  14074. return re(.9),
  14075. function(e, t, i, n, r) {
  14076. ne.info("Model data loaded"),
  14077. ne.debug("UUID: " + e.data.job.uuid),
  14078. W.init(G.getFlags()),
  14079. i && N.initKeen({
  14080. token: i,
  14081. appId: n
  14082. }),
  14083. N.initSegment({
  14084. model: e.sid,
  14085. version: "2.25.6-0-gd87e5b1",
  14086. startSource: r.startSource,
  14087. token: t,
  14088. autoplay: r.autoplay,
  14089. quickstart: r.quickstart
  14090. })
  14091. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14092. startSource: i,
  14093. autoplay: L.autoplay,
  14094. quickstart: o
  14095. }),
  14096. g.urls.init()
  14097. }).then(function() {
  14098. return g.loadPanos()
  14099. }).then(function() {
  14100. s = U.getStartCameraOptions(g, g.panos);
  14101. //初始画面
  14102. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14103. $("<img/>").attr("src", e).on("load", function() {
  14104. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14105. $(this).remove()
  14106. $(".screen .shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14107. })
  14108. }(window.DATA.camera_start.thumbImg);
  14109. {//初始化导览时间
  14110. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14111. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14112. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14113. /* if(DATA.tourWalkSpeed!=void 0){
  14114. let r = 100 / DATA.tourWalkSpeed;
  14115. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14116. window._settings.warp.flyTime = settings.flyTime * r
  14117. }else{
  14118. window._settings.warp.flyTime = settings.flyTime
  14119. } */
  14120. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14121. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14122. }
  14123. }
  14124. {//其他
  14125. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14126. }
  14127. d = function(e) {
  14128. var t = new E.PerspectiveCamera;
  14129. t.layers.enable(te.PANOMARKERS),
  14130. t.layers.enable(te.RETICULE),
  14131. t.layers.enable(te.TAG);
  14132. var o = new E.Scene
  14133. , i = new E.AmbientLight(16777215);
  14134. return o.add(i),
  14135. o.skybox = new V,
  14136. o.add(o.skybox),
  14137. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14138. side: E.DoubleSide
  14139. })),
  14140. o.plane.position.y = 0,
  14141. o.plane.rotateX(-Math.PI / 2),
  14142. o.plane.material.visible = !1,
  14143. o.add(o.plane),
  14144. o.updateMatrixWorld(),
  14145. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14146. if (e.metadata && e.metadata.camera_position) {
  14147. var t = e.metadata.camera_position
  14148. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14149. i.position = t.clone(),
  14150. o.add(i);
  14151. var n = e.metadata.camera_quaternion
  14152. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14153. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14154. }
  14155. }),
  14156. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14157. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14158. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14159. new Y(o,t,B)
  14160. }(g),
  14161. m = function(e, t) {
  14162. var i = e ? 1 : 1e3
  14163. , n = W.tilegen || W.imgopt ? 6 : 2;
  14164. n = O.valueFromHash("tileconc", n);
  14165. var r = new X
  14166. , o = new Q({
  14167. concurrentDownloads: n
  14168. })
  14169. , a = new J
  14170. , s = new x
  14171. , l = new w
  14172. , c = new b(t)
  14173. , h = new T
  14174. , u = new S(i)
  14175. , d = new M
  14176. , p = new K;
  14177. return {
  14178. qualityManager: r,
  14179. panoRenderer: a,
  14180. tileDownloader: o,
  14181. player: c,
  14182. director: l,
  14183. modelManager: s,
  14184. tagManager: p,
  14185. displayController: u,
  14186. labelDisplayController: d,
  14187. controls: h
  14188. }
  14189. }(o, s.mode),
  14190. l = m.controls,
  14191. c = m.player,
  14192. h = m.director,
  14193. u = m.tagManager,
  14194. p = m.tileDownloader,
  14195. f = m.qualityManager,
  14196. m.panoRenderer,
  14197. function(e, t, i, n) {
  14198. var r = i.controls
  14199. , o = i.qualityManager
  14200. , a = i.panoRenderer
  14201. , s = i.tileDownloader
  14202. , l = i.modelManager;
  14203. r.init(n, l),
  14204. j.init(i.director, r, i.player, l, t),
  14205. o.init(l),
  14206. s.init(o),
  14207. a.init(t, s, o),
  14208. l.init(s, a, o),
  14209. l.addModel(e),
  14210. t.addComponent(F)
  14211. }(g, d, m, r),
  14212. c.director = h,
  14213. g.supportsTiles && p.start(),
  14214. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14215. o = !1);
  14216. var e = null;
  14217. if (o) {
  14218. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14219. var t = l.controls[R.PANORAMA];
  14220. a = new q(f,d.scene,d.camera,t,r),
  14221. C(d, r, g),
  14222. e = a.load(s).then(function() {
  14223. d.addComponent(a),
  14224. d.once(ee.AfterRender, function() {
  14225. ne.warn("First render after quickstart load finished.")
  14226. })
  14227. })
  14228. }
  14229. return window.flyToFirst = function() {
  14230. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14231. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14232. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14233. c.flyToPano({
  14234. pano: e,
  14235. lookAtPoint: i
  14236. })
  14237. }
  14238. ,
  14239. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14240. }).then(function() {
  14241. return function(e, t, i, n, r) {
  14242. return r.progressCallback = t,
  14243. N.sessionStart(),
  14244. e.load(n).progress(function(e, t) {
  14245. e.modelElementsToLoad = t[1],
  14246. function(e) {
  14247. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14248. }(e),
  14249. function(e) {
  14250. e.totalElementsLoaded++,
  14251. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14252. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14253. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14254. console.log("pro:" + e.totalPercentageLoaded),
  14255. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14256. }(e)
  14257. }
  14258. .bind(this, r))
  14259. }(g, D.onProgress, 0, !o, n)
  14260. }).then(function() {
  14261. s.quickstart = o,
  14262. function(e, t, i, n) {
  14263. var r = i.qualityManager
  14264. , o = i.panoRenderer
  14265. , a = i.tileDownloader
  14266. , s = i.modelManager
  14267. , l = i.player
  14268. , c = i.director
  14269. , h = i.tagManager
  14270. , u = i.displayController
  14271. , d = i.labelDisplayController
  14272. , p = i.controls;
  14273. t.scene.add(e),
  14274. t.qualityManager = r;
  14275. var f = {
  14276. camera: t.camera,
  14277. director: c,
  14278. modelManager: s,
  14279. tileDownloader: a,
  14280. panoRenderer: o,
  14281. qualityManager: r,
  14282. tagManager: h,
  14283. container: n,
  14284. controls: p
  14285. };
  14286. l.init(f),
  14287. l.setScene(t.scene),
  14288. h.init(s, l),
  14289. c.init(l, s),
  14290. u.init(c, l, s, h, n),
  14291. d.init(l, s, n),
  14292. B.bindEvents(l),
  14293. t.addComponent(h),
  14294. t.addComponent(l),
  14295. t.addComponent(o),
  14296. l.sceneRenderer = t
  14297. }(g, d, m, r),
  14298. d.started || C(d, r, g),
  14299. N.modelLoaded(g, c, l, L.autoplay),
  14300. function(e, t, i, n) {
  14301. return ne.info("Starting player in " + i.mode),
  14302. N.report(t.sid, "started-playing", n, i.quickstart),
  14303. e.start(i)
  14304. }(c, g, s, L.autoplay).done(function() {
  14305. h.autoTour()
  14306. }),
  14307. g.supportsTiles || new H(g,c).start();
  14308. o && (d.removeComponent(a),
  14309. a.destroy(),
  14310. s.pano.enter()),
  14311. D.init(g, h, c, l, d, s, N.getSessionId()),
  14312. D.endLoading(g, h, u),
  14313. d.once(ee.AfterRender, function() {
  14314. v.setAppReadyTime();
  14315. var e = v.calcFullLoadingTime();
  14316. ne.warn("Total load time: " + e / 1e3),
  14317. N.loadComplete(e),
  14318. ne.warn("First render after model load finished.");
  14319. editTool.loadDone('data', window.DATA)
  14320. }),
  14321. d.on(ee.MemoryUsageUpdated, y)
  14322. }).fail(A.bind(this, e))
  14323. }()
  14324. }()
  14325. }).fail(e=>{
  14326. alert("缺少someData文件,请检查场景码是否正确。")
  14327. })
  14328. }
  14329. ).call(this, "/js/main.js")
  14330. }
  14331. , {
  14332. "./DisplayController": 1,
  14333. "./TimingData": 2,
  14334. "./ab": 3,
  14335. "./analytics": 4,
  14336. "./cameras/PanoramaCamera": 7,
  14337. "./controls/CameraControls": 9,
  14338. "./director": 15,
  14339. "./effects": 16,
  14340. "./enum/PanoSizeClass": 36,
  14341. "./enum/PanoramaEvents": 37,
  14342. "./enum/RenderLayers": 41,
  14343. "./enum/SceneRendererEvents": 43,
  14344. "./enum/Viewmode": 51,
  14345. "./featureflags": 59,
  14346. "./gui/error": 64,
  14347. "./gui/gui": 65,
  14348. "./gui/memoryUsage": 73,
  14349. "./label/LabelDisplayController": 91,
  14350. "./lib/array-polyfill": 92,
  14351. "./lib/performance-polyfill": 95,
  14352. "./lib/postprocessing/EffectComposer.js": 96,
  14353. "./lib/postprocessing/MaskPass.js": 97,
  14354. "./lib/postprocessing/RenderPass.js": 98,
  14355. "./lib/postprocessing/ShaderPass.js": 99,
  14356. "./lib/shaders/CopyShader.js": 100,
  14357. "./lib/shaders/HorizontalBlurShader.js": 101,
  14358. "./lib/shaders/VerticalBlurShader.js": 102,
  14359. "./lib/three75-shim": 103,
  14360. "./localization/localize": 108,
  14361. "./tag/tagManager": 124,
  14362. "./model/ModelManager": 140,
  14363. "./objects/Panorama": 148,
  14364. "./objects/Skybox": 152,
  14365. "./player": 155,
  14366. "./preloaders": 156,
  14367. "./scene/QuickstartManager": 157,
  14368. "./scene/SceneRenderer": 158,
  14369. "./sdk/automation.js": 164,
  14370. "./settings": 166,
  14371. "./showcase": 168,
  14372. "./tile/PanoRenderer": 169,
  14373. "./tile/QualityManager.js": 170,
  14374. "./tile/TileDownloader": 171,
  14375. "./util/PanoramaCollection": 178,
  14376. "./util/ajax": 181,
  14377. "./util/browser": 182,
  14378. "./util/camera": 183,
  14379. "./util/common": 185,
  14380. "./util/lerp": 188,
  14381. "./util/logger": 189,
  14382. "./util/math": 190,
  14383. "./util/sentry": 192,
  14384. "./util/showcase": 193,
  14385. "./util/transitions": 195,
  14386. events: 202,
  14387. "promise-polyfill": 213,
  14388. three: 217
  14389. }],
  14390. 117: [function(e, t, i) {
  14391. "use strict";
  14392. function n(e) {
  14393. e = e || {},
  14394. r.RawShaderMaterial.call(this, a.extendObject({
  14395. fragmentShader: o.cube.fragmentShader,
  14396. vertexShader: o.cube.vertexShader,
  14397. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14398. name: "CubemapMaterial"
  14399. }, e))
  14400. }
  14401. var r = e("three")
  14402. , o = e("../shaders")
  14403. , a = e("../util/common");
  14404. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14405. t.exports = n
  14406. }
  14407. , {
  14408. "../shaders": 167,
  14409. "../util/common": 185,
  14410. three: 217
  14411. }],
  14412. 118: [function(e, t, i) {
  14413. "use strict";
  14414. function n(e) {
  14415. e = e || {},
  14416. r.RawShaderMaterial.call(this, a.extendObject({
  14417. fragmentShader: o.model.fragmentShader,
  14418. vertexShader: o.model.vertexShader,
  14419. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14420. name: "ModelTextureMaterial"
  14421. }, e))
  14422. }
  14423. var r = e("three")
  14424. , o = e("../shaders")
  14425. , a = e("../util/common");
  14426. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14427. i && (this.uniforms.progress.value = 0),
  14428. e.ensureSkyboxReadyForRender(),
  14429. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14430. this.uniforms.pano0Position.value.copy(e.position),
  14431. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14432. t.ensureSkyboxReadyForRender(),
  14433. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14434. this.uniforms.pano1Position.value.copy(t.position),
  14435. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14436. }
  14437. ,
  14438. t.exports = n
  14439. }
  14440. , {
  14441. "../shaders": 167,
  14442. "../util/common": 185,
  14443. three: 217
  14444. }],
  14445. 119: [function(m, v, e) {
  14446. (function(e) {
  14447. "use strict";
  14448. function t(e, t, i, n) {
  14449. this.div = null,
  14450. this.body = null,
  14451. this.label = e,
  14452. this.description = t,
  14453. this.parsedDescription = [],
  14454. this.media = i || {
  14455. type: null
  14456. },
  14457. this.loadingSpinner = null,
  14458. this.parser = new r({
  14459. supportLinks: !c.valueFromHash("mls"),
  14460. keepLinkLabels: !0
  14461. }),
  14462. this.state = g.CLOSED,
  14463. this.orientation = "",
  14464. this.initialTransform = "",
  14465. this.hovering = !1,
  14466. this.openTransition = null,
  14467. this.closeTransition = null,
  14468. this.openPromise = null,
  14469. this.closePromise = null,
  14470. this.animationTransition = null,
  14471. this.animationScale = 0
  14472. }
  14473. var r = m("../Parser/DescriptionParser")
  14474. , i = m("../Media/Link")
  14475. , n = m("../Media/Image")
  14476. , o = m("../Media/EmbedlyPlayer")
  14477. , a = m("../Media/EmbedlyEmbed")
  14478. , s = m("../../util/transitions")
  14479. , l = m("../../util/lerp")
  14480. , c = m("../../util/browser")
  14481. , b = m("./BillboardEvent")
  14482. , w = m("../Media/MediaEvent")
  14483. , h = m("../Parser/DescriptionChunkType")
  14484. , u = m("events").EventEmitter
  14485. , d = m("./billboardSettings")
  14486. , T = m("./overlaySettings")
  14487. , p = new (m("../../util/logger"))(e)
  14488. , f = document.getElementById("tag-billboards");
  14489. f.addEventListener("touchend", function(e) {
  14490. f.style.pointerEvents = "none"
  14491. }),
  14492. f.addEventListener("touchcancel", function(e) {
  14493. f.style.pointerEvents = "none"
  14494. });
  14495. var g = {
  14496. CLOSED: "closed",
  14497. OPENING: "opening",
  14498. OPEN: "open",
  14499. CLOSING: "closing",
  14500. ACTIVE: "active"
  14501. };
  14502. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14503. this.parsedDescription = this.parser.parse(this.description);
  14504. var t = document.createElement("div");
  14505. t.className = "tag-container has-hotzone",
  14506. this.div = t,
  14507. this.body = document.createElement("div"),
  14508. this.body.className = "tag-body";
  14509. var i = document.createElement("div");
  14510. i.classList.add("tag-content");
  14511. var n = document.createElement("div");
  14512. n.classList.add("tag-text-content");
  14513. var r = document.createElement("div");
  14514. r.className = "tag-label",
  14515. r.textContent = this.label,
  14516. n.appendChild(r);
  14517. var o = document.createElement("div");
  14518. o.className = "tag-desc",
  14519. n.appendChild(o),
  14520. i.appendChild(n),
  14521. this.body.appendChild(i),
  14522. this.appendDescriptionElements(this.parsedDescription, o),
  14523. this.appendMedia(),
  14524. t.appendChild(this.body),
  14525. f.appendChild(t),
  14526. this.bindEvents(t, this.body)
  14527. }
  14528. ,
  14529. t.prototype.bindEvents = function(i, e) {
  14530. function t(n) {
  14531. return function(e) {
  14532. if (!this.div.classList.contains("overlay")) {
  14533. var t, i = document.getElementById("player");
  14534. try {
  14535. t = new MouseEvent(n,e)
  14536. } catch (i) {
  14537. (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)
  14538. }
  14539. i.dispatchEvent(t)
  14540. }
  14541. }
  14542. }
  14543. e.addEventListener("mousedown", function(e) {
  14544. e.stopPropagation()
  14545. }),
  14546. e.addEventListener("mouseup", function(e) {
  14547. e.stopPropagation()
  14548. }),
  14549. i.addEventListener("touchstart", function(e) {
  14550. f.style.pointerEvents = "auto"
  14551. }),
  14552. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14553. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14554. e.addEventListener("mouseover", function(e) {
  14555. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14556. }
  14557. .bind(this)),
  14558. i.addEventListener("mouseenter", function(e) {
  14559. this.state !== g.CLOSING && (this.hovering = !0,
  14560. this.emit(b.ENTER))
  14561. }
  14562. .bind(this)),
  14563. i.addEventListener("mouseleave", function(e) {
  14564. this.hovering = !1,
  14565. this.emit(b.LEAVE)
  14566. }
  14567. .bind(this)),
  14568. i.addEventListener("gesturestart", function(e) {
  14569. e.preventDefault()
  14570. });
  14571. var n = i.querySelector(".tag-text-content")
  14572. , r = 0;
  14573. n.addEventListener("touchstart", function(e) {
  14574. r = e.changedTouches[0].clientY
  14575. }),
  14576. n.addEventListener("touchmove", function(t) {
  14577. function e(e) {
  14578. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14579. }
  14580. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14581. }),
  14582. i.addEventListener("touchmove", function(e) {
  14583. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14584. })
  14585. }
  14586. ,
  14587. t.prototype.appendDescriptionElements = function(e, i) {
  14588. 0 < e.length && this.div.classList.add("has-text"),
  14589. e.forEach(function(e, t) {
  14590. switch (e.type) {
  14591. case h.TEXT:
  14592. i.appendChild(this.createTextElement(e.text));
  14593. break;
  14594. case h.LINK:
  14595. i.appendChild(this.createLinkElement(e.link))
  14596. }
  14597. }
  14598. .bind(this))
  14599. }
  14600. ,
  14601. t.prototype.appendLoadingSpinner = function() {
  14602. this.loadingSpinner = document.createElement("div"),
  14603. this.loadingSpinner.classList.add("loading-spinner");
  14604. var e = document.createElement("div");
  14605. e.classList.add("gui-spinner-icon"),
  14606. this.loadingSpinner.appendChild(e),
  14607. this.body.appendChild(this.loadingSpinner)
  14608. }
  14609. ,
  14610. t.prototype.onMediaLoadFinished = function() {
  14611. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14612. this.applyOrientation(this.orientation),
  14613. this.loadingSpinner = null)
  14614. }
  14615. ,
  14616. t.prototype.appendMedia = function() {
  14617. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14618. this.appendLoadingSpinner();
  14619. var e = document.createElement("div");
  14620. e.classList.add("tag-media-content");
  14621. var t = document.createElement("i");
  14622. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14623. t.classList.add(e)
  14624. }),
  14625. this.body.appendChild(t),
  14626. this.body.appendChild(e),
  14627. this.media.type) {
  14628. case h.IMAGE:
  14629. e.appendChild(this.createImageElement(this.media, this.body));
  14630. break;
  14631. case h.VIDEO:
  14632. e.appendChild(this.createVideoElement(this.media, this.body));
  14633. break;
  14634. case h.RICH:
  14635. e.appendChild(this.createEmbedElement(this.media, this.body))
  14636. }
  14637. }
  14638. }
  14639. ,
  14640. t.prototype.createTextElement = function(e) {
  14641. var t = document.createElement("span");
  14642. return t.textContent = e,
  14643. t
  14644. }
  14645. ,
  14646. t.prototype.createLinkElement = function(e) {
  14647. var t = new i(e);
  14648. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14649. t.createDomElement()
  14650. }
  14651. ,
  14652. t.prototype.createImageElement = function(t, C) {
  14653. function e() {
  14654. function e() {
  14655. p || (E.classList.remove("view-image"),
  14656. a.classList.add("overlay"),
  14657. t(),
  14658. window.addEventListener("resize", A),
  14659. a.addEventListener("click", i),
  14660. c.addEventListener("click", r),
  14661. o.addEventListener("click", n),
  14662. p = !0,
  14663. _.emit(w.IMAGE_OPENED))
  14664. }
  14665. function t() {
  14666. C.classList.add("show-info"),
  14667. s.classList.remove("collapsible"),
  14668. s.style.height = "";
  14669. var e = parseFloat(getComputedStyle(v).lineHeight)
  14670. , t = g + e
  14671. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14672. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14673. , r = n
  14674. , o = r * I.aspect;
  14675. i < o && (r = (o = i) / I.aspect),
  14676. n < r && (o = (r = n) * I.aspect),
  14677. o += m,
  14678. r += m + t,
  14679. C.style.width = o + "px",
  14680. C.style.height = r + "px",
  14681. l.style.paddingTop = e + m + "px",
  14682. 0 < _.description.length && (s.classList.add("collapsible"),
  14683. s.style.height = s.clientHeight + 12 + "px",
  14684. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14685. }
  14686. function i(e) {
  14687. e.target === a && n()
  14688. }
  14689. function n() {
  14690. p && (p = !1,
  14691. E.classList.add("view-image"),
  14692. a.classList.remove("overlay"),
  14693. s.style.height = "",
  14694. l.style.paddingTop = "",
  14695. C.style.width = "",
  14696. C.style.height = "",
  14697. window.removeEventListener("resize", A),
  14698. a.removeEventListener("click", i),
  14699. c.removeEventListener("click", r),
  14700. o.removeEventListener("click", n),
  14701. _.emit(w.IMAGE_CLOSED),
  14702. _.close(!0))
  14703. }
  14704. function r(e) {
  14705. C.classList.toggle("show-info")
  14706. }
  14707. var a = _.div
  14708. , s = a.getElementsByClassName("tag-content")[0]
  14709. , l = a.getElementsByClassName("tag-media-content")[0]
  14710. , o = C.getElementsByClassName("close")[0]
  14711. , c = s.getElementsByClassName("tag-label")[0];
  14712. a.classList.add("has-image"),
  14713. E.classList.add("view-image"),
  14714. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14715. _.applyOrientation(_.orientation);
  14716. 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,
  14717. function() {
  14718. clearInterval(h),
  14719. clearTimeout(u),
  14720. h = setInterval(function() {
  14721. var e = a.clientHeight;
  14722. d !== e && (t(),
  14723. d = e)
  14724. }, 100),
  14725. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14726. }
  14727. );
  14728. I.on(w.IMAGE_OPENING, e),
  14729. _.on(b.ACTIVATE, e),
  14730. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14731. _.on(b.CLOSING, n)
  14732. }
  14733. var I = new n
  14734. , E = I.createDomElement();
  14735. this.once(b.OPENED, function() {
  14736. I.load(t.src).then(e).catch(function(e) {
  14737. p.warn("Failed to load image:", t.src),
  14738. p.warn("with error:", e)
  14739. }).then(this.onMediaLoadFinished.bind(this))
  14740. });
  14741. var _ = this;
  14742. return E
  14743. }
  14744. ,
  14745. t.prototype.createVideoElement = function(t, e) {
  14746. var i = new o({
  14747. autoPlay: !0,
  14748. autoResume: !0,
  14749. startMuted: !1,
  14750. loop: !1
  14751. })
  14752. , n = i.createDomElement();
  14753. return this.once(b.OPENED, function() {
  14754. i.load(t.src).then(function() {
  14755. this.div.classList.add("has-video"),
  14756. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14757. i.play()),
  14758. this.on(b.OPENING, i.show.bind(i)),
  14759. this.on(b.OPENED, i.play.bind(i)),
  14760. this.on(b.CLOSING, i.pause.bind(i)),
  14761. this.on(b.CLOSED, i.hide.bind(i))
  14762. }
  14763. .bind(this)).catch(function(e) {
  14764. p.warn("Failed to embed video:", t.src),
  14765. p.warn("with error:", e)
  14766. }).then(this.onMediaLoadFinished.bind(this))
  14767. }
  14768. .bind(this)),
  14769. n
  14770. }
  14771. ,
  14772. t.prototype.createEmbedElement = function(t, e) {
  14773. var i = new a
  14774. , n = i.createDomElement();
  14775. return this.once(b.OPENED, function() {
  14776. i.load(t.src).then(function() {
  14777. this.div.classList.add("has-embed"),
  14778. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14779. this.applyOrientation(this.orientation),
  14780. this.on(b.OPENING, i.show.bind(i)),
  14781. this.on(b.CLOSED, i.hide.bind(i))
  14782. }
  14783. .bind(this)).catch(function(e) {
  14784. p.warn("Failed to embed:", t.src),
  14785. p.warn("with error:", e)
  14786. }).then(this.onMediaLoadFinished.bind(this))
  14787. }
  14788. .bind(this)),
  14789. n
  14790. }
  14791. ,
  14792. t.prototype.open = function(e) {
  14793. return this.openPromise = $.Deferred(),
  14794. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14795. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14796. this.state !== g.OPEN && (this.emit(b.OPENING),
  14797. e && this.emit(b.ACTIVATING),
  14798. this.state = g.OPENING,
  14799. this.animateOpen(function() {
  14800. e && this.setActiveState(),
  14801. this.openPromise.resolve()
  14802. }
  14803. .bind(this)))
  14804. }
  14805. .bind(this), d.animation.openDelay),
  14806. s.cancel(this.closeTransition),
  14807. this.closePromise && this.closePromise.reject(),
  14808. this.closeTransition = void 0,
  14809. this.openPromise.promise())
  14810. }
  14811. ,
  14812. t.prototype.close = function(e) {
  14813. return this.closePromise = $.Deferred(),
  14814. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14815. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14816. this.state = g.CLOSING,
  14817. this.animateClose())
  14818. }
  14819. .bind(this), d.animation.closeDelay)),
  14820. s.cancel(this.openTransition),
  14821. this.openPromise && this.openPromise.reject(),
  14822. this.openTransition = void 0,
  14823. this.closePromise.resolve(),
  14824. this.closePromise.promise())
  14825. }
  14826. ,
  14827. t.prototype.setActiveState = function() {
  14828. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14829. this.emit(b.ACTIVATE),
  14830. this.div.classList.remove("has-hotzone"))
  14831. }
  14832. ,
  14833. t.prototype.animateOpen = function(e) {
  14834. if (this.state === g.OPENING) {
  14835. if (s.cancel(this.animationTransition),
  14836. c.detectSamsungNative())
  14837. return this.boardOrientation = null,
  14838. this.div.style.visibility = "visible",
  14839. this.emit(b.OPENED),
  14840. this.state = g.OPEN,
  14841. void (e && e());
  14842. this.div.style.webkitTransform = "scale(0)",
  14843. this.div.style.transform = "scale(0)",
  14844. this.div.style.visibility = "visible",
  14845. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14846. this.emit(b.OPENED),
  14847. this.state = g.OPEN,
  14848. e && e()
  14849. }
  14850. .bind(this))
  14851. }
  14852. }
  14853. ,
  14854. t.prototype.animateClose = function(e) {
  14855. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14856. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14857. this.emit(b.CLOSED),
  14858. this.state = g.CLOSED,
  14859. this.div.style.visibility = "hidden",
  14860. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14861. e && e()
  14862. }
  14863. .bind(this)))
  14864. }
  14865. ,
  14866. t.prototype.needsUpdate = function() {
  14867. return this.state !== g.CLOSED
  14868. }
  14869. ,
  14870. t.prototype.update = function(e, t) {
  14871. if (this.needsUpdate()) {
  14872. var i = (this.updateOrientation(e),
  14873. this.calcScale(t))
  14874. , n = {
  14875. x: (e.x + 1) * $("#player").width() / 2,
  14876. y: (e.y + 1) * $("#player").height() / 2
  14877. };
  14878. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14879. this.div.style.webkitTransform = this.div.screenTransform,
  14880. this.div.style.transform = this.div.screenTransform
  14881. }
  14882. }
  14883. ,
  14884. t.prototype.getDimensions = function() {
  14885. return this.div.getBoundingClientRect()
  14886. }
  14887. ,
  14888. t.prototype.calcScale = function(e) {
  14889. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14890. }
  14891. ,
  14892. t.prototype.updateOrientation = function(e) {
  14893. if (this.state !== g.ACTIVE) {
  14894. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14895. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14896. , n = "";
  14897. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14898. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14899. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14900. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14901. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14902. }
  14903. }
  14904. ,
  14905. t.prototype.applyOrientation = function(e) {
  14906. this.div.style.transform = this.div.style.webkitTransform = "",
  14907. this.div.classList.remove("tag-container-" + this.orientation),
  14908. this.div.classList.add("tag-container-" + e);
  14909. var t = window.getComputedStyle(this.div);
  14910. this.initialTransform = t.transform || t.webkitTransform,
  14911. "none" === this.initialTransform && (this.initialTransform = "");
  14912. var i = t.transform.slice(7, -1).split(",")
  14913. , n = -i[4]
  14914. , r = -i[5];
  14915. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14916. this.div.style.transformOrigin = n + "px " + r + "px",
  14917. this.orientation = e
  14918. }
  14919. ,
  14920. v.exports = t
  14921. }
  14922. ).call(this, "/js/tag/Billboard/Billboard.js")
  14923. }
  14924. , {
  14925. "../../util/browser": 182,
  14926. "../../util/lerp": 188,
  14927. "../../util/logger": 189,
  14928. "../../util/transitions": 195,
  14929. "../Media/EmbedlyEmbed": 125,
  14930. "../Media/EmbedlyPlayer": 126,
  14931. "../Media/Image": 128,
  14932. "../Media/Link": 129,
  14933. "../Media/MediaEvent": 131,
  14934. "../Parser/DescriptionChunkType": 133,
  14935. "../Parser/DescriptionParser": 134,
  14936. "./BillboardEvent": 120,
  14937. "./billboardSettings": 121,
  14938. "./overlaySettings": 122,
  14939. events: 202
  14940. }],
  14941. 120: [function(e, t, i) {
  14942. "use strict";
  14943. t.exports = Object.freeze({
  14944. ENTER: "billboard.enter",
  14945. LEAVE: "billboard.leave",
  14946. OPENING: "billboard.opening",
  14947. OPENED: "billboard.open",
  14948. CLOSING: "billboard.closing",
  14949. CLOSED: "billboard.closed",
  14950. ACTIVATING: "billboard.activating",
  14951. ACTIVATE: "billboard.activate"
  14952. })
  14953. }
  14954. , {}],
  14955. 121: [function(e, t, i) {
  14956. "use strict";
  14957. t.exports = Object.freeze({
  14958. animation: Object.freeze({
  14959. hoverOnClosing: !1,
  14960. openDelay: 100,
  14961. closeDelay: 50,
  14962. openDuration: 200,
  14963. closeDuration: 100
  14964. }),
  14965. boardToDiscRatio: 1.2
  14966. })
  14967. }
  14968. , {}],
  14969. 122: [function(e, t, i) {
  14970. "use strict";
  14971. t.exports = Object.freeze({
  14972. boundaryWidth: 30,
  14973. boundaryHeight: 0
  14974. })
  14975. }
  14976. , {}],
  14977. 123: [function(M, R, e) {
  14978. (function(e) {
  14979. "use strict";
  14980. function d(e, t, i) {
  14981. var n = i.version || "0";
  14982. "0" !== n && w.info("tag defined using version " + n),
  14983. this.model = e,
  14984. this.sid = t,
  14985. this.color = (new f.Color).set(i.color || o.tagDefault),
  14986. this.hoverColor = o._darken(this.color, .2),
  14987. this.floor = null,
  14988. this.floorIndex = i.floor,
  14989. this.mode = m.PANORAMA,
  14990. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  14991. this.obj3d = null,
  14992. this.disc = null,
  14993. this.materials = {
  14994. disc: null,
  14995. pole: null
  14996. },
  14997. this.position = (new f.Vector3).copy(i.position),
  14998. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  14999. this.discWorldPosition = null,
  15000. this.discScale = .05,
  15001. this.poleEnabled = i.stem.enabled,
  15002. this.billboard = new r(i.label,i.description,i.media,this),
  15003. this.visibleTransition = null,
  15004. this.hoveringDisc = !1
  15005. }
  15006. 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"),
  15007. 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);
  15008. d.prototype = Object.create(b.prototype),
  15009. d.raycaster = new f.Raycaster,
  15010. d.prototype.bindEvents = function() {
  15011. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15012. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15013. }
  15014. ,
  15015. d.prototype.build = function() {
  15016. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15017. this.floor && (this.billboard.build(this.model.sid),
  15018. this.obj3d = this.buildObject3D(),
  15019. this.floor.add(this.obj3d)),
  15020. this
  15021. }
  15022. ,
  15023. d.prototype.buildObject3D = function() {
  15024. var e = new f.Object3D;
  15025. e.position.copy(this.position);
  15026. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15027. t.bg.value = x,
  15028. t.mask.value = T,
  15029. t.color.value.copy(this.color),
  15030. this.materials.disc = new f.RawShaderMaterial({
  15031. transparent: !0,
  15032. vertexShader: A.tagDisc.vertexShader,
  15033. fragmentShader: A.tagDisc.fragmentShader,
  15034. uniforms: t
  15035. }),
  15036. this.disc = new f.Mesh(S,this.materials.disc),
  15037. this.disc.layers.set(a.TAG),
  15038. this.disc.position.copy(this.discPosition),
  15039. this.disc.renderOrder = s.tagDisc;
  15040. var i = (this.disc.tag = this).buildPole();
  15041. return i.layers.set(a.TAG),
  15042. i.renderOrder = s.tagStem,
  15043. e.add(i),
  15044. e.layers.set(a.TAG),
  15045. e.add(this.disc)
  15046. }
  15047. ,
  15048. d.prototype.buildPole = function() {
  15049. var e = new f.BufferGeometry
  15050. , t = new Float32Array(6);
  15051. return t[0] = t[1] = t[2] = 0,
  15052. t[3] = this.discPosition.x,
  15053. t[4] = this.discPosition.y,
  15054. t[5] = this.discPosition.z,
  15055. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15056. this.materials.pole = new f.LineBasicMaterial({
  15057. linewidth: g.tags.pole.width,
  15058. color: g.tags.pole.color,
  15059. opacity: 0,
  15060. visible: this.poleEnabled,
  15061. transparent: !0,
  15062. depthWrite: !1
  15063. }),
  15064. new f.Line(e,this.materials.pole)
  15065. }
  15066. ,
  15067. d.prototype.setFreeState = function(e) {
  15068. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15069. this.materials.disc.uniforms.color.value = this.color
  15070. }
  15071. .bind(this))
  15072. }
  15073. ,
  15074. d.prototype.setHoverState = function(e) {
  15075. this.billboard.open(e),
  15076. this.materials.disc.uniforms.color.value = this.hoverColor
  15077. }
  15078. ,
  15079. d.prototype.hide = function(e, t) {
  15080. var i = $.Deferred();
  15081. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15082. return i.resolve().promise();
  15083. e = e || 0,
  15084. t = t || 0,
  15085. C.cancel(this.visibleTransition);
  15086. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15087. return this.visibleTransition = C.start((n = this,
  15088. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15089. o = I.property(n.materials.pole, "opacity", 0),
  15090. function(e) {
  15091. r(e),
  15092. n.materials.pole && o(e)
  15093. }
  15094. ), s * a, function() {
  15095. i.resolve()
  15096. }, l, E[g.warp.blendEasing]),
  15097. i.promise()
  15098. }
  15099. ,
  15100. d.prototype.show = function(e, t) {
  15101. var i = $.Deferred();
  15102. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15103. return i.resolve().promise();
  15104. e = e || 0,
  15105. t = t || 0,
  15106. C.cancel(this.visibleTransition);
  15107. 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;
  15108. return this.visibleTransition = C.start((n = this,
  15109. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15110. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15111. function(e) {
  15112. r(e),
  15113. n.materials.pole && o(e)
  15114. }
  15115. ), s * a, function() {
  15116. i.resolve()
  15117. }, l, E[g.warp.blendEasing]),
  15118. i.promise()
  15119. }
  15120. ,
  15121. d.prototype.closestPanoTowardTag = function(e, t) {
  15122. var i = []
  15123. , n = []
  15124. , r = this.disc.getWorldPosition();
  15125. if (e === m.PANORAMA) {
  15126. var o = t.position.clone().sub(r).normalize();
  15127. i.push(y.filters.isPanoAligned()),
  15128. i.push(y.filters.isNeighbourPanoTo(t)),
  15129. i.push(y.filters.inPanoDirection(r, o, .5)),
  15130. n.push(y.scoreFunctions.direction(r, o))
  15131. }
  15132. var a = new f.Vector3;
  15133. i.push(function(e) {
  15134. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15135. }, function(e) {
  15136. a.copy(r).sub(e.position);
  15137. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15138. , i = g.tags.navigate.tiltTolerance;
  15139. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15140. }),
  15141. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15142. var s = this.model.panos.sortByScore(i, n);
  15143. if (g.tags.navigate.lineOfSight) {
  15144. for (var l = 0; l < s.length; l++) {
  15145. var c = s[l].item
  15146. , h = c.position.distanceTo(r);
  15147. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15148. return null;
  15149. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15150. var u = d.raycaster.intersectObjects(this.model.colliders);
  15151. if (0 === u.length || u[0].distance > h)
  15152. return c
  15153. }
  15154. return null
  15155. }
  15156. return 0 < s.length && s[0].pano
  15157. }
  15158. ,
  15159. d.prototype.examine = function(i) {
  15160. if(!player.currentPano)return;
  15161. var e = i.mode
  15162. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15163. , t = this.disc.getWorldPosition();
  15164. this.billboard.setActiveState();
  15165. var r = function() {
  15166. var e = this.billboard.getDimensions()
  15167. , t = new f.Vector3;
  15168. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15169. t.unproject(i.camera),
  15170. i.flyToPano({
  15171. pano: n,
  15172. lookAtPoint: t
  15173. })
  15174. }
  15175. .bind(this);
  15176. if (e === m.PANORAMA)
  15177. if (n !== i.currentPano) {
  15178. var o = {
  15179. pano: n,
  15180. lookAtPoint: t,
  15181. duration: null,
  15182. maxDistanceOverride: null,
  15183. skipWarpingCheck: !1
  15184. };
  15185. i.flyToPano(o, r)
  15186. } else
  15187. setTimeout(function() {
  15188. this.billboard.open().then(function() {
  15189. r()
  15190. })
  15191. }
  15192. .bind(this), 0);
  15193. else {
  15194. var a = {
  15195. pano: n
  15196. };
  15197. if (t) {
  15198. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15199. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15200. }
  15201. a.callback = r,
  15202. a.duration = 1500,
  15203. a.mode = m.PANORAMA,
  15204. i.flyToNewMode(a)
  15205. }
  15206. }
  15207. ,
  15208. d.prototype.update = (n = new f.Vector3,
  15209. function(e, t) {
  15210. this.discWorldPosition = this.disc.getWorldPosition(),
  15211. this.updateDisc(e, t),
  15212. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15213. n.z < 1 && (n.y *= -1,
  15214. this.billboard.update(n, this.getDiscRadius(n, t))))
  15215. }
  15216. ),
  15217. d.prototype.updateDisc = (l = new f.Vector3,
  15218. c = new f.Vector3,
  15219. h = new f.Vector3,
  15220. u = new f.Vector3,
  15221. p = new f.Vector3,
  15222. function(e, t) {
  15223. var i = g.tags.visibility
  15224. , n = g.tags.disc.scale
  15225. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15226. 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)),
  15227. this.obj3d.visible) {
  15228. this.disc.quaternion.copy(t.quaternion);
  15229. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15230. l.copy(this.discWorldPosition).project(t),
  15231. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15232. h.set(o / 2, 0, 0).add(c),
  15233. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15234. p.copy(u).unproject(t);
  15235. var a = p.distanceTo(this.discWorldPosition)
  15236. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15237. this.discScale = a * s,
  15238. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15239. }
  15240. }
  15241. ),
  15242. d.prototype.getDiscRadius = (i = new f.Vector3,
  15243. function(e, t) {
  15244. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15245. Math.abs(e.x - i.x) * $("#player").width()
  15246. }
  15247. ),
  15248. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15249. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15250. }
  15251. ,
  15252. d.prototype.offScreen = function(e, t) {
  15253. var i = e.getWorldPosition().project(t);
  15254. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15255. }
  15256. ,
  15257. d.viewportScale = function() {
  15258. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15259. d.viewportHeight = $("#player").height(),
  15260. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15261. d.currentViewportScale
  15262. }
  15263. ,
  15264. R.exports = d
  15265. }
  15266. ).call(this, "/js/tag/tag.js")
  15267. }
  15268. , {
  15269. "../enum/Colors": 19,
  15270. "../enum/RenderLayers": 41,
  15271. "../enum/RenderOrder": 42,
  15272. "../enum/Viewmode": 51,
  15273. "../objects/Panorama": 148,
  15274. "../settings": 166,
  15275. "../shaders": 167,
  15276. "../util/common": 185,
  15277. "../util/easing": 186,
  15278. "../util/lerp": 188,
  15279. "../util/logger": 189,
  15280. "../util/math": 190,
  15281. "../util/texture": 194,
  15282. "../util/transitions": 195,
  15283. "./Billboard/Billboard": 119,
  15284. "./Billboard/BillboardEvent": 120,
  15285. events: 202,
  15286. three: 217
  15287. }],
  15288. 124: [function(M, R, e) {
  15289. (function(e) {
  15290. "use strict";
  15291. function t() {
  15292. this.tagState = T.IDLE,
  15293. this.intersectTag = null,
  15294. this.hoveredTag = null,
  15295. this.activeTag = null,
  15296. this.tagDiscs = [],
  15297. this.raycaster = new i.Raycaster,
  15298. this.modelManager = null,
  15299. this.player = null,
  15300. this.totaltags = 0,
  15301. this.navigatingViaTag = !1,
  15302. this.enabled = !1
  15303. }
  15304. 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"),
  15305. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15306. r.extend(t, x),
  15307. t.prototype.init = function(e, t) {
  15308. this.modelManager = e,
  15309. this.player = t,
  15310. this.updateModel(),
  15311. this.bindEvents()
  15312. }
  15313. ,
  15314. t.prototype.update = function(e) {
  15315. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15316. }
  15317. ,
  15318. t.prototype.updateTags = function(e, t, i, n) {
  15319. for (var r in this.model.tags)
  15320. this.model.tags[r].update(e, t, i, n)
  15321. }
  15322. ,
  15323. t.prototype.updateModel = function() {
  15324. this.model = this.modelManager.getActiveModel(),
  15325. this.gettagsFromModel(),
  15326. this.totaltags = Object.keys(this.model.tags).length
  15327. }
  15328. ,
  15329. t.prototype.gettagsFromModel = function() {
  15330. for (var e in this.tagDiscs = [],
  15331. this.model.tags) {
  15332. var t = this.model.tags[e].disc;
  15333. t && this.tagDiscs.push(t)
  15334. }
  15335. }
  15336. ,
  15337. t.prototype.bindEvents = function() {
  15338. function e() {
  15339. Object.keys(this.model.tags).forEach(function(e) {
  15340. var t = this.model.tags[e];
  15341. t.bindEvents(),
  15342. t.billboard.on(y.LINK_CLICK, function(e) {
  15343. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15344. }
  15345. .bind(this)),
  15346. t.billboard.on(y.IMAGE_OPENED, function() {
  15347. this.tagState = T.EXAMINE,
  15348. this.emit(y.IMAGE_OPENED)
  15349. }
  15350. .bind(this)),
  15351. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15352. }
  15353. .bind(this))
  15354. }
  15355. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15356. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15357. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15358. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15359. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15360. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15361. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15362. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15363. e.call(this)
  15364. }
  15365. ,
  15366. t.prototype.navigateViaLink = function(e) {
  15367. var t = a.deserialize(e);
  15368. if (t)
  15369. if (t.mode === C.PANORAMA) {
  15370. try {
  15371. this.player.model.panos.get(t.panoId)
  15372. } catch (e) {
  15373. return void S.warn("Unable to find panorama location", t.panoId)
  15374. }
  15375. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15376. } else {
  15377. var i = {
  15378. cameraMode: t.mode,
  15379. position: t.position,
  15380. quaternion: t.quaternion,
  15381. scanId: t.panoId,
  15382. orthoZoom: t.zoom,
  15383. floorVisibility: t.floorVisibility,
  15384. thumbUrl: null,
  15385. name: null
  15386. };
  15387. this.player.flyToNewMode({
  15388. mode: t.mode,
  15389. duration: m.warp.outsideTime,
  15390. warpDest: new g(i),
  15391. force: !0
  15392. })
  15393. }
  15394. }
  15395. ,
  15396. t.prototype.handleWarpStart = function(e, t, i, n) {
  15397. this.dismissExaminedTag(),
  15398. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15399. e && (i = E.END),
  15400. this.hideShowTagsForBlackoutStyle(i, n))
  15401. }
  15402. ,
  15403. t.prototype.handleWarpInterruption = function(e, t, i) {
  15404. null != i || (i = m.warp.teleportTime),
  15405. this.hideShowTagsForBlackoutStyle(t, i)
  15406. }
  15407. ,
  15408. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15409. var i = 0
  15410. , n = 0
  15411. , r = t / 2;
  15412. switch (null != e || (e = E.MIDDLE),
  15413. e) {
  15414. case E.END:
  15415. this.hideAlltags(r);
  15416. break;
  15417. case E.BEGINNING:
  15418. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15419. break;
  15420. case E.NONE:
  15421. break;
  15422. case E.MIDDLE:
  15423. n = i = r,
  15424. this.hideAlltags(n),
  15425. setTimeout(function() {
  15426. this.showAlltags(i)
  15427. }
  15428. .bind(this), n);
  15429. break;
  15430. case E.FADEIN:
  15431. setTimeout(function() {
  15432. this.showAlltags(r)
  15433. }
  15434. .bind(this), r)
  15435. }
  15436. }
  15437. ,
  15438. t.prototype.onPlayerModeChanging = function(e, t) {
  15439. t !== C.PANORAMA && this.dismissExaminedTag(),
  15440. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15441. var i = t !== C.OUTDOOR;
  15442. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15443. }
  15444. ,
  15445. t.prototype.onPanoChange = function(e, t) {
  15446. var i = this.navigatingViaTag;
  15447. if (this.navigatingViaTag = !1,
  15448. !i) {
  15449. this.dismissExaminedTag();
  15450. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15451. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15452. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15453. }
  15454. }
  15455. ,
  15456. t.prototype.onPlayerReady = function(e, t, i) {
  15457. this.startAlltags(e, t ? i : null)
  15458. }
  15459. ,
  15460. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15461. this.updateClosestTags(e)
  15462. }
  15463. ,
  15464. t.prototype.dismissExaminedTag = function() {
  15465. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15466. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15467. this.hoveredTag = null)
  15468. }
  15469. ,
  15470. t.prototype.startAlltags = function(e, t) {
  15471. this.model.shouldShowtags = m.tags.enabled,
  15472. this.enabled = !0,
  15473. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15474. t && setTimeout(function() {
  15475. this.activateTag(this.model.getTagBySid(t))
  15476. }
  15477. .bind(this), m.tags.startup.fadeInDuration / 2))
  15478. }
  15479. ,
  15480. t.prototype.showAlltags = function(e, t, i) {
  15481. function n() {
  15482. ++o === this.totaltags && (this.model.tagsShown = !0,
  15483. r.resolve())
  15484. }
  15485. var r = $.Deferred();
  15486. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15487. return r.resolve().promise();
  15488. var o = 0;
  15489. for (var a in this.model.tags) {
  15490. this.model.tags[a].show(e, t).done(n.bind(this))
  15491. }
  15492. return r.promise()
  15493. }
  15494. ,
  15495. t.prototype.hideAlltags = function(e, t) {
  15496. function i() {
  15497. ++r === this.totaltags && (this.model.tagsShown = !1,
  15498. n.resolve())
  15499. }
  15500. var n = $.Deferred()
  15501. , r = 0;
  15502. for (var o in this.model.tags) {
  15503. var a = this.model.tags[o];
  15504. a.hide(e, t).done(i.bind(this)),
  15505. a === this.activeTag && this.dismissActiveTag()
  15506. }
  15507. return n.promise()
  15508. }
  15509. ,
  15510. t.prototype.enableHovering = function() {
  15511. this.enabled = !0
  15512. }
  15513. ,
  15514. t.prototype.disableHovering = function() {
  15515. this.enabled = !1
  15516. }
  15517. ,
  15518. t.prototype.activateTag = function(e, t) {
  15519. t = t || T.EXAMINE,
  15520. this.activeTag = e,
  15521. this.activeTag.hoveringDisc = !0,
  15522. this.activeTag.setHoverState(t === T.EXAMINE),
  15523. this.tagState = t,
  15524. this.emit(b.TagActivated, e)
  15525. }
  15526. ,
  15527. t.prototype.dismissActiveTag = function() {
  15528. this.activeTag.hoveringDisc = !1,
  15529. this.activeTag.setFreeState(!0);
  15530. var e = this.activeTag;
  15531. this.activeTag = null,
  15532. this.tagState = T.IDLE,
  15533. this.emit(b.TagDismissed, e)
  15534. }
  15535. ,
  15536. t.prototype.clickedOnTag = function(e) {
  15537. var t = function() {
  15538. this.navigatingViaTag = !0,
  15539. this.activeTag.examine(this.player),
  15540. this.emit(b.TagNavigation, this.activeTag)
  15541. }
  15542. .bind(this);
  15543. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15544. this.activeTag = this.intersectTag,
  15545. t(),
  15546. !0) : (this.dismissActiveTag(),
  15547. !1)
  15548. }
  15549. ,
  15550. t.prototype.intersecttag = (s = new i.Vector3,
  15551. l = new i.Vector3,
  15552. c = new i.Vector3,
  15553. function(e, t, i) {
  15554. if (!this.enabled)
  15555. return null;
  15556. var n = null
  15557. , r = this.tagDiscs.filter(function(e) {
  15558. return e.parent.visible
  15559. });
  15560. if (0 < r.length) {
  15561. var o = this.model.floors.reduce(function(e, t) {
  15562. return t.hidden ? e : e.concat(t.collider.children)
  15563. }, r);
  15564. s.set(e.x, e.y, -1).unproject(i),
  15565. l.set(e.x, e.y, 1).unproject(i),
  15566. c.copy(l).sub(s).normalize(),
  15567. this.raycaster.set(s, c);
  15568. var a = this.raycaster.intersectObjects(o);
  15569. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15570. }
  15571. return this.intersectTag = n,
  15572. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15573. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15574. this.hoveredTag = n
  15575. }
  15576. .bind(this)),
  15577. n.billboard.on(v.LEAVE, function() {
  15578. this.hoveredTag = null
  15579. }
  15580. .bind(this))),
  15581. this.activateTag(n, T.BROWSE))),
  15582. n
  15583. }
  15584. ),
  15585. t.prototype.rankedtagInDirection = (h = [],
  15586. u = [],
  15587. d = new i.Vector3,
  15588. p = new i.Vector3,
  15589. f = new i.Vector3,
  15590. function(e, t, i, n) {
  15591. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15592. var a = this.closesttags[o];
  15593. p.copy(a.position),
  15594. p.add(a.discPosition),
  15595. d.copy(t),
  15596. d.sub(p).negate(),
  15597. d.normalize();
  15598. var s = d.dot(n);
  15599. if (0 <= s && (f.copy(p),
  15600. f.project(i),
  15601. this.intersecttag(f, !1, i))) {
  15602. if (r >= h.length)
  15603. for (var l = 0; l < 64; l++)
  15604. h.push({
  15605. tag: a,
  15606. dot: s
  15607. });
  15608. var c = h[r];
  15609. c.tag = a,
  15610. c.dot = s,
  15611. c.position = math.projectPositionToCanvas(p, i),
  15612. u.push(c),
  15613. r++
  15614. }
  15615. }
  15616. return u.sort(function(e, t) {
  15617. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15618. }),
  15619. e < u.length ? u[e].tag : null
  15620. }
  15621. ),
  15622. t.prototype.updateClosestTags = (o = new i.Vector3,
  15623. function(e) {
  15624. this.closesttags || (this.closesttags = []),
  15625. this.closesttags.length = 0;
  15626. var t = this.model.tags;
  15627. if (t)
  15628. for (var i in t)
  15629. if (t.hasOwnProperty(i)) {
  15630. var n = t[i]
  15631. , r = n.position;
  15632. o.copy(e),
  15633. o.sub(r).negate(),
  15634. o.lengthSq() < 30 && this.closesttags.push(n)
  15635. }
  15636. }
  15637. ),
  15638. R.exports = t
  15639. }
  15640. ).call(this, "/js/tag/tagManager.js")
  15641. }
  15642. , {
  15643. "../controls/serializer": 14,
  15644. "../enum/BlackoutStyle": 18,
  15645. "../enum/tagEvents": 32,
  15646. "../enum/ModelManagerEvents": 33,
  15647. "../enum/PlayerEvents": 40,
  15648. "../enum/TagStates": 44,
  15649. "../enum/Viewmode": 51,
  15650. "../enum/WarpStyle": 52,
  15651. "../objects/Snapshot": 153,
  15652. "../settings": 166,
  15653. "../util/common": 185,
  15654. "../util/lerp": 188,
  15655. "../util/logger": 189,
  15656. "./Billboard/BillboardEvent": 120,
  15657. "./Media/LinkType": 130,
  15658. "./Media/MediaEvent": 131,
  15659. events: 202,
  15660. three: 217
  15661. }],
  15662. 125: [function(r, o, e) {
  15663. (function(e) {
  15664. "use strict";
  15665. function t() {
  15666. this.embedWrapper = null,
  15667. this.embedElement = null
  15668. }
  15669. var i = r("../../util/ajax")
  15670. , a = r("./mediaSettings")
  15671. , n = r("../../settings")
  15672. , s = new (r("../../util/logger"))(e);
  15673. t.prototype.createDomElement = function() {
  15674. return this.embedWrapper = document.createElement("div"),
  15675. this.embedWrapper.classList.add("tag-embed"),
  15676. this.embedWrapper.classList.add("hidden"),
  15677. this.embedWrapper
  15678. }
  15679. ,
  15680. t.prototype.load = function(e) {
  15681. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15682. return new Promise(function(r, o) {
  15683. i.get(t).then(function(e) {
  15684. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15685. this.embedWrapper.innerHTML = e.html;
  15686. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15687. if (this.embedWrapper.style.width = t + "px",
  15688. e.height) {
  15689. var i = e.height / e.width;
  15690. this.embedWrapper.style.height = t * i + "px"
  15691. }
  15692. this.embedElement = this.embedWrapper.firstChild;
  15693. var n = [];
  15694. try {
  15695. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15696. } catch (e) {
  15697. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15698. }
  15699. n.forEach(function(e) {
  15700. e.setAttribute("target", "_blank")
  15701. }),
  15702. this.embedElement.classList.add("hidden"),
  15703. this.embedWrapper.classList.remove("hidden"),
  15704. r()
  15705. } else
  15706. o("Not a valid embed")
  15707. }
  15708. .bind(this), function(e) {
  15709. o(e.response)
  15710. })
  15711. }
  15712. .bind(this))
  15713. }
  15714. ,
  15715. t.prototype.show = function() {
  15716. this.embedElement && this.embedElement.classList.remove("hidden")
  15717. }
  15718. ,
  15719. t.prototype.hide = function() {
  15720. this.embedElement && this.embedElement.classList.add("hidden")
  15721. }
  15722. ,
  15723. o.exports = t
  15724. }
  15725. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15726. }
  15727. , {
  15728. "../../settings": 166,
  15729. "../../util/ajax": 181,
  15730. "../../util/logger": 189,
  15731. "./mediaSettings": 132
  15732. }],
  15733. 126: [function(a, s, e) {
  15734. (function(e) {
  15735. "use strict";
  15736. function t(e) {
  15737. r.call(this),
  15738. this.options = e,
  15739. this.playerControls = null,
  15740. this.state = o.NOT_READY
  15741. }
  15742. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15743. Object.freeze({
  15744. NOT_READY: "player.not.ready",
  15745. CUED: "player.cued",
  15746. PLAYING: "player.playing",
  15747. PAUSED: "player.paused"
  15748. }));
  15749. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15750. return this.embedWrapper = document.createElement("div"),
  15751. this.embedWrapper.classList.add("tag-video"),
  15752. this.embedWrapper.classList.add("hidden"),
  15753. this.embedWrapper
  15754. }
  15755. ,
  15756. t.prototype.load = function(e) {
  15757. var t = function() {
  15758. function e(e) {
  15759. this.playerState = e
  15760. }
  15761. this.playerControls = new playerjs.Player(this.embedElement),
  15762. this.playerControls.on("ready", function(e) {
  15763. this.playerState = o.CUED,
  15764. this.options.startMuted && this.playerControls.mute()
  15765. }
  15766. .bind(this)),
  15767. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15768. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15769. this.playerControls.on("ended", function(e) {
  15770. this.playerControls.setCurrentTime(0),
  15771. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15772. }
  15773. .bind(this))
  15774. }
  15775. .bind(this);
  15776. return r.prototype.load.call(this, e).then(t.bind(this))
  15777. }
  15778. ,
  15779. t.prototype.play = (i = n.isMobile(),
  15780. function() {
  15781. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15782. }
  15783. ),
  15784. t.prototype.pause = function() {
  15785. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15786. }
  15787. ,
  15788. s.exports = t
  15789. }
  15790. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15791. }
  15792. , {
  15793. "../../util/browser": 182,
  15794. "../../util/logger": 189,
  15795. "./EmbedlyEmbed": 125
  15796. }],
  15797. 127: [function(t, i, e) {
  15798. (function(e) {
  15799. "use strict";
  15800. var r = t("../../util/ajax")
  15801. , o = new (t("./mediaSettings"),
  15802. t("../../util/logger"))(e)
  15803. , a = Promise.resolve();
  15804. i.exports.enqueue = function(i) {
  15805. function n() {}
  15806. return a = new Promise(function(e, t) {
  15807. a.catch(n).then(function() {
  15808. (o.debug("requesting file from embedly:", i.href),
  15809. r.get(i.href, {
  15810. responseType: i.responseType
  15811. }).then(function(e) {
  15812. return o.debug("requesting file finished:", i.href),
  15813. e
  15814. })).then(e, t)
  15815. })
  15816. }
  15817. )
  15818. }
  15819. }
  15820. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15821. }
  15822. , {
  15823. "../../util/ajax": 181,
  15824. "../../util/logger": 189,
  15825. "./mediaSettings": 132
  15826. }],
  15827. 128: [function(s, l, e) {
  15828. (function(e) {
  15829. "use strict";
  15830. function t() {
  15831. this.imageWrapper = null,
  15832. this.width = 0,
  15833. this.height = 0,
  15834. this.aspect = 1
  15835. }
  15836. var i = s("./MediaEvent")
  15837. , n = s("./EmbedlyQueue")
  15838. , r = s("events").EventEmitter
  15839. , o = s("../../util/logger")
  15840. , a = s("../../settings");
  15841. new o(e),
  15842. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15843. return this.imageWrapper = document.createElement("div"),
  15844. this.imageWrapper.classList.add("tag-image"),
  15845. this.imageWrapper.classList.add("hidden"),
  15846. this.imageWrapper.addEventListener("click", function(e) {
  15847. e.stopPropagation(),
  15848. this.emit(i.IMAGE_OPENING),
  15849. this.imageWrapper.style.pointerEvents = "none"
  15850. }
  15851. .bind(this)),
  15852. this.imageWrapper
  15853. }
  15854. ,
  15855. t.prototype.onClosed = function() {
  15856. this.imageWrapper.style.pointerEvents = "auto"
  15857. }
  15858. ,
  15859. t.prototype.load = function(e) {
  15860. var t = Math.max(window.screen.height, window.screen.width)
  15861. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15862. return new Promise(function(o, e) {
  15863. n.enqueue({
  15864. href: i,
  15865. responseType: "arraybuffer"
  15866. }).then(function(e) {
  15867. var t = new Uint8Array(e)
  15868. , i = new Blob([t])
  15869. , n = new window.Image;
  15870. n.addEventListener("load", function(e) {
  15871. var t = e.target;
  15872. this.width = t.naturalWidth,
  15873. this.height = t.naturalHeight,
  15874. this.aspect = this.width / this.height;
  15875. var i = e.target.src;
  15876. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15877. this.imageWrapper.style.width = this.width + "px",
  15878. this.imageWrapper.style.height = this.height + "px",
  15879. this.imageWrapper.classList.remove("hidden"),
  15880. o()
  15881. }
  15882. .bind(this));
  15883. var r = URL.createObjectURL(i);
  15884. n.src = r
  15885. }
  15886. .bind(this), e)
  15887. }
  15888. .bind(this))
  15889. }
  15890. ,
  15891. l.exports = t
  15892. }
  15893. ).call(this, "/js/tag/Media/Image.js")
  15894. }
  15895. , {
  15896. "../../settings": 166,
  15897. "../../util/logger": 189,
  15898. "./EmbedlyQueue": 127,
  15899. "./MediaEvent": 131,
  15900. events: 202
  15901. }],
  15902. 129: [function(e, t, i) {
  15903. "use strict";
  15904. function n(e) {
  15905. this.label = e.label,
  15906. this.href = e.url,
  15907. this.type = this.updateLinkForType(),
  15908. this.domElement = null,
  15909. this.id = c++
  15910. }
  15911. var r = e("./LinkType")
  15912. , o = e("./MediaEvent")
  15913. , a = e("../../util/browser")
  15914. , s = e("../../analytics")
  15915. , l = e("events").EventEmitter
  15916. , c = 0;
  15917. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15918. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15919. 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,
  15920. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15921. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15922. r.MODEL) : r.EXT_LINK
  15923. }
  15924. ;
  15925. var h = {};
  15926. n.prototype.createDomElement = function() {
  15927. if (this.domElement = document.createElement("a"),
  15928. this.domElement.classList.add("tag-link"),
  15929. this.domElement.textContent = this.label,
  15930. this.type === r.EXT_LINK) {
  15931. this.domElement.textContent += " ";
  15932. var e = document.createElement("i");
  15933. e.classList.add("icon-ext-link"),
  15934. e.title = "Link to external web site",
  15935. this.domElement.appendChild(e)
  15936. }
  15937. return this.domElement.addEventListener("click", function(e) {
  15938. switch (e.stopPropagation(),
  15939. h[this.id] = !0,
  15940. s.trackAlways("click_tag_link", {
  15941. link_type: this.type,
  15942. link_count: c,
  15943. links_clicked: Object.keys(h).length
  15944. }),
  15945. this.type) {
  15946. case r.MODEL:
  15947. window.location.replace(this.href);
  15948. break;
  15949. case r.EXT_LINK:
  15950. window.open(this.href, "_blank")
  15951. }
  15952. this.emit(o.LINK_CLICK, {
  15953. type: this.type,
  15954. url: this.href
  15955. })
  15956. }
  15957. .bind(this)),
  15958. this.domElement
  15959. }
  15960. ,
  15961. t.exports = n
  15962. }
  15963. , {
  15964. "../../analytics": 4,
  15965. "../../util/browser": 182,
  15966. "./LinkType": 130,
  15967. "./MediaEvent": 131,
  15968. events: 202
  15969. }],
  15970. 130: [function(e, t, i) {
  15971. "use strict";
  15972. t.exports = {
  15973. NAVIGATION: "navigation",
  15974. MODEL: "model",
  15975. EXT_LINK: "ext-link"
  15976. }
  15977. }
  15978. , {}],
  15979. 131: [function(e, t, i) {
  15980. "use strict";
  15981. t.exports = Object.freeze({
  15982. LINK_CLICK: "mtmedia.link",
  15983. IMAGE_LOADED: "mtmedia.image.loaded",
  15984. IMAGE_OPENING: "mtmedia.image.opening",
  15985. IMAGE_OPENED: "mtmedia.image.opened",
  15986. IMAGE_CLOSING: "mtmedia.image.closing",
  15987. IMAGE_CLOSED: "mtmedia.image.closed",
  15988. VIDEO_START: "mtmedia.video.start",
  15989. VIDEO_PAUSE: "mtmedia.video.pause",
  15990. VIDEO_ENDED: "mtmedia.video.end"
  15991. })
  15992. }
  15993. , {}],
  15994. 132: [function(e, t, i) {
  15995. "use strict";
  15996. t.exports = Object.freeze({
  15997. maxEmbedWidth: 350,
  15998. defaultAspectRatio: .75
  15999. })
  16000. }
  16001. , {}],
  16002. 133: [function(e, t, i) {
  16003. "use strict";
  16004. t.exports = Object.freeze({
  16005. TEXT: "text",
  16006. LINK: "link",
  16007. IMAGE: "photo",
  16008. VIDEO: "video",
  16009. RICH: "rich"
  16010. })
  16011. }
  16012. , {}],
  16013. 134: [function(e, t, i) {
  16014. "use strict";
  16015. function n(e) {
  16016. this.capabilities = {
  16017. links: {
  16018. enable: e.supportLinks,
  16019. keepLabels: e.keepLinkLabels
  16020. }
  16021. }
  16022. }
  16023. var r = e("./DescriptionChunkType");
  16024. n.prototype.parse = function(e, i) {
  16025. var n = [];
  16026. return e.split("[").map(function(e, t) {
  16027. return 0 === t ? e : "[" + e
  16028. }).forEach(function(e) {
  16029. var t = this.findMarkdown(e);
  16030. if (t) {
  16031. if (-1 !== t.url.indexOf("javascript:"))
  16032. return;
  16033. this.addLinkChunk(n, t, i),
  16034. this.addTextChunk(n, e.slice(t.markdown.length))
  16035. } else
  16036. this.addTextChunk(n, e)
  16037. }
  16038. .bind(this)),
  16039. n
  16040. }
  16041. ,
  16042. n.prototype.findMarkdown = function(e) {
  16043. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16044. if (t) {
  16045. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16046. 0 !== n); )
  16047. r++;
  16048. var o = i.length - r;
  16049. return {
  16050. markdown: t[0].substring(0, t[0].length - o),
  16051. label: t[1],
  16052. url: t[2].substring(0, r)
  16053. }
  16054. }
  16055. }
  16056. ,
  16057. n.prototype.addTextChunk = function(e, t) {
  16058. 0 !== t.length && e.push({
  16059. type: r.TEXT,
  16060. text: t
  16061. })
  16062. }
  16063. ,
  16064. n.prototype.addLinkChunk = function(e, t) {
  16065. if (this.capabilities.links.enable) {
  16066. var i = {
  16067. label: t.label,
  16068. url: t.url
  16069. };
  16070. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16071. e.push({
  16072. type: r.LINK,
  16073. link: i
  16074. })
  16075. } else
  16076. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16077. }
  16078. ,
  16079. t.exports = n
  16080. }
  16081. , {
  16082. "./DescriptionChunkType": 133
  16083. }],
  16084. 135: [function(t, r, e) {
  16085. (function(e) {
  16086. "use strict";
  16087. var i = new (t("../util/logger"))(e)
  16088. , n = {
  16089. parseIdsFromChunkName: function(e, t) {
  16090. t.floorId = n.parseFloor(e),
  16091. t.roomId = n.parseRoom(e)
  16092. },
  16093. parseFloor: function(e) {
  16094. var t = e.match(/_group([0-9]+)/);
  16095. if (!t)
  16096. return 0;
  16097. try {
  16098. return parseInt(t[1], 10)
  16099. } catch (e) {
  16100. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16101. 0
  16102. }
  16103. },
  16104. parseRoom: function(e) {
  16105. var t = e.match(/_sub([0-9]+)/);
  16106. if (!t)
  16107. return -1;
  16108. try {
  16109. return parseInt(t[1], 10)
  16110. } catch (e) {
  16111. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16112. 0
  16113. }
  16114. }
  16115. };
  16116. r.exports = n
  16117. }
  16118. ).call(this, "/js/model/Chunks.js")
  16119. }
  16120. , {
  16121. "../util/logger": 189
  16122. }],
  16123. 136: [function(a, c, e) {
  16124. (function(e) {
  16125. "use strict";
  16126. function t(e) {
  16127. r.call(this),
  16128. this.model = e,
  16129. this.exploded = !1
  16130. }
  16131. var i = a("../objects/Floor")
  16132. , n = (a("../settings"),
  16133. a("../util/logger"))
  16134. , s = a("../util/transitions")
  16135. , r = a("../util/IndexedCollection")
  16136. , o = a("../util/common")
  16137. , l = a("../util/easing");
  16138. new n(e),
  16139. o.inherit(t, r),
  16140. t.prototype.add = function(e) {
  16141. r.prototype.add.call(this, e),
  16142. this.model.add(e)
  16143. }
  16144. ,
  16145. t.prototype.getIndex = function(e) {
  16146. return e.floorIndex
  16147. }
  16148. ,
  16149. t.prototype.build = function() {
  16150. this.list.forEach(function(e) {
  16151. e.build()
  16152. })
  16153. }
  16154. ,
  16155. t.prototype.size = function() {
  16156. return this.length
  16157. }
  16158. ,
  16159. t.prototype.sort = function() {
  16160. r.prototype.sort.call(this, function(e, t) {
  16161. return e.floorIndex - t.floorIndex
  16162. })
  16163. }
  16164. ,
  16165. t.prototype.nextFloor = function(e, t) {
  16166. return this.index[e.floorIndex + t] || null
  16167. }
  16168. ,
  16169. t.prototype.getFloorAtPoint = function(e) {
  16170. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16171. var r = this.list[n]
  16172. , o = r.distanceToPoint(e);
  16173. (!t || o < i) && (i = o,
  16174. t = r)
  16175. }
  16176. return t
  16177. }
  16178. ,
  16179. t.prototype.getOrMakeFloor = function(e) {
  16180. var t = this.index[e];
  16181. return t || (t = new i(this.model,e),
  16182. this.add(t)),
  16183. t
  16184. }
  16185. ,
  16186. t.prototype.hide = function() {
  16187. this.list.forEach(function(e) {
  16188. e.hide()
  16189. })
  16190. }
  16191. ,
  16192. t.prototype.show = function() {
  16193. this.list.forEach(function(e) {
  16194. e.show()
  16195. })
  16196. }
  16197. ,
  16198. t.prototype.names = function() {
  16199. return this.list.reduce(function(e, t) {
  16200. return e.concat(t.name)
  16201. }, [])
  16202. }
  16203. ,
  16204. t.prototype.toggleExplodeHorizontal = function() {
  16205. function i(e, t) {
  16206. a.copy(e.position),
  16207. e.position.x = r[e.floorIndex] * t,
  16208. e.position.y = 1 * e.floorIndex * t,
  16209. a.sub(e.position).multiplyScalar(-1),
  16210. e.panos.forEach(function(e) {
  16211. e.translate(a)
  16212. })
  16213. }
  16214. var n, r = [], o = 0;
  16215. this.list.forEach(function(e, t, i) {
  16216. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16217. o += n,
  16218. r[t] = o
  16219. }),
  16220. r = r.map(function(e) {
  16221. return e - o / 2
  16222. });
  16223. var a = this.list[0].position.clone();
  16224. this.exploded ? this.list.forEach(function(t) {
  16225. s.start(function(e) {
  16226. i(t, 1 - e)
  16227. }, 1500, null, 0, l.easeOutExpo)
  16228. }) : this.list.forEach(function(t) {
  16229. s.start(function(e) {
  16230. i(t, e)
  16231. }, 1500, null, 0, l.easeOutExpo)
  16232. }),
  16233. this.exploded = !this.exploded
  16234. }
  16235. ,
  16236. t.prototype.toggleExplodeVertical = function() {
  16237. function i(e, t) {
  16238. var i = i.copy(e.position);
  16239. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16240. i.sub(e.position).multiplyScalar(-1),
  16241. e.panos.forEach(function(e) {
  16242. e.translate(i)
  16243. })
  16244. }
  16245. var n = this.model.size;
  16246. this.list[0].position.clone(),
  16247. this.exploded ? this.list.forEach(function(t) {
  16248. s.start(function(e) {
  16249. i(t, 1 - e)
  16250. }, 1500, null, 0, l.easeOutExpo)
  16251. }) : this.list.forEach(function(t) {
  16252. s.start(function(e) {
  16253. i(t, e)
  16254. }, 1500, null, 0, l.easeOutExpo)
  16255. }),
  16256. this.exploded = !this.exploded
  16257. }
  16258. ,
  16259. c.exports = t
  16260. }
  16261. ).call(this, "/js/model/FloorCollection.js")
  16262. }
  16263. , {
  16264. "../objects/Floor": 146,
  16265. "../settings": 166,
  16266. "../util/IndexedCollection": 175,
  16267. "../util/common": 185,
  16268. "../util/easing": 186,
  16269. "../util/logger": 189,
  16270. "../util/transitions": 195
  16271. }],
  16272. 137: [function(r, o, e) {
  16273. (function(e) {
  16274. "use strict";
  16275. function h() {
  16276. n.call(this)
  16277. }
  16278. var u = r("../settings")
  16279. , t = r("../util/logger")
  16280. , d = r("../enum/Viewmode")
  16281. , p = r("../objects/Snapshot")
  16282. , i = (r("../util/math"),
  16283. r("../util/common"))
  16284. , n = r("../util/IndexedCollection")
  16285. , l = new t(e);
  16286. i.inherit(h, n),
  16287. h.prototype.getImage = function(e) {
  16288. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16289. }
  16290. ,
  16291. h.prototype.filterByModesAndReel = function(e, t) {
  16292. for (var i = [], n = 0; n < t.length; n += 1) {
  16293. var r = t[n]
  16294. , o = this.index[r.sid];
  16295. o && i.push(o)
  16296. }
  16297. var a = e[d.DOLLHOUSE]
  16298. , s = e[d.FLOORPLAN];
  16299. (i = i.filter(function(e) {
  16300. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16301. return !0;
  16302. var t;
  16303. try {
  16304. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16305. } catch (e) {
  16306. return l.debug(e.message),
  16307. !1
  16308. }
  16309. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16310. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16311. this.list = i,
  16312. this.reIndex()
  16313. }
  16314. ,
  16315. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16316. if (0 === this.list.length)
  16317. return [];
  16318. var locations = [];
  16319. var deal = (n, container)=>{
  16320. var r = n.thumbnail_signed_src,
  16321. o = n.name || "";
  16322. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16323. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16324. var a = panos.get(n.metadata.scan_id);
  16325. if (a && !a.isAligned()) return
  16326. }
  16327. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16328. if (s === d.MESH) return
  16329. if(window.isLocal)var src = manage.dealURL(r)
  16330. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16331. var l = {
  16332. cameraMode: s,
  16333. position: n.metadata.camera_position,
  16334. quaternion: n.metadata.camera_quaternion,
  16335. zoom: n.metadata.zoom,
  16336. panoId: n.metadata.scan_id,
  16337. orthoZoom: n.metadata.ortho_zoom,
  16338. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16339. thumbUrl: src,
  16340. name: h.filterImageName(o),
  16341. sid: n.sid
  16342. }
  16343. var item = new p(l);
  16344. item.momentTour = n.momentTour
  16345. item.dontRot = n.dontRot
  16346. item.rotTime = n.rotTime
  16347. container.push(item)
  16348. return item
  16349. }
  16350. }
  16351. this.list.forEach(image=>{
  16352. if(image.images){
  16353. var folder = $.extend({}, image )
  16354. folder.heroLocations = [];
  16355. image.images.list.forEach(child=>{
  16356. deal(child, folder.heroLocations);
  16357. })
  16358. folder.musicInfo = folder.musicInfo || {}
  16359. locations.push(folder)
  16360. delete folder.images;
  16361. delete folder.locations;
  16362. }else{
  16363. var item = deal(image, locations);
  16364. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16365. }
  16366. })
  16367. return locations
  16368. }
  16369. ,
  16370. h.prototype.getIndex = function(e) {
  16371. return e.sid
  16372. }
  16373. ,
  16374. h.filterImageName = function(e) {
  16375. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16376. }
  16377. ,
  16378. o.exports = h
  16379. }
  16380. ).call(this, "/js/model/ImageCollection.js")
  16381. }
  16382. , {
  16383. "../enum/Viewmode": 51,
  16384. "../objects/Snapshot": 153,
  16385. "../settings": 166,
  16386. "../util/IndexedCollection": 175,
  16387. "../util/common": 185,
  16388. "../util/logger": 189,
  16389. "../util/math": 190
  16390. }],
  16391. 138: [function(h, u, e) {
  16392. (function(e) {
  16393. "use strict";
  16394. function n() {
  16395. c.call(this)
  16396. }
  16397. var r = h("../label/Label")
  16398. , i = h("../settings")
  16399. , t = h("../util/logger")
  16400. , o = h("../util/math")
  16401. , a = h("../util/ajax")
  16402. , s = h("./RoomCollection")
  16403. , l = h("../util/common")
  16404. , c = h("../util/IndexedCollection");
  16405. new t(e),
  16406. l.inherit(n, c),
  16407. n.prototype.getIndex = function(e) {
  16408. return e.labelId
  16409. }
  16410. ,
  16411. n.prototype.associateWithRooms = function(e) {
  16412. this.forEach(function(t) {
  16413. e.forEach(function(e) {
  16414. e.roomId === t.roomId && (t.room = e)
  16415. })
  16416. })
  16417. }
  16418. ,
  16419. n.prototype.createFromLabelData = function(e) {
  16420. e.forEach(function(e) {
  16421. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16422. t = s.generateRoomId(e.floorId, t);
  16423. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16424. i.position = o.convertWorkshopVector(i.position),
  16425. this.add(i),
  16426. i.build()
  16427. }
  16428. .bind(this))
  16429. }
  16430. ,
  16431. n.prototype.load = function(e, t) {
  16432. return a.get(e, {
  16433. responseType: "json",
  16434. auth: t ? i.authorizationHeader : null
  16435. }).done(function(e) {
  16436. var t = [];
  16437. for (var i in e) {
  16438. var n = e[i];
  16439. t.push(n)
  16440. }
  16441. this.createFromLabelData(t)
  16442. }
  16443. .bind(this))
  16444. }
  16445. ,
  16446. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16447. var t = -1;
  16448. if (e) {
  16449. if(typeof e == 'number'){
  16450. t = parseInt(e)
  16451. }else{
  16452. var i = e.split("_");
  16453. t = parseInt(i[0])
  16454. }
  16455. }
  16456. return t
  16457. }
  16458. ,
  16459. u.exports = n
  16460. }
  16461. ).call(this, "/js/model/LabelCollection.js")
  16462. }
  16463. , {
  16464. "../label/Label": 90,
  16465. "../settings": 166,
  16466. "../util/IndexedCollection": 175,
  16467. "../util/ajax": 181,
  16468. "../util/common": 185,
  16469. "../util/logger": 189,
  16470. "../util/math": 190,
  16471. "./RoomCollection": 141
  16472. }],
  16473. 139: [function(P, O, e) {
  16474. (function(e) {
  16475. "use strict";
  16476. function t(e, t) {
  16477. o.Object3D.call(this),
  16478. this.sid = window.number;//t.sid,
  16479. this.data = t,
  16480. this.options = e,
  16481. this.urls = new i(e.urlFiles),
  16482. this.isPublic = void 0 !== t.is_public && t.is_public,
  16483. //创建heroLocations
  16484. this.images = new E(this),
  16485. this.images.extend(t.images),
  16486. this.images.forEach((info)=>{
  16487. if(info.locations){
  16488. info.images = new E(this);
  16489. info.images.extend(info.locations)
  16490. }
  16491. })
  16492. this.heroLocations = []
  16493. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16494. this.outdoorPanoLocations = [],
  16495. this.floors = new c(this),
  16496. this.floorsEnabled = void 0 === e.floors || e.floors,
  16497. this.changingFloor = !1,
  16498. this.chunks = [],
  16499. this.panos = new g,
  16500. this.colliders = [],
  16501. this.loadPanosPromise = null,
  16502. this.loadMeshTexturesPromise = null,
  16503. this.auxDataPromise = null,
  16504. this.meshTexturesLoaded = !1,
  16505. this.meshTextures = [],
  16506. this.tags = {},
  16507. this.tagsShown = !1,
  16508. this.shouldShowtags = !1,
  16509. this.has360Views = !1,
  16510. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16511. this.supportedModes = {},
  16512. this.supportedModes[s.PANORAMA] = !0,
  16513. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16514. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16515. this.supportedModes[s.TRANSITIONING] = !0,
  16516. this.supportsTiles = this.configureTiling(),
  16517. this.supportsVR = window.DATA.supportsVR || false//!0,
  16518. this.mode = s.DOLLHOUSE,
  16519. this.size = null,
  16520. this.center = null,
  16521. this.boundingBox = new o.Box3,
  16522. this.currentFloor = null,
  16523. this.allFloorsVisible = !0,
  16524. this.projectedPano0 = null,
  16525. this.projectedPano1 = null,
  16526. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16527. this.addFloor(new r(this,t,e.trim()))
  16528. }
  16529. .bind(this)),
  16530. this.waitQueue = [],
  16531. this.on("load", function(e) {
  16532. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16533. return !e.isLoadedCallback()
  16534. }),
  16535. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16536. }
  16537. .bind(this)),
  16538. this.setupCustomProperties(),
  16539. this.hots = {}
  16540. }
  16541. var o = P("three")
  16542. , a = P("../util/ajax")
  16543. , i = P("../util/ModelUrls")
  16544. , n = P("../objects/BoundingTextureSkybox")
  16545. , s = P("../enum/Viewmode")
  16546. , l = P("../enum/RenderOrder")
  16547. , r = (P("../enum/AlignmentType"),
  16548. P("../objects/Floor"))
  16549. , c = P("./FloorCollection")
  16550. , h = P("../objects/Chunk")
  16551. , u = (P("../objects/Room"),
  16552. P("../objects/Snapshot"),
  16553. P("../label/Label"),
  16554. P("../util/math"),
  16555. P("../settings"))
  16556. , d = P("../shaders")
  16557. , p = P("../util/logger")
  16558. , f = (P("../tag/tag"),
  16559. P("../tag/tagManager"),
  16560. P("../objects/Panorama"))
  16561. , g = P("../util/PanoramaCollection")
  16562. , m = P("../loaders/ModelLoader")
  16563. , v = P("../loaders/ModelTextureLoader")
  16564. , y = P("../loaders/SweepDataLoader")
  16565. , A = P("../util/transitions")
  16566. , C = (P("../util/easing"),
  16567. P("../util/lerp"),
  16568. P("../util/common"))
  16569. , I = (P("../util/texture"),
  16570. P("./../util/browser"))
  16571. , E = P("./ImageCollection")
  16572. , _ = P("./RoomCollection")
  16573. , b = P("./LabelCollection")
  16574. , w = P("./Chunks")
  16575. , T = P("./../util/showcase")
  16576. , x = P("../exception/BasicException")
  16577. , S = (P("../constants"),
  16578. P("events").EventEmitter)
  16579. // , M = P("hot")
  16580. , R = new p(e);
  16581. t.prototype = Object.create(o.Object3D.prototype),
  16582. C.extend(t, S),
  16583. t.prototype.setupCustomProperties = function() {
  16584. var t = u.modelAlpha;
  16585. Object.defineProperty(this, "alpha", {
  16586. get: function() {
  16587. return t
  16588. },
  16589. set: function(e) {
  16590. t = e,
  16591. this.chunks.forEach(function(e) {
  16592. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16593. })
  16594. }
  16595. })
  16596. }
  16597. ,
  16598. t.prototype.configureTiling = function() {
  16599. var e = function() {
  16600. try {
  16601. var e = document.createElement("canvas")
  16602. , t = e.getContext("webgl");
  16603. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16604. } catch (e) {
  16605. return 0
  16606. }
  16607. }();
  16608. if (e < 2048)
  16609. return !1;
  16610. R.warn("Max cube texture size: " + e);
  16611. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16612. var i = u.tiling.tilingFlagNames[t];
  16613. if ("1" === I.valueFromHash(i, null))
  16614. return !0;
  16615. if ("0" === I.valueFromHash(i, null))
  16616. return !1
  16617. }
  16618. return !!T.modelDataPromisesTiles(this.data)
  16619. }
  16620. ,
  16621. t.prototype.toggleAlpha = function() {
  16622. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16623. }
  16624. ,
  16625. t.prototype.load = function(e) {
  16626. var t = this.urls.init().then(function() {
  16627. return $.when(this.loadPanos(), this.loadMesh())
  16628. }
  16629. .bind(this));
  16630. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16631. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16632. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16633. }
  16634. ,
  16635. t.prototype.loadMesh = function() {
  16636. var n = $.Deferred()
  16637. , r = this;
  16638. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16639. if (0 === e.length) {
  16640. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16641. r.supportedModes[s.DOLLHOUSE] = !1,
  16642. r.supportedModes[s.FLOORPLAN] = !1;
  16643. var i = new h({
  16644. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16645. });
  16646. i.material.visible = !1,
  16647. i.rotateX(-Math.PI / 2),
  16648. i.geometry.computeBoundingBox(),
  16649. e = [i]
  16650. }
  16651. e.forEach(function(e) {
  16652. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16653. r.addChunk(t, e)
  16654. }),
  16655. r.floors.sort(),
  16656. n.resolve(r)
  16657. }, function(e, t) {
  16658. n.notify(e, t)
  16659. }, function(e) {
  16660. R.error(e),
  16661. n.reject("loading-failed")
  16662. }),
  16663. n.promise()
  16664. }
  16665. ,
  16666. t.prototype.loadMeshTextures = function() {
  16667. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16668. this.meshTexturesLoaded = !0
  16669. }
  16670. .bind(this))),
  16671. this.loadTexturesPromise
  16672. }
  16673. ,
  16674. t.prototype.loadhots = function() {
  16675. initHot(this)
  16676. var r = $.Deferred()
  16677. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16678. return a.get(e, {
  16679. responseType: "json",
  16680. auth: this.isPublic ? null : u.authorizationHeader
  16681. }).done(function(e) {
  16682. window.data2 = e;
  16683. this.roomLabels = []
  16684. editTool.loadDone('data2', e)
  16685. if(!e){
  16686. console.error("data2 is null")
  16687. }else{
  16688. g_data2 = hotMatcher(e)
  16689. this.hotsCount = 0;
  16690. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16691. //window.hotData = {}
  16692. /* if(e.hots){
  16693. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16694. sids.forEach((sid)=>{
  16695. this.hotsCount++,
  16696. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16697. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16698. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16699. window.hotData[sid] = e.hots[sid];
  16700. })
  16701. }*/
  16702. if(e.hots){
  16703. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16704. sids.forEach((sid)=>{
  16705. e.hots[sid].sid = sid
  16706. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  16707. })
  16708. }
  16709. if(e.overlays){
  16710. e.overlays.forEach((info)=>{
  16711. new Hot(info, 'byOverlay')
  16712. })
  16713. }
  16714. Hot.createHotList();
  16715. if(DATA.roomLabels){
  16716. DATA.roomLabels.forEach((data)=>{
  16717. this.roomLabels.push(new RoomLabel(data))
  16718. })
  16719. }
  16720. /* if(e.multiOverlays){
  16721. e.multiOverlays.forEach((info)=>{
  16722. new Hot(info)
  16723. })
  16724. }) */
  16725. Hot.startLoad()
  16726. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16727. }
  16728. r.resolve()
  16729. }
  16730. .bind(this)).fail(function() {
  16731. console.log("没有热点"),
  16732. editTool.loadDone('data2', null)
  16733. r.resolve()
  16734. }),
  16735. r
  16736. }
  16737. ,
  16738. t.prototype.loadPanos = function() {
  16739. if (this.loadPanosPromise)
  16740. return this.loadPanosPromise;
  16741. var e = new y(this);
  16742. return this.loadPanosPromise = e.load().then(function(e) {
  16743. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  16744. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16745. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16746. else console.log(e.uuid)
  16747. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16748. }
  16749. .bind(this))),
  16750. this.panos.extend(e.map(function(e) {
  16751. return new f(this,e.uuid,e,this.supportsTiles)
  16752. }
  16753. .bind(this))),
  16754. this.panos.forEach(function(i) {
  16755. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16756. var t = this.panos.get(e);
  16757. t && this.panos.setNeighbour(i, t, !0)
  16758. }
  16759. .bind(this)),
  16760. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16761. }
  16762. .bind(this)),
  16763. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16764. this.supportedModes[s.PANORAMA] = !1),
  16765. $.when(this)
  16766. }
  16767. .bind(this)),
  16768. this.loadPanosPromise
  16769. }
  16770. ,
  16771. t.prototype.loadHighlightReel = function() {
  16772. var t = $.Deferred()
  16773. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16774. return a.get(e, {
  16775. responseType: "json",
  16776. auth: this.isPublic ? null : u.authorizationHeader
  16777. }).done(function(e) {
  16778. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16779. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16780. t.resolve()
  16781. }
  16782. .bind(this)).fail(function() {
  16783. R.warn("Getting highlight reel failed, no highlights available"),
  16784. t.resolve()
  16785. }),
  16786. t
  16787. }
  16788. ,
  16789. t.prototype.waitForLoad = function(e, t) {
  16790. t() || (this.waitQueue.push({
  16791. object: e,
  16792. isLoadedCallback: t
  16793. }),
  16794. 1 === this.waitQueue.length && this.emit("waiting"))
  16795. }
  16796. ,
  16797. t.prototype.hide = function() {
  16798. this.floors.hide()
  16799. }
  16800. ,
  16801. t.prototype.show = function() {
  16802. this.floors.show()
  16803. }
  16804. ,
  16805. t.prototype.floorNames = function() {
  16806. return this.floors.names()
  16807. }
  16808. ,
  16809. t.prototype.warpDestFloors = function(e, t) {
  16810. if (e && this.floors.length === e.length) {
  16811. var i = e.findIndex(function(e) {
  16812. return e
  16813. }
  16814. .bind(this));
  16815. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16816. } else
  16817. this.toggleAllFloors(!0)
  16818. }
  16819. ,
  16820. t.prototype.setFloor = function(e, t, i) {
  16821. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16822. this.allFloorsVisible = !1,
  16823. this._setFloor(e, t, i)
  16824. }
  16825. ,
  16826. t.prototype.toggleAllFloors = function(e) {
  16827. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16828. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16829. this._setFloor(this.currentFloor)
  16830. }
  16831. ,
  16832. t.prototype._setFloor = function(e, t, i) {
  16833. var n;
  16834. if (t = t || this.mode,
  16835. this.emit("floor.changed", e, t, this.currentFloor),
  16836. this.currentFloor = e,
  16837. t === s.PANORAMA) {
  16838. if (this.show(),
  16839. this.shouldShowtags && this.tagsShown)
  16840. for (n in this.tags)
  16841. this.tags[n].show(u.showFloorDuration)
  16842. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16843. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16844. }
  16845. .bind(this)),
  16846. this.shouldShowtags && this.tagsShown))
  16847. for (n in this.tags) {
  16848. var r = this.tags[n];
  16849. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16850. }
  16851. var o = this
  16852. , a = e;
  16853. A.start(function() {}, u.showFloorDelay, function() {
  16854. o.floors.forEach(function(t) {
  16855. t.chunks.forEach(function(e) {
  16856. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16857. })
  16858. })
  16859. }
  16860. .bind(this))
  16861. }
  16862. ,
  16863. t.prototype.toggleExplode = function() {
  16864. this.floors.toggleExplodeHorizontal()
  16865. }
  16866. ,
  16867. t.prototype.toggleExplodeUp = function() {
  16868. this.floors.toggleExplodeVertical()
  16869. }
  16870. ,
  16871. t.prototype.nextFloor = function(e) {
  16872. return this.floors.nextFloor(this.currentFloor, e)
  16873. }
  16874. ,
  16875. t.prototype.addFloor = function(e) {
  16876. this.floors.add(e)
  16877. }
  16878. ,
  16879. t.prototype.getFloorAtPoint = function(e) {
  16880. return this.floors.getFloorAtPoint(e)
  16881. }
  16882. ,
  16883. t.prototype.getTagBySid = function(e) {
  16884. return this.tags[e]
  16885. }
  16886. ,
  16887. t.prototype.addChunk = function(e, t) {
  16888. this.floors.getOrMakeFloor(e).addChunk(t),
  16889. this.chunks.push(t)
  16890. }
  16891. ,
  16892. t.prototype.setMode = function(t) {
  16893. if (!this.supportedModes[t])
  16894. throw new x("Mode not supported for this model: " + t);
  16895. this.mode = t
  16896. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  16897. this.chunks.forEach(function(e) {
  16898. e.setMode(t)
  16899. })
  16900. }
  16901. ,
  16902. t.prototype.build = function() {
  16903. this.heroLocations = this.images.getHeroLocations(this.panos);
  16904. var e = function() {
  16905. 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()
  16906. }
  16907. .bind(this)();
  16908. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16909. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16910. }
  16911. .bind(this)) || e,
  16912. null === this.heroImage && R.warn("No hero image defined."),
  16913. this.currentFloor = this.floors.last(),
  16914. this.floors.build(),
  16915. this.colliders = this.floors.reduce(function(e, t) {
  16916. return e.concat(t.collider.children)
  16917. }, []),
  16918. this.panos.forEach(function(e) {
  16919. e.build1(),
  16920. e.on("enter", function() {
  16921. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16922. }
  16923. .bind(this))
  16924. }
  16925. .bind(this)),
  16926. this.panos.forEach(function(e) {
  16927. e.build2()
  16928. }),
  16929. this.floors.forEach(function(e) {
  16930. this.boundingBox.union(e.boundingBox)
  16931. }
  16932. .bind(this)),
  16933. this.size = this.boundingBox.size(),
  16934. this.center = this.boundingBox.center(),
  16935. this.floors.forEach(function(e) {
  16936. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  16937. }
  16938. .bind(this)),
  16939. this.panos.populate_path_graph(),
  16940. this.skybox = new n(this.boundingBox),
  16941. this.skybox.matrixWorldNeedsUpdate = !0,
  16942. this.add(this.skybox),
  16943. /* setTimeout(function() {
  16944. //this.hotsCount && this.shineHots()
  16945. Hot.beginShineHot()
  16946. }
  16947. .bind(this), 1300), */
  16948. this.tags)
  16949. this.tags[t].build();
  16950. //add-----
  16951. console.log('计算visiblePanos开始,可能需要一段时间')
  16952. for(let i in this.hots){
  16953. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos);
  16954. }
  16955. console.log('计算visiblePanos完毕')
  16956. //---------
  16957. return R.debug("Done building model"),
  16958. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  16959. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  16960. this.buildRooms(),
  16961. this.labels.associateWithRooms(this.rooms),
  16962. $.when(this)
  16963. }
  16964. ,
  16965. t.prototype.loadLabels = function() {
  16966. this.labels = new b(this);
  16967. var e = $.Deferred();
  16968. window.DATA.showingLabels ? this.showingLabels = true : '';
  16969. if (!this.showingLabels)
  16970. return e.resolve();
  16971. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  16972. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  16973. R.warn("Getting labels failed, not displaying labels."),
  16974. e.resolve()
  16975. }),
  16976. e
  16977. }
  16978. ,
  16979. t.prototype.buildRooms = function() {
  16980. this.rooms = new _(this),
  16981. this.rooms.createFromChunks(this.chunks),
  16982. this.rooms.calcRoomBoundaries()
  16983. }
  16984. ,
  16985. t.prototype.updateProjectedPanos = function() {
  16986. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  16987. }
  16988. ,
  16989. t.prototype.setProjectedPanos = function(t, i, n) {
  16990. null != n || (n = !0),
  16991. n = !!n,
  16992. this.projectedPano0 = t,
  16993. this.projectedPano1 = i,
  16994. this.skybox.material.setProjectedPanos(t, i, n),
  16995. this.chunks.forEach(function(e) {
  16996. e.materialInside.setProjectedPanos(t, i, n)
  16997. })
  16998. }
  16999. ,
  17000. t.prototype.setSide = function(t) {
  17001. this.floors.forEach(function(e) {
  17002. e.collider.material.side = t
  17003. })
  17004. }
  17005. ,
  17006. t.prototype.heroCount = function() {
  17007. return this.heroLocations ? this.heroLocations.length : 0
  17008. }
  17009. ,
  17010. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17011. if (e[0] < 0)
  17012. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17013. null;
  17014. if (this.heroCount() < 1)
  17015. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17016. null;
  17017. var t = this.heroLocations[e[0]];
  17018. if(t.heroLocations && e[1]!=void 0){
  17019. t = t.heroLocations[e[1]];
  17020. }
  17021. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17022. null) : t
  17023. }
  17024. ,
  17025. t.prototype.findPanoramicHero = function() {
  17026. for (var e in this.heroLocations)
  17027. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17028. return this.heroLocations[e];
  17029. return null
  17030. }
  17031. ,
  17032. t.prototype.listImagePanos = function() {
  17033. var i = []
  17034. , n = this;
  17035. return this.images.forEach(function(e) {
  17036. if (e.metadata && e.metadata.scan_id) {
  17037. var t = n.panos.get(e.metadata.scan_id);
  17038. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17039. }
  17040. }),
  17041. i
  17042. }
  17043. ,
  17044. t.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  17045. if(window.DATA.hideFloorMarker)return
  17046. var currentPano = player.currentPano
  17047. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  17048. var hideWhenFlyOut = () => {
  17049. var shows = [],
  17050. hides = []
  17051. player.model.panos.forEach(pano => {
  17052. hides.push(pano)
  17053. })
  17054. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  17055. }
  17056. if (opacity == 0) {
  17057. hideWhenFlyOut()
  17058. } else {
  17059. if (player.mode == 'panorama' && currentPano) {
  17060. var shows = [], hides = []
  17061. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  17062. if (currentPano.neighbourPanos[pano.id]) {
  17063. shows.push(pano)
  17064. } else {
  17065. hides.push(pano)
  17066. }
  17067. })
  17068. this.panos.fadeMarkerOpacity(opacity, dur, [
  17069. { toOp: opacity, member: shows },
  17070. { toOp: 0, member: hides },
  17071. ])
  17072. } else if (player.modeTran.split('-')[1] != 'panorama') {
  17073. //飞出后marker隐藏
  17074. hideWhenFlyOut()
  17075. }
  17076. }
  17077. }
  17078. ,
  17079. t.prototype.setSweepVisibility = function(t) {
  17080. this.panos.forEach(function(e) {
  17081. e.marker && (e.marker.visible = t)
  17082. })
  17083. }
  17084. ,
  17085. t.prototype.outsideAllowed = function() {
  17086. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17087. }
  17088. ,
  17089. O.exports = t
  17090. }
  17091. ).call(this, "/js/model/Model.js")
  17092. }
  17093. , {
  17094. "../constants": 8,
  17095. "../enum/AlignmentType": 17,
  17096. "../enum/RenderOrder": 42,
  17097. "../enum/Viewmode": 51,
  17098. "../exception/BasicException": 55,
  17099. "../label/Label": 90,
  17100. "../loaders/ModelLoader": 105,
  17101. "../loaders/ModelTextureLoader": 106,
  17102. "../loaders/SweepDataLoader": 107,
  17103. "../tag/tag": 123,
  17104. "../tag/tagManager": 124,
  17105. "../objects/BoundingTextureSkybox": 143,
  17106. "../objects/Chunk": 144,
  17107. "../objects/Floor": 146,
  17108. "../objects/Panorama": 148,
  17109. "../objects/Room": 150,
  17110. "../objects/Snapshot": 153,
  17111. "../settings": 166,
  17112. "../shaders": 167,
  17113. "../util/ModelUrls": 177,
  17114. "../util/PanoramaCollection": 178,
  17115. "../util/ajax": 181,
  17116. "../util/common": 185,
  17117. "../util/easing": 186,
  17118. "../util/lerp": 188,
  17119. "../util/logger": 189,
  17120. "../util/math": 190,
  17121. "../util/texture": 194,
  17122. "../util/transitions": 195,
  17123. "./../util/browser": 182,
  17124. "./../util/showcase": 193,
  17125. "./Chunks": 135,
  17126. "./FloorCollection": 136,
  17127. "./ImageCollection": 137,
  17128. "./LabelCollection": 138,
  17129. "./RoomCollection": 141,
  17130. events: 202,
  17131. three: 217,
  17132. //hot: "hot"
  17133. }],
  17134. 140: [function(e, t, i) {
  17135. "use strict";
  17136. function n() {
  17137. this.modelMap = {},
  17138. this.activeModel = null,
  17139. this.modelCount = 0,
  17140. this.tileDownloader = null,
  17141. this.panoRenderer = null
  17142. }
  17143. var r = (e("three"),
  17144. e("../util/common"))
  17145. , o = e("../exception/BasicException")
  17146. , a = e("../enum/ModelManagerEvents")
  17147. , s = e("../enum/PanoRendererEvents")
  17148. , l = e("events").EventEmitter;
  17149. n.prototype.init = function(e, t, i) {
  17150. this.tileDownloader = e,
  17151. this.panoRenderer = t,
  17152. this.qualityManager = i,
  17153. this.bindEvents()
  17154. }
  17155. ,
  17156. n.prototype.bindEvents = function() {
  17157. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17158. }
  17159. ,
  17160. n.prototype.onTileRendered = function(e, t, i, n) {}
  17161. ,
  17162. n.prototype.addModel = function(e) {
  17163. this.modelMap[e.sid] = e,
  17164. 0 === this.modelCount && this.activateModel(e.sid),
  17165. this.modelCount++,
  17166. this.emit(a.ModelAdded)
  17167. }
  17168. ,
  17169. n.prototype.getModel = function(e) {
  17170. return this.modelMap[e]
  17171. }
  17172. ,
  17173. n.prototype.activateModel = function(e) {
  17174. var t = this.modelMap[e];
  17175. if (!t)
  17176. throw new o("Tried to activate invalid model!");
  17177. var i = this.activeModel;
  17178. this.activeModel = t,
  17179. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17180. this.tileDownloader.setUrls(t.urls),
  17181. t.panos.forEach(function(e) {
  17182. e.attachToPanoRenderer(this.panoRenderer),
  17183. e.tileDownloader = this.tileDownloader,
  17184. e.qualityManager = this.qualityManager
  17185. }
  17186. .bind(this)),
  17187. this.emit(a.ActiveModelChanged, {
  17188. oldModel: i,
  17189. model: t
  17190. })
  17191. }
  17192. ,
  17193. n.prototype.getActiveModel = function() {
  17194. return this.activeModel
  17195. }
  17196. ,
  17197. r.extend(n, l),
  17198. t.exports = n
  17199. }
  17200. , {
  17201. "../enum/ModelManagerEvents": 33,
  17202. "../enum/PanoRendererEvents": 35,
  17203. "../exception/BasicException": 55,
  17204. "../util/common": 185,
  17205. events: 202,
  17206. three: 217
  17207. }],
  17208. 141: [function(r, l, e) {
  17209. (function(e) {
  17210. "use strict";
  17211. function o() {
  17212. n.call(this)
  17213. }
  17214. var a = r("../objects/Room")
  17215. , t = (r("../settings"),
  17216. r("../util/logger"))
  17217. , i = (r("../util/transitions"),
  17218. r("../util/easing"),
  17219. r("../util/common"))
  17220. , n = r("../util/IndexedCollection")
  17221. , s = r("./Chunks");
  17222. new t(e),
  17223. i.inherit(o, n),
  17224. o.prototype.getIndex = function(e) {
  17225. return e.roomId
  17226. }
  17227. ,
  17228. o.prototype.calcRoomBoundaries = function() {
  17229. this.forEach(function(e) {
  17230. e.calcBoundaries()
  17231. })
  17232. }
  17233. ,
  17234. o.prototype.createFromChunks = function(e) {
  17235. var n = {
  17236. floorId: -1,
  17237. roomId: -1
  17238. }
  17239. , r = {};
  17240. e.forEach(function(e) {
  17241. s.parseIdsFromChunkName(e.name, n);
  17242. var t = r[n.roomId];
  17243. if (!t) {
  17244. var i = o.generateRoomId(n.floorId, n.roomId);
  17245. t = new a(n.floorId,i),
  17246. this.add(t),
  17247. r[n.roomId] = t
  17248. }
  17249. t.addChunk(e)
  17250. }
  17251. .bind(this)),
  17252. this.calcRoomBoundaries()
  17253. }
  17254. ,
  17255. o.generateRoomId = function(e, t) {
  17256. return e + "_" + t
  17257. }
  17258. ,
  17259. l.exports = o
  17260. }
  17261. ).call(this, "/js/model/RoomCollection.js")
  17262. }
  17263. , {
  17264. "../objects/Room": 150,
  17265. "../settings": 166,
  17266. "../util/IndexedCollection": 175,
  17267. "../util/common": 185,
  17268. "../util/easing": 186,
  17269. "../util/logger": 189,
  17270. "../util/transitions": 195,
  17271. "./Chunks": 135
  17272. }],
  17273. 142: [function(e, t, i) {
  17274. "use strict";
  17275. function n(e, t, i) {
  17276. var n = (e = e.clone().expandByScalar(0.01)).size()
  17277. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17278. r.boundingBox = e,
  17279. o.Mesh.call(this, r, t),
  17280. this.position.copy(e.center()),
  17281. this.frustumCulled = !1,
  17282. i && this.add(new o.WireframeHelper(this))
  17283. }
  17284. var o = e("three");
  17285. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17286. t.exports = n
  17287. }
  17288. , {
  17289. three: 217
  17290. }],
  17291. 143: [function(l, c, e) {
  17292. (function(e) {
  17293. "use strict";
  17294. function t(e) {
  17295. s.time("Computing a nice bounding cubemap");
  17296. var t = new r({
  17297. side: i.BackSide,
  17298. transparent: !0
  17299. });
  17300. t.uniforms.modelAlpha.value = 0,
  17301. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17302. this.renderOrder = a.boundingSkybox,
  17303. n.call(this, e, t),
  17304. s.timeEnd("Computing a nice bounding cubemap")
  17305. }
  17306. var i = l("three")
  17307. , n = (l("../enum/Viewmode"),
  17308. l("../shaders"),
  17309. l("./BoundingMesh"))
  17310. , r = l("../materials/ModelTextureMaterial")
  17311. , o = l("../settings")
  17312. , a = l("../enum/RenderOrder")
  17313. , s = new (l("../util/logger"))(e);
  17314. (t.prototype = Object.create(n.prototype)).constructor = t,
  17315. c.exports = t
  17316. }
  17317. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17318. }
  17319. , {
  17320. "../enum/RenderOrder": 42,
  17321. "../enum/Viewmode": 51,
  17322. "../materials/ModelTextureMaterial": 118,
  17323. "../settings": 166,
  17324. "../shaders": 167,
  17325. "../util/logger": 189,
  17326. "./BoundingMesh": 142,
  17327. three: 217
  17328. }],
  17329. 144: [function(e, t, i) {
  17330. "use strict";
  17331. function n(e) {
  17332. this.materialInside = new s({
  17333. side: r.DoubleSide
  17334. });
  17335. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17336. this.materialOutside = new r.RawShaderMaterial({
  17337. fragmentShader: o.modelOutside.fragmentShader,
  17338. vertexShader: o.modelOutside.vertexShader,
  17339. uniforms: t,
  17340. side: r.FrontSide,
  17341. name: "chunkOut"
  17342. }),
  17343. r.Mesh.call(this, e.geometry, this.materialInside),
  17344. this.name = e.name || "",
  17345. this.textureName = e.textureName,
  17346. this.meshUrl = e.meshUrl
  17347. }
  17348. var r = e("three")
  17349. , o = e("../shaders")
  17350. , a = e("../enum/Viewmode")
  17351. , s = e("../materials/ModelTextureMaterial");
  17352. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17353. this.materialInside.uniforms.map.value = e,
  17354. this.materialOutside.uniforms.map.value = e
  17355. }
  17356. ,
  17357. n.prototype.setMode = function(e) {
  17358. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17359. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17360. t.transparent = this.material.transparent,
  17361. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17362. this.material = t
  17363. }
  17364. ,
  17365. t.exports = n
  17366. }
  17367. , {
  17368. "../enum/Viewmode": 51,
  17369. "../materials/ModelTextureMaterial": 118,
  17370. "../shaders": 167,
  17371. three: 217
  17372. }],
  17373. 145: [function(e, t, i) {
  17374. "use strict";
  17375. function n(e) {
  17376. this.chunksize = e || 10,
  17377. this.chunks = {},
  17378. this.boundingBoxes = {},
  17379. this.children = [],
  17380. this.offset = new m.Vector3(0,.5,0),
  17381. this.material = new m.MeshBasicMaterial({
  17382. color: 16777215 * Math.random(),
  17383. side: m.DoubleSide
  17384. })
  17385. }
  17386. var m = e("three");
  17387. e("../enum/Viewmode"),
  17388. n.prototype.add = function(e) {
  17389. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17390. u ? (t = u.position.array,
  17391. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17392. e.faces);
  17393. var d = new m.Vector3;
  17394. if (i)
  17395. for (n = 0,
  17396. r = i.length; n < r; n += 3) {
  17397. var p = 3 * i[n]
  17398. , f = 3 * i[n + 1]
  17399. , g = 3 * i[n + 2];
  17400. o = (t[p] + t[f] + t[g]) / 3,
  17401. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17402. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17403. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17404. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17405. this.boundingBoxes[l] = new m.Box3),
  17406. 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]),
  17407. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17408. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17409. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17410. }
  17411. else
  17412. for (n = 0,
  17413. r = t.length; n < r; n += 9)
  17414. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17415. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17416. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17417. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17418. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17419. this.boundingBoxes[l] = new m.Box3),
  17420. 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]),
  17421. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17422. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17423. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17424. }
  17425. ,
  17426. n.prototype.build = function() {
  17427. var e = new m.Object3D;
  17428. for (var t in e.material = this.material,
  17429. this.chunks) {
  17430. var i = this.chunks[t]
  17431. , n = new m.BufferGeometry;
  17432. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17433. n.boundingBox = this.boundingBoxes[t];
  17434. var r = new m.Mesh(n,this.material);
  17435. r.material.visible = !1,
  17436. e.add(r),
  17437. this.chunks[t] = []
  17438. }
  17439. return e
  17440. }
  17441. ,
  17442. t.exports = n
  17443. }
  17444. , {
  17445. "../enum/Viewmode": 51,
  17446. three: 217
  17447. }],
  17448. 146: [function(e, t, i) {
  17449. "use strict";
  17450. var n = e("three")
  17451. , r = e("../settings")
  17452. , o = e("../util/common")
  17453. , a = e("../util/lerp")
  17454. , s = e("./ChunkedCollider")
  17455. , l = e("../util/transitions")
  17456. , c = e("../util/easing")
  17457. , h = (e("../objects/Panorama"),
  17458. e("../enum/RenderOrder"));
  17459. e("../localization/localize");
  17460. function u(e, t, i) {
  17461. n.Object3D.call(this),
  17462. this.model = e,
  17463. this.floorIndex = t,
  17464. this.lang = r.languageTag,
  17465. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17466. this.panos = [],
  17467. this.chunks = [],
  17468. this.colliderBuilder = new s(3),
  17469. this.collider = null,
  17470. this.center = null,
  17471. this.boundingBox = new n.Box3,
  17472. this.size = null,
  17473. this.hidden = !1,
  17474. this.conservativeBoundingBox = new n.Box3,
  17475. this.debugColor = 16777215 * Math.random(),
  17476. this.transition = null
  17477. }
  17478. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17479. this.model.setFloor(this, e)
  17480. }
  17481. ,
  17482. u.prototype.hide = function(e) {
  17483. if (!this.hidden || this.transition) {
  17484. this.chunks.forEach(function(e) {
  17485. e.material.transparent = !0
  17486. }),
  17487. l.cancel(this.transition);
  17488. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17489. , i = e ? 0 : r.hideFloorDelay / t;
  17490. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17491. this.hidden = !0
  17492. }
  17493. .bind(this), i, c.easeInOutQuad)
  17494. }
  17495. }
  17496. ,
  17497. u.prototype.show = function(e) {
  17498. if (this.hidden || this.transition) {
  17499. this.hidden = !1,
  17500. l.cancel(this.transition);
  17501. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17502. , i = e ? 0 : r.showFloorDelay / t;
  17503. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17504. this.hidden || this.chunks.forEach(function(e) {
  17505. e.material.transparent = !1
  17506. })
  17507. }
  17508. .bind(this), i, c.easeInOutQuad)
  17509. }
  17510. }
  17511. ,
  17512. u.prototype.toggle = function(e, t) {
  17513. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17514. }
  17515. ,
  17516. u.prototype.containsPoint = function(t) {
  17517. return this.collider.children.some(function(e) {
  17518. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17519. e.geometry.boundingBox.containsPoint(t)
  17520. })
  17521. }
  17522. ,
  17523. u.prototype.distanceToPoint = function(i) {
  17524. var n = null
  17525. , r = 1 / 0;
  17526. return this.collider.children.forEach(function(e) {
  17527. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17528. var t = e.geometry.boundingBox.distanceToPoint(i);
  17529. (!n || t < r) && (r = t,
  17530. n = e)
  17531. }),
  17532. r
  17533. }
  17534. ,
  17535. u.prototype.addChunk = function(e) {
  17536. e.renderOrder = h.ghostFloor,
  17537. this.add(e),
  17538. this.chunks.push(e),
  17539. this.boundingBox.union(e.geometry.boundingBox),
  17540. this.size = this.boundingBox.size(),
  17541. this.colliderBuilder.add(e.geometry)
  17542. }
  17543. ,
  17544. u.prototype.addPano = function(e) {
  17545. this.panos.push(e),
  17546. this.add(e.skyboxMesh),
  17547. e.marker && this.add(e.marker);
  17548. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17549. var t = new n.Vector3(1,1,1)
  17550. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17551. this.boundingBox.union(i)
  17552. }
  17553. }
  17554. ,
  17555. u.prototype.build = function() {
  17556. this.collider = this.colliderBuilder.build(!0),
  17557. this.add(this.collider),
  17558. this.center = this.boundingBox.center(),
  17559. this.conservativeBoundingBox.copy(this.boundingBox),
  17560. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17561. return e.geometry.boundingBox.min.y
  17562. }), 5),
  17563. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17564. return e.geometry.boundingBox.max.y
  17565. }), 5),
  17566. this.colliderBuilder = null
  17567. }
  17568. ,
  17569. u.prototype.toShortString = function() {
  17570. return o.nth(this.floorIndex + 1)
  17571. }
  17572. ,
  17573. u.prototype.toString = function() {
  17574. return this.name
  17575. }
  17576. ,
  17577. t.exports = u
  17578. }
  17579. , {
  17580. "../enum/RenderOrder": 42,
  17581. "../localization/localize": 108,
  17582. "./strings-cn-CN": 109,
  17583. "../objects/Panorama": 148,
  17584. "../settings": 166,
  17585. "../util/common": 185,
  17586. "../util/easing": 186,
  17587. "../util/lerp": 188,
  17588. "../util/transitions": 195,
  17589. "./ChunkedCollider": 145,
  17590. three: 217
  17591. }],
  17592. 147: [function(e, t, i) {
  17593. "use strict";
  17594. function n(e) {
  17595. this.player = e,
  17596. this.obj3d = null,
  17597. this.UP = new u.Vector3(0,1,0)
  17598. }
  17599. var u = e("three")
  17600. , d = e("../settings");
  17601. n.prototype.prefs = {
  17602. linewidth: 3,
  17603. height: .07,
  17604. opacity: .45,
  17605. endScale: .05
  17606. },
  17607. n.prototype.discard = function() {
  17608. if (this.obj3d) {
  17609. var e = this.obj3d.parent;
  17610. e && e.remove(this.obj3d)
  17611. }
  17612. this.obj3d = null
  17613. }
  17614. ,
  17615. n.prototype.draw = function() {
  17616. if (this.discard(),
  17617. d.showNeighbors) {
  17618. var e = this.player.currentPano.floor;
  17619. this.obj3d = new u.Object3D;
  17620. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17621. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17622. i.y += this.prefs.height;
  17623. var n = .1525
  17624. , r = new u.Matrix4;
  17625. for (var o in t)
  17626. if (t[o]) {
  17627. var a = this.player.model.panos.get(o)
  17628. , s = (a.position.clone().sub(this.player.model.position),
  17629. a.position.clone().sub(a.floorPosition))
  17630. , l = a.floorPosition.clone().sub(this.player.model.position);
  17631. l.y += this.prefs.height;
  17632. var c = new u.Geometry;
  17633. 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)),
  17634. 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)),
  17635. r.identity().setPosition(s),
  17636. c.applyMatrix(r),
  17637. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17638. 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)),
  17639. r.lookAt(l, i, this.UP).setPosition(l),
  17640. c.applyMatrix(r),
  17641. c.vertices.push(l, i);
  17642. var h = new u.Line(c,new u.LineBasicMaterial({
  17643. color: a.debugColor.getHex(),
  17644. transparent: !0,
  17645. opacity: this.prefs.opacity,
  17646. depthWrite: !1,
  17647. name: "sLine" + o,
  17648. linewidth: this.prefs.linewidth
  17649. }));
  17650. this.obj3d.add(h)
  17651. }
  17652. e.add(this.obj3d)
  17653. }
  17654. }
  17655. ,
  17656. n.prototype.update = function() {
  17657. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17658. }
  17659. ,
  17660. t.exports = n
  17661. }
  17662. , {
  17663. "../settings": 166,
  17664. three: 217
  17665. }],
  17666. 148: [function(S, M, e) {
  17667. (function(e) {
  17668. "use strict";
  17669. function r(e, t, i, n) {
  17670. this.model = e,
  17671. this.id = t,
  17672. this.alignmentType = i.alignmentType || c.ALIGNED,
  17673. this.neighbourUUIDs = i.neighbours,
  17674. this.neighbourPanos = null,
  17675. this.floor = null,
  17676. this.floorIndex = i.floor,
  17677. this.failedLoadingAt = 0,
  17678. this.maxLoadRetries = 4,
  17679. this.origin = i.position.clone(),
  17680. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17681. this.quaternion = i.quaternion.clone(),
  17682. this.skyboxMesh = new s.Mesh(E),
  17683. this.skyboxMesh.position.copy(this.position),
  17684. this.skyboxMesh.quaternion.copy(this.quaternion),
  17685. this.skyboxMesh.name = "skybox",
  17686. this.skyboxMesh.visible = !1,
  17687. this.skyboxMesh.updateMatrix(),
  17688. this.skyboxMesh.updateMatrixWorld(),
  17689. this.marker = null,
  17690. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker
  17691. if(this.isAligned() ){
  17692. this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17693. map: b,
  17694. side: s.DoubleSide,
  17695. opacity: 0,
  17696. transparent: !0,
  17697. depthWrite: !1
  17698. })),
  17699. this.marker.visible = false //改:先不显示,之后根据opacity显示
  17700. this.marker.renderOrder = l.panoMarker,
  17701. this.marker.name = "marker",
  17702. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17703. this.marker.updateMatrixWorld()
  17704. if(!window.DATA.hideFloorMarker){//xzw
  17705. let opa = this.marker.material.opacity
  17706. Object.defineProperty(this.marker.material, 'opacity', {
  17707. get: function () {
  17708. return opa
  17709. },
  17710. set: (o)=>{
  17711. opa = o
  17712. //if(o>0)console.log('o>0',this.pano.id)
  17713. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o != 0)
  17714. },
  17715. })
  17716. }
  17717. a.colorMarkerOnLoad && this.on("load", function() {
  17718. this.marker.material.color.set(65280)
  17719. })
  17720. }
  17721. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17722. this.floorPosition = i.puck ? i.puck.clone() : null,
  17723. this.tiled = n,
  17724. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17725. this.solidSkybox.flipY = !1,
  17726. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17727. this.solidSkybox.magFilter = s.LinearFilter,
  17728. this.solidSkybox.generateMipmaps = !1)),
  17729. this.zoomed = !1,
  17730. this.panoRenderer = null,
  17731. this.qualityManager = null,
  17732. this.tileDownloader = null,
  17733. this.tiledPanoRenderTarget = null,
  17734. this.minimumTiledPanoLoaded = !1,
  17735. this.highestPartialTileRenderOpCompleted = 0,
  17736. this.highestFullTileRenderOpCompleted = 0,
  17737. this.shouldRedrawOnBaseLoaded = !1,
  17738. this.lockUntilRenderingComplete = !1,
  17739. a.colorMarkerOnLoad && this.on("load", function() {
  17740. this.marker.material.color.set(65280)
  17741. }),
  17742. (e = new s.TextureLoader).setCrossOrigin(!0);
  17743. var r = e.load("images/texture.jpg");
  17744. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17745. color: 16777215,
  17746. transparent: !0,
  17747. opacity: .75,
  17748. map: r
  17749. })),
  17750. this.vrMarker.boluoType = "vr",
  17751. this.vrMarker.position.z = 1,
  17752. this.vrMarker.enabled = !0,
  17753. this.vrMarker.visible = !1,
  17754. window.vrMarkers = window.vrMarkers || [],
  17755. window.vrMarkers.push(this.vrMarker),
  17756. this.marker && this.marker.add(this.vrMarker),
  17757. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17758. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17759. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17760. this.adjustAngleEnable) {
  17761. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17762. this.skyboxMesh.quaternion.multiply(i);
  17763. var o = new s.Quaternion;
  17764. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17765. this.skyboxMesh.quaternion.multiply(o),
  17766. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17767. this.skyboxMesh.quaternion.multiply(n),
  17768. this.skyboxMesh.updateMatrix(),
  17769. this.skyboxMesh.updateMatrixWorld(),
  17770. this.model.updateProjectedPanos()
  17771. }
  17772. }
  17773. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17774. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17775. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17776. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17777. S("../enum/GLCubeFaces"),
  17778. 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");
  17779. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17780. function() {
  17781. this.setZoomed(!1),
  17782. this.emit("enter", {
  17783. oldPano: t,
  17784. newPano: this
  17785. }),
  17786. t = this
  17787. }
  17788. ),
  17789. r.prototype.exit = function() {
  17790. this.tiled ? (this.clearWaitDeferreds(),
  17791. this.minimumTiledPanoLoaded = !1,
  17792. this.tiledPanoRenderTarget = null,
  17793. this.setZoomed(!1),
  17794. this.panoRenderer.deactivateTiledPano(this),
  17795. this.highestPartialTileRenderOpCompleted = 0,
  17796. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17797. this.solidSkybox.loaded = !1,
  17798. this.solidSkybox.version = 0),
  17799. this.emit("exit")
  17800. }
  17801. ,
  17802. r.prototype.hoverOn = function(e) {
  17803. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17804. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17805. }
  17806. ,
  17807. r.prototype.hoverOff = function(e) {
  17808. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17809. }
  17810. ,
  17811. r.prototype.build1 = function() {
  17812. 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), //改
  17813. this.floor.addPano(this)
  17814. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17815. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17816. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17817. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  17818. }
  17819. ,
  17820. r.prototype.build2 = function() {
  17821. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17822. this.height = this.position.distanceTo(this.floorPosition),
  17823. this.placeMarker()
  17824. }
  17825. ,
  17826. r.prototype.interpolateFloorPosition = function() {
  17827. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17828. return !!e.floorPosition
  17829. }).sort(function(e, t) {
  17830. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17831. }
  17832. .bind(this))
  17833. , t = this.position.clone();
  17834. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17835. t
  17836. }
  17837. ,
  17838. r.prototype.raycastFloorPosition = function() {
  17839. I.warn("Performance warning: Raycasting to find floor position");
  17840. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17841. return e.length ? e[0].point : null
  17842. }
  17843. ,
  17844. 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)],
  17845. function() {
  17846. I.warn("Performance warning: Raycasting to find floor index");
  17847. for (var e = 0; e < i.length; e++) {
  17848. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17849. if (t.length)
  17850. return t[0].object.parent.parent
  17851. }
  17852. return null
  17853. }
  17854. ),
  17855. r.prototype.placeMarker = function() {
  17856. this.marker && (this.marker.position.copy(this.floorPosition),
  17857. this.marker.position.y += .05,
  17858. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17859. }
  17860. ,
  17861. r.prototype.translate = function(e) {
  17862. this.position.add(e),
  17863. this.floorPosition.add(e)
  17864. }
  17865. ,
  17866. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17867. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17868. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17869. }
  17870. ,
  17871. r.prototype.attachToPanoRenderer = function(e) {
  17872. this.panoRenderer = e,
  17873. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17874. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17875. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17876. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17877. }
  17878. ;
  17879. var w, T, x = {};
  17880. r.prototype.getWaitDeferred = function(e) {
  17881. var t = x[this.id];
  17882. t || (t = {},
  17883. x[this.id] = t);
  17884. var i = t[e];
  17885. return i || (i = {
  17886. deferred: $.Deferred(),
  17887. active: !1
  17888. },
  17889. t[e] = i),
  17890. i
  17891. }
  17892. ,
  17893. r.prototype.resetWaitDeferred = function(e) {
  17894. var t = this.getWaitDeferred(e);
  17895. t.active = !1,
  17896. t.deferred = $.Deferred()
  17897. }
  17898. ,
  17899. r.prototype.clearWaitDeferreds = function() {
  17900. var e = x[this.id];
  17901. for (var t in e || (e = {},
  17902. x[this.id] = e),
  17903. e)
  17904. if (e.hasOwnProperty(t)) {
  17905. var i = e[t];
  17906. i.active = !1,
  17907. i.deferred = $.Deferred()
  17908. }
  17909. }
  17910. ,
  17911. r.prototype.loadTiledPano = (new s.Vector3,
  17912. w = [],
  17913. T = [],
  17914. function(e, t, i, n, r, o) {
  17915. null != n || (n = !0),
  17916. null != r || (r = !0);
  17917. var a = this.getWaitDeferred(e)
  17918. , s = a.deferred
  17919. , l = null
  17920. , c = null;
  17921. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17922. c = i.vFov)),
  17923. !this.isLoaded(e)) {
  17924. if (!a.active) {
  17925. if (a.active = !0,
  17926. i) {
  17927. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17928. w[this.id + ":" + e] = {
  17929. tileCount: 0,
  17930. targetTileCount: h
  17931. },
  17932. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17933. }
  17934. T[this.id] || (T[this.id] = !0,
  17935. this.on(f.LoadComplete, function(e, t) {
  17936. var i = this.getWaitDeferred(e).deferred;
  17937. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17938. this.resetWaitDeferred(e))
  17939. }
  17940. .bind(this)),
  17941. this.on(f.LoadFailed, function(e) {
  17942. var t = this.getWaitDeferred(e).deferred;
  17943. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17944. this.resetWaitDeferred(e))
  17945. }
  17946. .bind(this)),
  17947. this.on(f.TileLoaded, function(e, t, i) {
  17948. var n = this.getWaitDeferred(e).deferred;
  17949. if (n && "pending" === n.state()) {
  17950. n.notify(e, t, i);
  17951. var r = w[this.id + ":" + e];
  17952. r && (r.tileCount++,
  17953. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  17954. n.resolve(e, i),
  17955. this.resetWaitDeferred(e)))
  17956. }
  17957. }
  17958. .bind(this)))
  17959. }
  17960. this.tileDownloader.clearForceQueue(),
  17961. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  17962. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  17963. this.panoRenderer.renderPanoTiles(this.id, t, r)
  17964. }
  17965. return s.promise()
  17966. }
  17967. ),
  17968. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  17969. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  17970. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  17971. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  17972. }
  17973. ,
  17974. r.prototype.onTileRendered = function(e, t, i, n) {
  17975. e === this.id && this.emit(f.TileLoaded, t, i, n)
  17976. }
  17977. ,
  17978. r.prototype.onPanoRendered = function(e, t, i, n) {
  17979. e === this.id && (this.minimumTiledPanoLoaded = !0,
  17980. this.updateSkyboxForZoomLevel(),
  17981. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  17982. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  17983. this.emit("load", t),
  17984. this.model.emit("load", this),
  17985. this.emit(f.LoadComplete, t, i))
  17986. }
  17987. ,
  17988. r.prototype.setZoomed = function(e) {
  17989. this.zoomed = e,
  17990. this.updateSkyboxForZoomLevel()
  17991. }
  17992. ,
  17993. r.prototype.ensureSkyboxReadyForRender = function() {
  17994. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  17995. this.solidSkybox.loaded = !0)
  17996. }
  17997. ,
  17998. r.prototype.updateSkyboxForZoomLevel = function() {
  17999. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18000. }
  18001. ,
  18002. r.prototype.getSkyboxTexture = function() {
  18003. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18004. }
  18005. ,
  18006. r.prototype.onTileRenderFail = function(e, t, i) {
  18007. e === this.id && this.emit(f.LoadFailed, t)
  18008. }
  18009. ,
  18010. r.prototype.isLoaded = function(e) {
  18011. if (this.tiled) {
  18012. if (e && "string" == typeof e)
  18013. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18014. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18015. }
  18016. if (e && "number" == typeof e)
  18017. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18018. return !!this.solidSkybox.high || e in this.solidSkybox
  18019. }
  18020. ,
  18021. r.prototype.loadCube = function(a) {
  18022. if (this.isLoaded(a))
  18023. return I.info("Skipping load of pano, already loaded"),
  18024. $.when();
  18025. this.emit("loading", a),
  18026. this.model.emit("loading", this);
  18027. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18028. , e = n.filter(function(e) {
  18029. return !e
  18030. });
  18031. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18032. a = "high",
  18033. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18034. var t = 0
  18035. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18036. return u.getImage(n[t])
  18037. }
  18038. .bind(this));
  18039. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18040. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18041. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18042. this.solidSkybox.low = null),
  18043. this.solidSkybox.needsUpdate = !0,
  18044. this.emit("load", a),
  18045. this.model.emit("load", this),
  18046. this
  18047. }
  18048. .bind(this), function() {
  18049. I.error("Downloading cubemap for pano", this.id, "failed"),
  18050. this.failedLoadingAt = Date.now()
  18051. }
  18052. .bind(this), function() {
  18053. return $.when(++t, 6)
  18054. })
  18055. }
  18056. ,
  18057. r.raycastsSkipped = 0,
  18058. r.raycastsDone = 0,
  18059. r.prototype.findNeighourPanos = function() {
  18060. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18061. this.model.panos.forEach(function(e) {
  18062. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18063. var t = this.position.distanceTo(e.position);
  18064. if (t > a.panoramaNeighbourMaxDistance)
  18065. return this.model.panos.setNeighbour(this, e, !1),
  18066. void r.raycastsSkipped++;
  18067. var i = e.position.clone().sub(this.position).normalize()
  18068. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18069. r.raycastsDone++,
  18070. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18071. 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)))
  18072. }
  18073. }
  18074. .bind(this)),
  18075. this.model.panos.neighbourMap[this.id]
  18076. }
  18077. ,
  18078. r.prototype.worldPosition = function() {
  18079. return this.position
  18080. }
  18081. ,
  18082. r.prototype.addTextSprite = function(e, color, parent) {
  18083. this.removeTextSprite();
  18084. var ratio = 16;
  18085. var i = document.createElement("canvas")
  18086. , n = i.getContext("2d");
  18087. i.width = 1024,
  18088. i.height = i.width / ratio;
  18089. n.font = " 30px Arial",
  18090. n.fillStyle = "white";
  18091. var r = n.measureText(e).width;
  18092. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18093. var o = new s.Texture(i);
  18094. o.needsUpdate = !0;
  18095. var a = new s.SpriteMaterial({
  18096. map: o,
  18097. color: color || 16428055,
  18098. depthTest:false
  18099. });
  18100. this.text3d = new s.Sprite(a)
  18101. if(parent){
  18102. parent.add(this.text3d)
  18103. }else{
  18104. this.text3d.position.copy(this.skyboxMesh.position)
  18105. this.floor.add(this.text3d)
  18106. }
  18107. var scale = 5
  18108. this.text3d.scale.y = scale/ratio
  18109. this.text3d.scale.x = scale
  18110. }
  18111. ,
  18112. r.prototype.removeTextSprite = function() {
  18113. this.text3d && (this.text3d.parent.remove(this.text3d),
  18114. this.text3d.material.map.dispose(),
  18115. this.text3d = null)
  18116. }
  18117. ,
  18118. r.prototype.isAligned = function() {
  18119. return this.alignmentType === c.ALIGNED
  18120. }
  18121. ,
  18122. r.filters = {
  18123. inDirection: function(t, i, n) {
  18124. return function(e) {
  18125. return e.position.clone().sub(t).normalize().dot(i) > n
  18126. }
  18127. },
  18128. inFloorDirection: function(t, i, n) {
  18129. return function(e) {
  18130. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18131. }
  18132. },
  18133. inPanoDirection: function(n, r, o) {
  18134. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18135. function(e) {
  18136. var t = e.floorPosition.clone().sub(n).normalize()
  18137. , i = e.position.clone().sub(n).normalize();
  18138. return t.dot(r) > o || i.dot(r) > o
  18139. }
  18140. },
  18141. atFloor: function(t) {
  18142. return function(e) {
  18143. return !t || e.floor === t
  18144. }
  18145. },
  18146. not: function(t) {
  18147. return function(e) {
  18148. return e !== t
  18149. }
  18150. },
  18151. notIn: function(t) {
  18152. return function(e) {
  18153. return -1 === t.indexOf(e)
  18154. }
  18155. },
  18156. isLoaded: function() {
  18157. return function(e) {
  18158. return e.isLoaded()
  18159. }
  18160. },
  18161. isNotLoaded: function() {
  18162. return function(e) {
  18163. return !e.isLoaded()
  18164. }
  18165. },
  18166. isCloseEnoughTo: function(t, i) {
  18167. return function(e) {
  18168. return t.distanceTo(e.floorPosition) < i
  18169. }
  18170. },
  18171. hasMinimumHeightDifferenceTo: function(t, i) {
  18172. return function(e) {
  18173. return Math.abs(e.position.y - t.y) > i
  18174. }
  18175. },
  18176. isNotBehindNormal: function(t, i) {
  18177. var n = new s.Vector3;
  18178. return i = i.clone(),
  18179. function(e) {
  18180. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18181. }
  18182. },
  18183. isNeighbourPanoTo: function(t) {
  18184. return function(e) {
  18185. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18186. }
  18187. },
  18188. isNeighbourOfNeighbourTo: function(n) {
  18189. return function(i) {
  18190. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18191. var t = n.model.panos.get(e);
  18192. return !!t && t.neighbourPanos[i.id]
  18193. })
  18194. }
  18195. },
  18196. isNotRecentlyFailed: function(t) {
  18197. return function(e) {
  18198. return Date.now() - e.failedLoadingAt > t
  18199. }
  18200. },
  18201. isOnVisibleFloor: function() {
  18202. return function(e) {
  18203. return !e.floor.hidden
  18204. }
  18205. },
  18206. isPanoAligned: function() {
  18207. return function(e) {
  18208. return e.isAligned()
  18209. }
  18210. }
  18211. },
  18212. r.sortFunctions = {
  18213. distanceToPoint: function(i) {
  18214. return function(e, t) {
  18215. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18216. }
  18217. },
  18218. floorDistanceToPoint: function(i) {
  18219. return function(e, t) {
  18220. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18221. }
  18222. },
  18223. choose: function(i) {
  18224. return function(e, t) {
  18225. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18226. }
  18227. }
  18228. },
  18229. r.scoreFunctions = {
  18230. distance: function(t, i) {
  18231. return i = i || a.navigation.distanceFactor,
  18232. function(e) {
  18233. return t ? t.position.distanceTo(e.position) * i : 0
  18234. }
  18235. },
  18236. distanceSquared: function(t, i) {
  18237. return i = i || a.navigation.distanceFactor,
  18238. function(e) {
  18239. return t ? t.position.distanceToSquared(e.position) * i : 0
  18240. }
  18241. },
  18242. direction: function(t, i) {
  18243. return function(e) {
  18244. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18245. }
  18246. },
  18247. angle: function(t, i) {
  18248. return function(e) {
  18249. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18250. }
  18251. },
  18252. inFieldOfView: function(t, i) {
  18253. return function(e) {
  18254. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18255. }
  18256. },
  18257. optionality: function(t) {
  18258. return function(e) {
  18259. return e.neighbourUUIDs.filter(function(e) {
  18260. return !(e in t.neighbourUUIDs) && e !== t.id
  18261. }).length * a.navigation.optionalityFactor
  18262. }
  18263. },
  18264. penalizeHeightDifferenceUnder: function(t, i) {
  18265. return function(e) {
  18266. return t.y - e.position.y < i ? -20 : 0
  18267. }
  18268. }
  18269. },
  18270. M.exports = r
  18271. }
  18272. ).call(this, "/js/objects/Panorama.js")
  18273. }
  18274. , {
  18275. "../enum/AlignmentType": 17,
  18276. "../enum/GLCubeFaces": 25,
  18277. "../enum/PanoRendererEvents": 35,
  18278. "../enum/PanoSizeClass": 36,
  18279. "../enum/PanoramaEvents": 37,
  18280. "../enum/RenderLayers": 41,
  18281. "../enum/RenderOrder": 42,
  18282. "../enum/TileDownloaderEvents": 45,
  18283. "../enum/Viewmode": 51,
  18284. "../exception/BasicException": 55,
  18285. "../scene/SceneRenderer": 158,
  18286. "../settings": 166,
  18287. "../tile/TileUtils": 174,
  18288. "../util/ajax": 181,
  18289. "../util/common": 185,
  18290. "../util/lerp": 188,
  18291. "../util/logger": 189,
  18292. "../util/panorama": 191,
  18293. "../util/texture": 194,
  18294. "../util/transitions": 195,
  18295. events: 202,
  18296. three: 217
  18297. }],
  18298. 149: [function(e, t, i) {
  18299. "use strict";
  18300. function n(e) {
  18301. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18302. t.map.value = d,
  18303. t.opacity.value = 0,
  18304. t.color.value.set(o.reticuleColor),
  18305. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18306. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18307. side: r.DoubleSide,
  18308. depthWrite: !1,
  18309. depthTest: !1,
  18310. transparent: !0,
  18311. vertexShader: c.waypoint.vertexShader,
  18312. fragmentShader: c.waypoint.fragmentShader,
  18313. uniforms: t,
  18314. name: "waypoint",
  18315. opacity: 0,
  18316. visible: t.showMouseMarker
  18317. })),
  18318. this.layers.set(h.RETICULE),
  18319. this.renderOrder = u.reticule,
  18320. this.player = e,
  18321. this.direction = new r.Vector3,
  18322. this.hidden = !0,
  18323. this.mouseLastMoveTime = Date.now()
  18324. }
  18325. var r = e("three")
  18326. , o = e("../settings")
  18327. , a = e("../util/transitions")
  18328. , s = e("../util/texture")
  18329. , l = e("../util/lerp")
  18330. , c = e("../shaders")
  18331. , h = e("../enum/RenderLayers")
  18332. , u = e("../enum/RenderOrder")
  18333. , d = s.load("images/reticule-256x256.png");
  18334. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18335. this.hidden = i,
  18336. this.mouseLastMoveTime = Date.now()
  18337. }
  18338. ,
  18339. n.prototype.hide = function() {
  18340. this.hidden || (this.hidden = !0,
  18341. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18342. }
  18343. ,
  18344. n.prototype.show = function() {
  18345. this.hidden = !1,
  18346. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18347. }
  18348. ,
  18349. n.prototype.update = function() {
  18350. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18351. }
  18352. ,
  18353. n.prototype.updatePosition = function(e, t) {
  18354. if (!this.hidden) {
  18355. if (!t)
  18356. return this.hide();
  18357. var i = t.point
  18358. , n = e.distanceTo(i)
  18359. , r = 1 + .01 * n;
  18360. n < 1 && (r -= 1 - n),
  18361. this.show(),
  18362. this.scale.set(r, r, r),
  18363. this.direction = this.direction.multiplyScalar(.8),
  18364. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18365. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18366. this.lookAt(this.position.clone().add(this.direction))
  18367. }
  18368. }
  18369. ,
  18370. n.prototype.writeAstag = function() {
  18371. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18372. , t = new Date;
  18373. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18374. var i = {
  18375. enabled: !0,
  18376. version: "0",
  18377. created: t.toISOString(),
  18378. created_by: "APITest",
  18379. position: this.position.clone(),
  18380. stem: {
  18381. enabled: o.tags.pole.enabled,
  18382. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18383. },
  18384. label: "tag " + this.tagCount,
  18385. description: "Description " + e,
  18386. floor: function(e) {
  18387. if (e.currentFloor) {
  18388. var t = e.floors.indexOf(e.currentFloor);
  18389. return -1 < t ? t : void 0
  18390. }
  18391. }(this.player.model),
  18392. type: "info",
  18393. metadata: {
  18394. preferred_camera: {
  18395. mode: this.player.mode
  18396. }
  18397. }
  18398. };
  18399. console.log("--------------------------"),
  18400. console.log(JSON.stringify(i));
  18401. var n = this.player.model.addtag(e, i).build();
  18402. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18403. n.visible || n.show(o.tags.startup.fadeInDuration))
  18404. }
  18405. ,
  18406. t.exports = n
  18407. }
  18408. , {
  18409. "../enum/RenderLayers": 41,
  18410. "../enum/RenderOrder": 42,
  18411. "../settings": 166,
  18412. "../shaders": 167,
  18413. "../util/lerp": 188,
  18414. "../util/texture": 194,
  18415. "../util/transitions": 195,
  18416. three: 217
  18417. }],
  18418. 150: [function(e, t, i) {
  18419. "use strict";
  18420. function n(e, t) {
  18421. this.chunks = [],
  18422. this.floorId = e,
  18423. this.roomId = t,
  18424. this.position = new l.Vector3
  18425. }
  18426. var l = e("three");
  18427. n.prototype.addChunk = function(e) {
  18428. this.chunks.push(e)
  18429. }
  18430. ,
  18431. n.prototype.calcBoundaries = function() {
  18432. 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++) {
  18433. var a = this.chunks[o].geometry.attributes.position;
  18434. if (a)
  18435. for (var s = 0; s < a.array.length; s += 3)
  18436. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18437. t.add(e),
  18438. 0 === s ? (i.copy(e),
  18439. n.copy(e)) : (i.max(e),
  18440. n.min(e)),
  18441. r++
  18442. }
  18443. 0 < r ? (t.multiplyScalar(1 / r),
  18444. this.average = t) : this.average = null,
  18445. this.boundsMax = i,
  18446. this.boundsMin = n,
  18447. this.center = new l.Vector3,
  18448. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18449. }
  18450. ,
  18451. t.exports = n
  18452. }
  18453. , {
  18454. three: 217
  18455. }],
  18456. 151: [function(o, v, e) {
  18457. (function(e) {
  18458. "use strict";
  18459. function t(e, t, i) {
  18460. this.obj3d = null,
  18461. this.nodes = [],
  18462. this.colorHull = [],
  18463. this.shortPaths = {},
  18464. this.floorHull = null,
  18465. this.cameraHull = null,
  18466. this.floorPathDistance = 0,
  18467. this.floorCurvePoints = null,
  18468. this.floorCurveColors = null,
  18469. this.camCurvePoints = null,
  18470. this.warpDestHeroLoc = null,
  18471. this.warpDestPano = null,
  18472. this.warpPathPoints = null,
  18473. this.warpPathLengths = [0],
  18474. this.warpLength = 0,
  18475. this.closeWarpDistance = 4,
  18476. this.UP = U.UP.clone(),
  18477. this.longestStep = 0,
  18478. this.upcomingTransType = null,
  18479. this.burnsDir = 1,
  18480. this.prevNextDist = 0,
  18481. this.nextI = 0,
  18482. this.activeTransType = null,
  18483. this.lastTransType = null,
  18484. this.bunnyObj = null,
  18485. this.director = e,
  18486. this.player = t,
  18487. this.playerControls = i,
  18488. this.modelManager = t.modelManager,
  18489. this.updateModel(),
  18490. this.updateDefaultsFromModelData(),
  18491. this.bindEvents(),
  18492. this.warping = !1,
  18493. this.waitingToWarp = !1,
  18494. this.warpInterrupted = !1,
  18495. this.warpInterruptionBlackoutStyle = null,
  18496. this.warpInterruptionTravelTime = null
  18497. }
  18498. 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"),
  18499. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18500. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18501. 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"),
  18502. pathEnd: n.load("images/End.png"),
  18503. 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==")
  18504. };
  18505. t.prototype.setScene = function(e) {
  18506. this.createCpm(e),
  18507. this.createBunnyObj(e)
  18508. }
  18509. ,
  18510. t.prototype.updateModel = function() {
  18511. this.model = this.modelManager.getActiveModel()
  18512. }
  18513. ,
  18514. t.prototype.bindEvents = function() {
  18515. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18516. }
  18517. ,
  18518. t.prototype.updateDefaultsFromModelData = function() {
  18519. this.model.data
  18520. }
  18521. ,
  18522. t.prototype.pointPathDistance = function(e) {
  18523. for (var t = 0, i = 1; i < e.length; i += 1)
  18524. t += e[i - 1].distanceTo(e[i]);
  18525. return t
  18526. }
  18527. ,
  18528. t.prototype.pointPathLengths = function(e) {
  18529. for (var t = [0], i = 1; i < e.length; i += 1)
  18530. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18531. return t
  18532. }
  18533. ,
  18534. t.prototype.interpAlongPath = function(e, t, i) {
  18535. var n, r = new P.Vector3, o = t[t.length - 1];
  18536. if (i < 1) {
  18537. n = i * o;
  18538. for (var a = 1; a < t.length; a += 1)
  18539. if (t[a] > n) {
  18540. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18541. return r.copy(e[a]),
  18542. r.sub(e[a - 1]),
  18543. r.multiplyScalar(s),
  18544. r.add(e[a - 1]),
  18545. r
  18546. }
  18547. } else
  18548. r.copy(e[e.length - 1]);
  18549. return r
  18550. }
  18551. ,
  18552. t.prototype.pathHeight = function() {
  18553. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18554. }
  18555. ,
  18556. t.prototype.createBunnyObj = function(e) {
  18557. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18558. this.bunnyObj.visible = D.warp.showBunny),
  18559. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18560. e.add(this.bunnyObj)
  18561. }
  18562. ,
  18563. t.prototype.createCpm = function(e) {
  18564. if (!this.currentPanoMarker) {
  18565. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18566. t.material.uniforms.opacity.value = 0,
  18567. this.currentPanoMarker = {
  18568. mesh: t,
  18569. placed: !1
  18570. }
  18571. }
  18572. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18573. this.placeCpm(),
  18574. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18575. }
  18576. ,
  18577. t.prototype.placeCpm = function() {
  18578. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18579. var e = this.player.currentPano.floor;
  18580. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18581. e.add(this.currentPanoMarker.mesh)),
  18582. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18583. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18584. this.currentPanoMarker.placed = !0
  18585. } else
  18586. this.popOutCpm()
  18587. }
  18588. ,
  18589. t.prototype.fadeInCpm = function(e) {
  18590. 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)
  18591. }
  18592. ,
  18593. t.prototype.fadeOutCpm = function(e) {
  18594. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18595. }
  18596. ,
  18597. t.prototype.popInCpm = function() {
  18598. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18599. }
  18600. ,
  18601. t.prototype.popOutCpm = function() {
  18602. this.fadeOutCpm(2)
  18603. }
  18604. ,
  18605. t.prototype.brushPrefs = {
  18606. linewidth: 7,
  18607. strokeWidth: 15,
  18608. cvSegments: 48,
  18609. paveStep: .1,
  18610. paveWidth: .2,
  18611. lookBlendDist: 3,
  18612. maxTurn: P.Math.degToRad(2)
  18613. },
  18614. t.prototype.panoPathDistance = function(e) {
  18615. var t = this.model.panos;
  18616. if (!e || e.length < 2)
  18617. return 0;
  18618. for (var i = [], n = 0; n < e.length; n += 1)
  18619. i.push(t.get(e[n]).floorPosition);
  18620. return this.pointPathDistance(i)
  18621. }
  18622. ,
  18623. t.prototype.loadTileTexture = function(t) {
  18624. var e = n.load(t, function(e) {
  18625. e.wrapS = P.RepeatWrapping,
  18626. e.wrapT = P.RepeatWrapping,
  18627. e.needsUpdate = !0,
  18628. H.debug('path texture "' + t + '" is ready')
  18629. }, function() {
  18630. H.error('path texture "' + t + '" failed')
  18631. });
  18632. return e.mapping = P.UVMapping,
  18633. e
  18634. }
  18635. ,
  18636. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18637. return new l({
  18638. cameraMode: n,
  18639. position: e,
  18640. quaternion: t,
  18641. panoId: i,
  18642. orthoZoom: o,
  18643. floorVisibility: r,
  18644. thumbUrl: null,
  18645. name: null
  18646. })
  18647. }
  18648. ,
  18649. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18650. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18651. }
  18652. ,
  18653. t.prototype.setWarpDestination = function(e) {
  18654. this.warpDestHeroLoc = e
  18655. }
  18656. ,
  18657. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18658. var t = this.getHeroDescriptorByHeroIndex(e);
  18659. return null !== t && (this.setWarpDestination(t),
  18660. !0)
  18661. }
  18662. ,
  18663. t.prototype.setWarpDestinationByPano = function(e, t) {
  18664. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18665. }
  18666. ,
  18667. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18668. var i = this.model.panos.get(e);
  18669. if (i) {
  18670. t = t || new P.Quaternion;
  18671. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18672. return this.setWarpDestination(n),
  18673. !0
  18674. }
  18675. return !1
  18676. }
  18677. ,
  18678. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18679. var t = this.model.heroCount();
  18680. if (null !== this.warpDestHeroLoc && t < 1)
  18681. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18682. this.model.getHeroDescriptorByIndex(0);
  18683. var i = this.model.getHeroDescriptorByIndex(e);
  18684. if (i) {
  18685. var n = i.isPano() ? i.panoId : i.cameraMode;
  18686. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18687. }
  18688. return i
  18689. }
  18690. ,
  18691. t.prototype.getHeroDescriptorByPano = function(e) {
  18692. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18693. }
  18694. ,
  18695. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18696. var t = this.getHeroIndexFromPanoId(e);
  18697. return this.getHeroDescriptorByHeroIndex(t)
  18698. }
  18699. ,
  18700. t.prototype.getHeroIndexFromPanoId = function(e) {
  18701. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18702. var i = this.model.heroLocations[t]
  18703. , n = this.getHeroId(i);
  18704. if (n && n === e)
  18705. return t
  18706. }
  18707. return -1
  18708. }
  18709. ,
  18710. t.prototype.getHeroPano = function(e) {
  18711. if (null === e)
  18712. return H.warn("getHeroPano(): no destination"),
  18713. null;
  18714. var t = this.getHeroId(e)
  18715. , i = this.model.panos.get(t);
  18716. return void 0 === i && (i = null,
  18717. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18718. i
  18719. }
  18720. ,
  18721. t.prototype.getHeroId = function(e) {
  18722. return e.panoId
  18723. }
  18724. ,
  18725. t.prototype.setWarpDestPano = function() {
  18726. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18727. this.warpDestPano
  18728. }
  18729. ,
  18730. t.prototype.brushToWarpPano = function(e, t) {
  18731. if (this.discardPathObject(),
  18732. !this.setWarpDestPano())
  18733. return !1;
  18734. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18735. !this.warpDestPano)
  18736. return H.info("No brush"),
  18737. !1;
  18738. if (!this.player.currentPano)
  18739. return H.debug("No current pano, visibility undefined"),
  18740. !1;
  18741. if (!this.warpDestPano)
  18742. return H.info("No wPano, visibility undefined"),
  18743. !1;
  18744. if (!this.warpDestPano.isAligned())
  18745. return H.debug("Cannot brush to unaligned pano"),
  18746. !1;
  18747. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18748. , n = !0;
  18749. if (this.player.currentPano.id === this.warpDestPano.id)
  18750. H.debug("Already at destination pano");
  18751. else {
  18752. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18753. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18754. this.obj3d = new P.Object3D,
  18755. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18756. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18757. e = t) : (this.setPathHulls(this.nodes),
  18758. this.setFloorCurves(),
  18759. 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)))),
  18760. this.player.currentPano.floor.add(this.obj3d);
  18761. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18762. , o = e === L.STD;
  18763. if (!n && (i || o)) {
  18764. if (r) {
  18765. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18766. this.obj3d.add(a)
  18767. }
  18768. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18769. this.obj3d.add(s)
  18770. }
  18771. this.appearSlow()
  18772. }
  18773. return this.upcomingTransType = e,
  18774. !n
  18775. }
  18776. ,
  18777. t.prototype.findShortestPath = function(e, t) {
  18778. if (!e || !t)
  18779. return null;
  18780. var i = D.warp.walkExtraPanosDistance
  18781. , n = e.id + ":" + t.id + ":" + i;
  18782. if (this.shortPaths.hasOwnProperty(n))
  18783. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18784. var r = t.id + ":" + e.id + ":" + i;
  18785. if (this.shortPaths.hasOwnProperty(r))
  18786. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18787. var o = this.model.panos.aStarSearch(e, t);
  18788. return this.model.panos.includeNodesNearPath(o, i),
  18789. this.shortPaths[n] = o ? o.slice() : null,
  18790. o
  18791. }
  18792. ,
  18793. t.prototype.makePathHulls = function(e) {
  18794. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18795. r = (t = h.get(e[0])).floor.floorIndex;
  18796. for (var u = 0; u < e.length; u += 1)
  18797. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18798. s.push(i),
  18799. l.push(t.position.clone()),
  18800. n = t.floor.floorIndex,
  18801. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18802. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18803. return a > this.longestStep && (this.longestStep = a,
  18804. H.debug("path contains " + a + " meter segment")),
  18805. {
  18806. floor: s,
  18807. camera: l,
  18808. color: c
  18809. }
  18810. }
  18811. ,
  18812. t.prototype.makeFloorCurves = function(e, t, i) {
  18813. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18814. , r = this.pointPathDistance(e) - 2 * n
  18815. , o = e.slice(0)
  18816. , a = o[1].clone().sub(o[0]);
  18817. a.y = 0,
  18818. a.normalize().multiplyScalar(n),
  18819. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18820. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18821. a.normalize().multiplyScalar(n),
  18822. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18823. var s = new P.CatmullRomCurve3(o)
  18824. , l = Math.floor(r / i);
  18825. l = 4 * Math.floor(l / 4),
  18826. l = Math.max(4, l);
  18827. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18828. h = 0,
  18829. c = u[f].distanceTo(e[0]);
  18830. for (var g = 1; g < e.length; g += 1)
  18831. p.copy(u[f]).sub(e[g]),
  18832. p.y *= 4,
  18833. p.length() < c && (h = g);
  18834. d.push(t[h])
  18835. }
  18836. return {
  18837. distance: r,
  18838. points: u,
  18839. colors: d
  18840. }
  18841. }
  18842. ,
  18843. t.prototype.makeCameraCurvePoints = function(e, t) {
  18844. var i = this.pointPathDistance(e);
  18845. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18846. }
  18847. ,
  18848. t.prototype.makeCameraCurveTangents = function(e, t) {
  18849. var i = this.pointPathDistance(e)
  18850. , n = new P.CatmullRomCurve3(e)
  18851. , r = Math.max(2, Math.floor(i / t));
  18852. r = r || 5;
  18853. for (var o = [], a = 0; a <= r; a++)
  18854. o.push(n.getTangentAt(a / r));
  18855. return o
  18856. }
  18857. ,
  18858. t.prototype.setPathHulls = function(e) {
  18859. var t = this.makePathHulls(e);
  18860. this.floorHull = t.floor,
  18861. this.cameraHull = t.camera,
  18862. this.colorHull = t.color
  18863. }
  18864. ,
  18865. t.prototype.setFloorCurves = function() {
  18866. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18867. this.floorPathDistance = e.distance,
  18868. this.floorCurvePoints = e.points,
  18869. this.floorCurveColors = e.colors
  18870. }
  18871. ,
  18872. t.prototype.setCameraCurvePoints = function() {
  18873. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18874. }
  18875. ,
  18876. t.prototype.chooseWarpPath = function(e) {
  18877. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18878. if (this.player.currentPano === this.warpDestPano || !e)
  18879. return this.warpPathPoints = null,
  18880. this.warpLength = 0,
  18881. !1;
  18882. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18883. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18884. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18885. t.multiplyScalar(.15).add(r.position),
  18886. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18887. t.y = r.position.y,
  18888. i.y = this.warpDestPano.position.y,
  18889. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18890. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18891. this.setCameraCurvePoints(),
  18892. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18893. this.warpLength = 0,
  18894. this.warpPathLengths = [0];
  18895. 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) {
  18896. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18897. var h = o.length();
  18898. o.y *= D.warp.climbEffort;
  18899. var u = o.length() / h;
  18900. if (1 < c) {
  18901. o.setY(0).normalize(),
  18902. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18903. var d = Math.min(1, o.dot(a))
  18904. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18905. u = Math.max(p, u)
  18906. }
  18907. this.warpLength += h * u,
  18908. this.warpPathLengths[c] = this.warpLength
  18909. }
  18910. return !0
  18911. }
  18912. ,
  18913. t.prototype.drawPathRibbon = function(e, t) {
  18914. this.bunnyObj.visible = D.warp.showBunny;
  18915. 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) {
  18916. a.copy(e[s]),
  18917. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18918. a.normalize(),
  18919. n.crossVectors(a, U.UP),
  18920. n.multiplyScalar(i);
  18921. var l = (new P.Vector3).copy(e[s]).add(r);
  18922. l.sub(n),
  18923. o.vertices.push(l),
  18924. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18925. o.vertices.push(l)
  18926. }
  18927. var c, h, u, d = 0;
  18928. for (s = 0; s < e.length - 1; s += 1) {
  18929. var p = 2 * s
  18930. , f = d
  18931. , g = d += e[s + 1].distanceTo(e[s])
  18932. , m = t[s]
  18933. , v = t[s + 1];
  18934. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18935. o.faces.push(c),
  18936. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18937. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18938. o.faces.push(c),
  18939. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18940. }
  18941. o.computeFaceNormals(),
  18942. o.computeVertexNormals(),
  18943. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18944. u.opacity.value = 0,
  18945. u.color.value.set(D.path.color),
  18946. new P.RawShaderMaterial({
  18947. side: P.DoubleSide,
  18948. depthWrite: !1,
  18949. transparent: !0,
  18950. vertexShader: C.ribbon.vertexShader,
  18951. fragmentShader: C.ribbon.fragmentShader,
  18952. uniforms: u,
  18953. name: "ribbonT",
  18954. opacity: 0
  18955. })) : new P.MeshBasicMaterial({
  18956. color: 16777215,
  18957. side: P.DoubleSide,
  18958. name: "ribbonOut",
  18959. vertexColors: P.VertexColors
  18960. });
  18961. var y = new P.Mesh(o,h);
  18962. return y.name = "ribbon",
  18963. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  18964. y
  18965. }
  18966. ,
  18967. t.prototype.drawPathPavement = function(e) {
  18968. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  18969. r.copy(e[o]),
  18970. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  18971. r.normalize(),
  18972. i.crossVectors(r, U.UP),
  18973. i.multiplyScalar(this.brushPrefs.paveWidth),
  18974. (t = (new P.Vector3).copy(e[o])).sub(i),
  18975. n.vertices.push(t),
  18976. n.vertices.push((new P.Vector3).copy(e[o])),
  18977. (t = (new P.Vector3).copy(e[o])).add(i),
  18978. n.vertices.push(t);
  18979. var a, s, l;
  18980. for (o = 0; o < e.length - 1; o += 1)
  18981. a = 3 * o + 1,
  18982. l = .25 + (s = .25 * o),
  18983. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  18984. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  18985. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  18986. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  18987. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  18988. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  18989. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  18990. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  18991. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  18992. color: D.path.color,
  18993. side: P.DoubleSide,
  18994. transparent: !0,
  18995. depthWrite: !1,
  18996. opacity: 0,
  18997. name: "paveT",
  18998. map: I.path
  18999. }) : new P.MeshBasicMaterial({
  19000. color: D.path.color,
  19001. side: P.DoubleSide,
  19002. transparent: !0,
  19003. depthWrite: !1,
  19004. opacity: 1,
  19005. name: "paveO",
  19006. map: I.path
  19007. });
  19008. return new P.Mesh(n,c)
  19009. }
  19010. ,
  19011. t.prototype.hintPrefs = {
  19012. rad: .18,
  19013. width: .0125,
  19014. depth: .0625,
  19015. setBack: -.04,
  19016. markRad: .25,
  19017. markInnerRad: .16
  19018. },
  19019. t.prototype.makeWaypointObj = function(e, t) {
  19020. var i = new P.Geometry
  19021. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19022. , r = this.pathHeight();
  19023. 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)),
  19024. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19025. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19026. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19027. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19028. o.map.value = e,
  19029. o.opacity.value = 0,
  19030. o.color.value.set(D.path.color);
  19031. var a = {
  19032. side: P.DoubleSide,
  19033. depthWrite: !1,
  19034. transparent: !0,
  19035. vertexShader: C.waypoint.vertexShader,
  19036. fragmentShader: C.waypoint.fragmentShader,
  19037. uniforms: o,
  19038. name: "waypoint",
  19039. opacity: 0
  19040. };
  19041. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19042. a.name = "wayPtOut");
  19043. var s = new P.RawShaderMaterial(a)
  19044. , l = new P.Mesh(i,s);
  19045. return l.name = t,
  19046. l
  19047. }
  19048. ,
  19049. t.prototype.makeStartMarker = function(e, t) {
  19050. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19051. i.y = 0,
  19052. i.normalize();
  19053. var n = Math.acos(i.x)
  19054. , r = this.makeWaypointObj(I.pathStart, "Start");
  19055. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19056. r.position.copy(e),
  19057. r
  19058. }
  19059. ,
  19060. t.prototype.makeEndMarker = function(e) {
  19061. var t = this.makeWaypointObj(I.pathEnd, "End")
  19062. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19063. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19064. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19065. t.position.copy(e),
  19066. t
  19067. }
  19068. ,
  19069. t.prototype.pathClean = function(e) {
  19070. if (e) {
  19071. for (var t in e.children)
  19072. this.pathClean(e.children[t]);
  19073. e.geometry && e.geometry.dispose(),
  19074. e.material && e.material.dispose()
  19075. }
  19076. }
  19077. ,
  19078. t.prototype.discardPathObject = function() {
  19079. if (this.obj3d) {
  19080. var e = this.obj3d.parent;
  19081. e && e.remove(this.obj3d),
  19082. this.pathClean(this.obj3d)
  19083. }
  19084. this.obj3d = null,
  19085. this.popInCpm()
  19086. }
  19087. ,
  19088. t.prototype.discardSlow = function() {
  19089. if (this.obj3d) {
  19090. if (this.player.mode !== O.PANORAMA)
  19091. return void this.discardPathObject();
  19092. for (var e, t = 0, i = function() {
  19093. this.discardPathObject()
  19094. }
  19095. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19096. 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]),
  19097. t += 1,
  19098. i = null);
  19099. 0 === t && this.discardPathObject(),
  19100. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19101. }
  19102. }
  19103. ,
  19104. t.prototype.appearSlow = function() {
  19105. var e;
  19106. this.fadeOutCpm(D.path.fadeInTime);
  19107. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19108. 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]))
  19109. }
  19110. ,
  19111. t.prototype.update = function() {
  19112. this.obj3d && this.obj3d.updateMatrixWorld()
  19113. }
  19114. ,
  19115. t.prototype.calcBurnsAmount = function(e) {
  19116. var n = P.Math.degToRad(D.warp.burnsAngle);
  19117. if (this.player.mode !== O.PANORAMA)
  19118. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19119. var t = this.burnsDir * n;
  19120. if (this.upcomingTransType === L.BLACK)
  19121. return t;
  19122. var i = e;
  19123. if (null === i)
  19124. return H.warn("Transition request for non-highlight"),
  19125. t;
  19126. var r = this.getHeroDescriptorByHeroIndex(i);
  19127. if (null === r)
  19128. return t;
  19129. if (!r.isPano())
  19130. return t;
  19131. function o(e) {
  19132. var t = Math.acos(Math.min(1, e.dot(l)))
  19133. , i = (new P.Vector3).crossVectors(l, e);
  19134. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19135. }
  19136. var a = this.getHeroPano(r)
  19137. , s = this.playerControls.cameras[O.PANORAMA]
  19138. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19139. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19140. if (a === this.player.currentPano)
  19141. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19142. var h = this.findShortestPath(this.player.currentPano, a);
  19143. if (null == h || h.length < 1)
  19144. return H.debug("Empty path ahead..."),
  19145. t;
  19146. var u = this.makePathHulls(h)
  19147. , d = new P.CatmullRomCurve3(u.camera)
  19148. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19149. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19150. }
  19151. ,
  19152. t.prototype.waitNextStep = function(e, t, i) {
  19153. var o = null == i ? D.warp.tourStepDelay : i;
  19154. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19155. var a = new P.Euler
  19156. , s = new P.Vector3;
  19157. H.debug("Starting wait: " + (void 0 !== t));
  19158. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  19159. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19160. , c = function() {
  19161. this.endWarpState(),
  19162. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19163. t && t()
  19164. }
  19165. .bind(this)
  19166. , n = function(e, t) {
  19167. if (this.warpInterrupted)
  19168. return c(),
  19169. !0;
  19170. var i = t || 1e3 / 60;
  19171. if (D.warp.doBurns && !currentLocation.dontRot )
  19172. if (this.player.mode === O.PANORAMA) {
  19173. var n = this.playerControls.cameras[O.PANORAMA];
  19174. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19175. var r = o == 0 ? l : i * l / o;
  19176. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19177. a.y += r,
  19178. s.set(0, 0, -1),
  19179. s.applyEuler(a),
  19180. s.add(n.position),
  19181. n.controls.lookAt(s),
  19182. n.controls.lookVector.copy(s),
  19183. n.lookAt(s)
  19184. } else
  19185. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19186. }
  19187. .bind(this);
  19188. this.startWarpState(),
  19189. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19190. }
  19191. ,
  19192. t.prototype.warpToNonPano = function(e) {
  19193. if (this.discardPathObject(),
  19194. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19195. var t = function() {
  19196. e && e()
  19197. }
  19198. .bind(this);
  19199. this.player.flyToNewMode({
  19200. mode: this.warpDestHeroLoc.cameraMode,
  19201. duration: D.warp.outsideTime,
  19202. warpDest: this.warpDestHeroLoc,
  19203. callback: t,
  19204. force: !0
  19205. })
  19206. } else
  19207. H.warn("no warp destination!!!"),
  19208. e && e()
  19209. }
  19210. ,
  19211. t.prototype._resetWarpShaderParams = function(e) {
  19212. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19213. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19214. }
  19215. ,
  19216. t.prototype._clearWarpShading = function() {
  19217. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19218. this._resetWarpShaderParams(e[t]),
  19219. e[t].visible = !0;
  19220. this._resetWarpShaderParams(this.model.skybox)
  19221. }
  19222. ,
  19223. t.prototype._warpStopFlying = function() {
  19224. this.activeTransType = null,
  19225. this.placeCpm()
  19226. }
  19227. ,
  19228. t.prototype._wrapupTravelOnlyBits = function() {
  19229. this._warpStopFlying(),
  19230. this.warpPathPoints && (this.player.currentPano.exit(),
  19231. this.warpDestPano.enter(),
  19232. this.player.currentPano = this.warpDestPano),
  19233. this.player.spider.draw(),
  19234. this.placeCpm()
  19235. }
  19236. ,
  19237. t.prototype._wrapupTravel = function(e) {
  19238. this._wrapupTravelOnlyBits(),
  19239. this.warpCameraAim(e)
  19240. }
  19241. ,
  19242. t.prototype._wrapupWarpShading = function(e) {
  19243. this._clearWarpShading(),
  19244. this._wrapupTravel(e)
  19245. }
  19246. ,
  19247. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19248. t !== z.END && this._clearWarpShading(),
  19249. this._wrapupTravelOnlyBits(),
  19250. this.upcomingTransType = null,
  19251. e && e()
  19252. }
  19253. ,
  19254. t.prototype._warpCameraAim = function(e, t) {
  19255. var i = this.warpDestHeroLoc.quaternion
  19256. , n = this.playerControls.cameras[O.PANORAMA]
  19257. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19258. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19259. , a = P.Math.radToDeg(Math.acos(o))
  19260. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19261. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19262. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19263. c.y = N.constrainedTurn(c.y),
  19264. this.burnsDir = Math.sign(c.y);
  19265. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19266. , u = new P.Vector3
  19267. , d = function(e, t) {
  19268. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19269. h.y = l.y + e * c.y,
  19270. h.z = l.z + e * c.z,
  19271. u.set(0, 0, -1),
  19272. u.applyEuler(h),
  19273. u.add(n.position),
  19274. n.controls.lookAt(u),
  19275. n.controls.lookVector.copy(u),
  19276. void n.lookAt(u))
  19277. }
  19278. .bind(this);
  19279. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19280. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19281. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19282. )
  19283. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19284. void (t && t())) */
  19285. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19286. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19287. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19288. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19289. void (t && t()))
  19290. }
  19291. ,
  19292. t.prototype._warpBendAim = function(e, t, i, n) {
  19293. var r = n || 0
  19294. , o = this.playerControls.cameras[O.PANORAMA]
  19295. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19296. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19297. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19298. l.y = N.constrainedTurn(l.y);
  19299. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19300. l.x = c * Math.sign(l.x),
  19301. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19302. this.burnsDir = Math.sign(l.y),
  19303. c *= Math.sign(l.y),
  19304. l.y = c;
  19305. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19306. , u = new P.Vector3
  19307. , d = function(e, t) {
  19308. if (e < .5)
  19309. h.x = s.x + e * l.x,
  19310. h.y = s.y + e * l.y,
  19311. h.z = s.z + e * l.z;
  19312. else {
  19313. var i = (1 - e) * D.warp.softBendEnd;
  19314. h.x = a.x - i * l.x,
  19315. h.y = a.y - i * l.y,
  19316. h.z = a.z - i * l.z
  19317. }
  19318. u.set(0, 0, -1),
  19319. u.applyEuler(h),
  19320. u.add(o.position),
  19321. o.controls.lookAt(u),
  19322. o.controls.lookVector.copy(u),
  19323. o.lookAt(u)
  19324. }
  19325. .bind(this);
  19326. if(window.DATA.momentTourBlackNewType){
  19327. d(1)
  19328. }else return V.start(d, t, i, r, B[D.warp.movementEasing])
  19329. }
  19330. ,
  19331. t.prototype._warpStepCameraAim = function(e, t, i) {
  19332. var n = this.playerControls.cameras[O.PANORAMA]
  19333. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19334. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19335. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19336. a.y = N.constrainedTurn(a.y),
  19337. this.burnsDir = Math.sign(a.y);
  19338. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19339. , l = new P.Vector3
  19340. , c = function(e, t) {
  19341. e < .5 ? s.copy(o) : s.copy(r),
  19342. l.set(0, 0, -1),
  19343. l.applyEuler(s),
  19344. l.add(n.position),
  19345. n.controls.lookAt(l),
  19346. n.controls.lookVector.copy(l),
  19347. n.lookAt(l)
  19348. }
  19349. .bind(this);
  19350. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19351. }
  19352. ,
  19353. t.prototype.setBurnsDir = function() {
  19354. var e = this.playerControls.cameras[O.PANORAMA]
  19355. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19356. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19357. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19358. n.y = N.constrainedTurn(n.y),
  19359. this.burnsDir = Math.sign(n.y)
  19360. }
  19361. ,
  19362. t.prototype.stepWarpPath = function(firstPos, e ) {
  19363. var i = this.playerControls.cameras[O.PANORAMA];
  19364. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19365. if (!n){
  19366. return i.position.copy(this.warpDestPano.position),
  19367. !0;
  19368. }
  19369. /* if (!this.warpPathPoints)
  19370. return i.position.copy(this.warpDestPano.position),
  19371. !0;
  19372. var n = this.warpPathPoints[0] */
  19373. var r = this.warpDestPano.position;
  19374. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19375. var o = new P.Vector3;
  19376. 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),
  19377. i.position.copy(o)
  19378. } else
  19379. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19380. }
  19381. ,
  19382. t.prototype.interruptAndFastForward = function(e, t) {
  19383. this.warping && (this.warpInterrupted = !0,
  19384. this.warpInterruptionBlackoutStyle = e,
  19385. this.warpInterruptionTravelTime = t,
  19386. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19387. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19388. }
  19389. ,
  19390. t.prototype.warpCameraAim = function(e) {
  19391. var t = D.warp.minWarpTime;
  19392. if (this.upcomingTransType === L.BLACK)
  19393. t = D.warp.teleportTime;
  19394. else {
  19395. var i = this.playerControls.cameras[O.PANORAMA]
  19396. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19397. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19398. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19399. o.y = N.constrainedTurn(o.y);
  19400. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19401. t = Math.max(t, a)
  19402. }
  19403. var s = function() {
  19404. this._warpStopFlying(),
  19405. this.discardSlow(),
  19406. e && e()
  19407. }
  19408. .bind(this);
  19409. this._warpCameraAim(t, s)
  19410. }
  19411. ,
  19412. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19413. this.model.skybox.material.uniforms.blackout.value = n;
  19414. var r = F.uniform(this.model.skybox, "progress", 1)
  19415. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19416. , a = !1
  19417. , s = function() {
  19418. if (this.warpInterrupted)
  19419. return a = !0
  19420. }
  19421. .bind(this)
  19422. , l = function(e, t) {
  19423. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19424. }
  19425. .bind(this)
  19426. , c = function(e, t) {
  19427. return i && a ? (o(0),
  19428. !0) : void o(e, t)
  19429. }
  19430. .bind(this);
  19431. V.start(s, e, null, t, null, "safeHaltWatch"),
  19432. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19433. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19434. }
  19435. ,
  19436. t.prototype.warpTravel_STD = function(e) {
  19437. 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),
  19438. 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;
  19439. t += this.warpLength * D.warp.timePerMeter,
  19440. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19441. function n(e) {
  19442. var t = i;
  19443. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19444. }
  19445. var y = !1
  19446. , r = this.warpDestHeroLoc.quaternion
  19447. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19448. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19449. , a = A.dot(o)
  19450. , C = P.Math.radToDeg(Math.acos(a))
  19451. , s = function() {
  19452. return m.lookAt(g, l, U.UP),
  19453. u.setFromRotationMatrix(m, D.warp.eOrder),
  19454. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19455. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19456. N.constrainedTurn(v.y)
  19457. }
  19458. .bind(this)
  19459. , I = function(e, t) {
  19460. if (this.warpInterrupted)
  19461. return y = !0
  19462. }
  19463. .bind(this)
  19464. , E = function(e, t) {
  19465. return y || !this.warpPathPoints ? (k.blur(0),
  19466. !0) : void k.blur(e)
  19467. }
  19468. .bind(this)
  19469. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19470. , b = function(e, t) {
  19471. return y || !this.warpPathPoints ? (_(0),
  19472. !0) : void _(e, t)
  19473. }
  19474. .bind(this)
  19475. , w = function(e, t) {
  19476. if (!this.warpPathPoints)
  19477. return h.position.copy(this.warpDestPano.position),
  19478. !0;
  19479. if (y)
  19480. return !0;
  19481. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19482. h.position.copy(i),
  19483. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19484. }
  19485. .bind(this)
  19486. , T = function(e, t) {
  19487. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19488. !0)
  19489. }
  19490. .bind(this)
  19491. , x = function(e, t) {
  19492. if (y)
  19493. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19494. !0;
  19495. if (!this.warpPathPoints)
  19496. return !0;
  19497. var i = this.warpLength * e
  19498. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19499. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19500. D.warp.matchCam && (n *= 1 - r),
  19501. m.lookAt(g, l, U.UP),
  19502. u.setFromRotationMatrix(m, D.warp.eOrder),
  19503. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19504. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19505. v.y = N.constrainedTurn(v.y),
  19506. u.x = p.x + n * v.x,
  19507. u.y = p.y + n * v.y,
  19508. u.z = p.z + n * v.z,
  19509. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19510. v.y = N.constrainedTurn(v.y);
  19511. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19512. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19513. f.x = f.x + v.x * D.warp.turnFriction,
  19514. f.y = f.y + v.y * D.warp.turnFriction,
  19515. f.z = f.z + v.z * D.warp.turnFriction,
  19516. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19517. var a = l.clone().sub(g).normalize();
  19518. if (C < D.warp.maxAimRotation && 0 < r) {
  19519. var s = 1 - r;
  19520. a.x = a.x * s + r * A.x,
  19521. a.y = a.y * s + r * A.y,
  19522. a.z = a.z * s + r * A.z,
  19523. a.normalize()
  19524. }
  19525. this.bunnyObj.position.copy(h.position).add(a),
  19526. d.set(0, 0, -1).applyEuler(f).normalize(),
  19527. d.multiplyScalar(8),
  19528. d.add(h.position),
  19529. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19530. h.controls.lookVector.copy(d),
  19531. h.lookAt(d))
  19532. }
  19533. .bind(this)
  19534. , S = function() {
  19535. y ? (this.discardSlow(),
  19536. this.upcomingTransType = L.BLACK,
  19537. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19538. }
  19539. .bind(this);
  19540. T(0);
  19541. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19542. , R = M / (t += M);
  19543. this.warpCommonParameters(t, R, !0, z.NONE),
  19544. V.start(I, t, null, 0, null, "_haltWatcher"),
  19545. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19546. V.start(E, t, null, R, n, "blurring")),
  19547. V.start(b, t, null, R, n, "modelAlpha"),
  19548. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19549. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19550. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19551. }
  19552. ,
  19553. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19554. var r = e || 0;
  19555. null != t || (t = D.warp.teleportTime)
  19556. //add
  19557. var done = ()=>{
  19558. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19559. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19560. }
  19561. if(window.DATA.momentTourBlackNewType){
  19562. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
  19563. var camera = this.playerControls.cameras['panorama'];
  19564. var end = this.warpDestHeroLoc.position
  19565. camera.position.copy(end)
  19566. setTimeout(()=>{
  19567. player.sceneRenderer.effects.transitionMaskPass.stop()
  19568. this.wrapupWarpShadingOnly(n, i);
  19569. done()
  19570. },t)
  19571. }else{
  19572. var o = function() {
  19573. this.wrapupWarpShadingOnly(n, i);
  19574. done()
  19575. }
  19576. .bind(this);
  19577. var firstPos = this.player.position.clone()//add
  19578. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19579. }
  19580. this.warpCommonParameters(t, r, !1, i)
  19581. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  19582. if(window.DATA.momentTourBlackNewType){
  19583. e.material.uniforms.blackout.value = 5//i 改
  19584. //e.material.defines.newBlack = ''
  19585. //e.material.needsUpdate = true
  19586. }else{
  19587. e.material.uniforms.blackout.value = i
  19588. }
  19589. }),
  19590. this._warpBendAim(null, t, null, r);
  19591. /* this.warpCommonParameters(t, r, !1, i)
  19592. this.model.chunks.forEach(function(e) {
  19593. e.material.uniforms.blackout.value = i
  19594. }),
  19595. this._warpBendAim(null, t, null, r);
  19596. //add
  19597. var done = ()=>{
  19598. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19599. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19600. }
  19601. var o = function() {
  19602. this.wrapupWarpShadingOnly(n, i)
  19603. done()
  19604. }
  19605. .bind(this);
  19606. var firstPos = this.player.position.clone()//add
  19607. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19608. */
  19609. }
  19610. ,
  19611. t.prototype.flightStepWalk = (a = new P.Vector3,
  19612. s = new P.Vector3,
  19613. function(e, t, i) {
  19614. if (this.warpInterrupted)
  19615. i && i();
  19616. else if (this.activeTransType !== L.WALK)
  19617. this._clearWarpShading(),
  19618. this._warpStopFlying(),
  19619. this.player.spider.draw(),
  19620. this.placeCpm(),
  19621. i && i();
  19622. else if (this.player.currentPano !== e) {
  19623. var n = {
  19624. pano: e,
  19625. lookAtPoint: t,
  19626. duration: null,
  19627. maxDistanceOverride: D.warp.walkMaxDist,
  19628. skipWarpingCheck: !1,
  19629. constantMoveSpeed: !0
  19630. };
  19631. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  19632. n.zoomLevel = this.warpDestHeroLoc.zoom
  19633. }
  19634. n.duration = function(e, t) {
  19635. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19636. s.copy(U.FORWARD),
  19637. this.player.getDirection(s),
  19638. a.copy(t).sub(e.position).normalize();
  19639. var n = a.dot(s)
  19640. , r = Math.acos(n)
  19641. , o = r / i;
  19642. .001 < o && (i *= o / .001, //-----这是什么????
  19643. r < 1 && (i *= 1.2))
  19644. return i / DATA.tourWalkSpeed * 100
  19645. }
  19646. .call(this, e, t),
  19647. this.player.nonInterruptingFlyToPano(n, i)
  19648. } else
  19649. i && i()
  19650. }
  19651. ),
  19652. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19653. return this.flightStepWalk.bind(this, e, t, i)
  19654. }
  19655. ,
  19656. t.prototype.warpTravel_WALK = (f = [],
  19657. function(e) {
  19658. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19659. var o = this.nodes[r]
  19660. , a = t.get(o);
  19661. this.nodes.length,
  19662. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19663. i && n || (f.push(o),
  19664. i = a)
  19665. }
  19666. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19667. var s = f.length
  19668. , l = t.get(f[s - 1])
  19669. , c = new Array(s + 1);
  19670. c[c.length - 1] = function() {
  19671. e && e()
  19672. }
  19673. .bind(this);
  19674. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19675. var d = f[h];
  19676. l = t.get(d);
  19677. var p = new P.Vector3;
  19678. this.getLookAtForWalkingTourNode(f, h, p),
  19679. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19680. h--
  19681. }
  19682. c[0]()
  19683. }
  19684. ),
  19685. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19686. h = new P.Vector3,
  19687. u = new P.Vector3,
  19688. d = new P.Vector3,
  19689. p = new P.Vector3,
  19690. function(e, t, i) {
  19691. var n = e.length;
  19692. if (n <= t)
  19693. return !1;
  19694. var r = 1
  19695. , o = 1;
  19696. h.set(0, 0, 0),
  19697. p.set(0, 0, 0);
  19698. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19699. if (a = this.player.model.panos.get(e[s]),
  19700. this.getOrientationForWalkingTourNode(e, s, u),
  19701. s === t && c.copy(u),
  19702. d.copy(u),
  19703. t < s) {
  19704. var l = d.dot(c) < .65;
  19705. r *= l ? .2 : .75,
  19706. o *= l ? .2 : .4
  19707. }
  19708. u.multiplyScalar(r),
  19709. h.add(u),
  19710. p.lerp(a.position, o)
  19711. }
  19712. return h.normalize(),
  19713. i.copy(p),
  19714. i.add(h),
  19715. !0
  19716. }
  19717. ),
  19718. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19719. var n = e.length;
  19720. if (n <= t)
  19721. return !1;
  19722. if (t === n - 1)
  19723. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19724. else {
  19725. var r = this.player.model.panos.get(e[t])
  19726. , o = this.player.model.panos.get(e[t + 1]);
  19727. i.copy(o.position).sub(r.position)
  19728. }
  19729. return i.normalize(),
  19730. !0
  19731. }
  19732. ,
  19733. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19734. if (this.activeTransType = this.upcomingTransType,
  19735. this.lastTransType = this.activeTransType,
  19736. this.upcomingTransType = null,
  19737. e)
  19738. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19739. this._clearWarpShading(),
  19740. this._warpStopFlying(),
  19741. this.player.spider.draw(),
  19742. this.placeCpm(),
  19743. n && n()
  19744. }
  19745. .bind(this)) : this.warpTravel_STD(n);
  19746. else {
  19747. var r = function() {
  19748. this._wrapupTravel(n)
  19749. }
  19750. .bind(this)
  19751. , o = {
  19752. pano: this.warpDestPano,
  19753. lookAtPoint: null,
  19754. duration: null,
  19755. maxDistanceOverride: null,
  19756. skipWarpingCheck: !1
  19757. };
  19758. this.player.flyToPano(o, r)
  19759. }
  19760. }
  19761. ,
  19762. t.prototype.startWarpState = function() {
  19763. this.warping = !0,
  19764. this.warpInterrupted = !1,
  19765. this.warpInterruptionBlackoutStyle = null,
  19766. this.warpInterruptionTravelTime = null
  19767. }
  19768. ,
  19769. t.prototype.endWarpState = function() {
  19770. this.warping = !1
  19771. }
  19772. ,
  19773. t.prototype.warpToPano = function(e, t, i, n) {
  19774. if (this.warping)
  19775. H.warn("Cannot warp when already warping");
  19776. else {
  19777. if (this.upcomingTransType = e,
  19778. this.activeTransType = null,
  19779. !this.setWarpDestPano())
  19780. return this.upcomingTransType = null,
  19781. void this.warpToNonPano(n);
  19782. if (this.player.mode !== O.PANORAMA)
  19783. return this.upcomingTransType = null,
  19784. this.discardSlow(),
  19785. void this.player.flyToNewMode({
  19786. mode: O.PANORAMA,
  19787. pano: this.warpDestPano,
  19788. duration: D.warp.outsideTime,
  19789. warpDest: this.warpDestHeroLoc,
  19790. callback: n,
  19791. force: !0
  19792. });
  19793. if (!this.warpDestPano)
  19794. return H.warn("no warp destination, callback dropped"),
  19795. void (this.upcomingTransType = null);
  19796. 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)
  19797. , o = this.chooseWarpPath(r);
  19798. if (o && this.upcomingTransType !== L.WALK) {
  19799. var a = function() {
  19800. this.waitingToWarp = !1,
  19801. this.warpToPano(e, t, i, n)
  19802. }
  19803. .bind(this);
  19804. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19805. return void (this.waitingToWarp = !0)
  19806. }
  19807. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19808. this.player.currentPano = this.warpDestPano,
  19809. this.placeCpm(),
  19810. this.fadeOutCpm(D.path.fadeOutTime),
  19811. this.player.spider.draw()),
  19812. H.debug("Warping to pano ", this.warpDestPano.position),
  19813. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19814. this.startWarpState();
  19815. var s = function() {
  19816. this.endWarpState(),
  19817. n && n()
  19818. }
  19819. .bind(this);
  19820. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19821. }
  19822. }
  19823. ,
  19824. v.exports = t
  19825. }
  19826. ).call(this, "/js/objects/ShowPath.js")
  19827. }
  19828. , {
  19829. "../constants": 8,
  19830. "../effects": 16,
  19831. "../enum/BlackoutStyle": 18,
  19832. "../enum/ModelManagerEvents": 33,
  19833. "../enum/PlayerEvents": 40,
  19834. "../enum/RenderOrder": 42,
  19835. "../enum/Vectors": 50,
  19836. "../enum/Viewmode": 51,
  19837. "../enum/WarpStyle": 52,
  19838. "../gui/gui": 65,
  19839. "../model/ModelManager": 140,
  19840. "../objects/Snapshot": 153,
  19841. "../settings": 166,
  19842. "../shaders": 167,
  19843. "../util/easing": 186,
  19844. "../util/lerp": 188,
  19845. "../util/logger": 189,
  19846. "../util/math": 190,
  19847. "../util/texture": 194,
  19848. "../util/transitions": 195,
  19849. three: 217
  19850. }],
  19851. 152: [function(e, t, i) {
  19852. "use strict";
  19853. function n() {
  19854. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19855. , t = new r.RawShaderMaterial({
  19856. fragmentShader: o.skysphere.fragmentShader,
  19857. vertexShader: o.skysphere.vertexShader,
  19858. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19859. side: r.BackSide,
  19860. name: "skysphere"
  19861. });
  19862. t.uniforms.radius.value = e.parameters.radius,
  19863. r.Mesh.call(this, e, t)
  19864. }
  19865. var r = e("three")
  19866. , o = e("../shaders")
  19867. , a = e("../settings");
  19868. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19869. t.exports = n
  19870. }
  19871. , {
  19872. "../settings": 166,
  19873. "../shaders": 167,
  19874. three: 217
  19875. }],
  19876. 153: [function(r, o, e) {
  19877. (function(e) {
  19878. "use strict";
  19879. function t(e) {
  19880. n.call(this, e),
  19881. this.sid = e.sid,
  19882. this.panoId = e.panoId,
  19883. this.orthoZoom = e.orthoZoom,
  19884. this.floorVisibility = e.floorVisibility,
  19885. this.thumbUrl = e.thumbUrl,
  19886. this.name = e.name,
  19887. this.zoom = e.zoom
  19888. }
  19889. var i = (r("three"),
  19890. r("../util/logger"))
  19891. , n = (r("../settings"),
  19892. r("../enum/Viewmode"),
  19893. r("../util/common"),
  19894. r("../util/transitions"),
  19895. r("../util/lerp"),
  19896. r("../util/ajax"),
  19897. r("../util/texture"),
  19898. r("./View"));
  19899. r("events").EventEmitter,
  19900. new i(e),
  19901. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19902. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19903. }
  19904. ,
  19905. o.exports = t
  19906. }
  19907. ).call(this, "/js/objects/Snapshot.js")
  19908. }
  19909. , {
  19910. "../enum/Viewmode": 51,
  19911. "../settings": 166,
  19912. "../util/ajax": 181,
  19913. "../util/common": 185,
  19914. "../util/lerp": 188,
  19915. "../util/logger": 189,
  19916. "../util/texture": 194,
  19917. "../util/transitions": 195,
  19918. "./View": 154,
  19919. events: 202,
  19920. three: 217
  19921. }],
  19922. 154: [function(o, a, e) {
  19923. (function(e) {
  19924. "use strict";
  19925. function t(e) {
  19926. e = e || {},
  19927. this.position = new i.Vector3,
  19928. this.quaternion = new i.Quaternion,
  19929. this.update(e)
  19930. }
  19931. var i = o("three")
  19932. , n = o("../util/logger")
  19933. , r = (o("../settings"),
  19934. o("../enum/Viewmode"),
  19935. o("../util/common"),
  19936. o("../util/transitions"),
  19937. o("../util/lerp"),
  19938. o("../util/ajax"),
  19939. o("../util/texture"),
  19940. o("events").EventEmitter);
  19941. new n(e),
  19942. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19943. return !!this.cameraMode
  19944. }
  19945. ,
  19946. t.prototype.update = function(e) {
  19947. return this.cameraMode = e.cameraMode || this.cameraMode,
  19948. this.pano = e.pano || this.pano,
  19949. e.position && this.position.copy(e.position),
  19950. e.quaternion && this.quaternion.copy(e.quaternion),
  19951. this
  19952. }
  19953. ,
  19954. a.exports = t
  19955. }
  19956. ).call(this, "/js/objects/View.js")
  19957. }
  19958. , {
  19959. "../enum/Viewmode": 51,
  19960. "../settings": 166,
  19961. "../util/ajax": 181,
  19962. "../util/common": 185,
  19963. "../util/lerp": 188,
  19964. "../util/logger": 189,
  19965. "../util/texture": 194,
  19966. "../util/transitions": 195,
  19967. events: 202,
  19968. three: 217
  19969. }],
  19970. 155: [function(J, ee, e) {
  19971. (function(e) {
  19972. "use strict";
  19973. function t(e) {
  19974. this.currentPano = null,
  19975. this.nextPano = null,
  19976. this.camera = null,
  19977. this.paused = !1,
  19978. this.flying = !1,
  19979. this.sceneIntersectionPlane = null,
  19980. this.target = new B.Vector3,
  19981. this.mouse = new B.Vector3(1.1,1.1,.5),
  19982. this.mouseAtMouseDown = new B.Vector2,
  19983. this.mouseCouldBeClickToMove = !1,
  19984. this.mouseLastMoveTime = Date.now(),
  19985. this.mouseDown = !1,
  19986. this.mouseDownTimer = null,
  19987. this.couldBeLongTap = !1,
  19988. this.containsMouse = !0,
  19989. this.isTouchEvent = !1,
  19990. this.isPanoHover = !1,
  19991. this.reticule = new n(this),
  19992. this.panoMarkers = [],
  19993. this.spider = new s(this),
  19994. this.quaternion = new B.Quaternion,
  19995. this.position = new B.Vector3(15,10,15),
  19996. this.previousState = null,
  19997. this.lastInsideView = new o,
  19998. this.last360View = new o,
  19999. this.raycaster = new B.Raycaster,
  20000. this.intersect = null,
  20001. this.lastChangeTime = Date.now(),
  20002. this.history = new h,
  20003. this.cameraControls = null,
  20004. this.path = null,
  20005. this.model = null,
  20006. this.domElement = null,
  20007. this.cachedPanoCandidates = null,
  20008. this.basePanoSize = 0,
  20009. this.standardPanoSize = 0,
  20010. this.highPanoSize = 0,
  20011. this.ultraHighPanoSize = 0,
  20012. this.zoomLevel = 1,
  20013. this.zooming = 0,
  20014. this.zoomSpeed = .5,
  20015. this.scrollZoomSpeed = .06,
  20016. this.zoomSpeedAdjust = .05,
  20017. this.defaultZoomIncrement = .2,
  20018. this.baseFov = k.insideFOV,
  20019. this.zoomFov = this.baseFov,
  20020. this.zoomEnabled = !0,
  20021. this.preRenderingEnabled = !1,
  20022. this.setupCustomProperties(e),
  20023. this.zoomStats = new v,
  20024. this.modeTran = ''//'dollhouse-panorama'
  20025. this.currentCursor = '';
  20026. window.player = this
  20027. }
  20028. var B = J("three")
  20029. , i = J("./util/logger")
  20030. , n = J("./objects/Reticule")
  20031. , a = J("./objects/Panorama")
  20032. , r = J("./objects/ShowPath")
  20033. , o = J("./objects/View")
  20034. , s = (J("./objects/Snapshot"),
  20035. J("./objects/NSpider"))
  20036. , V = J("./enum/Viewmode")
  20037. , T = (J("./enum/TagStates"),
  20038. J("./enum/Vectors"))
  20039. , l = J("./enum/Keys")
  20040. , k = (J("./enum/AlignmentType"),
  20041. J("./settings"))
  20042. , x = J("./util/common")
  20043. , U = (J("./util/browser"),
  20044. J("./util/math"))
  20045. , H = J("./util/lerp")
  20046. , z = J("./util/easing")
  20047. , G = J("./util/transitions")
  20048. , c = J("events").EventEmitter
  20049. , h = (J("./shaders"),
  20050. J("./util/history"))
  20051. , S = (J("./util/camera"),
  20052. J("./model/ModelManager"),
  20053. J("./enum/PathDiscardMode"))
  20054. , M = J("./enum/PathDisplayMode")
  20055. , W = J("./enum/PlayerEvents")
  20056. , u = J("./enum/ControlEvents")
  20057. , d = J("./enum/ModelManagerEvents")
  20058. , R = J("./enum/WarpStyle")
  20059. , P = J("./enum/BlackoutStyle")
  20060. , p = J("./exception/BasicException")
  20061. , f = J("./enum/PanoSizeClass")
  20062. , g = (J("./tile/TileDownloader"),
  20063. J("./tile/TilePrioritizer"))
  20064. , m = (J("./enum/PanoramaEvents"),
  20065. J("./enum/ZoomEvents"))
  20066. , v = J("./util/ZoomStats")
  20067. , y = J("./constants")
  20068. , j = J("./util/common")
  20069. , A = J("./util/cameraLight")
  20070. //, C = J("hot")
  20071. , Y = new i(e)
  20072. , q = Object.freeze({
  20073. FlyToPano: G.getUniqueId(),
  20074. FlyToNewMode: G.getUniqueId(),
  20075. FlyToSameMode: G.getUniqueId(),
  20076. FlyToViewFloor: G.getUniqueId(),
  20077. LookTransition: G.getUniqueId(),
  20078. ZoomTransition: G.getUniqueId()
  20079. });
  20080. function I(e) {
  20081. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20082. o[r] = n.charCodeAt(r);
  20083. return new Blob([o],{
  20084. type: i
  20085. })
  20086. }
  20087. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20088. this.modelManager = e.modelManager,
  20089. this.tileDownloader = e.tileDownloader,
  20090. this.panoRenderer = e.panoRenderer,
  20091. this.qualityManager = e.qualityManager,
  20092. this.domElement = e.container,
  20093. this.camera = e.camera,
  20094. this.tagManager = e.tagManager,
  20095. this.cameraControls = e.controls,
  20096. this.path = new r(e.director,this,e.controls),
  20097. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20098. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20099. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20100. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20101. this.tileDownloader.processPriorityQueue = !1,
  20102. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20103. this.bindEvents(e.container),
  20104. this.updateModel()
  20105. }
  20106. ,
  20107. t.prototype.screenShot = function(i) {
  20108. if (!this.flying && !this.flyingToTag) {
  20109. var n = this.sceneRenderer;
  20110. n.updateScreenSize(i)
  20111. this.model.panos.forEach(e=>{
  20112. if(e.marker){
  20113. e.marker.forceHide = e.marker.visible
  20114. e.marker.visible = !1;
  20115. }
  20116. })
  20117. /* for (var e in this.model.hots)
  20118. this.model.hots[e].mesh.visible = !1; */
  20119. player.model.hotGroup.visible = false
  20120. this.reticule.visible = !1,
  20121. this.reticule.forceUnvisible = !0,
  20122. this.path.currentPanoMarker.mesh.visible = !1,
  20123. setTimeout(function() {
  20124. n.renderer.clear(!0, !0, !0),
  20125. n.renderer.render(n.scene, n.camera);
  20126. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20127. i.f && i.f(e)
  20128. n.updateScreenSize({
  20129. resize: !0
  20130. })
  20131. this.reticule.visible = !0
  20132. player.model.hotGroup.visible = true
  20133. this.model.panos.forEach(e=>{
  20134. e.marker && (e.marker.visible = e.marker.forceHide);
  20135. })
  20136. this.path.currentPanoMarker.mesh.visible = !0,
  20137. n.renderer.render(n.scene, n.camera)
  20138. }
  20139. .bind(this), 30)
  20140. }
  20141. }
  20142. ;
  20143. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20144. t.prototype.getWrapShot = function() {
  20145. var i = this.getSnapAngleInfo()
  20146. , n = ",{\r\t" + i
  20147. , r = arguments[0];
  20148. this.screenShot({
  20149. width: g_snapShotWidth,
  20150. height: g_snapShotHeight,
  20151. type: "image/jpeg",
  20152. f: function(e) {
  20153. if (r && r.__callback)
  20154. return r.__callback(e, i);
  20155. var t = new Image;
  20156. t.src = e,
  20157. t.onload = function() {
  20158. var e = function(r, i) {
  20159. function n(e, t) {
  20160. var i = o || r
  20161. , n = document.createElement("canvas");
  20162. n.width = i.width,
  20163. n.height = i.height,
  20164. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20165. o = Q(e, n, t)
  20166. }
  20167. function e() {
  20168. var e = o || r
  20169. , t = I(e.src);
  20170. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20171. t = I(e.src)),
  20172. (o = o || new Image).base64Src = e.src,
  20173. o.src = window.URL.createObjectURL(t)
  20174. }
  20175. var o, t = Math.max(r.width, r.height);
  20176. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20177. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20178. e())),
  20179. o || r
  20180. }(this, {
  20181. maxSize: g_snapShotWidth,
  20182. oldType: "jpeg"
  20183. });
  20184. e.src.replace(function(e) {
  20185. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20186. }("image/jpeg"), "image/octet-stream");
  20187. var t = "snap" + (new Date).getTime();
  20188. !function(e, t) {
  20189. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20190. i.href = e,
  20191. i.download = t;
  20192. var n = document.createEvent("MouseEvents");
  20193. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20194. i.dispatchEvent(n)
  20195. }(e.src, t + ".jpg"),
  20196. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20197. n += '\r\t"sid":"' + t + '",',
  20198. n += '\r\t"name":"' + t + '"\r}',
  20199. logData(n)
  20200. }
  20201. }
  20202. })
  20203. }
  20204. /* ,
  20205. t.prototype.getSnapAngleInfo = function() {
  20206. var e = {}
  20207. , t = '"metadata":{'
  20208. , i = this.camera.quaternion.clone();
  20209. switch (this.mode) {
  20210. case "panorama":
  20211. e.scan_id = this.currentPano.id,
  20212. t += '"scan_id":"' + this.currentPano.id + '",';
  20213. break;
  20214. case "floorplan":
  20215. e.camera_mode = 1,
  20216. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20217. t += '"camera_mode":1,',
  20218. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20219. break;
  20220. case "dollhouse":
  20221. e.camera_mode = 2,
  20222. t += '"camera_mode":2,'
  20223. }
  20224. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20225. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20226. n.x *= -1,
  20227. n.w *= -1,
  20228. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20229. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20230. e.zoom = this.zoomLevel,
  20231. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20232. }
  20233. , */
  20234. t.prototype.getSnapAngleInfo = function(){
  20235. var info = {};
  20236. var str = '"metadata":{';
  20237. var q = this.camera.quaternion.clone();
  20238. switch (this.mode) {
  20239. case "panorama":
  20240. info.scan_id = this.currentPano.id;
  20241. str += ('"scan_id":"'+this.currentPano.id+'",');
  20242. break;
  20243. case "floorplan":
  20244. info.camera_mode = 1;
  20245. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20246. q.multiply(this.camera.quaternion);
  20247. str += ('"camera_mode":1,');
  20248. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20249. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20250. break;
  20251. case "dollhouse":
  20252. info.camera_mode = 2;
  20253. str += ('"camera_mode":2,');
  20254. break;
  20255. }
  20256. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20257. //console.log(info.camera_position)
  20258. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20259. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20260. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20261. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20262. out.x *= -1;
  20263. out.w *= -1;
  20264. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20265. }else{
  20266. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20267. } */
  20268. info.zoom = this.zoomLevel;
  20269. //console.log(info.camera_quaternion)
  20270. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20271. // fyz 扩展编辑页面, 加上导览点缩放值
  20272. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20273. console.log(str)
  20274. return str;
  20275. }
  20276. //------end
  20277. ,
  20278. t.prototype.setupCustomProperties = function(e) {
  20279. var i = e || V.PANORAMA;
  20280. Object.defineProperty(this, "mode", {
  20281. get: function() {
  20282. return i
  20283. },
  20284. set: function(e) {
  20285. var t = i;
  20286. i = e,
  20287. this.onModeUpdated(t, i)
  20288. }
  20289. })
  20290. }
  20291. ,
  20292. t.prototype.isInMode = function() {
  20293. for (var e = 0; e < arguments.length; e++)
  20294. if (this.mode === arguments[e])
  20295. return !0;
  20296. return !1
  20297. }
  20298. ,
  20299. t.prototype.isOutsideMode = function(e) {
  20300. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20301. }
  20302. ,
  20303. t.prototype.is360View = function(e, t) {
  20304. return e === V.PANORAMA && t && !t.isAligned()
  20305. }
  20306. ,
  20307. t.prototype.setScene = function(e) {
  20308. this.sceneIntersectionPlane = e.plane,
  20309. this.path.setScene(e),
  20310. this.moveReticuleToScene(e)
  20311. }
  20312. ,
  20313. t.prototype.moveReticuleToScene = function(e) {
  20314. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20315. e.add(this.reticule)
  20316. }
  20317. ,
  20318. t.prototype.updateModel = function() {
  20319. function n(e) {
  20320. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20321. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20322. , n = t.position.y + (e - i.target.y)
  20323. , r = k.showFloorDuration + k.showFloorDelay;
  20324. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20325. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20326. }
  20327. this.model = this.modelManager.getActiveModel(),
  20328. this.model.on("floor.changed", function(e, t, i) {
  20329. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20330. }
  20331. .bind(this)),
  20332. this.model.on("allfloors.toggled", function(e, t) {
  20333. if (this.mode === V.DOLLHOUSE) {
  20334. var i = e ? this.model.center.y : i = t.center.y;
  20335. n.call(this, i)
  20336. }
  20337. }
  20338. .bind(this)),
  20339. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20340. var t = this;
  20341. this.model.panos.list.forEach(function(e) {
  20342. e.vrMarker.addEventListener("click", function() {
  20343. t.flyToPano({
  20344. pano: e
  20345. })
  20346. })
  20347. })
  20348. }
  20349. ,
  20350. t.prototype.updateModelDependentData = function() {
  20351. this.cameraControls.setModelForControls(this.model),
  20352. this.getPanoMarkersFromModel(this.model)
  20353. }
  20354. ,
  20355. t.prototype.onModelChanged = function() {
  20356. this.updateModel(),
  20357. this.updateModelDependentData()
  20358. }
  20359. ,
  20360. t.prototype.getPanoMarkersFromModel = function(e) {
  20361. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20362. return t.marker ? e.concat(t.marker) : e
  20363. }, [])
  20364. }
  20365. ,
  20366. t.prototype.handleControlMove = function(e) {
  20367. this.emit(W.Move, e)
  20368. }
  20369. ,
  20370. t.prototype.handleControlInputStart = function(e) {
  20371. this.emit(W.InputStart, e)
  20372. }
  20373. ,
  20374. t.prototype.onModeUpdated = function(e, t) {
  20375. this.cameraControls.activateControls(t),
  20376. this.emit(W.ModeChanged, e, t)
  20377. }
  20378. ,
  20379. t.prototype.isWarping = function() {
  20380. return this.path.warping
  20381. }
  20382. ,
  20383. t.prototype.isWaitingToWarp = function() {
  20384. return this.path.waitingToWarp
  20385. }
  20386. ,
  20387. t.prototype.getLabelScaleFactor = function() {
  20388. if (this.isOutsideMode()) {
  20389. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20390. }
  20391. return .5
  20392. }
  20393. ,
  20394. t.prototype.bindEvents = function(e) {
  20395. e !== document && e.setAttribute("tabindex", -1),
  20396. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20397. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20398. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20399. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20400. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20401. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20402. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20403. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20404. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20405. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20406. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20407. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20408. document.addEventListener("pointerup", ()=>{//add
  20409. window.transformControls && transformControls.onPointerUp()
  20410. }),
  20411. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20412. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20413. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20414. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20415. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20416. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20417. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20418. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20419. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20420. window.getSeft && getSeft(this)
  20421. }
  20422. ,
  20423. t.prototype.onMouseDown = function(e) {
  20424. e.currentTarget !== document && e.currentTarget.focus(),
  20425. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20426. this.updateIntersect())
  20427. }
  20428. ,
  20429. t.prototype.onMouseMove = function(e) {
  20430. this.isTouchEvent = !1,
  20431. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20432. }
  20433. ,
  20434. t.prototype.onMouseOver = function(e) {
  20435. this.containsMouse = !0,
  20436. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20437. }
  20438. ,
  20439. t.prototype.onMouseOut = function(e) {
  20440. this.containsMouse = !1
  20441. }
  20442. ,
  20443. t.prototype.onMouseUp = function(e) {
  20444. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20445. }
  20446. ,
  20447. t.prototype.onTouchStart = function(e) {
  20448. if (e.currentTarget !== document && e.currentTarget.focus(),
  20449. !this.mouseDown) {
  20450. this.couldBeLongTap = !0;
  20451. var t = x.average(e.changedTouches, "clientX")
  20452. , i = x.average(e.changedTouches, "clientY");
  20453. this.handleInputStart.call(this, t, i, !0),
  20454. this.mouseDownTimer = setTimeout(function() {
  20455. this.updateIntersect(),
  20456. this.handleInputEnd.call(this, t, i, !0)
  20457. }
  20458. .bind(this), k.input.longTapThreshold)
  20459. }
  20460. }
  20461. ,
  20462. t.prototype.onTouchMove = function(e) {
  20463. var t = x.average(e.changedTouches, "clientX")
  20464. , i = x.average(e.changedTouches, "clientY");
  20465. this.handleInputMove.call(this, t, i, !0)
  20466. }
  20467. ,
  20468. t.prototype.onTouchEnd = function(e) {
  20469. if (clearTimeout(this.mouseDownTimer),
  20470. this.mouseDown) {
  20471. this.couldBeLongTap = !1,
  20472. this.updateIntersect();
  20473. var t = x.average(e.changedTouches, "clientX")
  20474. , i = x.average(e.changedTouches, "clientY");
  20475. this.handleInputEnd.call(this, t, i, !0)
  20476. }
  20477. }
  20478. ,
  20479. t.prototype.onPointerDown = function(e) {
  20480. return e.currentTarget !== document && e.currentTarget.focus(),
  20481. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20482. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20483. void (this.mouseDownTimer = setTimeout(function() {
  20484. this.updateIntersect(),
  20485. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20486. }
  20487. .bind(this), k.input.longTapThreshold)))
  20488. }
  20489. ,
  20490. t.prototype.onPointerMove = function(e) {
  20491. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20492. }
  20493. ,
  20494. t.prototype.onPointerUp = function(e) {
  20495. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20496. this.couldBeLongTap = !1,
  20497. this.updateIntersect(),
  20498. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20499. }
  20500. ,
  20501. t.prototype.onPointerOut = function(e) {
  20502. this.mouseDown = !1
  20503. }
  20504. ,
  20505. t.prototype.onPointerCancel = function(e) {
  20506. this.mouseDown = !1
  20507. }
  20508. ,
  20509. t.prototype.onKeyDown = function(e) {
  20510. var t = function() {
  20511. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20512. }
  20513. .bind(this)
  20514. , i = e.which;
  20515. switch (i) {
  20516. case l.F:
  20517. t(),
  20518. this.changeFloor(-1);
  20519. break;
  20520. case l.R:
  20521. t(),
  20522. this.changeFloor(1)
  20523. }
  20524. if (this.mode === V.PANORAMA)
  20525. switch (i) {
  20526. case l.UPARROW:
  20527. case l.W:
  20528. this.flyLocalDirection(T.FORWARD.clone());
  20529. break;
  20530. case l.DOWNARROW:
  20531. case l.S:
  20532. this.flyLocalDirection(T.BACK.clone());
  20533. break;
  20534. case l.A:
  20535. this.flyLocalDirection(T.LEFT.clone());
  20536. break;
  20537. case l.D:
  20538. this.flyLocalDirection(T.RIGHT.clone())
  20539. }
  20540. }
  20541. ,
  20542. t.prototype.handleScrollPinchZoom = function(e) {
  20543. var t = e
  20544. , i = this.zoomLevel;
  20545. this.zoomBy(t),
  20546. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20547. }
  20548. ,
  20549. t.prototype.handleControlPinch = function(e) {
  20550. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20551. }
  20552. ,
  20553. t.prototype.handleControlScroll = function(e) {
  20554. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20555. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20556. }
  20557. ,
  20558. t.prototype.handleInputStart = function(e, t, i) {
  20559. var n = this.handelPadding(e, t);
  20560. e = n.x,
  20561. t = n.y,
  20562. this.isTouchEvent = i,
  20563. U.convertScreenPositionToNDC(e, t, this.mouse),
  20564. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20565. this.mouseCouldBeClickToMove = !0,
  20566. this.mouseDown = !0
  20567. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20568. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20569. window.transformControls && transformControls.onPointerDown()
  20570. }
  20571. ,
  20572. t.prototype.handelPadding = function(e, t) {
  20573. return this.pad || (this.pad = {
  20574. x: dom.getOffset("left", $("#player")[0]),
  20575. y: dom.getOffset("top", $("#player")[0])
  20576. }),
  20577. {
  20578. x: e - this.pad.x,
  20579. y: t - this.pad.y
  20580. }
  20581. }
  20582. ,
  20583. t.prototype.handleInputMove = function(e, t, i) {
  20584. var n = this.handelPadding(e, t);
  20585. e = n.x,
  20586. t = n.y,
  20587. this.isTouchEvent = i,
  20588. U.convertScreenPositionToNDC(e, t, this.mouse);
  20589. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20590. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20591. this.couldBeLongTap = !1,
  20592. clearTimeout(this.mouseDownTimer)),
  20593. this.mouseLastMoveTime = Date.now(),
  20594. this.reticule.move(e, t, i)
  20595. window.transformControls && transformControls.onPointerMove()
  20596. }
  20597. ,
  20598. t.prototype.handleInputEnd = function(e, t, i) {
  20599. if (this.isTouchEvent = i,
  20600. this.mouseDown = !1,
  20601. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20602. !i && this.couldBeLongTap)
  20603. return !0;
  20604. if (this.handleLongTap())
  20605. return !0;
  20606. window.transformControls && transformControls.onPointerUp()
  20607. if (this.mouseCouldBeClickToMove) {
  20608. if (this.flying)
  20609. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20610. !0;
  20611. //add----
  20612. if (this.checkHotClick())
  20613. return !0;
  20614. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20615. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20616. return;
  20617. }
  20618. if (window.VisiSet && VisiSet.setTagVisible ) {
  20619. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20620. return;
  20621. }
  20622. if (window.VisiSet && VisiSet.setPanoLog ) {
  20623. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  20624. return;
  20625. }
  20626. if(this.hoveringPlane){
  20627. this.clickOverlay(this.hoveringPlane)
  20628. return;
  20629. }
  20630. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20631. return EditOverlay.addPlane({intersect:this.intersect});
  20632. }
  20633. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20634. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20635. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20636. } */
  20637. //----------
  20638. if(this.intersect){// for cad add door etc.
  20639. let result = {}
  20640. this.emit('getIntersect', this.intersect, (state)=>{//consume
  20641. result.consume = true
  20642. })
  20643. if(result.consume)return; //有效使用了,就return
  20644. }
  20645. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20646. this.history.invalidate(),
  20647. this.intersect)
  20648. return this.flyToPanoClosestToMouse();
  20649. if (this.mode === V.PANORAMA) {
  20650. var n = this.closestPanoInDirection(this.getMouseDirection());
  20651. return n ? this.flyToPano({
  20652. pano: n
  20653. }) : this.bump(this.getMouseDirection())
  20654. }
  20655. }
  20656. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20657. }
  20658. ,
  20659. t.prototype.handleLongTap = function() {
  20660. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20661. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20662. !0
  20663. }
  20664. ,
  20665. t.prototype.checktagClick = function() {
  20666. if (this.tagManager.intersectTag) {
  20667. var e = this.isTouchEvent
  20668. , t = this.tagManager.clickedOnTag(e, this);
  20669. return e || t || G.cancelById(q.LookTransition),
  20670. !0
  20671. }
  20672. if (this.tagManager.activeTag)
  20673. return this.tagManager.dismissActiveTag(),
  20674. !1
  20675. }
  20676. ,
  20677. t.prototype.rankedtagInDirection = function(e, t) {
  20678. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20679. }
  20680. ,
  20681. t.prototype.start = function(e) {
  20682. $(".toolLeft").removeClass("unable");
  20683. $(".toolTop").removeClass("unable");
  20684. //-------------------
  20685. window.initTransformCtl(B)
  20686. //this.model.loadOverlays()
  20687. //window.EditOverlay && window.EditOverlay.init(B);
  20688. window.VisiSet && VisiSet.init()
  20689. //-------------------
  20690. var t = e.mode
  20691. , i = e.pano
  20692. , n = e.position
  20693. , r = e.quaternion
  20694. , o = e.tag
  20695. , a = e.quickstart
  20696. , s = $.Deferred();
  20697. this.updateModelDependentData(),
  20698. this.updateFromControls(),
  20699. this.findDefaultViews();
  20700. var l = this.is360View(t, i);
  20701. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20702. s.done(function(e) {
  20703. this.emit(W.Ready, l, e, o)
  20704. }
  20705. .bind(this)),
  20706. s.promise()
  20707. }
  20708. ,
  20709. t.prototype.startOutside = function(e, t) {
  20710. var i = e.mode
  20711. , n = e.pano
  20712. , r = e.position
  20713. , o = e.quaternion
  20714. , a = e.zoom
  20715. , s = e.floorVisibility
  20716. , l = e.tag;
  20717. this.emit(W.StartOutside, k[i].transitionTime),
  20718. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20719. G.cancelById(q.FlyToViewFloor),
  20720. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20721. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20722. }
  20723. ,
  20724. t.prototype.startInside = function(e, t, i, n, r) {
  20725. r = r || $.Deferred();
  20726. var o = (this.currentPano = e) && !e.isAligned();
  20727. window.bus.dispatchEvent({type:'playerAndModelReady'})
  20728. this.ready = true
  20729. if (t = o ? e.position : t || e.position,
  20730. i = i || e.quaternion,
  20731. e) {
  20732. var a = this.startInside.bind(this, e, t, i, n, r);
  20733. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20734. return
  20735. }
  20736. //add
  20737. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20738. //this.updateHotVisible()
  20739. //EditOverlay.updatePano()
  20740. editTool.hotpoint.updatePano()
  20741. Hot.updateVisibles([this.currentPano])
  20742. return this.mode = V.PANORAMA,
  20743. e.floor.enter(this.mode),
  20744. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20745. this.switchCameraMode(this.mode, i),
  20746. this.emit(W.StartInside, o),
  20747. r.resolve(!0),
  20748. r
  20749. }
  20750. ,
  20751. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20752. if (r = r || $.Deferred(),
  20753. this.dollhouseMode(),
  20754. !i)
  20755. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20756. r.resolve(!1),
  20757. r;
  20758. e = e || i.position;
  20759. var o = n || this.cameraControls.activeControl.camera.quaternion
  20760. , a = i.position;
  20761. return this.fitDollhouse(a, e, o),
  20762. setTimeout(function(e) {
  20763. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20764. var t = {
  20765. mode: V.PANORAMA,
  20766. pano: i,
  20767. quaternion: n,
  20768. callback: function() {
  20769. this.emit(W.FlyinFinished),
  20770. r.resolve(!0)
  20771. }
  20772. .bind(this)
  20773. };
  20774. this.flyToNewMode(t)
  20775. }
  20776. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20777. r
  20778. }
  20779. ,
  20780. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20781. K = {},
  20782. function(t, e, i, n, r, o, a, s, l, c) {
  20783. if (function() {
  20784. for (var e in Z)
  20785. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20786. return !0;
  20787. return !1
  20788. }())
  20789. return !0;
  20790. var h = function(e, t, i) {
  20791. j.delayOneFrame(function() {
  20792. Z[e] = !1,
  20793. r && r(t, i)
  20794. }
  20795. .bind(this))
  20796. }
  20797. .bind(this, t.id)
  20798. , u = function(e, t) {
  20799. j.delayOneFrame(function() {
  20800. Z[e] = !1,
  20801. o && o(t)
  20802. }
  20803. .bind(this))
  20804. }
  20805. .bind(this, t.id);
  20806. try {
  20807. return null != s || (s = !0),
  20808. 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),
  20809. Z[t.id] && (K[t.id] = performance.now()),
  20810. Z[t.id]
  20811. } catch (e) {
  20812. throw Z[t.id] = !1,
  20813. K[t.id] = performance.now() - 5e3,
  20814. e
  20815. }
  20816. }
  20817. ),
  20818. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20819. if (!e)
  20820. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20821. return r && this.model.waitForLoad(e, function() {
  20822. return e.isLoaded(i)
  20823. }),
  20824. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20825. !0)
  20826. }
  20827. ,
  20828. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20829. function(e, t, i, n, r, o, a, s) {
  20830. if (!e)
  20831. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20832. return X.copy(T.FORWARD),
  20833. this.getDirection(X),
  20834. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20835. return e.isLoaded(t)
  20836. }),
  20837. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20838. i && i(e, t)
  20839. }
  20840. .bind(this)).fail(function(e) {
  20841. n && n(e)
  20842. }
  20843. .bind(this)).progress(function(e, t, i) {
  20844. r && r(e, t, i)
  20845. }
  20846. .bind(this)),
  20847. !0)
  20848. }
  20849. ),
  20850. t.prototype.switchCameraMode = function(e, t) {
  20851. var i = this.cameraControls.controls[e]
  20852. , n = i.camera;
  20853. switch (e) {
  20854. case V.PANORAMA:
  20855. n.position.copy(this.currentPano.position);
  20856. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20857. i.lookAt(r.add(n.position));
  20858. break;
  20859. case V.DOLLHOUSE:
  20860. var o = this.position.clone();
  20861. 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),
  20862. n.position.copy(o),
  20863. i.target.copy(this.target.clone().setY(this.model.center.y));
  20864. break;
  20865. //for多楼层 且 让模型刚好适应屏幕
  20866. /* var box = this.model.boundingBox.clone();
  20867. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20868. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20869. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  20870. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20871. console.log(boxSize.x,distance, boxSize.length() / 2)
  20872. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20873. if(this.mode === V.PANORAMA){
  20874. i.target.copy(this.model.center);
  20875. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20876. }else{
  20877. i.target.copy(this.target.clone().setY(this.model.center.y))
  20878. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20879. }
  20880. vec.multiplyScalar(distance )
  20881. n.position.copy(i.target.clone().add(vec)) */
  20882. break
  20883. case V.FLOORPLAN:
  20884. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20885. i.target.copy(this.model.center).setY(0),
  20886. i.zoomToContain(this.model.size),
  20887. i.rotateToView(this.model.size, this.getDirection())
  20888. }
  20889. i.update(0)
  20890. }
  20891. ,
  20892. t.prototype.update = (new B.Vector3,
  20893. N = {},
  20894. F = [],
  20895. function(e) {
  20896. this.updatePersistentZooming(e),
  20897. this.updateFromControls(e),
  20898. this.getCurrentNodePanos(F)
  20899. if(this.hasChanged(N)){
  20900. this.lastChangeTime = Date.now(),
  20901. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20902. this.emit(W.ViewChanged, N)
  20903. //add:
  20904. if(N.cameraChanged){
  20905. Hot.updateHots()
  20906. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20907. }
  20908. }
  20909. this.model.supportsTiles && (this.updateTileDownloader(F),
  20910. this.updatePanoRenderer(F)),
  20911. this.updatePreRendering(F),
  20912. this.reticule.update(),
  20913. this.path.update(),
  20914. this.spider.update(),
  20915. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20916. this.updateControlLocks(),
  20917. this.model.supportsTiles && this.updateZoomPano()
  20918. }
  20919. ),
  20920. t.prototype.updatePersistentZooming = function(e) {
  20921. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20922. }
  20923. ,
  20924. t.prototype.updateControlLocks = function() {
  20925. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20926. }
  20927. ,
  20928. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20929. function(e) {
  20930. var t = this.nextPano || this.currentPano;
  20931. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20932. this.getDirection(D),
  20933. this.panoRenderer.updateDirection(D))
  20934. }
  20935. ),
  20936. t.prototype.cleanupInactivePanos = (O = [],
  20937. L = [],
  20938. function() {
  20939. O.length = 0,
  20940. O.push(this.currentPano),
  20941. this.nextPano && O.push(this.nextPano);
  20942. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20943. L.push(this.panoRenderer.activePanos[e]);
  20944. for (var t = 0; t < L.length; t++) {
  20945. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20946. i.id === O[r].id && (n = !1);
  20947. n && i.exit()
  20948. }
  20949. }
  20950. ),
  20951. t.prototype.updatePreRendering = (w = {},
  20952. function(e) {
  20953. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20954. var t = this.nextPano || this.currentPano;
  20955. if (t && e && 1 < e.length) {
  20956. var i = e.findIndex(function(e) {
  20957. if (e.id === t.id)
  20958. return !0
  20959. });
  20960. if (0 <= i && i + 1 < e.length) {
  20961. var n = e[i + 1];
  20962. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20963. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20964. window.setTimeout(function(e) {
  20965. w[e.id] = !1
  20966. }
  20967. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20968. }
  20969. .bind(this, n), k.tiling.panoPreRenderDelay),
  20970. w[n.id] = !0)
  20971. }
  20972. }
  20973. }
  20974. }
  20975. ),
  20976. t.prototype.enablePreRendering = function() {
  20977. this.preRenderingEnabled = !0
  20978. }
  20979. ,
  20980. t.prototype.disablePreRendering = function() {
  20981. this.preRenderingEnabled = !1,
  20982. this.cleanupInactivePanos()
  20983. }
  20984. ,
  20985. t.prototype.updateTileDownloader = (b = new B.Vector3,
  20986. function(e) {
  20987. var t = this.nextPano || this.currentPano;
  20988. t && (b.copy(T.FORWARD),
  20989. this.getDirection(b),
  20990. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  20991. this.tileDownloader.processPriorityQueue = !0)
  20992. }
  20993. ),
  20994. t.prototype.updateFromControls = function(e) {
  20995. null != e || (e = 0),
  20996. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  20997. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  20998. this.position.copy(this.cameraControls.activeControl.camera.position),
  20999. this.target.copy(this.cameraControls.activeControl.target),
  21000. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21001. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21002. this.camera.position.copy(this.position),
  21003. this.camera.quaternion.copy(this.quaternion),
  21004. this.camera.updateMatrix(),
  21005. this.camera.updateMatrixWorld()
  21006. }
  21007. ,
  21008. t.prototype.hasChanged = function(e) {
  21009. if (!this.previousState){
  21010. e.cameraChanged = true
  21011. return this.previousState = {
  21012. allFloorsVisible: this.model.allFloorsVisible,
  21013. position: this.position.clone(),
  21014. quaternion: this.quaternion.clone(),
  21015. mouse: this.mouse.clone(),
  21016. labelScaleFactor: this.getLabelScaleFactor(),
  21017. currentFloor: this.model.currentFloor,
  21018. projectionMatrix: this.camera.projectionMatrix.clone(),
  21019. worldMatrix: this.camera.matrixWorld.clone(),
  21020. mode: this.mode,
  21021. modelPosition: this.model.position.clone(),
  21022. modelCenter: this.model.center.clone(),
  21023. zoomLevel: this.zoomLevel
  21024. },
  21025. !0;
  21026. }
  21027. //许钟文改 分成相机是否改变cameraChanged 和其他
  21028. 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)
  21029. 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 ;
  21030. e.cameraChanged = !a;
  21031. //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;
  21032. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21033. e.moved = !this.position.equals(this.previousState.position),
  21034. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21035. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21036. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21037. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21038. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21039. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21040. e.modeChanged = this.mode !== this.previousState.mode,
  21041. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21042. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21043. e.nextPanoActive = null !== this.nextPano,
  21044. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21045. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21046. this.previousState.position.copy(this.position),
  21047. this.previousState.quaternion.copy(this.quaternion),
  21048. this.previousState.mouse.copy(this.mouse),
  21049. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21050. this.previousState.currentFloor = this.model.currentFloor,
  21051. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21052. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21053. this.previousState.mode = this.mode,
  21054. this.previousState.modelPosition.copy(this.model.position),
  21055. this.previousState.modelCenter.copy(this.model.center),
  21056. this.previousState.zoomLevel = this.zoomLevel,
  21057. !t
  21058. }
  21059. ,
  21060. t.prototype.updateIntersect = function() {
  21061. var e = this.flying || this.isWarping()
  21062. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21063. , i = G.getById(q.LookTransition);
  21064. e || t || this.isTouchEvent || i.length && i[0].running;
  21065. {//clear:
  21066. //if(this.intersectHot) this.intersectHot.hideTitle()
  21067. if(this.intersectHot) this.intersectHot.setHoverState(false)
  21068. this.intersectHot = null
  21069. //$("#player").css("cursor", "")
  21070. CursorDeal.remove('hoverFootIcon' )
  21071. CursorDeal.remove('hoverHot' )
  21072. $(".toolRight .spotList ul li").removeClass("active")
  21073. }
  21074. var deal = ()=>{
  21075. if(this.intersect && this.intersect.object.visible ){
  21076. if("hotSprite" == this.intersect.object.type){
  21077. this.intersectHot = this.intersect.object
  21078. while(!(this.intersectHot instanceof Hot)){
  21079. this.intersectHot = this.intersectHot.parent
  21080. }
  21081. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21082. this.intersectHot.setHoverState(true)
  21083. }
  21084. }
  21085. }
  21086. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) {
  21087. this.intersect = this.getMouseIntersect(null, this.model.hotGroup.children.concat(VisiSet.footIcons||[]) );
  21088. deal()
  21089. if(this.intersect){
  21090. CursorDeal.add('hoverFootIcon' ) //$("#player").css("cursor", "pointer");
  21091. }
  21092. if(this.intersectHot){
  21093. this.intersect = null
  21094. }
  21095. return
  21096. }else if (g_HotStatus) {//加热点
  21097. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21098. if(this.intersect){
  21099. //$("#player").css("cursor", "cell")
  21100. CursorDeal.remove('noIntersect' )
  21101. }else{
  21102. //$("#player").css("cursor", "not-allowed")
  21103. CursorDeal.add('noIntersect' )
  21104. }
  21105. return;
  21106. }else{
  21107. if(this.model.hotGroup){
  21108. if(editTool.atPanel == 'hotpoint'){
  21109. var hots = this.model.hotGroup.children
  21110. }else{
  21111. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21112. }
  21113. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  21114. if(this.intersect){
  21115. deal()
  21116. this.intersectHot && CursorDeal.add('hoverHot' ) //$("#player").css("cursor", "pointer");
  21117. }
  21118. }else{
  21119. this.intersect = this.getMouseIntersect()
  21120. }
  21121. }
  21122. this.intersect && this.updateClosestPano(this.intersect),
  21123. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21124. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21125. }
  21126. ,
  21127. t.prototype.checkHotClick = function() {
  21128. if (this.intersectHot){
  21129. if (window.VisiSet && VisiSet.setTagVisible ) {
  21130. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21131. return;
  21132. }else if(editTool.atPanel == 'hotpoint'){
  21133. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21134. var sure = confirm("是否保存当前热点?")
  21135. if(sure){
  21136. editTool.hotpoint.saveHot().then(()=>{
  21137. editTool.hotpoint.editHot(this.intersectHot)
  21138. })
  21139. }else{
  21140. editTool.hotpoint.editHot(this.intersectHot)
  21141. }
  21142. }else{
  21143. editTool.hotpoint.editHot(this.intersectHot)
  21144. }
  21145. }else{
  21146. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21147. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21148. }
  21149. this.intersectHot.examine()
  21150. }
  21151. return !0
  21152. }
  21153. }
  21154. ,
  21155. t.prototype.getMouseDirection = function(e) {
  21156. e = e || this.mouse;
  21157. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21158. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21159. }
  21160. ,
  21161. /* t.prototype.hoverOverlay = function(mesh){
  21162. if(!mesh){
  21163. this.hoveringPlane = null;
  21164. $("#player").css("cursor",this.currentCursor || "" );
  21165. }else{
  21166. var overlay = mesh.parent;
  21167. $("#player").css("cursor","pointer");
  21168. this.hoveringPlane = overlay;
  21169. return true;
  21170. }
  21171. }, */
  21172. t.prototype.clickOverlay = function(overlay){
  21173. if(this.openOverlay && !overlay)return;
  21174. var plane = overlay.plane;
  21175. if(overlay.texType == "video"){
  21176. overlay.switchPlay(!!overlay.pausedByUser)
  21177. }
  21178. if(window.EditOverlay && EditOverlay.editing){
  21179. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21180. var sure = confirm("是否保存当前展览?")
  21181. if(sure){
  21182. $("#overlayProp button.submit").click()
  21183. }else{
  21184. EditOverlay.closeOverlayPanel('cancel')
  21185. }
  21186. }
  21187. EditOverlay.beginEdit(overlay);
  21188. return;
  21189. }
  21190. },
  21191. t.prototype.getMouseIntersect = function(e, t1) {
  21192. e = e || this.mouse.clone()
  21193. var t = t1 || this.model.floors.reduce(function(e, t) {
  21194. return t.hidden ? e : e.concat(t.collider.children)
  21195. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21196. t = t.slice(0)
  21197. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21198. this.raycaster.set(i, this.getMouseDirection(e));
  21199. var n = this.raycaster.intersectObjects(t , true );//add true
  21200. var o = n[0];
  21201. if(o){
  21202. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21203. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21204. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21205. o.horizontal = .8 < o.normal.y);
  21206. return o
  21207. }
  21208. }
  21209. ,
  21210. t.prototype.updateClosestPano = function(e) {
  21211. var t = [a.filters.isPanoAligned()];
  21212. if (this.mode === V.PANORAMA) {
  21213. if (!this.currentPano)
  21214. return;
  21215. t.push(a.filters.not(this.currentPano)),
  21216. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21217. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21218. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21219. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21220. } else{
  21221. t.push(a.filters.isOnVisibleFloor()),
  21222. t.push(this.checkHasNeighbor)//add
  21223. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21224. }
  21225. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21226. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21227. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21228. this.closestPano = i) : this.isPanoHover = !1
  21229. }
  21230. ,
  21231. t.prototype.dollhouseMode = function(e, t) {
  21232. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21233. this.mode = V.DOLLHOUSE,
  21234. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21235. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21236. , n = new B.Vector3(15,10,15);
  21237. if (e && t) {
  21238. var r = T.FORWARD.clone().applyQuaternion(t)
  21239. , o = this.model.center.clone().sub(e).dot(r);
  21240. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21241. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21242. }
  21243. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21244. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21245. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21246. this.updateFromControls(),
  21247. this.model.alpha = 1,
  21248. this.model.skybox.material.uniforms.opacity.value = 0
  21249. }
  21250. ,
  21251. t.prototype.insideMode = function(e, t) {
  21252. var i = $.Deferred()
  21253. , n = t || null;
  21254. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21255. var r = [a.filters.isPanoAligned()];
  21256. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21257. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21258. this.flyToNewMode({
  21259. mode: V.PANORAMA,
  21260. pano: e,
  21261. callback: n
  21262. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21263. } else {
  21264. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21265. i.reject(o)
  21266. }
  21267. return i.promise()
  21268. }
  21269. ,
  21270. t.prototype.fitDollhouse = function(e, t, i) {
  21271. var maxY = this.model.boundingBox.max.y;//add
  21272. var n = T.FORWARD.clone().applyQuaternion(i);
  21273. i = n.clone().add(e);
  21274. this.cameraControls.activeControl.target.copy(i),
  21275. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21276. }
  21277. ,
  21278. t.prototype.floorplanMode = function(e, t, i) {
  21279. this.mode = V.FLOORPLAN;
  21280. var n = this.cameraControls.controls[V.FLOORPLAN];
  21281. n.reset();
  21282. var r = e || this.model.center;
  21283. if (n.target.copy(r).setY(0),
  21284. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21285. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21286. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21287. t) {
  21288. var o = T.LEFT.clone().applyQuaternion(t);
  21289. n.rotateLeft(-Math.atan2(o.x, o.z))
  21290. } else
  21291. n.rotateToView(this.model.size, this.getDirection());
  21292. n.update(0)
  21293. }
  21294. ,
  21295. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21296. return e.skipWarpingCheck = !0,
  21297. this.flyToPano(e, t)
  21298. }
  21299. ,
  21300. t.prototype.updateMarkerVisi = function() {//加
  21301. if(this.mode != "panorama")return;
  21302. this.model.panos.list.forEach((pano)=>{
  21303. if(!pano.marker)return;
  21304. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21305. })
  21306. }
  21307. ,
  21308. /* t.prototype.updateHotVisible = function(pano){
  21309. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21310. var hots = this.model.hots;
  21311. pano = pano || this.currentPano;
  21312. for (var index in hots){
  21313. var visible;
  21314. if(this.mode != "panorama"){
  21315. visible = true;
  21316. }else{
  21317. //hots[index].mesh.material.depthTest = false;
  21318. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21319. }
  21320. hots[index].mesh.visible = visible;
  21321. }
  21322. }
  21323. */
  21324. t.prototype.flyToPano = function(e, t) {
  21325. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21326. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21327. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21328. if (aim){
  21329. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21330. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21331. }
  21332. else aimQua = aimQua
  21333. var zoomLevel = e.zoomLevel || 1 //add
  21334. if(this.flying) return t && t(e)
  21335. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21336. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21337. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21338. t && t(),
  21339. !1;
  21340. this.updateLastView()
  21341. if (this.mode !== V.PANORAMA)
  21342. return void this.flyToNewMode({
  21343. mode: V.PANORAMA,
  21344. pano: n,
  21345. duration: o,
  21346. quaternion: aimQua,
  21347. callback: t
  21348. });
  21349. if (!n || (h = x.deepExtend(e), u = function() {
  21350. j.delayOneFrame(function() {
  21351. this.flyToPano(h, t)
  21352. }.bind(this))
  21353. }.bind(this),
  21354. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21355. var d = function(e) {
  21356. t && t(e)
  21357. }
  21358. .bind(this);
  21359. this.currentPano || (this.currentPano = n,
  21360. this.path.placeCpm(),
  21361. this.path.fadeOutCpm(k.path.fadeOutTime),
  21362. this.spider.draw());
  21363. var p = o;
  21364. if ("number" != typeof o) {
  21365. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21366. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21367. }
  21368. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21369. zoomLevel !== this.zoomLevel)
  21370. switch (k.zoom.transitionStyle) {
  21371. case 1:
  21372. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21373. break;
  21374. case 2:
  21375. return h = x.deepExtend(e),
  21376. u = this.flyToPano.bind(this, h, t),
  21377. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21378. }
  21379. if (aimQua) {
  21380. G.cancelById(q.LookTransition),
  21381. p *= k.transition.aimSlowFactor;
  21382. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21383. , y = g.clone()
  21384. , A = new B.Vector3;
  21385. if (n === this.currentPano) {
  21386. var C = T.FORWARD.clone().applyQuaternion(g)
  21387. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21388. , E = C.angleTo(I);
  21389. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21390. void G.start(function(e) {
  21391. y.copy(g),
  21392. H.quaternion(y, aimQua)(e),
  21393. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21394. this.cameraControls.activeControl.lookAt(A)
  21395. }
  21396. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21397. }
  21398. }
  21399. if (n === this.currentPano )
  21400. return void d();
  21401. this.flying = !0;
  21402. var _ = this.position.clone()
  21403. , b = this.currentPano;
  21404. Y.debug("Flying to pano ", n.position);
  21405. this.emit(W.PanoChosen, this.currentPano, n);
  21406. this.emit(W.FlyingStarted, n.position, _, n, b);
  21407. //this.updateHotVisible(n); //更新热点显示
  21408. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21409. Hot.updateVisibles([this.currentPano, n])
  21410. aimQua && G.start(function(e) {
  21411. y.copy(g),
  21412. H.quaternion(y, aimQua)(e),
  21413. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21414. this.cameraControls.activeControl.lookAt(A)
  21415. }
  21416. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21417. var w = c ? null : z[k.transition.movementEasing];
  21418. this.nextPano = n;
  21419. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21420. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21421. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21422. this.flying = !1,
  21423. this.currentPano !== n && this.currentPano.exit(),
  21424. n.enter(),
  21425. this.currentPano = n,
  21426. this.nextPano = null,
  21427. this.path.placeCpm(),
  21428. this.path.fadeOutCpm(k.path.fadeOutTime),
  21429. this.spider.draw(),
  21430. this.emit(W.FlyingEnded, n.position, _, n, b),
  21431. this.updateMarkerVisi();//add
  21432. d(e)
  21433. if(this.mode == "panorama" ){
  21434. //EditOverlay.updatePano()
  21435. editTool.hotpoint.updatePano()
  21436. Hot.updateVisibles([this.currentPano])
  21437. this.model.fadePanoMarkers()//add
  21438. }
  21439. }
  21440. .bind(this), 0, w, "camFly", q.FlyToPano)
  21441. }
  21442. }
  21443. ,
  21444. t.prototype.blackToPano = function(o={}) {//add 瞬间过渡
  21445. if(this.flying || this.isWarping() )return;
  21446. let pano = o.pano || this.model.panos.index[o.panoId]
  21447. if(this.mode != 'panorama'){
  21448. return this.flyToNewMode({
  21449. mode : 'panorama',
  21450. pano,
  21451. quaternion: o.quaternion
  21452. })
  21453. }
  21454. let oldPos = this.position.clone();
  21455. let oldPano = this.currentPano
  21456. this.path.warpDestPano = pano
  21457. var retry = ()=>{
  21458. this.waitingToWarp = !1,
  21459. this.blackToPano(o)
  21460. }
  21461. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  21462. return void (this.waitingToWarp = !0)
  21463. this.emit("pano.chosen", oldPano, pano)
  21464. console.log('blackToPano')
  21465. this.flying = true
  21466. this.nextPano = pano //提前加载高清图片
  21467. this.path.warpDestHeroLoc = {
  21468. panoId : o.panoId,
  21469. position: pano.position,
  21470. quaternion: o.quaternion || this.quaternion.clone()
  21471. }
  21472. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  21473. pano != this.currentPano && this.currentPano.exit()
  21474. pano.enter()
  21475. this.currentPano = pano
  21476. this.emit("flying.ended", pano.position, oldPos, pano, oldPano)
  21477. this.flying = false
  21478. this.nextPano = null
  21479. this.updateMarkerVisi();//add
  21480. console.log('blackToPano end')
  21481. } )
  21482. }
  21483. window._transitionPosId = 9999
  21484. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21485. G.cancelById(_transitionPosId)
  21486. var begin = function(object, pos, qua, scale){
  21487. if(pos){
  21488. if(!same(object.position, pos, 0.01)){
  21489. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21490. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21491. }
  21492. if(qua && !same(object.quaternion, qua, 1e-6)){
  21493. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21494. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21495. }
  21496. if(scale && !same(object.scale, scale, 0.001)){
  21497. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21498. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21499. }
  21500. }
  21501. }
  21502. var same = function(vec1, vec2, diff){
  21503. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21504. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21505. return s
  21506. }
  21507. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21508. /* this.model.hotGroup.children.forEach(overlay=>{
  21509. var panoData = overlay.transformAtPanos[sid]
  21510. var useCustom = !panoData
  21511. //if(overlay.usingTransformData || !useCustom){
  21512. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21513. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21514. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21515. overlay.getScaleBySize(panoData.width , panoData.height)
  21516. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21517. begin(overlay, pos, qua, scale )
  21518. //}
  21519. overlay.usingTransformData = !useCustom
  21520. }) */
  21521. for(let i in this.model.hots){//是否判断visible?
  21522. var hot = this.model.hots[i];
  21523. var panoData = hot.info.transformAtPanos[sid];
  21524. var useCustom = !panoData
  21525. //if(hot.usingTransformData || !useCustom){
  21526. var pos = useCustom ? hot.info.position : panoData.pos;
  21527. //var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  21528. begin(hot, pos/* , qua */ )
  21529. //}
  21530. //hot.usingTransformData = !useCustom;
  21531. }
  21532. }
  21533. window._tranOutsideFocus = 4399
  21534. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21535. console.log("focusPoint")
  21536. if(this.mode == "floorplan"){
  21537. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21538. var control = player.cameraControls.controls.floorplan;
  21539. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21540. var currentScale = control.absoluteScale;
  21541. var currentTarget = control.target.clone()
  21542. G.cancelById(window._tranOutsideFocus, true);
  21543. G.start(function(progress){
  21544. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  21545. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21546. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21547. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21548. }else if(player.mode == "dollhouse"){
  21549. var control = player.cameraControls.controls.dollhouse;
  21550. var radius = o.radius || 8;
  21551. var currentTarget = control.target.clone()
  21552. var dir = control.offset.clone().normalize()
  21553. var currentRadius = control.offset.length();
  21554. G.cancelById(window._tranOutsideFocus, true);
  21555. G.start(function(progress){
  21556. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21557. let radius_ = radius*progress+currentRadius*(1-progress)
  21558. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21559. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21560. }else if(this.mode == 'panorama'){
  21561. this.flyToPano({
  21562. lookAtPoint: o.aim.clone() ,
  21563. pano: this.currentPano,
  21564. aimDuration: o.dur || 600
  21565. })
  21566. }
  21567. }
  21568. t.prototype.fastForwardActivePanoFlight = function(e) {
  21569. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21570. G.adjustSpeed(q.FlyToPano, e),
  21571. G.adjustSpeed(q.LookTransition, e)
  21572. }
  21573. ,
  21574. t.prototype.flyToPanoClosestToMouse = function() {
  21575. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21576. this.intersect && this.updateClosestPano(this.intersect)),
  21577. this.closestPano)
  21578. return this.flyToPano({
  21579. pano: this.closestPano
  21580. });
  21581. var e = this.getMouseDirection();
  21582. this.flyDirection(e) || this.flyToPano({
  21583. pano: this.currentPano
  21584. })
  21585. }
  21586. ,
  21587. t.prototype.flyLocalDirection = function(e) {
  21588. var t = this.getDirection(e)
  21589. , i = 1 === e.z ? .4 : .75
  21590. , n = 1 === Math.abs(e.x);
  21591. return this.flyDirection(t, i, n)
  21592. }
  21593. ,
  21594. t.prototype.flyDirection = function(e, t, i) {
  21595. Hot.closePopup();//xzw add
  21596. var n = $.Deferred();
  21597. this.history.invalidate();
  21598. var r = this.closestPanoInDirection(e, t, i);
  21599. return r ? this.flyToPano({
  21600. pano: r
  21601. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21602. n.resolve(!1)),
  21603. n.promise()
  21604. }
  21605. ,
  21606. t.prototype.closestPanoInDirection = function(e, t, i) {
  21607. return this.rankedPanoInDirection(0, e, t, i)
  21608. }
  21609. ,
  21610. t.prototype.rankedPanoInDirection = (_ = {
  21611. pano: null,
  21612. candidates: []
  21613. },
  21614. function(e, t, i, n) {
  21615. e = e || 0,
  21616. i = void 0 !== i ? i : .75;
  21617. var r = n ? "angle" : "direction";
  21618. return this.model.panos.findRankedByScore(e,
  21619. [a.filters.isPanoAligned(),
  21620. a.filters.not(this.currentPano),
  21621. a.filters.isNeighbourPanoTo(this.currentPano),
  21622. a.filters.inPanoDirection(this.position, t, i)
  21623. ],
  21624. [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21625. this.cachedPanoCandidates = _.candidates,
  21626. _.pano
  21627. }
  21628. ),
  21629. t.prototype.bump = function(e) {
  21630. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21631. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21632. if (.5 < Math.abs(a))
  21633. t = function() {
  21634. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21635. }
  21636. .bind(this),
  21637. i = function() {
  21638. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21639. }
  21640. .bind(this);
  21641. else {
  21642. var s = this.camera.position.clone()
  21643. , l = e.clone();
  21644. this.raycaster.set(s, l);
  21645. var c = this.model.floors.reduce(function(e, t) {
  21646. return e.concat(t.collider.children)
  21647. }, [])
  21648. , h = this.raycaster.intersectObjects(c)
  21649. , u = 0 < h.length ? h[0].distance / 25 : .04
  21650. , d = s.clone().add(l.multiplyScalar(u));
  21651. t = function() {
  21652. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21653. }
  21654. .bind(this),
  21655. i = function() {
  21656. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21657. }
  21658. .bind(this)
  21659. }
  21660. n = function() {
  21661. this.flying = !1
  21662. }
  21663. .bind(this),
  21664. this.flying = !0,
  21665. t()
  21666. }
  21667. }
  21668. ,
  21669. t.prototype.changeFloor = function(e) {
  21670. if (!this.is360View(this.mode, this.currentPano))
  21671. if (this.mode === V.PANORAMA) {
  21672. var t = this.history.reversePano(e);
  21673. t && t.isAligned() ? this.flyToPano({
  21674. pano: t
  21675. }) : this.changeFloorByScore(e)
  21676. } else
  21677. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21678. }
  21679. ,
  21680. t.prototype.changeFloorByScore = (E = {
  21681. pano: null,
  21682. candidates: []
  21683. },
  21684. function(e) {
  21685. var t = this.model.nextFloor(e);
  21686. 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),
  21687. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21688. this.history.push(e, this.currentPano),
  21689. this.flyToPano({
  21690. pano: E.pano
  21691. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21692. }
  21693. ),
  21694. t.prototype.gotoFloor = function(e) {
  21695. var t = e - this.model.currentFloor.floorIndex;
  21696. this.changeFloor(t)
  21697. }
  21698. ,
  21699. t.prototype.getDirection = function(e) {
  21700. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21701. }
  21702. ,
  21703. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21704. if (r = r || $.Deferred(),
  21705. this.mode === V.TRANSITIONING)
  21706. return Y.warn("should not be transitioning here"),
  21707. n && n(!1),
  21708. r.reject().promise();
  21709. var o = i || !1
  21710. , a = i ? i.position : this.position
  21711. , s = this.position.clone()
  21712. , l = this.currentPano;
  21713. if (Y.debug("New pose in mode " + this.mode),
  21714. !e || (retryCallback = function() {
  21715. j.delayOneFrame(function() {
  21716. this.flyToSameMode(e, t, i, n, r)
  21717. }
  21718. .bind(this))
  21719. }
  21720. .bind(this),
  21721. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21722. var c = function() {
  21723. this.emit(W.FlyingEnded, a, s, e, l),
  21724. n && n(!0)
  21725. }
  21726. .bind(this)
  21727. , h = k[this.mode]
  21728. , u = void 0 !== t ? t : h.transitionTime
  21729. , d = new B.Vector3
  21730. , p = new B.Vector3;
  21731. if (this.emit(W.FlyingStarted, a, s, e, l),
  21732. this.mode === V.PANORAMA)
  21733. Y.warn("we should not be here for panorama views");
  21734. else if (this.mode === V.DOLLHOUSE)
  21735. if (o) {
  21736. var f = new B.Vector3(0,1,0);
  21737. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21738. this.model.warpDestFloors(i.floorVisibility),
  21739. p.copy(i.position);
  21740. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21741. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21742. , v = 3;
  21743. m.length ? (d.copy(m[0].point),
  21744. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21745. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21746. var y = (new B.Matrix4).lookAt(p, d, f)
  21747. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21748. , C = d.distanceTo(p)
  21749. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21750. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21751. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21752. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21753. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21754. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21755. this.path.burnsDir = Math.sign(b.y);
  21756. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21757. , T = new B.Vector3;
  21758. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21759. G.start(function(e, t) {
  21760. w.x = E.x + e * b.x,
  21761. w.y = E.y + e * b.y,
  21762. w.z = E.z + e * b.z;
  21763. var i = _ + e * (C - _);
  21764. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21765. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21766. }
  21767. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21768. G.start(function(e, t) {
  21769. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21770. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21771. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21772. }
  21773. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21774. } else
  21775. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21776. else if (this.path.placeCpm(),
  21777. this.path.fadeInCpm(k.path.fadeInTime),
  21778. i) {
  21779. this.model.warpDestFloors(i.floorVisibility);
  21780. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21781. , S = this.cameraControls.controls[V.FLOORPLAN]
  21782. , M = S.target.clone()
  21783. , R = i.position.clone().sub(M)
  21784. , P = x.position.clone().sub(S.target).length()
  21785. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21786. , L = Math.atan2(S.offset.x, S.offset.z)
  21787. , D = Math.atan2(O.x, O.z)
  21788. , N = S.absoluteScale
  21789. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21790. G.start(function(e, t) {
  21791. S.target.copy(R).multiplyScalar(e).add(M);
  21792. var i = L + (D - L) * e;
  21793. S.offset.x = P * Math.sin(i),
  21794. S.offset.z = P * Math.cos(i),
  21795. x.position.copy(S.target).add(S.offset),
  21796. S.absoluteScale = N + e * (F - N),
  21797. S.update(),
  21798. this.quaternion.copy(x.quaternion),
  21799. this.position.copy(x.position),
  21800. this.target.copy(S.target),
  21801. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21802. }
  21803. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21804. } else
  21805. Y.info("flyToSameMode() funny floorplan view? skipping");
  21806. return G.setTimeout(function(e) {
  21807. this.mode = e,
  21808. c(),
  21809. r.resolve(!0)
  21810. }
  21811. .bind(this, this.mode), u, q.FlyToSameMode),
  21812. this.mode = V.TRANSITIONING,
  21813. r.promise()
  21814. }
  21815. }
  21816. ,
  21817. t.prototype.flyToNewMode = function(e, t) {
  21818. Hot.closePopup();//xzw add
  21819. var i = (e = e || {}).mode
  21820. , n = e.pano
  21821. , r = e.duration
  21822. , o = e.warpDest
  21823. , a = e.callback
  21824. , s = e.force
  21825. , l = e.quaternion;
  21826. if (t = t || $.Deferred(),
  21827. this.isWarping())
  21828. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21829. a && a(!1),
  21830. t.reject("Cannot change mode during tour transition").promise();
  21831. if (this.mode === V.TRANSITIONING)
  21832. return a && a(!1),
  21833. t.reject("Cannot change mode during mode transition").promise();
  21834. if (i === this.mode)
  21835. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21836. t.promise()) : (a && a(!1),
  21837. t.reject("Already in " + i + " mode").promise());
  21838. var c = o || !1;
  21839. Y.debug("Switching mode to " + i);
  21840. var h = function() {
  21841. j.delayOneFrame(function() {
  21842. this.flyToNewMode(e, t)
  21843. }
  21844. .bind(this))
  21845. }
  21846. .bind(this);
  21847. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21848. return t.promise();
  21849. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)){
  21850. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21851. this.model.waitForLoad(this.model, function() {
  21852. return this.model.meshTexturesLoaded
  21853. }
  21854. .bind(this)),
  21855. this.model.loadMeshTextures().done(h),
  21856. t.promise();
  21857. }
  21858. this.history.invalidate()
  21859. this.updateLastView();
  21860. var u = this.mode
  21861. , d = this.cameraControls.cameras[i];
  21862. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21863. var p = void 0 !== r ? r : e.transitionTime;
  21864. this.emit(W.ModeChanging, u, i, n, p)
  21865. n && (this.currentPano = n)
  21866. this.switchCameraMode(i, l)
  21867. G.cancelById(q.LookTransition);
  21868. var f = (new B.Vector3).copy(this.position);
  21869. this.modeTran = this.mode + "-" + i;
  21870. /* if(editTool.atPanel == "screen"){
  21871. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21872. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21873. } */
  21874. if(i == "panorama"){
  21875. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21876. }else{
  21877. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21878. }
  21879. window.bus.dispatchEvent({type:'playerAndModelReady'})
  21880. this.ready = true
  21881. if (i === V.PANORAMA)
  21882. this.emit(W.PanoChosen, n, n),
  21883. setTimeout(function() {
  21884. n.floor.enter(i)
  21885. }
  21886. .bind(this), p / 2),
  21887. this.path.fadeOutCpm(k.path.fadeOutTime);
  21888. else if (i === V.DOLLHOUSE) {
  21889. if (c && (this.model.stayPut = !0),
  21890. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21891. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21892. this.path.placeCpm(),
  21893. this.path.fadeInCpm(k.path.fadeInTime),
  21894. c) {
  21895. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21896. f.set(15, 10, 15);
  21897. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21898. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21899. v.length ? (g.copy(v[0].point),
  21900. f.copy(o.position),
  21901. 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),
  21902. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21903. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21904. f.add(this.model.position),
  21905. d.position.copy(f),
  21906. this.cameraControls.controls[V.DOLLHOUSE].update()
  21907. }
  21908. } else if (this.path.placeCpm(),
  21909. this.path.fadeInCpm(k.path.fadeInTime),
  21910. o) {
  21911. this.model.warpDestFloors(o.floorVisibility);
  21912. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21913. , A = this.cameraControls.controls[V.FLOORPLAN]
  21914. , C = y.position.clone().sub(A.target)
  21915. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21916. , E = Math.atan2(I.x, I.z);
  21917. A.target.copy(o.position);
  21918. var _ = C.length();
  21919. A.offset.x = _ * Math.sin(E),
  21920. A.offset.y = 0,
  21921. A.offset.z = _ * Math.cos(E),
  21922. y.position.copy(A.target).add(A.offset),
  21923. A.target.clone().sub(d.position),
  21924. d.quaternion.copy(o.quaternion),
  21925. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21926. A.absoluteScale = A.currentScale,
  21927. A.update()
  21928. } else
  21929. this.model.currentFloor.enter(i);
  21930. var b = this.currentPano
  21931. , w = this.position.clone();
  21932. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21933. this.flying = !0,
  21934. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21935. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21936. d.controls.update()),
  21937. e.blackoutStyle = P.FADEIN,
  21938. p = k.show360Views.transitionTime,
  21939. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21940. this.mode = i,
  21941. this.path && this.path.popOutCpm(),
  21942. e.blackoutStyle = P.END,
  21943. p = k.show360Views.transitionTime,
  21944. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21945. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21946. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21947. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21948. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21949. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21950. G.setTimeout(function() {
  21951. this.flying = !1,
  21952. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21953. this.currentPano.enter(),
  21954. this.path.placeCpm(),
  21955. this.path.fadeOutCpm(k.path.fadeOutTime),
  21956. this.spider.draw()),
  21957. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21958. this.mode = i,
  21959. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21960. if (this.afterCModeFuc) {
  21961. //手动加的函数
  21962. var cf = this.afterCModeFuc;
  21963. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21964. cf();
  21965. }
  21966. this.updateMarkerVisi();//add
  21967. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  21968. if(this.mode == V.PANORAMA){
  21969. //EditOverlay.updatePano()
  21970. editTool.hotpoint.updatePano()
  21971. this.model.fadePanoMarkers()
  21972. Hot.updateVisibles([this.currentPano])
  21973. }else{
  21974. Hot.updateVisibles(true)
  21975. this.model.hotGroup.children.forEach(overlay=>{
  21976. if(overlay.animateInfo){
  21977. GifTexDeal.start(overlay.animation)
  21978. }
  21979. })
  21980. }
  21981. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21982. t.resolve())
  21983. }
  21984. .bind(this), p, q.FlyToNewMode),
  21985. this.mode = V.TRANSITIONING,
  21986. //EditOverlay.updatePano(),//add
  21987. editTool.hotpoint.updatePano(),//add
  21988. //u == "panorama" && this.updateHotVisible(),
  21989. t.promise()
  21990. }
  21991. ,
  21992. t.prototype.fade360View = function(e, t, i) {
  21993. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21994. $(this.domElement).fadeOut(.5 * e, function() {
  21995. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21996. this.model.alpha = i.modelAlpha,
  21997. this.position.copy(t.position),
  21998. this.quaternion.copy(t.quaternion),
  21999. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22000. $(this.domElement).fadeIn(.5 * e)
  22001. }
  22002. .bind(this))
  22003. }
  22004. ,
  22005. t.prototype.findDefaultViews = function() {
  22006. this.findDefaultView(this.lastInsideView, !0),
  22007. this.findDefaultView(this.last360View, !1)
  22008. }
  22009. ,
  22010. t.prototype.findDefaultView = function(e, i) {
  22011. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22012. if (e.cameraMode !== V.PANORAMA)
  22013. return !1;
  22014. var t = r.get(e.panoId);
  22015. return t && t.isAligned() === i
  22016. });
  22017. 0 <= o ? (t = r.get(n[o].panoId),
  22018. e.update({
  22019. cameraMode: V.PANORAMA,
  22020. pano: t,
  22021. position: n[o].position,
  22022. quaternion: n[o].quaternion
  22023. })) : 0 <= (o = r.list.findIndex(function(e) {
  22024. return e.isAligned() === i
  22025. })) ? (t = r.list[o],
  22026. e.update({
  22027. cameraMode: V.PANORAMA,
  22028. pano: t,
  22029. position: t.position
  22030. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22031. }
  22032. ,
  22033. t.prototype.updateLastView = function() {
  22034. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22035. pano: this.currentPano,
  22036. position: this.position,
  22037. quaternion: this.quaternion
  22038. })
  22039. }
  22040. ,
  22041. t.prototype.goToLastView = function(e, t) {
  22042. var i = $.Deferred()
  22043. , n = i.resolve.bind(i)
  22044. , r = i.reject.bind(i)
  22045. , o = e ? this.lastInsideView : this.last360View;
  22046. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22047. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22048. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22049. mode: o.cameraMode,
  22050. pano: o.pano,
  22051. quaternion: o.quaternion,
  22052. callback: t
  22053. }).done(n).fail(r),
  22054. i.promise()
  22055. }
  22056. ,
  22057. t.prototype.fadeToView = function(e, t, i, n) {
  22058. var r = $.Deferred()
  22059. , o = r.resolve.bind(r)
  22060. , a = r.reject.bind(r);
  22061. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22062. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22063. a("Cannot go to illegal view"),
  22064. r.promise();
  22065. var s = (k[t.cameraMode],
  22066. function() {
  22067. $(this.domElement).fadeIn(.5 * i),
  22068. n && n(),
  22069. o()
  22070. }
  22071. .bind(this))
  22072. , l = e ? P.FADEIN : P.END;
  22073. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22074. $(this.domElement).fadeOut(.5 * i, function() {
  22075. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22076. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22077. pano: t.pano,
  22078. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22079. duration: 0
  22080. }, s) : this.flyToNewMode({
  22081. mode: t.cameraMode,
  22082. quaternion: t.quaternion,
  22083. duration: 0,
  22084. callback: s
  22085. })
  22086. }
  22087. .bind(this)),
  22088. r.promise()
  22089. }
  22090. ,
  22091. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22092. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22093. this.flying)
  22094. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22095. o && o(),
  22096. !1;
  22097. null != e || (e = M.Show),
  22098. this.history.invalidate(),
  22099. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22100. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22101. return this.emit(W.WarpStarted, a, i, n, r),
  22102. n = n || P.MIDDLE,
  22103. this.path.warpToPano(i, n, r, function() {
  22104. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22105. this.emit(W.WarpEnded, i),
  22106. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22107. o && o()
  22108. }
  22109. .bind(this)),
  22110. e === M.Hide && this.path.discardPathObject(),
  22111. !0
  22112. }
  22113. ,
  22114. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22115. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22116. s && s(),
  22117. !1)
  22118. }
  22119. ,
  22120. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22121. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22122. a && a(),
  22123. !1)
  22124. }
  22125. ,
  22126. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22127. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22128. }
  22129. ,
  22130. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22131. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22132. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22133. t && t(),
  22134. !1)
  22135. }
  22136. ,
  22137. t.prototype.aimTourCamera = function(e, t, i, n) {
  22138. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22139. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22140. }
  22141. ,
  22142. t.prototype.showPathToHeroLocation = function(e) {
  22143. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22144. }
  22145. ,
  22146. t.prototype.tourInterlude = function(e, t) {
  22147. this.history.invalidate(),
  22148. this.path.discardSlow();
  22149. var defaultRotTime = DATA.tourRotTime * 1000
  22150. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  22151. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  22152. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  22153. var rotTime
  22154. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  22155. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  22156. var hasMusic = currentLocation0.musicInfo && currentLocation0.musicInfo.music
  22157. if(hasMusic){
  22158. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  22159. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22160. rotTime = currentLocation0.musicInfo.time - current
  22161. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22162. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22163. }
  22164. }else{
  22165. rotTime = defaultRotTime
  22166. }
  22167. rotTime = Math.max(0, rotTime)
  22168. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''))
  22169. }else{
  22170. rotTime = currentLocation.rotTime * 1000
  22171. console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  22172. }
  22173. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22174. t && t()
  22175. }
  22176. .bind(this), rotTime)
  22177. }
  22178. ,
  22179. t.prototype.stopInterlude = function() {
  22180. this.interruptAndFastForward(null, 0)
  22181. }
  22182. ,
  22183. t.prototype.interruptAndFastForward = function(e, t) {
  22184. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22185. this.flying && this.emit(W.FlyingInterrupted),
  22186. this.path.interruptAndFastForward(e, t)
  22187. }
  22188. ,
  22189. t.prototype.setSize = function(e, t) {
  22190. var i = e / t;
  22191. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22192. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22193. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22194. this.cameraControls.cameras) {
  22195. var o = this.cameraControls.cameras[r];
  22196. o.fov = this.baseFov * (1 / this.zoomLevel),
  22197. o.updateAspect(i)
  22198. }
  22199. }
  22200. ,
  22201. t.prototype.toJSON = function() {
  22202. var e = {};
  22203. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22204. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22205. return e.hidden ? 0 : 1
  22206. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22207. e
  22208. }
  22209. ,
  22210. t.prototype.getCurrentNodePanos = function(e) {
  22211. if (this.model.panos.map,
  22212. e.length = 0,
  22213. this.path.nodes)
  22214. for (var t = 0; t < this.path.nodes.length; t++) {
  22215. var i = this.path.nodes[t];
  22216. e.push(this.model.panos.get(i))
  22217. }
  22218. }
  22219. ,
  22220. t.prototype.zoomIncrementally = function(e) {
  22221. var t = this.zoomLevel;
  22222. this.zoomTo(this.zoomLevel + e),
  22223. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22224. }
  22225. ,
  22226. t.prototype.zoomInIncrementally = function(e) {
  22227. e = e || this.defaultZoomIncrement,
  22228. this.zoomIncrementally(e)
  22229. }
  22230. ,
  22231. t.prototype.zoomOutIncrementally = function(e) {
  22232. e = e || -this.defaultZoomIncrement,
  22233. this.zoomIncrementally(e)
  22234. }
  22235. ,
  22236. t.prototype.zoomBy = function(e) {
  22237. this.zoomTo(this.zoomLevel * e)
  22238. }
  22239. ,
  22240. t.prototype.zoomIn = function() {
  22241. this.zoomBy(1 + this.zoomSpeed)
  22242. }
  22243. ,
  22244. t.prototype.zoomOut = function() {
  22245. this.zoomBy(1 - this.zoomSpeed)
  22246. }
  22247. ,
  22248. t.prototype.zoomTo = function(e, t) {
  22249. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22250. e > k.zoom.max && (e = k.zoom.max),
  22251. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22252. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22253. e === k.zoom.min && this.emit(m.ZoomMin)),
  22254. this.cameraControls.activeControl)) {
  22255. var i = this.cameraControls.activeControl.camera;
  22256. this.zoomLevel = e,
  22257. i.fov = this.baseFov * (1 / this.zoomLevel),
  22258. i.updateProjectionMatrix(),
  22259. this.zoomFov = i.fov
  22260. }
  22261. }
  22262. ,
  22263. t.prototype.increaseZoomSpeed = function() {
  22264. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22265. }
  22266. ,
  22267. t.prototype.decreaseZoomSpeed = function() {
  22268. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22269. }
  22270. ,
  22271. t.prototype.clampZoomSpeed = function(e) {
  22272. return e < 0 ? 0 : e
  22273. }
  22274. ,
  22275. t.prototype.activatePersistentZooming = function(e) {
  22276. this.zooming = e ? 1 : -1
  22277. }
  22278. ,
  22279. t.prototype.deactivatePersistentZooming = function() {
  22280. this.zooming = 0
  22281. }
  22282. ,
  22283. t.prototype.zoomDefault = function() {
  22284. this.zoomTo(1, !0)
  22285. }
  22286. window.fovTranId = 333;//add
  22287. t.prototype.smoothZoomToDefault = function(e, t) {
  22288. G.cancelById(window.fovTranId)
  22289. var i, n = this.zoomLevel, r = function(e) {
  22290. 1 < e && (e = 1),
  22291. i = n * (1 - e) + e,
  22292. this.zoomTo(i, !0)
  22293. }
  22294. .bind(this), o = function() {
  22295. this.zoomDefault(),
  22296. t && window.setTimeout(t, 50)
  22297. }
  22298. .bind(this);
  22299. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22300. }
  22301. ,
  22302. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22303. G.cancelById(window.fovTranId)
  22304. var i,
  22305. n = this.zoomLevel,
  22306. aimLevel = zoomLevel || this.baseFov / fov
  22307. if (n == aimLevel) return
  22308. var fun = function (e) {
  22309. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22310. }.bind(this)
  22311. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22312. }
  22313. ,
  22314. t.prototype.updateZoomPano = function() {
  22315. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22316. var e = this.currentPano;
  22317. if (e) {
  22318. var t = this.zoomLevel > k.zoom.activationThreshold
  22319. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22320. t);
  22321. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22322. this.panoRenderer.setZoomingActive(i, e, !0);
  22323. var n = function(e, t) {
  22324. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22325. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22326. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22327. e.setZoomed(t)
  22328. }
  22329. .bind(this);
  22330. i && !e.zoomed ? (n(e, !0),
  22331. this.panoRenderer.enableUltraHighQualityMode(function() {
  22332. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22333. i && n(e, !0)
  22334. }
  22335. .bind(this))) : !t && e.zoomed && n(e, !1)
  22336. }
  22337. }
  22338. },
  22339. //--------
  22340. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22341. var f2;
  22342. if (this.mode == mode) {
  22343. f1 && f1()
  22344. } else {
  22345. f2 = f1;
  22346. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22347. this.afterCModeFuc = function() {
  22348. this.afterCModeFuc = f2
  22349. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22350. }.bind(this)
  22351. } else {
  22352. this.afterCModeFuc = f2;//飞入后执行
  22353. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22354. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22355. }catch(e){}
  22356. }
  22357. }
  22358. }
  22359. ,
  22360. t.prototype.checkHasNeighbor = function(pano){//add
  22361. for(var i in pano.neighbourPanos ){
  22362. if(i == pano.id)continue;
  22363. if(pano.neighbourPanos[i]){
  22364. return true;
  22365. }
  22366. }
  22367. }
  22368. ,
  22369. ee.exports = t
  22370. }
  22371. ).call(this, "/js/player.js")
  22372. }
  22373. , {
  22374. "./constants": 8,
  22375. "./enum/AlignmentType": 17,
  22376. "./enum/BlackoutStyle": 18,
  22377. "./enum/ControlEvents": 21,
  22378. "./enum/Keys": 30,
  22379. "./enum/ModelManagerEvents": 33,
  22380. "./enum/PanoSizeClass": 36,
  22381. "./enum/PanoramaEvents": 37,
  22382. "./enum/PathDiscardMode": 38,
  22383. "./enum/PathDisplayMode": 39,
  22384. "./enum/PlayerEvents": 40,
  22385. "./enum/TagStates": 44,
  22386. "./enum/Vectors": 50,
  22387. "./enum/Viewmode": 51,
  22388. "./enum/WarpStyle": 52,
  22389. "./enum/ZoomEvents": 53,
  22390. "./exception/BasicException": 55,
  22391. "./model/ModelManager": 140,
  22392. "./objects/NSpider": 147,
  22393. "./objects/Panorama": 148,
  22394. "./objects/Reticule": 149,
  22395. "./objects/ShowPath": 151,
  22396. "./objects/Snapshot": 153,
  22397. "./objects/View": 154,
  22398. "./settings": 166,
  22399. "./shaders": 167,
  22400. "./tile/TileDownloader": 171,
  22401. "./tile/TilePrioritizer": 172,
  22402. "./util/ZoomStats": 179,
  22403. "./util/browser": 182,
  22404. "./util/camera": 183,
  22405. "./util/cameraLight": 184,
  22406. "./util/common": 185,
  22407. "./util/easing": 186,
  22408. "./util/history": 187,
  22409. "./util/lerp": 188,
  22410. "./util/logger": 189,
  22411. "./util/math": 190,
  22412. "./util/transitions": 195,
  22413. // hot: "hot",
  22414. scaleImg: "scaleImg",
  22415. events: 202,
  22416. three: 217
  22417. }],
  22418. scaleImg: [function(e, t) {
  22419. var i = t;
  22420. (function() {
  22421. function e(e, t, i, n) {
  22422. function r() {
  22423. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22424. U.height = p,
  22425. H = U.getContext("2d")
  22426. }
  22427. function o(e) {
  22428. if (e) {
  22429. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22430. for (t = 0; t < ie; t += 4)
  22431. n[t] = e[t] * ne | 0,
  22432. n[t + 1] = e[t + 1] * ne | 0,
  22433. n[t + 2] = e[t + 2] * ne | 0,
  22434. n[t + 3] = e[t + 3] * ne | 0;
  22435. return delete e,
  22436. i
  22437. }
  22438. return H.getImageData(0, 0, d, p)
  22439. }
  22440. function a(e, t, i, n, r) {
  22441. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22442. }
  22443. var s, l;
  22444. if (t || (t = e.input,
  22445. i = e.output,
  22446. n = e.inputRemovable,
  22447. e.scale && (e = e.scale)),
  22448. t.src)
  22449. if (s = document.createElement("canvas"),
  22450. null != t.naturalWidth)
  22451. s.width = t.naturalWidth,
  22452. s.height = t.naturalHeight;
  22453. else if (null != t.runtimeStyle) {
  22454. var c = t.runtimeStyle
  22455. , h = c.width
  22456. , u = c.height;
  22457. c.width = "auto",
  22458. c.height = "auto",
  22459. s.width = t.width,
  22460. s.height = t.height,
  22461. c.width = h,
  22462. c.height = u
  22463. } else {
  22464. h = t.width,
  22465. u = t.height;
  22466. t.removeAttribute && (t.removeAttribute("width"),
  22467. t.removeAttribute("height")),
  22468. s.width = t.width,
  22469. s.height = t.height,
  22470. t.width = h,
  22471. t.height = u
  22472. }
  22473. else
  22474. s = t;
  22475. l = s.getContext("2d"),
  22476. t.src && l.drawImage(t, 0, 0);
  22477. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22478. if (!f || !g)
  22479. return !1;
  22480. (t.src || n) && s.clearRect(0, 0, f, g),
  22481. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22482. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22483. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22484. e * g + .5 | 0);
  22485. 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;
  22486. if (1 < re || 1 < oe)
  22487. for (r(),
  22488. G = (z = o()).data,
  22489. C = 0; C < p; C++)
  22490. for (V = (y = C / oe) - (w = 0 | y),
  22491. j = w * $,
  22492. W = w < 1 ? j : j - $,
  22493. w < g - 2 ? (Y = j + $,
  22494. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22495. A = 0; A < d; A++,
  22496. te += 4)
  22497. Z = (b = 0 | (v = A / re)) << 2,
  22498. b < f - 2 ? (K = Z + 4,
  22499. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22500. 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,
  22501. ++Z,
  22502. ++K,
  22503. ++Q,
  22504. 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,
  22505. ++Z,
  22506. ++K,
  22507. ++Q,
  22508. 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,
  22509. ++Z,
  22510. ++K,
  22511. ++Q,
  22512. 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,
  22513. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22514. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22515. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22516. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22517. else {
  22518. if (le.Float32Array)
  22519. L = new Float32Array(ie);
  22520. else
  22521. for (L = [],
  22522. te = 0; te < ie; ++te)
  22523. L[te] = 0;
  22524. for (y = 0; y < g; y++)
  22525. for (I = (_ = 0 | (C = y * oe)) * J,
  22526. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22527. R = C + oe - _ - 1),
  22528. v = 0; v < f; v++,
  22529. ee += 4)
  22530. switch (A = v * re,
  22531. E = 0 | A,
  22532. te = I + (E << 2),
  22533. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22534. P && (x = 1 + E - A,
  22535. S = A + re - E - 1),
  22536. D = m[ee],
  22537. F = m[ee + 1],
  22538. B = m[ee + 2],
  22539. N = m[ee + 3],
  22540. P + O) {
  22541. case 0:
  22542. L[te] += D * ae,
  22543. L[te + 1] += F * ae,
  22544. L[te + 2] += B * ae,
  22545. L[te + 3] += N * ae;
  22546. break;
  22547. case 1:
  22548. T = x * oe,
  22549. L[te] += D * T,
  22550. L[te + 1] += F * T,
  22551. L[te + 2] += B * T,
  22552. L[te + 3] += N * T,
  22553. T = S * oe,
  22554. L[te + 4] += D * T,
  22555. L[te + 5] += F * T,
  22556. L[te + 6] += B * T,
  22557. L[te + 7] += N * T;
  22558. break;
  22559. case 2:
  22560. T = re * M,
  22561. L[te] += D * T,
  22562. L[te + 1] += F * T,
  22563. L[te + 2] += B * T,
  22564. L[te + 3] += N * T,
  22565. T = re * R,
  22566. L[te += J] += D * T,
  22567. L[te + 1] += F * T,
  22568. L[te + 2] += B * T,
  22569. L[te + 3] += N * T;
  22570. break;
  22571. default:
  22572. T = x * M,
  22573. L[te] += D * T,
  22574. L[te + 1] += F * T,
  22575. L[te + 2] += B * T,
  22576. L[te + 3] += N * T,
  22577. T = S * M,
  22578. L[te + 4] += D * T,
  22579. L[te + 5] += F * T,
  22580. L[te + 6] += B * T,
  22581. L[te + 7] += N * T,
  22582. T = x * R,
  22583. L[te += J] += D * T,
  22584. L[te + 1] += F * T,
  22585. L[te + 2] += B * T,
  22586. L[te + 3] += N * T,
  22587. T = S * R,
  22588. L[te + 4] += D * T,
  22589. L[te + 5] += F * T,
  22590. L[te + 6] += B * T,
  22591. L[te + 7] += N * T
  22592. }
  22593. delete m,
  22594. r(),
  22595. z = o(L)
  22596. }
  22597. if (H.putImageData(z, 0, 0),
  22598. "string" == typeof i) {
  22599. var se;
  22600. if ("png" === i || "jpeg" === i)
  22601. return (se = n && t.src ? t : new Image).width = d,
  22602. se.height = p,
  22603. se.src = U.toDataURL("image/" + i, .85),
  22604. se;
  22605. if ("png-src" === i || "jpeg-src" === i)
  22606. return U.toDataURL("image/" + i.split("-")[0], .85)
  22607. }
  22608. return U
  22609. }
  22610. var le = this;
  22611. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22612. exports.scale = e) : c = e
  22613. }
  22614. ).call(this),
  22615. i.exports = c
  22616. }
  22617. , {}],
  22618. 156: [function(i, n, e) {
  22619. (function(e) {
  22620. "use strict";
  22621. function t(e, t) {
  22622. this.model = e,
  22623. this.panos = e.panos,
  22624. this.player = t,
  22625. this.imagePanos = this.listImagePanos(),
  22626. this.retryMinimumTime = 1e4
  22627. }
  22628. var r = (i("three"),
  22629. i("./enum/Viewmode"))
  22630. , o = (i("./settings"),
  22631. i("./objects/Panorama"))
  22632. , a = new (i("./util/logger"))(e);
  22633. t.prototype.start = function() {
  22634. this.loadNextPano(function(e) {
  22635. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22636. setTimeout(function() {
  22637. this.start()
  22638. }
  22639. .bind(this), 1e3))
  22640. }
  22641. .bind(this))
  22642. }
  22643. ,
  22644. t.prototype.validLoadTarget = function(e) {
  22645. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22646. }
  22647. ,
  22648. t.prototype.listImagePanos = function() {
  22649. var i = []
  22650. , n = this;
  22651. return this.model.images.forEach(function(e) {
  22652. if (e.metadata && e.metadata.scan_id) {
  22653. var t = n.model.panos.get(e.metadata.scan_id);
  22654. t && !t.isLoaded("high") && i.push(t)
  22655. }
  22656. }),
  22657. i
  22658. }
  22659. ,
  22660. t.prototype.nextNotLoadedImage = function() {
  22661. for (; 0 < this.imagePanos.length; ) {
  22662. var e = this.imagePanos[0];
  22663. if (!e.isLoaded("high"))
  22664. return e;
  22665. this.imagePanos.shift()
  22666. }
  22667. return null
  22668. }
  22669. ,
  22670. t.prototype.loadNextPano = function(e) {
  22671. var t, i, n = this.model.waitQueue.filter(function(e) {
  22672. return e.object instanceof o
  22673. });
  22674. 0 < n.length ? (t = n[0].object,
  22675. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22676. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22677. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22678. t = this.imagePanos[0],
  22679. 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),
  22680. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22681. a.debug("Preloading " + i + "-res pano " + t.id),
  22682. t.loadCube(i).done(e).fail(function() {
  22683. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22684. e()
  22685. })) : e && e(null)
  22686. }
  22687. ,
  22688. n.exports = t
  22689. }
  22690. ).call(this, "/js/preloaders.js")
  22691. }
  22692. , {
  22693. "./enum/Viewmode": 51,
  22694. "./objects/Panorama": 148,
  22695. "./settings": 166,
  22696. "./util/logger": 189,
  22697. three: 217
  22698. }],
  22699. 157: [function(a, s, e) {
  22700. (function(e) {
  22701. "use strict";
  22702. function t(e, t, i, n, r) {
  22703. this.qualityManager = e,
  22704. this.scene = t,
  22705. this.camera = i,
  22706. this.container = r,
  22707. this.controls = n,
  22708. this.controls.enabled = !0,
  22709. this.controls.locked = !0,
  22710. this.quickstartCamera = n.camera,
  22711. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22712. this.skybox = null
  22713. }
  22714. var i = a("three")
  22715. , n = a("../util/logger")
  22716. , o = a("../constants")
  22717. , h = (a("../util/transitions"),
  22718. a("../util/lerp"),
  22719. a("../util/easing"),
  22720. a("../enum/Vectors"))
  22721. , u = a("../enum/PanoSizeClass")
  22722. , r = (a("../materials/ModelTextureMaterial"),
  22723. a("../materials/CubemapMaterial"))
  22724. , d = (a("../cameras/PanoramaCamera"),
  22725. a("../controls/PanoramaControls"),
  22726. a("../tile/TileUtils"),
  22727. a("../util/camera"),
  22728. a("../util/cameraLight"))
  22729. , p = (a("../util/browser"),
  22730. a("../settings"),
  22731. a("../gui/helpManager"),
  22732. new n(e));
  22733. t.prototype.load = function(e) {
  22734. e.pano.shouldRedrawOnBaseLoaded = !0;
  22735. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22736. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22737. var a = this.qualityManager.getPanoSize(u.BASE)
  22738. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22739. if (e.pano.tiled) {
  22740. p.warn("Loading startPano, TILED", e.pano.id);
  22741. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22742. , c = this.quickstartCamera.fov;
  22743. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22744. t = e.pano.loadTiledPano(s, r, {
  22745. hFov: l,
  22746. vFov: c
  22747. }, !1, !1, !0),
  22748. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22749. } else
  22750. p.warn("Loading startPano", e.pano.id),
  22751. t = e.pano.loadCube("high");
  22752. return $.when(t).then(function() {
  22753. n.init(e.pano, e.quaternion),
  22754. e.pano.tiled ? i.done(function() {
  22755. e.pano.lockUntilRenderingComplete = !1,
  22756. this.controls.locked = !1
  22757. }
  22758. .bind(this)) : this.controls.locked = !1
  22759. }
  22760. .bind(this))
  22761. }
  22762. ,
  22763. t.prototype.init = function(e, t) {
  22764. p.info("Quickstart done loading, adding scene objects"),
  22765. e.lockUntilRenderingComplete = !0,
  22766. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22767. side: i.BackSide
  22768. })),
  22769. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22770. this.skybox.quaternion.copy(e.quaternion),
  22771. this.scene.add(this.skybox),
  22772. $(this.container).show()
  22773. }
  22774. ,
  22775. t.prototype.update = function(e) {
  22776. this.controls.update(e),
  22777. this.camera.copy(this.quickstartCamera)
  22778. }
  22779. ,
  22780. t.prototype.setSize = function(e, t) {
  22781. this.quickstartCamera.updateAspect(e / t)
  22782. }
  22783. ,
  22784. t.prototype.destroy = function() {
  22785. this.scene.remove(this.skybox)
  22786. }
  22787. ,
  22788. s.exports = t
  22789. }
  22790. ).call(this, "/js/scene/QuickstartManager.js")
  22791. }
  22792. , {
  22793. "../cameras/PanoramaCamera": 7,
  22794. "../constants": 8,
  22795. "../controls/PanoramaControls": 13,
  22796. "../enum/PanoSizeClass": 36,
  22797. "../enum/Vectors": 50,
  22798. "../gui/helpManager": 68,
  22799. "../materials/CubemapMaterial": 117,
  22800. "../materials/ModelTextureMaterial": 118,
  22801. "../settings": 166,
  22802. "../tile/TileUtils": 174,
  22803. "../util/browser": 182,
  22804. "../util/camera": 183,
  22805. "../util/cameraLight": 184,
  22806. "../util/easing": 186,
  22807. "../util/lerp": 188,
  22808. "../util/logger": 189,
  22809. "../util/transitions": 195,
  22810. three: 217
  22811. }],
  22812. 158: [function(e, t, i) {
  22813. "use strict";
  22814. function h(e, t, i) {
  22815. this.scene = e,
  22816. this.camera = t,
  22817. this.renderer = null,
  22818. this.effects = i,
  22819. this.animateCallback = null,
  22820. this.composer = null,
  22821. this.qualityManager = null,
  22822. e.renderWidth = 0,
  22823. e.renderHeight = 0,
  22824. this.updateClock = new M.Clock,
  22825. this.components = [],
  22826. this.updateListeners = [],
  22827. this.resizeListeners = [],
  22828. this.forceUpdateSize = !1,
  22829. this.started = !1,
  22830. this.textures = {},
  22831. this.suspendedObjects = []
  22832. }
  22833. 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;
  22834. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22835. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22836. this.components.push(e),
  22837. e.update && this.updateListeners.push(e),
  22838. e.setSize && (this.resizeListeners.push(e),
  22839. this.forceUpdateSize = !0)
  22840. }
  22841. ,
  22842. h.prototype.removeComponent = function(t) {
  22843. function e(e) {
  22844. return e !== t
  22845. }
  22846. this.components = this.components.filter(e),
  22847. this.updateListeners = this.updateListeners.filter(e),
  22848. this.resizeListeners = this.resizeListeners.filter(e)
  22849. }
  22850. ,
  22851. h.prototype.start = function(e) {
  22852. if (this.started)
  22853. throw new l("Can't start SceneRenderer, already started");
  22854. this.createContext(e),
  22855. //u.isMobile() && this.boluoVrInit(),
  22856. this.initComposer(),
  22857. this.started = !0,
  22858. (b = b.bind(this))()
  22859. }
  22860. ,
  22861. h.prototype.createContext = function(e) {
  22862. try {
  22863. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22864. this.renderer.autoClear = !0,
  22865. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22866. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22867. this.emit(r.ContextCreated)
  22868. } catch (e) {
  22869. throw new c("Unable to create a WebGL rendering context")
  22870. }
  22871. d.profiling.enabled && this.overrideTextures(),
  22872. e.appendChild(this.renderer.domElement)
  22873. }
  22874. ,
  22875. h.prototype.overrideTextures = function() {
  22876. var d = this.renderer.context
  22877. , t = 0
  22878. , i = d.createTexture;
  22879. d.createTexture = function() {
  22880. var e = i.call(d);
  22881. return e.id = t++,
  22882. this.textures[e.id] = e
  22883. }
  22884. .bind(this);
  22885. var p = d.texImage2D;
  22886. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22887. var c, h = this.getTextureTypeFromTarget(d, e);
  22888. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22889. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22890. s = r,
  22891. n = (l = o).naturalWidth,
  22892. r = l.naturalHeight,
  22893. p.call(d, e, t, i, a, s, l));
  22894. var u = this.textures[c.id];
  22895. u.width = h === f.TextureCube ? 6 * n : n,
  22896. u.height = r
  22897. }
  22898. .bind(this);
  22899. var n = d.deleteTexture;
  22900. d.deleteTexture = function(e) {
  22901. delete this.textures[e.id],
  22902. n.call(d, e)
  22903. }
  22904. .bind(this)
  22905. }
  22906. ,
  22907. h.prototype.updateTextureMemory = (n = null,
  22908. function() {
  22909. var e = 0;
  22910. for (var t in this.textures) {
  22911. var i = this.textures[t];
  22912. i.width && i.height && (e += i.width * i.height * 4)
  22913. }
  22914. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22915. n = e
  22916. }
  22917. ),
  22918. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22919. switch (t) {
  22920. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22921. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22922. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22923. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22924. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22925. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22926. return f.TextureCube;
  22927. case e.TEXTURE_2D:
  22928. return f.Texture2D;
  22929. default:
  22930. return null
  22931. }
  22932. }
  22933. ,
  22934. h.prototype.initComposer = function() {
  22935. this.composer = new M.EffectComposer(this.renderer),
  22936. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22937. /* this.composer.addPass(this.effects.hblurPass),
  22938. this.composer.addPass(this.effects.vblurPass) */
  22939. this.composer.addPass(this.effects.transitionMaskPass)//add
  22940. }
  22941. ,
  22942. h.prototype.setSize = function(e, t, i) {
  22943. this.renderWidth = e,
  22944. this.renderHeight = t,
  22945. this.effects.aspect = e / t,
  22946. this.renderer.setSize(e, t, !1, i),
  22947. this.composer.setSize(e, t);
  22948. for (var n = 0; n < this.resizeListeners.length; n++)
  22949. this.resizeListeners[n].setSize(e, t)
  22950. }
  22951. ,
  22952. h.prototype.render = function() {
  22953. this.effects.transitionMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22954. }
  22955. ,
  22956. h.prototype.boluoVrInit = function() {
  22957. console.log("boluoVrInit"),
  22958. this.isHuawei5X = u.detectHUAWEI5X(),
  22959. this.oldRenderer = this.renderer,
  22960. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22961. window.panoCamera = this.camera;
  22962. var i = this;
  22963. window._vrEnabled = !1,
  22964. Object.defineProperty(window, "vrEnabled", {
  22965. get: function() {
  22966. return window._vrEnabled
  22967. },
  22968. set: function(e) {
  22969. (e = !!e) ? (i.renderer = i.newRenderer,
  22970. window.vrMarkers.forEach(function(e) {
  22971. e.visible = !0
  22972. })) : (i.renderer = i.oldRenderer,
  22973. window.vrMarkers.forEach(function(e) {
  22974. e.visible = !1
  22975. })),
  22976. i.cursor.visible = e,
  22977. i.setSize($("#player").width(), $("#player").height()),
  22978. window._vrEnabled = e,
  22979. setTimeout(function() {
  22980. console.log(player.cameraControls.activeControl.camera.fov)
  22981. }, 500)
  22982. }
  22983. }),
  22984. this.createCursor(.5, !1, 1, 16777215, 0);
  22985. var e = {
  22986. setSize: function(e, t) {
  22987. i.camera.aspect = e / t
  22988. }
  22989. };
  22990. this.resizeListeners.push(e),
  22991. this.vrLoadingInit()
  22992. }
  22993. ,
  22994. h.prototype.vrLoadingInit = function() {
  22995. var e = new (e = function(camera) {
  22996. var t = this
  22997. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22998. , i = new M.MeshBasicMaterial({
  22999. color: 4967932,
  23000. side: M.DoubleSide
  23001. })
  23002. , n = new M.Mesh(e,i);
  23003. (this.mesh = n).position.z = -2,
  23004. n.scale.set(.08, .08, .08),
  23005. n.visible = !1,
  23006. //window.player.camera.add(n),
  23007. camera.add(n),
  23008. t.enabled = !1,
  23009. this.update = function(e) {
  23010. 1 == t.enabled && (n.rotation.z += 15 * e)
  23011. }
  23012. }
  23013. )(this.camera);
  23014. window.Loading = e,
  23015. this.updateListeners.push(e)
  23016. }
  23017. ,
  23018. h.prototype.createCursor = function(e, t, i, n, r) {
  23019. var o, a = new M.SpriteMaterial({
  23020. opacity: i,
  23021. color: n,
  23022. transparent: t,
  23023. map: this.boluoGetTexture("images/cursor.png"),
  23024. needsUpdate: !0,
  23025. side: M.DoubleSide
  23026. });
  23027. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23028. a.map.repeat = new M.Vector2(1 / 17,1),
  23029. a.depthTest = !1,
  23030. a.blending = M.AdditiveBlending,
  23031. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23032. o.position.z = -2,
  23033. o.visible = !1,
  23034. o.name = "cursor",
  23035. this.camera.add(o),
  23036. this.scene.add(this.camera),
  23037. this.cursor = o;
  23038. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23039. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23040. this.updateListeners.push(s)
  23041. }
  23042. ,
  23043. h.prototype.CursorAnimation = function(e, t, o) {
  23044. this.cursor = t,
  23045. this.raycaster = new M.Raycaster,
  23046. this.targetEventObj = {},
  23047. this.type = 1,
  23048. this.tweenFlag = !0;
  23049. var s = this;
  23050. this.target = o,
  23051. console.log(o.uuid),
  23052. this.euler = new M.Euler,
  23053. this.q0 = new M.Quaternion,
  23054. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23055. this.zee = new M.Vector3(0,0,1),
  23056. this.alpha = -1e3,
  23057. this.beta = -1e3,
  23058. this.gamma = -1e3,
  23059. this.orient = M.Math.degToRad(window.orientation || 0),
  23060. window.addEventListener("orientationchange", function() {
  23061. s.orient = M.Math.degToRad(window.orientation || 0)
  23062. }),
  23063. window.addEventListener("deviceorientation", function(e) {
  23064. var t = M.Math.degToRad(e.alpha)
  23065. , i = M.Math.degToRad(e.beta)
  23066. , n = M.Math.degToRad(e.gamma);
  23067. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23068. -1e3 === s.beta && (s.beta = i),
  23069. -1e3 === s.gamma && (s.gamma = n),
  23070. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23071. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23072. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23073. s.beta = i,
  23074. s.gamma = n),
  23075. h.vrDebug) {
  23076. $("#info-device-orientation").css("display", "block");
  23077. var r = "";
  23078. r += "alpha=(" + s.alpha + ")<BR/>",
  23079. r += "beta=(" + s.beta + ")<BR/>",
  23080. r += "gamma=" + s.gamma + "<BR/>",
  23081. document.getElementById("info-device-orientation").innerHTML = r
  23082. }
  23083. }),
  23084. this.setObjectQuaternion = function(e, t, i, n, r) {
  23085. s.euler.set(i, t, -n, "YXZ"),
  23086. e.setFromEuler(s.euler),
  23087. e.multiply(s.q1),
  23088. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23089. o.updateMatrixWorld()
  23090. }
  23091. ,
  23092. parent !== window && window.addEventListener("message", function(e) {
  23093. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23094. o && o.alpha && o.beta && o.gamma && (t = a,
  23095. i = M.Math.degToRad(o.alpha),
  23096. n = M.Math.degToRad(o.beta),
  23097. r = M.Math.degToRad(o.gamma),
  23098. t ? (-1e3 === s.alpha && (s.alpha = i),
  23099. -1e3 === s.beta && (s.beta = n),
  23100. -1e3 === s.gamma && (s.gamma = r),
  23101. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23102. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23103. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23104. s.beta = n,
  23105. s.gamma = r))
  23106. }),
  23107. this.update = function(e) {
  23108. TWEEN.update(),
  23109. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23110. this.triggerTargetEvent())
  23111. }
  23112. ,
  23113. this.triggerTargetEvent = function() {
  23114. var e = this.choseObj()
  23115. , t = e ? e.object : void 0;
  23116. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23117. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23118. t && t.enabled && this.startAnimate(function() {
  23119. this.clickCallback(t)
  23120. }
  23121. .bind(this))) : this.type,
  23122. this.targetEventObj.lastObj = t)
  23123. }
  23124. ,
  23125. this.choseObj = function() {
  23126. this.raycaster.setFromCamera({
  23127. x: 0,
  23128. y: 0
  23129. }, o);
  23130. var e = (this.raycaster.ray,
  23131. window.vrMarkers)
  23132. , t = this.raycaster.intersectObjects(e);
  23133. if (0 < t.length)
  23134. return t[0]
  23135. }
  23136. ,
  23137. this.clickCallback = function(e) {
  23138. this.runTHREEAction(e, "onclick")
  23139. }
  23140. ,
  23141. this.runTHREEAction = function(e, t) {
  23142. switch (t) {
  23143. case "onclick":
  23144. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23145. e()
  23146. });
  23147. break;
  23148. case "onhover":
  23149. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23150. e()
  23151. });
  23152. break;
  23153. case "onout":
  23154. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23155. e()
  23156. })
  23157. }
  23158. }
  23159. ,
  23160. this.startAnimate = function(e) {
  23161. this.tweenFlag && this.initAnimation(e)
  23162. }
  23163. ,
  23164. this.initAnimation = function(e) {
  23165. var t = this
  23166. , i = this.cursor.material.map.offset;
  23167. t.tweenFlag = !1,
  23168. this.cursorAnimate = new TWEEN.Tween(i).to({
  23169. x: 1
  23170. }, 1e3).onStart(function() {
  23171. t.tweenFlag = !1
  23172. }).onStop(function() {
  23173. t.tweenFlag = !0,
  23174. this.x = 0,
  23175. i.x = 0
  23176. }).onUpdate(function() {}).onComplete(function() {
  23177. e(),
  23178. i.x = 0,
  23179. setTimeout(function() {
  23180. t.tweenFlag = !0
  23181. }, 1500)
  23182. }),
  23183. this.cursorAnimate.easing(function(e) {
  23184. return Math.floor(17 * e) / 17
  23185. }),
  23186. this.cursorAnimate.start()
  23187. }
  23188. ,
  23189. this.autoCursorPosition = function(e) {
  23190. this.cursor.scale.set(.3, .3, .3)
  23191. }
  23192. }
  23193. ,
  23194. h.prototype.vrRenderer = function(a, i, e) {
  23195. var s = new i.vrCamera(e);
  23196. s.bananaAspect = .8,
  23197. this.width,
  23198. this.height;
  23199. i = this;
  23200. this.setSize = function(e, t) {
  23201. a.setSize.call(this, e, t),
  23202. i.width = e,
  23203. i.height = t
  23204. }
  23205. ,
  23206. this.render = function(e, t, i, n) {
  23207. var r, o;
  23208. if (window.cameraQua = t.quaternion.clone(),
  23209. t.__RESS__SKIP__STEREO__)
  23210. return a.render(e, t, i, n);
  23211. if ("PerspectiveCamera" === t.type)
  23212. r = s.cameraL,
  23213. o = s.cameraR,
  23214. e.updateMatrixWorld(),
  23215. null === t.parent && t.updateMatrixWorld(),
  23216. s.vrCameraUpdate(t);
  23217. else {
  23218. if ("OrthographicCamera" !== t.type)
  23219. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23220. r = o = t
  23221. }
  23222. a.setScissorTest(!0),
  23223. a.setScissor(0, 0, this.width / 2, this.height),
  23224. a.setViewport(0, 0, this.width / 2, this.height),
  23225. a.render.call(this, e, r, i, n),
  23226. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23227. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23228. a.render.call(this, e, o, i, n),
  23229. a.setScissorTest(!1)
  23230. }
  23231. ,
  23232. this.__proto__ = {
  23233. __proto__: a
  23234. }
  23235. }
  23236. ,
  23237. h.prototype.vrCamera = function(e) {
  23238. this.type = "StereoCamera",
  23239. this._aspect = 1,
  23240. this._overlap = .064,
  23241. this.cameraL = new M.PerspectiveCamera,
  23242. this.cameraL.layers.enable(1),
  23243. this.cameraL.matrixAutoUpdate = !1,
  23244. this.cameraR = new M.PerspectiveCamera,
  23245. this.cameraR.layers.enable(2),
  23246. this.cameraR.matrixAutoUpdate = !1,
  23247. this.eyeRight = new M.Matrix4,
  23248. this.eyeLeft = new M.Matrix4,
  23249. this.vrCameraNeedsUpdate = !0,
  23250. window.vrCameraL = this.cameraL,
  23251. Object.defineProperty(this, "bananaAspect", {
  23252. get: function() {
  23253. return this._aspect
  23254. },
  23255. set: function(e) {
  23256. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23257. this._aspect = e
  23258. }
  23259. }),
  23260. Object.defineProperty(this, "overlap", {
  23261. get: function() {
  23262. return this._overlap
  23263. },
  23264. set: function(e) {
  23265. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23266. this._overlap = e
  23267. }
  23268. }),
  23269. this.vrCameraUpdate = function(e) {
  23270. if (this.vrCameraNeedsUpdate = !0,
  23271. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23272. this.vrCameraNeedsUpdate) {
  23273. this.vrCameraNeedsUpdate = !1,
  23274. console.debug("vrCameraUpdate"),
  23275. this.bananaFocus = e.focus,
  23276. this.bananaFov = e.fov,
  23277. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23278. this.bananaNear = e.near,
  23279. this.bananaFar = e.far,
  23280. console.debug(e.aspect),
  23281. this.bananaFocus = 10;
  23282. 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);
  23283. this.eyeLeft.elements[12] = -r,
  23284. this.eyeRight.elements[12] = r,
  23285. t = -a * this.bananaReal_aspect + o,
  23286. i = a * this.bananaReal_aspect + o,
  23287. n.elements[0] = 2 * this.bananaNear / (i - t),
  23288. n.elements[8] = (i + t) / (i - t),
  23289. this.cameraL.projectionMatrix.copy(n),
  23290. t = -a * this.bananaReal_aspect - o,
  23291. i = a * this.bananaReal_aspect - o,
  23292. n.elements[0] = 2 * this.bananaNear / (i - t),
  23293. n.elements[8] = (i + t) / (i - t),
  23294. this.cameraR.projectionMatrix.copy(n)
  23295. }
  23296. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23297. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23298. }
  23299. }
  23300. ,
  23301. h.prototype.boluoGetTexture = function(e) {
  23302. var t = new M.TextureLoader;
  23303. return t.crossOrigin = "anonymous",
  23304. t.load(e)
  23305. }
  23306. ,
  23307. h.prototype.updateScreenSize = function(e) {
  23308. var t, i, n, r = !1;
  23309. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23310. n = e.height,
  23311. r = !0,
  23312. t = 1) : (i = $("#player").width(),
  23313. n = $("#player").height(),
  23314. e && e.resize && (o = this.renderWidth,
  23315. a = this.renderHeight),
  23316. i === o && n === a && !this.forceUpdateSize || (o = i,
  23317. a = n,
  23318. r = !0,
  23319. t = window.devicePixelRatio)),
  23320. r && (this.setSize(i, n, t),
  23321. this.forceUpdateSize = !1)
  23322. }
  23323. ,
  23324. h.prototype.updateComponents = function() {
  23325. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23326. this.updateListeners[t].update(e)
  23327. }
  23328. ,
  23329. h.prototype.suspend = function() {
  23330. this.started = !1,
  23331. this.suspendedObjects = this.scene.children.map(function(e) {
  23332. return this.scene.remove(e),
  23333. e
  23334. }
  23335. .bind(this)),
  23336. this.render()
  23337. }
  23338. ,
  23339. h.prototype.resume = function() {
  23340. this.suspendedObjects.forEach(function(e) {
  23341. this.scene.add(e)
  23342. }
  23343. .bind(this)),
  23344. this.suspendedObjects = [],
  23345. this.started = !0,
  23346. b()
  23347. }
  23348. ;
  23349. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23350. this.started && (window.requestAnimationFrame(b),
  23351. this.updateScreenSize(),
  23352. this.updateComponents(),
  23353. this.updateTextureMemory(),
  23354. this.render(),
  23355. this.emit(r.AfterRender))
  23356. };
  23357. h.prototype.getImageData = (E = document.createElement("canvas"),
  23358. _ = E.getContext("2d"),
  23359. function(e, t, i) {
  23360. return E.width === t && E.height === i || (E.width = t,
  23361. E.height = i),
  23362. _.drawImage(e, 0, 0, t, i),
  23363. _.getImageData(0, 0, t, i)
  23364. }
  23365. ),
  23366. h.prototype.initSizedTexture2D = function(e, t, i) {
  23367. var n = this.renderer
  23368. , r = n.context
  23369. , o = n.state
  23370. , a = new M.Texture(null);
  23371. !(a.flipY = !1) !== i && (i = !1),
  23372. a.generateMipmaps = i;
  23373. var s = n.paramThreeToGL(a.format)
  23374. , l = n.paramThreeToGL(a.type)
  23375. , c = n.properties.get(a)
  23376. , h = r.createTexture();
  23377. o.bindTexture(r.TEXTURE_2D, h),
  23378. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23379. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23380. a.wrapS = t,
  23381. a.wrapT = t;
  23382. var u = n.paramThreeToGL(t);
  23383. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23384. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23385. i ? (a.magFilter = M.LinearFilter,
  23386. a.minFilter = M.LinearMipMapLinearFilter,
  23387. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23388. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23389. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23390. a.minFilter = M.LinearFilter,
  23391. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23392. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23393. o.bindTexture(r.TEXTURE_2D, null),
  23394. c.__webglTexture = h,
  23395. a
  23396. }
  23397. ,
  23398. h.prototype.initSizedCubeMap = function(e, t) {
  23399. var i = this.renderer
  23400. , n = i.context
  23401. , r = i.state
  23402. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23403. o.flipY = !1,
  23404. o.generateMipmaps = t;
  23405. var a = i.paramThreeToGL(o.format)
  23406. , s = i.paramThreeToGL(o.type)
  23407. , l = i.properties.get(o)
  23408. , c = n.createTexture();
  23409. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23410. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23411. for (var h = 0; h < 6; h++)
  23412. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23413. return t ? (o.magFilter = M.LinearFilter,
  23414. o.minFilter = M.LinearMipMapLinearFilter,
  23415. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23416. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23417. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23418. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23419. o.minFilter = M.LinearFilter,
  23420. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23421. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23422. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23423. l.__image__webglTextureCube = c,
  23424. o
  23425. }
  23426. ,
  23427. h.prototype.deallocateCubeTexture = function(e) {
  23428. var t = this.renderer
  23429. , i = t.context
  23430. , n = t.properties.get(e);
  23431. i.deleteTexture(n.__image__webglTextureCube)
  23432. }
  23433. ,
  23434. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23435. var a = this.renderer
  23436. , s = a.context
  23437. , l = a.state
  23438. , c = a.properties.get(t);
  23439. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23440. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23441. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23442. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23443. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23444. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23445. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23446. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23447. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23448. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23449. l.bindTexture(s.TEXTURE_2D, null)
  23450. }
  23451. ,
  23452. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23453. var s = this.renderer
  23454. , l = s.context
  23455. , c = s.state
  23456. , h = s.properties.get(t);
  23457. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23458. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23459. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23460. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23461. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23462. }
  23463. ,
  23464. h.prototype.rebuildMipMaps2D = function(e) {
  23465. var t = this.renderer
  23466. , i = t.context
  23467. , n = t.state;
  23468. t.properties.get(e),
  23469. i.generateMipmap(i.TEXTURE_2D),
  23470. n.bindTexture(i.TEXTURE_2D, null)
  23471. }
  23472. ,
  23473. h.prototype.rebuildMipMaps3D = function(e) {
  23474. var t = this.renderer
  23475. , i = t.context
  23476. , n = t.state
  23477. , r = t.properties.get(e);
  23478. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23479. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23480. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23481. }
  23482. ,
  23483. h.prototype.renderToCubeMap = (P = !1,
  23484. F = N = D = L = O = null,
  23485. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23486. this.renderer.context,
  23487. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23488. (O = new M.Scene).add(L),
  23489. D = new M.ShaderMaterial({
  23490. uniforms: {
  23491. tDiffuse: {
  23492. type: "t",
  23493. value: null
  23494. },
  23495. alpha: {
  23496. type: "f",
  23497. value: 1
  23498. }
  23499. },
  23500. vertexShader: R.basicTextured.vertexShader,
  23501. fragmentShader: R.basicTextured.fragmentShader,
  23502. depthWrite: !1,
  23503. depthTest: !1,
  23504. side: M.DoubleSide
  23505. }),
  23506. N = new M.PlaneBufferGeometry(1,1),
  23507. (F = new M.Mesh(N,D)).position.z = 0,
  23508. O.add(F),
  23509. P = !0);
  23510. var m = N.getAttribute("uv");
  23511. m.setDynamic(!0),
  23512. m.needsUpdate = !0;
  23513. var v = m.array
  23514. , y = r / i
  23515. , A = o / n
  23516. , C = a / i
  23517. , I = s / n;
  23518. v[0] = y,
  23519. v[1] = A + I,
  23520. v[2] = y + C,
  23521. v[3] = A + I,
  23522. v[4] = y,
  23523. v[5] = A,
  23524. v[6] = y + C,
  23525. v[7] = A;
  23526. var E = N.getAttribute("position");
  23527. E.setDynamic(!0),
  23528. E.needsUpdate = !0;
  23529. var _ = E.array
  23530. , b = l / t.width - .5
  23531. , w = c / t.height - .5
  23532. , T = h / t.width
  23533. , x = u / t.height;
  23534. _[0] = b,
  23535. _[1] = w + x,
  23536. _[3] = b + T,
  23537. _[4] = w + x,
  23538. _[6] = b,
  23539. _[7] = w,
  23540. _[9] = b + T,
  23541. _[10] = w,
  23542. this.renderer.properties.get(e),
  23543. D.uniforms.tDiffuse.value = e,
  23544. D.blending = p || M.NoBlending,
  23545. D.transparent = !!f,
  23546. null != g || (g = 1),
  23547. D.uniforms.alpha.value = g,
  23548. D.needUpdate = !0,
  23549. t.activeCubeFace = d,
  23550. t.viewport.set(0, 0, t.width, t.height);
  23551. var S = this.renderer.autoClear;
  23552. this.renderer.autoClear = !1,
  23553. this.renderer.render(O, L, t, !1),
  23554. this.renderer.autoClear = S
  23555. }
  23556. ),
  23557. h.prototype.copyCubeMap = (g = !1,
  23558. C = A = y = v = m = null,
  23559. I = new M.Euler,
  23560. new M.Vector3,
  23561. function(e, t, i, n, r, o, a, s, l) {
  23562. this.renderer,
  23563. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23564. (m = new M.Scene).add(v),
  23565. y = new M.ShaderMaterial({
  23566. uniforms: {
  23567. tDiffuse: {
  23568. type: "t",
  23569. value: null
  23570. },
  23571. alpha: {
  23572. type: "f",
  23573. value: 1
  23574. }
  23575. },
  23576. vertexShader: R.copyCubeMap.vertexShader,
  23577. fragmentShader: R.copyCubeMap.fragmentShader,
  23578. depthWrite: !1,
  23579. depthTest: !1,
  23580. side: M.DoubleSide
  23581. }),
  23582. A = new M.BoxGeometry(2,2,2),
  23583. C = new M.Mesh(A,y),
  23584. m.add(C),
  23585. g = !0);
  23586. for (var c = 0; c < 6; c++)
  23587. h.getCubeOrientationForCubeFace(c, I),
  23588. C.rotation.copy(I),
  23589. C.matrixWorldNeedsUpdate = !0,
  23590. C.updateMatrixWorld(),
  23591. y.uniforms.tDiffuse.value = e,
  23592. y.blending = a || M.NoBlending,
  23593. y.transparent = !!s,
  23594. null != l || (l = 1),
  23595. y.uniforms.alpha.value = l,
  23596. y.needUpdate = !0,
  23597. t.activeCubeFace = c,
  23598. t.viewport.set(0, 0, r, o),
  23599. this.renderer.render(m, v, t, !1)
  23600. }
  23601. ),
  23602. h.getLookAtForCubeFace = function(e, t) {
  23603. switch (e) {
  23604. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23605. t.set(1, 0, 0);
  23606. break;
  23607. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23608. t.set(-1, 0, 0);
  23609. break;
  23610. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23611. t.set(0, 1, 0);
  23612. break;
  23613. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23614. t.set(0, -1, 0);
  23615. break;
  23616. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23617. t.set(0, 0, 1);
  23618. break;
  23619. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23620. t.set(0, 0, -1)
  23621. }
  23622. }
  23623. ,
  23624. h.getCubeOrientationForCubeFace = function(e, t) {
  23625. switch (e) {
  23626. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23627. t.set(0, -Math.PI / 2, 0);
  23628. break;
  23629. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23630. t.set(0, Math.PI / 2, 0);
  23631. break;
  23632. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23633. t.set(Math.PI / 2, Math.PI, 0);
  23634. break;
  23635. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23636. t.set(-Math.PI / 2, Math.PI, 0);
  23637. break;
  23638. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23639. t.set(0, -Math.PI, 0);
  23640. break;
  23641. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23642. t.set(0, 0, 0)
  23643. }
  23644. }
  23645. ,
  23646. t.exports = h
  23647. }
  23648. , {
  23649. "../enum/GLCubeFaces": 25,
  23650. "../enum/GLTextureType": 26,
  23651. "../enum/SceneRendererEvents": 43,
  23652. "../exception/BasicException": 55,
  23653. "../exception/RendererCreationException": 57,
  23654. "../settings": 166,
  23655. "../shaders": 167,
  23656. "../util/browser": 182,
  23657. events: 202,
  23658. three: 217
  23659. }],
  23660. 159: [function(e, t, i) {
  23661. "use strict";
  23662. function n(e) {
  23663. this.messenger = new a(e),
  23664. this.clientKey = null
  23665. }
  23666. var o = e("../util/ajax")
  23667. , r = e("./PostMessageType")
  23668. , a = e("./postmessage")
  23669. , s = e("./VersionInfo")
  23670. , l = e("events").EventEmitter
  23671. , c = window.location.origin + "/api/v1/user/";
  23672. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23673. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23674. }
  23675. ,
  23676. n.prototype.waitForConnection = function() {
  23677. return new Promise(function(t, i) {
  23678. this.messenger.on(r.CONNECT, function(e) {
  23679. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23680. }
  23681. .bind(this))
  23682. }
  23683. .bind(this))
  23684. }
  23685. ,
  23686. n.prototype.onConnectionReceived = function(i) {
  23687. return this.messenger.setTarget(i.source, i.origin),
  23688. this.verifyConnection(i).then(function(e, t) {
  23689. this.messenger.send({
  23690. type: r.ACCEPT,
  23691. toId: i.fromId,
  23692. warning: t
  23693. }),
  23694. this.clientKey = e,
  23695. this.messenger.removeAllListeners(r.CONNECT),
  23696. this.bindEvents()
  23697. }
  23698. .bind(this), function(e) {
  23699. this.messenger.send({
  23700. type: r.REJECT,
  23701. toId: i.fromId,
  23702. reason: e
  23703. }),
  23704. this.messenger.setTarget()
  23705. }
  23706. .bind(this))
  23707. }
  23708. ,
  23709. n.prototype.verifyConnection = function(r) {
  23710. return new Promise(function(e, t) {
  23711. var i;
  23712. if (s.isDeprecated(r.sdkVersion))
  23713. i = "这个版本正在被弃用";
  23714. else if (!s.isSupported(r.sdkVersion))
  23715. return t("不支持此版本的SDK");
  23716. var n = {
  23717. cache: !1,
  23718. headers: {
  23719. "X-port-Application-Key": r.applicationKey,
  23720. "X-port-Referrer": r.origin
  23721. }
  23722. };
  23723. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23724. }
  23725. )
  23726. }
  23727. ,
  23728. n.prototype.onMessageReceived = function(t) {
  23729. if (this.validateClientApplicationKey(t.applicationKey)) {
  23730. var i = this;
  23731. t.onDone = function(e) {
  23732. e.toId = t.fromId,
  23733. e.uid = t.uid,
  23734. e.type = r.RESPONSE,
  23735. i.messenger.send(e)
  23736. }
  23737. ,
  23738. this.emit(r.ACTION, t)
  23739. }
  23740. }
  23741. ,
  23742. n.prototype.validateClientApplicationKey = function(e) {
  23743. return this.clientKey === e
  23744. }
  23745. ,
  23746. n.prototype.sendEvent = function(e, t) {
  23747. this.messenger.send({
  23748. type: r.EVENT,
  23749. eventType: e,
  23750. eventData: t
  23751. })
  23752. }
  23753. ,
  23754. t.exports = n
  23755. }
  23756. , {
  23757. "../util/ajax": 181,
  23758. "./PostMessageType": 160,
  23759. "./VersionInfo": 163,
  23760. "./postmessage": 165,
  23761. events: 202
  23762. }],
  23763. 160: [function(e, t, i) {
  23764. "use strict";
  23765. t.exports = Object.freeze({
  23766. CONNECT: "postmessage.connect",
  23767. ACCEPT: "postmessage.accept",
  23768. REJECT: "postmessage.reject",
  23769. ACTION: "postmessage.action",
  23770. RESPONSE: "postmessage.response",
  23771. EVENT: "postmessage.event"
  23772. })
  23773. }
  23774. , {}],
  23775. 161: [function(e, t, i) {
  23776. "use strict";
  23777. t.exports = Object.freeze({
  23778. MOVE: "sdk.move",
  23779. ENTER_PANO: "sdk.enterpano",
  23780. MODEL_LOADED: "sdk.modelloaded"
  23781. })
  23782. }
  23783. , {}],
  23784. 162: [function(e, t, i) {
  23785. "use strict";
  23786. t.exports = Object.freeze({
  23787. FLY: "transition.fly",
  23788. FADEOUT: "transition.fade",
  23789. INSTANT: "transition.instant"
  23790. })
  23791. }
  23792. , {}],
  23793. 163: [function(e, t, i) {
  23794. "use strict";
  23795. t.exports = {
  23796. current: "1.0",
  23797. supported: ["1.0"],
  23798. deprecated: [],
  23799. isSupported: function(e) {
  23800. return -1 !== this.supported.indexOf(e)
  23801. },
  23802. isDeprecated: function(e) {
  23803. return -1 !== this.deprecated.indexOf(e)
  23804. },
  23805. isValid: function(e) {
  23806. return this.isSupported(e) || this.isDeprecated(e)
  23807. }
  23808. }
  23809. }
  23810. , {}],
  23811. 164: [function(q, X, e) {
  23812. (function(e) {
  23813. "use strict";
  23814. function r(e, t, i) {
  23815. e = e && e.toLowerCase().trim();
  23816. var n = new C.UP.clone
  23817. , r = Math.PI / 3
  23818. , o = Math.PI / 2;
  23819. switch (e) {
  23820. case "left":
  23821. i.copy(t),
  23822. i.applyAxisAngle(n, o);
  23823. break;
  23824. case "right":
  23825. i.copy(t),
  23826. i.applyAxisAngle(n, -o);
  23827. break;
  23828. case "forwardleft":
  23829. i.copy(t),
  23830. i.applyAxisAngle(n, r);
  23831. break;
  23832. case "forwardright":
  23833. i.copy(t),
  23834. i.applyAxisAngle(n, -r);
  23835. break;
  23836. case "forward":
  23837. default:
  23838. i.copy(t)
  23839. }
  23840. return i
  23841. }
  23842. function o(e, t) {
  23843. if (e) {
  23844. var i = {
  23845. pano: e,
  23846. lookAtPoint: null,
  23847. duration: null,
  23848. maxDistanceOverride: null,
  23849. skipWarpingCheck: !1
  23850. };
  23851. this.player.flyToPano(i, function() {
  23852. t && t({
  23853. success: !0,
  23854. message: "Transition complete."
  23855. })
  23856. })
  23857. } else
  23858. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23859. t && t({
  23860. success: !1,
  23861. error: "Unable to find pano."
  23862. })
  23863. }
  23864. function a(e, t) {
  23865. t.copy(C.FORWARD),
  23866. e.getDirection(t)
  23867. }
  23868. function c(i) {
  23869. return {
  23870. panos: i.panos.list.map(function(e) {
  23871. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23872. return {
  23873. uuid: e.id,
  23874. aligned: e.alignmentType === g.ALIGNED,
  23875. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23876. position: function(e) {
  23877. return e.alignmentType !== g.ALIGNED ? null : {
  23878. x: e.position.x,
  23879. y: e.position.y,
  23880. z: e.position.z
  23881. }
  23882. }(e),
  23883. rotation: function(e) {
  23884. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23885. return {
  23886. x: h.Math.radToDeg(t._x),
  23887. y: h.Math.radToDeg(t._y),
  23888. z: h.Math.radToDeg(t._z)
  23889. }
  23890. }(e),
  23891. thumbnail: t
  23892. }
  23893. })
  23894. }
  23895. }
  23896. 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"),
  23897. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23898. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23899. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23900. N.angle = 0,
  23901. N.angleTravelled = 0,
  23902. N.playerDirection = new h.Vector3,
  23903. N.lastFacingDirection = new h.Vector3,
  23904. N.onDone = null,
  23905. N.player = null,
  23906. N.start = function(e, t, i, n) {
  23907. N.active = !0,
  23908. e && t && (t = 0),
  23909. N.angle = e || t,
  23910. N.xAngle = e,
  23911. N.yAngle = t,
  23912. N.angleTravelled = 0,
  23913. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23914. i.getDirection(N.playerDirection),
  23915. N.lastFacingDirection.copy(N.playerDirection),
  23916. N.projectVectors(),
  23917. N.onDone = n,
  23918. N.player = i,
  23919. N()
  23920. }
  23921. ,
  23922. N.projectVectors = function() {
  23923. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23924. N.lastFacingDirection.projectOnPlane(C.UP))
  23925. }
  23926. ,
  23927. N), P = (i = new h.Vector3,
  23928. function(e) {
  23929. e ? (i.copy(e.position),
  23930. i.add(e.discPosition),
  23931. s.projectPositionToCanvas(i, this.player.camera, i),
  23932. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23933. }
  23934. ), O = (l = new h.Vector3,
  23935. function(e) {
  23936. var t = this.player.getDirection();
  23937. l.copy(t);
  23938. var i = l.y;
  23939. l.y = 0,
  23940. l.normalize();
  23941. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23942. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23943. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23944. 0;
  23945. this.player.mode === I.DOLLHOUSE && (n = -n);
  23946. var r = function() {
  23947. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23948. }
  23949. .call(this) - .1
  23950. , o = function() {
  23951. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23952. }
  23953. .call(this) + .1
  23954. , a = n + e;
  23955. r < a ? a = r : a < o && (a = o);
  23956. var s = a - n;
  23957. return 0 < e && s < .01 && (s = 0),
  23958. e < 0 && -.01 < s && (s = 0),
  23959. s
  23960. }
  23961. ), L = (t = new h.Euler,
  23962. function(e) {
  23963. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23964. {
  23965. position: {
  23966. x: e.position.x,
  23967. y: e.position.y,
  23968. z: e.position.z
  23969. },
  23970. rotation: {
  23971. x: h.Math.radToDeg(t.x),
  23972. y: h.Math.radToDeg(t.y),
  23973. z: 0
  23974. },
  23975. pano: e.currentPano ? e.currentPano.id : null,
  23976. mode: e.mode
  23977. }
  23978. }
  23979. ), D = null;
  23980. function N() {
  23981. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23982. N.player.getDirection(N.playerDirection),
  23983. N.projectVectors();
  23984. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23985. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23986. N.onDone && (0,
  23987. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23988. window.setTimeout(N, 4))
  23989. }
  23990. X.exports = {
  23991. init: function(e, t, i, n, r) {
  23992. Y.init(e, t, i, r),
  23993. D = new Promise(function(e, t) {
  23994. i.on(_.Ready, function() {
  23995. e()
  23996. })
  23997. }
  23998. .bind(this));
  23999. var o = new u(window)
  24000. , a = o.waitForConnection();
  24001. a.then(function(e) {
  24002. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24003. });
  24004. var s, l = (s = Date.now(),
  24005. function() {
  24006. if (!(Date.now() - s < 100)) {
  24007. var e = L(i);
  24008. o.sendEvent(b.MOVE, {
  24009. state: e
  24010. }),
  24011. s = Date.now()
  24012. }
  24013. }
  24014. );
  24015. i.on(_.Move, l),
  24016. i.on(_.ViewChanged, l),
  24017. n.on(p.ActiveModelChanged, function(e) {
  24018. function t(e) {
  24019. var t, i = e.newPano.id;
  24020. e.oldPano && (t = e.oldPano.id),
  24021. i !== t && o.sendEvent(b.ENTER_PANO, {
  24022. oldPano: t,
  24023. newPano: i
  24024. })
  24025. }
  24026. var i = e.model
  24027. , n = e.oldModel;
  24028. Y.model = i,
  24029. a.then(function() {
  24030. o.sendEvent(b.MODEL_LOADED, {
  24031. metadata: c(i)
  24032. })
  24033. }),
  24034. n && n.panos.forEach(function(e) {
  24035. e.removeEventListener("enter", t)
  24036. }),
  24037. i.panos.forEach(function(e) {
  24038. e.on("enter", t)
  24039. })
  24040. })
  24041. }
  24042. };
  24043. var F, B, V, k, U, H, z, G, W, j, Y = {
  24044. director: null,
  24045. player: null,
  24046. controls: null,
  24047. sceneRenderer: null,
  24048. model: null,
  24049. init: function(e, t, i, n) {
  24050. this.director = e,
  24051. this.player = i,
  24052. this.controls = t,
  24053. this.sceneRenderer = n
  24054. },
  24055. handleToObject: {},
  24056. objectToHandle: {},
  24057. handleCount: 0,
  24058. onMessageReceive: function(e) {
  24059. if (e) {
  24060. var t = e.targetFunction
  24061. , i = e.params
  24062. , n = e.onDone;
  24063. t && this[t] && this[t](i, n)
  24064. }
  24065. },
  24066. waitForInit: function(e, t) {
  24067. D.then(t.bind({
  24068. success: !0,
  24069. message: "Init complete."
  24070. }))
  24071. },
  24072. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24073. j = new h.Quaternion,
  24074. function(e, t) {
  24075. var i = e.pano
  24076. , n = e.rotation
  24077. , r = e.transition;
  24078. if (!this.model)
  24079. return t({
  24080. success: !1,
  24081. error: "The model has not been loaded yet"
  24082. });
  24083. var o = this.model.panos.get(i);
  24084. if (!o)
  24085. return t({
  24086. success: !1,
  24087. error: i + " does not exist in this model"
  24088. });
  24089. if (!n)
  24090. return t({
  24091. sucess: !1,
  24092. erorr: n + " is not a valid rotation"
  24093. });
  24094. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24095. console.log(n.z);
  24096. var a = {
  24097. success: !0,
  24098. message: i
  24099. };
  24100. if (r === v.FADEOUT)
  24101. j.setFromEuler(W),
  24102. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24103. else {
  24104. var s, l;
  24105. r === v.INSTANT && (l = s = 0);
  24106. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24107. this.player.flyToPano({
  24108. pano: o,
  24109. lookAtPoint: c,
  24110. duration: s,
  24111. aimDuration: l
  24112. }, t.bind(this, a))
  24113. }
  24114. }
  24115. ),
  24116. moveInDirection: function(e, t) {
  24117. var i = e.direction;
  24118. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24119. void (t && t({
  24120. success: !1,
  24121. error: "Invalid direction."
  24122. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24123. t(e ? {
  24124. success: !0,
  24125. message: "moved " + i
  24126. } : {
  24127. success: !1,
  24128. error: "Cannot move in direction: " + i
  24129. })
  24130. })
  24131. },
  24132. getPose: function(e, t) {
  24133. return this.player.camera.position,
  24134. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24135. t({
  24136. success: !0,
  24137. message: L(this.player)
  24138. })
  24139. },
  24140. takeScreenShot: (z = new h.PerspectiveCamera,
  24141. G = new h.WebGLRenderTarget,
  24142. function(e, t) {
  24143. if (!e.resolution)
  24144. return t({
  24145. success: !1,
  24146. error: "An invalid resolution was specified"
  24147. });
  24148. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24149. var i = this.sceneRenderer.renderer.getSize();
  24150. e.resolution.width = i.width,
  24151. e.resolution.height = i.height
  24152. }
  24153. z.layers.set(T.DEFAULT),
  24154. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24155. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24156. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24157. var n = e.resolution.width
  24158. , r = e.resolution.height
  24159. , o = n / r;
  24160. z.position.copy(this.sceneRenderer.camera.position),
  24161. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24162. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24163. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24164. G.setSize(n, r),
  24165. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24166. var a = new Uint8Array(n * r * 4);
  24167. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24168. var s = S.encode({
  24169. data: a,
  24170. width: n,
  24171. height: r,
  24172. heading: 180,
  24173. pitch: 0
  24174. }, {
  24175. quality: 75,
  24176. flipY: !0
  24177. });
  24178. t({
  24179. success: !0,
  24180. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24181. })
  24182. }
  24183. ),
  24184. findRankedPano: (U = new h.Vector3,
  24185. H = new h.Vector3,
  24186. function(e, t) {
  24187. a(this.player, H),
  24188. r(t, H, U);
  24189. var i = this.player.rankedPanoInDirection(e, U);
  24190. if (i) {
  24191. var n = this.objectToHandle[i.id];
  24192. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24193. this.handleToObject[n] = i),
  24194. n
  24195. }
  24196. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24197. -1
  24198. }
  24199. ),
  24200. findRankedtag: (V = new h.Vector3,
  24201. k = new h.Vector3,
  24202. function(e, t) {
  24203. a(this.player, k),
  24204. r(t, k, V);
  24205. var i = this.player.rankedtagInDirection(e, V);
  24206. if (i) {
  24207. var n = this.objectToHandle[i.sid];
  24208. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24209. this.handleToObject[n] = i),
  24210. n
  24211. }
  24212. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24213. -1
  24214. }
  24215. ),
  24216. clickNearesttag: function(e) {
  24217. this.clickRankedtag(0, e)
  24218. },
  24219. clickRankedtag: function(e, t) {
  24220. var i = function(e, t) {
  24221. var i = this.findRankedtag(e, t);
  24222. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24223. null)
  24224. }
  24225. .call(this, e, t);
  24226. i && P.call(this, i)
  24227. },
  24228. clickNearestPano: function(e, t) {
  24229. this.clickRankedPano(0, e, t)
  24230. },
  24231. clickRankedPano: function(e, t, i) {
  24232. var n = function(e, t) {
  24233. var i = this.findRankedPano(e, t);
  24234. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24235. null)
  24236. }
  24237. .call(this, e, t);
  24238. n ? o.call(this, n, i) : i(null)
  24239. },
  24240. clickPano: function(e, t) {
  24241. var i = this.handleTable[e];
  24242. i ? o.call(this, i, t) : t(null)
  24243. },
  24244. rotateDirection: function(e, t) {
  24245. var i = e.direction
  24246. , n = e.angle;
  24247. if (!R.active) {
  24248. var r = 0
  24249. , o = 0
  24250. , a = 0
  24251. , s = 0;
  24252. if (!n || isNaN(n))
  24253. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24254. void (t && t({
  24255. success: !1,
  24256. error: "Invalid rotation angle."
  24257. }));
  24258. if (this.player.mode === I.TRANSITIONING)
  24259. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24260. void (t && t({
  24261. success: !1,
  24262. error: "Cannot rotate while transitioning"
  24263. }));
  24264. if (i === m.RIGHT || i === m.LEFT)
  24265. i === m.RIGHT && (n = -n),
  24266. r = 0 < n ? -1 : 1,
  24267. a = n;
  24268. else {
  24269. if (i !== m.UP && i !== m.DOWN)
  24270. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24271. void (t && t({
  24272. success: !1,
  24273. error: "Invalid direction for rotation."
  24274. }));
  24275. if (this.player.mode === I.FLOORPLAN)
  24276. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24277. void (t && t({
  24278. success: !1,
  24279. error: "Cannot rotate " + i + " in floorplan mode"
  24280. }));
  24281. if (i === m.DOWN && (n = -n),
  24282. 0 === (n = O.call(this, n)))
  24283. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24284. void (t && t({
  24285. success: !1,
  24286. error: "Already at maximum rotation in direction: " + i
  24287. }));
  24288. o = 0 < n ? 1 : -1,
  24289. s = n
  24290. }
  24291. var l = n;
  24292. n = h.Math.degToRad(n),
  24293. a = h.Math.degToRad(a),
  24294. s = h.Math.degToRad(s);
  24295. var c = this.controls.activeControl;
  24296. c.startRotating(r, o),
  24297. R.start(a, s, this.player, function() {
  24298. c.stopRotating(!0),
  24299. t && t({
  24300. success: !0,
  24301. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24302. })
  24303. })
  24304. }
  24305. },
  24306. rotate: (F = new h.Vector3,
  24307. B = new h.Vector3,
  24308. function(e, t) {
  24309. var i = e.xAngle
  24310. , n = e.yAngle;
  24311. if (!R.active) {
  24312. if (i = i || 0,
  24313. n = n || 0,
  24314. isNaN(i) || isNaN(n))
  24315. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24316. void (t && t({
  24317. success: !1,
  24318. error: "Invalid rotation angle."
  24319. }));
  24320. if (this.player.mode === I.TRANSITIONING)
  24321. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24322. void (t && t({
  24323. success: !1,
  24324. error: "Cannot rotate while transitioning"
  24325. }));
  24326. Math.abs(i) < .01 && (i = 0),
  24327. Math.abs(n) < .01 && (n = 0);
  24328. var r = n;
  24329. n = O.call(this, n);
  24330. var o = 0 < r ? "UP" : "DOWN";
  24331. if (!(i = -i) && r && !n)
  24332. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24333. void (t && t({
  24334. success: !1,
  24335. error: "Already at maximum rotation in direction: " + o
  24336. }));
  24337. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24338. var a = n;
  24339. n = h.Math.degToRad(n),
  24340. i = h.Math.degToRad(i),
  24341. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24342. this.player.getDirection(F),
  24343. B.copy(F).applyAxisAngle(C.UP, i),
  24344. B.applyAxisAngle(C.RIGHT, n);
  24345. var s = (F.angleTo(B),
  24346. 0 < i ? -1 : i < 0 ? 1 : 0)
  24347. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24348. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24349. var c = this.controls.activeControl;
  24350. c.startRotating(s, l),
  24351. R.start(i, n, this.player, function() {
  24352. c.stopRotating(!0),
  24353. t && t({
  24354. success: !0,
  24355. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24356. })
  24357. })
  24358. }
  24359. }
  24360. ),
  24361. panCamera: function(e, i) {
  24362. function t(e) {
  24363. switch (r.removeAllListeners(w.AutoPanComplete),
  24364. r.removeAllListeners(w.AutoPanInterrupt),
  24365. r.removeAllListeners(w.AutoPanClamped),
  24366. e) {
  24367. case w.AutoPanInterrupt:
  24368. i({
  24369. success: !0,
  24370. message: "Camera panning interrupted."
  24371. });
  24372. break;
  24373. case w.AutoPanClamped:
  24374. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24375. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24376. return void i({
  24377. success: !1,
  24378. error: "Already at edge of current model bounds."
  24379. });
  24380. var t = "The view point is outside the bounds for the current model. ";
  24381. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24382. console.warn(t)
  24383. }
  24384. case w.AutoPanComplete:
  24385. i({
  24386. success: !0,
  24387. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24388. })
  24389. }
  24390. }
  24391. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24392. return i({
  24393. success: !1,
  24394. error: "Camera panning is not available in the current mode: " + this.player.mode
  24395. });
  24396. var n = e.position
  24397. , r = this.player.control;
  24398. r.setAutoPanPosition(n.x, n.z),
  24399. r.autoPan = !0;
  24400. var o = function(e, t) {
  24401. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24402. };
  24403. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24404. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24405. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24406. },
  24407. click: function(e, t) {
  24408. var i = e.x
  24409. , n = e.y;
  24410. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24411. n = n / 100 * $("#player").height()),
  24412. this.player.handleInputStart(i, n),
  24413. this.player.updateIntersect(),
  24414. this.player.handleInputEnd(i, n)
  24415. },
  24416. mouseOver: function(e, t) {
  24417. var i = e.x
  24418. , n = e.y;
  24419. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24420. n = n / 100 * $("#player").height()),
  24421. this.player.handleInputMove(i, n),
  24422. this.player.updateIntersect()
  24423. },
  24424. moveToMode: function(e, t) {
  24425. function i(e) {
  24426. t(e ? {
  24427. success: !1,
  24428. error: "Failed to load new mode: " + e
  24429. } : {
  24430. success: !0,
  24431. message: "Moved to new mode: " + n
  24432. })
  24433. }
  24434. var n = e.mode;
  24435. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24436. i()
  24437. }, function(e) {
  24438. i(e)
  24439. }) : t({
  24440. success: !1,
  24441. error: "Invalid mode selection"
  24442. })
  24443. }
  24444. }
  24445. }
  24446. ).call(this, "/js/sdk/automation.js")
  24447. }
  24448. , {
  24449. "../constants": 8,
  24450. "../enum/AlignmentType": 17,
  24451. "../enum/ControlEvents": 21,
  24452. "../enum/Direction": 22,
  24453. "../enum/GLCubeFaces": 25,
  24454. "../enum/Keys": 30,
  24455. "../enum/ModelManagerEvents": 33,
  24456. "../enum/PlayerEvents": 40,
  24457. "../enum/RenderLayers": 41,
  24458. "../enum/Vectors": 50,
  24459. "../enum/Viewmode": 51,
  24460. "../enum/WarpStyle": 52,
  24461. "../lib/jpeg_encoder": 94,
  24462. "../sdk/SdkEvents": 161,
  24463. "../settings": 166,
  24464. "../util/common": 185,
  24465. "../util/logger": 189,
  24466. "../util/math": 190,
  24467. "../util/panorama": 191,
  24468. "./ApiHost": 159,
  24469. "./PostMessageType": 160,
  24470. "./TransitionStyles": 162,
  24471. three: 217
  24472. }],
  24473. 165: [function(e, t, i) {
  24474. "use strict";
  24475. function n(e) {
  24476. this.sourceWindow = e,
  24477. this.targetWindow = null,
  24478. this.targetOrigin = null,
  24479. this.id = Math.floor(1e5 * Math.random()),
  24480. this.bindEvents()
  24481. }
  24482. var r = e("./PostMessageType")
  24483. , o = e("events").EventEmitter;
  24484. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24485. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24486. }
  24487. ,
  24488. n.prototype.setTarget = function(e, t) {
  24489. this.targetWindow = e,
  24490. this.targetOrigin = t
  24491. }
  24492. ,
  24493. n.prototype.onPostmessageReceived = function(e) {
  24494. var t = e.origin || e.originalEvent.origin
  24495. , i = e.source;
  24496. switch (e.data.type) {
  24497. case r.CONNECT:
  24498. break;
  24499. case r.RESPONSE:
  24500. if (this.id !== e.data.toId)
  24501. return;
  24502. default:
  24503. if (!this.validateMessageOrigin(t))
  24504. return
  24505. }
  24506. var n = e.data;
  24507. n.source = i,
  24508. n.origin = t,
  24509. n.timestamp = Date.now(),
  24510. this.emit(e.data.type, n)
  24511. }
  24512. ,
  24513. n.prototype.validateMessageOrigin = function(e) {
  24514. return "*" === this.targetOrigin || e === this.targetOrigin
  24515. }
  24516. ,
  24517. n.prototype.send = function(e) {
  24518. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24519. this.targetWindow.postMessage(e, this.targetOrigin))
  24520. }
  24521. ,
  24522. t.exports = n
  24523. }
  24524. , {
  24525. "./PostMessageType": 160,
  24526. events: 202
  24527. }],
  24528. 166: [function(e, t, i) {
  24529. "use strict";
  24530. var n = e("three")
  24531. , r = e("./util/browser")
  24532. , o = e("./enum/Viewmode")
  24533. , a = e("./enum/VROption")
  24534. , s = e("./enum/Colors")
  24535. , l = e("./enum/WarpStyle")
  24536. , c = e("./util/easing")
  24537. , h = e("./util/common")
  24538. , u = e("./util/showcase")
  24539. , d = e("./constants")
  24540. , p = {
  24541. debug: !1,
  24542. version: "2.25.6-0-gd87e5b1",
  24543. languageTag: r.valueFromHash("lang", null),
  24544. pageTitle: "四维虚拟漫游",
  24545. authorizationHeader: u.getAuthorizationHeader(),
  24546. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24547. logLevel: r.valueFromHash("log", 2),
  24548. skyboxRadius: 2500,
  24549. modelBoundsPadding: 5,
  24550. showNeighbors: !1,
  24551. brand: r.valueFromHash("brand", !0),
  24552. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24553. startHighlights: r.valueFromHash("hl", -1),
  24554. specialEdition: r.valueFromHash("bn", 0),
  24555. useWheel: r.valueFromHash("wh", !0),
  24556. crossOrigin: "anonymous",
  24557. fancierTransition: !1,
  24558. wireframe: !1,
  24559. skyboxWireframe: !1,
  24560. modelAlpha: 1,
  24561. highlightPanoSelection: !1,
  24562. showSweeps: !0,
  24563. showSkyboxes: !1,
  24564. showMesh: !0,
  24565. showFloors: !1,
  24566. showFloorDuration: 300,
  24567. showFloorDelay: 300,
  24568. hideFloorDuration: 300,
  24569. hideFloorDelay: 0,
  24570. reticuleOpacityTransitionTime: 250,
  24571. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24572. markerOpacityTransitionTime: 500,
  24573. guiAnimationSpeed: 250,
  24574. highlightAnimationDuration: 500,
  24575. modelComponentLoadSpinnerDelay: 150,
  24576. captureErrors: !1,
  24577. maxMobileTextures: 6,
  24578. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24579. startupFlyinDelay: 3e3,
  24580. dollhouseDefault: {
  24581. minDistance: 1,//15, //编辑页面给近一些
  24582. maxDistance: 50,
  24583. minPolarAngle: n.Math.degToRad(10),
  24584. maxPolarAngle: n.Math.degToRad(90)
  24585. },
  24586. hideReticuleTimeout: 1e3,
  24587. analytics: {
  24588. inactivityThreshold: 30,
  24589. sessionTrackingRate: .15,
  24590. maxTrackedErrors: 20,
  24591. sessionDurationPingFrequency: 10,
  24592. sessionDurationTimeout: 15
  24593. },
  24594. flydown: {
  24595. movementEasing: "easeInOutQuad",
  24596. movementDelay: .001,
  24597. rotationEasing: "easeInOutQuad",
  24598. rotationDelay: .5,
  24599. modelTextureDelay: .75,
  24600. skyboxDelay: .75
  24601. },
  24602. transition: {
  24603. flySpeed: .001,
  24604. flyTime: 750,
  24605. flytimeMaxDistanceThreshold: 5,
  24606. flytimeDistanceMultiplier: 150,
  24607. aimTime: 1500,
  24608. aimSlowFactor: 1.5,
  24609. blur: .8,
  24610. movementEasing: "easeInOutQuad",
  24611. blendEasing: "easeInOutQuad",
  24612. fastForwardFactor: 4
  24613. },
  24614. show360Views: {
  24615. enabled: !0,
  24616. transitionTime: 1e3
  24617. },
  24618. quickstart: {
  24619. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24620. animation: 1400,
  24621. showTextDelay: 500,
  24622. fadeOutDelay: 3e3,
  24623. fovChange: 10
  24624. },
  24625. appConfig: {
  24626. webvr_version: null,
  24627. segment_key: null,
  24628. embedly_key: null,
  24629. branch_key: null,
  24630. keen_write_key: null,
  24631. keen_project_id: null
  24632. },
  24633. vr: {
  24634. enabled: !0,
  24635. allowWebVR: !1,
  24636. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24637. },
  24638. share: {
  24639. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24640. },
  24641. input: {
  24642. longTapThreshold: 200,
  24643. moveToleranceNDC: 0.01,//.08,
  24644. touchMoveThreshold: 25
  24645. },
  24646. help: {
  24647. modalStayDuration: 600
  24648. },
  24649. immersive: {
  24650. timeToShowAgain: 1250,
  24651. uiStayDuration: 600
  24652. },
  24653. tourInteraction: {
  24654. disabled: "0" === r.valueFromHash("tourcta", null),
  24655. showPauseButton: 1e3,
  24656. showModal: 1500,
  24657. allowNextClick: 200,
  24658. largeModal: "1" === r.valueFromHash("tourcta", null),
  24659. smallModal: "2" === r.valueFromHash("tourcta", null)
  24660. },
  24661. labels: {
  24662. enabled: !1,
  24663. hideUntilStart: !0,
  24664. fadeInDuration: 250,
  24665. fadeInDelay: 250,
  24666. fadeOutDuration: 250,
  24667. fadeOutDelay: 0,
  24668. zoomHideThreshhold: {
  24669. mobile: r.isSmallScreen() ? .45 : .6,
  24670. desktop: 2
  24671. },
  24672. zoomTruncateThreshhold: {
  24673. mobile: r.isSmallScreen() ? .35 : .45,
  24674. desktop: .85
  24675. },
  24676. minLengthForTruncate: 16,
  24677. truncateLength: 12,
  24678. truncateSuffix: "..."
  24679. },
  24680. tags: {
  24681. enabled: r.valueFromHash("mt", 1),
  24682. startup: {
  24683. hideUntilStart: !0,
  24684. fadeInDuration: 500,
  24685. fadeInDelay: 100
  24686. },
  24687. visibility: {
  24688. anyDistance: !0,
  24689. visibleDistance: 8,
  24690. cameraClearance: .1,
  24691. alphaTestLevel: .05,
  24692. hideViaFloor: !0,
  24693. hideOffScreenDisc: !1,
  24694. hideOffScreenObject: !1
  24695. },
  24696. disc: {
  24697. opacity: 1,
  24698. disabledOpacity: .5,
  24699. scale: {
  24700. nearBound: 1.5,
  24701. farBound: 4.8,
  24702. linkFarBound: !1,
  24703. linkPercent: 40,
  24704. maxSize: 80,
  24705. minSize: 40,
  24706. baseViewportSize: 800,
  24707. responsiveness: 100
  24708. }
  24709. },
  24710. pole: {
  24711. enabled: !0,
  24712. height: .5,
  24713. width: 2,
  24714. opacity: .5,
  24715. color: "white"
  24716. },
  24717. navigate: {
  24718. nearestPano: !0,
  24719. lineOfSight: !0,
  24720. reactivate: !0,
  24721. aimAt: "disc",
  24722. tiltTolerance: 25,
  24723. rotateSpeedFactor: .6
  24724. }
  24725. },
  24726. path: {
  24727. color: window.DATA.floorMarkerColor || s.newBlue,
  24728. colorUp: s._desat(s.newBlue, .5),
  24729. colorDown: s._darken(s.newBlue, .35),
  24730. opacity: .5,
  24731. style: "ribbon",
  24732. height: .025,
  24733. ribbonWidth: .24,
  24734. outsideHeight: .5,
  24735. waypointRadius: .5,
  24736. waypointIndoorRadius: .24,
  24737. waypointPulse: 1e3,
  24738. typ: l.BLACK,
  24739. meshFree: r.valueFromHash("mf", 1),
  24740. mapGuides: r.valueFromHash("guides", !0),
  24741. fadeInTime: 400,
  24742. fadeOutTime: 300
  24743. },
  24744. warp: {
  24745. nearPanoDist: .1,
  24746. matchCam: !1,
  24747. blur: .33,
  24748. fastTime: 1500,
  24749. teleportTime: 1500,//瞬间过渡的时间
  24750. flytimeDistanceMultiplier:150,//add
  24751. flyTime:750,//add
  24752. outsideTime: 2e3,
  24753. lookAheadMax: .3,
  24754. lookAheadDist: 2.5,
  24755. softPushDist: .37,
  24756. softPushEnd: .3,
  24757. softBendAngle: 8,
  24758. softBendTilt: 4,
  24759. softBendEnd: .3,
  24760. doBurns: !0,
  24761. burnsAngle: 8,
  24762. minBurnsAngle: 35,
  24763. minDownAngle: -35,
  24764. maxTurnPerSec: 280,
  24765. maxAimPerSec: 35,
  24766. minRotation: 12,
  24767. maxAimRotation: 33.2,
  24768. turnFriction: .2,
  24769. flySpeed: .01,
  24770. minWarpTime: 1200,
  24771. warpInterruptionRedirectTime: 500,
  24772. tourStepDelay: r.valueFromHash("st", 0),
  24773. walkDelay: 0,
  24774. walkMaxDist: 50,
  24775. walkMinDist: .8,
  24776. walkSlideShowThreshhold: 3e3,
  24777. walkExtraPanosDistance: .4,
  24778. timePerMeter: 1200,
  24779. motionLeadTime: 5e3,
  24780. movementEasing: "easeInOutQuad",
  24781. blendEasing: "easeInOutQuad",
  24782. showBunny: !1,
  24783. loop: r.valueFromHash("lp", !1),
  24784. auto: r.valueFromHash("ts", -1),
  24785. eOrder: "YXZ",
  24786. stepFactor: .25,
  24787. brakeStrength: 2,
  24788. minBrakeAngle: .1,
  24789. maxBrakeAngle: 1.8,
  24790. climbEffort: 4
  24791. },
  24792. rotationFriction: .05,
  24793. rotationAccelerationInside: 4.5,
  24794. rotationAccelerationOutside: .15,
  24795. rotationAfterMoveMultiplier: 40,
  24796. rotationAfterMoveHistoryCount: 5,
  24797. panFriction: .09,
  24798. panAccelerationOutside: 60,
  24799. onload: r.valueFromHash("onload", o.PANORAMA),
  24800. zoomNearLimit: .1,
  24801. zoomFarLimit: 50,
  24802. navigation: {
  24803. panoScores: !1,
  24804. mouseDirection: !0,
  24805. filterStrictness: .75,
  24806. angleFactor: -30,
  24807. directionFactor: 10,
  24808. distanceFactor: -1,
  24809. optionalityFactor: 3
  24810. },
  24811. sdkInit: !1,
  24812. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24813. console: r.valueFromHash("console", !1),
  24814. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24815. panoramaNeighbourMaxDistance: 5,
  24816. panoFloorClickRadius: .35,
  24817. showScreenshotLocations: !1,
  24818. showAxis: !1,
  24819. showNeighbourRaycasts: !1,
  24820. colorMarkerOnLoad: !1,
  24821. colorMarkerByFloor: !1,
  24822. tiling: {
  24823. panoPreRenderRepeatDelay: 2500,
  24824. panoPreRenderDelay: 500,
  24825. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24826. tilingFlagNames: ["usetiles", "tiles"],
  24827. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24828. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24829. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24830. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24831. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24832. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24833. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24834. customCompression: r.valueFromHash("tilecustcomp", 0),
  24835. mobileHighQualityOverride: 1,
  24836. allowUltraHighResolution: !0
  24837. },
  24838. zoom: {
  24839. enabled: !0,
  24840. forceOff: r.valueFromHash("nozoom", 0),
  24841. overridemax: r.valueFromHash("maxzoom", null),
  24842. overridemin: r.valueFromHash("minzoom", null),
  24843. max: d.highQualityMaxZoom,
  24844. min: 1,
  24845. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24846. activationThreshold: 1.1,
  24847. restoreTime: 500
  24848. },
  24849. profiling: {
  24850. enabled: r.valueFromHash("mem", !1)
  24851. }
  24852. };
  24853. (p = h.deepExtend(p, d, {
  24854. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24855. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24856. panorama: {
  24857. transitionTime: 1e3,
  24858. modelAlpha: 0,
  24859. modelAlphaDelay: p.flydown.modelTextureDelay,
  24860. modelAlphaLength: 1,
  24861. skyboxOpacity: 1,
  24862. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24863. skyboxOpacityLength: .9,
  24864. fovLength: 1,
  24865. fovDelay: 0,
  24866. cameraMatrixDuration: .8,
  24867. cameraMatrixDelay: 0,
  24868. cameraMatrixEase: c.easeInCubic,
  24869. reticuleOpacity: 1,
  24870. markerOpacity: .3,
  24871. markerOpacityOnHover: 1
  24872. },
  24873. dollhouse: {
  24874. transitionTime: 1e3,
  24875. modelAlpha: 1,
  24876. modelAlphaDelay: 0,
  24877. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24878. skyboxOpacity: 0,
  24879. skyboxOpacityDelay: 0,
  24880. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24881. fovLength: 1,
  24882. fovDelay: 0,
  24883. cameraMatrixDuration: .8,
  24884. cameraMatrixDelay: .3,
  24885. cameraMatrixEase: c.easeInCubic,
  24886. reticuleOpacity: 1,
  24887. markerOpacity: 0,
  24888. markerOpacityOnHover: 0
  24889. },
  24890. floorplan: {
  24891. transitionTime: 1e3,
  24892. modelAlpha: 1,
  24893. modelAlphaDelay: 0,
  24894. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24895. skyboxOpacity: 0,
  24896. skyboxOpacityDelay: 0,
  24897. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24898. fovLength: 1,
  24899. fovDelay: 0,
  24900. cameraMatrixDuration: .5,
  24901. cameraMatrixDelay: 0,
  24902. cameraMatrixEase: c.easeOutCubic,
  24903. reticuleOpacity: 1,
  24904. markerOpacity: 0,
  24905. markerOpacityOnHover: 0,
  24906. cameraHeight: 50
  24907. },
  24908. transitioning: {
  24909. reticuleOpacity: 0,
  24910. markerOpacity: .3,
  24911. markerOpacityOnHover: 1
  24912. },
  24913. "floorplan-dollhouse": {
  24914. rotationDelay: 0,
  24915. rotationDuration: 1
  24916. },
  24917. "floorplan-panorama": {
  24918. rotationDelay: .5,
  24919. rotationDuration: 1
  24920. },
  24921. "dollhouse-panorama": {
  24922. rotationDelay: .5,
  24923. rotationDuration: 1
  24924. },
  24925. "dollhouse-floorplan": {
  24926. rotationDelay: 0,
  24927. rotationDuration: 1,
  24928. cameraMatrixDuration: 1.05,
  24929. cameraMatrixDelay: .5
  24930. },
  24931. "panorama-dollhouse": {
  24932. rotationDelay: 0,
  24933. rotationDuration: .5
  24934. },
  24935. "panorama-floorplan": {
  24936. transitionTime: 1500,
  24937. rotationDelay: 0,
  24938. rotationDuration: .5
  24939. }
  24940. })).path.meshFree && (p.path.typ = l.WALK),
  24941. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24942. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24943. window._settings = t.exports = p
  24944. }
  24945. , {
  24946. "./constants": 8,
  24947. "./enum/Colors": 19,
  24948. "./enum/VROption": 47,
  24949. "./enum/Viewmode": 51,
  24950. "./enum/WarpStyle": 52,
  24951. "./util/browser": 182,
  24952. "./util/common": 185,
  24953. "./util/easing": 186,
  24954. "./util/showcase": 193,
  24955. three: 217
  24956. }],
  24957. 167: [function(e, t, i) {
  24958. "use strict";
  24959. var n = e("three")
  24960. , r = e("./settings")
  24961. , 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"
  24962. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24963. t.exports = {
  24964. basicTextured: {
  24965. uniforms: {
  24966. tDiffuse: {
  24967. type: "t",
  24968. value: null
  24969. },
  24970. alpha: {
  24971. type: "f",
  24972. value: 1
  24973. }
  24974. },
  24975. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24976. 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}"
  24977. },
  24978. copyCubeMap: {
  24979. uniforms: {
  24980. tDiffuse: {
  24981. type: "t",
  24982. value: null
  24983. },
  24984. alpha: {
  24985. type: "f",
  24986. value: 1
  24987. }
  24988. },
  24989. 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}",
  24990. 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}"
  24991. },
  24992. cube: {
  24993. uniforms: {
  24994. map: {
  24995. type: "t",
  24996. value: null
  24997. },
  24998. opacity: {
  24999. type: "f",
  25000. value: 1
  25001. }
  25002. },
  25003. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25004. 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"
  25005. },
  25006. model: {
  25007. uniforms: {
  25008. map: {
  25009. type: "t",
  25010. value: null
  25011. },
  25012. modelAlpha: {
  25013. type: "f",
  25014. value: r.modelAlpha
  25015. },
  25016. opacity: {
  25017. type: "f",
  25018. value: 1
  25019. },
  25020. progress: {
  25021. type: "f",
  25022. value: 0
  25023. },
  25024. blackout: {
  25025. type: "i",
  25026. value: 0
  25027. },
  25028. pano0Map: {
  25029. type: "t",
  25030. value: null
  25031. },
  25032. pano0Position: {
  25033. type: "v3",
  25034. value: new n.Vector3
  25035. },
  25036. pano0Matrix: {
  25037. type: "m4",
  25038. value: new n.Matrix4
  25039. },
  25040. pano1Map: {
  25041. type: "t",
  25042. value: null
  25043. },
  25044. pano1Position: {
  25045. type: "v3",
  25046. value: new n.Vector3
  25047. },
  25048. pano1Matrix: {
  25049. type: "m4",
  25050. value: new n.Matrix4
  25051. }
  25052. },
  25053. /* 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",
  25054. 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"
  25055. */
  25056. vertexShader: o + `uniform vec3 pano0Position;
  25057. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  25058. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  25059. varying vec3 vWorldPosition0;
  25060. varying vec3 vWorldPosition1;
  25061. uniform int blackout;
  25062. void main() {
  25063. vUv = uv;
  25064. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  25065. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  25066. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  25067. vWorldPosition0.x *= -1.0;
  25068. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  25069. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  25070. vWorldPosition1.x *= -1.0;
  25071. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  25072. }`,
  25073. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  25074. 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
  25075. void main() {
  25076. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  25077. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  25078. vec4 colorFromPanos;
  25079. if (blackout == 5){//add for TransitionPass
  25080. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  25081. }else{
  25082. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  25083. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  25084. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  25085. else if (blackout == 1) {
  25086. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  25087. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  25088. }
  25089. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  25090. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  25091. }
  25092. vec4 colorFromTexture = texture2D( map, vUv );
  25093. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  25094. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  25095. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  25096. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  25097. }`
  25098. },
  25099. hot: {
  25100. uniforms: {
  25101. color: {
  25102. type: "c",
  25103. value: new n.Color(16720384)
  25104. },
  25105. opac: {
  25106. type: "f",
  25107. value: 0
  25108. },
  25109. texture1: {
  25110. type: "t",
  25111. value: null
  25112. },
  25113. texture2: {
  25114. type: "t",
  25115. value: null
  25116. }
  25117. },
  25118. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25119. 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"
  25120. },
  25121. modelOutside: {
  25122. uniforms: {
  25123. map: {
  25124. type: "t",
  25125. value: null
  25126. },
  25127. opacity: {
  25128. type: "f",
  25129. value: 1
  25130. }
  25131. },
  25132. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25133. 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"
  25134. },
  25135. ribbon: {
  25136. uniforms: {
  25137. map: {
  25138. type: "t",
  25139. value: null
  25140. },
  25141. opacity: {
  25142. type: "f",
  25143. value: 1
  25144. },
  25145. color: {
  25146. type: "c",
  25147. value: new n.Color(r.path.color)
  25148. }
  25149. },
  25150. 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",
  25151. 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"
  25152. },
  25153. waypoint: {
  25154. uniforms: {
  25155. map: {
  25156. type: "t",
  25157. value: null
  25158. },
  25159. opacity: {
  25160. type: "f",
  25161. value: 1
  25162. },
  25163. pulse: {
  25164. type: "f",
  25165. value: 1
  25166. },
  25167. nearFade: {
  25168. type: "v2",
  25169. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25170. },
  25171. color: {
  25172. type: "c",
  25173. value: new n.Color(r.reticuleColor)
  25174. }
  25175. },
  25176. 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",
  25177. 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"
  25178. },
  25179. modelDebug: {
  25180. uniforms: {
  25181. map: {
  25182. type: "t",
  25183. value: null
  25184. },
  25185. modelAlpha: {
  25186. type: "f",
  25187. value: r.modelAlpha
  25188. },
  25189. depthmapRatio: {
  25190. type: "f",
  25191. value: 0
  25192. },
  25193. opacity: {
  25194. type: "f",
  25195. value: 1
  25196. },
  25197. progress: {
  25198. type: "f",
  25199. value: 0
  25200. },
  25201. considerOcclusion: {
  25202. type: "i",
  25203. value: r.fancierTransition
  25204. },
  25205. highlightPanoSelection: {
  25206. type: "i",
  25207. value: 0
  25208. },
  25209. useThirdPano: {
  25210. type: "i",
  25211. value: r.useThirdPano
  25212. },
  25213. pano0Map: {
  25214. type: "t",
  25215. value: null
  25216. },
  25217. pano0Depth: {
  25218. type: "t",
  25219. value: null
  25220. },
  25221. pano0Position: {
  25222. type: "v3",
  25223. value: new n.Vector3
  25224. },
  25225. pano0Matrix: {
  25226. type: "m4",
  25227. value: new n.Matrix4
  25228. },
  25229. pano0Weight: {
  25230. type: "f",
  25231. value: r.transition.pano0Weight
  25232. },
  25233. pano1Map: {
  25234. type: "t",
  25235. value: null
  25236. },
  25237. pano1Depth: {
  25238. type: "t",
  25239. value: null
  25240. },
  25241. pano1Position: {
  25242. type: "v3",
  25243. value: new n.Vector3
  25244. },
  25245. pano1Matrix: {
  25246. type: "m4",
  25247. value: new n.Matrix4
  25248. },
  25249. pano1Weight: {
  25250. type: "f",
  25251. value: r.transition.pano1Weight
  25252. },
  25253. pano2Map: {
  25254. type: "t",
  25255. value: null
  25256. },
  25257. pano2Depth: {
  25258. type: "t",
  25259. value: null
  25260. },
  25261. pano2Position: {
  25262. type: "v3",
  25263. value: new n.Vector3
  25264. },
  25265. pano2Matrix: {
  25266. type: "m4",
  25267. value: new n.Matrix4
  25268. },
  25269. pano2Weight: {
  25270. type: "f",
  25271. value: r.transition.pano2Weight
  25272. }
  25273. },
  25274. 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",
  25275. 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"
  25276. },
  25277. customDepth: {
  25278. uniforms: {
  25279. panoPosition: {
  25280. type: "v3",
  25281. value: new n.Vector3
  25282. }
  25283. },
  25284. 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",
  25285. 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"
  25286. },
  25287. skysphere: {
  25288. uniforms: {
  25289. radius: {
  25290. type: "f",
  25291. value: 0
  25292. }
  25293. },
  25294. 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",
  25295. 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"
  25296. },
  25297. tagDisc: {
  25298. uniforms: {
  25299. opacity: {
  25300. type: "f",
  25301. value: 0
  25302. },
  25303. color: {
  25304. type: "c",
  25305. value: new n.Color
  25306. },
  25307. bg: {
  25308. type: "t",
  25309. value: null
  25310. },
  25311. mask: {
  25312. type: "t",
  25313. value: null
  25314. }
  25315. },
  25316. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25317. 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"
  25318. }
  25319. }
  25320. window.shaders = t.exports;
  25321. }
  25322. , {
  25323. "./settings": 166,
  25324. three: 217
  25325. }],
  25326. 168: [function(E, _, e) {
  25327. (function(e) {
  25328. "use strict";
  25329. var t = E("three")
  25330. , i = (E("url"),
  25331. E("./util/ajax"))
  25332. , n = E("./settings")
  25333. , r = E("./util/logger")
  25334. , o = E("./util/math")
  25335. , a = E("./util/showcase")
  25336. , s = E("./objects/Panorama")
  25337. , l = new r(e)
  25338. , c = E("./model/Model")
  25339. , h = E("./shaders")
  25340. , u = E("./util/transitions")
  25341. , d = E("./objects/Chunk")
  25342. , p = E("./objects/Reticule")
  25343. , f = E("./objects/Skybox")
  25344. , g = E("./objects/Floor")
  25345. , m = E("./cameras/DollhouseCamera")
  25346. , v = E("./cameras/FloorplanCamera")
  25347. , y = E("./cameras/PanoramaCamera")
  25348. , A = E("./controls/DollhouseControls")
  25349. , C = E("./controls/FloorplanControls")
  25350. , I = E("./controls/PanoramaControls");
  25351. t.ImageUtils.crossOrigin = n.crossOrigin,
  25352. _.exports = {
  25353. shaders: h,
  25354. transitions: u,
  25355. Model: c,
  25356. Chunk: d,
  25357. Floor: g,
  25358. Skybox: f,
  25359. Reticule: p,
  25360. Panorama: s,
  25361. DollhouseCamera: m,
  25362. FloorplanCamera: v,
  25363. PanoramaCamera: y,
  25364. DollhouseControls: A,
  25365. FloorplanControls: C,
  25366. PanoramaControls: I,
  25367. getModel: function(e) {
  25368. if (!e.url)
  25369. throw 'getModel(): missing parameter "url"';
  25370. e.autoload = void 0 === e.autoload || e.autoload;
  25371. var t = a.parseSidUrl(e.url);
  25372. e.urlBase = t.urlBase,
  25373. e.urlModel = t.urlModel,
  25374. e.urlFiles = t.urlFiles;
  25375. var i = this._getPlatformError();
  25376. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25377. this._loadModel().then(this._buildModel.bind(this)))
  25378. },
  25379. _getPlatformError: function() {
  25380. 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"
  25381. },
  25382. _loadModel: function() {
  25383. return i.get(this.options.urlModel, {
  25384. responseType: "json",
  25385. prefetchFrom: "model",
  25386. auth: a.getAuthorizationHeader()
  25387. }).then(null, function() {
  25388. return l.warn("Model loading failed at initial metadata load"),
  25389. "loading-failed"
  25390. })
  25391. },
  25392. _buildModel: function(e) {
  25393. e = a.normalizeModeldata(e, o);
  25394. var t = new c(this.options,e);
  25395. return this.options.autoload ? t.load(!0) : $.when(t)
  25396. }
  25397. }
  25398. }
  25399. ).call(this, "/js/showcase.js")
  25400. }
  25401. , {
  25402. "./cameras/DollhouseCamera": 5,
  25403. "./cameras/FloorplanCamera": 6,
  25404. "./cameras/PanoramaCamera": 7,
  25405. "./controls/DollhouseControls": 10,
  25406. "./controls/FloorplanControls": 11,
  25407. "./controls/PanoramaControls": 13,
  25408. "./model/Model": 139,
  25409. "./objects/Chunk": 144,
  25410. "./objects/Floor": 146,
  25411. "./objects/Panorama": 148,
  25412. "./objects/Reticule": 149,
  25413. "./objects/Skybox": 152,
  25414. "./settings": 166,
  25415. "./shaders": 167,
  25416. "./util/ajax": 181,
  25417. "./util/logger": 189,
  25418. "./util/math": 190,
  25419. "./util/showcase": 193,
  25420. "./util/transitions": 195,
  25421. three: 217,
  25422. url: 208
  25423. }],
  25424. 169: [function(e, t, i) {
  25425. "use strict";
  25426. function l(e) {
  25427. var t = {
  25428. renderTarget: null,
  25429. inUse: !1,
  25430. size: -1,
  25431. pano: null
  25432. };
  25433. return t.inUse = !0,
  25434. t.size = e,
  25435. function(e) {
  25436. O.push(e)
  25437. }(t),
  25438. t
  25439. }
  25440. function c(e) {
  25441. for (var t = 0; t < O.length; t++) {
  25442. var i = O[t];
  25443. if (i.renderTarget === e)
  25444. return !(i.inUse = !1)
  25445. }
  25446. return !1
  25447. }
  25448. function n() {
  25449. this.tileDirectory = {},
  25450. this.activeRenderTargetDescriptors = {},
  25451. this.activePanos = [],
  25452. this.panoLODDescriptors = {},
  25453. this.panoDescriptors = {},
  25454. this.tileTrees = {},
  25455. this.sceneRenderer = null,
  25456. this.tileDownloader = null,
  25457. this.forceQueue = [],
  25458. this.uploadQueues = {},
  25459. this.uploadInterval = null,
  25460. this.uploadIntervalCancelled = !1,
  25461. this.usingTileOverlay = !1,
  25462. this.overlayTilesLoaded = !1,
  25463. this.overlayTileBase = null,
  25464. this.overlayTilesBasic = {},
  25465. this.overlayTilesEnhanced = {},
  25466. this.zoomRenderTarget = null,
  25467. this.zoomPano = null,
  25468. this.zoomingActive = !1,
  25469. this.zoomPanoId = null,
  25470. this.zoomPanoRenderingDisabled = !1,
  25471. this.direction = new _.Vector3,
  25472. this.initTime = -1,
  25473. this.maxBaseUploadsPerFrame = R,
  25474. this.maxNonBaseUploadsPerFrame = M
  25475. }
  25476. 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"),
  25477. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25478. e("../objects/Panorama"),
  25479. e("./TileTree")), y = (e("./TileDownloader"),
  25480. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25481. e("../util/browser"),
  25482. 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 = {
  25483. Base: 0,
  25484. Remaining: 1
  25485. }, O = [];
  25486. function L(e) {
  25487. var t = e.shift();
  25488. return t.uploadQueued = !1,
  25489. t
  25490. }
  25491. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25492. this.sceneRenderer = e,
  25493. this.tileDownloader = t,
  25494. this.qualityManager = i,
  25495. this.bindEvents(),
  25496. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25497. this.initTime = performance.now()
  25498. }
  25499. ,
  25500. n.prototype.getActivePanoTextures = function(e) {
  25501. e = e || [];
  25502. for (var t = 0; t < O.length; t++) {
  25503. var i = O[t];
  25504. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25505. }
  25506. }
  25507. ,
  25508. n.prototype.hasQueuedTiles = function() {
  25509. var e = this.peekNextFromUploadQueue();
  25510. return null != e
  25511. }
  25512. ,
  25513. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25514. return this.activeRenderTargetDescriptors[e]
  25515. }
  25516. ,
  25517. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25518. this.activeRenderTargetDescriptors[e] = t
  25519. }
  25520. ,
  25521. n.prototype.loadOverlayTiles = function() {
  25522. if (0 !== d.tiling.overlayStyle) {
  25523. var n = 0
  25524. , e = function(e, t, i) {
  25525. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25526. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25527. ++n === r.length && (this.overlayTilesLoaded = !0)
  25528. }
  25529. .bind(this)
  25530. , 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)]];
  25531. r.forEach(function(e) {
  25532. this.tileDownloader.loadImage(e[0], 0, e[1])
  25533. }
  25534. .bind(this)),
  25535. this.usingTileOverlay = !0
  25536. } else
  25537. this.usingTileOverlay = !1
  25538. }
  25539. ,
  25540. n.prototype.bindEvents = function() {
  25541. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25542. }
  25543. ,
  25544. n.prototype.setupZoomRenderTarget = function() {
  25545. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25546. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25547. return;
  25548. var e = this.zoomRenderTarget;
  25549. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25550. e) {
  25551. var t = e.width
  25552. , i = this.zoomRenderTarget.width;
  25553. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25554. e.texture.dispose(),
  25555. e.texture.loaded = !1,
  25556. e.texture.version = 0,
  25557. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25558. e.texture = null
  25559. }
  25560. this.zoomPanoRenderingDisabled = !1
  25561. } else
  25562. this.zoomPanoRenderingDisabled = !0
  25563. }
  25564. ,
  25565. n.prototype.enableUltraHighQualityMode = function(t) {
  25566. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25567. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25568. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25569. e && (this.qualityManager.enableUltraHighQualityMode(),
  25570. this.setupZoomRenderTarget(),
  25571. t())
  25572. }
  25573. .bind(this))
  25574. }
  25575. }
  25576. ,
  25577. n.prototype.activateTiledPano = function(e, t, i) {
  25578. i && this.clearAllQueuedUploads();
  25579. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25580. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25581. this.linkAllTilesAndNodes(e);
  25582. var r = this.getActiveRenderTargetDescriptor(e.id)
  25583. , o = t;
  25584. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25585. !r || o !== r.size) {
  25586. if (r && c(r.renderTarget),
  25587. !(r = function(e) {
  25588. for (var t = 0; t < O.length; t++) {
  25589. var i = O[t];
  25590. if (!i.inUse && i.size === e)
  25591. return i.inUse = !0,
  25592. i
  25593. }
  25594. return null
  25595. }(o))) {
  25596. var a = this.initTiledPano(o, !1);
  25597. (r = l(a.width)).renderTarget = a
  25598. }
  25599. r.pano = e,
  25600. this.resetPanoDescriptor(e.id),
  25601. this.resetPanoLODDescriptors(e.id),
  25602. this.resetRenderStatus(e.id, !0, !0)
  25603. }
  25604. this.setActiveRenderTargetDescriptor(e.id, r);
  25605. var s = i ? 0 : 1;
  25606. return this.updateActivePanos(e, s),
  25607. r.renderTarget
  25608. }
  25609. ,
  25610. n.prototype.deactivateTiledPano = function(e) {
  25611. var t = this.getActiveRenderTargetDescriptor(e.id);
  25612. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25613. this.setActiveRenderTargetDescriptor(e.id, null);
  25614. var i = this.getUploadQueueForPano(e.id);
  25615. this.clearUploadQueue(i),
  25616. this.updateActivePanos()
  25617. }
  25618. ,
  25619. n.prototype.updateActivePanos = (s = [],
  25620. function(e, t) {
  25621. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25622. e && s.length === t && s.push(e);
  25623. var n = this.activePanos[i]
  25624. , r = this.getActiveRenderTargetDescriptor(n.id);
  25625. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25626. }
  25627. e && t >= s.length && s.push(e),
  25628. this.activePanos.length = 0,
  25629. this.activePanos.push.apply(this.activePanos, s)
  25630. }
  25631. ),
  25632. n.prototype.getActivePanoCount = function() {
  25633. return this.activePanos.length
  25634. }
  25635. ,
  25636. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25637. var i = null;
  25638. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25639. for (var n = function(e, t, i, n) {
  25640. o && (t.tile.zoomUploaded = !1),
  25641. r && (t.tile.uploaded = !1)
  25642. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25643. this.getTileTree(e, a).breadthFirst({
  25644. callback: n.bind(this, a),
  25645. minLevel: i
  25646. })
  25647. }
  25648. }
  25649. ,
  25650. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25651. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25652. t.tile.zoomUploaded = t.tile.uploaded,
  25653. t.zoomCovered = t.covered
  25654. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25655. this.getTileTree(e, n).breadthFirst({
  25656. callback: i.bind(this, n),
  25657. maxLevel: t
  25658. })
  25659. }
  25660. }
  25661. ,
  25662. n.prototype.renderPanoTiles = (h = [],
  25663. function(e, t, i, n) {
  25664. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25665. t = t || this.direction || m.FORWARD;
  25666. var r = this.getActiveRenderTargetDescriptor(e);
  25667. if (!this.isRenderTargetDescriptorValid(r))
  25668. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25669. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25670. var a = this.getTileTree(e, o);
  25671. h.length = 0,
  25672. a.breadthFirst({
  25673. saveVisited: h
  25674. });
  25675. for (var s = 0; s < h.length; s++) {
  25676. var l = h[s];
  25677. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25678. }
  25679. }
  25680. this.updateDirection(t)
  25681. }
  25682. ),
  25683. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25684. return e && e.renderTarget
  25685. }
  25686. ,
  25687. n.prototype.isPanoActive = function(e) {
  25688. var t = this.getActiveRenderTargetDescriptor(e);
  25689. return this.isRenderTargetDescriptorValid(t)
  25690. }
  25691. ,
  25692. n.prototype.isPanoZoomed = function(e) {
  25693. return this.zoomingActive && this.zoomPanoId === e
  25694. }
  25695. ,
  25696. n.prototype.initTileTree = function(e, t, i) {
  25697. var n = this.tileTrees[e];
  25698. n || (n = [],
  25699. this.tileTrees[e] = n);
  25700. var r = n[t];
  25701. if (!r) {
  25702. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25703. r = new v(A.TILE_SIZE,o),
  25704. n[t] = r
  25705. }
  25706. }
  25707. ,
  25708. n.prototype.getTileTree = function(e, t) {
  25709. var i = this.tileTrees[e];
  25710. if (!i)
  25711. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25712. var n = i[t];
  25713. if (!n)
  25714. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25715. return n
  25716. }
  25717. ,
  25718. n.prototype.initTiledPano = function(e, t) {
  25719. var i = this.sceneRenderer.renderer
  25720. , n = (i.context,
  25721. new _.WebGLRenderTargetCube(e,e,{
  25722. stencilBuffer: !1
  25723. }))
  25724. , r = new _.CubeTexture([]);
  25725. (n.texture = r).image = [null, null, null, null, null, null],
  25726. r.flipY = !0,
  25727. t ? (r.generateMipmaps = !0,
  25728. r.magFilter = _.LinearFilter,
  25729. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25730. r.magFilter = _.LinearFilter,
  25731. r.minFilter = _.LinearFilter),
  25732. r.format = _.RGBAFormat,
  25733. i.setRenderTarget(n),
  25734. i.setRenderTarget(null);
  25735. var o = i.properties.get(r);
  25736. return o.__image__webglTextureCube = o.__webglTexture,
  25737. n
  25738. }
  25739. ,
  25740. n.prototype.getUploadQueueForPano = function(e) {
  25741. var t = this.uploadQueues[e];
  25742. return t || (t = [],
  25743. this.uploadQueues[e] = t),
  25744. t
  25745. }
  25746. ,
  25747. n.prototype.isTileUploaded = function(e) {
  25748. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25749. }
  25750. ,
  25751. n.prototype.setUploaded = function(e, t) {
  25752. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25753. }
  25754. ,
  25755. n.prototype.queueTileUpload = function(e, t, i) {
  25756. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25757. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25758. var r = this.getUploadQueueForPano(e.panoId);
  25759. 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),
  25760. e.uploadQueued = !0,
  25761. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25762. }
  25763. }
  25764. ,
  25765. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25766. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25767. }
  25768. ,
  25769. n.prototype.getTopUploadQueue = function() {
  25770. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25771. for (var n = 0; n < this.activePanos.length; n++)
  25772. if (e = this.activePanos[n],
  25773. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25774. switch (i) {
  25775. case P.Base:
  25776. if (0 === t[0].level)
  25777. return t;
  25778. break;
  25779. case P.Remaining:
  25780. return t
  25781. }
  25782. return null
  25783. }
  25784. ,
  25785. n.prototype.getNextFromUploadQueue = function() {
  25786. if (0 < this.forceQueue.length)
  25787. return L(this.forceQueue);
  25788. var e = this.getTopUploadQueue();
  25789. return e && 0 < e.length ? L(e) : null
  25790. }
  25791. ,
  25792. n.prototype.peekNextFromUploadQueue = function() {
  25793. if (0 < this.forceQueue.length)
  25794. return this.forceQueue[0];
  25795. var e = this.getTopUploadQueue();
  25796. return e && 0 < e.length ? e[0] : null
  25797. }
  25798. ,
  25799. n.prototype.clearAllQueuedUploads = function() {
  25800. this.clearAllUploadQueues(null, 0)
  25801. }
  25802. ,
  25803. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25804. this.clearAllUploadQueues(e, 0)
  25805. }
  25806. ,
  25807. n.prototype.clearAllUploadQueues = function(e, t) {
  25808. if (e)
  25809. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25810. this.clearUploadQueue(this.forceQueue, t, e);
  25811. else {
  25812. for (var i = 0; i < this.activePanos.length; i++) {
  25813. var n = this.activePanos[i];
  25814. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25815. }
  25816. this.clearUploadQueue(this.forceQueue, t)
  25817. }
  25818. }
  25819. ,
  25820. n.prototype.clearUploadQueue = function(e, t, i) {
  25821. null != t || (t = 0);
  25822. for (var n = 0; n < e.length; ) {
  25823. var r = e[n];
  25824. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25825. e.splice(n, 1)) : n++
  25826. }
  25827. }
  25828. ,
  25829. n.prototype.refreshUploadInterval = (a = null,
  25830. function(e) {
  25831. this.uploadIntervalCancelled || (a = a || function() {
  25832. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25833. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25834. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25835. }
  25836. .bind(this),
  25837. null != e || (e = x),
  25838. T || (e = S),
  25839. this.uploadInterval = window.setTimeout(a, e),
  25840. this.uploadIntervalDelay = e)
  25841. }
  25842. ),
  25843. n.prototype.update = (r = performance.now(),
  25844. o = 0,
  25845. function() {
  25846. this.uploadIntervalCancelled = !0,
  25847. window.clearTimeout(this.uploadInterval),
  25848. this.uploadInterval = null;
  25849. var e = performance.now() - r;
  25850. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25851. r = performance.now()),
  25852. o++
  25853. }
  25854. ),
  25855. n.prototype.updateUploadQueue = function(e, t) {
  25856. e = e || 1;
  25857. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25858. var r = this.getNextFromUploadQueue();
  25859. if (!r)
  25860. break;
  25861. if (0 !== r.level ? i++ : n++,
  25862. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25863. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25864. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25865. }
  25866. }
  25867. }
  25868. ,
  25869. n.prototype.updateDirection = function(e) {
  25870. if (e = e || this.direction) {
  25871. this.direction = e;
  25872. for (var t = 0; t < this.activePanos.length; t++) {
  25873. var i = this.activePanos[t]
  25874. , n = this.getUploadQueueForPano(i.id);
  25875. y.sortPanoTiles(n, i, this.direction)
  25876. }
  25877. }
  25878. }
  25879. ,
  25880. n.prototype.uploadTile = (I = {},
  25881. new _.Vector4,
  25882. E = d.tiling.overlayStyle,
  25883. function(e, t) {
  25884. var i = e.panoId
  25885. , n = e.image
  25886. , r = e.tileSize
  25887. , o = e.panoSize
  25888. , a = e.tileIndex
  25889. , s = (e.faceTileIndex,
  25890. e.totalTiles)
  25891. , l = (e.face,
  25892. e.tileX)
  25893. , c = e.tileY
  25894. , h = !0
  25895. , u = !1
  25896. , d = (this.getPanoDescriptor(i),
  25897. this.getPanoLODDescriptor(i, o))
  25898. , p = this.getActiveRenderTargetDescriptor(i)
  25899. , f = p.renderTarget
  25900. , g = p.size;
  25901. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25902. g = this.qualityManager.getMaxZoomPanoSize()),
  25903. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25904. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25905. this.isTileUploaded(e) && (u = h = !1)),
  25906. h) {
  25907. var m = r / o * g
  25908. , v = l * r / o * g
  25909. , y = c * r / o * g;
  25910. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25911. var A = I[r];
  25912. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25913. 1 === E || 2 === E) {
  25914. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25915. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25916. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25917. } else
  25918. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25919. d.uploadCount++,
  25920. this.emit(b.TileRenderSuccess, i, o, a, s),
  25921. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25922. this.setUploaded(e, !0),
  25923. this.addCoverageForNode(e.node)
  25924. } else
  25925. this.setUploaded(e, !1);
  25926. return e.uploadAttempted || (d.uploadAttempts++,
  25927. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25928. e.uploadAttempted = !0,
  25929. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25930. u
  25931. }
  25932. ),
  25933. n.prototype.linkTileAndNode = function(e, t) {
  25934. (t.tile = e).node = t
  25935. }
  25936. ,
  25937. n.prototype.linkAllTilesAndNodes = function(a) {
  25938. for (var e = function(e, t, i, n, r) {
  25939. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25940. this.linkTileAndNode(o, i)
  25941. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25942. var i = this.getTileTree(a.id, t);
  25943. i.breadthFirst({
  25944. callback: e.bind(this, i, t)
  25945. })
  25946. }
  25947. }
  25948. ,
  25949. n.prototype.anyUploaded = function(e) {
  25950. if (!e)
  25951. return !1;
  25952. if (e.tile && this.isTileUploaded(e.tile))
  25953. return !0;
  25954. if (e.children)
  25955. for (var t = 0; t < e.children.length; t++) {
  25956. var i = e.children[t];
  25957. if (this.anyUploaded(i))
  25958. return !0
  25959. }
  25960. return !1
  25961. }
  25962. ,
  25963. n.prototype.setNodeCovered = function(e, t) {
  25964. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25965. }
  25966. ,
  25967. n.prototype.isNodeCovered = function(e) {
  25968. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25969. }
  25970. ,
  25971. n.prototype.addCoverageForNode = function(e) {
  25972. if (this.setNodeCovered(e, !0),
  25973. e.parent && e.covered) {
  25974. var t = e.parent;
  25975. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25976. }
  25977. }
  25978. ,
  25979. n.prototype.calcFullCoverage = function(e) {
  25980. var t = !1;
  25981. if (e.children)
  25982. for (var i = 0; i < e.children.length; i++) {
  25983. var n = e.children[i];
  25984. t = t || this.calcFullCoverage(n)
  25985. }
  25986. e.covered = e.tile.uploaded || t
  25987. }
  25988. ,
  25989. n.prototype.nodeSubcovered = function(e) {
  25990. if (!e.children)
  25991. return !1;
  25992. for (var t = 0; t < e.children.length; t++)
  25993. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25994. return !1;
  25995. return !0
  25996. }
  25997. ,
  25998. n.prototype.resetPanoDescriptor = function(e) {
  25999. this.getPanoDescriptor(e)
  26000. }
  26001. ,
  26002. n.prototype.getPanoDescriptor = function(e) {
  26003. var t = this.panoDescriptors[e];
  26004. return t || (t = {},
  26005. this.panoDescriptors[e] = t),
  26006. t
  26007. }
  26008. ,
  26009. n.prototype.resetPanoLODDescriptors = function(e) {
  26010. var t = this.getPanoLODDescriptors(e);
  26011. for (var i in t)
  26012. if (t.hasOwnProperty(i)) {
  26013. var n = t[i];
  26014. n.uploadCount = 0,
  26015. n.uploadAttempts = 0
  26016. }
  26017. }
  26018. ,
  26019. n.prototype.getPanoLODDescriptor = function(e, t) {
  26020. var i = this.getPanoLODDescriptors(e)
  26021. , n = i[t];
  26022. return n || (n = {
  26023. uploadCount: 0,
  26024. uploadAttempts: 0
  26025. },
  26026. i[t] = n),
  26027. n
  26028. }
  26029. ,
  26030. n.prototype.getPanoLODDescriptors = function(e) {
  26031. var t = this.panoLODDescriptors[e];
  26032. return t || (t = {},
  26033. this.panoLODDescriptors[e] = t),
  26034. t
  26035. }
  26036. ,
  26037. n.prototype.onTileDownloaded = function(e) {
  26038. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26039. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26040. if (i.downloaded = !0,
  26041. i.image = e.image,
  26042. i.panoSize = e.panoSize,
  26043. i.tileX = e.tileX,
  26044. i.tileY = e.tileY,
  26045. i.totalTiles = e.totalTiles,
  26046. i.tileIndex = e.tileIndex,
  26047. i.faceTileIndex = e.faceTileIndex,
  26048. i.face = e.face,
  26049. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26050. i.panoId = e.panoId,
  26051. i.tileSize = e.tileSize,
  26052. i.direction = (new _.Vector3).copy(e.direction),
  26053. i.node = null,
  26054. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26055. this.isPanoActive(i.panoId)) {
  26056. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26057. this.linkTileAndNode(i, n),
  26058. this.queueTileUpload(i, !0)
  26059. }
  26060. }
  26061. ,
  26062. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26063. var r = this.tileDirectory[e];
  26064. r || (r = {},
  26065. this.tileDirectory[e] = r);
  26066. var o = 16384 * t + 1024 * i + n
  26067. , a = r[o];
  26068. return a || (a = {
  26069. downloaded: !1,
  26070. uploaded: !1,
  26071. zoomUploaded: !1
  26072. },
  26073. r[o] = a),
  26074. a._key = e + ":" + t + ":" + i + ":" + n,
  26075. a._tileKey = o,
  26076. a
  26077. }
  26078. ,
  26079. n.prototype.setZoomingActive = function(e, t, i) {
  26080. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26081. this.zoomPanoId = t.id,
  26082. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26083. }
  26084. ,
  26085. n.prototype.updateZoomedPanoFromBase = function(e) {
  26086. if (!this.zoomPanoRenderingDisabled) {
  26087. var t = this.getActiveRenderTargetDescriptor(e.id);
  26088. if (t && t.renderTarget) {
  26089. var i = this.qualityManager.getMaxZoomPanoSize()
  26090. , n = t.renderTarget
  26091. , r = t.size;
  26092. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26093. this.copyBaseRenderStatusToZoomed(e.id)
  26094. }
  26095. }
  26096. }
  26097. ,
  26098. t.exports = n
  26099. }
  26100. , {
  26101. "../enum/GLCubeFaces": 25,
  26102. "../enum/PanoRendererEvents": 35,
  26103. "../enum/PanoSizeClass": 36,
  26104. "../enum/SceneRendererEvents": 43,
  26105. "../enum/TileDownloaderEvents": 45,
  26106. "../enum/Vectors": 50,
  26107. "../exception/BasicException": 55,
  26108. "../objects/Panorama": 148,
  26109. "../settings": 166,
  26110. "../util/browser": 182,
  26111. "../util/panorama": 191,
  26112. "./TileDownloader": 171,
  26113. "./TilePrioritizer": 172,
  26114. "./TileTree": 173,
  26115. "./TileUtils": 174,
  26116. events: 202,
  26117. three: 217
  26118. }],
  26119. 170: [function(e, t, i) {
  26120. "use strict";
  26121. function n(e, t, i) {
  26122. this.maxNavPanoSize = -1,
  26123. this.maxZoomPanoSize = -1,
  26124. this.devicePixelDensity = e,
  26125. this.deviceScreenSize = t,
  26126. this.clientBandwidth = i,
  26127. this.panoSizeClassMap = {},
  26128. this.useHighResolutionPanos = !0,
  26129. this.useUltraHighResolutionPanos = !1,
  26130. this.modelHasUltraHighPanos = !1
  26131. }
  26132. var r = e("../enum/PanoSizeClass")
  26133. , o = e("../settings")
  26134. , a = e("../util/browser")
  26135. , s = e("../constants")
  26136. , l = e("../util/showcase")
  26137. , c = e("../enum/ModelManagerEvents");
  26138. n.prototype.init = function(e) {
  26139. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26140. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26141. this.highSize = this.getPanoSize(r.HIGH),
  26142. this.standardSize = this.getPanoSize(r.STANDARD),
  26143. this.baseSize = this.getPanoSize(r.BASE),
  26144. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26145. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26146. this.updateMaximums(),
  26147. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26148. }
  26149. ,
  26150. n.prototype.updateFromModel = function(e) {
  26151. this.updateHighResolutionSettings(e),
  26152. this.updateUltraHighResolutionSettings(e)
  26153. }
  26154. ,
  26155. n.prototype.updateHighResolutionSettings = function(e) {
  26156. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26157. this.updateMaximums()
  26158. }
  26159. ,
  26160. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26161. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26162. this.updateMaximums()
  26163. }
  26164. ,
  26165. n.prototype.enableUltraHighQualityMode = function() {
  26166. this.modelHasUltraHighPanos = !0,
  26167. this.updateUltraHighResolutionSettings(null)
  26168. }
  26169. ,
  26170. n.prototype.ultraHighQualityModeEnabled = function() {
  26171. return this.modelHasUltraHighPanos
  26172. }
  26173. ,
  26174. n.prototype.onModelChanged = function(e) {
  26175. this.updateFromModel(e.model),
  26176. this.updateMaximums()
  26177. }
  26178. ,
  26179. n.prototype.updateMaximums = function() {
  26180. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26181. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26182. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26183. }
  26184. ,
  26185. n.prototype.buildPanoSizeClassMap = function() {
  26186. this.panoSizeClassMap[r.BASE] = 512,
  26187. this.panoSizeClassMap[r.STANDARD] = 1024,
  26188. this.panoSizeClassMap[r.HIGH] = 2048,
  26189. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26190. }
  26191. ,
  26192. n.prototype.getPanoSize = function(e) {
  26193. return this.panoSizeClassMap[e]
  26194. }
  26195. ,
  26196. n.prototype.getMaxPossiblePanoSize = function() {
  26197. return this.getPanoSize(r.ULTRAHIGH)
  26198. }
  26199. ,
  26200. n.prototype.getMaxPanoSize = function() {
  26201. return this.maxZoomPanoSize
  26202. }
  26203. ,
  26204. n.prototype.getMaxNavPanoSize = function() {
  26205. return this.maxNavPanoSize
  26206. }
  26207. ,
  26208. n.prototype.getMaxZoomPanoSize = function() {
  26209. return this.maxZoomPanoSize
  26210. }
  26211. ,
  26212. n.prototype.detectMaxNavPanoSizeClass = function() {
  26213. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26214. }
  26215. ,
  26216. n.prototype.detectMaxNavPanoSize = function() {
  26217. var e = this.detectMaxNavPanoSizeClass();
  26218. return this.getPanoSize(e)
  26219. }
  26220. ,
  26221. n.prototype.detectMaxZoomPanoSize = function() {
  26222. 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)
  26223. }
  26224. ,
  26225. t.exports = n
  26226. }
  26227. , {
  26228. "../constants": 8,
  26229. "../enum/ModelManagerEvents": 33,
  26230. "../enum/PanoSizeClass": 36,
  26231. "../settings": 166,
  26232. "../util/browser": 182,
  26233. "../util/showcase": 193
  26234. }],
  26235. 171: [function(A, C, e) {
  26236. (function(e) {
  26237. "use strict";
  26238. function i(e) {
  26239. this.panos = null,
  26240. this.retryMinimumTime = 1e4,
  26241. this.urls = null,
  26242. this.panoLoadCallbacks = {},
  26243. this.downloadDescriptors = {},
  26244. this.priorityQueue = [],
  26245. this.forceQueue = [],
  26246. this.activeDownloads = [],
  26247. this.qualityManager = null,
  26248. this.tilePrioritizer = null,
  26249. this.refreshInterval = null,
  26250. this.processPriorityQueue = !1,
  26251. this.concurrentDownloads = e.concurrentDownloads || 1,
  26252. this.downloadTestResults = {}
  26253. }
  26254. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26255. A("../settings")), r = (A("../objects/Panorama"),
  26256. A("../util/logger")), o = (A("../enum/Vectors"),
  26257. A("../enum/PanoSizeClass"),
  26258. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26259. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26260. Object.freeze({
  26261. Testing: 1,
  26262. Success: 2,
  26263. Fail: 3
  26264. }));
  26265. i.prototype = Object.create(l.prototype),
  26266. i.IDLE_REFRESH_DELAY = 500,
  26267. i.ACTIVE_REFRESH_DELAY = 16,
  26268. i.DOWNLOAD_RETRIES = 4,
  26269. i.prototype.init = function(e) {
  26270. this.qualityManager = e
  26271. }
  26272. ,
  26273. i.prototype.setUrls = function(e) {
  26274. this.urls = e
  26275. }
  26276. ,
  26277. i.prototype.setPanoData = function(e, t, i) {
  26278. this.panos = e,
  26279. this.imagePanos = t,
  26280. this.panoGroupId = i
  26281. }
  26282. ,
  26283. i.prototype.start = function() {
  26284. this.refreshUpdateInterval(0)
  26285. }
  26286. ,
  26287. i.prototype.stop = function() {
  26288. window.cancel(this.refreshInterval)
  26289. }
  26290. ,
  26291. i.prototype.refreshUpdateInterval = function(e) {
  26292. e = e || 0,
  26293. this.refreshInterval = window.setTimeout(function() {
  26294. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26295. }
  26296. .bind(this), e)
  26297. }
  26298. ,
  26299. i.prototype.update = function() {
  26300. var e = 0 < this.forceQueue.length;
  26301. return this.processQueueForDownloading(this.forceQueue),
  26302. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26303. 0 < this.priorityQueue.length && (e = !0),
  26304. this.processQueueForDownloading(this.priorityQueue)),
  26305. e
  26306. }
  26307. ,
  26308. i.prototype.forceQueueTilesForPano = (p = [],
  26309. f = [],
  26310. function(e, t, i, n, r, o) {
  26311. p.length = 0;
  26312. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26313. var l = a[s];
  26314. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26315. }
  26316. if (i && 0 < p.length) {
  26317. g.sortPanoTiles(p, e, i),
  26318. f.length = 0,
  26319. m.matchingTilesInDirection(e, t, i, n, r, f);
  26320. for (var c = 0, h = function(e) {
  26321. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26322. }; c < p.length; ) {
  26323. var u = p[c];
  26324. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26325. }
  26326. }
  26327. for (var d = 0; d < p.length; d++)
  26328. this.forceQueue.push(p[d]);
  26329. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26330. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26331. o && this.processQueueForDownloading(this.forceQueue, !0)
  26332. }
  26333. ),
  26334. i.prototype.clearForceQueue = function() {
  26335. this.clearQueue(this.forceQueue)
  26336. }
  26337. ,
  26338. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26339. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26340. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26341. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26342. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26343. }
  26344. ,
  26345. i.prototype.clearQueue = function(e) {
  26346. this.setStatusForAllDescriptors(e, v.None),
  26347. e.length = 0
  26348. }
  26349. ,
  26350. i.prototype.clearFromQueue = function(e, t, i) {
  26351. for (var n = 0; n < e.length; n++) {
  26352. var r = e[n];
  26353. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26354. }
  26355. }
  26356. ,
  26357. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26358. for (var i = 0; i < e.length; i++) {
  26359. var n = e[i];
  26360. n && (n.status = t)
  26361. }
  26362. }
  26363. ,
  26364. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26365. for (var i = 0; i < e.length; i++) {
  26366. var n = e[i];
  26367. n && (n.status !== t ? n.status = t : e[i] = null)
  26368. }
  26369. }
  26370. ,
  26371. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26372. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26373. , n = i[t];
  26374. return n || (n = this.buildDownloadDescriptorArray(t),
  26375. i[t] = n,
  26376. this.initTileDownloadDescriptors(n, e, t)),
  26377. n
  26378. }
  26379. ,
  26380. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26381. var t = this.downloadDescriptors[e.id];
  26382. return t || (t = {},
  26383. this.downloadDescriptors[e.id] = t),
  26384. t
  26385. }
  26386. ,
  26387. i.prototype.processQueueForDownloading = function(e, t) {
  26388. if (this.cleanupActiveDownloads(),
  26389. this.activeDownloads.length < this.concurrentDownloads || t)
  26390. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26391. var r = e.shift();
  26392. r && (this.startDownload(r),
  26393. n++)
  26394. }
  26395. }
  26396. ,
  26397. i.prototype.testDownload = function(t, e, i) {
  26398. var n = this.downloadTestResults[t];
  26399. if (n)
  26400. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26401. else {
  26402. this.downloadTestResults[t] = y.Testing;
  26403. var r = this.panos.list[0]
  26404. , o = this.getTileUrl(r.id, t, e, 0)
  26405. , a = function(e) {
  26406. this.downloadTestResults[t] = y.Success,
  26407. i(!0)
  26408. }
  26409. .bind(this)
  26410. , s = function() {
  26411. this.downloadTestResults[t] = y.Fail,
  26412. i(!1)
  26413. }
  26414. .bind(this);
  26415. this.loadImage(o, 0, a, s)
  26416. }
  26417. }
  26418. ,
  26419. i.prototype.startDownload = function(e) {
  26420. e.status = v.Downloading;
  26421. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26422. this.activeDownloads.push(e),
  26423. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26424. }
  26425. ,
  26426. i.prototype.downloadFailed = function(e, t) {}
  26427. ,
  26428. i.prototype.downloadComplete = function(e, t) {
  26429. if (e.panoGroupId === this.panoGroupId) {
  26430. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26431. e.status = v.Downloaded,
  26432. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26433. var n = {
  26434. panoId: e.pano.id,
  26435. image: t,
  26436. tileSize: e.tileSize,
  26437. panoSize: e.panoSize,
  26438. tileIndex: e.tileIndex,
  26439. faceTileIndex: e.faceTileIndex,
  26440. totalTiles: e.totalTiles,
  26441. face: e.face,
  26442. tileX: e.tileX,
  26443. tileY: e.tileY,
  26444. direction: e.direction
  26445. };
  26446. e.image = t,
  26447. this.emit(o.TileDownloadSuccess, n),
  26448. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26449. panoId: e.pano.id,
  26450. tileSize: e.tileSize,
  26451. panoSize: e.panoSize
  26452. },
  26453. this.emit(o.PanoDownloadComplete, n),
  26454. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26455. }
  26456. }
  26457. ,
  26458. i.prototype.cleanupActiveDownloads = (n = [],
  26459. function() {
  26460. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26461. var t = this.activeDownloads[e];
  26462. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26463. }
  26464. this.activeDownloads.length = 0,
  26465. this.activeDownloads.push.apply(this.activeDownloads, n)
  26466. }
  26467. ),
  26468. i.prototype.isPanoDownloaded = function(e, t) {
  26469. var i = this.getTileDownloadDescriptors(e, t);
  26470. if (i.length <= 0)
  26471. return !1;
  26472. for (var n = 0; n < i.length; n++) {
  26473. if (i[n].status !== v.Downloaded)
  26474. return !1
  26475. }
  26476. return !0
  26477. }
  26478. ,
  26479. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26480. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26481. this.panoLoadCallbacks[o] = {
  26482. onLoad: i,
  26483. onFail: n,
  26484. onProgress: r
  26485. }
  26486. }
  26487. ,
  26488. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26489. var i = e.id + ":" + t;
  26490. return this.panoLoadCallbacks[i]
  26491. }
  26492. ,
  26493. i.prototype.buildDownloadDescriptorArray = function(e) {
  26494. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26495. var r = this.buildDownloadDescriptor();
  26496. i.push(r)
  26497. }
  26498. return i
  26499. }
  26500. ,
  26501. i.prototype.buildDownloadDescriptor = function() {
  26502. return {
  26503. panoGroupId: null,
  26504. pano: null,
  26505. panoSize: -1,
  26506. tileSize: -1,
  26507. tileIndex: -1,
  26508. totalTiles: -1,
  26509. faceTileIndex: -1,
  26510. status: v.None,
  26511. url: null,
  26512. image: null,
  26513. direction: new t.Vector3,
  26514. face: -1,
  26515. cubeFace: -1,
  26516. tileX: -1,
  26517. tileY: -1
  26518. }
  26519. }
  26520. ,
  26521. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26522. for (var n = 0; n < e.length; n++) {
  26523. var r = e[n];
  26524. this.initTileDownloadDescriptor(r, t, i, n)
  26525. }
  26526. }
  26527. ,
  26528. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26529. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26530. e.face = m.getFaceForTile(i, n),
  26531. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26532. e.panoGroupId = this.panoGroupId,
  26533. e.pano = t,
  26534. e.panoSize = i,
  26535. e.tileSize = r,
  26536. e.tileIndex = n,
  26537. e.totalTiles = m.getTileCountForSize(i),
  26538. e.status = v.None,
  26539. e.image = null,
  26540. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26541. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26542. }
  26543. ,
  26544. i.prototype.getTileUrl = (c = {
  26545. 256: "256",
  26546. 512: "512",
  26547. 1024: "1k",
  26548. 2048: "2k",
  26549. 4096: "4k"
  26550. },
  26551. h = {
  26552. face: -1,
  26553. faceTileIndex: -1,
  26554. tileX: -1,
  26555. tileY: -1
  26556. },
  26557. function(e, t, i, n) {
  26558. m.getTileLocation(t, n, h);
  26559. var r = Math.floor(t / i)
  26560. , o = r * r
  26561. , a = Math.floor(n / o)
  26562. , s = "";
  26563. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26564. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26565. return d.changeIfTileGenerating(l)
  26566. }
  26567. ),
  26568. i.prototype.loadImage = function(e, t, i, n) {
  26569. s.getImage(e, t).then(function(e) {
  26570. i(e)
  26571. }).fail(n)
  26572. }
  26573. ,
  26574. C.exports = i
  26575. }
  26576. ).call(this, "/js/tile/TileDownloader.js")
  26577. }
  26578. , {
  26579. "../ab": 3,
  26580. "../enum/DownloadStatus": 24,
  26581. "../enum/GLCubeFaces": 25,
  26582. "../enum/PanoSizeClass": 36,
  26583. "../enum/TileDownloaderEvents": 45,
  26584. "../enum/Vectors": 50,
  26585. "../enum/Viewmode": 51,
  26586. "../objects/Panorama": 148,
  26587. "../settings": 166,
  26588. "../util/ajax": 181,
  26589. "../util/logger": 189,
  26590. "../util/panorama": 191,
  26591. "./TilePrioritizer": 172,
  26592. "./TileUtils": 174,
  26593. events: 202,
  26594. three: 217
  26595. }],
  26596. 172: [function(n, C, e) {
  26597. (function(e) {
  26598. "use strict";
  26599. function h(e, t, i, n, r) {
  26600. this.qualityManager = e,
  26601. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26602. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26603. this.baseSize = t,
  26604. this.standardSize = i,
  26605. this.highSize = n,
  26606. this.ultraHighSize = r,
  26607. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26608. }
  26609. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26610. n("../settings"),
  26611. n("../settings"),
  26612. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26613. n("../enum/PanoSizeClass"),
  26614. n("../enum/ModelManagerEvents"),
  26615. n("../enum/GLCubeFaces"),
  26616. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26617. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26618. new t(e),
  26619. Object.freeze({
  26620. None: 0,
  26621. DirectionalFOV: 1
  26622. }));
  26623. h.PriorityCriteria = function(e, t, i, n, r) {
  26624. this.pano = e,
  26625. this.cameraPosition = (new o.Vector3).copy(t),
  26626. this.cameraDir = (new o.Vector3).copy(i),
  26627. this.panoSpaceDir = (new o.Vector3).copy(n),
  26628. this.upcomingPanos = r,
  26629. this.copy = function(e) {
  26630. this.pano = e.pano,
  26631. this.cameraPosition.copy(e.cameraPosition),
  26632. this.cameraDir.copy(e.cameraDir),
  26633. this.panoSpaceDir.copy(e.panoSpaceDir),
  26634. this.upcomingPanos = r
  26635. }
  26636. ,
  26637. this.zoomingActive = !1
  26638. }
  26639. ,
  26640. h.DIRECTIONAL_FOV = 180,
  26641. h.DIRECTIONAL_FOV_NARROW = 120,
  26642. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26643. h.MAX_SCORED_PANOS_TOADD = 2,
  26644. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26645. h.DIRECTION_SCORE_STRICTNESS = .75,
  26646. h.appendQueue = function(e, t) {
  26647. if (e && t)
  26648. for (var i = 0; i < t.length; i++)
  26649. e.push(t[i])
  26650. }
  26651. ,
  26652. h.prototype.updateCriteria = function(e, t, i, n) {
  26653. this.priorityCriteria.pano = e,
  26654. this.priorityCriteria.cameraPosition.copy(t),
  26655. this.priorityCriteria.cameraDir.copy(i),
  26656. this.priorityCriteria.upcomingPanos = n,
  26657. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26658. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26659. }
  26660. ,
  26661. h.prototype.filterAndPrioritize = (u = [],
  26662. p = [],
  26663. f = [],
  26664. function(e, t, i) {
  26665. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26666. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26667. var n = this.baseSize
  26668. , r = this.standardSize
  26669. , o = this.highSize
  26670. , a = this.ultraHighSize;
  26671. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26672. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26673. f.length = 0,
  26674. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26675. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26676. h.appendQueue(e, f),
  26677. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26678. f.length = 0,
  26679. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26680. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26681. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26682. h.appendQueue(e, f),
  26683. f.length = 0,
  26684. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26685. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26686. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26687. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26688. h.appendQueue(e, f),
  26689. this.queueTilesForPanos(e, u, i, n)
  26690. }
  26691. ),
  26692. h.prototype.canDownloadSize = function(e) {
  26693. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26694. }
  26695. ,
  26696. h.prototype.populateNeighborPanos = function(e, t, i) {
  26697. (i = i || []).length = 0;
  26698. var n = t.getNeighbours(e);
  26699. for (var r in n)
  26700. if (n.hasOwnProperty(r)) {
  26701. var o = t.get(r);
  26702. i.push(o)
  26703. }
  26704. return i
  26705. }
  26706. ,
  26707. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26708. (i = i || []).length = 0;
  26709. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26710. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26711. , s = t.sortByScore(o, a);
  26712. if (s)
  26713. for (var l = 0; l < s.length && l < r; l++) {
  26714. var c = s[l].item;
  26715. i.push(c)
  26716. }
  26717. return i
  26718. }
  26719. ,
  26720. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26721. for (var o = 0, a = 0; a < t.length; a++) {
  26722. var s = t[a];
  26723. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26724. r && r <= o)
  26725. break
  26726. }
  26727. return o
  26728. }
  26729. ,
  26730. h.prototype.queueTilesForPano = (r = {
  26731. filter: a.None
  26732. },
  26733. function(e, t, i, n) {
  26734. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26735. }
  26736. ),
  26737. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26738. function(e, t, i, n, r, o, a, s) {
  26739. for (var l = 0, c = 0; c < i.length; c++) {
  26740. var h = i[c];
  26741. d.copy(h.position),
  26742. d.sub(r),
  26743. d.normalize();
  26744. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26745. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26746. s && s <= l))
  26747. break
  26748. }
  26749. return l
  26750. }
  26751. ),
  26752. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26753. for (var l = 0, c = 0; c < i.length; c++) {
  26754. var h = i[c];
  26755. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26756. s && s <= l)
  26757. break
  26758. }
  26759. return l
  26760. }
  26761. ,
  26762. h.prototype.queueTilesInDirectionForPano = (s = {
  26763. filter: a.DirectionalFOV,
  26764. direction: new o.Vector3,
  26765. fov: 60
  26766. },
  26767. l = new o.Vector3,
  26768. function(e, t, i, n, r, o, a) {
  26769. return l.copy(o),
  26770. m.getRelativeDirection(i.quaternion, l),
  26771. s.direction.copy(l),
  26772. s.fov = a,
  26773. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26774. }
  26775. ),
  26776. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26777. function(e, t, i, n, r) {
  26778. var o = t.getTileDownloadDescriptors(i, n);
  26779. c.length = 0,
  26780. this.filterTileDownloadDescriptors(i, o, c, r);
  26781. for (var a = 0, s = 0; s < c.length; s++) {
  26782. var l = c[s];
  26783. l && (e.push(l),
  26784. a++)
  26785. }
  26786. return a
  26787. }
  26788. ),
  26789. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26790. function(e, t, i, n) {
  26791. var r, o;
  26792. switch (n.filter) {
  26793. case a.DirectionalFOV:
  26794. for (r = 0; r < t.length; r++)
  26795. o = t[r],
  26796. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26797. break;
  26798. default:
  26799. for (r = 0; r < t.length; r++)
  26800. o = t[r],
  26801. i.push(o)
  26802. }
  26803. for (r = 0; r < i.length; r++)
  26804. o = i[r],
  26805. this.canIncludeDescriptor(o) || (i[r] = null)
  26806. }
  26807. ),
  26808. h.prototype.canIncludeDescriptor = function(e) {
  26809. return e.status !== i.Downloading && e.status !== i.Downloaded
  26810. }
  26811. ,
  26812. h.prototype.canIncludePano = function(e, t) {
  26813. return !e.isLoaded(t)
  26814. }
  26815. ,
  26816. h.getFOVDotThreshold = function(e) {
  26817. return Math.cos(o.Math.degToRad(e / 2))
  26818. }
  26819. ;
  26820. var y = (A._panoSpaceDir = new o.Vector3,
  26821. A._fovThreshold = -1,
  26822. A._fovThresholdNarrow = -1,
  26823. A);
  26824. function A(e, t) {
  26825. var i = A._panoSpaceDir
  26826. , n = A._fovThreshold
  26827. , r = A._fovThresholdNarrow
  26828. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26829. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26830. return e._dot = o,
  26831. t._dot = a,
  26832. 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)
  26833. }
  26834. h.sortPanoTiles = function(e, t, i) {
  26835. y._panoSpaceDir.copy(i),
  26836. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26837. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26838. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26839. e.sort(y)
  26840. }
  26841. ,
  26842. h.insertSortedPanoTile = function(e, t, i, n) {
  26843. y._panoSpaceDir.copy(n),
  26844. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26845. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26846. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26847. for (var r = -1, o = 0; o < e.length; o++) {
  26848. if (y(t, e[o]) <= 0) {
  26849. r = o;
  26850. break
  26851. }
  26852. }
  26853. if (-1 === r)
  26854. e[e.length] = t;
  26855. else {
  26856. for (var a = e.length; r < a; a--)
  26857. e[a] = e[a - 1];
  26858. e[r] = t
  26859. }
  26860. }
  26861. ,
  26862. h.prototype.setZoomingActive = function(e) {
  26863. e !== this.zoomingActive && (this.zoomingActive = e)
  26864. }
  26865. ,
  26866. C.exports = h
  26867. }
  26868. ).call(this, "/js/tile/TilePrioritizer.js")
  26869. }
  26870. , {
  26871. "../enum/DownloadStatus": 24,
  26872. "../enum/GLCubeFaces": 25,
  26873. "../enum/ModelManagerEvents": 33,
  26874. "../enum/PanoSizeClass": 36,
  26875. "../enum/Vectors": 50,
  26876. "../enum/Viewmode": 51,
  26877. "../objects/Panorama": 148,
  26878. "../settings": 166,
  26879. "../util/browser": 182,
  26880. "../util/logger": 189,
  26881. "../util/math": 190,
  26882. "./TileUtils": 174,
  26883. events: 202,
  26884. three: 217
  26885. }],
  26886. 173: [function(e, t, i) {
  26887. "use strict";
  26888. function f(e, t) {
  26889. this.levels = t,
  26890. this.tileSize = e,
  26891. this.root = null,
  26892. this.allNodes = [],
  26893. function(e) {
  26894. e.root = function e(t, i, n) {
  26895. if (n > t.levels)
  26896. return null;
  26897. var r = new a(t,i);
  26898. t.allNodes.push(r);
  26899. for (var o = 0; o < s; o++)
  26900. r.children[o] = e(t, r, n + 1);
  26901. return r
  26902. }(e, null, 0)
  26903. }(this)
  26904. }
  26905. function a(e, t) {
  26906. this.tree = e,
  26907. this.parent = t,
  26908. this.children = [],
  26909. this.id = ++n
  26910. }
  26911. var g = (e("three"),
  26912. e("./TileUtils"),
  26913. e("../objects/Panorama"),
  26914. e("../util/panorama"),
  26915. e("events").EventEmitter,
  26916. 2)
  26917. , s = g * g;
  26918. f.TraversalType = Object.freeze({
  26919. PreOrder: 0,
  26920. PostOrder: 1
  26921. });
  26922. var n = 0;
  26923. f.getLevelCountForSize = function(e, t) {
  26924. var i = 0;
  26925. for (t < e && (t = e); !((t /= g) < e); )
  26926. i++;
  26927. return i
  26928. }
  26929. ,
  26930. f.getSizeForLevel = function(e, t) {
  26931. return Math.pow(g, t) * e
  26932. }
  26933. ,
  26934. f.prototype.getSubNode = function(e, t, i) {
  26935. (!t || e < this.tileSize) && (t = 0),
  26936. (!i || e < this.tileSize) && (i = 0),
  26937. e < this.tileSize && (e = this.tileSize);
  26938. var n = f.getLevelCountForSize(this.tileSize, e);
  26939. return function e(t, i, n, r, o) {
  26940. if (!t)
  26941. return null;
  26942. if (0 === n)
  26943. return t;
  26944. if (!t.children || 0 === t.children.length)
  26945. return null;
  26946. var a = Math.pow(g, n) / g
  26947. , s = r % a
  26948. , l = o % a
  26949. , c = Math.floor(o / a)
  26950. , h = Math.floor(r / a)
  26951. , u = c * g + h;
  26952. return e(t.children[u], i + 1, n - 1, s, l)
  26953. }(this.root, 0, n, t, i)
  26954. }
  26955. ,
  26956. f.prototype.breadthFirst = function(e) {
  26957. var t = !!(e = e || {}).nullLevelEnd
  26958. , i = e.maxLevel
  26959. , n = e.minLevel
  26960. , r = e.callback
  26961. , o = e.saveVisited
  26962. , a = []
  26963. , s = {}
  26964. , l = 0;
  26965. for (a.push(this.root),
  26966. a.push(s); 0 < a.length && !(i && i < l); ) {
  26967. var c = a.shift();
  26968. if (c === s)
  26969. (!n || n <= l) && (r && t && r(null),
  26970. o && t && o.push(null)),
  26971. 0 < a.length && a.push(s),
  26972. l++,
  26973. 0;
  26974. else {
  26975. if (c.children)
  26976. for (var h = 0; h < c.children.length; h++) {
  26977. c.children[h] && a.push(c.children[h])
  26978. }
  26979. var u = this.getFaceIndexFromNode(c);
  26980. (!n || n <= l) && (r && r(c, l, u),
  26981. o && o.push(c)),
  26982. 0
  26983. }
  26984. }
  26985. }
  26986. ,
  26987. f.prototype.getFaceIndexFromNode = function(e) {
  26988. if (!e)
  26989. return -1;
  26990. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26991. var o = i.parent;
  26992. if (!o)
  26993. break;
  26994. for (var a = -1, s = 0; s < o.children.length; s++)
  26995. o.children[s] === i && (a = s);
  26996. n = a % g * t + n,
  26997. r = Math.floor(a / g) * t + r,
  26998. t *= g,
  26999. i = o
  27000. }
  27001. return r * t + n
  27002. }
  27003. ,
  27004. f.prototype.depthFirst = function(e, t, i) {
  27005. !function e(t, i, n, r, o, a, s, l) {
  27006. if (t) {
  27007. s = s || f.TraversalType.PreOrder;
  27008. var c = r * g + n;
  27009. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  27010. a && a.push(t)),
  27011. t.children && 0 !== t.children.length) {
  27012. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  27013. for (var p = 0; p < g; p++)
  27014. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  27015. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  27016. a && a.push(t))
  27017. }
  27018. }
  27019. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27020. }
  27021. ,
  27022. t.exports = f
  27023. }
  27024. , {
  27025. "../objects/Panorama": 148,
  27026. "../util/panorama": 191,
  27027. "./TileUtils": 174,
  27028. events: 202,
  27029. three: 217
  27030. }],
  27031. 174: [function(e, t, i) {
  27032. "use strict";
  27033. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27034. b.TILE_SIZE = 512,
  27035. b.FACES_PER_PANO = 6,
  27036. b.LocationOnTile = {
  27037. Center: 0,
  27038. UpperLeft: 1,
  27039. UpperRight: 2,
  27040. LowerRight: 3,
  27041. LowerLeft: 4
  27042. },
  27043. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27044. var l = e / t
  27045. , c = t / e * 2
  27046. , h = c / 2
  27047. , u = n / l * 2 - 1 + h
  27048. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27049. switch (o = o || b.LocationOnTile.Center) {
  27050. case b.LocationOnTile.UpperLeft:
  27051. u -= h,
  27052. d += h,
  27053. u += a * c;
  27054. break;
  27055. case b.LocationOnTile.UpperRight:
  27056. u += h,
  27057. d += h,
  27058. d -= a * c;
  27059. break;
  27060. case b.LocationOnTile.LowerRight:
  27061. u += h,
  27062. d -= h,
  27063. u -= a * c;
  27064. break;
  27065. case b.LocationOnTile.LowerLeft:
  27066. u -= h,
  27067. d -= h,
  27068. d += a * c;
  27069. break;
  27070. case b.LocationOnTile.Center:
  27071. }
  27072. switch (i) {
  27073. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27074. _.setVector(s, -1, d, -u);
  27075. break;
  27076. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27077. _.setVector(s, 1, d, u);
  27078. break;
  27079. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27080. _.setVector(s, -u, 1, -d);
  27081. break;
  27082. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27083. _.setVector(s, -u, -1, d);
  27084. break;
  27085. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27086. _.setVector(s, -u, d, 1);
  27087. break;
  27088. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27089. _.setVector(s, u, d, -1)
  27090. }
  27091. _.normalize(s)
  27092. }
  27093. ,
  27094. b.getFaceForTile = function(e, t) {
  27095. var i = b.TILE_SIZE;
  27096. e < b.TILE_SIZE && (i = e);
  27097. var n = Math.floor(e / i)
  27098. , r = n * n;
  27099. return Math.floor(t / r)
  27100. }
  27101. ,
  27102. b.getTileLocation = function(e, t, i) {
  27103. var n = b.TILE_SIZE;
  27104. e < b.TILE_SIZE && (n = e);
  27105. var r = b.getFaceForTile(e, t)
  27106. , o = Math.floor(e / n)
  27107. , a = t - r * (o * o);
  27108. i.tileX = a % o,
  27109. i.tileY = Math.floor(a / o),
  27110. i.face = r,
  27111. i.faceTileIndex = a
  27112. }
  27113. ,
  27114. b.getTileCountForSize = function(e) {
  27115. if (e <= b.TILE_SIZE)
  27116. return b.FACES_PER_PANO;
  27117. var t = Math.floor(e / b.TILE_SIZE);
  27118. return t * t * b.FACES_PER_PANO
  27119. }
  27120. ,
  27121. b.getRelativeDirection = (r = new _.Matrix4,
  27122. o = new _.Quaternion,
  27123. function(e, t) {
  27124. o.copy(e),
  27125. o.inverse(),
  27126. r.makeRotationFromQuaternion(o),
  27127. r.applyToVector3(t),
  27128. _.normalize(t)
  27129. }
  27130. ),
  27131. b.matchingTilesInDirection = (c = new _.Vector3,
  27132. h = new _.Vector3(0,0,-1),
  27133. u = new _.Quaternion,
  27134. l = {
  27135. face: -1,
  27136. faceTileIndex: -1,
  27137. tileX: -1,
  27138. tileY: -1
  27139. },
  27140. d = function(e, t, i) {
  27141. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27142. b.getTileLocation(e, o, l),
  27143. t && !t(l) || (r++,
  27144. i && (a = l,
  27145. i.push({
  27146. face: a.face,
  27147. faceTileIndex: a.faceTileIndex,
  27148. tileX: a.tileX,
  27149. tileY: a.tileY
  27150. })));
  27151. var a;
  27152. return r
  27153. }
  27154. ,
  27155. function(e, t, i, n, r, o) {
  27156. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27157. if (b.getTileCountForSize(t),
  27158. !n && !r)
  27159. return d(t, null, o);
  27160. var s = !!r;
  27161. return r = r || n,
  27162. r = Math.max(0, Math.min(r, 360)),
  27163. n = Math.max(0, Math.min(n, 360)),
  27164. _.copyVector(i, c),
  27165. b.getRelativeDirection(e.quaternion, c),
  27166. s ? (u.setFromUnitVectors(c, h),
  27167. d(t, function(e) {
  27168. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27169. }, o)) : d(t, function(e) {
  27170. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27171. }, o)
  27172. }
  27173. ),
  27174. b.isTileWithinFrustum = (E = new _.Vector3,
  27175. function(e, t, i, n, r, o, a, s) {
  27176. 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++)
  27177. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27178. _.applyQuaternionToVector(o, E),
  27179. -1e-5 <= E.z)
  27180. ;
  27181. else {
  27182. var A = -1 / E.z
  27183. , C = E.x * A
  27184. , I = E.y * A;
  27185. l < I ? p++ : I < c && f++,
  27186. h < C ? g++ : C < u && m++,
  27187. v++
  27188. }
  27189. return f !== v && p !== v && g !== v && m !== v
  27190. }
  27191. ),
  27192. b.isTileWithinFOV = (p = new _.Vector3,
  27193. f = new _.Vector3(0,1,0),
  27194. g = new _.Vector3(1,0,0),
  27195. function(e, t, i, n, r, o, a) {
  27196. var s = b.mapFaceToCubemapFace(i);
  27197. if (_.cross(o, f, g),
  27198. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27199. b.isWithinFOV(p, o, a, null))
  27200. return !0;
  27201. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27202. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27203. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27204. b.isWithinFOV(p, o, a, null))
  27205. return !0;
  27206. h += l
  27207. }
  27208. return !1
  27209. }
  27210. ),
  27211. b.isWithinFOV = (a = new _.Vector3,
  27212. s = new _.Vector3,
  27213. function(e, t, i, n) {
  27214. if (_.copyVector(e, s),
  27215. n) {
  27216. _.copyVector(n, a),
  27217. _.normalize(a);
  27218. var r = _.dot(a, e);
  27219. a.x *= r,
  27220. a.y *= r,
  27221. a.z *= r,
  27222. _.subVector(s, a)
  27223. }
  27224. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27225. return Math.cos(o) <= _.dot(s, t)
  27226. }
  27227. ),
  27228. b.mapFaceToCubemapFace = (n = {
  27229. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27230. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27231. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27232. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27233. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27234. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27235. },
  27236. function(e) {
  27237. return n[e]
  27238. }
  27239. ),
  27240. t.exports = b
  27241. }
  27242. , {
  27243. "../enum/GLCubeFaces": 25,
  27244. "../util/MathLight": 176
  27245. }],
  27246. 175: [function(i, n, e) {
  27247. (function(e) {
  27248. "use strict";
  27249. function t() {
  27250. this.list = [],
  27251. this.index = {},
  27252. Object.defineProperty(this, "length", {
  27253. get: function() {
  27254. return this.list.length
  27255. }
  27256. })
  27257. }
  27258. new (i("./common"),
  27259. i("./logger"))(e),
  27260. t.prototype.forEach = function(e) {
  27261. this.list.forEach(e)
  27262. }
  27263. ,
  27264. t.prototype.add = function(e) {
  27265. this.list.push(e),
  27266. this.index[this.getIndex(e)] = e
  27267. }
  27268. ,
  27269. t.prototype.getIndex = function(e) {
  27270. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27271. }
  27272. ,
  27273. t.prototype.extend = function(e) {
  27274. for (var t = 0; t < e.length; t++)
  27275. this.add(e[t])
  27276. }
  27277. ,
  27278. t.prototype.get = function(e) {
  27279. return this.index[e]
  27280. }
  27281. ,
  27282. t.prototype.first = function() {
  27283. return this.list[0]
  27284. }
  27285. ,
  27286. t.prototype.last = function() {
  27287. return this.list[this.list.length - 1]
  27288. }
  27289. ,
  27290. t.prototype.reIndex = function() {
  27291. this.index = {};
  27292. var t = this;
  27293. this.forEach(function(e) {
  27294. t.index[t.getIndex(e)] = e
  27295. })
  27296. }
  27297. ,
  27298. t.prototype.filter = function(e) {
  27299. var t = this.list.filter(e);
  27300. return this.reIndex(),
  27301. t
  27302. }
  27303. ,
  27304. t.prototype.reduce = function(e, t) {
  27305. return this.list.reduce(e, t)
  27306. }
  27307. ,
  27308. t.prototype.sort = function(e) {
  27309. return this.list.sort(e)
  27310. }
  27311. ,
  27312. t.prototype.indexOf = function(e) {
  27313. for (var t = 0; t < this.list.length; ++t)
  27314. if (this.list[t] === e)
  27315. return t;
  27316. return -1
  27317. }
  27318. ,
  27319. n.exports = t
  27320. }
  27321. ).call(this, "/js/util/IndexedCollection.js")
  27322. }
  27323. , {
  27324. "./common": 185,
  27325. "./logger": 189
  27326. }],
  27327. 176: [function(e, t, i) {
  27328. "use strict";
  27329. e("../constants");
  27330. var n, r, o = {};
  27331. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27332. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27333. o.Vector3 = function(e, t, i) {
  27334. this.x = e || 0,
  27335. this.y = t || 0,
  27336. this.z = i || 0
  27337. }
  27338. ,
  27339. o.Matrix4 = function() {
  27340. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27341. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27342. }
  27343. ,
  27344. o.Matrix4.prototype = {
  27345. identity: function() {
  27346. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27347. this
  27348. },
  27349. copy: function(e) {
  27350. return this.elements.set(e.elements),
  27351. this
  27352. },
  27353. applyToVector3: function(e) {
  27354. var t = e.x
  27355. , i = e.y
  27356. , n = e.z
  27357. , r = this.elements;
  27358. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27359. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27360. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27361. this
  27362. },
  27363. getInverse: function(e, t) {
  27364. var i = this.elements
  27365. , n = e.elements
  27366. , r = n[0]
  27367. , o = n[1]
  27368. , a = n[2]
  27369. , s = n[3]
  27370. , l = n[4]
  27371. , c = n[5]
  27372. , h = n[6]
  27373. , u = n[7]
  27374. , d = n[8]
  27375. , p = n[9]
  27376. , f = n[10]
  27377. , g = n[11]
  27378. , m = n[12]
  27379. , v = n[13]
  27380. , y = n[14]
  27381. , A = n[15]
  27382. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27383. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27384. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27385. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27386. , b = r * C + o * I + a * E + s * _;
  27387. if (0 == b) {
  27388. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27389. if (t)
  27390. throw new Error(w);
  27391. return console.warn(w),
  27392. this.identity()
  27393. }
  27394. var T = 1 / b;
  27395. return i[0] = C * T,
  27396. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27397. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27398. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27399. i[4] = I * T,
  27400. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27401. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27402. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27403. i[8] = E * T,
  27404. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27405. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27406. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27407. i[12] = _ * T,
  27408. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27409. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27410. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27411. this
  27412. },
  27413. makeRotationFromQuaternion: function(e) {
  27414. var t = this.elements
  27415. , i = e.x
  27416. , n = e.y
  27417. , r = e.z
  27418. , o = e.w
  27419. , a = i + i
  27420. , s = n + n
  27421. , l = r + r
  27422. , c = i * a
  27423. , h = i * s
  27424. , u = i * l
  27425. , d = n * s
  27426. , p = n * l
  27427. , f = r * l
  27428. , g = o * a
  27429. , m = o * s
  27430. , v = o * l;
  27431. return t[0] = 1 - (d + f),
  27432. t[4] = h - v,
  27433. t[8] = u + m,
  27434. t[1] = h + v,
  27435. t[5] = 1 - (c + f),
  27436. t[9] = p - g,
  27437. t[2] = u - m,
  27438. t[6] = p + g,
  27439. t[10] = 1 - (c + d),
  27440. t[3] = 0,
  27441. t[7] = 0,
  27442. t[11] = 0,
  27443. t[12] = 0,
  27444. t[13] = 0,
  27445. t[14] = 0,
  27446. t[15] = 1,
  27447. this
  27448. }
  27449. },
  27450. o.Quaternion = function(e, t, i, n) {
  27451. this._x = e || 0,
  27452. this._y = t || 0,
  27453. this._z = i || 0,
  27454. this._w = void 0 !== n ? n : 1
  27455. }
  27456. ,
  27457. o.Quaternion.prototype = {
  27458. get x() {
  27459. return this._x
  27460. },
  27461. set x(e) {
  27462. this._x = e
  27463. },
  27464. get y() {
  27465. return this._y
  27466. },
  27467. set y(e) {
  27468. this._y = e
  27469. },
  27470. get z() {
  27471. return this._z
  27472. },
  27473. set z(e) {
  27474. this._z = e
  27475. },
  27476. get w() {
  27477. return this._w
  27478. },
  27479. set w(e) {
  27480. this._w = e
  27481. },
  27482. copy: function(e) {
  27483. this._x = e.x,
  27484. this._y = e.y,
  27485. this._z = e.z,
  27486. this._w = e.w
  27487. },
  27488. inverse: function() {
  27489. return this.conjugate().normalize()
  27490. },
  27491. conjugate: function() {
  27492. return this._x *= -1,
  27493. this._y *= -1,
  27494. this._z *= -1,
  27495. this
  27496. },
  27497. length: function() {
  27498. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27499. },
  27500. normalize: function() {
  27501. var e = this.length();
  27502. return 0 === e ? (this._x = 0,
  27503. this._y = 0,
  27504. this._z = 0,
  27505. this._w = 1) : (e = 1 / e,
  27506. this._x = this._x * e,
  27507. this._y = this._y * e,
  27508. this._z = this._z * e,
  27509. this._w = this._w * e),
  27510. this
  27511. },
  27512. setFromAxisAngle: function(e, t) {
  27513. var i = t / 2
  27514. , n = Math.sin(i);
  27515. return this._x = e.x * n,
  27516. this._y = e.y * n,
  27517. this._z = e.z * n,
  27518. this._w = Math.cos(i),
  27519. this
  27520. },
  27521. setFromUnitVectors: function(e, t) {
  27522. return void 0 === n && (n = new o.Vector3),
  27523. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27524. 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),
  27525. this._x = n.x,
  27526. this._y = n.y,
  27527. this._z = n.z,
  27528. this._w = r,
  27529. this.normalize()
  27530. },
  27531. multiply: function(e) {
  27532. return this.multiplyQuaternions(this, e)
  27533. },
  27534. premultiply: function(e) {
  27535. return this.multiplyQuaternions(e, this)
  27536. },
  27537. multiplyQuaternions: function(e, t) {
  27538. var i = e._x
  27539. , n = e._y
  27540. , r = e._z
  27541. , o = e._w
  27542. , a = t._x
  27543. , s = t._y
  27544. , l = t._z
  27545. , c = t._w;
  27546. return this._x = i * c + o * a + n * l - r * s,
  27547. this._y = n * c + o * s + r * a - i * l,
  27548. this._z = r * c + o * l + i * s - n * a,
  27549. this._w = o * c - i * a - n * s - r * l,
  27550. this
  27551. }
  27552. },
  27553. o.convertWorkshopVector = function(e) {
  27554. return new o.Vector3(-e.x,e.y,e.z)
  27555. }
  27556. ,
  27557. o.convertWorkshopQuaternion = function(e) {
  27558. 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))
  27559. }
  27560. ,
  27561. o.convertWorkshopOrthoZoom = function(e) {
  27562. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27563. }
  27564. ,
  27565. o.convertWorkshopPanoramaQuaternion = function(e) {
  27566. 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))
  27567. }
  27568. ,
  27569. o.normalize = function(e) {
  27570. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27571. , i = Math.sqrt(t);
  27572. e.x /= i,
  27573. e.y /= i,
  27574. e.z /= i
  27575. }
  27576. ,
  27577. o.dot = function(e, t) {
  27578. return e.x * t.x + e.y * t.y + e.z * t.z
  27579. }
  27580. ,
  27581. o.cross = function(e, t, i) {
  27582. var n = e.x
  27583. , r = e.y
  27584. , o = e.z;
  27585. i.x = r * t.z - o * t.y,
  27586. i.y = o * t.x - n * t.z,
  27587. i.z = n * t.y - r * t.x
  27588. }
  27589. ,
  27590. o.setVector = function(e, t, i, n) {
  27591. e.x = t,
  27592. e.y = i,
  27593. e.z = n
  27594. }
  27595. ,
  27596. o.copyVector = function(e, t) {
  27597. t.x = e.x,
  27598. t.y = e.y,
  27599. t.z = e.z
  27600. }
  27601. ,
  27602. o.addVector = function(e, t) {
  27603. e.x += t.x,
  27604. e.y += t.y,
  27605. e.z += t.z
  27606. }
  27607. ,
  27608. o.subVector = function(e, t) {
  27609. e.x -= t.x,
  27610. e.y -= t.y,
  27611. e.z -= t.z
  27612. }
  27613. ,
  27614. o.applyQuaternionToVector = function(e, t) {
  27615. var i = t.x
  27616. , n = t.y
  27617. , r = t.z
  27618. , o = e.x
  27619. , a = e.y
  27620. , s = e.z
  27621. , l = e.w
  27622. , c = l * i + a * r - s * n
  27623. , h = l * n + s * i - o * r
  27624. , u = l * r + o * n - a * i
  27625. , d = -o * i - a * n - s * r;
  27626. t.x = c * l + d * -o + h * -s - u * -a,
  27627. t.y = h * l + d * -a + u * -o - c * -s,
  27628. t.z = u * l + d * -s + c * -a - h * -o
  27629. }
  27630. ,
  27631. o.angleBetweenVectors = function(e, t) {
  27632. return Math.acos(o.dot(e, t))
  27633. }
  27634. ,
  27635. t.exports = o
  27636. }
  27637. , {
  27638. "../constants": 8
  27639. }],
  27640. 177: [function(c, h, e) {
  27641. (function(e) {
  27642. "use strict";
  27643. function t(e) {
  27644. this.cache = null,
  27645. this.expires = 0
  27646. }
  27647. function i() {
  27648. this.baseUrl = null,
  27649. this.cache = null,
  27650. this.expires = 0
  27651. }
  27652. function n() {
  27653. this.baseUrl = null,
  27654. this.expires = 0
  27655. }
  27656. function r(e) {
  27657. this.initialLoadingPromise = null,
  27658. this.endpoint = e + "?type=3",
  27659. this.urlContainer = null,
  27660. this.authorizationHeader = s.getAuthorizationHeader(),
  27661. this.containerClasses = [n, i, t]
  27662. }
  27663. c("./ajax");
  27664. var o = c("./logger")
  27665. , a = c("../constants")
  27666. , s = c("./showcase")
  27667. , l = (c("../ab"),
  27668. new o(e));
  27669. t.prototype = {
  27670. version: 1,
  27671. validate: function(e) {
  27672. return "catalog.json"in e && 0 < Object.keys(e).length
  27673. },
  27674. update: function(e) {
  27675. return this.cache = e,
  27676. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27677. $.when()
  27678. },
  27679. get: function(e) {
  27680. return this.cache[e]
  27681. }
  27682. },
  27683. i.prototype = {
  27684. version: 2,
  27685. validate: function(e) {
  27686. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27687. },
  27688. update: function(e) {
  27689. return this.baseUrl = e["base.url"],
  27690. this.cache = e,
  27691. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27692. $.when()
  27693. },
  27694. get: function(e) {
  27695. var t = this.cache[e];
  27696. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27697. }
  27698. },
  27699. n.prototype = {
  27700. version: 3,
  27701. validate: function(e) {
  27702. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27703. },
  27704. update: function(e) {
  27705. return this.baseUrl = e.templates[0],
  27706. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27707. $.when()
  27708. },
  27709. get: function(e) {
  27710. return this.baseUrl.replace("{{filename}}", e)
  27711. }
  27712. },
  27713. r.prototype = {
  27714. init: function() {
  27715. return this.initialLoadingPromise || (setInterval(function() {
  27716. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27717. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27718. this.refresh().done(function() {
  27719. l.debug("Refreshed")
  27720. }).fail(function() {
  27721. l.error("Failed url refresh, urls might go stale soon")
  27722. }))
  27723. }
  27724. .bind(this), a.signedUrlCheckInterval),
  27725. this.initialLoadingPromise = this.refresh()),
  27726. this.initialLoadingPromise
  27727. },
  27728. refresh: function(e) {
  27729. return {},
  27730. $.Deferred().resolve()
  27731. },
  27732. get: function(e) {
  27733. return window.DATA.files.templates[0].replace("{{filename}}", e)
  27734. }
  27735. },
  27736. h.exports = r
  27737. }
  27738. ).call(this, "/js/util/ModelUrls.js")
  27739. }
  27740. , {
  27741. "../ab": 3,
  27742. "../constants": 8,
  27743. "./ajax": 181,
  27744. "./logger": 189,
  27745. "./showcase": 193
  27746. }],
  27747. 178: [function(l, c, e) {
  27748. (function(e) {
  27749. "use strict";
  27750. function t() {
  27751. i.call(this),
  27752. this.neighbourMap = {},
  27753. this.map = null
  27754. }
  27755. 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"),
  27756. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27757. n.inherit(t, i),
  27758. t.prototype.getIndex = function(e) {
  27759. return e.id
  27760. }
  27761. ,
  27762. t.prototype.find = function(e, t) {
  27763. var i = n.filterAll(this.list, e);
  27764. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27765. i = n.stableSort(i, e)
  27766. }),
  27767. i[0])
  27768. }
  27769. ,
  27770. /* t.prototype.sortByScore = function(e, t) {
  27771. var i = n.filterAll(this.list, e);
  27772. return 0 === i.length ? null : i = i.map(function(i) {
  27773. return {
  27774. pano: i,
  27775. score: t.reduce(function(e, t) {
  27776. return e + t(i)
  27777. }, 0)
  27778. }
  27779. }).sort(function(e, t) {
  27780. return t.score - e.score
  27781. })
  27782. } */
  27783. t.prototype.sortByScore = function( request, rank){
  27784. return common.sortByScore(this.list, request, rank)
  27785. }
  27786. ,
  27787. t.prototype.lowestByScore = function(e, t, i) {
  27788. return this.findRankedByScore(0, e, t, i)
  27789. }
  27790. ,
  27791. t.prototype.findRankedByScore = function(e, t, i, n) {
  27792. n && (n.candidates = null,
  27793. n.pano = null),
  27794. e = e || 0;
  27795. var r = this.sortByScore(t, i);
  27796. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27797. n.pano = r[e].item),
  27798. r[e].item)
  27799. }
  27800. ,
  27801. t.prototype.showPanoScores = function(e) {
  27802. this.list.forEach(function(e) {
  27803. e.removeTextSprite()
  27804. });
  27805. var t = 6344768;
  27806. e.forEach(function(e) {
  27807. e.pano.addTextSprite(e.score.toFixed(2), t),
  27808. t = 16428055
  27809. })
  27810. }
  27811. ,
  27812. t.prototype.isNeighbour = function(e, t) {
  27813. return this.neighbourMap[e.id][t.id]
  27814. }
  27815. ,
  27816. t.prototype.getNeighbours = function(e) {
  27817. return this.neighbourMap[e.id]
  27818. }
  27819. ,
  27820. t.prototype.setNeighbour = function(e, t, i) {
  27821. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27822. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27823. this.neighbourMap[e.id][e.id] = !0,
  27824. this.neighbourMap[t.id][t.id] = !0,
  27825. this.neighbourMap[e.id][t.id] = i,
  27826. this.neighbourMap[t.id][e.id] = i,
  27827. this.neighbourMap[e.id]
  27828. }
  27829. ,
  27830. t.prototype.findClosest = function(e, t) {
  27831. var i = [r.filters.isPanoAligned()];
  27832. return t && i.push(r.filters.inDirection(e, t, .75)),
  27833. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27834. }
  27835. ,
  27836. t.prototype.dualNeighbors = function(e, t) {
  27837. var i, n = [];
  27838. for (i in this.neighbourMap[e.id])
  27839. this.neighbourMap[t.id][i] && n.push(i);
  27840. return n
  27841. }
  27842. ,
  27843. t.prototype.populate_path_graph = function() {
  27844. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27845. for (e = 0; e < this.list.length; e += 1) {
  27846. for (t in s = !(a = {}),
  27847. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27848. if (i[t]) {
  27849. o = this.index[t],
  27850. u.copy(r.floorPosition),
  27851. u.sub(o.floorPosition);
  27852. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27853. , p = (Math.abs(u.y),
  27854. Math.max(d, .01),
  27855. Math.max(0, Math.abs(u.y) - .2));
  27856. n = 0 < p ? (1,
  27857. p = Math.pow(4 * p, 2),
  27858. d = Math.pow(d, 2),
  27859. Math.sqrt(p * p + d * d)) : (1,
  27860. u.length()),
  27861. a[o.id] = n,
  27862. s = !0
  27863. }
  27864. s ? c[r.id] = a : h += 1
  27865. }
  27866. this.map = c,
  27867. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27868. }
  27869. ,
  27870. t.prototype.aStarSearch = function(e, t) {
  27871. var i = Date.now()
  27872. , n = new o({
  27873. start: e,
  27874. isEnd: function(e) {
  27875. return e === t
  27876. },
  27877. neighbor: function(e) {
  27878. var t = e.neighbourPanos || e.findNeighourPanos()
  27879. , i = [];
  27880. for (var n in t)
  27881. t[n] && i.push(this.index[n]); //add: t[n] &&
  27882. return i
  27883. }
  27884. .bind(this),
  27885. distance: function(e, t) {
  27886. return this.map[e.id][t.id]
  27887. }
  27888. .bind(this),
  27889. heuristic: function(e, t) {
  27890. return 1
  27891. }
  27892. .bind(this),
  27893. hash: function(e) {
  27894. return e.id
  27895. },
  27896. timeout: 5e3
  27897. });
  27898. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27899. "success" !== n.status)
  27900. return T.debug("Did not find A* path from " + e + " to " + t),
  27901. null;
  27902. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27903. var r = [];
  27904. return n.path.forEach(function(e) {
  27905. r.push(e.id)
  27906. }),
  27907. r
  27908. }
  27909. ,
  27910. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27911. g = new w.Vector3,
  27912. m = new w.Vector3,
  27913. v = new w.Vector3,
  27914. y = new w.Vector3,
  27915. A = new w.Vector3,
  27916. C = new w.Vector3,
  27917. I = new w.Vector3,
  27918. E = [],
  27919. _ = new w.Vector3,
  27920. b = new w.Vector3,
  27921. function(e, t) {
  27922. if (e)
  27923. for (var i = function(e, t, i) {
  27924. return y.copy(t).sub(e),
  27925. y.dot(i)
  27926. }, n = function(e, t) {
  27927. return i(_, e.position, m) - i(_, t.position, m)
  27928. }, r = 0; r < e.length - 1; ) {
  27929. var o = e[r]
  27930. , a = e[r + 1]
  27931. , s = this.index[o]
  27932. , l = this.index[a];
  27933. _.copy(s.position),
  27934. b.copy(l.position),
  27935. E.length = 0,
  27936. f.copy(b).sub(_),
  27937. m.copy(f).normalize();
  27938. for (var c = 0; c < this.list.length; c++) {
  27939. var h = this.list[c];
  27940. y.copy(h.position).sub(_);
  27941. var u = y.dot(m);
  27942. 0 < u && (C.copy(m),
  27943. C.multiplyScalar(u),
  27944. A.copy(y),
  27945. A.sub(C),
  27946. A.length() < t && (g.copy(f).negate(),
  27947. v.copy(g).normalize(),
  27948. I.copy(h.position).sub(b),
  27949. 0 < I.dot(v) && E.push(h)))
  27950. }
  27951. if (0 < E.length) {
  27952. E.sort(n);
  27953. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27954. e[d] = e[d - E.length];
  27955. for (var p = 0; p < E.length; p++)
  27956. e[p + r + 1] = E[p].id
  27957. }
  27958. r += E.length + 1
  27959. }
  27960. }
  27961. ),
  27962. /* t.prototype.fadeMarkerOpacity = function(e, t) {
  27963. var i = void 0 === e ? a.panorama.markerOpacity : e
  27964. , n = this.list.findIndex(function(e) {
  27965. return e.marker
  27966. });
  27967. if (!(n < 0)) {
  27968. var r = this.list[n].marker.material.opacity;
  27969. if (r !== e) {
  27970. var o = i - r;
  27971. s.trigger({
  27972. func: function(e, t) {
  27973. var i = r + e * o;
  27974. this.forEach(function(e) {
  27975. e.marker && (e.marker.material.opacity = i)
  27976. })
  27977. }
  27978. .bind(this),
  27979. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27980. name: "_fpm"
  27981. })
  27982. }
  27983. }
  27984. } */
  27985. t.prototype.fadeMarkerOpacity = function(e, t, gr) {
  27986. s.cancelById('fadeMarkerOpacity')
  27987. var n = this.list.findIndex(function (e) {
  27988. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  27989. return e.marker
  27990. })
  27991. if (n < 0) {
  27992. //logger.info('marker findIndex<0')
  27993. return
  27994. }
  27995. var group
  27996. var tran = function (list, index) {
  27997. list.member = list.member.filter(function (m) {
  27998. return m.marker && m.marker.material.opacity != list.toOp
  27999. })
  28000. s.trigger({
  28001. func: function (e, t) {
  28002. //e:0-1
  28003. list.member.forEach(function (m) {
  28004. var o = m.marker.oldOpacity
  28005. var i = o + e * (list.toOp - o)
  28006. m.marker && (m.marker.material.opacity = i)
  28007. })
  28008. }.bind(this),
  28009. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  28010. name: '_fpm_' + index,
  28011. id: 'fadeMarkerOpacity',
  28012. })
  28013. }
  28014. this.forEach(function (e) {
  28015. //先记录旧的opacity
  28016. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  28017. })
  28018. group = gr
  28019. /* if (e > 0 && gr) {
  28020. group = gr
  28021. } else {
  28022. group = [
  28023. {
  28024. member: this.list,
  28025. toOp: 0,
  28026. },
  28027. ]
  28028. } */
  28029. for (var i = 0; i < group.length; i++) {
  28030. tran(group[i], i)
  28031. }
  28032. }
  28033. ,
  28034. c.exports = t
  28035. }
  28036. ).call(this, "/js/util/PanoramaCollection.js")
  28037. }
  28038. , {
  28039. "../objects/Panorama": 148,
  28040. "../settings": 166,
  28041. "./IndexedCollection": 175,
  28042. "./aStar": 180,
  28043. "./common": 185,
  28044. "./logger": 189,
  28045. "./transitions": 195,
  28046. three: 217
  28047. }],
  28048. 179: [function(e, t, i) {
  28049. "use strict";
  28050. function n() {
  28051. this.actionSequence = [],
  28052. this.actionSequenceInProgress = !1
  28053. }
  28054. function r(e, t, i, n) {
  28055. c.trackAlways("zoom_" + e, {
  28056. from: t,
  28057. to: i,
  28058. pano: n
  28059. })
  28060. }
  28061. var o, a, s, l, c = e("../analytics");
  28062. n.prototype.reset = function(e) {
  28063. this.actionSequenceInProgress = !1,
  28064. this.actionSequence.length = 0
  28065. }
  28066. ,
  28067. n.prototype.addZoomAction = (a = o = null,
  28068. s = !1,
  28069. l = function() {
  28070. if (o = null,
  28071. 0 < this.actionSequence.length) {
  28072. var e = this.actionSequence[0].start
  28073. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28074. 1 === e ? function(e, t) {
  28075. r("initial", 1, e, t)
  28076. }(t, a) : function(e, t, i) {
  28077. r("followup", e, t, i)
  28078. }(e, t, a)
  28079. }
  28080. this.reset()
  28081. }
  28082. ,
  28083. function(e, t, i) {
  28084. if (e !== t) {
  28085. s || (l = l.bind(this),
  28086. s = !0),
  28087. o && (window.clearTimeout(o),
  28088. o = null),
  28089. i === a && this.actionSequenceInProgress || (this.reset(),
  28090. a = i),
  28091. this.actionSequenceInProgress = !0;
  28092. var n = {
  28093. start: e,
  28094. end: t
  28095. };
  28096. this.actionSequence.push(n),
  28097. o = window.setTimeout(l, 150)
  28098. }
  28099. }
  28100. ),
  28101. t.exports = n
  28102. }
  28103. , {
  28104. "../analytics": 4
  28105. }],
  28106. 180: [function(e, t, i) {
  28107. "use strict";
  28108. function g(e) {
  28109. if (void 0 === e.parent)
  28110. return [e.data];
  28111. var t = g(e.parent);
  28112. return t.push(e.data),
  28113. t
  28114. }
  28115. function m(e) {
  28116. return e.toString()
  28117. }
  28118. function v(e, t) {
  28119. return e.f - t.f
  28120. }
  28121. var y = e("Set")
  28122. , A = e("heap")
  28123. , C = e("dict");
  28124. t.exports = function(e) {
  28125. void 0 === e.timeout && (e.timeout = 1 / 0);
  28126. var t = e.hash || m
  28127. , i = {
  28128. data: e.start,
  28129. g: 0,
  28130. h: e.heuristic(e.start)
  28131. }
  28132. , n = i;
  28133. i.f = i.h;
  28134. var r = new y
  28135. , o = new A(v)
  28136. , a = C();
  28137. o.push(i),
  28138. a.set(t(i.data), i);
  28139. for (var s = new Date; o.size(); ) {
  28140. if (new Date - s > e.timeout)
  28141. return {
  28142. status: "timeout",
  28143. cost: n.g,
  28144. path: g(n)
  28145. };
  28146. var l = o.pop();
  28147. if (a.delete(t(l.data)),
  28148. e.isEnd(l.data))
  28149. return {
  28150. status: "success",
  28151. cost: l.g,
  28152. path: g(l)
  28153. };
  28154. r.add(t(l.data));
  28155. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28156. var u = c[h];
  28157. if (!r.contains(t(u))) {
  28158. var d = l.g + e.distance(l.data, u)
  28159. , p = a.get(t(u))
  28160. , f = !1;
  28161. if (void 0 === p)
  28162. p = {
  28163. data: u
  28164. },
  28165. a.set(t(u), p);
  28166. else {
  28167. if (p.g < d)
  28168. continue;
  28169. f = !0
  28170. }
  28171. p.parent = l,
  28172. p.g = d,
  28173. p.h = e.heuristic(u),
  28174. p.f = d + p.h,
  28175. p.h < n.h && (n = p),
  28176. f ? o.heapify() : o.push(p)
  28177. }
  28178. }
  28179. }
  28180. return {
  28181. status: "noPath",
  28182. cost: n.g,
  28183. path: g(n)
  28184. }
  28185. }
  28186. }
  28187. , {
  28188. Set: 196,
  28189. dict: 210,
  28190. heap: 211
  28191. }],
  28192. 181: [function(i, n, e) {
  28193. (function(e) {
  28194. "use strict";
  28195. function s(e, t, i) {
  28196. function n() {
  28197. l.warn("Retrying ", t),
  28198. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28199. }
  28200. var r = function(e, t, i) {
  28201. var n = new XMLHttpRequest;
  28202. if (i && "withCredentials"in n)
  28203. n.open(e, t, i);
  28204. else if ("undefined" != typeof XDomainRequest)
  28205. (n = new XDomainRequest).open(e, t);
  28206. else {
  28207. if (i)
  28208. throw "Browser does not support CORS!";
  28209. n.open(e, t)
  28210. }
  28211. return n
  28212. }(e, t, !1);
  28213. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28214. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28215. i.responseType)
  28216. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28217. r.responseType = i.responseType;
  28218. else {
  28219. if ("image/jpeg" !== i.responseType)
  28220. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28221. r.responseType = "arraybuffer"
  28222. }
  28223. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28224. i.auth && r.setRequestHeader("Authorization", i.auth),
  28225. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28226. r.setRequestHeader("Content-Type", "application/json")),
  28227. "object" == typeof i.headers)
  28228. for (var o in i.headers)
  28229. r.setRequestHeader(o, i.headers[o]);
  28230. var a = $.Deferred();
  28231. return r.onreadystatechange = function(e) {
  28232. if (4 === this.readyState)
  28233. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28234. i.retries++,
  28235. setTimeout(n, 1e3);
  28236. else if (200 === this.status) {
  28237. var t = function(e, t) {
  28238. var i = e.response;
  28239. if ("json" === t && "object" != typeof i)
  28240. try {
  28241. i = JSON.parse(e.responseText)
  28242. } catch (e) {
  28243. return void a.reject({
  28244. error: "Failed parsing JSON"
  28245. })
  28246. }
  28247. else if ("image/jpeg" === t) {
  28248. var n = new Uint8Array(e.response)
  28249. , r = new Blob([n],{
  28250. type: "image/jpeg"
  28251. })
  28252. , o = URL.createObjectURL(r);
  28253. (i = new Image).src = o,
  28254. i.crossOrigin = "Anonymous",
  28255. i.onload = function() {
  28256. URL.revokeObjectURL(o)
  28257. }
  28258. }
  28259. return i
  28260. }(this, i.responseType);
  28261. a.resolve(t)
  28262. } else
  28263. a.reject(this)
  28264. }
  28265. ,
  28266. r.onprogress = function(e) {
  28267. a.notify(e)
  28268. }
  28269. ,
  28270. r.send(i.data),
  28271. a.promise()
  28272. }
  28273. function o(e, t) {
  28274. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28275. return t.headers && function(t) {
  28276. return Object.keys(t).sort().map(function(e) {
  28277. return {
  28278. key: e,
  28279. value: t[e]
  28280. }
  28281. })
  28282. }(t.headers).forEach(function(e) {
  28283. i += "__" + e.key + ":" + e.value
  28284. }),
  28285. i
  28286. }
  28287. var t = i("./logger")
  28288. , a = i("../ab")
  28289. , l = new t(e);
  28290. window.URL = window.URL || window.webkitURL,
  28291. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28292. window.DATA = window.DATA || {},
  28293. n.exports = {
  28294. get: function(e, t) {
  28295. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28296. if (n) {
  28297. var r = function(e, t) {
  28298. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28299. }(e, t);
  28300. if (r)
  28301. return r
  28302. }
  28303. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28304. n && function(e, t, i) {
  28305. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28306. }(e, t, i),
  28307. i
  28308. },
  28309. post: function(e, t) {
  28310. return s("POST", e, t)
  28311. },
  28312. patch: function(e, t) {
  28313. return s("PATCH", e, t)
  28314. },
  28315. getImage: function(e, t) {
  28316. function i() {
  28317. l.warn("Retrying ", e),
  28318. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28319. }
  28320. var n = $.Deferred()
  28321. , r = new Image
  28322. , o = this;
  28323. return e = a.changeIfImageOptimzing(e),
  28324. null != t || (t = 3),
  28325. r.onerror = function() {
  28326. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28327. }
  28328. ,
  28329. r.onload = function() {
  28330. n.resolve(r)
  28331. }
  28332. ,
  28333. r.crossOrigin = "anonymous",
  28334. r.src = e,
  28335. n
  28336. }
  28337. }
  28338. }
  28339. ).call(this, "/js/util/ajax.js")
  28340. }
  28341. , {
  28342. "../ab": 3,
  28343. "./logger": 189
  28344. }],
  28345. 182: [function(e, t, i) {
  28346. "use strict";
  28347. function n(e, t) {
  28348. var i = window.navigator.userAgent.match(e);
  28349. return i = i ? i[1].split(t) : [],
  28350. {
  28351. major: parseInt(i[0]) || 0,
  28352. minor: parseInt(i[1]) || 0,
  28353. patch: parseInt(i[2]) || 0
  28354. }
  28355. }
  28356. var r = e("../exception/DeviceMismatchException");
  28357. t.exports = {
  28358. supportsFullscreen: function() {
  28359. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28360. },
  28361. isPointerLocked: function() {
  28362. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28363. },
  28364. requestFullscreen: function(e, t) {
  28365. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28366. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28367. },
  28368. requestPointerLock: function() {
  28369. var e;
  28370. if (document.fullscreenElement)
  28371. e = document.fullscreenElement();
  28372. else if (document.mozFullscreenElement)
  28373. e = document.mozFullscreenElement();
  28374. else if (document.mozFullScreenElement)
  28375. e = document.mozFullScreenElement();
  28376. else {
  28377. if (!document.webkitFullscreenElement)
  28378. return;
  28379. e = document.webkitFullscreenElement()
  28380. }
  28381. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28382. e.requestPointerLock(),
  28383. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28384. },
  28385. exitPointerLock: function() {
  28386. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28387. document.exitPointerLock()
  28388. },
  28389. exitFullscreen: function() {
  28390. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28391. },
  28392. details: function() {
  28393. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28394. return e ? {
  28395. name: e[1],
  28396. version: parseInt(e[2]),
  28397. platform: navigator.platform
  28398. } : {}
  28399. },
  28400. is: function(e) {
  28401. return this.details() && this.details().name === e
  28402. },
  28403. inIframe: function() {
  28404. return window.parent !== window
  28405. },
  28406. aspectRatio: function() {
  28407. var e = $("#player").width() / $("#player").height();
  28408. return isFinite(e) ? e : 0
  28409. },
  28410. userAgent: function() {
  28411. return window.navigator.userAgent
  28412. },
  28413. isLandscape: function() {
  28414. return this.isMobile && 1 < this.aspectRatio()
  28415. },
  28416. isSmallScreen: function() {
  28417. return screen.width / window.devicePixelRatio < 240
  28418. },
  28419. detectIE: function() {
  28420. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28421. },
  28422. detectSafari: function() {
  28423. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28424. },
  28425. detectFirefox: function() {
  28426. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28427. },
  28428. detectChrome: function() {
  28429. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28430. },
  28431. detectOpera: function() {
  28432. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28433. },
  28434. detectIOS: function() {
  28435. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28436. },
  28437. detectIPad: function() {
  28438. var e = window.navigator.userAgent;
  28439. return /iPad/.test(e)
  28440. },
  28441. detectIPod: function() {
  28442. var e = window.navigator.userAgent;
  28443. return /iPod/.test(e)
  28444. },
  28445. detectIPhone: function() {
  28446. var e = window.navigator.userAgent;
  28447. return /iPhone/.test(e)
  28448. },
  28449. detectAndroid: function() {
  28450. return -1 !== window.navigator.userAgent.indexOf("Android")
  28451. },
  28452. detectAndroidMobile: function() {
  28453. var e = window.navigator.userAgent;
  28454. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28455. },
  28456. detectSamsungNative: function() {
  28457. var e = window.navigator.userAgent;
  28458. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28459. },
  28460. detectSamsungS6: function() {
  28461. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28462. },
  28463. detectHUAWEI5X: function() {
  28464. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28465. },
  28466. detectWebVR: function() {
  28467. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28468. },
  28469. getVRDisplay: function() {
  28470. var t = $.Deferred();
  28471. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28472. 1 <= e.length && t.resolve(e[0]),
  28473. t.reject(null)
  28474. }),
  28475. t) : t.reject(null)
  28476. },
  28477. iosVersion: function() {
  28478. if (!this.detectIOS())
  28479. throw new r("Did not detect an iDevice");
  28480. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28481. },
  28482. androidVersion: function() {
  28483. if (!this.detectAndroid())
  28484. throw new r("Did not detect an Android based device");
  28485. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28486. },
  28487. valueFromCookie: function(e, t) {
  28488. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28489. if (!i)
  28490. return t;
  28491. var n = i[1];
  28492. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28493. },
  28494. valueFromHash: function(e, t) {
  28495. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28496. if (!i)
  28497. return t;
  28498. var n = i[1];
  28499. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28500. }
  28501. }
  28502. Object.assign(window.browser, t.exports)
  28503. t.exports = window.browser
  28504. }
  28505. , {
  28506. "../exception/DeviceMismatchException": 56
  28507. }],
  28508. 183: [function(i, n, e) {
  28509. (function(e) {
  28510. "use strict";
  28511. var o = i("../controls/serializer")
  28512. , a = i("../util/math")
  28513. , s = i("./browser")
  28514. , l = i("../enum/Viewmode")
  28515. , t = i("../util/logger")
  28516. , c = i("three")
  28517. , h = new t(e);
  28518. n.exports = {
  28519. getStartCameraOptions: function(e, t) {
  28520. var i = function(e) {
  28521. var t = s.valueFromHash("start", "")
  28522. , i = {};
  28523. if ("" !== t) {
  28524. h.debug("Start override found in parameters, trying to parse..."),
  28525. i = function(e) {
  28526. return o.deserialize(e)
  28527. }(t) || {};
  28528. var n = s.valueFromHash("tag", null);
  28529. n && (i.tag = n),
  28530. i.panoId && (i.pano = e.get(i.panoId))
  28531. }
  28532. return i
  28533. }(t);
  28534. if (0 < Object.keys(i).length)
  28535. return i;
  28536. if (e.heroImage)
  28537. i = function(e, t) {
  28538. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28539. return {};
  28540. var i = {}
  28541. , n = e.heroImage.metadata;
  28542. h.debug("Using start position from thumbnail image"),
  28543. i.position = n.camera_position,
  28544. i.quaternion = n.camera_quaternion;
  28545. try {
  28546. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28547. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28548. } catch (e) {
  28549. h.debug(e.message)
  28550. }
  28551. return i
  28552. }(e, t);
  28553. else if (window.DATA.camera_start) {
  28554. var n = window.DATA.camera_start;
  28555. try {
  28556. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28557. i.position = (new c.Vector3).fromArray(n.camera.position),
  28558. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28559. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28560. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28561. h.debug("Using camera_start"),
  28562. h.debug("Modeldata pano: ", i.pano.quaternion),
  28563. h.debug("Camera start pano: ", n.pano.quaternion)),
  28564. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28565. } catch (e) {
  28566. h.warn(e.message)
  28567. if(i.mode == "panorama" && !i.pano){
  28568. i.pano = t.list[0]
  28569. }
  28570. }
  28571. }
  28572. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28573. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28574. i.pano = t.findClosest(i.position) ,
  28575. i.quaternion = i.pano.quaternion),
  28576. 0 === Object.keys(i).length) {
  28577. var r = t.list[0];
  28578. r && (i.mode = l.PANORAMA,
  28579. i.pano = r,
  28580. i.position = r.position,
  28581. i.quaternion = r.quaternion,
  28582. h.info("Starting at 1st pano " + r.id))
  28583. }
  28584. return i.mode = i.mode || l.DOLLHOUSE,
  28585. i
  28586. }
  28587. }
  28588. }
  28589. ).call(this, "/js/util/camera.js")
  28590. }
  28591. , {
  28592. "../controls/serializer": 14,
  28593. "../enum/Viewmode": 51,
  28594. "../util/logger": 189,
  28595. "../util/math": 190,
  28596. "./browser": 182,
  28597. three: 217
  28598. }],
  28599. 184: [function(e, t, i) {
  28600. "use strict";
  28601. function r(e, t, i) {
  28602. var n = t
  28603. , r = i;
  28604. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28605. }
  28606. function o(e, t, i) {
  28607. var n = t
  28608. , r = i;
  28609. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28610. }
  28611. var a = e("./MathLight");
  28612. t.exports = {
  28613. clampVFOV: function(e, t, i, n) {
  28614. return t < r(e, i, n) ? o(t, i, n) : e
  28615. },
  28616. getHFOVForCamera: function(e, t, i) {
  28617. return r(e.fov, t, i)
  28618. },
  28619. getHFOVFromVFOV: r,
  28620. getVFOVFromHFOV: o
  28621. }
  28622. window.MathLight = t.exports
  28623. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28624. var prec = Math.pow(10, - (precision || 4));
  28625. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28626. if(e1.w){
  28627. return s1 && Math.abs(e1.w - e2.w) < prec
  28628. }else return s1
  28629. }
  28630. }
  28631. , {
  28632. "./MathLight": 176
  28633. }],
  28634. 185: [function(e, t, i) {
  28635. "use strict";
  28636. var a = e("three");
  28637. t.exports = {
  28638. delayOneFrame: function(e) {
  28639. window.setTimeout(e, 1)
  28640. },
  28641. normalizeUrl: function(e) {
  28642. return e.replace("https://", "http://")
  28643. },
  28644. domainFromUrl: function(e) {
  28645. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28646. return t ? t[3] : e
  28647. },
  28648. average: function(e, t) {
  28649. if (0 === e.length)
  28650. return null;
  28651. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28652. i += t ? e[r][t] : e[r],
  28653. n++
  28654. }
  28655. return i / n
  28656. },
  28657. countUnique: function(e) {
  28658. for (var t = {}, i = 0; i < e.length; i++)
  28659. t[e[i]] = 1 + (t[e[i]] || 0);
  28660. return Object.keys(t).length
  28661. },
  28662. averageVectors: function(e, t) {
  28663. var i = new a.Vector3;
  28664. if (0 === e.length)
  28665. return i;
  28666. for (var n = 0, r = 0; r < e.length; r++) {
  28667. var o = t ? e[r][t] : e[r];
  28668. i.add(o),
  28669. n++
  28670. }
  28671. return i.divideScalar(n)
  28672. },
  28673. equalLists: function(e, t) {
  28674. if (e.length !== t.length)
  28675. return !1;
  28676. for (var i = 0; i < e.length; i++)
  28677. if (e[i] !== t[i])
  28678. return !1;
  28679. return !0
  28680. },
  28681. lowerMedian: function(e, t) {
  28682. return 0 === e.length ? null : (t = t || 2,
  28683. e.sort(function(e, t) {
  28684. return e - t
  28685. }),
  28686. e[Math.floor(e.length / t)])
  28687. },
  28688. stableSort: function(e, n) {
  28689. return e.map(function(e, t) {
  28690. return {
  28691. value: e,
  28692. index: t
  28693. }
  28694. }).sort(function(e, t) {
  28695. var i = n(e.value, t.value);
  28696. return 0 !== i ? i : e.index - t.index
  28697. }).map(function(e) {
  28698. return e.value
  28699. })
  28700. },
  28701. filterAll: function(e, i) {
  28702. return e.filter(function(t) {
  28703. return i.every(function(e) {
  28704. return e(t)
  28705. })
  28706. })
  28707. },
  28708. formatDate: function(e) {
  28709. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28710. },
  28711. formatDatetime: function(e) {
  28712. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28713. },
  28714. randomString: function(e) {
  28715. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28716. t += i.charAt(Math.floor(Math.random() * i.length));
  28717. return t
  28718. },
  28719. uint8ToBase64: function(e, t) {
  28720. t && "number" == typeof t || (t = 8192);
  28721. for (var i = [], n = 0; n < e.length; n += t)
  28722. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28723. return btoa(i.join(""))
  28724. },
  28725. uuid4: function e(t) {
  28726. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28727. },
  28728. nth: function(e) {
  28729. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28730. },
  28731. extendObject: function(t, i) {
  28732. return Object.keys(i).forEach(function(e) {
  28733. t[e] = i[e]
  28734. }),
  28735. t
  28736. },
  28737. deepExtend: function e(t) {
  28738. t = t || {};
  28739. for (var i = 1; i < arguments.length; i++) {
  28740. var n = arguments[i];
  28741. if (n)
  28742. for (var r in n)
  28743. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28744. }
  28745. return t
  28746. },
  28747. inherit: function(e, t) {
  28748. e.prototype = Object.create(t.prototype),
  28749. e.prototype.constructor = e
  28750. },
  28751. extend: function(e, t) {
  28752. for (var i in t.prototype)
  28753. e.prototype[i] = t.prototype[i]
  28754. },
  28755. getFileNameFromUrl:function(url){
  28756. return url.split('/').pop();
  28757. },
  28758. },
  28759. Math.sign = function(e) {
  28760. return e < 0 ? -1 : 1
  28761. }
  28762. window.common = t.exports
  28763. expandCommon(common)
  28764. }
  28765. , {
  28766. three: 217
  28767. }],
  28768. 186: [function(e, t, i) {
  28769. "use strict";
  28770. var r = {
  28771. linearTween: function(e, t, i, n) {
  28772. return i * e / n + t
  28773. },
  28774. easeInQuad: function(e, t, i, n) {
  28775. return i * (e /= n) * e + t
  28776. },
  28777. easeOutQuad: function(e, t, i, n) {
  28778. return -i * (e /= n) * (e - 2) + t
  28779. },
  28780. easeInOutQuad: function(e, t, i, n) {
  28781. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28782. },
  28783. easeInCubic: function(e, t, i, n) {
  28784. return i * (e /= n) * e * e + t
  28785. },
  28786. easeOutCubic: function(e, t, i, n) {
  28787. return e /= n,
  28788. i * (--e * e * e + 1) + t
  28789. },
  28790. easeInOutCubic: function(e, t, i, n) {
  28791. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28792. },
  28793. easeInQuart: function(e, t, i, n) {
  28794. return i * (e /= n) * e * e * e + t
  28795. },
  28796. easeOutQuart: function(e, t, i, n) {
  28797. return e /= n,
  28798. -i * (--e * e * e * e - 1) + t
  28799. },
  28800. easeInOutQuart: function(e, t, i, n) {
  28801. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28802. },
  28803. easeInQuint: function(e, t, i, n) {
  28804. return i * (e /= n) * e * e * e * e + t
  28805. },
  28806. easeOutQuint: function(e, t, i, n) {
  28807. return e /= n,
  28808. i * (--e * e * e * e * e + 1) + t
  28809. },
  28810. easeInOutQuint: function(e, t, i, n) {
  28811. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28812. },
  28813. easeInSine: function(e, t, i, n) {
  28814. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28815. },
  28816. easeOutSine: function(e, t, i, n) {
  28817. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28818. },
  28819. easeInOutSine: function(e, t, i, n) {
  28820. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28821. },
  28822. easeInExpo: function(e, t, i, n) {
  28823. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28824. },
  28825. easeOutExpo: function(e, t, i, n) {
  28826. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28827. },
  28828. easeInOutExpo: function(e, t, i, n) {
  28829. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28830. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28831. },
  28832. easeInCirc: function(e, t, i, n) {
  28833. return e /= n,
  28834. -i * (Math.sqrt(1 - e * e) - 1) + t
  28835. },
  28836. easeOutCirc: function(e, t, i, n) {
  28837. return e /= n,
  28838. e--,
  28839. i * Math.sqrt(1 - e * e) + t
  28840. },
  28841. easeInOutCirc: function(e, t, i, n) {
  28842. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28843. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28844. },
  28845. easeInElastic: function(e, t, i, n) {
  28846. var r = 1.70158
  28847. , o = 0
  28848. , a = i;
  28849. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28850. r = a < Math.abs(i) ? (a = i,
  28851. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28852. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28853. },
  28854. easeOutElastic: function(e, t, i, n) {
  28855. var r = 1.70158
  28856. , o = 0
  28857. , a = i;
  28858. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28859. r = a < Math.abs(i) ? (a = i,
  28860. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28861. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28862. },
  28863. easeInOutElastic: function(e, t, i, n) {
  28864. var r = 1.70158
  28865. , o = 0
  28866. , a = i;
  28867. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28868. r = a < Math.abs(i) ? (a = i,
  28869. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28870. 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)
  28871. },
  28872. easeInBack: function(e, t, i, n, r) {
  28873. return void 0 === r && (r = 1.70158),
  28874. i * (e /= n) * e * ((r + 1) * e - r) + t
  28875. },
  28876. easeOutBack: function(e, t, i, n, r) {
  28877. return void 0 === r && (r = 1.70158),
  28878. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28879. },
  28880. easeInOutBack: function(e, t, i, n, r) {
  28881. return void 0 === r && (r = 1.70158),
  28882. (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
  28883. },
  28884. easeOutBounce: function(e, t, i, n) {
  28885. 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
  28886. },
  28887. easeInBounce: function(e, t, i, n) {
  28888. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28889. },
  28890. easeInOutBounce: function(e, t, i, n) {
  28891. 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
  28892. }
  28893. };
  28894. window.easing = t.exports = r
  28895. }
  28896. , {}],
  28897. 187: [function(e, t, i) {
  28898. "use strict";
  28899. function n() {
  28900. this.events = [],
  28901. this.valid = !1
  28902. }
  28903. var r = e("../enum/Joystick");
  28904. n.prototype.push = function(e, t) {
  28905. this.events.push({
  28906. direction: e,
  28907. pano: t
  28908. }),
  28909. this.valid = !0
  28910. }
  28911. ,
  28912. n.prototype.pop = function(e) {
  28913. var t = this.events.pop();
  28914. return this.events.length < 1 && (this.valid = !1),
  28915. t
  28916. }
  28917. ,
  28918. n.prototype.peek = function() {
  28919. return this.events.length ? this.events[this.events.length - 1] : {
  28920. direction: null,
  28921. pano: null
  28922. }
  28923. }
  28924. ,
  28925. n.prototype.invalidate = function() {
  28926. this.events = [],
  28927. this.valid = !1
  28928. }
  28929. ,
  28930. n.prototype.reversePano = function(e) {
  28931. if (!this.valid)
  28932. return null;
  28933. var t = this.peek();
  28934. return r.opposite(e) === t.direction ? (this.pop(),
  28935. t.pano) : null
  28936. }
  28937. ,
  28938. t.exports = n
  28939. }
  28940. , {
  28941. "../enum/Joystick": 29
  28942. }],
  28943. 188: [function(e, t, i) {
  28944. "use strict";
  28945. t.exports = {
  28946. vector: function(t, i) {
  28947. var n = t.clone();
  28948. return i = i.clone(),
  28949. function(e) {
  28950. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28951. }
  28952. },
  28953. quaternion: function(t, i) {
  28954. var n = t.clone();
  28955. return function(e) {
  28956. t.copy(n).slerp(i, e)
  28957. }
  28958. },
  28959. property: function(t, i, n, r) {
  28960. var o = t[i];
  28961. return function(e) {
  28962. t[i] = o * (1 - e) + n * e,
  28963. r && r(t[i])
  28964. }
  28965. },
  28966. uniform: function(t, i, n) {
  28967. var r = t.material.uniforms[i].value;
  28968. return function(e) {
  28969. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28970. }
  28971. },
  28972. matrix4: function(o, a) {
  28973. var s = o.clone();
  28974. return function(e) {
  28975. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28976. t[r] = i[r] * (1 - e) + n[r] * e
  28977. }
  28978. },
  28979. allUniforms: function(e, t, i) {
  28980. var n = e.map(function(e) {
  28981. return this.uniform(e, t, i)
  28982. }
  28983. .bind(this));
  28984. return function(t) {
  28985. n.forEach(function(e) {
  28986. e(t)
  28987. })
  28988. }
  28989. }
  28990. }
  28991. }
  28992. , {}],
  28993. 189: [function(e, t, i) {
  28994. "use strict";
  28995. function h(n) {
  28996. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28997. if (h.consoleEnabled) {
  28998. var l = function(e) {
  28999. $("#debug-console").append("<p>" + e + "</p>"),
  29000. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29001. };
  29002. e = function(e) {
  29003. l(Array.prototype.slice.call(arguments).join(" "))
  29004. }
  29005. ,
  29006. t = function(e) {
  29007. l(Array.prototype.slice.call(arguments).join(" "))
  29008. }
  29009. ,
  29010. i = function(e) {
  29011. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29012. }
  29013. ,
  29014. r = function(e) {
  29015. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29016. }
  29017. } else
  29018. console.log ? (e = console.log,
  29019. t = console.info ? console.info : console.log,
  29020. i = console.warn ? console.warn : console.log,
  29021. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  29022. ;
  29023. function c(e) {
  29024. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29025. }
  29026. return {
  29027. debug: function() {
  29028. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29029. },
  29030. info: function() {
  29031. h.level >= h.levels.info && t.apply(console, c(arguments))
  29032. },
  29033. warn: function() {
  29034. (function(e, t) {
  29035. if (u) {
  29036. var i = Array.prototype.slice.call(e).join(" ");
  29037. u.captureMessage(i, {
  29038. level: t,
  29039. path: n,
  29040. timestamp: h.timestamp()
  29041. })
  29042. }
  29043. }
  29044. )(arguments, "warn"),
  29045. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29046. },
  29047. error: function() {
  29048. (function(e, t) {
  29049. if (u) {
  29050. var i = Array.prototype.slice.call(e).join(" ");
  29051. u.captureException(new Error(i), {
  29052. level: t,
  29053. path: n,
  29054. timestamp: h.timestamp()
  29055. })
  29056. }
  29057. }
  29058. )(arguments, "error"),
  29059. h.level >= h.levels.error && r.apply(console, c(arguments))
  29060. },
  29061. v3str: function(e, t) {
  29062. var i = void 0 === t ? 2 : t;
  29063. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29064. },
  29065. eulstr: function(e, t) {
  29066. var i = void 0 === t ? 2 : t;
  29067. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29068. },
  29069. time: function(e) {
  29070. h.level >= h.levels.debug && (s[e] = Date.now())
  29071. },
  29072. timeEnd: function(e) {
  29073. if (h.level >= h.levels.debug) {
  29074. var t = s[e];
  29075. if (!t)
  29076. return;
  29077. var i = (Date.now() - t) / 1e3;
  29078. this.debug(e, i + "s")
  29079. }
  29080. }
  29081. }
  29082. }
  29083. var u = window.Raven;
  29084. h.timestamp = function() {
  29085. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29086. }
  29087. ,
  29088. h.level = (h.levels = {
  29089. debug: 3,
  29090. info: 2,
  29091. warn: 1,
  29092. error: 0
  29093. }).info,
  29094. t.exports = h
  29095. }
  29096. , {}],
  29097. 190: [function(e, t, i) {
  29098. "use strict";
  29099. var o = e("three")
  29100. , r = e("../enum/GLCubeFaces");
  29101. e("../constants");
  29102. t.exports = {
  29103. convertVisionVector: function(e) {
  29104. return new o.Vector3(e.x,e.z,-e.y)
  29105. },
  29106. convertVisionQuaternion: function(e) {
  29107. 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)))
  29108. },
  29109. convertWorkshopVector: function(e) {
  29110. return new o.Vector3(-e.x,e.y,e.z)
  29111. },
  29112. convertWorkshopQuaternion: function(e) {
  29113. 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))
  29114. },
  29115. convertWorkshopPanoramaQuaternion: function(e) {
  29116. 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)))
  29117. },
  29118. convertWorkshopOrthoZoom: function(e) {
  29119. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29120. },
  29121. toPrecision: function(e, t) {
  29122. function i(e, t) {
  29123. var i = Math.pow(10, t);
  29124. return Math.round(e * i) / i
  29125. }
  29126. if (e instanceof Array) {
  29127. for (var n = 0; n < e.length; n++)
  29128. e[n] = i(e[n], t);
  29129. return e
  29130. }
  29131. return i(e, t)
  29132. },
  29133. isEmptyQuaternion: function(e) {
  29134. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29135. },
  29136. projectPositionToCanvas: function(e, t, i) {
  29137. (i = i || new o.Vector3).copy(e);
  29138. var n = .5 * $("#player").width()
  29139. , r = .5 * $("#player").height();
  29140. return i.project(t),
  29141. i.x = i.x * n + n,
  29142. i.y = -i.y * r + r,
  29143. i
  29144. },
  29145. convertScreenPositionToNDC: function(e, t, i) {
  29146. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29147. i.y = -t / $("#player").height() * 2 + 1,
  29148. i
  29149. },
  29150. constrainedTurn: function(e) {
  29151. var t = e % (2 * Math.PI);
  29152. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29153. },
  29154. getFOVDotThreshold: function(e) {
  29155. return Math.cos(o.Math.degToRad(e / 2))
  29156. },
  29157. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29158. switch (e) {
  29159. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29160. i.set(1, t.y, t.x);
  29161. break;
  29162. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29163. i.set(-1, t.y, -t.x);
  29164. break;
  29165. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29166. i.set(-t.x, 1, -t.y);
  29167. break;
  29168. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29169. i.set(-t.x, -1, t.y);
  29170. break;
  29171. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29172. i.set(-t.x, t.y, 1);
  29173. break;
  29174. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29175. i.set(t.x, t.y, -1)
  29176. }
  29177. n && i.normalize()
  29178. },
  29179. //add:
  29180. getPos2d : function(point, camera, dom){
  29181. var camera = camera ;
  29182. var dom = dom;
  29183. 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);
  29184. var x,y;
  29185. x = (pos.x + 1) / 2 * dom.clientWidth;
  29186. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29187. var inSight = x <= dom.clientWidth && x >= 0
  29188. && y <= dom.clientHeight && y >= 0
  29189. return {
  29190. pos: new THREE.Vector2(x,y),
  29191. vector: pos,
  29192. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29193. inSight : inSight //在屏幕范围内可见
  29194. };
  29195. },
  29196. getDirByLonLat: function(lon, lat) {
  29197. var dir = new THREE.Vector3();
  29198. var phi = THREE.Math.degToRad(90 - lat);
  29199. var theta = THREE.Math.degToRad(lon);
  29200. dir.x = Math.sin(phi) * Math.cos(theta);
  29201. dir.y = Math.cos(phi);
  29202. dir.z = Math.sin(phi) * Math.sin(theta);
  29203. return dir.negate();
  29204. }
  29205. }
  29206. window.math = t.exports
  29207. }
  29208. , {
  29209. "../constants": 8,
  29210. "../enum/GLCubeFaces": 25,
  29211. three: 217
  29212. }],
  29213. 191: [function(e, t, i) {
  29214. "use strict";
  29215. function o(e) {
  29216. return r[e]
  29217. }
  29218. var n = e("../enum/GLCubeFaces")
  29219. , a = [0, 1, 2, 3, 4, 5]
  29220. , r = {
  29221. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29222. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29223. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29224. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29225. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29226. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29227. };
  29228. t.exports = {
  29229. mapFaceToCubemapFace: o,
  29230. getCubemapUrls: function(i, n, r) {
  29231. return a.map(function(e, t) {
  29232. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29233. }
  29234. .bind(this))
  29235. }
  29236. }
  29237. }
  29238. , {
  29239. "../enum/GLCubeFaces": 25
  29240. }],
  29241. 192: [function(e, t, i) {
  29242. "use strict";
  29243. t.exports = {
  29244. captureErrors: function(e, t, i) {
  29245. if ("Raven"in window) {
  29246. Raven.config(e, t).install(),
  29247. i && Raven.setTagsContext(i);
  29248. var n = console.warn
  29249. , r = console.error;
  29250. console.warn = function() {
  29251. var e = Array.prototype.slice.call(arguments);
  29252. Raven.captureMessage(e.join(" "), {
  29253. level: "warning"
  29254. }),
  29255. n.apply(console, e)
  29256. }
  29257. ,
  29258. console.error = function() {
  29259. var e = Array.prototype.slice.call(arguments);
  29260. Raven.captureException(new Error(e.join(" ")), {
  29261. level: "error"
  29262. }),
  29263. r.apply(console, e)
  29264. }
  29265. } else
  29266. console.error("Raven not found, not capturing errors.")
  29267. }
  29268. }
  29269. }
  29270. , {}],
  29271. 193: [function(c, h, e) {
  29272. (function(e) {
  29273. "use strict";
  29274. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29275. getAuthorizationHeader: function() {
  29276. var e = n.valueFromHash("auth");
  29277. if (e)
  29278. return e.replace(",", " ");
  29279. var t = n.valueFromCookie("token");
  29280. return t ? "Token " + t : null
  29281. },
  29282. parseSidUrl: function(e) {
  29283. var t, i;
  29284. if (t = g_Prefix,
  29285. (e = e || "").match(/^https?/)) {
  29286. o.parse(e);
  29287. t = g_Prefix,
  29288. i = e
  29289. } else
  29290. i = (t = g_Prefix) + "data/" + e;
  29291. return {
  29292. urlBase: t,
  29293. urlModel: i,
  29294. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29295. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29296. }
  29297. },
  29298. getModelIDFromQueryString: function() {
  29299. return n.valueFromHash("model") || n.valueFromHash("m")
  29300. },
  29301. /* normalizeModeldata: function(e, i) {
  29302. e = JSON.parse(JSON.stringify(e));
  29303. var n = null;
  29304. if (e.images.forEach(function(t) {
  29305. if (t.metadata) {
  29306. if ("string" == typeof t.metadata)
  29307. try {
  29308. t.metadata = JSON.parse(t.metadata)
  29309. } catch (e) {
  29310. s.warn("Unable to parse image metadata"),
  29311. t.metadata = null
  29312. }
  29313. else
  29314. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29315. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29316. 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)),
  29317. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29318. t.metadata.zoom = t.metadata.zoom || 1),
  29319. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29320. }
  29321. }),
  29322. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29323. var t = {};
  29324. t.pano = {
  29325. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29326. position: i.convertWorkshopVector(n.scan_position),
  29327. uuid: n.scan_id
  29328. },
  29329. t.camera = {
  29330. quaternion: n.camera_quaternion,
  29331. position: n.camera_position
  29332. },
  29333. e.startPano = t
  29334. }
  29335. return e
  29336. }, */
  29337. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29338. e = JSON.parse(JSON.stringify(e));
  29339. var i = null;
  29340. var deal = function(n) {
  29341. if(!n.metadata) return;
  29342. if ("string" == typeof n.metadata)
  29343. try {
  29344. n.metadata = JSON.parse(n.metadata)
  29345. } catch (e) {
  29346. s.warn("Unable to parse image metadata"),
  29347. n.metadata = null
  29348. }
  29349. else{
  29350. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29351. }
  29352. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29353. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29354. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29355. }else{
  29356. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29357. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29358. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29359. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29360. }
  29361. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29362. }
  29363. //改
  29364. e.images.forEach(info=>{
  29365. if(info.locations){
  29366. info.locations.forEach(a=>deal(a))
  29367. }else{
  29368. deal(info)
  29369. }
  29370. })
  29371. //icon初始视角的:
  29372. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29373. var n = {};
  29374. n.pano = {
  29375. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29376. position: t.convertWorkshopVector(i.scan_position),
  29377. uuid: i.scan_id
  29378. },
  29379. n.camera = {
  29380. quaternion: i.camera_quaternion,
  29381. position: i.camera_position
  29382. },
  29383. e.startPano = n
  29384. }
  29385. return e
  29386. },
  29387. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29388. function(e) {
  29389. if (!e)
  29390. throw new Error("Vision version is required");
  29391. var t = i.exec(e);
  29392. if (null === t)
  29393. throw new Error("String is not a vision version: " + e);
  29394. return parseInt(t[1])
  29395. }
  29396. ),
  29397. modelDataPromisesTiles: function(e) {
  29398. var t = e.vision_version || window.DATA.vision_version;
  29399. if (t)
  29400. try {
  29401. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29402. } catch (e) {
  29403. s.warn("Invalid vision version: " + t)
  29404. }
  29405. return !1
  29406. }
  29407. };
  29408. h.exports = l
  29409. }
  29410. ).call(this, "/js/util/showcase.js")
  29411. }
  29412. , {
  29413. "../constants": 8,
  29414. "./browser": 182,
  29415. "./logger": 189,
  29416. three: 217,
  29417. url: 208
  29418. }],
  29419. 194: [function(e, t, i) {
  29420. "use strict";
  29421. var r = e("../util/ajax")
  29422. , o = e("three")
  29423. , a = e("../settings")
  29424. , s = {};
  29425. t.exports = {
  29426. load: function(e, t, i) {
  29427. var n = s[e];
  29428. return n ? t && setTimeout(function() {
  29429. t(n)
  29430. }, 1) : (n = new o.Texture,
  29431. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29432. n.magFilter = o.LinearFilter,
  29433. n.generateMipmaps = !1),
  29434. n.sourceFile = e,
  29435. s[e] = n,
  29436. r.getImage(e).then(function(e) {
  29437. n.image = e,
  29438. n.needsUpdate = !0,
  29439. t && t(n)
  29440. }).fail(i)),
  29441. n
  29442. },
  29443. loadBase64: function(e, t) {
  29444. t = t || "png";
  29445. var i = new o.Texture;
  29446. return i.image = document.createElement("img"),
  29447. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29448. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29449. i.magFilter = o.LinearFilter,
  29450. i.generateMipmaps = !1),
  29451. i.needsUpdate = !0,
  29452. i
  29453. },
  29454. isLoaded: function(e) {
  29455. return !!s[e]
  29456. }
  29457. }
  29458. window.Texture = t.exports
  29459. }
  29460. , {
  29461. "../settings": 166,
  29462. "../util/ajax": 181,
  29463. three: 217
  29464. }],
  29465. 195: [function(e, t, i) {
  29466. "use strict";
  29467. var l = e("./easing");
  29468. window.transitions = t.exports = {
  29469. globalDone: null,
  29470. funcs: [],
  29471. counter: 0,
  29472. uniqueID: 0,
  29473. start: function(e, t, i, n, r, o, a) {
  29474. return n = n || 0,
  29475. this.funcs.push({
  29476. func: e,
  29477. current: -n * Math.abs(t),
  29478. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29479. done: i,
  29480. easing: r || l.linearTween,
  29481. cycling: t < 0,
  29482. running: !0,
  29483. debug: n < 0,
  29484. name: o || "T" + this.counter,
  29485. id: void 0 === a ? this.counter : a,
  29486. paused: !1
  29487. }),
  29488. e(0, 16),
  29489. this.counter += 1,
  29490. e
  29491. },
  29492. trigger: function(e) {
  29493. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29494. , i = e.func || function() {}
  29495. , n = void 0 === e.duration ? 0 : e.duration;
  29496. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29497. var r = e.done || null
  29498. , o = e.easing || l.linearTween
  29499. , a = e.name || "R" + this.counter
  29500. , s = void 0 === e.id ? this.counter : e.id;
  29501. return this.start(i, n, r, t, o, a, s)
  29502. },
  29503. setTimeout: function(e, t, i) {
  29504. var n = void 0 === i ? this.counter : i;
  29505. return this.trigger({
  29506. done: e,
  29507. duration: void 0 === t ? 0 : t,
  29508. name: "O" + this.counter,
  29509. id: n
  29510. })
  29511. },
  29512. pause: function() {
  29513. this.paused = !0
  29514. },
  29515. resume: function() {
  29516. this.paused = !1
  29517. },
  29518. update: function(n) {
  29519. this.funcs.forEach(function(e) {
  29520. if (!(e.paused || (e.current += 1e3 * n,
  29521. e.current < 0)))
  29522. if (e.current >= e.duration && !e.cycling) {
  29523. var t = e.easing(1, 0, 1, 1);
  29524. e.func(t, 1e3 * n),
  29525. e.done && e.done(),
  29526. e.running = !1
  29527. } else {
  29528. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29529. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29530. e.running = !1)
  29531. }
  29532. });
  29533. var e = this.funcs.length;
  29534. this.funcs = this.funcs.filter(function(e) {
  29535. return e.running
  29536. });
  29537. var t = this.funcs.length;
  29538. if (0 < e && 0 === t && this.globalDone) {
  29539. var i = this.globalDone;
  29540. this.globalDone = null,
  29541. i()
  29542. }
  29543. },
  29544. adjustSpeed: function(e, t) {
  29545. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29546. var r = i[n];
  29547. r.duration /= t,
  29548. r.current /= t
  29549. }
  29550. },
  29551. getById: function(t) {
  29552. return this.funcs.filter(function(e) {
  29553. return t === e.id
  29554. })
  29555. },
  29556. get: function(e) {
  29557. for (var t = 0; t < this.funcs.length; t += 1)
  29558. if (this.funcs[t].func === e)
  29559. return this.funcs[t];
  29560. return null
  29561. },
  29562. isRunning: function(e) {
  29563. var t = this.get(e);
  29564. return null !== t && t.running
  29565. },
  29566. countActive: function() {
  29567. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29568. e += this.funcs[t].running;
  29569. return e
  29570. },
  29571. listActive: function() {
  29572. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29573. this.funcs[t].running && e.push(this.funcs[t].name);
  29574. return e
  29575. },
  29576. done: function(e) {
  29577. this.globalDone = e
  29578. },
  29579. cancelById: function(e) {
  29580. var t = void 0 === e ? 0 : e;
  29581. this.funcs = this.funcs.filter(function(e) {
  29582. return e.id !== t
  29583. })
  29584. },
  29585. cancel: function(t) {
  29586. this.funcs = this.funcs.filter(function(e) {
  29587. return e.func !== t
  29588. })
  29589. },
  29590. getUniqueId: function() {
  29591. return this.uniqueID -= 1,
  29592. this.uniqueID
  29593. }
  29594. }
  29595. }
  29596. , {
  29597. "./easing": 186
  29598. }],
  29599. 196: [function(e, t, i) {
  29600. function n(e) {
  29601. if (this.set = {},
  29602. this.infContains = function() {
  29603. return !0
  29604. }
  29605. ,
  29606. "object" == typeof e)
  29607. if (e instanceof Array)
  29608. for (var t = 0; t < e.length; t++)
  29609. this.set[e[t]] = !0;
  29610. else
  29611. this.set = e;
  29612. else if ("function" == typeof e)
  29613. this.infContains = e;
  29614. else if (void 0 !== e)
  29615. throw new Error("set must be either an array or an object.")
  29616. }
  29617. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29618. return !!this.set[e]
  29619. }
  29620. ,
  29621. n.prototype.add = function(e) {
  29622. if (1 == arguments.length)
  29623. this.set[e] = !0;
  29624. else
  29625. for (var t = 0; t < arguments.length; t++)
  29626. this.set[arguments[t]] = !0
  29627. }
  29628. ,
  29629. n.prototype.addAll = function(e) {
  29630. if ("object" != typeof e && !(e instanceof Array))
  29631. throw new Error("arr must be an array.");
  29632. for (var t = 0; t < e.length; t++)
  29633. this.add(e[t])
  29634. }
  29635. ,
  29636. n.prototype.delete = n.prototype.remove = function(e) {
  29637. if (1 == arguments.length)
  29638. delete this.set[e];
  29639. else
  29640. for (var t = 0; t < arguments.length; t++)
  29641. delete this.set[arguments[t]]
  29642. }
  29643. ,
  29644. n.prototype.clear = function() {
  29645. this.set = {}
  29646. }
  29647. ,
  29648. n.prototype.size = function() {
  29649. return Object.keys(this.set).length
  29650. }
  29651. ,
  29652. n.prototype.toString = function() {
  29653. return "{" + Object.keys(this.set).toString() + "}"
  29654. }
  29655. ,
  29656. n.prototype["*values"] = n.prototype.toArray = function() {
  29657. return void 0 === this.set ? [] : Object.keys(this.set)
  29658. }
  29659. }
  29660. , {}],
  29661. 197: [function(e, t, i) {}
  29662. , {}],
  29663. 198: [function(N, e, F) {
  29664. (function(e) {
  29665. "use strict";
  29666. function i() {
  29667. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29668. }
  29669. function o(e, t) {
  29670. if (i() < t)
  29671. throw new RangeError("Invalid typed array length");
  29672. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29673. e.length = t),
  29674. e
  29675. }
  29676. function u(e, t, i) {
  29677. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29678. return new u(e,t,i);
  29679. if ("number" != typeof e)
  29680. return n(this, e, t, i);
  29681. if ("string" == typeof t)
  29682. throw new Error("If encoding is specified then the first argument must be a string");
  29683. return a(this, e)
  29684. }
  29685. function n(e, t, i, n) {
  29686. if ("number" == typeof t)
  29687. throw new TypeError('"value" argument must not be a number');
  29688. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29689. if (t.byteLength,
  29690. i < 0 || t.byteLength < i)
  29691. throw new RangeError("'offset' is out of bounds");
  29692. if (t.byteLength < i + (n || 0))
  29693. throw new RangeError("'length' is out of bounds");
  29694. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29695. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29696. e
  29697. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29698. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29699. !u.isEncoding(i))
  29700. throw new TypeError('"encoding" must be a valid string encoding');
  29701. var n = 0 | c(t, i)
  29702. , r = (e = o(e, n)).write(t, i);
  29703. return r !== n && (e = e.slice(0, r)),
  29704. e
  29705. }(e, t, i) : function(e, t) {
  29706. if (u.isBuffer(t)) {
  29707. var i = 0 | l(t.length);
  29708. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29709. e
  29710. }
  29711. if (t) {
  29712. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29713. return "number" != typeof t.length || function(e) {
  29714. return e != e
  29715. }(t.length) ? o(e, 0) : s(e, t);
  29716. if ("Buffer" === t.type && L(t.data))
  29717. return s(e, t.data)
  29718. }
  29719. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29720. }(e, t)
  29721. }
  29722. function r(e) {
  29723. if ("number" != typeof e)
  29724. throw new TypeError('"size" argument must be a number');
  29725. if (e < 0)
  29726. throw new RangeError('"size" argument must not be negative')
  29727. }
  29728. function a(e, t) {
  29729. if (r(t),
  29730. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29731. !u.TYPED_ARRAY_SUPPORT)
  29732. for (var i = 0; i < t; ++i)
  29733. e[i] = 0;
  29734. return e
  29735. }
  29736. function s(e, t) {
  29737. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29738. e = o(e, i);
  29739. for (var n = 0; n < i; n += 1)
  29740. e[n] = 255 & t[n];
  29741. return e
  29742. }
  29743. function l(e) {
  29744. if (e >= i())
  29745. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29746. return 0 | e
  29747. }
  29748. function c(e, t) {
  29749. if (u.isBuffer(e))
  29750. return e.length;
  29751. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29752. return e.byteLength;
  29753. "string" != typeof e && (e = "" + e);
  29754. var i = e.length;
  29755. if (0 === i)
  29756. return 0;
  29757. for (var n = !1; ; )
  29758. switch (t) {
  29759. case "ascii":
  29760. case "latin1":
  29761. case "binary":
  29762. return i;
  29763. case "utf8":
  29764. case "utf-8":
  29765. case void 0:
  29766. return S(e).length;
  29767. case "ucs2":
  29768. case "ucs-2":
  29769. case "utf16le":
  29770. case "utf-16le":
  29771. return 2 * i;
  29772. case "hex":
  29773. return i >>> 1;
  29774. case "base64":
  29775. return M(e).length;
  29776. default:
  29777. if (n)
  29778. return S(e).length;
  29779. t = ("" + t).toLowerCase(),
  29780. n = !0
  29781. }
  29782. }
  29783. function h(e, t, i) {
  29784. var n = e[t];
  29785. e[t] = e[i],
  29786. e[i] = n
  29787. }
  29788. function d(e, t, i, n, r) {
  29789. if (0 === e.length)
  29790. return -1;
  29791. if ("string" == typeof i ? (n = i,
  29792. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29793. i = +i,
  29794. isNaN(i) && (i = r ? 0 : e.length - 1),
  29795. i < 0 && (i = e.length + i),
  29796. i >= e.length) {
  29797. if (r)
  29798. return -1;
  29799. i = e.length - 1
  29800. } else if (i < 0) {
  29801. if (!r)
  29802. return -1;
  29803. i = 0
  29804. }
  29805. if ("string" == typeof t && (t = u.from(t, n)),
  29806. u.isBuffer(t))
  29807. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29808. if ("number" == typeof t)
  29809. return t &= 255,
  29810. 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);
  29811. throw new TypeError("val must be string, number or Buffer")
  29812. }
  29813. function p(e, t, i, n, r) {
  29814. function o(e, t) {
  29815. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29816. }
  29817. var a, s = 1, l = e.length, c = t.length;
  29818. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29819. if (e.length < 2 || t.length < 2)
  29820. return -1;
  29821. l /= s = 2,
  29822. c /= 2,
  29823. i /= 2
  29824. }
  29825. if (r) {
  29826. var h = -1;
  29827. for (a = i; a < l; a++)
  29828. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29829. if (-1 === h && (h = a),
  29830. a - h + 1 === c)
  29831. return h * s
  29832. } else
  29833. -1 !== h && (a -= a - h),
  29834. h = -1
  29835. } else
  29836. for (l < i + c && (i = l - c),
  29837. a = i; 0 <= a; a--) {
  29838. for (var u = !0, d = 0; d < c; d++)
  29839. if (o(e, a + d) !== o(t, d)) {
  29840. u = !1;
  29841. break
  29842. }
  29843. if (u)
  29844. return a
  29845. }
  29846. return -1
  29847. }
  29848. function g(e, t, i, n) {
  29849. i = Number(i) || 0;
  29850. var r = e.length - i;
  29851. n ? r < (n = Number(n)) && (n = r) : n = r;
  29852. var o = t.length;
  29853. if (o % 2 != 0)
  29854. throw new TypeError("Invalid hex string");
  29855. o / 2 < n && (n = o / 2);
  29856. for (var a = 0; a < n; ++a) {
  29857. var s = parseInt(t.substr(2 * a, 2), 16);
  29858. if (isNaN(s))
  29859. return a;
  29860. e[i + a] = s
  29861. }
  29862. return a
  29863. }
  29864. function m(e, t, i, n) {
  29865. return R(function(e) {
  29866. for (var t = [], i = 0; i < e.length; ++i)
  29867. t.push(255 & e.charCodeAt(i));
  29868. return t
  29869. }(t), e, i, n)
  29870. }
  29871. function f(e, t, i) {
  29872. i = Math.min(e.length, i);
  29873. for (var n = [], r = t; r < i; ) {
  29874. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29875. if (r + u <= i)
  29876. switch (u) {
  29877. case 1:
  29878. c < 128 && (h = c);
  29879. break;
  29880. case 2:
  29881. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29882. break;
  29883. case 3:
  29884. o = e[r + 1],
  29885. a = e[r + 2],
  29886. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29887. break;
  29888. case 4:
  29889. o = e[r + 1],
  29890. a = e[r + 2],
  29891. s = e[r + 3],
  29892. 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))
  29893. }
  29894. null === h ? (h = 65533,
  29895. u = 1) : 65535 < h && (h -= 65536,
  29896. n.push(h >>> 10 & 1023 | 55296),
  29897. h = 56320 | 1023 & h),
  29898. n.push(h),
  29899. r += u
  29900. }
  29901. return function(e) {
  29902. var t = e.length;
  29903. if (t <= D)
  29904. return String.fromCharCode.apply(String, e);
  29905. for (var i = "", n = 0; n < t; )
  29906. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29907. return i
  29908. }(n)
  29909. }
  29910. function v(e, t, i) {
  29911. var n = "";
  29912. i = Math.min(e.length, i);
  29913. for (var r = t; r < i; ++r)
  29914. n += String.fromCharCode(127 & e[r]);
  29915. return n
  29916. }
  29917. function y(e, t, i) {
  29918. var n = "";
  29919. i = Math.min(e.length, i);
  29920. for (var r = t; r < i; ++r)
  29921. n += String.fromCharCode(e[r]);
  29922. return n
  29923. }
  29924. function A(e, t, i) {
  29925. var n, r = e.length;
  29926. (!t || t < 0) && (t = 0),
  29927. (!i || i < 0 || r < i) && (i = r);
  29928. for (var o = "", a = t; a < i; ++a)
  29929. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29930. return o
  29931. }
  29932. function C(e, t, i) {
  29933. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29934. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29935. return r
  29936. }
  29937. function I(e, t, i) {
  29938. if (e % 1 != 0 || e < 0)
  29939. throw new RangeError("offset is not uint");
  29940. if (i < e + t)
  29941. throw new RangeError("Trying to access beyond buffer length")
  29942. }
  29943. function E(e, t, i, n, r, o) {
  29944. if (!u.isBuffer(e))
  29945. throw new TypeError('"buffer" argument must be a Buffer instance');
  29946. if (r < t || t < o)
  29947. throw new RangeError('"value" argument is out of bounds');
  29948. if (i + n > e.length)
  29949. throw new RangeError("Index out of range")
  29950. }
  29951. function _(e, t, i, n) {
  29952. t < 0 && (t = 65535 + t + 1);
  29953. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29954. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29955. }
  29956. function b(e, t, i, n) {
  29957. t < 0 && (t = 4294967295 + t + 1);
  29958. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29959. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29960. }
  29961. function w(e, t, i, n) {
  29962. if (i + n > e.length)
  29963. throw new RangeError("Index out of range");
  29964. if (i < 0)
  29965. throw new RangeError("Index out of range")
  29966. }
  29967. function T(e, t, i, n, r) {
  29968. return r || w(e, 0, i, 4),
  29969. O.write(e, t, i, n, 23, 4),
  29970. i + 4
  29971. }
  29972. function x(e, t, i, n, r) {
  29973. return r || w(e, 0, i, 8),
  29974. O.write(e, t, i, n, 52, 8),
  29975. i + 8
  29976. }
  29977. function S(e, t) {
  29978. t = t || 1 / 0;
  29979. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29980. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29981. if (!r) {
  29982. if (56319 < i) {
  29983. -1 < (t -= 3) && o.push(239, 191, 189);
  29984. continue
  29985. }
  29986. if (a + 1 === n) {
  29987. -1 < (t -= 3) && o.push(239, 191, 189);
  29988. continue
  29989. }
  29990. r = i;
  29991. continue
  29992. }
  29993. if (i < 56320) {
  29994. -1 < (t -= 3) && o.push(239, 191, 189),
  29995. r = i;
  29996. continue
  29997. }
  29998. i = 65536 + (r - 55296 << 10 | i - 56320)
  29999. } else
  30000. r && -1 < (t -= 3) && o.push(239, 191, 189);
  30001. if (r = null,
  30002. i < 128) {
  30003. if ((t -= 1) < 0)
  30004. break;
  30005. o.push(i)
  30006. } else if (i < 2048) {
  30007. if ((t -= 2) < 0)
  30008. break;
  30009. o.push(i >> 6 | 192, 63 & i | 128)
  30010. } else if (i < 65536) {
  30011. if ((t -= 3) < 0)
  30012. break;
  30013. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30014. } else {
  30015. if (!(i < 1114112))
  30016. throw new Error("Invalid code point");
  30017. if ((t -= 4) < 0)
  30018. break;
  30019. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30020. }
  30021. }
  30022. return o
  30023. }
  30024. function M(e) {
  30025. return P.toByteArray(function(e) {
  30026. if ((e = function(e) {
  30027. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30028. }(e).replace(t, "")).length < 2)
  30029. return "";
  30030. for (; e.length % 4 != 0; )
  30031. e += "=";
  30032. return e
  30033. }(e))
  30034. }
  30035. function R(e, t, i, n) {
  30036. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30037. t[r + i] = e[r];
  30038. return r
  30039. }
  30040. var P = N("base64-js")
  30041. , O = N("ieee754")
  30042. , L = N("isarray");
  30043. F.Buffer = u,
  30044. F.SlowBuffer = function(e) {
  30045. return +e != e && (e = 0),
  30046. u.alloc(+e)
  30047. }
  30048. ,
  30049. F.INSPECT_MAX_BYTES = 50,
  30050. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30051. try {
  30052. var e = new Uint8Array(1);
  30053. return e.__proto__ = {
  30054. __proto__: Uint8Array.prototype,
  30055. foo: function() {
  30056. return 42
  30057. }
  30058. },
  30059. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30060. } catch (e) {
  30061. return !1
  30062. }
  30063. }(),
  30064. F.kMaxLength = i(),
  30065. u.poolSize = 8192,
  30066. u._augment = function(e) {
  30067. return e.__proto__ = u.prototype,
  30068. e
  30069. }
  30070. ,
  30071. u.from = function(e, t, i) {
  30072. return n(null, e, t, i)
  30073. }
  30074. ,
  30075. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30076. u.__proto__ = Uint8Array,
  30077. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30078. value: null,
  30079. configurable: !0
  30080. })),
  30081. u.alloc = function(e, t, i) {
  30082. return function(e, t, i, n) {
  30083. return r(t),
  30084. 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)
  30085. }(null, e, t, i)
  30086. }
  30087. ,
  30088. u.allocUnsafe = function(e) {
  30089. return a(null, e)
  30090. }
  30091. ,
  30092. u.allocUnsafeSlow = function(e) {
  30093. return a(null, e)
  30094. }
  30095. ,
  30096. u.isBuffer = function(e) {
  30097. return !(null == e || !e._isBuffer)
  30098. }
  30099. ,
  30100. u.compare = function(e, t) {
  30101. if (!u.isBuffer(e) || !u.isBuffer(t))
  30102. throw new TypeError("Arguments must be Buffers");
  30103. if (e === t)
  30104. return 0;
  30105. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30106. if (e[r] !== t[r]) {
  30107. i = e[r],
  30108. n = t[r];
  30109. break
  30110. }
  30111. return i < n ? -1 : n < i ? 1 : 0
  30112. }
  30113. ,
  30114. u.isEncoding = function(e) {
  30115. switch (String(e).toLowerCase()) {
  30116. case "hex":
  30117. case "utf8":
  30118. case "utf-8":
  30119. case "ascii":
  30120. case "latin1":
  30121. case "binary":
  30122. case "base64":
  30123. case "ucs2":
  30124. case "ucs-2":
  30125. case "utf16le":
  30126. case "utf-16le":
  30127. return !0;
  30128. default:
  30129. return !1
  30130. }
  30131. }
  30132. ,
  30133. u.concat = function(e, t) {
  30134. if (!L(e))
  30135. throw new TypeError('"list" argument must be an Array of Buffers');
  30136. if (0 === e.length)
  30137. return u.alloc(0);
  30138. var i;
  30139. if (void 0 === t)
  30140. for (i = t = 0; i < e.length; ++i)
  30141. t += e[i].length;
  30142. var n = u.allocUnsafe(t)
  30143. , r = 0;
  30144. for (i = 0; i < e.length; ++i) {
  30145. var o = e[i];
  30146. if (!u.isBuffer(o))
  30147. throw new TypeError('"list" argument must be an Array of Buffers');
  30148. o.copy(n, r),
  30149. r += o.length
  30150. }
  30151. return n
  30152. }
  30153. ,
  30154. u.byteLength = c,
  30155. u.prototype._isBuffer = !0,
  30156. u.prototype.swap16 = function() {
  30157. var e = this.length;
  30158. if (e % 2 != 0)
  30159. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30160. for (var t = 0; t < e; t += 2)
  30161. h(this, t, t + 1);
  30162. return this
  30163. }
  30164. ,
  30165. u.prototype.swap32 = function() {
  30166. var e = this.length;
  30167. if (e % 4 != 0)
  30168. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30169. for (var t = 0; t < e; t += 4)
  30170. h(this, t, t + 3),
  30171. h(this, t + 1, t + 2);
  30172. return this
  30173. }
  30174. ,
  30175. u.prototype.swap64 = function() {
  30176. var e = this.length;
  30177. if (e % 8 != 0)
  30178. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30179. for (var t = 0; t < e; t += 8)
  30180. h(this, t, t + 7),
  30181. h(this, t + 1, t + 6),
  30182. h(this, t + 2, t + 5),
  30183. h(this, t + 3, t + 4);
  30184. return this
  30185. }
  30186. ,
  30187. u.prototype.toString = function() {
  30188. var e = 0 | this.length;
  30189. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30190. var n, r, o, a = !1;
  30191. if ((void 0 === t || t < 0) && (t = 0),
  30192. t > this.length)
  30193. return "";
  30194. if ((void 0 === i || i > this.length) && (i = this.length),
  30195. i <= 0)
  30196. return "";
  30197. if ((i >>>= 0) <= (t >>>= 0))
  30198. return "";
  30199. for (e = e || "utf8"; ; )
  30200. switch (e) {
  30201. case "hex":
  30202. return A(this, t, i);
  30203. case "utf8":
  30204. case "utf-8":
  30205. return f(this, t, i);
  30206. case "ascii":
  30207. return v(this, t, i);
  30208. case "latin1":
  30209. case "binary":
  30210. return y(this, t, i);
  30211. case "base64":
  30212. return n = this,
  30213. o = i,
  30214. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30215. case "ucs2":
  30216. case "ucs-2":
  30217. case "utf16le":
  30218. case "utf-16le":
  30219. return C(this, t, i);
  30220. default:
  30221. if (a)
  30222. throw new TypeError("Unknown encoding: " + e);
  30223. e = (e + "").toLowerCase(),
  30224. a = !0
  30225. }
  30226. }
  30227. .apply(this, arguments)
  30228. }
  30229. ,
  30230. u.prototype.equals = function(e) {
  30231. if (!u.isBuffer(e))
  30232. throw new TypeError("Argument must be a Buffer");
  30233. return this === e || 0 === u.compare(this, e)
  30234. }
  30235. ,
  30236. u.prototype.inspect = function() {
  30237. var e = ""
  30238. , t = F.INSPECT_MAX_BYTES;
  30239. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30240. this.length > t && (e += " ... ")),
  30241. "<Buffer " + e + ">"
  30242. }
  30243. ,
  30244. u.prototype.compare = function(e, t, i, n, r) {
  30245. if (!u.isBuffer(e))
  30246. throw new TypeError("Argument must be a Buffer");
  30247. if (void 0 === t && (t = 0),
  30248. void 0 === i && (i = e ? e.length : 0),
  30249. void 0 === n && (n = 0),
  30250. void 0 === r && (r = this.length),
  30251. t < 0 || i > e.length || n < 0 || r > this.length)
  30252. throw new RangeError("out of range index");
  30253. if (r <= n && i <= t)
  30254. return 0;
  30255. if (r <= n)
  30256. return -1;
  30257. if (i <= t)
  30258. return 1;
  30259. if (this === e)
  30260. return 0;
  30261. 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)
  30262. if (l[h] !== c[h]) {
  30263. o = l[h],
  30264. a = c[h];
  30265. break
  30266. }
  30267. return o < a ? -1 : a < o ? 1 : 0
  30268. }
  30269. ,
  30270. u.prototype.includes = function(e, t, i) {
  30271. return -1 !== this.indexOf(e, t, i)
  30272. }
  30273. ,
  30274. u.prototype.indexOf = function(e, t, i) {
  30275. return d(this, e, t, i, !0)
  30276. }
  30277. ,
  30278. u.prototype.lastIndexOf = function(e, t, i) {
  30279. return d(this, e, t, i, !1)
  30280. }
  30281. ,
  30282. u.prototype.write = function(e, t, i, n) {
  30283. if (void 0 === t)
  30284. n = "utf8",
  30285. i = this.length,
  30286. t = 0;
  30287. else if (void 0 === i && "string" == typeof t)
  30288. n = t,
  30289. i = this.length,
  30290. t = 0;
  30291. else {
  30292. if (!isFinite(t))
  30293. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30294. t |= 0,
  30295. isFinite(i) ? (i |= 0,
  30296. void 0 === n && (n = "utf8")) : (n = i,
  30297. i = void 0)
  30298. }
  30299. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30300. if ((void 0 === i || p < i) && (i = p),
  30301. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30302. throw new RangeError("Attempt to write outside buffer bounds");
  30303. n = n || "utf8";
  30304. for (var f = !1; ; )
  30305. switch (n) {
  30306. case "hex":
  30307. return g(this, e, t, i);
  30308. case "utf8":
  30309. case "utf-8":
  30310. return u = t,
  30311. d = i,
  30312. R(S(e, (h = this).length - u), h, u, d);
  30313. case "ascii":
  30314. return m(this, e, t, i);
  30315. case "latin1":
  30316. case "binary":
  30317. return m(this, e, t, i);
  30318. case "base64":
  30319. return s = this,
  30320. l = t,
  30321. c = i,
  30322. R(M(e), s, l, c);
  30323. case "ucs2":
  30324. case "ucs-2":
  30325. case "utf16le":
  30326. case "utf-16le":
  30327. return o = t,
  30328. a = i,
  30329. R(function(e, t) {
  30330. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30331. i = e.charCodeAt(a),
  30332. n = i >> 8,
  30333. r = i % 256,
  30334. o.push(r),
  30335. o.push(n);
  30336. return o
  30337. }(e, (r = this).length - o), r, o, a);
  30338. default:
  30339. if (f)
  30340. throw new TypeError("Unknown encoding: " + n);
  30341. n = ("" + n).toLowerCase(),
  30342. f = !0
  30343. }
  30344. }
  30345. ,
  30346. u.prototype.toJSON = function() {
  30347. return {
  30348. type: "Buffer",
  30349. data: Array.prototype.slice.call(this._arr || this, 0)
  30350. }
  30351. }
  30352. ;
  30353. var D = 4096;
  30354. u.prototype.slice = function(e, t) {
  30355. var i, n = this.length;
  30356. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30357. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30358. t < e && (t = e),
  30359. u.TYPED_ARRAY_SUPPORT)
  30360. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30361. else {
  30362. var r = t - e;
  30363. i = new u(r,void 0);
  30364. for (var o = 0; o < r; ++o)
  30365. i[o] = this[o + e]
  30366. }
  30367. return i
  30368. }
  30369. ,
  30370. u.prototype.readUIntLE = function(e, t, i) {
  30371. e |= 0,
  30372. t |= 0,
  30373. i || I(e, t, this.length);
  30374. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30375. n += this[e + o] * r;
  30376. return n
  30377. }
  30378. ,
  30379. u.prototype.readUIntBE = function(e, t, i) {
  30380. e |= 0,
  30381. t |= 0,
  30382. i || I(e, t, this.length);
  30383. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30384. n += this[e + --t] * r;
  30385. return n
  30386. }
  30387. ,
  30388. u.prototype.readUInt8 = function(e, t) {
  30389. return t || I(e, 1, this.length),
  30390. this[e]
  30391. }
  30392. ,
  30393. u.prototype.readUInt16LE = function(e, t) {
  30394. return t || I(e, 2, this.length),
  30395. this[e] | this[e + 1] << 8
  30396. }
  30397. ,
  30398. u.prototype.readUInt16BE = function(e, t) {
  30399. return t || I(e, 2, this.length),
  30400. this[e] << 8 | this[e + 1]
  30401. }
  30402. ,
  30403. u.prototype.readUInt32LE = function(e, t) {
  30404. return t || I(e, 4, this.length),
  30405. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30406. }
  30407. ,
  30408. u.prototype.readUInt32BE = function(e, t) {
  30409. return t || I(e, 4, this.length),
  30410. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30411. }
  30412. ,
  30413. u.prototype.readIntLE = function(e, t, i) {
  30414. e |= 0,
  30415. t |= 0,
  30416. i || I(e, t, this.length);
  30417. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30418. n += this[e + o] * r;
  30419. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30420. n
  30421. }
  30422. ,
  30423. u.prototype.readIntBE = function(e, t, i) {
  30424. e |= 0,
  30425. t |= 0,
  30426. i || I(e, t, this.length);
  30427. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30428. o += this[e + --n] * r;
  30429. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30430. o
  30431. }
  30432. ,
  30433. u.prototype.readInt8 = function(e, t) {
  30434. return t || I(e, 1, this.length),
  30435. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30436. }
  30437. ,
  30438. u.prototype.readInt16LE = function(e, t) {
  30439. t || I(e, 2, this.length);
  30440. var i = this[e] | this[e + 1] << 8;
  30441. return 32768 & i ? 4294901760 | i : i
  30442. }
  30443. ,
  30444. u.prototype.readInt16BE = function(e, t) {
  30445. t || I(e, 2, this.length);
  30446. var i = this[e + 1] | this[e] << 8;
  30447. return 32768 & i ? 4294901760 | i : i
  30448. }
  30449. ,
  30450. u.prototype.readInt32LE = function(e, t) {
  30451. return t || I(e, 4, this.length),
  30452. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30453. }
  30454. ,
  30455. u.prototype.readInt32BE = function(e, t) {
  30456. return t || I(e, 4, this.length),
  30457. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30458. }
  30459. ,
  30460. u.prototype.readFloatLE = function(e, t) {
  30461. return t || I(e, 4, this.length),
  30462. O.read(this, e, !0, 23, 4)
  30463. }
  30464. ,
  30465. u.prototype.readFloatBE = function(e, t) {
  30466. return t || I(e, 4, this.length),
  30467. O.read(this, e, !1, 23, 4)
  30468. }
  30469. ,
  30470. u.prototype.readDoubleLE = function(e, t) {
  30471. return t || I(e, 8, this.length),
  30472. O.read(this, e, !0, 52, 8)
  30473. }
  30474. ,
  30475. u.prototype.readDoubleBE = function(e, t) {
  30476. return t || I(e, 8, this.length),
  30477. O.read(this, e, !1, 52, 8)
  30478. }
  30479. ,
  30480. u.prototype.writeUIntLE = function(e, t, i, n) {
  30481. e = +e,
  30482. t |= 0,
  30483. i |= 0,
  30484. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30485. var r = 1
  30486. , o = 0;
  30487. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30488. this[t + o] = e / r & 255;
  30489. return t + i
  30490. }
  30491. ,
  30492. u.prototype.writeUIntBE = function(e, t, i, n) {
  30493. e = +e,
  30494. t |= 0,
  30495. i |= 0,
  30496. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30497. var r = i - 1
  30498. , o = 1;
  30499. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30500. this[t + r] = e / o & 255;
  30501. return t + i
  30502. }
  30503. ,
  30504. u.prototype.writeUInt8 = function(e, t, i) {
  30505. return e = +e,
  30506. t |= 0,
  30507. i || E(this, e, t, 1, 255, 0),
  30508. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30509. this[t] = 255 & e,
  30510. t + 1
  30511. }
  30512. ,
  30513. u.prototype.writeUInt16LE = function(e, t, i) {
  30514. return e = +e,
  30515. t |= 0,
  30516. i || E(this, e, t, 2, 65535, 0),
  30517. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30518. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30519. t + 2
  30520. }
  30521. ,
  30522. u.prototype.writeUInt16BE = function(e, t, i) {
  30523. return e = +e,
  30524. t |= 0,
  30525. i || E(this, e, t, 2, 65535, 0),
  30526. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30527. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30528. t + 2
  30529. }
  30530. ,
  30531. u.prototype.writeUInt32LE = function(e, t, i) {
  30532. return e = +e,
  30533. t |= 0,
  30534. i || E(this, e, t, 4, 4294967295, 0),
  30535. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30536. this[t + 2] = e >>> 16,
  30537. this[t + 1] = e >>> 8,
  30538. this[t] = 255 & e) : b(this, e, t, !0),
  30539. t + 4
  30540. }
  30541. ,
  30542. u.prototype.writeUInt32BE = function(e, t, i) {
  30543. return e = +e,
  30544. t |= 0,
  30545. i || E(this, e, t, 4, 4294967295, 0),
  30546. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30547. this[t + 1] = e >>> 16,
  30548. this[t + 2] = e >>> 8,
  30549. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30550. t + 4
  30551. }
  30552. ,
  30553. u.prototype.writeIntLE = function(e, t, i, n) {
  30554. if (e = +e,
  30555. t |= 0,
  30556. !n) {
  30557. var r = Math.pow(2, 8 * i - 1);
  30558. E(this, e, t, i, r - 1, -r)
  30559. }
  30560. var o = 0
  30561. , a = 1
  30562. , s = 0;
  30563. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30564. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30565. this[t + o] = (e / a >> 0) - s & 255;
  30566. return t + i
  30567. }
  30568. ,
  30569. u.prototype.writeIntBE = function(e, t, i, n) {
  30570. if (e = +e,
  30571. t |= 0,
  30572. !n) {
  30573. var r = Math.pow(2, 8 * i - 1);
  30574. E(this, e, t, i, r - 1, -r)
  30575. }
  30576. var o = i - 1
  30577. , a = 1
  30578. , s = 0;
  30579. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30580. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30581. this[t + o] = (e / a >> 0) - s & 255;
  30582. return t + i
  30583. }
  30584. ,
  30585. u.prototype.writeInt8 = function(e, t, i) {
  30586. return e = +e,
  30587. t |= 0,
  30588. i || E(this, e, t, 1, 127, -128),
  30589. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30590. e < 0 && (e = 255 + e + 1),
  30591. this[t] = 255 & e,
  30592. t + 1
  30593. }
  30594. ,
  30595. u.prototype.writeInt16LE = function(e, t, i) {
  30596. return e = +e,
  30597. t |= 0,
  30598. i || E(this, e, t, 2, 32767, -32768),
  30599. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30600. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30601. t + 2
  30602. }
  30603. ,
  30604. u.prototype.writeInt16BE = function(e, t, i) {
  30605. return e = +e,
  30606. t |= 0,
  30607. i || E(this, e, t, 2, 32767, -32768),
  30608. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30609. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30610. t + 2
  30611. }
  30612. ,
  30613. u.prototype.writeInt32LE = function(e, t, i) {
  30614. return e = +e,
  30615. t |= 0,
  30616. i || E(this, e, t, 4, 2147483647, -2147483648),
  30617. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30618. this[t + 1] = e >>> 8,
  30619. this[t + 2] = e >>> 16,
  30620. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30621. t + 4
  30622. }
  30623. ,
  30624. u.prototype.writeInt32BE = function(e, t, i) {
  30625. return e = +e,
  30626. t |= 0,
  30627. i || E(this, e, t, 4, 2147483647, -2147483648),
  30628. e < 0 && (e = 4294967295 + e + 1),
  30629. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30630. this[t + 1] = e >>> 16,
  30631. this[t + 2] = e >>> 8,
  30632. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30633. t + 4
  30634. }
  30635. ,
  30636. u.prototype.writeFloatLE = function(e, t, i) {
  30637. return T(this, e, t, !0, i)
  30638. }
  30639. ,
  30640. u.prototype.writeFloatBE = function(e, t, i) {
  30641. return T(this, e, t, !1, i)
  30642. }
  30643. ,
  30644. u.prototype.writeDoubleLE = function(e, t, i) {
  30645. return x(this, e, t, !0, i)
  30646. }
  30647. ,
  30648. u.prototype.writeDoubleBE = function(e, t, i) {
  30649. return x(this, e, t, !1, i)
  30650. }
  30651. ,
  30652. u.prototype.copy = function(e, t, i, n) {
  30653. if (i = i || 0,
  30654. n || 0 === n || (n = this.length),
  30655. t >= e.length && (t = e.length),
  30656. t = t || 0,
  30657. 0 < n && n < i && (n = i),
  30658. n === i)
  30659. return 0;
  30660. if (0 === e.length || 0 === this.length)
  30661. return 0;
  30662. if (t < 0)
  30663. throw new RangeError("targetStart out of bounds");
  30664. if (i < 0 || i >= this.length)
  30665. throw new RangeError("sourceStart out of bounds");
  30666. if (n < 0)
  30667. throw new RangeError("sourceEnd out of bounds");
  30668. n > this.length && (n = this.length),
  30669. e.length - t < n - i && (n = e.length - t + i);
  30670. var r, o = n - i;
  30671. if (this === e && i < t && t < n)
  30672. for (r = o - 1; 0 <= r; --r)
  30673. e[r + t] = this[r + i];
  30674. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30675. for (r = 0; r < o; ++r)
  30676. e[r + t] = this[r + i];
  30677. else
  30678. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30679. return o
  30680. }
  30681. ,
  30682. u.prototype.fill = function(e, t, i, n) {
  30683. if ("string" == typeof e) {
  30684. if ("string" == typeof t ? (n = t,
  30685. t = 0,
  30686. i = this.length) : "string" == typeof i && (n = i,
  30687. i = this.length),
  30688. 1 === e.length) {
  30689. var r = e.charCodeAt(0);
  30690. r < 256 && (e = r)
  30691. }
  30692. if (void 0 !== n && "string" != typeof n)
  30693. throw new TypeError("encoding must be a string");
  30694. if ("string" == typeof n && !u.isEncoding(n))
  30695. throw new TypeError("Unknown encoding: " + n)
  30696. } else
  30697. "number" == typeof e && (e &= 255);
  30698. if (t < 0 || this.length < t || this.length < i)
  30699. throw new RangeError("Out of range index");
  30700. if (i <= t)
  30701. return this;
  30702. var o;
  30703. if (t >>>= 0,
  30704. i = void 0 === i ? this.length : i >>> 0,
  30705. "number" == typeof (e = e || 0))
  30706. for (o = t; o < i; ++o)
  30707. this[o] = e;
  30708. else {
  30709. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30710. , s = a.length;
  30711. for (o = 0; o < i - t; ++o)
  30712. this[o + t] = a[o % s]
  30713. }
  30714. return this
  30715. }
  30716. ;
  30717. var t = /[^+\/0-9A-Za-z-_]/g
  30718. }
  30719. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30720. }
  30721. , {
  30722. "base64-js": 199,
  30723. ieee754: 200,
  30724. isarray: 201
  30725. }],
  30726. 199: [function(e, t, i) {
  30727. "use strict";
  30728. function l(e) {
  30729. var t = e.length;
  30730. if (0 < t % 4)
  30731. throw new Error("Invalid string. Length must be a multiple of 4");
  30732. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30733. }
  30734. function c(e, t, i) {
  30735. for (var n, r = [], o = t; o < i; o += 3)
  30736. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30737. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30738. var a;
  30739. return r.join("")
  30740. }
  30741. i.byteLength = function(e) {
  30742. return 3 * e.length / 4 - l(e)
  30743. }
  30744. ,
  30745. i.toByteArray = function(e) {
  30746. var t, i, n, r, o, a = e.length;
  30747. r = l(e),
  30748. o = new d(3 * a / 4 - r),
  30749. i = 0 < r ? a - 4 : a;
  30750. var s = 0;
  30751. for (t = 0; t < i; t += 4,
  30752. 3)
  30753. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30754. o[s++] = n >> 16 & 255,
  30755. o[s++] = n >> 8 & 255,
  30756. o[s++] = 255 & n;
  30757. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30758. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30759. o[s++] = n >> 8 & 255,
  30760. o[s++] = 255 & n),
  30761. o
  30762. }
  30763. ,
  30764. i.fromByteArray = function(e) {
  30765. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30766. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30767. return 1 == n ? (t = e[i - 1],
  30768. r += h[t >> 2],
  30769. r += h[t << 4 & 63],
  30770. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30771. r += h[t >> 10],
  30772. r += h[t >> 4 & 63],
  30773. r += h[t << 2 & 63],
  30774. r += "="),
  30775. o.push(r),
  30776. o.join("")
  30777. }
  30778. ;
  30779. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30780. h[r] = n[r],
  30781. u[n.charCodeAt(r)] = r;
  30782. u["-".charCodeAt(0)] = 62,
  30783. u["_".charCodeAt(0)] = 63
  30784. }
  30785. , {}],
  30786. 200: [function(e, t, i) {
  30787. i.read = function(e, t, i, n, r) {
  30788. 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];
  30789. for (u += d,
  30790. o = p & (1 << -h) - 1,
  30791. p >>= -h,
  30792. h += s; 0 < h; o = 256 * o + e[t + u],
  30793. u += d,
  30794. h -= 8)
  30795. ;
  30796. for (a = o & (1 << -h) - 1,
  30797. o >>= -h,
  30798. h += n; 0 < h; a = 256 * a + e[t + u],
  30799. u += d,
  30800. h -= 8)
  30801. ;
  30802. if (0 === o)
  30803. o = 1 - c;
  30804. else {
  30805. if (o === l)
  30806. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30807. a += Math.pow(2, n),
  30808. o -= c
  30809. }
  30810. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30811. }
  30812. ,
  30813. i.write = function(e, t, i, n, r, o) {
  30814. 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;
  30815. for (t = Math.abs(t),
  30816. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30817. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30818. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30819. l *= 2),
  30820. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30821. l /= 2),
  30822. h <= a + u ? (s = 0,
  30823. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30824. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30825. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30826. p += f,
  30827. s /= 256,
  30828. r -= 8)
  30829. ;
  30830. for (a = a << r | s,
  30831. c += r; 0 < c; e[i + p] = 255 & a,
  30832. p += f,
  30833. a /= 256,
  30834. c -= 8)
  30835. ;
  30836. e[i + p - f] |= 128 * g
  30837. }
  30838. }
  30839. , {}],
  30840. 201: [function(e, t, i) {
  30841. var n = {}.toString;
  30842. t.exports = Array.isArray || function(e) {
  30843. return "[object Array]" == n.call(e)
  30844. }
  30845. }
  30846. , {}],
  30847. 202: [function(e, t, i) {
  30848. function n() {
  30849. this._events = this._events || {},
  30850. this._maxListeners = this._maxListeners || void 0
  30851. }
  30852. function l(e) {
  30853. return "function" == typeof e
  30854. }
  30855. function c(e) {
  30856. return "object" == typeof e && null !== e
  30857. }
  30858. function h(e) {
  30859. return void 0 === e
  30860. }
  30861. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30862. n.prototype._maxListeners = void 0,
  30863. n.defaultMaxListeners = 10,
  30864. n.prototype.setMaxListeners = function(e) {
  30865. if (!function(e) {
  30866. return "number" == typeof e
  30867. }(e) || e < 0 || isNaN(e))
  30868. throw TypeError("n must be a positive number");
  30869. return this._maxListeners = e,
  30870. this
  30871. }
  30872. ,
  30873. n.prototype.emit = function(e) {
  30874. var t, i, n, r, o, a;
  30875. if (this._events || (this._events = {}),
  30876. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30877. if ((t = arguments[1])instanceof Error)
  30878. throw t;
  30879. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30880. throw s.context = t,
  30881. s
  30882. }
  30883. if (h(i = this._events[e]))
  30884. return !1;
  30885. if (l(i))
  30886. switch (arguments.length) {
  30887. case 1:
  30888. i.call(this);
  30889. break;
  30890. case 2:
  30891. i.call(this, arguments[1]);
  30892. break;
  30893. case 3:
  30894. i.call(this, arguments[1], arguments[2]);
  30895. break;
  30896. default:
  30897. r = Array.prototype.slice.call(arguments, 1),
  30898. i.apply(this, r)
  30899. }
  30900. else if (c(i))
  30901. for (r = Array.prototype.slice.call(arguments, 1),
  30902. n = (a = i.slice()).length,
  30903. o = 0; o < n; o++)
  30904. a[o].apply(this, r);
  30905. return !0
  30906. }
  30907. ,
  30908. n.prototype.on = n.prototype.addListener = function(e, t) {
  30909. var i;
  30910. if (!l(t))
  30911. throw TypeError("listener must be a function");
  30912. return this._events || (this._events = {}),
  30913. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30914. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30915. 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,
  30916. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30917. "function" == typeof console.trace && console.trace())),
  30918. this
  30919. }
  30920. ,
  30921. n.prototype.once = function(e, t) {
  30922. function i() {
  30923. this.removeListener(e, i),
  30924. n || (n = !0,
  30925. t.apply(this, arguments))
  30926. }
  30927. if (!l(t))
  30928. throw TypeError("listener must be a function");
  30929. var n = !1;
  30930. return i.listener = t,
  30931. this.on(e, i),
  30932. this
  30933. }
  30934. ,
  30935. n.prototype.removeListener = function(e, t) {
  30936. var i, n, r, o;
  30937. if (!l(t))
  30938. throw TypeError("listener must be a function");
  30939. if (!this._events || !this._events[e])
  30940. return this;
  30941. if (r = (i = this._events[e]).length,
  30942. n = -1,
  30943. i === t || l(i.listener) && i.listener === t)
  30944. delete this._events[e],
  30945. this._events.removeListener && this.emit("removeListener", e, t);
  30946. else if (c(i)) {
  30947. for (o = r; 0 < o--; )
  30948. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30949. n = o;
  30950. break
  30951. }
  30952. if (n < 0)
  30953. return this;
  30954. 1 === i.length ? (i.length = 0,
  30955. delete this._events[e]) : i.splice(n, 1),
  30956. this._events.removeListener && this.emit("removeListener", e, t)
  30957. }
  30958. return this
  30959. }
  30960. ,
  30961. n.prototype.removeAllListeners = function(e) {
  30962. var t, i;
  30963. if (!this._events)
  30964. return this;
  30965. if (!this._events.removeListener)
  30966. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30967. this;
  30968. if (0 === arguments.length) {
  30969. for (t in this._events)
  30970. "removeListener" !== t && this.removeAllListeners(t);
  30971. return this.removeAllListeners("removeListener"),
  30972. this._events = {},
  30973. this
  30974. }
  30975. if (l(i = this._events[e]))
  30976. this.removeListener(e, i);
  30977. else if (i)
  30978. for (; i.length; )
  30979. this.removeListener(e, i[i.length - 1]);
  30980. return delete this._events[e],
  30981. this
  30982. }
  30983. ,
  30984. n.prototype.listeners = function(e) {
  30985. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30986. }
  30987. ,
  30988. n.prototype.listenerCount = function(e) {
  30989. if (this._events) {
  30990. var t = this._events[e];
  30991. if (l(t))
  30992. return 1;
  30993. if (t)
  30994. return t.length
  30995. }
  30996. return 0
  30997. }
  30998. ,
  30999. n.listenerCount = function(e, t) {
  31000. return e.listenerCount(t)
  31001. }
  31002. }
  31003. , {}],
  31004. 203: [function(e, t, i) {
  31005. function n() {
  31006. throw new Error("setTimeout has not been defined")
  31007. }
  31008. function r() {
  31009. throw new Error("clearTimeout has not been defined")
  31010. }
  31011. function o(t) {
  31012. if (h === setTimeout)
  31013. return setTimeout(t, 0);
  31014. if ((h === n || !h) && setTimeout)
  31015. return h = setTimeout,
  31016. setTimeout(t, 0);
  31017. try {
  31018. return h(t, 0)
  31019. } catch (e) {
  31020. try {
  31021. return h.call(null, t, 0)
  31022. } catch (e) {
  31023. return h.call(this, t, 0)
  31024. }
  31025. }
  31026. }
  31027. function a() {
  31028. g && p && (g = !1,
  31029. p.length ? f = p.concat(f) : m = -1,
  31030. f.length && s())
  31031. }
  31032. function s() {
  31033. if (!g) {
  31034. var e = o(a);
  31035. g = !0;
  31036. for (var t = f.length; t; ) {
  31037. for (p = f,
  31038. f = []; ++m < t; )
  31039. p && p[m].run();
  31040. m = -1,
  31041. t = f.length
  31042. }
  31043. p = null,
  31044. g = !1,
  31045. function(t) {
  31046. if (u === clearTimeout)
  31047. return clearTimeout(t);
  31048. if ((u === r || !u) && clearTimeout)
  31049. return u = clearTimeout,
  31050. clearTimeout(t);
  31051. try {
  31052. u(t)
  31053. } catch (e) {
  31054. try {
  31055. return u.call(null, t)
  31056. } catch (e) {
  31057. return u.call(this, t)
  31058. }
  31059. }
  31060. }(e)
  31061. }
  31062. }
  31063. function l(e, t) {
  31064. this.fun = e,
  31065. this.array = t
  31066. }
  31067. function c() {}
  31068. var h, u, d = t.exports = {};
  31069. !function() {
  31070. try {
  31071. h = "function" == typeof setTimeout ? setTimeout : n
  31072. } catch (e) {
  31073. h = n
  31074. }
  31075. try {
  31076. u = "function" == typeof clearTimeout ? clearTimeout : r
  31077. } catch (e) {
  31078. u = r
  31079. }
  31080. }();
  31081. var p, f = [], g = !1, m = -1;
  31082. d.nextTick = function(e) {
  31083. var t = new Array(arguments.length - 1);
  31084. if (1 < arguments.length)
  31085. for (var i = 1; i < arguments.length; i++)
  31086. t[i - 1] = arguments[i];
  31087. f.push(new l(e,t)),
  31088. 1 !== f.length || g || o(s)
  31089. }
  31090. ,
  31091. l.prototype.run = function() {
  31092. this.fun.apply(null, this.array)
  31093. }
  31094. ,
  31095. d.title = "browser",
  31096. d.browser = !0,
  31097. d.env = {},
  31098. d.argv = [],
  31099. d.version = "",
  31100. d.versions = {},
  31101. d.on = c,
  31102. d.addListener = c,
  31103. d.once = c,
  31104. d.off = c,
  31105. d.removeListener = c,
  31106. d.removeAllListeners = c,
  31107. d.emit = c,
  31108. d.binding = function(e) {
  31109. throw new Error("process.binding is not supported")
  31110. }
  31111. ,
  31112. d.cwd = function() {
  31113. return "/"
  31114. }
  31115. ,
  31116. d.chdir = function(e) {
  31117. throw new Error("process.chdir is not supported")
  31118. }
  31119. ,
  31120. d.umask = function() {
  31121. return 0
  31122. }
  31123. }
  31124. , {}],
  31125. 204: [function(e, O, L) {
  31126. (function(P) {
  31127. !function(e) {
  31128. function v(e) {
  31129. throw new RangeError(g[e])
  31130. }
  31131. function r(e, t) {
  31132. for (var i = e.length, n = []; i--; )
  31133. n[i] = t(e[i]);
  31134. return n
  31135. }
  31136. function t(e, t) {
  31137. var i = e.split("@")
  31138. , n = "";
  31139. return 1 < i.length && (n = i[0] + "@",
  31140. e = i[1]),
  31141. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31142. }
  31143. function y(e) {
  31144. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31145. 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),
  31146. r--) : n.push(t);
  31147. return n
  31148. }
  31149. function A(e) {
  31150. return r(e, function(e) {
  31151. var t = "";
  31152. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31153. e = 56320 | 1023 & e),
  31154. t + R(e)
  31155. }).join("")
  31156. }
  31157. function C(e, t) {
  31158. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31159. }
  31160. function I(e, t, i) {
  31161. var n = 0;
  31162. for (e = i ? M(e / u) : e >> 1,
  31163. e += M(e / t); m * w >> 1 < e; n += _)
  31164. e = M(e / m);
  31165. return M(n + (m + 1) * e / (e + h))
  31166. }
  31167. function i(e) {
  31168. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31169. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31170. n = 0; n < i; ++n)
  31171. 128 <= e.charCodeAt(n) && v("not-basic"),
  31172. d.push(e.charCodeAt(n));
  31173. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31174. for (o = f,
  31175. a = 1,
  31176. s = _; p <= r && v("invalid-input"),
  31177. u = e.charCodeAt(r++),
  31178. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31179. f += l * a,
  31180. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31181. a > M(E / (h = _ - c)) && v("overflow"),
  31182. a *= h;
  31183. m = I(f - o, t = d.length + 1, 0 == o),
  31184. M(f / t) > E - g && v("overflow"),
  31185. g += M(f / t),
  31186. f %= t,
  31187. d.splice(f++, 0, g)
  31188. }
  31189. return A(d)
  31190. }
  31191. function n(e) {
  31192. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31193. for (d = (e = y(e)).length,
  31194. t = x,
  31195. o = T,
  31196. a = i = 0; a < d; ++a)
  31197. (u = e[a]) < 128 && m.push(R(u));
  31198. for (n = r = m.length,
  31199. r && m.push(S); n < d; ) {
  31200. for (s = E,
  31201. a = 0; a < d; ++a)
  31202. t <= (u = e[a]) && u < s && (s = u);
  31203. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31204. i += (s - t) * p,
  31205. t = s,
  31206. a = 0; a < d; ++a)
  31207. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31208. u == t) {
  31209. for (l = i,
  31210. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31211. g = l - h,
  31212. f = _ - h,
  31213. m.push(R(C(h + g % f, 0))),
  31214. l = M(g / f);
  31215. m.push(R(C(l, 0))),
  31216. o = I(i, p, n == r),
  31217. i = 0,
  31218. ++n
  31219. }
  31220. ++i,
  31221. ++t
  31222. }
  31223. return m.join("")
  31224. }
  31225. var o = "object" == typeof L && L && !L.nodeType && L
  31226. , a = "object" == typeof O && O && !O.nodeType && O
  31227. , s = "object" == typeof P && P;
  31228. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31229. 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 = {
  31230. overflow: "Overflow: input needs wider integers to process",
  31231. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31232. "invalid-input": "Invalid input"
  31233. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31234. if (l = {
  31235. version: "1.4.1",
  31236. ucs2: {
  31237. decode: y,
  31238. encode: A
  31239. },
  31240. decode: i,
  31241. encode: n,
  31242. toASCII: function(e) {
  31243. return t(e, function(e) {
  31244. return p.test(e) ? "xn--" + n(e) : e
  31245. })
  31246. },
  31247. toUnicode: function(e) {
  31248. return t(e, function(e) {
  31249. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31250. })
  31251. }
  31252. },
  31253. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31254. define("punycode", function() {
  31255. return l
  31256. });
  31257. else if (o && a)
  31258. if (O.exports == o)
  31259. a.exports = l;
  31260. else
  31261. for (c in l)
  31262. l.hasOwnProperty(c) && (o[c] = l[c]);
  31263. else
  31264. e.punycode = l
  31265. }(this)
  31266. }
  31267. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31268. }
  31269. , {}],
  31270. 205: [function(e, t, i) {
  31271. "use strict";
  31272. t.exports = function(e, t, i, n) {
  31273. t = t || "&",
  31274. i = i || "=";
  31275. var r = {};
  31276. if ("string" != typeof e || 0 === e.length)
  31277. return r;
  31278. var o = /\+/g;
  31279. e = e.split(t);
  31280. var a = 1e3;
  31281. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31282. var s, l, c = e.length;
  31283. 0 < a && a < c && (c = a);
  31284. for (var h = 0; h < c; ++h) {
  31285. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31286. d = 0 <= m ? (u = g.substr(0, m),
  31287. g.substr(m + 1)) : (u = g,
  31288. ""),
  31289. p = decodeURIComponent(u),
  31290. f = decodeURIComponent(d),
  31291. s = r,
  31292. l = p,
  31293. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31294. }
  31295. return r
  31296. }
  31297. ;
  31298. var v = Array.isArray || function(e) {
  31299. return "[object Array]" === Object.prototype.toString.call(e)
  31300. }
  31301. }
  31302. , {}],
  31303. 206: [function(e, t, i) {
  31304. "use strict";
  31305. function o(e, t) {
  31306. if (e.map)
  31307. return e.map(t);
  31308. for (var i = [], n = 0; n < e.length; n++)
  31309. i.push(t(e[n], n));
  31310. return i
  31311. }
  31312. function a(e) {
  31313. switch (typeof e) {
  31314. case "string":
  31315. return e;
  31316. case "boolean":
  31317. return e ? "true" : "false";
  31318. case "number":
  31319. return isFinite(e) ? e : "";
  31320. default:
  31321. return ""
  31322. }
  31323. }
  31324. t.exports = function(i, n, r, e) {
  31325. return n = n || "&",
  31326. r = r || "=",
  31327. null === i && (i = void 0),
  31328. "object" == typeof i ? o(l(i), function(e) {
  31329. var t = encodeURIComponent(a(e)) + r;
  31330. return s(i[e]) ? o(i[e], function(e) {
  31331. return t + encodeURIComponent(a(e))
  31332. }).join(n) : t + encodeURIComponent(a(i[e]))
  31333. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31334. }
  31335. ;
  31336. var s = Array.isArray || function(e) {
  31337. return "[object Array]" === Object.prototype.toString.call(e)
  31338. }
  31339. , l = Object.keys || function(e) {
  31340. var t = [];
  31341. for (var i in e)
  31342. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31343. return t
  31344. }
  31345. }
  31346. , {}],
  31347. 207: [function(e, t, i) {
  31348. "use strict";
  31349. i.decode = i.parse = e("./decode"),
  31350. i.encode = i.stringify = e("./encode")
  31351. }
  31352. , {
  31353. "./decode": 205,
  31354. "./encode": 206
  31355. }],
  31356. 208: [function(e, t, i) {
  31357. "use strict";
  31358. function x() {
  31359. this.protocol = null,
  31360. this.slashes = null,
  31361. this.auth = null,
  31362. this.host = null,
  31363. this.port = null,
  31364. this.hostname = null,
  31365. this.hash = null,
  31366. this.search = null,
  31367. this.query = null,
  31368. this.pathname = null,
  31369. this.path = null,
  31370. this.href = null
  31371. }
  31372. function n(e, t, i) {
  31373. if (e && D.isObject(e) && e instanceof x)
  31374. return e;
  31375. var n = new x;
  31376. return n.parse(e, t, i),
  31377. n
  31378. }
  31379. var L = e("punycode")
  31380. , D = e("./util");
  31381. i.parse = n,
  31382. i.resolve = function(e, t) {
  31383. return n(e, !1, !0).resolve(t)
  31384. }
  31385. ,
  31386. i.resolveObject = function(e, t) {
  31387. return e ? n(e, !1, !0).resolveObject(t) : t
  31388. }
  31389. ,
  31390. i.format = function(e) {
  31391. return D.isString(e) && (e = n(e)),
  31392. e instanceof x ? e.format() : x.prototype.format.call(e)
  31393. }
  31394. ,
  31395. i.Url = x;
  31396. var N = /^([a-z0-9.+-]+:)/i
  31397. , r = /:[0-9]*$/
  31398. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31399. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31400. , B = ["'"].concat(o)
  31401. , V = ["%", "/", "?", ";", "#"].concat(B)
  31402. , k = ["/", "?", "#"]
  31403. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31404. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31405. , z = {
  31406. javascript: !0,
  31407. "javascript:": !0
  31408. }
  31409. , G = {
  31410. javascript: !0,
  31411. "javascript:": !0
  31412. }
  31413. , W = {
  31414. http: !0,
  31415. https: !0,
  31416. ftp: !0,
  31417. gopher: !0,
  31418. file: !0,
  31419. "http:": !0,
  31420. "https:": !0,
  31421. "ftp:": !0,
  31422. "gopher:": !0,
  31423. "file:": !0
  31424. }
  31425. , j = e("querystring");
  31426. x.prototype.parse = function(e, t, i) {
  31427. if (!D.isString(e))
  31428. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31429. var n = e.indexOf("?")
  31430. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31431. , o = e.split(r);
  31432. o[0] = o[0].replace(/\\/g, "/");
  31433. var a = e = o.join(r);
  31434. if (a = a.trim(),
  31435. !i && 1 === e.split("#").length) {
  31436. var s = F.exec(a);
  31437. if (s)
  31438. return this.path = a,
  31439. this.href = a,
  31440. this.pathname = s[1],
  31441. s[2] ? (this.search = s[2],
  31442. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31443. this.query = {}),
  31444. this
  31445. }
  31446. var l = N.exec(a);
  31447. if (l) {
  31448. var c = (l = l[0]).toLowerCase();
  31449. this.protocol = c,
  31450. a = a.substr(l.length)
  31451. }
  31452. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31453. var h = "//" === a.substr(0, 2);
  31454. !h || l && G[l] || (a = a.substr(2),
  31455. this.slashes = !0)
  31456. }
  31457. if (!G[l] && (h || l && !W[l])) {
  31458. for (var u = -1, d = 0; d < k.length; d++) {
  31459. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31460. }
  31461. var p, f;
  31462. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31463. a = a.slice(f + 1),
  31464. this.auth = decodeURIComponent(p)),
  31465. u = -1;
  31466. for (d = 0; d < V.length; d++) {
  31467. var g;
  31468. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31469. }
  31470. -1 === u && (u = a.length),
  31471. this.host = a.slice(0, u),
  31472. a = a.slice(u),
  31473. this.parseHost(),
  31474. this.hostname = this.hostname || "";
  31475. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31476. if (!m)
  31477. for (var v = this.hostname.split(/\./), y = (d = 0,
  31478. v.length); d < y; d++) {
  31479. var A = v[d];
  31480. if (A && !A.match(U)) {
  31481. for (var C = "", I = 0, E = A.length; I < E; I++)
  31482. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31483. if (!C.match(U)) {
  31484. var _ = v.slice(0, d)
  31485. , b = v.slice(d + 1)
  31486. , w = A.match(H);
  31487. w && (_.push(w[1]),
  31488. b.unshift(w[2])),
  31489. b.length && (a = "/" + b.join(".") + a),
  31490. this.hostname = _.join(".");
  31491. break
  31492. }
  31493. }
  31494. }
  31495. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31496. m || (this.hostname = L.toASCII(this.hostname));
  31497. var T = this.port ? ":" + this.port : ""
  31498. , x = this.hostname || "";
  31499. this.host = x + T,
  31500. this.href += this.host,
  31501. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31502. "/" !== a[0] && (a = "/" + a))
  31503. }
  31504. if (!z[c])
  31505. for (d = 0,
  31506. y = B.length; d < y; d++) {
  31507. var S = B[d];
  31508. if (-1 !== a.indexOf(S)) {
  31509. var M = encodeURIComponent(S);
  31510. M === S && (M = escape(S)),
  31511. a = a.split(S).join(M)
  31512. }
  31513. }
  31514. var R = a.indexOf("#");
  31515. -1 !== R && (this.hash = a.substr(R),
  31516. a = a.slice(0, R));
  31517. var P = a.indexOf("?");
  31518. if (-1 !== P ? (this.search = a.substr(P),
  31519. this.query = a.substr(P + 1),
  31520. t && (this.query = j.parse(this.query)),
  31521. a = a.slice(0, P)) : t && (this.search = "",
  31522. this.query = {}),
  31523. a && (this.pathname = a),
  31524. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31525. this.pathname || this.search) {
  31526. T = this.pathname || "";
  31527. var O = this.search || "";
  31528. this.path = T + O
  31529. }
  31530. return this.href = this.format(),
  31531. this
  31532. }
  31533. ,
  31534. x.prototype.format = function() {
  31535. var e = this.auth || "";
  31536. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31537. e += "@");
  31538. var t = this.protocol || ""
  31539. , i = this.pathname || ""
  31540. , n = this.hash || ""
  31541. , r = !1
  31542. , o = "";
  31543. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31544. this.port && (r += ":" + this.port)),
  31545. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31546. var a = this.search || o && "?" + o || "";
  31547. return t && ":" !== t.substr(-1) && (t += ":"),
  31548. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31549. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31550. n && "#" !== n.charAt(0) && (n = "#" + n),
  31551. a && "?" !== a.charAt(0) && (a = "?" + a),
  31552. t + r + (i = i.replace(/[?#]/g, function(e) {
  31553. return encodeURIComponent(e)
  31554. })) + (a = a.replace("#", "%23")) + n
  31555. }
  31556. ,
  31557. x.prototype.resolve = function(e) {
  31558. return this.resolveObject(n(e, !1, !0)).format()
  31559. }
  31560. ,
  31561. x.prototype.resolveObject = function(e) {
  31562. if (D.isString(e)) {
  31563. var t = new x;
  31564. t.parse(e, !1, !0),
  31565. e = t
  31566. }
  31567. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31568. var o = n[r];
  31569. i[o] = this[o]
  31570. }
  31571. if (i.hash = e.hash,
  31572. "" === e.href)
  31573. return i.href = i.format(),
  31574. i;
  31575. if (e.slashes && !e.protocol) {
  31576. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31577. var l = a[s];
  31578. "protocol" !== l && (i[l] = e[l])
  31579. }
  31580. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31581. i.href = i.format(),
  31582. i
  31583. }
  31584. if (e.protocol && e.protocol !== i.protocol) {
  31585. if (!W[e.protocol]) {
  31586. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31587. var u = c[h];
  31588. i[u] = e[u]
  31589. }
  31590. return i.href = i.format(),
  31591. i
  31592. }
  31593. if (i.protocol = e.protocol,
  31594. e.host || G[e.protocol])
  31595. i.pathname = e.pathname;
  31596. else {
  31597. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31598. ;
  31599. e.host || (e.host = ""),
  31600. e.hostname || (e.hostname = ""),
  31601. "" !== d[0] && d.unshift(""),
  31602. d.length < 2 && d.unshift(""),
  31603. i.pathname = d.join("/")
  31604. }
  31605. if (i.search = e.search,
  31606. i.query = e.query,
  31607. i.host = e.host || "",
  31608. i.auth = e.auth,
  31609. i.hostname = e.hostname || e.host,
  31610. i.port = e.port,
  31611. i.pathname || i.search) {
  31612. var p = i.pathname || ""
  31613. , f = i.search || "";
  31614. i.path = p + f
  31615. }
  31616. return i.slashes = i.slashes || e.slashes,
  31617. i.href = i.format(),
  31618. i
  31619. }
  31620. var g = i.pathname && "/" === i.pathname.charAt(0)
  31621. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31622. , v = m || g || i.host && e.pathname
  31623. , y = v
  31624. , A = i.pathname && i.pathname.split("/") || []
  31625. , C = (d = e.pathname && e.pathname.split("/") || [],
  31626. i.protocol && !W[i.protocol]);
  31627. if (C && (i.hostname = "",
  31628. i.port = null,
  31629. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31630. i.host = "",
  31631. e.protocol && (e.hostname = null,
  31632. e.port = null,
  31633. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31634. e.host = null),
  31635. v = v && ("" === d[0] || "" === A[0])),
  31636. m)
  31637. i.host = e.host || "" === e.host ? e.host : i.host,
  31638. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31639. i.search = e.search,
  31640. i.query = e.query,
  31641. A = d;
  31642. else if (d.length)
  31643. (A = A || []).pop(),
  31644. A = A.concat(d),
  31645. i.search = e.search,
  31646. i.query = e.query;
  31647. else if (!D.isNullOrUndefined(e.search)) {
  31648. if (C)
  31649. i.hostname = i.host = A.shift(),
  31650. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31651. i.host = i.hostname = w.shift());
  31652. return i.search = e.search,
  31653. i.query = e.query,
  31654. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31655. i.href = i.format(),
  31656. i
  31657. }
  31658. if (!A.length)
  31659. return i.pathname = null,
  31660. i.search ? i.path = "/" + i.search : i.path = null,
  31661. i.href = i.format(),
  31662. i;
  31663. 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--)
  31664. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31665. _++) : _ && (A.splice(b, 1),
  31666. _--);
  31667. if (!v && !y)
  31668. for (; _--; )
  31669. A.unshift("..");
  31670. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31671. E && "/" !== A.join("/").substr(-1) && A.push("");
  31672. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31673. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31674. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31675. i.host = i.hostname = w.shift()));
  31676. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31677. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31678. i.path = null),
  31679. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31680. i.auth = e.auth || i.auth,
  31681. i.slashes = i.slashes || e.slashes,
  31682. i.href = i.format(),
  31683. i
  31684. }
  31685. ,
  31686. x.prototype.parseHost = function() {
  31687. var e = this.host
  31688. , t = r.exec(e);
  31689. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31690. e = e.substr(0, e.length - t.length)),
  31691. e && (this.hostname = e)
  31692. }
  31693. }
  31694. , {
  31695. "./util": 209,
  31696. punycode: 204,
  31697. querystring: 207
  31698. }],
  31699. 209: [function(e, t, i) {
  31700. "use strict";
  31701. t.exports = {
  31702. isString: function(e) {
  31703. return "string" == typeof e
  31704. },
  31705. isObject: function(e) {
  31706. return "object" == typeof e && null !== e
  31707. },
  31708. isNull: function(e) {
  31709. return null === e
  31710. },
  31711. isNullOrUndefined: function(e) {
  31712. return null == e
  31713. }
  31714. }
  31715. }
  31716. , {}],
  31717. 210: [function(e, t, i) {
  31718. "use strict";
  31719. function r(e) {
  31720. return c + e
  31721. }
  31722. function s(e) {
  31723. if ("string" != typeof e)
  31724. throw new TypeError("key must be a string.")
  31725. }
  31726. var l = Object.prototype.hasOwnProperty
  31727. , c = "~";
  31728. t.exports = function(t) {
  31729. var o = Object.create(null)
  31730. , n = 0
  31731. , a = {};
  31732. return function(e, t) {
  31733. for (var i in t)
  31734. Object.defineProperty(e, i, {
  31735. value: t[i],
  31736. configurable: !0,
  31737. writable: !0
  31738. })
  31739. }(a, {
  31740. get: function(e, t) {
  31741. s(e);
  31742. var i = r(e);
  31743. return i in o ? o[i] : t
  31744. },
  31745. set: function(e, t) {
  31746. s(e);
  31747. var i = r(e);
  31748. return i in o || ++n,
  31749. o[i] = t
  31750. },
  31751. has: function(e) {
  31752. return s(e),
  31753. r(e)in o
  31754. },
  31755. delete: function(e) {
  31756. s(e);
  31757. var t = r(e);
  31758. return t in o && (--n,
  31759. delete o[t],
  31760. !0)
  31761. },
  31762. clear: function() {
  31763. o = Object.create(null),
  31764. n = 0
  31765. },
  31766. forEach: function(e, t) {
  31767. if ("function" != typeof e)
  31768. throw new TypeError("`callback` must be a function");
  31769. for (var i in o)
  31770. if (l.call(o, i)) {
  31771. var n = i.substring(c.length)
  31772. , r = o[i];
  31773. e.call(t, r, n, a)
  31774. }
  31775. }
  31776. }),
  31777. Object.defineProperty(a, "size", {
  31778. get: function() {
  31779. return n
  31780. },
  31781. configurable: !0
  31782. }),
  31783. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31784. a.set(e, t[e])
  31785. }),
  31786. a
  31787. }
  31788. }
  31789. , {}],
  31790. 211: [function(e, t, i) {
  31791. t.exports = e("./lib/heap")
  31792. }
  31793. , {
  31794. "./lib/heap": 212
  31795. }],
  31796. 212: [function(e, y, A) {
  31797. (function() {
  31798. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31799. function v(e) {
  31800. this.cmp = null != e ? e : d,
  31801. this.nodes = []
  31802. }
  31803. l = Math.floor,
  31804. m = Math.min,
  31805. d = function(e, t) {
  31806. return e < t ? -1 : t < e ? 1 : 0
  31807. }
  31808. ,
  31809. g = function(e, t, i, n, r) {
  31810. var o;
  31811. if (null == i && (i = 0),
  31812. null == r && (r = d),
  31813. i < 0)
  31814. throw new Error("lo must be non-negative");
  31815. for (null == n && (n = e.length); i < n; )
  31816. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31817. return [].splice.apply(e, [i, i - i].concat(t)),
  31818. t
  31819. }
  31820. ,
  31821. t = function(e, t, i) {
  31822. return null == i && (i = d),
  31823. e.push(t),
  31824. h(e, 0, e.length - 1, i)
  31825. }
  31826. ,
  31827. f = function(e, t) {
  31828. var i, n;
  31829. return null == t && (t = d),
  31830. i = e.pop(),
  31831. e.length ? (n = e[0],
  31832. e[0] = i,
  31833. u(e, 0, t)) : n = i,
  31834. n
  31835. }
  31836. ,
  31837. i = function(e, t, i) {
  31838. var n;
  31839. return null == i && (i = d),
  31840. n = e[0],
  31841. e[0] = t,
  31842. u(e, 0, i),
  31843. n
  31844. }
  31845. ,
  31846. c = function(e, t, i) {
  31847. var n;
  31848. return null == i && (i = d),
  31849. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31850. e[0] = n[1],
  31851. u(e, 0, i)),
  31852. t
  31853. }
  31854. ,
  31855. p = function(i, e) {
  31856. var t, n, r, o, a, s;
  31857. for (null == e && (e = d),
  31858. a = [],
  31859. n = 0,
  31860. r = (o = function() {
  31861. s = [];
  31862. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31863. s.push(e);
  31864. return s
  31865. }
  31866. .apply(this).reverse()).length; n < r; n++)
  31867. t = o[n],
  31868. a.push(u(i, t, e));
  31869. return a
  31870. }
  31871. ,
  31872. o = function(e, t, i) {
  31873. var n;
  31874. if (null == i && (i = d),
  31875. -1 !== (n = e.indexOf(t)))
  31876. return h(e, 0, n, i),
  31877. u(e, n, i)
  31878. }
  31879. ,
  31880. n = function(e, t, i) {
  31881. var n, r, o, a, s;
  31882. if (null == i && (i = d),
  31883. !(r = e.slice(0, t)).length)
  31884. return r;
  31885. for (p(r, i),
  31886. o = 0,
  31887. a = (s = e.slice(t)).length; o < a; o++)
  31888. n = s[o],
  31889. c(r, n, i);
  31890. return r.sort(i).reverse()
  31891. }
  31892. ,
  31893. r = function(e, t, i) {
  31894. var n, r, o, a, s, l, c, h, u;
  31895. if (null == i && (i = d),
  31896. 10 * t <= e.length) {
  31897. if (!(o = e.slice(0, t).sort(i)).length)
  31898. return o;
  31899. for (r = o[o.length - 1],
  31900. a = 0,
  31901. l = (c = e.slice(t)).length; a < l; a++)
  31902. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31903. o.pop(),
  31904. r = o[o.length - 1]);
  31905. return o
  31906. }
  31907. for (p(e, i),
  31908. u = [],
  31909. s = 0,
  31910. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31911. u.push(f(e, i));
  31912. return u
  31913. }
  31914. ,
  31915. h = function(e, t, i, n) {
  31916. var r, o, a;
  31917. for (null == n && (n = d),
  31918. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31919. e[i] = o,
  31920. i = a;
  31921. return e[i] = r
  31922. }
  31923. ,
  31924. u = function(e, t, i) {
  31925. var n, r, o, a, s;
  31926. for (null == i && (i = d),
  31927. r = e.length,
  31928. o = e[s = t],
  31929. n = 2 * t + 1; n < r; )
  31930. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31931. e[t] = e[n],
  31932. n = 2 * (t = n) + 1;
  31933. return e[t] = o,
  31934. h(e, s, t, i)
  31935. }
  31936. ,
  31937. v.push = t,
  31938. v.pop = f,
  31939. v.replace = i,
  31940. v.pushpop = c,
  31941. v.heapify = p,
  31942. v.updateItem = o,
  31943. v.nlargest = n,
  31944. v.nsmallest = r,
  31945. v.prototype.push = function(e) {
  31946. return t(this.nodes, e, this.cmp)
  31947. }
  31948. ,
  31949. v.prototype.pop = function() {
  31950. return f(this.nodes, this.cmp)
  31951. }
  31952. ,
  31953. v.prototype.peek = function() {
  31954. return this.nodes[0]
  31955. }
  31956. ,
  31957. v.prototype.contains = function(e) {
  31958. return -1 !== this.nodes.indexOf(e)
  31959. }
  31960. ,
  31961. v.prototype.replace = function(e) {
  31962. return i(this.nodes, e, this.cmp)
  31963. }
  31964. ,
  31965. v.prototype.pushpop = function(e) {
  31966. return c(this.nodes, e, this.cmp)
  31967. }
  31968. ,
  31969. v.prototype.heapify = function() {
  31970. return p(this.nodes, this.cmp)
  31971. }
  31972. ,
  31973. v.prototype.updateItem = function(e) {
  31974. return o(this.nodes, e, this.cmp)
  31975. }
  31976. ,
  31977. v.prototype.clear = function() {
  31978. return this.nodes = []
  31979. }
  31980. ,
  31981. v.prototype.empty = function() {
  31982. return 0 === this.nodes.length
  31983. }
  31984. ,
  31985. v.prototype.size = function() {
  31986. return this.nodes.length
  31987. }
  31988. ,
  31989. v.prototype.clone = function() {
  31990. var e;
  31991. return (e = new v).nodes = this.nodes.slice(0),
  31992. e
  31993. }
  31994. ,
  31995. v.prototype.toArray = function() {
  31996. return this.nodes.slice(0)
  31997. }
  31998. ,
  31999. v.prototype.insert = v.prototype.push,
  32000. v.prototype.top = v.prototype.peek,
  32001. v.prototype.front = v.prototype.peek,
  32002. v.prototype.has = v.prototype.contains,
  32003. v.prototype.copy = v.prototype.clone,
  32004. e = v,
  32005. a = this,
  32006. s = function() {
  32007. return e
  32008. }
  32009. ,
  32010. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  32011. }
  32012. ).call(this)
  32013. }
  32014. , {}],
  32015. 213: [function(e, t, i) {
  32016. function n() {}
  32017. function o(e) {
  32018. if ("object" != typeof this)
  32019. throw new TypeError("Promises must be constructed via new");
  32020. if ("function" != typeof e)
  32021. throw new TypeError("not a function");
  32022. this._state = 0,
  32023. this._handled = !1,
  32024. this._value = void 0,
  32025. this._deferreds = [],
  32026. h(e, this)
  32027. }
  32028. function r(i, n) {
  32029. for (; 3 === i._state; )
  32030. i = i._value;
  32031. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  32032. void o._immediateFn(function() {
  32033. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  32034. if (null !== e) {
  32035. var t;
  32036. try {
  32037. t = e(i._value)
  32038. } catch (e) {
  32039. return void s(n.promise, e)
  32040. }
  32041. a(n.promise, t)
  32042. } else
  32043. (1 === i._state ? a : s)(n.promise, i._value)
  32044. }))
  32045. }
  32046. function a(e, t) {
  32047. try {
  32048. if (t === e)
  32049. throw new TypeError("A promise cannot be resolved with itself.");
  32050. if (t && ("object" == typeof t || "function" == typeof t)) {
  32051. var i = t.then;
  32052. if (t instanceof o)
  32053. return e._state = 3,
  32054. e._value = t,
  32055. void l(e);
  32056. if ("function" == typeof i)
  32057. return void h(function(e, t) {
  32058. return function() {
  32059. e.apply(t, arguments)
  32060. }
  32061. }(i, t), e)
  32062. }
  32063. e._state = 1,
  32064. e._value = t,
  32065. l(e)
  32066. } catch (t) {
  32067. s(e, t)
  32068. }
  32069. }
  32070. function s(e, t) {
  32071. e._state = 2,
  32072. e._value = t,
  32073. l(e)
  32074. }
  32075. function l(e) {
  32076. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32077. e._handled || o._unhandledRejectionFn(e._value)
  32078. });
  32079. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32080. r(e, e._deferreds[t]);
  32081. e._deferreds = null
  32082. }
  32083. function c(e, t, i) {
  32084. this.onFulfilled = "function" == typeof e ? e : null,
  32085. this.onRejected = "function" == typeof t ? t : null,
  32086. this.promise = i
  32087. }
  32088. function h(e, t) {
  32089. var i = !1;
  32090. try {
  32091. e(function(e) {
  32092. i || (i = !0,
  32093. a(t, e))
  32094. }, function(e) {
  32095. i || (i = !0,
  32096. s(t, e))
  32097. })
  32098. } catch (e) {
  32099. if (i)
  32100. return;
  32101. i = !0,
  32102. s(t, e)
  32103. }
  32104. }
  32105. var u, d;
  32106. u = this,
  32107. d = setTimeout,
  32108. o.prototype.catch = function(e) {
  32109. return this.then(null, e)
  32110. }
  32111. ,
  32112. o.prototype.then = function(e, t) {
  32113. var i = new this.constructor(n);
  32114. return r(this, new c(e,t,i)),
  32115. i
  32116. }
  32117. ,
  32118. o.all = function(e) {
  32119. var s = Array.prototype.slice.call(e);
  32120. return new o(function(n, r) {
  32121. function o(t, e) {
  32122. try {
  32123. if (e && ("object" == typeof e || "function" == typeof e)) {
  32124. var i = e.then;
  32125. if ("function" == typeof i)
  32126. return void i.call(e, function(e) {
  32127. o(t, e)
  32128. }, r)
  32129. }
  32130. s[t] = e,
  32131. 0 == --a && n(s)
  32132. } catch (e) {
  32133. r(e)
  32134. }
  32135. }
  32136. if (0 === s.length)
  32137. return n([]);
  32138. for (var a = s.length, e = 0; e < s.length; e++)
  32139. o(e, s[e])
  32140. }
  32141. )
  32142. }
  32143. ,
  32144. o.resolve = function(t) {
  32145. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32146. e(t)
  32147. }
  32148. )
  32149. }
  32150. ,
  32151. o.reject = function(i) {
  32152. return new o(function(e, t) {
  32153. t(i)
  32154. }
  32155. )
  32156. }
  32157. ,
  32158. o.race = function(r) {
  32159. return new o(function(e, t) {
  32160. for (var i = 0, n = r.length; i < n; i++)
  32161. r[i].then(e, t)
  32162. }
  32163. )
  32164. }
  32165. ,
  32166. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32167. setImmediate(e)
  32168. }
  32169. || function(e) {
  32170. d(e, 0)
  32171. }
  32172. ,
  32173. o._unhandledRejectionFn = function(e) {
  32174. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32175. }
  32176. ,
  32177. o._setImmediateFn = function(e) {
  32178. o._immediateFn = e
  32179. }
  32180. ,
  32181. o._setUnhandledRejectionFn = function(e) {
  32182. o._unhandledRejectionFn = e
  32183. }
  32184. ,
  32185. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32186. }
  32187. , {}],
  32188. 214: [function(p, i, e) {
  32189. (function(d) {
  32190. var e, t;
  32191. e = this,
  32192. t = function(I, e) {
  32193. "use strict";
  32194. var a, t, u, i, s, n, r, o = {};
  32195. return o.ByteBuffer = I,
  32196. o.Long = I.Long || null,
  32197. o.VERSION = "5.0.1",
  32198. o.WIRE_TYPES = {},
  32199. o.WIRE_TYPES.VARINT = 0,
  32200. o.WIRE_TYPES.BITS64 = 1,
  32201. o.WIRE_TYPES.LDELIM = 2,
  32202. o.WIRE_TYPES.STARTGROUP = 3,
  32203. o.WIRE_TYPES.ENDGROUP = 4,
  32204. o.WIRE_TYPES.BITS32 = 5,
  32205. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32206. o.TYPES = {
  32207. int32: {
  32208. name: "int32",
  32209. wireType: o.WIRE_TYPES.VARINT,
  32210. defaultValue: 0
  32211. },
  32212. uint32: {
  32213. name: "uint32",
  32214. wireType: o.WIRE_TYPES.VARINT,
  32215. defaultValue: 0
  32216. },
  32217. sint32: {
  32218. name: "sint32",
  32219. wireType: o.WIRE_TYPES.VARINT,
  32220. defaultValue: 0
  32221. },
  32222. int64: {
  32223. name: "int64",
  32224. wireType: o.WIRE_TYPES.VARINT,
  32225. defaultValue: o.Long ? o.Long.ZERO : void 0
  32226. },
  32227. uint64: {
  32228. name: "uint64",
  32229. wireType: o.WIRE_TYPES.VARINT,
  32230. defaultValue: o.Long ? o.Long.UZERO : void 0
  32231. },
  32232. sint64: {
  32233. name: "sint64",
  32234. wireType: o.WIRE_TYPES.VARINT,
  32235. defaultValue: o.Long ? o.Long.ZERO : void 0
  32236. },
  32237. bool: {
  32238. name: "bool",
  32239. wireType: o.WIRE_TYPES.VARINT,
  32240. defaultValue: !1
  32241. },
  32242. double: {
  32243. name: "double",
  32244. wireType: o.WIRE_TYPES.BITS64,
  32245. defaultValue: 0
  32246. },
  32247. string: {
  32248. name: "string",
  32249. wireType: o.WIRE_TYPES.LDELIM,
  32250. defaultValue: ""
  32251. },
  32252. bytes: {
  32253. name: "bytes",
  32254. wireType: o.WIRE_TYPES.LDELIM,
  32255. defaultValue: null
  32256. },
  32257. fixed32: {
  32258. name: "fixed32",
  32259. wireType: o.WIRE_TYPES.BITS32,
  32260. defaultValue: 0
  32261. },
  32262. sfixed32: {
  32263. name: "sfixed32",
  32264. wireType: o.WIRE_TYPES.BITS32,
  32265. defaultValue: 0
  32266. },
  32267. fixed64: {
  32268. name: "fixed64",
  32269. wireType: o.WIRE_TYPES.BITS64,
  32270. defaultValue: o.Long ? o.Long.UZERO : void 0
  32271. },
  32272. sfixed64: {
  32273. name: "sfixed64",
  32274. wireType: o.WIRE_TYPES.BITS64,
  32275. defaultValue: o.Long ? o.Long.ZERO : void 0
  32276. },
  32277. float: {
  32278. name: "float",
  32279. wireType: o.WIRE_TYPES.BITS32,
  32280. defaultValue: 0
  32281. },
  32282. enum: {
  32283. name: "enum",
  32284. wireType: o.WIRE_TYPES.VARINT,
  32285. defaultValue: 0
  32286. },
  32287. message: {
  32288. name: "message",
  32289. wireType: o.WIRE_TYPES.LDELIM,
  32290. defaultValue: null
  32291. },
  32292. group: {
  32293. name: "group",
  32294. wireType: o.WIRE_TYPES.STARTGROUP,
  32295. defaultValue: null
  32296. }
  32297. },
  32298. 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],
  32299. o.ID_MIN = 1,
  32300. o.ID_MAX = 536870911,
  32301. o.convertFieldsToCamelCase = !1,
  32302. o.populateAccessors = !0,
  32303. o.populateDefaults = !0,
  32304. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32305. r.XHR = function() {
  32306. for (var e = [function() {
  32307. return new XMLHttpRequest
  32308. }
  32309. , function() {
  32310. return new ActiveXObject("Msxml2.XMLHTTP")
  32311. }
  32312. , function() {
  32313. return new ActiveXObject("Msxml3.XMLHTTP")
  32314. }
  32315. , function() {
  32316. return new ActiveXObject("Microsoft.XMLHTTP")
  32317. }
  32318. ], t = null, i = 0; i < e.length; i++) {
  32319. try {
  32320. t = e[i]()
  32321. } catch (e) {
  32322. continue
  32323. }
  32324. break
  32325. }
  32326. if (!t)
  32327. throw Error("XMLHttpRequest is not supported");
  32328. return t
  32329. }
  32330. ,
  32331. r.fetch = function(e, i) {
  32332. if (i && "function" != typeof i && (i = null),
  32333. r.IS_NODE) {
  32334. var t = p("fs");
  32335. if (i)
  32336. t.readFile(e, function(e, t) {
  32337. i(e ? null : "" + t)
  32338. });
  32339. else
  32340. try {
  32341. return t.readFileSync(e)
  32342. } catch (e) {
  32343. return null
  32344. }
  32345. } else {
  32346. var n = r.XHR();
  32347. if (n.open("GET", e, !!i),
  32348. n.setRequestHeader("Accept", "text/plain"),
  32349. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32350. !i)
  32351. return n.send(null),
  32352. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32353. if (n.onreadystatechange = function() {
  32354. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32355. }
  32356. ,
  32357. 4 == n.readyState)
  32358. return;
  32359. n.send(null)
  32360. }
  32361. }
  32362. ,
  32363. r.toCamelCase = function(e) {
  32364. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32365. return t.toUpperCase()
  32366. })
  32367. }
  32368. ,
  32369. r),
  32370. o.Lang = {
  32371. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32372. RULE: /^(?:required|optional|repeated|map)$/,
  32373. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32374. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32375. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32376. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32377. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32378. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32379. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32380. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32381. NUMBER_OCT: /^0[0-7]+$/,
  32382. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32383. BOOL: /^(?:true|false)$/i,
  32384. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32385. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32386. WHITESPACE: /\s/,
  32387. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32388. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32389. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32390. },
  32391. o.DotProto = function(r, a) {
  32392. function s(e, t) {
  32393. var i = -1
  32394. , n = 1;
  32395. if ("-" == e.charAt(0) && (n = -1,
  32396. e = e.substring(1)),
  32397. a.NUMBER_DEC.test(e))
  32398. i = parseInt(e);
  32399. else if (a.NUMBER_HEX.test(e))
  32400. i = parseInt(e.substring(2), 16);
  32401. else {
  32402. if (!a.NUMBER_OCT.test(e))
  32403. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32404. i = parseInt(e.substring(1), 8)
  32405. }
  32406. if (i = n * i | 0,
  32407. !t && i < 0)
  32408. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32409. return i
  32410. }
  32411. function o(e) {
  32412. var t = 1;
  32413. if ("-" == e.charAt(0) && (t = -1,
  32414. e = e.substring(1)),
  32415. a.NUMBER_DEC.test(e))
  32416. return t * parseInt(e, 10);
  32417. if (a.NUMBER_HEX.test(e))
  32418. return t * parseInt(e.substring(2), 16);
  32419. if (a.NUMBER_OCT.test(e))
  32420. return t * parseInt(e.substring(1), 8);
  32421. if ("inf" === e)
  32422. return t * (1 / 0);
  32423. if ("nan" === e)
  32424. return NaN;
  32425. if (a.NUMBER_FLT.test(e))
  32426. return t * parseFloat(e);
  32427. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32428. }
  32429. function n(e, t, i) {
  32430. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32431. e[t].push(i))
  32432. }
  32433. function t(e) {
  32434. this.source = e + "",
  32435. this.index = 0,
  32436. this.line = 1,
  32437. this.stack = [],
  32438. this._stringOpen = null
  32439. }
  32440. var e = {}
  32441. , i = t.prototype;
  32442. i._readString = function() {
  32443. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32444. e.lastIndex = this.index - 1;
  32445. var t = e.exec(this.source);
  32446. if (!t)
  32447. throw Error("unterminated string");
  32448. return this.index = e.lastIndex,
  32449. this.stack.push(this._stringOpen),
  32450. this._stringOpen = null,
  32451. t[1]
  32452. }
  32453. ,
  32454. i.next = function() {
  32455. if (0 < this.stack.length)
  32456. return this.stack.shift();
  32457. if (this.index >= this.source.length)
  32458. return null;
  32459. if (null !== this._stringOpen)
  32460. return this._readString();
  32461. var e, t, i;
  32462. do {
  32463. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32464. if ("\n" === i && ++this.line,
  32465. ++this.index === this.source.length)
  32466. return null;
  32467. if ("/" === this.source.charAt(this.index))
  32468. if (++this.index,
  32469. "/" === this.source.charAt(this.index)) {
  32470. for (; "\n" !== this.source.charAt(++this.index); )
  32471. if (this.index == this.source.length)
  32472. return null;
  32473. ++this.index,
  32474. ++this.line,
  32475. e = !0
  32476. } else {
  32477. if ("*" !== (i = this.source.charAt(this.index)))
  32478. return "/";
  32479. do {
  32480. if ("\n" === i && ++this.line,
  32481. ++this.index === this.source.length)
  32482. return null;
  32483. t = i,
  32484. i = this.source.charAt(this.index)
  32485. } while ("*" !== t || "/" !== i);++this.index,
  32486. e = !0
  32487. }
  32488. } while (e);if (this.index === this.source.length)
  32489. return null;
  32490. var n = this.index;
  32491. if (a.DELIM.lastIndex = 0,
  32492. !a.DELIM.test(this.source.charAt(n++)))
  32493. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32494. ++n;
  32495. var r = this.source.substring(this.index, this.index = n);
  32496. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32497. r
  32498. }
  32499. ,
  32500. i.peek = function() {
  32501. if (0 === this.stack.length) {
  32502. var e = this.next();
  32503. if (null === e)
  32504. return null;
  32505. this.stack.push(e)
  32506. }
  32507. return this.stack[0]
  32508. }
  32509. ,
  32510. i.skip = function(e) {
  32511. var t = this.next();
  32512. if (t !== e)
  32513. throw Error("illegal '" + t + "', '" + e + "' expected")
  32514. }
  32515. ,
  32516. i.omit = function(e) {
  32517. return this.peek() === e && (this.next(),
  32518. !0)
  32519. }
  32520. ,
  32521. i.toString = function() {
  32522. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32523. }
  32524. ,
  32525. e.Tokenizer = t;
  32526. function l(e) {
  32527. this.tn = new t(e),
  32528. this.proto3 = !1
  32529. }
  32530. var c = l.prototype;
  32531. return c.parse = function() {
  32532. var e, t, i = {
  32533. name: "[ROOT]",
  32534. package: null,
  32535. messages: [],
  32536. enums: [],
  32537. imports: [],
  32538. options: {},
  32539. services: []
  32540. }, n = !0;
  32541. try {
  32542. for (; e = this.tn.next(); )
  32543. switch (e) {
  32544. case "package":
  32545. if (!n || null !== i.package)
  32546. throw Error("unexpected 'package'");
  32547. if (e = this.tn.next(),
  32548. !a.TYPEREF.test(e))
  32549. throw Error("illegal package name: " + e);
  32550. this.tn.skip(";"),
  32551. i.package = e;
  32552. break;
  32553. case "import":
  32554. if (!n)
  32555. throw Error("unexpected 'import'");
  32556. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32557. e = this._readString(),
  32558. this.tn.skip(";"),
  32559. t || i.imports.push(e);
  32560. break;
  32561. case "syntax":
  32562. if (!n)
  32563. throw Error("unexpected 'syntax'");
  32564. this.tn.skip("="),
  32565. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32566. this.tn.skip(";");
  32567. break;
  32568. case "message":
  32569. this._parseMessage(i, null),
  32570. n = !1;
  32571. break;
  32572. case "enum":
  32573. this._parseEnum(i),
  32574. n = !1;
  32575. break;
  32576. case "option":
  32577. this._parseOption(i);
  32578. break;
  32579. case "service":
  32580. this._parseService(i);
  32581. break;
  32582. case "extend":
  32583. this._parseExtend(i);
  32584. break;
  32585. default:
  32586. throw Error("unexpected '" + e + "'")
  32587. }
  32588. } catch (e) {
  32589. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32590. e
  32591. }
  32592. return delete i.name,
  32593. i
  32594. }
  32595. ,
  32596. l.parse = function(e) {
  32597. return new l(e).parse()
  32598. }
  32599. ,
  32600. c._readString = function() {
  32601. var e, t, i = "";
  32602. do {
  32603. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32604. throw Error("illegal string delimiter: " + t);
  32605. i += this.tn.next(),
  32606. this.tn.skip(t),
  32607. e = this.tn.peek()
  32608. } while ('"' === e || '"' === e);return i
  32609. }
  32610. ,
  32611. c._readValue = function(e) {
  32612. var t = this.tn.peek();
  32613. if ('"' === t || "'" === t)
  32614. return this._readString();
  32615. if (this.tn.next(),
  32616. a.NUMBER.test(t))
  32617. return o(t);
  32618. if (a.BOOL.test(t))
  32619. return "true" === t.toLowerCase();
  32620. if (e && a.TYPEREF.test(t))
  32621. return t;
  32622. throw Error("illegal value: " + t)
  32623. }
  32624. ,
  32625. c._parseOption = function(e, t) {
  32626. var i = this.tn.next()
  32627. , n = !1;
  32628. if ("(" === i && (n = !0,
  32629. i = this.tn.next()),
  32630. !a.TYPEREF.test(i))
  32631. throw Error("illegal option name: " + i);
  32632. var r = i;
  32633. n && (this.tn.skip(")"),
  32634. r = "(" + r + ")",
  32635. i = this.tn.peek(),
  32636. a.FQTYPEREF.test(i) && (r += i,
  32637. this.tn.next())),
  32638. this.tn.skip("="),
  32639. this._parseOptionValue(e, r),
  32640. t || this.tn.skip(";")
  32641. }
  32642. ,
  32643. c._parseOptionValue = function(e, t) {
  32644. var i = this.tn.peek();
  32645. if ("{" !== i)
  32646. n(e.options, t, this._readValue(!0));
  32647. else
  32648. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32649. if (!a.NAME.test(i))
  32650. throw Error("illegal option name: " + t + "." + i);
  32651. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32652. }
  32653. }
  32654. ,
  32655. c._parseService = function(e) {
  32656. var t = this.tn.next();
  32657. if (!a.NAME.test(t))
  32658. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32659. var i = {
  32660. name: t,
  32661. rpc: {},
  32662. options: {}
  32663. };
  32664. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32665. if ("option" === t)
  32666. this._parseOption(i);
  32667. else {
  32668. if ("rpc" !== t)
  32669. throw Error("illegal service token: " + t);
  32670. this._parseServiceRPC(i)
  32671. }
  32672. this.tn.omit(";"),
  32673. e.services.push(i)
  32674. }
  32675. ,
  32676. c._parseServiceRPC = function(e) {
  32677. var t = this.tn.next();
  32678. if (!a.NAME.test(t))
  32679. throw Error("illegal rpc service method name: " + t);
  32680. var i = t
  32681. , n = {
  32682. request: null,
  32683. response: null,
  32684. request_stream: !1,
  32685. response_stream: !1,
  32686. options: {}
  32687. };
  32688. if (this.tn.skip("("),
  32689. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32690. t = this.tn.next()),
  32691. !a.TYPEREF.test(t))
  32692. throw Error("illegal rpc service request type: " + t);
  32693. if (n.request = t,
  32694. this.tn.skip(")"),
  32695. "returns" !== (t = this.tn.next()).toLowerCase())
  32696. throw Error("illegal rpc service request type delimiter: " + t);
  32697. if (this.tn.skip("("),
  32698. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32699. t = this.tn.next()),
  32700. n.response = t,
  32701. this.tn.skip(")"),
  32702. "{" === (t = this.tn.peek())) {
  32703. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32704. if ("option" !== t)
  32705. throw Error("illegal rpc service token: " + t);
  32706. this._parseOption(n)
  32707. }
  32708. this.tn.omit(";")
  32709. } else
  32710. this.tn.skip(";");
  32711. void 0 === e.rpc && (e.rpc = {}),
  32712. e.rpc[i] = n
  32713. }
  32714. ,
  32715. c._parseMessage = function(e, t) {
  32716. var i = !!t
  32717. , n = this.tn.next()
  32718. , r = {
  32719. name: "",
  32720. fields: [],
  32721. enums: [],
  32722. messages: [],
  32723. options: {},
  32724. services: [],
  32725. oneofs: {}
  32726. };
  32727. if (!a.NAME.test(n))
  32728. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32729. for (r.name = n,
  32730. i && (this.tn.skip("="),
  32731. t.id = s(this.tn.next()),
  32732. r.isGroup = !0),
  32733. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32734. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32735. if (a.RULE.test(n))
  32736. this._parseMessageField(r, n);
  32737. else if ("oneof" === n)
  32738. this._parseMessageOneOf(r);
  32739. else if ("enum" === n)
  32740. this._parseEnum(r);
  32741. else if ("message" === n)
  32742. this._parseMessage(r);
  32743. else if ("option" === n)
  32744. this._parseOption(r);
  32745. else if ("service" === n)
  32746. this._parseService(r);
  32747. else if ("extensions" === n)
  32748. r.extensions = this._parseExtensionRanges();
  32749. else if ("reserved" === n)
  32750. this._parseIgnored();
  32751. else if ("extend" === n)
  32752. this._parseExtend(r);
  32753. else {
  32754. if (!a.TYPEREF.test(n))
  32755. throw Error("illegal message token: " + n);
  32756. if (!this.proto3)
  32757. throw Error("illegal field rule: " + n);
  32758. this._parseMessageField(r, "optional", n)
  32759. }
  32760. return this.tn.omit(";"),
  32761. e.messages.push(r),
  32762. r
  32763. }
  32764. ,
  32765. c._parseIgnored = function() {
  32766. for (; ";" !== this.tn.peek(); )
  32767. this.tn.next();
  32768. this.tn.skip(";")
  32769. }
  32770. ,
  32771. c._parseMessageField = function(e, t, i) {
  32772. if (!a.RULE.test(t))
  32773. throw Error("illegal message field rule: " + t);
  32774. var n, r = {
  32775. rule: t,
  32776. type: "",
  32777. name: "",
  32778. options: {},
  32779. id: 0
  32780. };
  32781. if ("map" === t) {
  32782. if (i)
  32783. throw Error("illegal type: " + i);
  32784. if (this.tn.skip("<"),
  32785. n = this.tn.next(),
  32786. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32787. throw Error("illegal message field type: " + n);
  32788. if (r.keytype = n,
  32789. this.tn.skip(","),
  32790. n = this.tn.next(),
  32791. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32792. throw Error("illegal message field: " + n);
  32793. if (r.type = n,
  32794. this.tn.skip(">"),
  32795. n = this.tn.next(),
  32796. !a.NAME.test(n))
  32797. throw Error("illegal message field name: " + n);
  32798. r.name = n,
  32799. this.tn.skip("="),
  32800. r.id = s(this.tn.next()),
  32801. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32802. this.tn.skip(";")
  32803. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32804. var o = this._parseMessage(e, r);
  32805. if (!/^[A-Z]/.test(o.name))
  32806. throw Error("illegal group name: " + o.name);
  32807. r.type = o.name,
  32808. r.name = o.name.toLowerCase(),
  32809. this.tn.omit(";")
  32810. } else {
  32811. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32812. throw Error("illegal message field type: " + i);
  32813. if (r.type = i,
  32814. n = this.tn.next(),
  32815. !a.NAME.test(n))
  32816. throw Error("illegal message field name: " + n);
  32817. r.name = n,
  32818. this.tn.skip("="),
  32819. r.id = s(this.tn.next()),
  32820. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32821. this.tn.skip(";")
  32822. }
  32823. return e.fields.push(r),
  32824. r
  32825. }
  32826. ,
  32827. c._parseMessageOneOf = function(e) {
  32828. var t = this.tn.next();
  32829. if (!a.NAME.test(t))
  32830. throw Error("illegal oneof name: " + t);
  32831. var i, n = t, r = [];
  32832. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32833. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32834. r.push(i.id);
  32835. this.tn.omit(";"),
  32836. e.oneofs[n] = r
  32837. }
  32838. ,
  32839. c._parseFieldOptions = function(e) {
  32840. this.tn.skip("[");
  32841. for (var t = !0; "]" !== this.tn.peek(); )
  32842. t || this.tn.skip(","),
  32843. this._parseOption(e, !0),
  32844. t = !1;
  32845. this.tn.next()
  32846. }
  32847. ,
  32848. c._parseEnum = function(e) {
  32849. var t = {
  32850. name: "",
  32851. values: [],
  32852. options: {}
  32853. }
  32854. , i = this.tn.next();
  32855. if (!a.NAME.test(i))
  32856. throw Error("illegal name: " + i);
  32857. for (t.name = i,
  32858. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32859. if ("option" === i)
  32860. this._parseOption(t);
  32861. else {
  32862. if (!a.NAME.test(i))
  32863. throw Error("illegal name: " + i);
  32864. this.tn.skip("=");
  32865. var n = {
  32866. name: i,
  32867. id: s(this.tn.next(), !0)
  32868. };
  32869. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32870. options: {}
  32871. }),
  32872. this.tn.skip(";"),
  32873. t.values.push(n)
  32874. }
  32875. this.tn.omit(";"),
  32876. e.enums.push(t)
  32877. }
  32878. ,
  32879. c._parseExtensionRanges = function() {
  32880. var e, t, i, n = [];
  32881. do {
  32882. for (t = []; ; ) {
  32883. switch (e = this.tn.next()) {
  32884. case "min":
  32885. i = r.ID_MIN;
  32886. break;
  32887. case "max":
  32888. i = r.ID_MAX;
  32889. break;
  32890. default:
  32891. i = o(e)
  32892. }
  32893. if (t.push(i),
  32894. 2 === t.length)
  32895. break;
  32896. if ("to" !== this.tn.peek()) {
  32897. t.push(i);
  32898. break
  32899. }
  32900. this.tn.next()
  32901. }
  32902. n.push(t)
  32903. } while (this.tn.omit(","));return this.tn.skip(";"),
  32904. n
  32905. }
  32906. ,
  32907. c._parseExtend = function(e) {
  32908. var t = this.tn.next();
  32909. if (!a.TYPEREF.test(t))
  32910. throw Error("illegal extend reference: " + t);
  32911. var i = {
  32912. ref: t,
  32913. fields: []
  32914. };
  32915. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32916. if (a.RULE.test(t))
  32917. this._parseMessageField(i, t);
  32918. else {
  32919. if (!a.TYPEREF.test(t))
  32920. throw Error("illegal extend token: " + t);
  32921. if (!this.proto3)
  32922. throw Error("illegal field rule: " + t);
  32923. this._parseMessageField(i, "optional", t)
  32924. }
  32925. return this.tn.omit(";"),
  32926. e.messages.push(i),
  32927. i
  32928. }
  32929. ,
  32930. c.toString = function() {
  32931. return "Parser at line " + this.tn.line
  32932. }
  32933. ,
  32934. e.Parser = l,
  32935. e
  32936. }(o, o.Lang),
  32937. o.Reflect = function(g) {
  32938. function a(e, t) {
  32939. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32940. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32941. if ("string" == typeof e)
  32942. return g.Long.fromString(e, t || !1, 10);
  32943. if ("number" == typeof e)
  32944. return g.Long.fromNumber(e, t || !1);
  32945. throw Error("not convertible to Long")
  32946. }
  32947. function m(e, t) {
  32948. var i = t.readVarint32()
  32949. , n = 7 & i
  32950. , r = i >>> 3;
  32951. switch (n) {
  32952. case g.WIRE_TYPES.VARINT:
  32953. for (; 128 == (128 & (i = t.readUint8())); )
  32954. ;
  32955. break;
  32956. case g.WIRE_TYPES.BITS64:
  32957. t.offset += 8;
  32958. break;
  32959. case g.WIRE_TYPES.LDELIM:
  32960. i = t.readVarint32(),
  32961. t.offset += i;
  32962. break;
  32963. case g.WIRE_TYPES.STARTGROUP:
  32964. m(r, t);
  32965. break;
  32966. case g.WIRE_TYPES.ENDGROUP:
  32967. if (r === e)
  32968. return !1;
  32969. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32970. case g.WIRE_TYPES.BITS32:
  32971. t.offset += 4;
  32972. break;
  32973. default:
  32974. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32975. }
  32976. return !0
  32977. }
  32978. function h(e, t, i) {
  32979. this.builder = e,
  32980. this.parent = t,
  32981. this.name = i,
  32982. this.className
  32983. }
  32984. var s = {}
  32985. , e = h.prototype;
  32986. e.fqn = function() {
  32987. for (var e = this.name, t = this; null != (t = t.parent); )
  32988. e = t.name + "." + e;
  32989. return e
  32990. }
  32991. ,
  32992. e.toString = function(e) {
  32993. return (e ? this.className + " " : "") + this.fqn()
  32994. }
  32995. ,
  32996. e.build = function() {
  32997. throw Error(this.toString(!0) + " cannot be built directly")
  32998. }
  32999. ,
  33000. s.T = h;
  33001. function l(e, t, i, n, r) {
  33002. h.call(this, e, t, i),
  33003. this.className = "Namespace",
  33004. this.children = [],
  33005. this.options = n || {},
  33006. this.syntax = r || "proto2"
  33007. }
  33008. var t = l.prototype = Object.create(h.prototype);
  33009. t.getChildren = function(e) {
  33010. if (null == (e = e || null))
  33011. return this.children.slice();
  33012. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33013. this.children[i]instanceof e && t.push(this.children[i]);
  33014. return t
  33015. }
  33016. ,
  33017. t.addChild = function(e) {
  33018. var t;
  33019. if (t = this.getChild(e.name))
  33020. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33021. t.name = t.originalName;
  33022. else {
  33023. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33024. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33025. e.name = e.originalName
  33026. }
  33027. this.children.push(e)
  33028. }
  33029. ,
  33030. t.getChild = function(e) {
  33031. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33032. if (this.children[i][t] === e)
  33033. return this.children[i];
  33034. return null
  33035. }
  33036. ,
  33037. t.resolve = function(e, t) {
  33038. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  33039. if ("" === n[o]) {
  33040. for (; null !== r.parent; )
  33041. r = r.parent;
  33042. o++
  33043. }
  33044. do {
  33045. do {
  33046. if (!(r instanceof s.Namespace)) {
  33047. r = null;
  33048. break
  33049. }
  33050. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33051. r = null;
  33052. break
  33053. }
  33054. r = i,
  33055. o++
  33056. } while (o < n.length);if (null != r)
  33057. break;
  33058. if (null !== this.parent)
  33059. return this.parent.resolve(e, t)
  33060. } while (null != r);return r
  33061. }
  33062. ,
  33063. t.qn = function(e) {
  33064. for (var t = [], i = e; t.unshift(i.name),
  33065. null !== (i = i.parent); )
  33066. ;
  33067. for (var n = 1; n <= t.length; n++) {
  33068. var r = t.slice(t.length - n);
  33069. if (e === this.resolve(r, e instanceof s.Namespace))
  33070. return r.join(".")
  33071. }
  33072. return e.fqn()
  33073. }
  33074. ,
  33075. t.build = function() {
  33076. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33077. (e = i[n])instanceof l && (t[e.name] = e.build());
  33078. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33079. value: this.buildOpt()
  33080. }),
  33081. t
  33082. }
  33083. ,
  33084. t.buildOpt = function() {
  33085. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33086. var r = t[i]
  33087. , o = this.options[t[i]];
  33088. e[r] = o
  33089. }
  33090. return e
  33091. }
  33092. ,
  33093. t.getOption = function(e) {
  33094. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33095. }
  33096. ,
  33097. s.Namespace = l;
  33098. function u(e, t, i, n) {
  33099. if (this.type = e,
  33100. this.resolvedType = t,
  33101. this.isMapKey = i,
  33102. this.syntax = n,
  33103. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33104. throw Error("Invalid map key type: " + e.name)
  33105. }
  33106. var i = u.prototype;
  33107. u.defaultFieldValue = function(e) {
  33108. if ("string" == typeof e && (e = g.TYPES[e]),
  33109. void 0 === e.defaultValue)
  33110. throw Error("default value for type " + e.name + " is not supported");
  33111. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33112. }
  33113. ,
  33114. i.verifyValue = function(t) {
  33115. function i(e, t) {
  33116. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33117. }
  33118. var n = this;
  33119. switch (this.type) {
  33120. case g.TYPES.int32:
  33121. case g.TYPES.sint32:
  33122. case g.TYPES.sfixed32:
  33123. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33124. 4294967295 < t ? 0 | t : t;
  33125. case g.TYPES.uint32:
  33126. case g.TYPES.fixed32:
  33127. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33128. t < 0 ? t >>> 0 : t;
  33129. case g.TYPES.int64:
  33130. case g.TYPES.sint64:
  33131. case g.TYPES.sfixed64:
  33132. if (g.Long)
  33133. try {
  33134. return a(t, !1)
  33135. } catch (e) {
  33136. i(typeof t, e.message)
  33137. }
  33138. else
  33139. i(typeof t, "requires Long.js");
  33140. case g.TYPES.uint64:
  33141. case g.TYPES.fixed64:
  33142. if (g.Long)
  33143. try {
  33144. return a(t, !0)
  33145. } catch (e) {
  33146. i(typeof t, e.message)
  33147. }
  33148. else
  33149. i(typeof t, "requires Long.js");
  33150. case g.TYPES.bool:
  33151. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33152. t;
  33153. case g.TYPES.float:
  33154. case g.TYPES.double:
  33155. return "number" != typeof t && i(typeof t, "not a number"),
  33156. t;
  33157. case g.TYPES.string:
  33158. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33159. "" + t;
  33160. case g.TYPES.bytes:
  33161. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33162. case g.TYPES.enum:
  33163. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33164. for (o = 0; o < e.length; o++) {
  33165. if (e[o].name == t)
  33166. return e[o].id;
  33167. if (e[o].id == t)
  33168. return e[o].id
  33169. }
  33170. if ("proto3" === this.syntax)
  33171. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33172. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33173. t;
  33174. i(t, "not a valid enum value");
  33175. case g.TYPES.group:
  33176. case g.TYPES.message:
  33177. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33178. t instanceof this.resolvedType.clazz)
  33179. return t;
  33180. if (t instanceof g.Builder.Message) {
  33181. var r = {};
  33182. for (var o in t)
  33183. t.hasOwnProperty(o) && (r[o] = t[o]);
  33184. t = r
  33185. }
  33186. return new this.resolvedType.clazz(t)
  33187. }
  33188. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33189. }
  33190. ,
  33191. i.calculateLength = function(e, t) {
  33192. if (null === t)
  33193. return 0;
  33194. var i;
  33195. switch (this.type) {
  33196. case g.TYPES.int32:
  33197. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33198. case g.TYPES.uint32:
  33199. return I.calculateVarint32(t);
  33200. case g.TYPES.sint32:
  33201. return I.calculateVarint32(I.zigZagEncode32(t));
  33202. case g.TYPES.fixed32:
  33203. case g.TYPES.sfixed32:
  33204. case g.TYPES.float:
  33205. return 4;
  33206. case g.TYPES.int64:
  33207. case g.TYPES.uint64:
  33208. return I.calculateVarint64(t);
  33209. case g.TYPES.sint64:
  33210. return I.calculateVarint64(I.zigZagEncode64(t));
  33211. case g.TYPES.fixed64:
  33212. case g.TYPES.sfixed64:
  33213. return 8;
  33214. case g.TYPES.bool:
  33215. return 1;
  33216. case g.TYPES.enum:
  33217. return I.calculateVarint32(t);
  33218. case g.TYPES.double:
  33219. return 8;
  33220. case g.TYPES.string:
  33221. return i = I.calculateUTF8Bytes(t),
  33222. I.calculateVarint32(i) + i;
  33223. case g.TYPES.bytes:
  33224. if (t.remaining() < 0)
  33225. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33226. return I.calculateVarint32(t.remaining()) + t.remaining();
  33227. case g.TYPES.message:
  33228. return i = this.resolvedType.calculate(t),
  33229. I.calculateVarint32(i) + i;
  33230. case g.TYPES.group:
  33231. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33232. }
  33233. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33234. }
  33235. ,
  33236. i.encodeValue = function(e, t, i) {
  33237. if (null === t)
  33238. return i;
  33239. switch (this.type) {
  33240. case g.TYPES.int32:
  33241. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33242. break;
  33243. case g.TYPES.uint32:
  33244. i.writeVarint32(t);
  33245. break;
  33246. case g.TYPES.sint32:
  33247. i.writeVarint32ZigZag(t);
  33248. break;
  33249. case g.TYPES.fixed32:
  33250. i.writeUint32(t);
  33251. break;
  33252. case g.TYPES.sfixed32:
  33253. i.writeInt32(t);
  33254. break;
  33255. case g.TYPES.int64:
  33256. case g.TYPES.uint64:
  33257. i.writeVarint64(t);
  33258. break;
  33259. case g.TYPES.sint64:
  33260. i.writeVarint64ZigZag(t);
  33261. break;
  33262. case g.TYPES.fixed64:
  33263. i.writeUint64(t);
  33264. break;
  33265. case g.TYPES.sfixed64:
  33266. i.writeInt64(t);
  33267. break;
  33268. case g.TYPES.bool:
  33269. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33270. break;
  33271. case g.TYPES.enum:
  33272. i.writeVarint32(t);
  33273. break;
  33274. case g.TYPES.float:
  33275. i.writeFloat32(t);
  33276. break;
  33277. case g.TYPES.double:
  33278. i.writeFloat64(t);
  33279. break;
  33280. case g.TYPES.string:
  33281. i.writeVString(t);
  33282. break;
  33283. case g.TYPES.bytes:
  33284. if (t.remaining() < 0)
  33285. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33286. var n = t.offset;
  33287. i.writeVarint32(t.remaining()),
  33288. i.append(t),
  33289. t.offset = n;
  33290. break;
  33291. case g.TYPES.message:
  33292. var r = (new I).LE();
  33293. this.resolvedType.encode(t, r),
  33294. i.writeVarint32(r.offset),
  33295. i.append(r.flip());
  33296. break;
  33297. case g.TYPES.group:
  33298. this.resolvedType.encode(t, i),
  33299. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33300. break;
  33301. default:
  33302. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33303. }
  33304. return i
  33305. }
  33306. ,
  33307. i.decode = function(e, t, i) {
  33308. if (t != this.type.wireType)
  33309. throw Error("Unexpected wire type for element");
  33310. var n, r;
  33311. switch (this.type) {
  33312. case g.TYPES.int32:
  33313. return 0 | e.readVarint32();
  33314. case g.TYPES.uint32:
  33315. return e.readVarint32() >>> 0;
  33316. case g.TYPES.sint32:
  33317. return 0 | e.readVarint32ZigZag();
  33318. case g.TYPES.fixed32:
  33319. return e.readUint32() >>> 0;
  33320. case g.TYPES.sfixed32:
  33321. return 0 | e.readInt32();
  33322. case g.TYPES.int64:
  33323. return e.readVarint64();
  33324. case g.TYPES.uint64:
  33325. return e.readVarint64().toUnsigned();
  33326. case g.TYPES.sint64:
  33327. return e.readVarint64ZigZag();
  33328. case g.TYPES.fixed64:
  33329. return e.readUint64();
  33330. case g.TYPES.sfixed64:
  33331. return e.readInt64();
  33332. case g.TYPES.bool:
  33333. return !!e.readVarint32();
  33334. case g.TYPES.enum:
  33335. return e.readVarint32();
  33336. case g.TYPES.float:
  33337. return e.readFloat();
  33338. case g.TYPES.double:
  33339. return e.readDouble();
  33340. case g.TYPES.string:
  33341. return e.readVString();
  33342. case g.TYPES.bytes:
  33343. if (r = e.readVarint32(),
  33344. e.remaining() < r)
  33345. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33346. return (n = e.clone()).limit = n.offset + r,
  33347. e.offset += r,
  33348. n;
  33349. case g.TYPES.message:
  33350. return r = e.readVarint32(),
  33351. this.resolvedType.decode(e, r);
  33352. case g.TYPES.group:
  33353. return this.resolvedType.decode(e, -1, i)
  33354. }
  33355. throw Error("[INTERNAL] Illegal decode type")
  33356. }
  33357. ,
  33358. i.valueFromString = function(e) {
  33359. if (!this.isMapKey)
  33360. throw Error("valueFromString() called on non-map-key element");
  33361. switch (this.type) {
  33362. case g.TYPES.int32:
  33363. case g.TYPES.sint32:
  33364. case g.TYPES.sfixed32:
  33365. case g.TYPES.uint32:
  33366. case g.TYPES.fixed32:
  33367. return this.verifyValue(parseInt(e));
  33368. case g.TYPES.int64:
  33369. case g.TYPES.sint64:
  33370. case g.TYPES.sfixed64:
  33371. case g.TYPES.uint64:
  33372. case g.TYPES.fixed64:
  33373. return this.verifyValue(e);
  33374. case g.TYPES.bool:
  33375. return "true" === e;
  33376. case g.TYPES.string:
  33377. return this.verifyValue(e);
  33378. case g.TYPES.bytes:
  33379. return I.fromBinary(e)
  33380. }
  33381. }
  33382. ,
  33383. i.valueToString = function(e) {
  33384. if (!this.isMapKey)
  33385. throw Error("valueToString() called on non-map-key element");
  33386. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33387. }
  33388. ,
  33389. s.Element = u;
  33390. var d = function(e, t, i, n, r, o) {
  33391. l.call(this, e, t, i, n, o),
  33392. this.className = "Message",
  33393. this.extensions = void 0,
  33394. this.clazz = null,
  33395. this.isGroup = !!r,
  33396. this._fields = null,
  33397. this._fieldsById = null,
  33398. this._fieldsByName = null
  33399. }
  33400. , n = d.prototype = Object.create(l.prototype);
  33401. n.build = function(e) {
  33402. if (this.clazz && !e)
  33403. return this.clazz;
  33404. var t = function(u, a) {
  33405. function d(e, i, n, r) {
  33406. if (null === e || "object" != typeof e) {
  33407. if (r && r instanceof u.Reflect.Enum) {
  33408. var t = u.Reflect.Enum.getName(r.object, e);
  33409. if (null !== t)
  33410. return t
  33411. }
  33412. return e
  33413. }
  33414. if (I.isByteBuffer(e))
  33415. return i ? e.toBase64() : e.toBuffer();
  33416. if (u.Long.isLong(e))
  33417. return n ? e.toString() : u.Long.fromValue(e);
  33418. var o;
  33419. if (Array.isArray(e))
  33420. return o = [],
  33421. e.forEach(function(e, t) {
  33422. o[t] = d(e, i, n, r)
  33423. }),
  33424. o;
  33425. if (o = {},
  33426. e instanceof u.Map) {
  33427. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33428. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33429. return o
  33430. }
  33431. var l = e.$type
  33432. , c = void 0;
  33433. for (var h in e)
  33434. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33435. return o
  33436. }
  33437. var s = a.getChildren(u.Reflect.Message.Field)
  33438. , l = a.getChildren(u.Reflect.Message.OneOf)
  33439. , c = function(e, t) {
  33440. u.Builder.Message.call(this);
  33441. for (var i = 0, n = l.length; i < n; ++i)
  33442. this[l[i].name] = null;
  33443. for (i = 0,
  33444. n = s.length; i < n; ++i) {
  33445. var r = s[i];
  33446. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33447. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33448. }
  33449. var o;
  33450. if (0 < arguments.length)
  33451. 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)
  33452. for (i = 0,
  33453. n = arguments.length; i < n; ++i)
  33454. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33455. else
  33456. this.$set(e)
  33457. }
  33458. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33459. o.add = function(e, t, i) {
  33460. var n = a._fieldsByName[e];
  33461. if (!i) {
  33462. if (!n)
  33463. throw Error(this + "#" + e + " is undefined");
  33464. if (!(n instanceof u.Reflect.Message.Field))
  33465. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33466. if (!n.repeated)
  33467. throw Error(this + "#" + e + " is not a repeated field");
  33468. t = n.verifyValue(t, !0)
  33469. }
  33470. return null === this[e] && (this[e] = []),
  33471. this[e].push(t),
  33472. this
  33473. }
  33474. ,
  33475. o.$add = o.add,
  33476. o.set = function(e, t, i) {
  33477. if (e && "object" == typeof e) {
  33478. for (var n in i = t,
  33479. e)
  33480. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33481. return this
  33482. }
  33483. var r = a._fieldsByName[e];
  33484. if (i)
  33485. this[e] = t;
  33486. else {
  33487. if (!r)
  33488. throw Error(this + "#" + e + " is not a field: undefined");
  33489. if (!(r instanceof u.Reflect.Message.Field))
  33490. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33491. this[r.name] = t = r.verifyValue(t)
  33492. }
  33493. if (r && r.oneof) {
  33494. var o = this[r.oneof.name];
  33495. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33496. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33497. }
  33498. return this
  33499. }
  33500. ,
  33501. o.$set = o.set,
  33502. o.get = function(e, t) {
  33503. if (t)
  33504. return this[e];
  33505. var i = a._fieldsByName[e];
  33506. if (!(i && i instanceof u.Reflect.Message.Field))
  33507. throw Error(this + "#" + e + " is not a field: undefined");
  33508. if (!(i instanceof u.Reflect.Message.Field))
  33509. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33510. return this[i.name]
  33511. }
  33512. ,
  33513. o.$get = o.get;
  33514. for (var e = 0; e < s.length; e++) {
  33515. var t = s[e];
  33516. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33517. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33518. return e.toUpperCase().replace("_", "")
  33519. });
  33520. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33521. function t(e, t) {
  33522. return this[i.name] = t ? e : i.verifyValue(e),
  33523. this
  33524. }
  33525. function n() {
  33526. return this[i.name]
  33527. }
  33528. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33529. return "_" + e
  33530. });
  33531. null === a.getChild("set" + e) && (o["set" + e] = t),
  33532. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33533. null === a.getChild("get" + e) && (o["get" + e] = n),
  33534. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33535. }(t)
  33536. }
  33537. return o.encode = function(t, e) {
  33538. "boolean" == typeof t && (e = t,
  33539. t = void 0);
  33540. var i = !1;
  33541. t || (t = new I,
  33542. i = !0);
  33543. var n = t.littleEndian;
  33544. try {
  33545. return a.encode(this, t.LE(), e),
  33546. (i ? t.flip() : t).LE(n)
  33547. } catch (e) {
  33548. throw t.LE(n),
  33549. e
  33550. }
  33551. }
  33552. ,
  33553. c.encode = function(e, t, i) {
  33554. return new c(e).encode(t, i)
  33555. }
  33556. ,
  33557. o.calculate = function() {
  33558. return a.calculate(this)
  33559. }
  33560. ,
  33561. o.encodeDelimited = function(e, t) {
  33562. var i = !1;
  33563. e || (e = new I,
  33564. i = !0);
  33565. var n = (new I).LE();
  33566. return a.encode(this, n, t).flip(),
  33567. e.writeVarint32(n.remaining()),
  33568. e.append(n),
  33569. i ? e.flip() : e
  33570. }
  33571. ,
  33572. o.encodeAB = function() {
  33573. try {
  33574. return this.encode().toArrayBuffer()
  33575. } catch (e) {
  33576. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33577. e
  33578. }
  33579. }
  33580. ,
  33581. o.toArrayBuffer = o.encodeAB,
  33582. o.encodeNB = function() {
  33583. try {
  33584. return this.encode().toBuffer()
  33585. } catch (e) {
  33586. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33587. e
  33588. }
  33589. }
  33590. ,
  33591. o.toBuffer = o.encodeNB,
  33592. o.encode64 = function() {
  33593. try {
  33594. return this.encode().toBase64()
  33595. } catch (e) {
  33596. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33597. e
  33598. }
  33599. }
  33600. ,
  33601. o.toBase64 = o.encode64,
  33602. o.encodeHex = function() {
  33603. try {
  33604. return this.encode().toHex()
  33605. } catch (e) {
  33606. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33607. e
  33608. }
  33609. }
  33610. ,
  33611. o.toHex = o.encodeHex,
  33612. o.toRaw = function(e, t) {
  33613. return d(this, !!e, !!t, this.$type)
  33614. }
  33615. ,
  33616. o.encodeJSON = function() {
  33617. return JSON.stringify(d(this, !0, !0, this.$type))
  33618. }
  33619. ,
  33620. c.decode = function(t, e, i) {
  33621. "string" == typeof e && (i = e,
  33622. e = -1),
  33623. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33624. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33625. try {
  33626. var r = a.decode(t.LE());
  33627. return t.LE(n),
  33628. r
  33629. } catch (e) {
  33630. throw t.LE(n),
  33631. e
  33632. }
  33633. }
  33634. ,
  33635. c.decodeDelimited = function(t, e) {
  33636. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33637. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33638. return null;
  33639. var i = t.offset
  33640. , n = t.readVarint32();
  33641. if (t.remaining() < n)
  33642. return t.offset = i,
  33643. null;
  33644. try {
  33645. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33646. return t.offset += n,
  33647. r
  33648. } catch (e) {
  33649. throw t.offset += n,
  33650. e
  33651. }
  33652. }
  33653. ,
  33654. c.decode64 = function(e) {
  33655. return c.decode(e, "base64")
  33656. }
  33657. ,
  33658. c.decodeHex = function(e) {
  33659. return c.decode(e, "hex")
  33660. }
  33661. ,
  33662. c.decodeJSON = function(e) {
  33663. return new c(JSON.parse(e))
  33664. }
  33665. ,
  33666. o.toString = function() {
  33667. return a.toString()
  33668. }
  33669. ,
  33670. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33671. value: a.buildOpt()
  33672. }),
  33673. Object.defineProperty(o, "$options", {
  33674. value: c.$options
  33675. }),
  33676. Object.defineProperty(c, "$type", {
  33677. value: a
  33678. }),
  33679. Object.defineProperty(o, "$type", {
  33680. value: a
  33681. })),
  33682. c
  33683. }(g, this);
  33684. this._fields = [],
  33685. this._fieldsById = {},
  33686. this._fieldsByName = {};
  33687. for (var i, n = 0, r = this.children.length; n < r; n++)
  33688. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33689. if (t.hasOwnProperty(i.name))
  33690. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33691. t[i.name] = i.build()
  33692. } else if (i instanceof d.Field)
  33693. i.build(),
  33694. this._fields.push(i),
  33695. this._fieldsById[i.id] = i,
  33696. this._fieldsByName[i.name] = i;
  33697. else if (!(i instanceof d.OneOf || i instanceof v))
  33698. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33699. return this.clazz = t
  33700. }
  33701. ,
  33702. n.encode = function(e, t, i) {
  33703. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33704. r = e[(n = this._fields[a]).name],
  33705. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33706. if (null === o)
  33707. return t;
  33708. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33709. throw l.encoded = t,
  33710. l
  33711. }
  33712. ,
  33713. n.calculate = function(e) {
  33714. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33715. if (i = e[(t = this._fields[r]).name],
  33716. t.required && null === i)
  33717. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33718. n += t.calculate(i, e)
  33719. }
  33720. return n
  33721. }
  33722. ,
  33723. n.decode = function(e, t, i) {
  33724. t = "number" == typeof t ? t : -1;
  33725. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33726. if (o = (n = e.readVarint32()) >>> 3,
  33727. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33728. if (o !== i)
  33729. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33730. break
  33731. }
  33732. if (a = this._fieldsById[o]) {
  33733. if (a.repeated && !a.options.packed)
  33734. l[a.name].push(a.decode(r, e));
  33735. else if (a.map) {
  33736. var c = a.decode(r, e);
  33737. l[a.name].set(c[0], c[1])
  33738. } else if (l[a.name] = a.decode(r, e),
  33739. a.oneof) {
  33740. var h = l[a.oneof.name];
  33741. null !== h && h !== a.name && (l[h] = null),
  33742. l[a.oneof.name] = a.name
  33743. }
  33744. } else
  33745. switch (r) {
  33746. case g.WIRE_TYPES.VARINT:
  33747. e.readVarint32();
  33748. break;
  33749. case g.WIRE_TYPES.BITS32:
  33750. e.offset += 4;
  33751. break;
  33752. case g.WIRE_TYPES.BITS64:
  33753. e.offset += 8;
  33754. break;
  33755. case g.WIRE_TYPES.LDELIM:
  33756. var u = e.readVarint32();
  33757. e.offset += u;
  33758. break;
  33759. case g.WIRE_TYPES.STARTGROUP:
  33760. for (; m(o, e); )
  33761. ;
  33762. break;
  33763. default:
  33764. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33765. }
  33766. }
  33767. for (var d = 0, p = this._fields.length; d < p; ++d)
  33768. if (null === l[(a = this._fields[d]).name])
  33769. if ("proto3" === this.syntax)
  33770. l[a.name] = a.defaultValue;
  33771. else {
  33772. if (a.required) {
  33773. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33774. throw f.decoded = l,
  33775. f
  33776. }
  33777. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33778. }
  33779. return l
  33780. }
  33781. ,
  33782. s.Message = d;
  33783. function c(e, t, i, n, r, o, a, s, l, c) {
  33784. h.call(this, e, t, o),
  33785. this.className = "Message.Field",
  33786. this.required = "required" === i,
  33787. this.repeated = "repeated" === i,
  33788. this.map = "map" === i,
  33789. this.keyType = n || null,
  33790. this.type = r,
  33791. this.resolvedType = null,
  33792. this.id = a,
  33793. this.options = s || {},
  33794. this.defaultValue = null,
  33795. this.oneof = l || null,
  33796. this.syntax = c || "proto2",
  33797. this.originalName = this.name,
  33798. this.element = null,
  33799. this.keyElement = null,
  33800. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33801. }
  33802. var r = c.prototype = Object.create(h.prototype);
  33803. r.build = function() {
  33804. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33805. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33806. "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)
  33807. }
  33808. ,
  33809. r.verifyValue = function(e, t) {
  33810. function i(e, t) {
  33811. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33812. }
  33813. t = t || !1;
  33814. var n, r = this;
  33815. if (null === e)
  33816. return this.required && i(typeof e, "required"),
  33817. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33818. null;
  33819. if (!this.repeated || t)
  33820. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33821. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33822. this.element.verifyValue(e));
  33823. Array.isArray(e) || (e = [e]);
  33824. var o = [];
  33825. for (n = 0; n < e.length; n++)
  33826. o.push(this.element.verifyValue(e[n]));
  33827. return o
  33828. }
  33829. ,
  33830. r.hasWirePresence = function(e, t) {
  33831. if ("proto3" !== this.syntax)
  33832. return null !== e;
  33833. if (this.oneof && t[this.oneof.name] === this.name)
  33834. return !0;
  33835. switch (this.type) {
  33836. case g.TYPES.int32:
  33837. case g.TYPES.sint32:
  33838. case g.TYPES.sfixed32:
  33839. case g.TYPES.uint32:
  33840. case g.TYPES.fixed32:
  33841. return 0 !== e;
  33842. case g.TYPES.int64:
  33843. case g.TYPES.sint64:
  33844. case g.TYPES.sfixed64:
  33845. case g.TYPES.uint64:
  33846. case g.TYPES.fixed64:
  33847. return 0 !== e.low || 0 !== e.high;
  33848. case g.TYPES.bool:
  33849. return e;
  33850. case g.TYPES.float:
  33851. case g.TYPES.double:
  33852. return 0 !== e;
  33853. case g.TYPES.string:
  33854. return 0 < e.length;
  33855. case g.TYPES.bytes:
  33856. return 0 < e.remaining();
  33857. case g.TYPES.enum:
  33858. return 0 !== e;
  33859. case g.TYPES.message:
  33860. return null !== e;
  33861. default:
  33862. return !0
  33863. }
  33864. }
  33865. ,
  33866. r.encode = function(t, r, e) {
  33867. if (null === this.type || "object" != typeof this.type)
  33868. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33869. if (null === t || this.repeated && 0 == t.length)
  33870. return r;
  33871. try {
  33872. var i;
  33873. if (this.repeated)
  33874. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33875. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33876. r.ensureCapacity(r.offset += 1);
  33877. var n = r.offset;
  33878. for (i = 0; i < t.length; i++)
  33879. this.element.encodeValue(this.id, t[i], r);
  33880. var o = r.offset - n
  33881. , a = I.calculateVarint32(o);
  33882. if (1 < a) {
  33883. var s = r.slice(n, r.offset);
  33884. n += a - 1,
  33885. r.offset = n,
  33886. r.append(s)
  33887. }
  33888. r.writeVarint32(o, n - a)
  33889. } else
  33890. for (i = 0; i < t.length; i++)
  33891. r.writeVarint32(this.id << 3 | this.type.wireType),
  33892. this.element.encodeValue(this.id, t[i], r);
  33893. else
  33894. this.map ? t.forEach(function(e, t, i) {
  33895. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33896. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33897. r.writeVarint32(n),
  33898. r.writeVarint32(8 | this.keyType.wireType),
  33899. this.keyElement.encodeValue(1, t, r),
  33900. r.writeVarint32(16 | this.type.wireType),
  33901. this.element.encodeValue(2, e, r)
  33902. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33903. this.element.encodeValue(this.id, t, r))
  33904. } catch (e) {
  33905. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33906. }
  33907. return r
  33908. }
  33909. ,
  33910. r.calculate = function(t, e) {
  33911. if (t = this.verifyValue(t),
  33912. null === this.type || "object" != typeof this.type)
  33913. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33914. if (null === t || this.repeated && 0 == t.length)
  33915. return 0;
  33916. var r = 0;
  33917. try {
  33918. var i, n;
  33919. if (this.repeated)
  33920. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33921. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33922. i = n = 0; i < t.length; i++)
  33923. n += this.element.calculateLength(this.id, t[i]);
  33924. r += I.calculateVarint32(n),
  33925. r += n
  33926. } else
  33927. for (i = 0; i < t.length; i++)
  33928. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33929. r += this.element.calculateLength(this.id, t[i]);
  33930. else
  33931. this.map ? t.forEach(function(e, t, i) {
  33932. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33933. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33934. r += I.calculateVarint32(n),
  33935. r += n
  33936. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33937. r += this.element.calculateLength(this.id, t))
  33938. } catch (e) {
  33939. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33940. }
  33941. return r
  33942. }
  33943. ,
  33944. r.decode = function(e, t, i) {
  33945. var n, r;
  33946. 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))
  33947. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33948. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33949. r = t.readVarint32(),
  33950. r = t.offset + r;
  33951. for (var o = []; t.offset < r; )
  33952. o.push(this.decode(this.type.wireType, t, !0));
  33953. return o
  33954. }
  33955. if (this.map) {
  33956. var a = u.defaultFieldValue(this.keyType);
  33957. if (n = u.defaultFieldValue(this.type),
  33958. r = t.readVarint32(),
  33959. t.remaining() < r)
  33960. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33961. var s = t.clone();
  33962. for (s.limit = s.offset + r,
  33963. t.offset += r; 0 < s.remaining(); ) {
  33964. var l = s.readVarint32();
  33965. e = 7 & l;
  33966. var c = l >>> 3;
  33967. if (1 == c)
  33968. a = this.keyElement.decode(s, e, c);
  33969. else {
  33970. if (2 != c)
  33971. throw Error("Unexpected tag in map field key/value submessage");
  33972. n = this.element.decode(s, e, c)
  33973. }
  33974. }
  33975. return [a, n]
  33976. }
  33977. return this.element.decode(t, e, this.id)
  33978. }
  33979. ,
  33980. s.Message.Field = c;
  33981. function o(e, t, i, n, r, o, a) {
  33982. c.call(this, e, t, i, null, n, r, o, a),
  33983. this.extension
  33984. }
  33985. o.prototype = Object.create(c.prototype),
  33986. s.Message.ExtensionField = o;
  33987. s.Message.OneOf = function(e, t, i) {
  33988. h.call(this, e, t, i),
  33989. this.fields = []
  33990. }
  33991. ;
  33992. var p = function(e, t, i, n, r) {
  33993. l.call(this, e, t, i, n, r),
  33994. this.className = "Enum",
  33995. this.object = null
  33996. };
  33997. p.getName = function(e, t) {
  33998. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33999. if (e[i = n[r]] === t)
  34000. return i;
  34001. return null
  34002. }
  34003. ,
  34004. (p.prototype = Object.create(l.prototype)).build = function(e) {
  34005. if (this.object && !e)
  34006. return this.object;
  34007. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  34008. t[i[n].name] = i[n].id;
  34009. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34010. value: this.buildOpt(),
  34011. enumerable: !1
  34012. }),
  34013. this.object = t
  34014. }
  34015. ,
  34016. s.Enum = p;
  34017. function f(e, t, i, n) {
  34018. h.call(this, e, t, i),
  34019. this.className = "Enum.Value",
  34020. this.id = n
  34021. }
  34022. f.prototype = Object.create(h.prototype),
  34023. s.Enum.Value = f;
  34024. var v = function(e, t, i, n) {
  34025. h.call(this, e, t, i),
  34026. this.field = n
  34027. };
  34028. v.prototype = Object.create(h.prototype),
  34029. s.Extension = v;
  34030. var y = function(e, t, i, n) {
  34031. l.call(this, e, t, i, n),
  34032. this.className = "Service",
  34033. this.clazz = null
  34034. };
  34035. (y.prototype = Object.create(l.prototype)).build = function(e) {
  34036. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  34037. for (var o = function(e) {
  34038. t.Builder.Service.call(this),
  34039. this.rpcImpl = e || function(e, t, i) {
  34040. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34041. }
  34042. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  34043. !function(n) {
  34044. e[n.name] = function(e, i) {
  34045. try {
  34046. try {
  34047. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34048. } catch (e) {
  34049. if (!(e instanceof TypeError))
  34050. throw e
  34051. }
  34052. if (null === e || "object" != typeof e)
  34053. throw Error("Illegal arguments");
  34054. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34055. this.rpcImpl(n.fqn(), e, function(e, t) {
  34056. if (!e) {
  34057. null === t && (t = "");
  34058. try {
  34059. t = n.resolvedResponseType.clazz.decode(t)
  34060. } catch (e) {}
  34061. 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))
  34062. }
  34063. i(e)
  34064. })
  34065. } catch (e) {
  34066. setTimeout(i.bind(this, e), 0)
  34067. }
  34068. }
  34069. ,
  34070. o[n.name] = function(e, t, i) {
  34071. new o(e)[n.name](t, i)
  34072. }
  34073. ,
  34074. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34075. value: n.buildOpt()
  34076. }),
  34077. Object.defineProperty(e[n.name], "$options", {
  34078. value: o[n.name].$options
  34079. }))
  34080. }(i[n]);
  34081. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34082. value: r.buildOpt()
  34083. }),
  34084. Object.defineProperty(e, "$options", {
  34085. value: o.$options
  34086. }),
  34087. Object.defineProperty(o, "$type", {
  34088. value: r
  34089. }),
  34090. Object.defineProperty(e, "$type", {
  34091. value: r
  34092. })),
  34093. o
  34094. }(g, this)
  34095. }
  34096. ,
  34097. s.Service = y;
  34098. function A(e, t, i, n) {
  34099. h.call(this, e, t, i),
  34100. this.className = "Service.Method",
  34101. this.options = n || {}
  34102. }
  34103. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34104. s.Service.Method = A;
  34105. function C(e, t, i, n, r, o, a, s) {
  34106. A.call(this, e, t, i, s),
  34107. this.className = "Service.RPCMethod",
  34108. this.requestName = n,
  34109. this.responseName = r,
  34110. this.requestStream = o,
  34111. this.responseStream = a,
  34112. this.resolvedRequestType = null,
  34113. this.resolvedResponseType = null
  34114. }
  34115. return C.prototype = Object.create(A.prototype),
  34116. s.Service.RPCMethod = C,
  34117. s
  34118. }(o),
  34119. o.Builder = (i = (u = o).Lang,
  34120. s = o.Reflect,
  34121. n = h.prototype,
  34122. h.isMessage = function(e) {
  34123. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34124. }
  34125. ,
  34126. h.isMessageField = function(e) {
  34127. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34128. }
  34129. ,
  34130. h.isEnum = function(e) {
  34131. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34132. }
  34133. ,
  34134. h.isService = function(e) {
  34135. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34136. }
  34137. ,
  34138. h.isExtend = function(e) {
  34139. return "string" == typeof e.ref
  34140. }
  34141. ,
  34142. n.reset = function() {
  34143. return this.ptr = this.ns,
  34144. this
  34145. }
  34146. ,
  34147. n.define = function(e) {
  34148. if ("string" != typeof e || !i.TYPEREF.test(e))
  34149. throw Error("illegal namespace: " + e);
  34150. return e.split(".").forEach(function(e) {
  34151. var t = this.ptr.getChild(e);
  34152. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34153. this.ptr = t
  34154. }, this),
  34155. this
  34156. }
  34157. ,
  34158. n.create = function(e) {
  34159. if (!e)
  34160. return this;
  34161. if (Array.isArray(e)) {
  34162. if (0 === e.length)
  34163. return this;
  34164. e = e.slice()
  34165. } else
  34166. e = [e];
  34167. for (var t = [e]; 0 < t.length; ) {
  34168. if (e = t.pop(),
  34169. !Array.isArray(e))
  34170. throw Error("not a valid namespace: " + JSON.stringify(e));
  34171. for (; 0 < e.length; ) {
  34172. var i = e.shift();
  34173. if (h.isMessage(i)) {
  34174. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34175. , n = {};
  34176. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34177. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34178. }, this),
  34179. i.fields && i.fields.forEach(function(e) {
  34180. if (null !== o.getChild(0 | e.id))
  34181. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34182. if (e.options && "object" != typeof e.options)
  34183. throw Error("illegal field options in " + o.name + "#" + e.name);
  34184. var t = null;
  34185. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34186. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34187. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34188. t && t.fields.push(e),
  34189. o.addChild(e)
  34190. }, this);
  34191. var r = [];
  34192. if (i.enums && i.enums.forEach(function(e) {
  34193. r.push(e)
  34194. }),
  34195. i.messages && i.messages.forEach(function(e) {
  34196. r.push(e)
  34197. }),
  34198. i.services && i.services.forEach(function(e) {
  34199. r.push(e)
  34200. }),
  34201. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34202. this.ptr.addChild(o),
  34203. 0 < r.length) {
  34204. t.push(e),
  34205. e = r,
  34206. r = null,
  34207. this.ptr = o,
  34208. o = null;
  34209. continue
  34210. }
  34211. r = null
  34212. } else if (h.isEnum(i))
  34213. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34214. i.values.forEach(function(e) {
  34215. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34216. }, this),
  34217. this.ptr.addChild(o);
  34218. else if (h.isService(i))
  34219. o = new s.Service(this,this.ptr,i.name,i.options),
  34220. Object.keys(i.rpc).forEach(function(e) {
  34221. var t = i.rpc[e];
  34222. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34223. }, this),
  34224. this.ptr.addChild(o);
  34225. else {
  34226. if (!h.isExtend(i))
  34227. throw Error("not a valid definition: " + JSON.stringify(i));
  34228. if (o = this.ptr.resolve(i.ref, !0))
  34229. i.fields.forEach(function(t) {
  34230. if (null !== o.getChild(0 | t.id))
  34231. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34232. if (o.extensions) {
  34233. var i = !1;
  34234. if (o.extensions.forEach(function(e) {
  34235. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34236. }),
  34237. !i)
  34238. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34239. }
  34240. var e = t.name;
  34241. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34242. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34243. , r = new s.Extension(this,this.ptr,t.name,n);
  34244. n.extension = r,
  34245. this.ptr.addChild(r),
  34246. o.addChild(n)
  34247. }, this);
  34248. else if (!/\.?google\.protobuf\./.test(i.ref))
  34249. throw Error("extended message " + i.ref + " is not defined")
  34250. }
  34251. o = i = null
  34252. }
  34253. e = null,
  34254. this.ptr = this.ptr.parent
  34255. }
  34256. return this.resolved = !1,
  34257. this.result = null,
  34258. this
  34259. }
  34260. ,
  34261. n.import = function(t, e) {
  34262. var i = "/";
  34263. if ("string" == typeof e) {
  34264. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34265. !0 === this.files[e])
  34266. return this.reset();
  34267. this.files[e] = !0
  34268. } else if ("object" == typeof e) {
  34269. var n = e.root;
  34270. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34271. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34272. var r = n + i + e.file;
  34273. if (!0 === this.files[r])
  34274. return this.reset();
  34275. this.files[r] = !0
  34276. }
  34277. if (t.imports && 0 < t.imports.length) {
  34278. var o, a = !1;
  34279. "object" == typeof e ? (this.importRoot = e.root,
  34280. a = !0,
  34281. o = this.importRoot,
  34282. e = e.file,
  34283. (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(/\\[^\\]*$/, ""),
  34284. i = "\\") : o = "." : o = null;
  34285. for (var s = 0; s < t.imports.length; s++)
  34286. if ("string" == typeof t.imports[s]) {
  34287. if (!o)
  34288. throw Error("cannot determine import root");
  34289. var l = t.imports[s];
  34290. if ("google/protobuf/descriptor.proto" === l)
  34291. continue;
  34292. if (l = o + i + l,
  34293. !0 === this.files[l])
  34294. continue;
  34295. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34296. var c = u.Util.fetch(l);
  34297. if (null === c)
  34298. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34299. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34300. } else
  34301. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34302. return t + "_import" + s + "." + i
  34303. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34304. a && (this.importRoot = null)
  34305. }
  34306. t.package && this.define(t.package),
  34307. t.syntax && function t(i) {
  34308. i.messages && i.messages.forEach(function(e) {
  34309. e.syntax = i.syntax,
  34310. t(e)
  34311. }),
  34312. i.enums && i.enums.forEach(function(e) {
  34313. e.syntax = i.syntax
  34314. })
  34315. }(t);
  34316. var h = this.ptr;
  34317. return t.options && Object.keys(t.options).forEach(function(e) {
  34318. h.options[e] = t.options[e]
  34319. }),
  34320. t.messages && (this.create(t.messages),
  34321. this.ptr = h),
  34322. t.enums && (this.create(t.enums),
  34323. this.ptr = h),
  34324. t.services && (this.create(t.services),
  34325. this.ptr = h),
  34326. t.extends && this.create(t.extends),
  34327. this.reset()
  34328. }
  34329. ,
  34330. n.resolveAll = function() {
  34331. var e;
  34332. if (null == this.ptr || "object" == typeof this.ptr.type)
  34333. return this;
  34334. if (this.ptr instanceof s.Namespace)
  34335. this.ptr.children.forEach(function(e) {
  34336. this.ptr = e,
  34337. this.resolveAll()
  34338. }, this);
  34339. else if (this.ptr instanceof s.Message.Field) {
  34340. if (i.TYPE.test(this.ptr.type))
  34341. this.ptr.type = u.TYPES[this.ptr.type];
  34342. else {
  34343. if (!i.TYPEREF.test(this.ptr.type))
  34344. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34345. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34346. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34347. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34348. if (this.ptr.type = u.TYPES.enum,
  34349. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34350. throw Error("proto3 message cannot reference proto2 enum")
  34351. } else {
  34352. if (!(e instanceof s.Message))
  34353. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34354. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34355. }
  34356. }
  34357. if (this.ptr.map) {
  34358. if (!i.TYPE.test(this.ptr.keyType))
  34359. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34360. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34361. }
  34362. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34363. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34364. throw Error("illegal service type in " + this.ptr.toString(!0));
  34365. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34366. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34367. if (this.ptr.resolvedRequestType = e,
  34368. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34369. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34370. this.ptr.resolvedResponseType = e
  34371. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34372. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34373. return this.reset()
  34374. }
  34375. ,
  34376. n.build = function(e) {
  34377. if (this.reset(),
  34378. this.resolved || (this.resolveAll(),
  34379. this.resolved = !0,
  34380. this.result = null),
  34381. null === this.result && (this.result = this.ns.build()),
  34382. !e)
  34383. return this.result;
  34384. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34385. if (!i[t[n]]) {
  34386. i = null;
  34387. break
  34388. }
  34389. i = i[t[n]]
  34390. }
  34391. return i
  34392. }
  34393. ,
  34394. n.lookup = function(e, t) {
  34395. return e ? this.ns.resolve(e, t) : this.ns
  34396. }
  34397. ,
  34398. n.toString = function() {
  34399. return "Builder"
  34400. }
  34401. ,
  34402. h.Message = function() {}
  34403. ,
  34404. h.Enum = function() {}
  34405. ,
  34406. h.Service = function() {}
  34407. ,
  34408. h),
  34409. o.Map = (a = o.Reflect,
  34410. (t = c.prototype).clear = function() {
  34411. this.map = {}
  34412. }
  34413. ,
  34414. t.delete = function(e) {
  34415. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34416. , i = t in this.map;
  34417. return delete this.map[t],
  34418. i
  34419. }
  34420. ,
  34421. t.entries = function() {
  34422. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34423. t.push([(e = this.map[i[n]]).key, e.value]);
  34424. return l(t)
  34425. }
  34426. ,
  34427. t.keys = function() {
  34428. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34429. e.push(this.map[t[i]].key);
  34430. return l(e)
  34431. }
  34432. ,
  34433. t.values = function() {
  34434. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34435. e.push(this.map[t[i]].value);
  34436. return l(e)
  34437. }
  34438. ,
  34439. t.forEach = function(e, t) {
  34440. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34441. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34442. }
  34443. ,
  34444. t.set = function(e, t) {
  34445. var i = this.keyElem.verifyValue(e)
  34446. , n = this.valueElem.verifyValue(t);
  34447. return this.map[this.keyElem.valueToString(i)] = {
  34448. key: i,
  34449. value: n
  34450. },
  34451. this
  34452. }
  34453. ,
  34454. t.get = function(e) {
  34455. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34456. if (t in this.map)
  34457. return this.map[t].value
  34458. }
  34459. ,
  34460. t.has = function(e) {
  34461. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34462. }
  34463. ,
  34464. c),
  34465. o.loadProto = function(e, t, i) {
  34466. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34467. t = void 0),
  34468. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34469. }
  34470. ,
  34471. o.protoFromString = o.loadProto,
  34472. o.loadProtoFile = function(t, i, n) {
  34473. if (i && "object" == typeof i ? (n = i,
  34474. i = null) : i && "function" == typeof i || (i = null),
  34475. i)
  34476. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34477. if (null !== e)
  34478. try {
  34479. i(null, o.loadProto(e, n, t))
  34480. } catch (e) {
  34481. i(e)
  34482. }
  34483. else
  34484. i(Error("Failed to fetch file"))
  34485. });
  34486. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34487. return null === e ? null : o.loadProto(e, n, t)
  34488. }
  34489. ,
  34490. o.protoFromFile = o.loadProtoFile,
  34491. o.newBuilder = function(e) {
  34492. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34493. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34494. new o.Builder(e)
  34495. }
  34496. ,
  34497. o.loadJson = function(e, t, i) {
  34498. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34499. t = null),
  34500. t && "object" == typeof t || (t = o.newBuilder()),
  34501. "string" == typeof e && (e = JSON.parse(e)),
  34502. t.import(e, i),
  34503. t.resolveAll(),
  34504. t
  34505. }
  34506. ,
  34507. o.loadJsonFile = function(t, i, n) {
  34508. if (i && "object" == typeof i ? (n = i,
  34509. i = null) : i && "function" == typeof i || (i = null),
  34510. i)
  34511. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34512. if (null !== e)
  34513. try {
  34514. i(null, o.loadJson(JSON.parse(e), n, t))
  34515. } catch (e) {
  34516. i(e)
  34517. }
  34518. else
  34519. i(Error("Failed to fetch file"))
  34520. });
  34521. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34522. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34523. }
  34524. ,
  34525. o;
  34526. function l(e) {
  34527. var t = 0;
  34528. return {
  34529. next: function() {
  34530. return t < e.length ? {
  34531. done: !1,
  34532. value: e[t++]
  34533. } : {
  34534. done: !0
  34535. }
  34536. }
  34537. }
  34538. }
  34539. function c(e, t) {
  34540. if (!e.map)
  34541. throw Error("field is not a map");
  34542. if (this.field = e,
  34543. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34544. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34545. this.map = {},
  34546. Object.defineProperty(this, "size", {
  34547. get: function() {
  34548. return Object.keys(this.map).length
  34549. }
  34550. }),
  34551. t)
  34552. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34553. var r = this.keyElem.valueFromString(i[n])
  34554. , o = this.valueElem.verifyValue(t[i[n]]);
  34555. this.map[this.keyElem.valueToString(r)] = {
  34556. key: r,
  34557. value: o
  34558. }
  34559. }
  34560. }
  34561. function h(e) {
  34562. this.ns = new s.Namespace(this,null,""),
  34563. this.ptr = this.ns,
  34564. this.resolved = !1,
  34565. this.result = null,
  34566. this.files = {},
  34567. this.importRoot = null,
  34568. this.options = e || {}
  34569. }
  34570. }
  34571. ,
  34572. "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)
  34573. }
  34574. ).call(this, p("_process"))
  34575. }
  34576. , {
  34577. _process: 203,
  34578. bytebuffer: 215,
  34579. fs: 197,
  34580. path: 197
  34581. }],
  34582. 215: [function(t, e, i) {
  34583. var n, r;
  34584. n = this,
  34585. r = function(l) {
  34586. "use strict";
  34587. function s(e) {
  34588. var t = 0;
  34589. return function() {
  34590. return t < e.length ? e.charCodeAt(t++) : null
  34591. }
  34592. }
  34593. function c() {
  34594. var e = []
  34595. , t = [];
  34596. return function() {
  34597. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34598. e.length = 0),
  34599. void Array.prototype.push.apply(e, arguments))
  34600. }
  34601. }
  34602. function n(e, t, i, n, r) {
  34603. 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];
  34604. for (u += d,
  34605. o = p & (1 << -h) - 1,
  34606. p >>= -h,
  34607. h += s; 0 < h; o = 256 * o + e[t + u],
  34608. u += d,
  34609. h -= 8)
  34610. ;
  34611. for (a = o & (1 << -h) - 1,
  34612. o >>= -h,
  34613. h += n; 0 < h; a = 256 * a + e[t + u],
  34614. u += d,
  34615. h -= 8)
  34616. ;
  34617. if (0 === o)
  34618. o = 1 - c;
  34619. else {
  34620. if (o === l)
  34621. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34622. a += Math.pow(2, n),
  34623. o -= c
  34624. }
  34625. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34626. }
  34627. function r(e, t, i, n, r, o) {
  34628. 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;
  34629. for (t = Math.abs(t),
  34630. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34631. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34632. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34633. l *= 2),
  34634. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34635. l /= 2),
  34636. h <= a + u ? (s = 0,
  34637. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34638. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34639. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34640. p += f,
  34641. s /= 256,
  34642. r -= 8)
  34643. ;
  34644. for (a = a << r | s,
  34645. c += r; 0 < c; e[i + p] = 255 & a,
  34646. p += f,
  34647. a /= 256,
  34648. c -= 8)
  34649. ;
  34650. e[i + p - f] |= 128 * g
  34651. }
  34652. var f = function(e, t, i) {
  34653. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34654. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34655. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34656. !i) {
  34657. if ((e |= 0) < 0)
  34658. throw RangeError("Illegal capacity");
  34659. t = !!t,
  34660. i = !!i
  34661. }
  34662. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34663. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34664. this.offset = 0,
  34665. this.markedOffset = -1,
  34666. this.limit = e,
  34667. this.littleEndian = t,
  34668. this.noAssert = i
  34669. };
  34670. f.VERSION = "5.0.1",
  34671. f.LITTLE_ENDIAN = !0,
  34672. f.BIG_ENDIAN = !1,
  34673. f.DEFAULT_CAPACITY = 16,
  34674. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34675. f.DEFAULT_NOASSERT = !1,
  34676. f.Long = l || null;
  34677. var a = f.prototype;
  34678. a.__isByteBuffer__,
  34679. Object.defineProperty(a, "__isByteBuffer__", {
  34680. value: !0,
  34681. enumerable: !1,
  34682. configurable: !1
  34683. });
  34684. var o = new ArrayBuffer(0)
  34685. , i = String.fromCharCode;
  34686. f.accessor = function() {
  34687. return Uint8Array
  34688. }
  34689. ,
  34690. f.allocate = function(e, t, i) {
  34691. return new f(e,t,i)
  34692. }
  34693. ,
  34694. f.concat = function(e, t, i, n) {
  34695. "boolean" != typeof t && "string" == typeof t || (n = i,
  34696. i = t,
  34697. t = void 0);
  34698. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34699. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34700. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34701. if (0 === o)
  34702. return new f(0,i,n);
  34703. var l, c = new f(o,i,n);
  34704. for (a = 0; a < s; )
  34705. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34706. c.offset += r);
  34707. return c.limit = c.offset,
  34708. c.offset = 0,
  34709. c
  34710. }
  34711. ,
  34712. f.isByteBuffer = function(e) {
  34713. return !0 === (e && e.__isByteBuffer__)
  34714. }
  34715. ,
  34716. f.type = function() {
  34717. return ArrayBuffer
  34718. }
  34719. ,
  34720. f.wrap = function(e, t, i, n) {
  34721. if ("string" != typeof t && (n = i,
  34722. i = t,
  34723. t = void 0),
  34724. "string" == typeof e)
  34725. switch (void 0 === t && (t = "utf8"),
  34726. t) {
  34727. case "base64":
  34728. return f.fromBase64(e, i);
  34729. case "hex":
  34730. return f.fromHex(e, i);
  34731. case "binary":
  34732. return f.fromBinary(e, i);
  34733. case "utf8":
  34734. return f.fromUTF8(e, i);
  34735. case "debug":
  34736. return f.fromDebug(e, i);
  34737. default:
  34738. throw Error("Unsupported encoding: " + t)
  34739. }
  34740. if (null === e || "object" != typeof e)
  34741. throw TypeError("Illegal buffer");
  34742. var r;
  34743. if (f.isByteBuffer(e))
  34744. return (r = a.clone.call(e)).markedOffset = -1,
  34745. r;
  34746. if (e instanceof Uint8Array)
  34747. r = new f(0,i,n),
  34748. 0 < e.length && (r.buffer = e.buffer,
  34749. r.offset = e.byteOffset,
  34750. r.limit = e.byteOffset + e.byteLength,
  34751. r.view = new Uint8Array(e.buffer));
  34752. else if (e instanceof ArrayBuffer)
  34753. r = new f(0,i,n),
  34754. 0 < e.byteLength && (r.buffer = e,
  34755. r.offset = 0,
  34756. r.limit = e.byteLength,
  34757. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34758. else {
  34759. if ("[object Array]" !== Object.prototype.toString.call(e))
  34760. throw TypeError("Illegal buffer");
  34761. (r = new f(e.length,i,n)).limit = e.length;
  34762. for (var o = 0; o < e.length; ++o)
  34763. r.view[o] = e[o]
  34764. }
  34765. return r
  34766. }
  34767. ,
  34768. a.writeBitSet = function(e, t) {
  34769. var i = void 0 === t;
  34770. if (i && (t = this.offset),
  34771. !this.noAssert) {
  34772. if (!(e instanceof Array))
  34773. throw TypeError("Illegal BitSet: Not an array");
  34774. if ("number" != typeof t || t % 1 != 0)
  34775. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34776. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34777. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34778. }
  34779. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34780. for (t += this.writeVarint32(o, t); a--; )
  34781. 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,
  34782. this.writeByte(n, t++);
  34783. if (s < o) {
  34784. var l = 0;
  34785. for (n = 0; s < o; )
  34786. n |= (1 & !!e[s++]) << l++;
  34787. this.writeByte(n, t++)
  34788. }
  34789. return i ? (this.offset = t,
  34790. this) : t - r
  34791. }
  34792. ,
  34793. a.readBitSet = function(e) {
  34794. var t = void 0 === e;
  34795. t && (e = this.offset);
  34796. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34797. for (e += n.length; o--; )
  34798. i = this.readByte(e++),
  34799. s[a++] = !!(1 & i),
  34800. s[a++] = !!(2 & i),
  34801. s[a++] = !!(4 & i),
  34802. s[a++] = !!(8 & i),
  34803. s[a++] = !!(16 & i),
  34804. s[a++] = !!(32 & i),
  34805. s[a++] = !!(64 & i),
  34806. s[a++] = !!(128 & i);
  34807. if (a < r) {
  34808. var l = 0;
  34809. for (i = this.readByte(e++); a < r; )
  34810. s[a++] = !!(i >> l++ & 1)
  34811. }
  34812. return t && (this.offset = e),
  34813. s
  34814. }
  34815. ,
  34816. a.readBytes = function(e, t) {
  34817. var i = void 0 === t;
  34818. if (i && (t = this.offset),
  34819. !this.noAssert) {
  34820. if ("number" != typeof t || t % 1 != 0)
  34821. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34822. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34823. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34824. }
  34825. var n = this.slice(t, t + e);
  34826. return i && (this.offset += e),
  34827. n
  34828. }
  34829. ,
  34830. a.writeBytes = a.append,
  34831. a.writeInt8 = function(e, t) {
  34832. var i = void 0 === t;
  34833. if (i && (t = this.offset),
  34834. !this.noAssert) {
  34835. if ("number" != typeof e || e % 1 != 0)
  34836. throw TypeError("Illegal value: " + e + " (not an integer)");
  34837. if (e |= 0,
  34838. "number" != typeof t || t % 1 != 0)
  34839. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34840. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34841. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34842. }
  34843. t += 1;
  34844. var n = this.buffer.byteLength;
  34845. return n < t && this.resize((n *= 2) > t ? n : t),
  34846. t -= 1,
  34847. this.view[t] = e,
  34848. i && (this.offset += 1),
  34849. this
  34850. }
  34851. ,
  34852. a.writeByte = a.writeInt8,
  34853. a.readInt8 = function(e) {
  34854. var t = void 0 === e;
  34855. if (t && (e = this.offset),
  34856. !this.noAssert) {
  34857. if ("number" != typeof e || e % 1 != 0)
  34858. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34859. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34860. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34861. }
  34862. var i = this.view[e];
  34863. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34864. t && (this.offset += 1),
  34865. i
  34866. }
  34867. ,
  34868. a.readByte = a.readInt8,
  34869. a.writeUint8 = function(e, t) {
  34870. var i = void 0 === t;
  34871. if (i && (t = this.offset),
  34872. !this.noAssert) {
  34873. if ("number" != typeof e || e % 1 != 0)
  34874. throw TypeError("Illegal value: " + e + " (not an integer)");
  34875. if (e >>>= 0,
  34876. "number" != typeof t || t % 1 != 0)
  34877. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34878. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34879. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34880. }
  34881. t += 1;
  34882. var n = this.buffer.byteLength;
  34883. return n < t && this.resize((n *= 2) > t ? n : t),
  34884. t -= 1,
  34885. this.view[t] = e,
  34886. i && (this.offset += 1),
  34887. this
  34888. }
  34889. ,
  34890. a.writeUInt8 = a.writeUint8,
  34891. a.readUint8 = function(e) {
  34892. var t = void 0 === e;
  34893. if (t && (e = this.offset),
  34894. !this.noAssert) {
  34895. if ("number" != typeof e || e % 1 != 0)
  34896. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34897. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34898. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34899. }
  34900. var i = this.view[e];
  34901. return t && (this.offset += 1),
  34902. i
  34903. }
  34904. ,
  34905. a.readUInt8 = a.readUint8,
  34906. a.writeInt16 = function(e, t) {
  34907. var i = void 0 === t;
  34908. if (i && (t = this.offset),
  34909. !this.noAssert) {
  34910. if ("number" != typeof e || e % 1 != 0)
  34911. throw TypeError("Illegal value: " + e + " (not an integer)");
  34912. if (e |= 0,
  34913. "number" != typeof t || t % 1 != 0)
  34914. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34915. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34916. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34917. }
  34918. t += 2;
  34919. var n = this.buffer.byteLength;
  34920. return n < t && this.resize((n *= 2) > t ? n : t),
  34921. t -= 2,
  34922. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34923. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34924. this.view[t + 1] = 255 & e),
  34925. i && (this.offset += 2),
  34926. this
  34927. }
  34928. ,
  34929. a.writeShort = a.writeInt16,
  34930. a.readInt16 = function(e) {
  34931. var t = void 0 === e;
  34932. if (t && (e = this.offset),
  34933. !this.noAssert) {
  34934. if ("number" != typeof e || e % 1 != 0)
  34935. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34936. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34937. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34938. }
  34939. var i = 0;
  34940. return this.littleEndian ? (i = this.view[e],
  34941. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34942. i |= this.view[e + 1]),
  34943. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34944. t && (this.offset += 2),
  34945. i
  34946. }
  34947. ,
  34948. a.readShort = a.readInt16,
  34949. a.writeUint16 = function(e, t) {
  34950. var i = void 0 === t;
  34951. if (i && (t = this.offset),
  34952. !this.noAssert) {
  34953. if ("number" != typeof e || e % 1 != 0)
  34954. throw TypeError("Illegal value: " + e + " (not an integer)");
  34955. if (e >>>= 0,
  34956. "number" != typeof t || t % 1 != 0)
  34957. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34958. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34959. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34960. }
  34961. t += 2;
  34962. var n = this.buffer.byteLength;
  34963. return n < t && this.resize((n *= 2) > t ? n : t),
  34964. t -= 2,
  34965. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34966. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34967. this.view[t + 1] = 255 & e),
  34968. i && (this.offset += 2),
  34969. this
  34970. }
  34971. ,
  34972. a.writeUInt16 = a.writeUint16,
  34973. a.readUint16 = function(e) {
  34974. var t = void 0 === e;
  34975. if (t && (e = this.offset),
  34976. !this.noAssert) {
  34977. if ("number" != typeof e || e % 1 != 0)
  34978. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34979. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34980. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34981. }
  34982. var i = 0;
  34983. return this.littleEndian ? (i = this.view[e],
  34984. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34985. i |= this.view[e + 1]),
  34986. t && (this.offset += 2),
  34987. i
  34988. }
  34989. ,
  34990. a.readUInt16 = a.readUint16,
  34991. a.writeInt32 = function(e, t) {
  34992. var i = void 0 === t;
  34993. if (i && (t = this.offset),
  34994. !this.noAssert) {
  34995. if ("number" != typeof e || e % 1 != 0)
  34996. throw TypeError("Illegal value: " + e + " (not an integer)");
  34997. if (e |= 0,
  34998. "number" != typeof t || t % 1 != 0)
  34999. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35000. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35001. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35002. }
  35003. t += 4;
  35004. var n = this.buffer.byteLength;
  35005. return n < t && this.resize((n *= 2) > t ? n : t),
  35006. t -= 4,
  35007. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35008. this.view[t + 2] = e >>> 16 & 255,
  35009. this.view[t + 1] = e >>> 8 & 255,
  35010. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35011. this.view[t + 1] = e >>> 16 & 255,
  35012. this.view[t + 2] = e >>> 8 & 255,
  35013. this.view[t + 3] = 255 & e),
  35014. i && (this.offset += 4),
  35015. this
  35016. }
  35017. ,
  35018. a.writeInt = a.writeInt32,
  35019. a.readInt32 = function(e) {
  35020. var t = void 0 === e;
  35021. if (t && (e = this.offset),
  35022. !this.noAssert) {
  35023. if ("number" != typeof e || e % 1 != 0)
  35024. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35025. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35026. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35027. }
  35028. var i = 0;
  35029. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35030. i |= this.view[e + 1] << 8,
  35031. i |= this.view[e],
  35032. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35033. i |= this.view[e + 2] << 8,
  35034. i |= this.view[e + 3],
  35035. i += this.view[e] << 24 >>> 0),
  35036. i |= 0,
  35037. t && (this.offset += 4),
  35038. i
  35039. }
  35040. ,
  35041. a.readInt = a.readInt32,
  35042. a.writeUint32 = function(e, t) {
  35043. var i = void 0 === t;
  35044. if (i && (t = this.offset),
  35045. !this.noAssert) {
  35046. if ("number" != typeof e || e % 1 != 0)
  35047. throw TypeError("Illegal value: " + e + " (not an integer)");
  35048. if (e >>>= 0,
  35049. "number" != typeof t || t % 1 != 0)
  35050. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35051. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35052. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35053. }
  35054. t += 4;
  35055. var n = this.buffer.byteLength;
  35056. return n < t && this.resize((n *= 2) > t ? n : t),
  35057. t -= 4,
  35058. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35059. this.view[t + 2] = e >>> 16 & 255,
  35060. this.view[t + 1] = e >>> 8 & 255,
  35061. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35062. this.view[t + 1] = e >>> 16 & 255,
  35063. this.view[t + 2] = e >>> 8 & 255,
  35064. this.view[t + 3] = 255 & e),
  35065. i && (this.offset += 4),
  35066. this
  35067. }
  35068. ,
  35069. a.writeUInt32 = a.writeUint32,
  35070. a.readUint32 = function(e) {
  35071. var t = void 0 === e;
  35072. if (t && (e = this.offset),
  35073. !this.noAssert) {
  35074. if ("number" != typeof e || e % 1 != 0)
  35075. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35076. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35077. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35078. }
  35079. var i = 0;
  35080. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35081. i |= this.view[e + 1] << 8,
  35082. i |= this.view[e],
  35083. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35084. i |= this.view[e + 2] << 8,
  35085. i |= this.view[e + 3],
  35086. i += this.view[e] << 24 >>> 0),
  35087. t && (this.offset += 4),
  35088. i
  35089. }
  35090. ,
  35091. a.readUInt32 = a.readUint32,
  35092. l && (a.writeInt64 = function(e, t) {
  35093. var i = void 0 === t;
  35094. if (i && (t = this.offset),
  35095. !this.noAssert) {
  35096. if ("number" == typeof e)
  35097. e = l.fromNumber(e);
  35098. else if ("string" == typeof e)
  35099. e = l.fromString(e);
  35100. else if (!(e && e instanceof l))
  35101. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35102. if ("number" != typeof t || t % 1 != 0)
  35103. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35104. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35105. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35106. }
  35107. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35108. t += 8;
  35109. var n = this.buffer.byteLength;
  35110. n < t && this.resize((n *= 2) > t ? n : t),
  35111. t -= 8;
  35112. var r = e.low
  35113. , o = e.high;
  35114. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35115. this.view[t + 2] = r >>> 16 & 255,
  35116. this.view[t + 1] = r >>> 8 & 255,
  35117. this.view[t] = 255 & r,
  35118. t += 4,
  35119. this.view[t + 3] = o >>> 24 & 255,
  35120. this.view[t + 2] = o >>> 16 & 255,
  35121. this.view[t + 1] = o >>> 8 & 255,
  35122. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35123. this.view[t + 1] = o >>> 16 & 255,
  35124. this.view[t + 2] = o >>> 8 & 255,
  35125. this.view[t + 3] = 255 & o,
  35126. t += 4,
  35127. this.view[t] = r >>> 24 & 255,
  35128. this.view[t + 1] = r >>> 16 & 255,
  35129. this.view[t + 2] = r >>> 8 & 255,
  35130. this.view[t + 3] = 255 & r),
  35131. i && (this.offset += 8),
  35132. this
  35133. }
  35134. ,
  35135. a.writeLong = a.writeInt64,
  35136. a.readInt64 = function(e) {
  35137. var t = void 0 === e;
  35138. if (t && (e = this.offset),
  35139. !this.noAssert) {
  35140. if ("number" != typeof e || e % 1 != 0)
  35141. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35142. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35143. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35144. }
  35145. var i = 0
  35146. , n = 0;
  35147. this.littleEndian ? (i = this.view[e + 2] << 16,
  35148. i |= this.view[e + 1] << 8,
  35149. i |= this.view[e],
  35150. i += this.view[e + 3] << 24 >>> 0,
  35151. e += 4,
  35152. n = this.view[e + 2] << 16,
  35153. n |= this.view[e + 1] << 8,
  35154. n |= this.view[e],
  35155. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35156. n |= this.view[e + 2] << 8,
  35157. n |= this.view[e + 3],
  35158. n += this.view[e] << 24 >>> 0,
  35159. e += 4,
  35160. i = this.view[e + 1] << 16,
  35161. i |= this.view[e + 2] << 8,
  35162. i |= this.view[e + 3],
  35163. i += this.view[e] << 24 >>> 0);
  35164. var r = new l(i,n,!1);
  35165. return t && (this.offset += 8),
  35166. r
  35167. }
  35168. ,
  35169. a.readLong = a.readInt64,
  35170. a.writeUint64 = function(e, t) {
  35171. var i = void 0 === t;
  35172. if (i && (t = this.offset),
  35173. !this.noAssert) {
  35174. if ("number" == typeof e)
  35175. e = l.fromNumber(e);
  35176. else if ("string" == typeof e)
  35177. e = l.fromString(e);
  35178. else if (!(e && e instanceof l))
  35179. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35180. if ("number" != typeof t || t % 1 != 0)
  35181. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35182. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35183. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35184. }
  35185. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35186. t += 8;
  35187. var n = this.buffer.byteLength;
  35188. n < t && this.resize((n *= 2) > t ? n : t),
  35189. t -= 8;
  35190. var r = e.low
  35191. , o = e.high;
  35192. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35193. this.view[t + 2] = r >>> 16 & 255,
  35194. this.view[t + 1] = r >>> 8 & 255,
  35195. this.view[t] = 255 & r,
  35196. t += 4,
  35197. this.view[t + 3] = o >>> 24 & 255,
  35198. this.view[t + 2] = o >>> 16 & 255,
  35199. this.view[t + 1] = o >>> 8 & 255,
  35200. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35201. this.view[t + 1] = o >>> 16 & 255,
  35202. this.view[t + 2] = o >>> 8 & 255,
  35203. this.view[t + 3] = 255 & o,
  35204. t += 4,
  35205. this.view[t] = r >>> 24 & 255,
  35206. this.view[t + 1] = r >>> 16 & 255,
  35207. this.view[t + 2] = r >>> 8 & 255,
  35208. this.view[t + 3] = 255 & r),
  35209. i && (this.offset += 8),
  35210. this
  35211. }
  35212. ,
  35213. a.writeUInt64 = a.writeUint64,
  35214. a.readUint64 = function(e) {
  35215. var t = void 0 === e;
  35216. if (t && (e = this.offset),
  35217. !this.noAssert) {
  35218. if ("number" != typeof e || e % 1 != 0)
  35219. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35220. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35221. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35222. }
  35223. var i = 0
  35224. , n = 0;
  35225. this.littleEndian ? (i = this.view[e + 2] << 16,
  35226. i |= this.view[e + 1] << 8,
  35227. i |= this.view[e],
  35228. i += this.view[e + 3] << 24 >>> 0,
  35229. e += 4,
  35230. n = this.view[e + 2] << 16,
  35231. n |= this.view[e + 1] << 8,
  35232. n |= this.view[e],
  35233. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35234. n |= this.view[e + 2] << 8,
  35235. n |= this.view[e + 3],
  35236. n += this.view[e] << 24 >>> 0,
  35237. e += 4,
  35238. i = this.view[e + 1] << 16,
  35239. i |= this.view[e + 2] << 8,
  35240. i |= this.view[e + 3],
  35241. i += this.view[e] << 24 >>> 0);
  35242. var r = new l(i,n,!0);
  35243. return t && (this.offset += 8),
  35244. r
  35245. }
  35246. ,
  35247. a.readUInt64 = a.readUint64),
  35248. a.writeFloat32 = function(e, t) {
  35249. var i = void 0 === t;
  35250. if (i && (t = this.offset),
  35251. !this.noAssert) {
  35252. if ("number" != typeof e)
  35253. throw TypeError("Illegal value: " + e + " (not a number)");
  35254. if ("number" != typeof t || t % 1 != 0)
  35255. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35256. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35257. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35258. }
  35259. t += 4;
  35260. var n = this.buffer.byteLength;
  35261. return n < t && this.resize((n *= 2) > t ? n : t),
  35262. t -= 4,
  35263. r(this.view, e, t, this.littleEndian, 23, 4),
  35264. i && (this.offset += 4),
  35265. this
  35266. }
  35267. ,
  35268. a.writeFloat = a.writeFloat32,
  35269. a.readFloat32 = function(e) {
  35270. var t = void 0 === e;
  35271. if (t && (e = this.offset),
  35272. !this.noAssert) {
  35273. if ("number" != typeof e || e % 1 != 0)
  35274. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35275. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35276. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35277. }
  35278. var i = n(this.view, e, this.littleEndian, 23, 4);
  35279. return t && (this.offset += 4),
  35280. i
  35281. }
  35282. ,
  35283. a.readFloat = a.readFloat32,
  35284. a.writeFloat64 = function(e, t) {
  35285. var i = void 0 === t;
  35286. if (i && (t = this.offset),
  35287. !this.noAssert) {
  35288. if ("number" != typeof e)
  35289. throw TypeError("Illegal value: " + e + " (not a number)");
  35290. if ("number" != typeof t || t % 1 != 0)
  35291. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35292. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35293. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35294. }
  35295. t += 8;
  35296. var n = this.buffer.byteLength;
  35297. return n < t && this.resize((n *= 2) > t ? n : t),
  35298. t -= 8,
  35299. r(this.view, e, t, this.littleEndian, 52, 8),
  35300. i && (this.offset += 8),
  35301. this
  35302. }
  35303. ,
  35304. a.writeDouble = a.writeFloat64,
  35305. a.readFloat64 = function(e) {
  35306. var t = void 0 === e;
  35307. if (t && (e = this.offset),
  35308. !this.noAssert) {
  35309. if ("number" != typeof e || e % 1 != 0)
  35310. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35311. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35312. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35313. }
  35314. var i = n(this.view, e, this.littleEndian, 52, 8);
  35315. return t && (this.offset += 8),
  35316. i
  35317. }
  35318. ,
  35319. a.readDouble = a.readFloat64,
  35320. f.MAX_VARINT32_BYTES = 5,
  35321. f.calculateVarint32 = function(e) {
  35322. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35323. }
  35324. ,
  35325. f.zigZagEncode32 = function(e) {
  35326. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35327. }
  35328. ,
  35329. f.zigZagDecode32 = function(e) {
  35330. return e >>> 1 ^ -(1 & e) | 0
  35331. }
  35332. ,
  35333. a.writeVarint32 = function(e, t) {
  35334. var i = void 0 === t;
  35335. if (i && (t = this.offset),
  35336. !this.noAssert) {
  35337. if ("number" != typeof e || e % 1 != 0)
  35338. throw TypeError("Illegal value: " + e + " (not an integer)");
  35339. if (e |= 0,
  35340. "number" != typeof t || t % 1 != 0)
  35341. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35342. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35343. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35344. }
  35345. var n, r = f.calculateVarint32(e);
  35346. t += r;
  35347. var o = this.buffer.byteLength;
  35348. for (o < t && this.resize((o *= 2) > t ? o : t),
  35349. t -= r,
  35350. e >>>= 0; 128 <= e; )
  35351. n = 127 & e | 128,
  35352. this.view[t++] = n,
  35353. e >>>= 7;
  35354. return this.view[t++] = e,
  35355. i ? (this.offset = t,
  35356. this) : r
  35357. }
  35358. ,
  35359. a.writeVarint32ZigZag = function(e, t) {
  35360. return this.writeVarint32(f.zigZagEncode32(e), t)
  35361. }
  35362. ,
  35363. a.readVarint32 = function(e) {
  35364. var t = void 0 === e;
  35365. if (t && (e = this.offset),
  35366. !this.noAssert) {
  35367. if ("number" != typeof e || e % 1 != 0)
  35368. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35369. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35370. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35371. }
  35372. var i, n = 0, r = 0;
  35373. do {
  35374. if (!this.noAssert && e > this.limit) {
  35375. var o = Error("Truncated");
  35376. throw o.truncated = !0,
  35377. o
  35378. }
  35379. i = this.view[e++],
  35380. n < 5 && (r |= (127 & i) << 7 * n),
  35381. ++n
  35382. } while (0 != (128 & i));return r |= 0,
  35383. t ? (this.offset = e,
  35384. r) : {
  35385. value: r,
  35386. length: n
  35387. }
  35388. }
  35389. ,
  35390. a.readVarint32ZigZag = function(e) {
  35391. var t = this.readVarint32(e);
  35392. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35393. t
  35394. }
  35395. ,
  35396. l && (f.MAX_VARINT64_BYTES = 10,
  35397. f.calculateVarint64 = function(e) {
  35398. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35399. var t = e.toInt() >>> 0
  35400. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35401. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35402. 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
  35403. }
  35404. ,
  35405. f.zigZagEncode64 = function(e) {
  35406. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35407. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35408. }
  35409. ,
  35410. f.zigZagDecode64 = function(e) {
  35411. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35412. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35413. }
  35414. ,
  35415. a.writeVarint64 = function(e, t) {
  35416. var i = void 0 === t;
  35417. if (i && (t = this.offset),
  35418. !this.noAssert) {
  35419. if ("number" == typeof e)
  35420. e = l.fromNumber(e);
  35421. else if ("string" == typeof e)
  35422. e = l.fromString(e);
  35423. else if (!(e && e instanceof l))
  35424. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35425. if ("number" != typeof t || t % 1 != 0)
  35426. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35427. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35428. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35429. }
  35430. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35431. var n = f.calculateVarint64(e)
  35432. , r = e.toInt() >>> 0
  35433. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35434. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35435. t += n;
  35436. var s = this.buffer.byteLength;
  35437. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35438. t -= n,
  35439. n) {
  35440. case 10:
  35441. this.view[t + 9] = a >>> 7 & 1;
  35442. case 9:
  35443. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35444. case 8:
  35445. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35446. case 7:
  35447. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35448. case 6:
  35449. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35450. case 5:
  35451. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35452. case 4:
  35453. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35454. case 3:
  35455. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35456. case 2:
  35457. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35458. case 1:
  35459. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35460. }
  35461. return i ? (this.offset += n,
  35462. this) : n
  35463. }
  35464. ,
  35465. a.writeVarint64ZigZag = function(e, t) {
  35466. return this.writeVarint64(f.zigZagEncode64(e), t)
  35467. }
  35468. ,
  35469. a.readVarint64 = function(e) {
  35470. var t = void 0 === e;
  35471. if (t && (e = this.offset),
  35472. !this.noAssert) {
  35473. if ("number" != typeof e || e % 1 != 0)
  35474. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35475. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35476. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35477. }
  35478. var i = e
  35479. , n = 0
  35480. , r = 0
  35481. , o = 0
  35482. , a = 0;
  35483. if (n = 127 & (a = this.view[e++]),
  35484. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35485. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35486. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35487. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35488. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35489. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35490. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35491. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35492. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35493. 128 & a || this.noAssert && void 0 === a))))))))))
  35494. throw Error("Buffer overrun");
  35495. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35496. return t ? (this.offset = e,
  35497. s) : {
  35498. value: s,
  35499. length: e - i
  35500. }
  35501. }
  35502. ,
  35503. a.readVarint64ZigZag = function(e) {
  35504. var t = this.readVarint64(e);
  35505. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35506. t
  35507. }
  35508. ),
  35509. a.writeCString = function(e, t) {
  35510. var i = void 0 === t;
  35511. i && (t = this.offset);
  35512. var n, r = e.length;
  35513. if (!this.noAssert) {
  35514. if ("string" != typeof e)
  35515. throw TypeError("Illegal str: Not a string");
  35516. for (n = 0; n < r; ++n)
  35517. if (0 === e.charCodeAt(n))
  35518. throw RangeError("Illegal str: Contains NULL-characters");
  35519. if ("number" != typeof t || t % 1 != 0)
  35520. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35521. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35522. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35523. }
  35524. r = d.calculateUTF16asUTF8(s(e))[1],
  35525. t += r + 1;
  35526. var o = this.buffer.byteLength;
  35527. return o < t && this.resize((o *= 2) > t ? o : t),
  35528. t -= r + 1,
  35529. d.encodeUTF16toUTF8(s(e), function(e) {
  35530. this.view[t++] = e
  35531. }
  35532. .bind(this)),
  35533. this.view[t++] = 0,
  35534. i ? (this.offset = t,
  35535. this) : r
  35536. }
  35537. ,
  35538. a.readCString = function(e) {
  35539. var t = void 0 === e;
  35540. if (t && (e = this.offset),
  35541. !this.noAssert) {
  35542. if ("number" != typeof e || e % 1 != 0)
  35543. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35544. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35545. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35546. }
  35547. var i, n = e, r = -1;
  35548. return d.decodeUTF8toUTF16(function() {
  35549. if (0 === r)
  35550. return null;
  35551. if (e >= this.limit)
  35552. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35553. return 0 === (r = this.view[e++]) ? null : r
  35554. }
  35555. .bind(this), i = c(), !0),
  35556. t ? (this.offset = e,
  35557. i()) : {
  35558. string: i(),
  35559. length: e - n
  35560. }
  35561. }
  35562. ,
  35563. a.writeIString = function(e, t) {
  35564. var i = void 0 === t;
  35565. if (i && (t = this.offset),
  35566. !this.noAssert) {
  35567. if ("string" != typeof e)
  35568. throw TypeError("Illegal str: Not a string");
  35569. if ("number" != typeof t || t % 1 != 0)
  35570. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35571. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35572. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35573. }
  35574. var n, r = t;
  35575. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35576. t += 4 + n;
  35577. var o = this.buffer.byteLength;
  35578. if (o < t && this.resize((o *= 2) > t ? o : t),
  35579. t -= 4 + n,
  35580. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35581. this.view[t + 2] = n >>> 16 & 255,
  35582. this.view[t + 1] = n >>> 8 & 255,
  35583. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35584. this.view[t + 1] = n >>> 16 & 255,
  35585. this.view[t + 2] = n >>> 8 & 255,
  35586. this.view[t + 3] = 255 & n),
  35587. t += 4,
  35588. d.encodeUTF16toUTF8(s(e), function(e) {
  35589. this.view[t++] = e
  35590. }
  35591. .bind(this)),
  35592. t !== r + 4 + n)
  35593. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35594. return i ? (this.offset = t,
  35595. this) : t - r
  35596. }
  35597. ,
  35598. a.readIString = function(e) {
  35599. var t = void 0 === e;
  35600. if (t && (e = this.offset),
  35601. !this.noAssert) {
  35602. if ("number" != typeof e || e % 1 != 0)
  35603. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35604. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35605. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35606. }
  35607. var i = e
  35608. , n = this.readUint32(e)
  35609. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35610. return e += r.length,
  35611. t ? (this.offset = e,
  35612. r.string) : {
  35613. string: r.string,
  35614. length: e - i
  35615. }
  35616. }
  35617. ,
  35618. f.METRICS_CHARS = "c",
  35619. f.METRICS_BYTES = "b",
  35620. a.writeUTF8String = function(e, t) {
  35621. var i = void 0 === t;
  35622. if (i && (t = this.offset),
  35623. !this.noAssert) {
  35624. if ("number" != typeof t || t % 1 != 0)
  35625. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35626. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35627. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35628. }
  35629. var n, r = t;
  35630. n = d.calculateUTF16asUTF8(s(e))[1],
  35631. t += n;
  35632. var o = this.buffer.byteLength;
  35633. return o < t && this.resize((o *= 2) > t ? o : t),
  35634. t -= n,
  35635. d.encodeUTF16toUTF8(s(e), function(e) {
  35636. this.view[t++] = e
  35637. }
  35638. .bind(this)),
  35639. i ? (this.offset = t,
  35640. this) : t - r
  35641. }
  35642. ,
  35643. a.writeString = a.writeUTF8String,
  35644. f.calculateUTF8Chars = function(e) {
  35645. return d.calculateUTF16asUTF8(s(e))[0]
  35646. }
  35647. ,
  35648. f.calculateUTF8Bytes = function(e) {
  35649. return d.calculateUTF16asUTF8(s(e))[1]
  35650. }
  35651. ,
  35652. f.calculateString = f.calculateUTF8Bytes,
  35653. a.readUTF8String = function(e, t, i) {
  35654. "number" == typeof t && (i = t,
  35655. t = void 0);
  35656. var n = void 0 === i;
  35657. if (n && (i = this.offset),
  35658. void 0 === t && (t = f.METRICS_CHARS),
  35659. !this.noAssert) {
  35660. if ("number" != typeof e || e % 1 != 0)
  35661. throw TypeError("Illegal length: " + e + " (not an integer)");
  35662. if (e |= 0,
  35663. "number" != typeof i || i % 1 != 0)
  35664. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35665. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35666. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35667. }
  35668. var r, o = 0, a = i;
  35669. if (t === f.METRICS_CHARS) {
  35670. if (r = c(),
  35671. d.decodeUTF8(function() {
  35672. return o < e && i < this.limit ? this.view[i++] : null
  35673. }
  35674. .bind(this), function(e) {
  35675. ++o,
  35676. d.UTF8toUTF16(e, r)
  35677. }),
  35678. o !== e)
  35679. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35680. return n ? (this.offset = i,
  35681. r()) : {
  35682. string: r(),
  35683. length: i - a
  35684. }
  35685. }
  35686. if (t !== f.METRICS_BYTES)
  35687. throw TypeError("Unsupported metrics: " + t);
  35688. if (!this.noAssert) {
  35689. if ("number" != typeof i || i % 1 != 0)
  35690. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35691. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35692. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35693. }
  35694. var s = i + e;
  35695. if (d.decodeUTF8toUTF16(function() {
  35696. return i < s ? this.view[i++] : null
  35697. }
  35698. .bind(this), r = c(), this.noAssert),
  35699. i !== s)
  35700. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35701. return n ? (this.offset = i,
  35702. r()) : {
  35703. string: r(),
  35704. length: i - a
  35705. }
  35706. }
  35707. ,
  35708. a.readString = a.readUTF8String,
  35709. a.writeVString = function(e, t) {
  35710. var i = void 0 === t;
  35711. if (i && (t = this.offset),
  35712. !this.noAssert) {
  35713. if ("string" != typeof e)
  35714. throw TypeError("Illegal str: Not a string");
  35715. if ("number" != typeof t || t % 1 != 0)
  35716. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35717. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35718. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35719. }
  35720. var n, r, o = t;
  35721. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35722. r = f.calculateVarint32(n),
  35723. t += r + n;
  35724. var a = this.buffer.byteLength;
  35725. if (a < t && this.resize((a *= 2) > t ? a : t),
  35726. t -= r + n,
  35727. t += this.writeVarint32(n, t),
  35728. d.encodeUTF16toUTF8(s(e), function(e) {
  35729. this.view[t++] = e
  35730. }
  35731. .bind(this)),
  35732. t !== o + n + r)
  35733. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35734. return i ? (this.offset = t,
  35735. this) : t - o
  35736. }
  35737. ,
  35738. a.readVString = function(e) {
  35739. var t = void 0 === e;
  35740. if (t && (e = this.offset),
  35741. !this.noAssert) {
  35742. if ("number" != typeof e || e % 1 != 0)
  35743. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35744. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35745. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35746. }
  35747. var i = e
  35748. , n = this.readVarint32(e)
  35749. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35750. return e += r.length,
  35751. t ? (this.offset = e,
  35752. r.string) : {
  35753. string: r.string,
  35754. length: e - i
  35755. }
  35756. }
  35757. ,
  35758. a.append = function(e, t, i) {
  35759. "number" != typeof t && "string" == typeof t || (i = t,
  35760. t = void 0);
  35761. var n = void 0 === i;
  35762. if (n && (i = this.offset),
  35763. !this.noAssert) {
  35764. if ("number" != typeof i || i % 1 != 0)
  35765. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35766. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35767. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35768. }
  35769. e instanceof f || (e = f.wrap(e, t));
  35770. var r = e.limit - e.offset;
  35771. if (r <= 0)
  35772. return this;
  35773. i += r;
  35774. var o = this.buffer.byteLength;
  35775. return o < i && this.resize((o *= 2) > i ? o : i),
  35776. i -= r,
  35777. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35778. e.offset += r,
  35779. n && (this.offset += r),
  35780. this
  35781. }
  35782. ,
  35783. a.appendTo = function(e, t) {
  35784. return e.append(this, t),
  35785. this
  35786. }
  35787. ,
  35788. a.assert = function(e) {
  35789. return this.noAssert = !e,
  35790. this
  35791. }
  35792. ,
  35793. a.capacity = function() {
  35794. return this.buffer.byteLength
  35795. }
  35796. ,
  35797. a.clear = function() {
  35798. return this.offset = 0,
  35799. this.limit = this.buffer.byteLength,
  35800. this.markedOffset = -1,
  35801. this
  35802. }
  35803. ,
  35804. a.clone = function(e) {
  35805. var t = new f(0,this.littleEndian,this.noAssert);
  35806. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35807. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35808. t.view = this.view),
  35809. t.offset = this.offset,
  35810. t.markedOffset = this.markedOffset,
  35811. t.limit = this.limit,
  35812. t
  35813. }
  35814. ,
  35815. a.compact = function(e, t) {
  35816. if (void 0 === e && (e = this.offset),
  35817. void 0 === t && (t = this.limit),
  35818. !this.noAssert) {
  35819. if ("number" != typeof e || e % 1 != 0)
  35820. throw TypeError("Illegal begin: Not an integer");
  35821. if (e >>>= 0,
  35822. "number" != typeof t || t % 1 != 0)
  35823. throw TypeError("Illegal end: Not an integer");
  35824. if (t >>>= 0,
  35825. e < 0 || t < e || t > this.buffer.byteLength)
  35826. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35827. }
  35828. if (0 === e && t === this.buffer.byteLength)
  35829. return this;
  35830. var i = t - e;
  35831. if (0 == i)
  35832. return this.buffer = o,
  35833. this.view = null,
  35834. 0 <= this.markedOffset && (this.markedOffset -= e),
  35835. this.offset = 0,
  35836. this.limit = 0,
  35837. this;
  35838. var n = new ArrayBuffer(i)
  35839. , r = new Uint8Array(n);
  35840. return r.set(this.view.subarray(e, t)),
  35841. this.buffer = n,
  35842. this.view = r,
  35843. 0 <= this.markedOffset && (this.markedOffset -= e),
  35844. this.offset = 0,
  35845. this.limit = i,
  35846. this
  35847. }
  35848. ,
  35849. a.copy = function(e, t) {
  35850. if (void 0 === e && (e = this.offset),
  35851. void 0 === t && (t = this.limit),
  35852. !this.noAssert) {
  35853. if ("number" != typeof e || e % 1 != 0)
  35854. throw TypeError("Illegal begin: Not an integer");
  35855. if (e >>>= 0,
  35856. "number" != typeof t || t % 1 != 0)
  35857. throw TypeError("Illegal end: Not an integer");
  35858. if (t >>>= 0,
  35859. e < 0 || t < e || t > this.buffer.byteLength)
  35860. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35861. }
  35862. if (e === t)
  35863. return new f(0,this.littleEndian,this.noAssert);
  35864. var i = t - e
  35865. , n = new f(i,this.littleEndian,this.noAssert);
  35866. return n.offset = 0,
  35867. n.limit = i,
  35868. 0 <= n.markedOffset && (n.markedOffset -= e),
  35869. this.copyTo(n, 0, e, t),
  35870. n
  35871. }
  35872. ,
  35873. a.copyTo = function(e, t, i, n) {
  35874. var r, o;
  35875. if (!this.noAssert && !f.isByteBuffer(e))
  35876. throw TypeError("Illegal target: Not a ByteBuffer");
  35877. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35878. i = (r = void 0 === i) ? this.offset : 0 | i,
  35879. n = void 0 === n ? this.limit : 0 | n,
  35880. t < 0 || t > e.buffer.byteLength)
  35881. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35882. if (i < 0 || n > this.buffer.byteLength)
  35883. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35884. var a = n - i;
  35885. return 0 == a ? e : (e.ensureCapacity(t + a),
  35886. e.view.set(this.view.subarray(i, n), t),
  35887. r && (this.offset += a),
  35888. o && (e.offset += a),
  35889. this)
  35890. }
  35891. ,
  35892. a.ensureCapacity = function(e) {
  35893. var t = this.buffer.byteLength;
  35894. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35895. }
  35896. ,
  35897. a.fill = function(e, t, i) {
  35898. var n = void 0 === t;
  35899. if (n && (t = this.offset),
  35900. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35901. void 0 === t && (t = this.offset),
  35902. void 0 === i && (i = this.limit),
  35903. !this.noAssert) {
  35904. if ("number" != typeof e || e % 1 != 0)
  35905. throw TypeError("Illegal value: " + e + " (not an integer)");
  35906. if (e |= 0,
  35907. "number" != typeof t || t % 1 != 0)
  35908. throw TypeError("Illegal begin: Not an integer");
  35909. if (t >>>= 0,
  35910. "number" != typeof i || i % 1 != 0)
  35911. throw TypeError("Illegal end: Not an integer");
  35912. if (i >>>= 0,
  35913. t < 0 || i < t || i > this.buffer.byteLength)
  35914. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35915. }
  35916. if (i <= t)
  35917. return this;
  35918. for (; t < i; )
  35919. this.view[t++] = e;
  35920. return n && (this.offset = t),
  35921. this
  35922. }
  35923. ,
  35924. a.flip = function() {
  35925. return this.limit = this.offset,
  35926. this.offset = 0,
  35927. this
  35928. }
  35929. ,
  35930. a.mark = function(e) {
  35931. if (e = void 0 === e ? this.offset : e,
  35932. !this.noAssert) {
  35933. if ("number" != typeof e || e % 1 != 0)
  35934. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35935. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35936. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35937. }
  35938. return this.markedOffset = e,
  35939. this
  35940. }
  35941. ,
  35942. a.order = function(e) {
  35943. if (!this.noAssert && "boolean" != typeof e)
  35944. throw TypeError("Illegal littleEndian: Not a boolean");
  35945. return this.littleEndian = !!e,
  35946. this
  35947. }
  35948. ,
  35949. a.LE = function(e) {
  35950. return this.littleEndian = void 0 === e || !!e,
  35951. this
  35952. }
  35953. ,
  35954. a.BE = function(e) {
  35955. return this.littleEndian = void 0 !== e && !e,
  35956. this
  35957. }
  35958. ,
  35959. a.prepend = function(e, t, i) {
  35960. "number" != typeof t && "string" == typeof t || (i = t,
  35961. t = void 0);
  35962. var n = void 0 === i;
  35963. if (n && (i = this.offset),
  35964. !this.noAssert) {
  35965. if ("number" != typeof i || i % 1 != 0)
  35966. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35967. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35968. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35969. }
  35970. e instanceof f || (e = f.wrap(e, t));
  35971. var r = e.limit - e.offset;
  35972. if (r <= 0)
  35973. return this;
  35974. var o = r - i;
  35975. if (0 < o) {
  35976. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35977. , s = new Uint8Array(a);
  35978. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35979. this.buffer = a,
  35980. this.view = s,
  35981. this.offset += o,
  35982. 0 <= this.markedOffset && (this.markedOffset += o),
  35983. this.limit += o,
  35984. i += o
  35985. } else
  35986. new Uint8Array(this.buffer);
  35987. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35988. e.offset = e.limit,
  35989. n && (this.offset -= r),
  35990. this
  35991. }
  35992. ,
  35993. a.prependTo = function(e, t) {
  35994. return e.prepend(this, t),
  35995. this
  35996. }
  35997. ,
  35998. a.printDebug = function(e) {
  35999. "function" != typeof e && (e = console.log.bind(console)),
  36000. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36001. }
  36002. ,
  36003. a.remaining = function() {
  36004. return this.limit - this.offset
  36005. }
  36006. ,
  36007. a.reset = function() {
  36008. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  36009. this.markedOffset = -1) : this.offset = 0,
  36010. this
  36011. }
  36012. ,
  36013. a.resize = function(e) {
  36014. if (!this.noAssert) {
  36015. if ("number" != typeof e || e % 1 != 0)
  36016. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36017. if ((e |= 0) < 0)
  36018. throw RangeError("Illegal capacity: 0 <= " + e)
  36019. }
  36020. if (this.buffer.byteLength < e) {
  36021. var t = new ArrayBuffer(e)
  36022. , i = new Uint8Array(t);
  36023. i.set(this.view),
  36024. this.buffer = t,
  36025. this.view = i
  36026. }
  36027. return this
  36028. }
  36029. ,
  36030. a.reverse = function(e, t) {
  36031. if (void 0 === e && (e = this.offset),
  36032. void 0 === t && (t = this.limit),
  36033. !this.noAssert) {
  36034. if ("number" != typeof e || e % 1 != 0)
  36035. throw TypeError("Illegal begin: Not an integer");
  36036. if (e >>>= 0,
  36037. "number" != typeof t || t % 1 != 0)
  36038. throw TypeError("Illegal end: Not an integer");
  36039. if (t >>>= 0,
  36040. e < 0 || t < e || t > this.buffer.byteLength)
  36041. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36042. }
  36043. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  36044. this
  36045. }
  36046. ,
  36047. a.skip = function(e) {
  36048. if (!this.noAssert) {
  36049. if ("number" != typeof e || e % 1 != 0)
  36050. throw TypeError("Illegal length: " + e + " (not an integer)");
  36051. e |= 0
  36052. }
  36053. var t = this.offset + e;
  36054. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36055. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36056. return this.offset = t,
  36057. this
  36058. }
  36059. ,
  36060. a.slice = function(e, t) {
  36061. if (void 0 === e && (e = this.offset),
  36062. void 0 === t && (t = this.limit),
  36063. !this.noAssert) {
  36064. if ("number" != typeof e || e % 1 != 0)
  36065. throw TypeError("Illegal begin: Not an integer");
  36066. if (e >>>= 0,
  36067. "number" != typeof t || t % 1 != 0)
  36068. throw TypeError("Illegal end: Not an integer");
  36069. if (t >>>= 0,
  36070. e < 0 || t < e || t > this.buffer.byteLength)
  36071. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36072. }
  36073. var i = this.clone();
  36074. return i.offset = e,
  36075. i.limit = t,
  36076. i
  36077. }
  36078. ,
  36079. a.toBuffer = function(e) {
  36080. var t = this.offset
  36081. , i = this.limit;
  36082. if (!this.noAssert) {
  36083. if ("number" != typeof t || t % 1 != 0)
  36084. throw TypeError("Illegal offset: Not an integer");
  36085. if (t >>>= 0,
  36086. "number" != typeof i || i % 1 != 0)
  36087. throw TypeError("Illegal limit: Not an integer");
  36088. if (i >>>= 0,
  36089. t < 0 || i < t || i > this.buffer.byteLength)
  36090. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36091. }
  36092. if (!e && 0 === t && i === this.buffer.byteLength)
  36093. return this.buffer;
  36094. if (t === i)
  36095. return o;
  36096. var n = new ArrayBuffer(i - t);
  36097. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36098. n
  36099. }
  36100. ,
  36101. a.toArrayBuffer = a.toBuffer,
  36102. a.toString = function(e, t, i) {
  36103. if (void 0 === e)
  36104. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36105. switch ("number" == typeof e && (i = t = e = "utf8"),
  36106. e) {
  36107. case "utf8":
  36108. return this.toUTF8(t, i);
  36109. case "base64":
  36110. return this.toBase64(t, i);
  36111. case "hex":
  36112. return this.toHex(t, i);
  36113. case "binary":
  36114. return this.toBinary(t, i);
  36115. case "debug":
  36116. return this.toDebug();
  36117. case "columns":
  36118. return this.toColumns();
  36119. default:
  36120. throw Error("Unsupported encoding: " + e)
  36121. }
  36122. }
  36123. ;
  36124. var h = function() {
  36125. 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)
  36126. a[r[t]] = t;
  36127. return e.encode = function(e, t) {
  36128. for (var i, n; null !== (i = e()); )
  36129. t(r[i >> 2 & 63]),
  36130. n = (3 & i) << 4,
  36131. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36132. n = (15 & i) << 2,
  36133. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36134. t(r[63 & i])) : (t(r[63 & n]),
  36135. t(61))) : (t(r[63 & n]),
  36136. t(61),
  36137. t(61))
  36138. }
  36139. ,
  36140. e.decode = function(e, t) {
  36141. function i(e) {
  36142. throw Error("Illegal character code: " + e)
  36143. }
  36144. for (var n, r, o; null !== (n = e()); )
  36145. if (void 0 === (r = a[n]) && i(n),
  36146. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36147. t(r << 2 >>> 0 | (48 & o) >> 4),
  36148. null !== (n = e()))) {
  36149. if (void 0 === (r = a[n])) {
  36150. if (61 === n)
  36151. break;
  36152. i(n)
  36153. }
  36154. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36155. null !== (n = e())) {
  36156. if (void 0 === (o = a[n])) {
  36157. if (61 === n)
  36158. break;
  36159. i(n)
  36160. }
  36161. t((3 & r) << 6 >>> 0 | o)
  36162. }
  36163. }
  36164. }
  36165. ,
  36166. e.test = function(e) {
  36167. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36168. }
  36169. ,
  36170. e
  36171. }();
  36172. a.toBase64 = function(e, t) {
  36173. if (void 0 === e && (e = this.offset),
  36174. void 0 === t && (t = this.limit),
  36175. t |= 0,
  36176. (e |= 0) < 0 || t > this.capacity || t < e)
  36177. throw RangeError("begin, end");
  36178. var i;
  36179. return h.encode(function() {
  36180. return e < t ? this.view[e++] : null
  36181. }
  36182. .bind(this), i = c()),
  36183. i()
  36184. }
  36185. ,
  36186. f.fromBase64 = function(e, t) {
  36187. if ("string" != typeof e)
  36188. throw TypeError("str");
  36189. var i = new f(e.length / 4 * 3,t)
  36190. , n = 0;
  36191. return h.decode(s(e), function(e) {
  36192. i.view[n++] = e
  36193. }),
  36194. i.limit = n,
  36195. i
  36196. }
  36197. ,
  36198. f.btoa = function(e) {
  36199. return f.fromBinary(e).toBase64()
  36200. }
  36201. ,
  36202. f.atob = function(e) {
  36203. return f.fromBase64(e).toBinary()
  36204. }
  36205. ,
  36206. a.toBinary = function(e, t) {
  36207. if (void 0 === e && (e = this.offset),
  36208. void 0 === t && (t = this.limit),
  36209. t |= 0,
  36210. (e |= 0) < 0 || t > this.capacity() || t < e)
  36211. throw RangeError("begin, end");
  36212. if (e === t)
  36213. return "";
  36214. for (var i = [], n = []; e < t; )
  36215. i.push(this.view[e++]),
  36216. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36217. i = []);
  36218. return n.join("") + String.fromCharCode.apply(String, i)
  36219. }
  36220. ,
  36221. f.fromBinary = function(e, t) {
  36222. if ("string" != typeof e)
  36223. throw TypeError("str");
  36224. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36225. if (255 < (i = e.charCodeAt(n)))
  36226. throw RangeError("illegal char code: " + i);
  36227. o.view[n++] = i
  36228. }
  36229. return o.limit = r,
  36230. o
  36231. }
  36232. ,
  36233. a.toDebug = function(e) {
  36234. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36235. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36236. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36237. ++i,
  36238. e && 0 < i && i % 16 == 0 && i !== n) {
  36239. for (; r.length < 51; )
  36240. r += " ";
  36241. a += r + o + "\n",
  36242. r = o = ""
  36243. }
  36244. 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 ? " " : ""
  36245. }
  36246. if (e && " " !== r) {
  36247. for (; r.length < 51; )
  36248. r += " ";
  36249. a += r + o + "\n"
  36250. }
  36251. return e ? a : r
  36252. }
  36253. ,
  36254. f.fromDebug = function(e, t, i) {
  36255. 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; ) {
  36256. switch (n = e.charAt(s++)) {
  36257. case "!":
  36258. if (!i) {
  36259. if (h || u || d) {
  36260. p = !0;
  36261. break
  36262. }
  36263. h = u = d = !0
  36264. }
  36265. a.offset = a.markedOffset = a.limit = l,
  36266. c = !1;
  36267. break;
  36268. case "|":
  36269. if (!i) {
  36270. if (h || d) {
  36271. p = !0;
  36272. break
  36273. }
  36274. h = d = !0
  36275. }
  36276. a.offset = a.limit = l,
  36277. c = !1;
  36278. break;
  36279. case "[":
  36280. if (!i) {
  36281. if (h || u) {
  36282. p = !0;
  36283. break
  36284. }
  36285. h = u = !0
  36286. }
  36287. a.offset = a.markedOffset = l,
  36288. c = !1;
  36289. break;
  36290. case "<":
  36291. if (!i) {
  36292. if (h) {
  36293. p = !0;
  36294. break
  36295. }
  36296. h = !0
  36297. }
  36298. a.offset = l,
  36299. c = !1;
  36300. break;
  36301. case "]":
  36302. if (!i) {
  36303. if (d || u) {
  36304. p = !0;
  36305. break
  36306. }
  36307. d = u = !0
  36308. }
  36309. a.limit = a.markedOffset = l,
  36310. c = !1;
  36311. break;
  36312. case ">":
  36313. if (!i) {
  36314. if (d) {
  36315. p = !0;
  36316. break
  36317. }
  36318. d = !0
  36319. }
  36320. a.limit = l,
  36321. c = !1;
  36322. break;
  36323. case "'":
  36324. if (!i) {
  36325. if (u) {
  36326. p = !0;
  36327. break
  36328. }
  36329. u = !0
  36330. }
  36331. a.markedOffset = l,
  36332. c = !1;
  36333. break;
  36334. case " ":
  36335. c = !1;
  36336. break;
  36337. default:
  36338. if (!i && c) {
  36339. p = !0;
  36340. break
  36341. }
  36342. if (r = parseInt(n + e.charAt(s++), 16),
  36343. !i && (isNaN(r) || r < 0 || 255 < r))
  36344. throw TypeError("Illegal str: Not a debug encoded string");
  36345. a.view[l++] = r,
  36346. c = !0
  36347. }
  36348. if (p)
  36349. throw TypeError("Illegal str: Invalid symbol at " + s)
  36350. }
  36351. if (!i) {
  36352. if (!h || !d)
  36353. throw TypeError("Illegal str: Missing offset or limit");
  36354. if (l < a.buffer.byteLength)
  36355. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36356. }
  36357. return a
  36358. }
  36359. ,
  36360. a.toHex = function(e, t) {
  36361. if (e = void 0 === e ? this.offset : e,
  36362. t = void 0 === t ? this.limit : t,
  36363. !this.noAssert) {
  36364. if ("number" != typeof e || e % 1 != 0)
  36365. throw TypeError("Illegal begin: Not an integer");
  36366. if (e >>>= 0,
  36367. "number" != typeof t || t % 1 != 0)
  36368. throw TypeError("Illegal end: Not an integer");
  36369. if (t >>>= 0,
  36370. e < 0 || t < e || t > this.buffer.byteLength)
  36371. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36372. }
  36373. for (var i, n = new Array(t - e); e < t; )
  36374. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36375. return n.join("")
  36376. }
  36377. ,
  36378. f.fromHex = function(e, t, i) {
  36379. if (!i) {
  36380. if ("string" != typeof e)
  36381. throw TypeError("Illegal str: Not a string");
  36382. if (e.length % 2 != 0)
  36383. throw TypeError("Illegal str: Length not a multiple of 2")
  36384. }
  36385. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36386. if (n = parseInt(e.substring(a, a + 2), 16),
  36387. !i && (!isFinite(n) || n < 0 || 255 < n))
  36388. throw TypeError("Illegal str: Contains non-hex characters");
  36389. o.view[s++] = n
  36390. }
  36391. return o.limit = s,
  36392. o
  36393. }
  36394. ;
  36395. var u, d = u = {
  36396. MAX_CODEPOINT: 1114111,
  36397. encodeUTF8: function(e, t) {
  36398. var i = null;
  36399. for ("number" == typeof e && (i = e,
  36400. e = function() {
  36401. return null
  36402. }
  36403. ); null !== i || null !== (i = e()); )
  36404. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36405. t(i >> 12 & 63 | 128)),
  36406. t(i >> 6 & 63 | 128)),
  36407. t(63 & i | 128)),
  36408. i = null
  36409. },
  36410. decodeUTF8: function(e, t) {
  36411. for (var i, n, r, o, a = function(e) {
  36412. e = e.slice(0, e.indexOf(null));
  36413. var t = Error(e.toString());
  36414. throw t.name = "TruncatedError",
  36415. t.bytes = e,
  36416. t
  36417. }; null !== (i = e()); )
  36418. if (0 == (128 & i))
  36419. t(i);
  36420. else if (192 == (224 & i))
  36421. null === (n = e()) && a([i, n]),
  36422. t((31 & i) << 6 | 63 & n);
  36423. else if (224 == (240 & i))
  36424. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36425. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36426. else {
  36427. if (240 != (248 & i))
  36428. throw RangeError("Illegal starting byte: " + i);
  36429. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36430. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36431. }
  36432. },
  36433. UTF16toUTF8: function(e, t) {
  36434. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36435. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36436. n = null) : t(i);
  36437. null !== n && t(n)
  36438. },
  36439. UTF8toUTF16: function(e, t) {
  36440. var i = null;
  36441. for ("number" == typeof e && (i = e,
  36442. e = function() {
  36443. return null
  36444. }
  36445. ); null !== i || null !== (i = e()); )
  36446. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36447. t(i % 1024 + 56320)),
  36448. i = null
  36449. },
  36450. encodeUTF16toUTF8: function(e, t) {
  36451. u.UTF16toUTF8(e, function(e) {
  36452. u.encodeUTF8(e, t)
  36453. })
  36454. },
  36455. decodeUTF8toUTF16: function(e, t) {
  36456. u.decodeUTF8(e, function(e) {
  36457. u.UTF8toUTF16(e, t)
  36458. })
  36459. },
  36460. calculateCodePoint: function(e) {
  36461. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36462. },
  36463. calculateUTF8: function(e) {
  36464. for (var t, i = 0; null !== (t = e()); )
  36465. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36466. return i
  36467. },
  36468. calculateUTF16asUTF8: function(e) {
  36469. var t = 0
  36470. , i = 0;
  36471. return u.UTF16toUTF8(e, function(e) {
  36472. ++t,
  36473. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36474. }),
  36475. [t, i]
  36476. }
  36477. };
  36478. return a.toUTF8 = function(t, i) {
  36479. if (void 0 === t && (t = this.offset),
  36480. void 0 === i && (i = this.limit),
  36481. !this.noAssert) {
  36482. if ("number" != typeof t || t % 1 != 0)
  36483. throw TypeError("Illegal begin: Not an integer");
  36484. if (t >>>= 0,
  36485. "number" != typeof i || i % 1 != 0)
  36486. throw TypeError("Illegal end: Not an integer");
  36487. if (i >>>= 0,
  36488. t < 0 || i < t || i > this.buffer.byteLength)
  36489. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36490. }
  36491. var e;
  36492. try {
  36493. d.decodeUTF8toUTF16(function() {
  36494. return t < i ? this.view[t++] : null
  36495. }
  36496. .bind(this), e = c())
  36497. } catch (e) {
  36498. if (t !== i)
  36499. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36500. }
  36501. return e()
  36502. }
  36503. ,
  36504. f.fromUTF8 = function(e, t, i) {
  36505. if (!i && "string" != typeof e)
  36506. throw TypeError("Illegal str: Not a string");
  36507. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36508. , r = 0;
  36509. return d.encodeUTF16toUTF8(s(e), function(e) {
  36510. n.view[r++] = e
  36511. }),
  36512. n.limit = r,
  36513. n
  36514. }
  36515. ,
  36516. f
  36517. }
  36518. ,
  36519. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36520. var e;
  36521. try {
  36522. e = t("long")
  36523. } catch (e) {}
  36524. return r(e)
  36525. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36526. }
  36527. , {
  36528. long: 216
  36529. }],
  36530. 216: [function(e, t, i) {
  36531. var n, r;
  36532. n = this,
  36533. r = function() {
  36534. "use strict";
  36535. function n(e, t, i) {
  36536. this.low = 0 | e,
  36537. this.high = 0 | t,
  36538. this.unsigned = !!i
  36539. }
  36540. function p(e) {
  36541. return !0 === (e && e.__isLong__)
  36542. }
  36543. function e(e, t) {
  36544. var i, n, r;
  36545. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36546. r && (a[e] = i),
  36547. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36548. r && (o[e] = i),
  36549. i)
  36550. }
  36551. function f(e, t) {
  36552. if (isNaN(e) || !isFinite(e))
  36553. return t ? l : y;
  36554. if (t) {
  36555. if (e < 0)
  36556. return l;
  36557. if (r <= e)
  36558. return I
  36559. } else {
  36560. if (e <= -s)
  36561. return E;
  36562. if (s <= e + 1)
  36563. return C
  36564. }
  36565. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36566. }
  36567. function g(e, t, i) {
  36568. return new n(e,t,i)
  36569. }
  36570. function h(e, t, i) {
  36571. if (0 === e.length)
  36572. throw Error("empty string");
  36573. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36574. return y;
  36575. if (t = "number" == typeof t ? (i = t,
  36576. !1) : !!t,
  36577. (i = i || 10) < 2 || 36 < i)
  36578. throw RangeError("radix");
  36579. var n;
  36580. if (0 < (n = e.indexOf("-")))
  36581. throw Error("interior hyphen");
  36582. if (0 === n)
  36583. return h(e.substring(1), t, i).neg();
  36584. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36585. var s = Math.min(8, e.length - a)
  36586. , l = parseInt(e.substring(a, a + s), i);
  36587. if (s < 8) {
  36588. var c = f(u(i, s));
  36589. o = o.mul(c).add(f(l))
  36590. } else
  36591. o = (o = o.mul(r)).add(f(l))
  36592. }
  36593. return o.unsigned = t,
  36594. o
  36595. }
  36596. function m(e) {
  36597. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36598. }
  36599. Object.defineProperty(n.prototype, "__isLong__", {
  36600. value: !0,
  36601. enumerable: !1,
  36602. configurable: !1
  36603. }),
  36604. n.isLong = p;
  36605. var o = {}
  36606. , a = {};
  36607. n.fromInt = e,
  36608. n.fromNumber = f,
  36609. n.fromBits = g;
  36610. var u = Math.pow;
  36611. n.fromString = h,
  36612. n.fromValue = m;
  36613. var i = 4294967296
  36614. , r = 0x10000000000000000
  36615. , s = r / 2
  36616. , v = e(1 << 24)
  36617. , y = e(0);
  36618. n.ZERO = y;
  36619. var l = e(0, !0);
  36620. n.UZERO = l;
  36621. var c = e(1);
  36622. n.ONE = c;
  36623. var d = e(1, !0);
  36624. n.UONE = d;
  36625. var A = e(-1);
  36626. n.NEG_ONE = A;
  36627. var C = g(-1, 2147483647, !1);
  36628. n.MAX_VALUE = C;
  36629. var I = g(-1, -1, !0);
  36630. n.MAX_UNSIGNED_VALUE = I;
  36631. var E = g(0, -2147483648, !1);
  36632. n.MIN_VALUE = E;
  36633. var t = n.prototype;
  36634. return t.toInt = function() {
  36635. return this.unsigned ? this.low >>> 0 : this.low
  36636. }
  36637. ,
  36638. t.toNumber = function() {
  36639. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36640. }
  36641. ,
  36642. t.toString = function(e) {
  36643. if ((e = e || 10) < 2 || 36 < e)
  36644. throw RangeError("radix");
  36645. if (this.isZero())
  36646. return "0";
  36647. if (this.isNegative()) {
  36648. if (this.eq(E)) {
  36649. var t = f(e)
  36650. , i = this.div(t)
  36651. , n = i.mul(t).sub(this);
  36652. return i.toString(e) + n.toInt().toString(e)
  36653. }
  36654. return "-" + this.neg().toString(e)
  36655. }
  36656. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36657. var s = o.div(r)
  36658. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36659. if ((o = s).isZero())
  36660. return l + a;
  36661. for (; l.length < 6; )
  36662. l = "0" + l;
  36663. a = "" + l + a
  36664. }
  36665. }
  36666. ,
  36667. t.getHighBits = function() {
  36668. return this.high
  36669. }
  36670. ,
  36671. t.getHighBitsUnsigned = function() {
  36672. return this.high >>> 0
  36673. }
  36674. ,
  36675. t.getLowBits = function() {
  36676. return this.low
  36677. }
  36678. ,
  36679. t.getLowBitsUnsigned = function() {
  36680. return this.low >>> 0
  36681. }
  36682. ,
  36683. t.getNumBitsAbs = function() {
  36684. if (this.isNegative())
  36685. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36686. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36687. ;
  36688. return 0 != this.high ? t + 33 : t + 1
  36689. }
  36690. ,
  36691. t.isZero = function() {
  36692. return 0 === this.high && 0 === this.low
  36693. }
  36694. ,
  36695. t.isNegative = function() {
  36696. return !this.unsigned && this.high < 0
  36697. }
  36698. ,
  36699. t.isPositive = function() {
  36700. return this.unsigned || 0 <= this.high
  36701. }
  36702. ,
  36703. t.isOdd = function() {
  36704. return 1 == (1 & this.low)
  36705. }
  36706. ,
  36707. t.isEven = function() {
  36708. return 0 == (1 & this.low)
  36709. }
  36710. ,
  36711. t.equals = function(e) {
  36712. return p(e) || (e = m(e)),
  36713. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36714. }
  36715. ,
  36716. t.eq = t.equals,
  36717. t.notEquals = function(e) {
  36718. return !this.eq(e)
  36719. }
  36720. ,
  36721. t.neq = t.notEquals,
  36722. t.lessThan = function(e) {
  36723. return this.comp(e) < 0
  36724. }
  36725. ,
  36726. t.lt = t.lessThan,
  36727. t.lessThanOrEqual = function(e) {
  36728. return this.comp(e) <= 0
  36729. }
  36730. ,
  36731. t.lte = t.lessThanOrEqual,
  36732. t.greaterThan = function(e) {
  36733. return 0 < this.comp(e)
  36734. }
  36735. ,
  36736. t.gt = t.greaterThan,
  36737. t.greaterThanOrEqual = function(e) {
  36738. return 0 <= this.comp(e)
  36739. }
  36740. ,
  36741. t.gte = t.greaterThanOrEqual,
  36742. t.compare = function(e) {
  36743. if (p(e) || (e = m(e)),
  36744. this.eq(e))
  36745. return 0;
  36746. var t = this.isNegative()
  36747. , i = e.isNegative();
  36748. 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
  36749. }
  36750. ,
  36751. t.comp = t.compare,
  36752. t.negate = function() {
  36753. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36754. }
  36755. ,
  36756. t.neg = t.negate,
  36757. t.add = function(e) {
  36758. p(e) || (e = m(e));
  36759. var t = this.high >>> 16
  36760. , i = 65535 & this.high
  36761. , n = this.low >>> 16
  36762. , r = 65535 & this.low
  36763. , o = e.high >>> 16
  36764. , a = 65535 & e.high
  36765. , s = e.low >>> 16
  36766. , l = 0
  36767. , c = 0
  36768. , h = 0
  36769. , u = 0;
  36770. return h += (u += r + (65535 & e.low)) >>> 16,
  36771. c += (h += n + s) >>> 16,
  36772. l += (c += i + a) >>> 16,
  36773. l += t + o,
  36774. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36775. }
  36776. ,
  36777. t.subtract = function(e) {
  36778. return p(e) || (e = m(e)),
  36779. this.add(e.neg())
  36780. }
  36781. ,
  36782. t.sub = t.subtract,
  36783. t.multiply = function(e) {
  36784. if (this.isZero())
  36785. return y;
  36786. if (p(e) || (e = m(e)),
  36787. e.isZero())
  36788. return y;
  36789. if (this.eq(E))
  36790. return e.isOdd() ? E : y;
  36791. if (e.eq(E))
  36792. return this.isOdd() ? E : y;
  36793. if (this.isNegative())
  36794. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36795. if (e.isNegative())
  36796. return this.mul(e.neg()).neg();
  36797. if (this.lt(v) && e.lt(v))
  36798. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36799. var t = this.high >>> 16
  36800. , i = 65535 & this.high
  36801. , n = this.low >>> 16
  36802. , r = 65535 & this.low
  36803. , o = e.high >>> 16
  36804. , a = 65535 & e.high
  36805. , s = e.low >>> 16
  36806. , l = 65535 & e.low
  36807. , c = 0
  36808. , h = 0
  36809. , u = 0
  36810. , d = 0;
  36811. return u += (d += r * l) >>> 16,
  36812. h += (u += n * l) >>> 16,
  36813. u &= 65535,
  36814. h += (u += r * s) >>> 16,
  36815. c += (h += i * l) >>> 16,
  36816. h &= 65535,
  36817. c += (h += n * s) >>> 16,
  36818. h &= 65535,
  36819. c += (h += r * a) >>> 16,
  36820. c += t * l + i * s + n * a + r * o,
  36821. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36822. }
  36823. ,
  36824. t.mul = t.multiply,
  36825. t.divide = function(e) {
  36826. if (p(e) || (e = m(e)),
  36827. e.isZero())
  36828. throw Error("division by zero");
  36829. if (this.isZero())
  36830. return this.unsigned ? l : y;
  36831. var t, i, n;
  36832. if (this.unsigned) {
  36833. if (e.unsigned || (e = e.toUnsigned()),
  36834. e.gt(this))
  36835. return l;
  36836. if (e.gt(this.shru(1)))
  36837. return d;
  36838. n = l
  36839. } else {
  36840. if (this.eq(E))
  36841. 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)),
  36842. n = t.add(i.div(e)));
  36843. if (e.eq(E))
  36844. return this.unsigned ? l : y;
  36845. if (this.isNegative())
  36846. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36847. if (e.isNegative())
  36848. return this.div(e.neg()).neg();
  36849. n = y
  36850. }
  36851. for (i = this; i.gte(e); ) {
  36852. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36853. 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); )
  36854. s = (a = f(t -= o, this.unsigned)).mul(e);
  36855. a.isZero() && (a = c),
  36856. n = n.add(a),
  36857. i = i.sub(s)
  36858. }
  36859. return n
  36860. }
  36861. ,
  36862. t.div = t.divide,
  36863. t.modulo = function(e) {
  36864. return p(e) || (e = m(e)),
  36865. this.sub(this.div(e).mul(e))
  36866. }
  36867. ,
  36868. t.mod = t.modulo,
  36869. t.not = function() {
  36870. return g(~this.low, ~this.high, this.unsigned)
  36871. }
  36872. ,
  36873. t.and = function(e) {
  36874. return p(e) || (e = m(e)),
  36875. g(this.low & e.low, this.high & e.high, this.unsigned)
  36876. }
  36877. ,
  36878. t.or = function(e) {
  36879. return p(e) || (e = m(e)),
  36880. g(this.low | e.low, this.high | e.high, this.unsigned)
  36881. }
  36882. ,
  36883. t.xor = function(e) {
  36884. return p(e) || (e = m(e)),
  36885. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36886. }
  36887. ,
  36888. t.shiftLeft = function(e) {
  36889. return p(e) && (e = e.toInt()),
  36890. 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)
  36891. }
  36892. ,
  36893. t.shl = t.shiftLeft,
  36894. t.shiftRight = function(e) {
  36895. return p(e) && (e = e.toInt()),
  36896. 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)
  36897. }
  36898. ,
  36899. t.shr = t.shiftRight,
  36900. t.shiftRightUnsigned = function(e) {
  36901. if (p(e) && (e = e.toInt()),
  36902. 0 === (e &= 63))
  36903. return this;
  36904. var t = this.high;
  36905. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36906. }
  36907. ,
  36908. t.shru = t.shiftRightUnsigned,
  36909. t.toSigned = function() {
  36910. return this.unsigned ? g(this.low, this.high, !1) : this
  36911. }
  36912. ,
  36913. t.toUnsigned = function() {
  36914. return this.unsigned ? this : g(this.low, this.high, !0)
  36915. }
  36916. ,
  36917. t.toBytes = function(e) {
  36918. return e ? this.toBytesLE() : this.toBytesBE()
  36919. }
  36920. ,
  36921. t.toBytesLE = function() {
  36922. var e = this.high
  36923. , t = this.low;
  36924. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36925. }
  36926. ,
  36927. t.toBytesBE = function() {
  36928. var e = this.high
  36929. , t = this.low;
  36930. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36931. }
  36932. ,
  36933. n
  36934. }
  36935. ,
  36936. "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()
  36937. }
  36938. , {}],
  36939. 217: [function(e, t, i) {
  36940. 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 = {
  36941. REVISION: "75"
  36942. };
  36943. function Ii(e, t) {
  36944. return e.distance - t.distance
  36945. }
  36946. function Ei(e, t, i, n) {
  36947. if (!1 !== e.visible && (e.raycast(t, i),
  36948. !0 === n))
  36949. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36950. Ei(r[o], t, i, !0)
  36951. }
  36952. function _i(e, t, i) {
  36953. return i < 0 && (i += 1),
  36954. 1 < i && (i -= 1),
  36955. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36956. }
  36957. function bi(e, t, i, n, r, o, a) {
  36958. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36959. r.multiplyScalar(Vt.x),
  36960. o.multiplyScalar(Vt.y),
  36961. a.multiplyScalar(Vt.z),
  36962. r.add(o).add(a),
  36963. r.clone()
  36964. }
  36965. function wi(e, t, i, n, r, o, a) {
  36966. var s = e.material;
  36967. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36968. return null;
  36969. Ut.copy(a),
  36970. Ut.applyMatrix4(e.matrixWorld);
  36971. var l = t.ray.origin.distanceTo(Ut);
  36972. return l < t.near || l > t.far ? null : {
  36973. distance: l,
  36974. point: Ut.clone(),
  36975. object: e
  36976. }
  36977. }
  36978. function Ti(e, t, i, n, r, o, a, s) {
  36979. Mt.fromArray(n, 3 * o),
  36980. Rt.fromArray(n, 3 * a),
  36981. Pt.fromArray(n, 3 * s);
  36982. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36983. return l && (r && (Nt.fromArray(r, 2 * o),
  36984. Ft.fromArray(r, 2 * a),
  36985. Bt.fromArray(r, 2 * s),
  36986. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36987. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36988. l.faceIndex = o),
  36989. l
  36990. }
  36991. function xi() {}
  36992. function Si(e, t, i, n, r, o) {
  36993. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36994. if (s = e[o[t]].x,
  36995. l = e[o[t]].y,
  36996. c = e[o[i]].x,
  36997. h = e[o[i]].y,
  36998. u = e[o[n]].x,
  36999. d = e[o[n]].y,
  37000. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  37001. return !1;
  37002. for (g = u - c,
  37003. m = d - h,
  37004. v = s - u,
  37005. y = l - d,
  37006. A = c - s,
  37007. C = h - l,
  37008. a = 0; a < r; a++)
  37009. if (p = e[o[a]].x,
  37010. f = e[o[a]].y,
  37011. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  37012. E = v * (f - d) - y * (p - u),
  37013. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  37014. return !1;
  37015. return !0
  37016. }
  37017. function Mi(e) {
  37018. switch (e) {
  37019. case Ci.LinearEncoding:
  37020. return ["Linear", "( value )"];
  37021. case Ci.sRGBEncoding:
  37022. return ["sRGB", "( value )"];
  37023. case Ci.RGBEEncoding:
  37024. return ["RGBE", "( value )"];
  37025. case Ci.RGBM7Encoding:
  37026. return ["RGBM", "( value, 7.0 )"];
  37027. case Ci.RGBM16Encoding:
  37028. return ["RGBM", "( value, 16.0 )"];
  37029. case Ci.RGBDEncoding:
  37030. return ["RGBD", "( value, 256.0 )"];
  37031. case Ci.GammaEncoding:
  37032. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  37033. default:
  37034. throw new Error("unsupported encoding: " + e)
  37035. }
  37036. }
  37037. function Ri(e, t) {
  37038. var i = Mi(t);
  37039. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  37040. }
  37041. function Pi(e) {
  37042. return "" !== e
  37043. }
  37044. function Oi(e, t) {
  37045. 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)
  37046. }
  37047. function Li(e) {
  37048. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37049. var i = Ci.ShaderChunk[t];
  37050. if (void 0 === i)
  37051. throw new Error("Can not resolve #include <" + t + ">");
  37052. return Li(i)
  37053. })
  37054. }
  37055. function Di(e) {
  37056. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37057. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37058. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37059. return r
  37060. })
  37061. }
  37062. function Ni(e, t, i, n) {
  37063. gi.set(t, i, n).unproject(mi);
  37064. var r = fi[e];
  37065. if (void 0 !== r)
  37066. for (var o = 0, a = r.length; o < a; o++)
  37067. pi.vertices[r[o]].copy(gi)
  37068. }
  37069. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37070. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37071. void 0 === Math.sign && (Math.sign = function(e) {
  37072. return e < 0 ? -1 : 0 < e ? 1 : +e
  37073. }
  37074. ),
  37075. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37076. get: function() {
  37077. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37078. }
  37079. }),
  37080. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37081. writable: !0,
  37082. configurable: !0,
  37083. value: function(e) {
  37084. "use strict";
  37085. if (null == e)
  37086. throw new TypeError("Cannot convert first argument to object");
  37087. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37088. var r = arguments[i];
  37089. if (null != r) {
  37090. r = Object(r);
  37091. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37092. var l = o[a]
  37093. , c = Object.getOwnPropertyDescriptor(r, l);
  37094. void 0 !== c && c.enumerable && (t[l] = r[l])
  37095. }
  37096. }
  37097. }
  37098. return t
  37099. }
  37100. }),
  37101. Ci.MOUSE = {
  37102. LEFT: 0,
  37103. MIDDLE: 1,
  37104. RIGHT: 2
  37105. },
  37106. Ci.CullFaceNone = 0,
  37107. Ci.CullFaceBack = 1,
  37108. Ci.CullFaceFront = 2,
  37109. Ci.CullFaceFrontBack = 3,
  37110. Ci.FrontFaceDirectionCW = 0,
  37111. Ci.FrontFaceDirectionCCW = 1,
  37112. Ci.BasicShadowMap = 0,
  37113. Ci.PCFShadowMap = 1,
  37114. Ci.PCFSoftShadowMap = 2,
  37115. Ci.FrontSide = 0,
  37116. Ci.BackSide = 1,
  37117. Ci.DoubleSide = 2,
  37118. Ci.FlatShading = 1,
  37119. Ci.SmoothShading = 2,
  37120. Ci.NoColors = 0,
  37121. Ci.FaceColors = 1,
  37122. Ci.VertexColors = 2,
  37123. Ci.NoBlending = 0,
  37124. Ci.NormalBlending = 1,
  37125. Ci.AdditiveBlending = 2,
  37126. Ci.SubtractiveBlending = 3,
  37127. Ci.MultiplyBlending = 4,
  37128. Ci.CustomBlending = 5,
  37129. Ci.AddEquation = 100,
  37130. Ci.SubtractEquation = 101,
  37131. Ci.ReverseSubtractEquation = 102,
  37132. Ci.MinEquation = 103,
  37133. Ci.MaxEquation = 104,
  37134. Ci.ZeroFactor = 200,
  37135. Ci.OneFactor = 201,
  37136. Ci.SrcColorFactor = 202,
  37137. Ci.OneMinusSrcColorFactor = 203,
  37138. Ci.SrcAlphaFactor = 204,
  37139. Ci.OneMinusSrcAlphaFactor = 205,
  37140. Ci.DstAlphaFactor = 206,
  37141. Ci.OneMinusDstAlphaFactor = 207,
  37142. Ci.DstColorFactor = 208,
  37143. Ci.OneMinusDstColorFactor = 209,
  37144. Ci.SrcAlphaSaturateFactor = 210,
  37145. Ci.NeverDepth = 0,
  37146. Ci.AlwaysDepth = 1,
  37147. Ci.LessDepth = 2,
  37148. Ci.LessEqualDepth = 3,
  37149. Ci.EqualDepth = 4,
  37150. Ci.GreaterEqualDepth = 5,
  37151. Ci.GreaterDepth = 6,
  37152. Ci.NotEqualDepth = 7,
  37153. Ci.MultiplyOperation = 0,
  37154. Ci.MixOperation = 1,
  37155. Ci.AddOperation = 2,
  37156. Ci.NoToneMapping = 0,
  37157. Ci.LinearToneMapping = 1,
  37158. Ci.ReinhardToneMapping = 2,
  37159. Ci.Uncharted2ToneMapping = 3,
  37160. Ci.CineonToneMapping = 4,
  37161. Ci.UVMapping = 300,
  37162. Ci.CubeReflectionMapping = 301,
  37163. Ci.CubeRefractionMapping = 302,
  37164. Ci.EquirectangularReflectionMapping = 303,
  37165. Ci.EquirectangularRefractionMapping = 304,
  37166. Ci.SphericalReflectionMapping = 305,
  37167. Ci.CubeUVReflectionMapping = 306,
  37168. Ci.CubeUVRefractionMapping = 307,
  37169. Ci.RepeatWrapping = 1e3,
  37170. Ci.ClampToEdgeWrapping = 1001,
  37171. Ci.MirroredRepeatWrapping = 1002,
  37172. Ci.NearestFilter = 1003,
  37173. Ci.NearestMipMapNearestFilter = 1004,
  37174. Ci.NearestMipMapLinearFilter = 1005,
  37175. Ci.LinearFilter = 1006,
  37176. Ci.LinearMipMapNearestFilter = 1007,
  37177. Ci.LinearMipMapLinearFilter = 1008,
  37178. Ci.UnsignedByteType = 1009,
  37179. Ci.ByteType = 1010,
  37180. Ci.ShortType = 1011,
  37181. Ci.UnsignedShortType = 1012,
  37182. Ci.IntType = 1013,
  37183. Ci.UnsignedIntType = 1014,
  37184. Ci.FloatType = 1015,
  37185. Ci.HalfFloatType = 1025,
  37186. Ci.UnsignedShort4444Type = 1016,
  37187. Ci.UnsignedShort5551Type = 1017,
  37188. Ci.UnsignedShort565Type = 1018,
  37189. Ci.AlphaFormat = 1019,
  37190. Ci.RGBFormat = 1020,
  37191. Ci.RGBAFormat = 1021,
  37192. Ci.LuminanceFormat = 1022,
  37193. Ci.LuminanceAlphaFormat = 1023,
  37194. Ci.RGBEFormat = Ci.RGBAFormat,
  37195. Ci.RGB_S3TC_DXT1_Format = 2001,
  37196. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37197. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37198. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37199. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37200. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37201. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37202. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37203. Ci.RGB_ETC1_Format = 2151,
  37204. Ci.LoopOnce = 2200,
  37205. Ci.LoopRepeat = 2201,
  37206. Ci.LoopPingPong = 2202,
  37207. Ci.InterpolateDiscrete = 2300,
  37208. Ci.InterpolateLinear = 2301,
  37209. Ci.InterpolateSmooth = 2302,
  37210. Ci.ZeroCurvatureEnding = 2400,
  37211. Ci.ZeroSlopeEnding = 2401,
  37212. Ci.WrapAroundEnding = 2402,
  37213. Ci.TrianglesDrawMode = 0,
  37214. Ci.TriangleStripDrawMode = 1,
  37215. Ci.TriangleFanDrawMode = 2,
  37216. Ci.LinearEncoding = 3e3,
  37217. Ci.sRGBEncoding = 3001,
  37218. Ci.GammaEncoding = 3007,
  37219. Ci.RGBEEncoding = 3002,
  37220. Ci.LogLuvEncoding = 3003,
  37221. Ci.RGBM7Encoding = 3004,
  37222. Ci.RGBM16Encoding = 3005,
  37223. Ci.RGBDEncoding = 3006,
  37224. Ci.Color = function(e) {
  37225. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37226. }
  37227. ,
  37228. Ci.Color.prototype = {
  37229. constructor: Ci.Color,
  37230. r: 1,
  37231. g: 1,
  37232. b: 1,
  37233. set: function(e) {
  37234. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37235. this
  37236. },
  37237. setScalar: function(e) {
  37238. this.r = e,
  37239. this.g = e,
  37240. this.b = e
  37241. },
  37242. setHex: function(e) {
  37243. return e = Math.floor(e),
  37244. this.r = (e >> 16 & 255) / 255,
  37245. this.g = (e >> 8 & 255) / 255,
  37246. this.b = (255 & e) / 255,
  37247. this
  37248. },
  37249. setRGB: function(e, t, i) {
  37250. return this.r = e,
  37251. this.g = t,
  37252. this.b = i,
  37253. this
  37254. },
  37255. setHSL: function(e, t, i) {
  37256. if (e = Ci.Math.euclideanModulo(e, 1),
  37257. t = Ci.Math.clamp(t, 0, 1),
  37258. i = Ci.Math.clamp(i, 0, 1),
  37259. 0 === t)
  37260. this.r = this.g = this.b = i;
  37261. else {
  37262. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37263. , r = 2 * i - n;
  37264. this.r = _i(r, n, e + 1 / 3),
  37265. this.g = _i(r, n, e),
  37266. this.b = _i(r, n, e - 1 / 3)
  37267. }
  37268. return this
  37269. },
  37270. setStyle: function(t) {
  37271. function e(e) {
  37272. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37273. }
  37274. var i;
  37275. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37276. var n, r = i[1], o = i[2];
  37277. switch (r) {
  37278. case "rgb":
  37279. case "rgba":
  37280. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37281. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37282. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37283. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37284. e(n[5]),
  37285. this;
  37286. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37287. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37288. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37289. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37290. e(n[5]),
  37291. this;
  37292. break;
  37293. case "hsl":
  37294. case "hsla":
  37295. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37296. var a = parseFloat(n[1]) / 360
  37297. , s = parseInt(n[2], 10) / 100
  37298. , l = parseInt(n[3], 10) / 100;
  37299. return e(n[5]),
  37300. this.setHSL(a, s, l)
  37301. }
  37302. }
  37303. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37304. var c, h = (c = i[1]).length;
  37305. if (3 === h)
  37306. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37307. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37308. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37309. this;
  37310. if (6 === h)
  37311. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37312. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37313. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37314. this
  37315. }
  37316. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37317. return this
  37318. },
  37319. clone: function() {
  37320. return new this.constructor(this.r,this.g,this.b)
  37321. },
  37322. copy: function(e) {
  37323. return this.r = e.r,
  37324. this.g = e.g,
  37325. this.b = e.b,
  37326. this
  37327. },
  37328. copyGammaToLinear: function(e, t) {
  37329. return void 0 === t && (t = 2),
  37330. this.r = Math.pow(e.r, t),
  37331. this.g = Math.pow(e.g, t),
  37332. this.b = Math.pow(e.b, t),
  37333. this
  37334. },
  37335. copyLinearToGamma: function(e, t) {
  37336. void 0 === t && (t = 2);
  37337. var i = 0 < t ? 1 / t : 1;
  37338. return this.r = Math.pow(e.r, i),
  37339. this.g = Math.pow(e.g, i),
  37340. this.b = Math.pow(e.b, i),
  37341. this
  37342. },
  37343. convertGammaToLinear: function() {
  37344. var e = this.r
  37345. , t = this.g
  37346. , i = this.b;
  37347. return this.r = e * e,
  37348. this.g = t * t,
  37349. this.b = i * i,
  37350. this
  37351. },
  37352. convertLinearToGamma: function() {
  37353. return this.r = Math.sqrt(this.r),
  37354. this.g = Math.sqrt(this.g),
  37355. this.b = Math.sqrt(this.b),
  37356. this
  37357. },
  37358. getHex: function() {
  37359. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37360. },
  37361. getHexString: function() {
  37362. return ("000000" + this.getHex().toString(16)).slice(-6)
  37363. },
  37364. getHSL: function(e) {
  37365. var t, i, n = e || {
  37366. h: 0,
  37367. s: 0,
  37368. l: 0
  37369. }, 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;
  37370. if (l === s)
  37371. i = t = 0;
  37372. else {
  37373. var h = s - l;
  37374. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37375. s) {
  37376. case r:
  37377. t = (o - a) / h + (o < a ? 6 : 0);
  37378. break;
  37379. case o:
  37380. t = (a - r) / h + 2;
  37381. break;
  37382. case a:
  37383. t = (r - o) / h + 4
  37384. }
  37385. t /= 6
  37386. }
  37387. return n.h = t,
  37388. n.s = i,
  37389. n.l = c,
  37390. n
  37391. },
  37392. getStyle: function() {
  37393. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37394. },
  37395. offsetHSL: function(e, t, i) {
  37396. var n = this.getHSL();
  37397. return n.h += e,
  37398. n.s += t,
  37399. n.l += i,
  37400. this.setHSL(n.h, n.s, n.l),
  37401. this
  37402. },
  37403. add: function(e) {
  37404. return this.r += e.r,
  37405. this.g += e.g,
  37406. this.b += e.b,
  37407. this
  37408. },
  37409. addColors: function(e, t) {
  37410. return this.r = e.r + t.r,
  37411. this.g = e.g + t.g,
  37412. this.b = e.b + t.b,
  37413. this
  37414. },
  37415. addScalar: function(e) {
  37416. return this.r += e,
  37417. this.g += e,
  37418. this.b += e,
  37419. this
  37420. },
  37421. multiply: function(e) {
  37422. return this.r *= e.r,
  37423. this.g *= e.g,
  37424. this.b *= e.b,
  37425. this
  37426. },
  37427. multiplyScalar: function(e) {
  37428. return this.r *= e,
  37429. this.g *= e,
  37430. this.b *= e,
  37431. this
  37432. },
  37433. lerp: function(e, t) {
  37434. return this.r += (e.r - this.r) * t,
  37435. this.g += (e.g - this.g) * t,
  37436. this.b += (e.b - this.b) * t,
  37437. this
  37438. },
  37439. equals: function(e) {
  37440. return e.r === this.r && e.g === this.g && e.b === this.b
  37441. },
  37442. fromArray: function(e, t) {
  37443. return void 0 === t && (t = 0),
  37444. this.r = e[t],
  37445. this.g = e[t + 1],
  37446. this.b = e[t + 2],
  37447. this
  37448. },
  37449. toArray: function(e, t) {
  37450. return void 0 === e && (e = []),
  37451. void 0 === t && (t = 0),
  37452. e[t] = this.r,
  37453. e[t + 1] = this.g,
  37454. e[t + 2] = this.b,
  37455. e
  37456. }
  37457. },
  37458. Ci.ColorKeywords = {
  37459. aliceblue: 15792383,
  37460. antiquewhite: 16444375,
  37461. aqua: 65535,
  37462. aquamarine: 8388564,
  37463. azure: 15794175,
  37464. beige: 16119260,
  37465. bisque: 16770244,
  37466. black: 0,
  37467. blanchedalmond: 16772045,
  37468. blue: 255,
  37469. blueviolet: 9055202,
  37470. brown: 10824234,
  37471. burlywood: 14596231,
  37472. cadetblue: 6266528,
  37473. chartreuse: 8388352,
  37474. chocolate: 13789470,
  37475. coral: 16744272,
  37476. cornflowerblue: 6591981,
  37477. cornsilk: 16775388,
  37478. crimson: 14423100,
  37479. cyan: 65535,
  37480. darkblue: 139,
  37481. darkcyan: 35723,
  37482. darkgoldenrod: 12092939,
  37483. darkgray: 11119017,
  37484. darkgreen: 25600,
  37485. darkgrey: 11119017,
  37486. darkkhaki: 12433259,
  37487. darkmagenta: 9109643,
  37488. darkolivegreen: 5597999,
  37489. darkorange: 16747520,
  37490. darkorchid: 10040012,
  37491. darkred: 9109504,
  37492. darksalmon: 15308410,
  37493. darkseagreen: 9419919,
  37494. darkslateblue: 4734347,
  37495. darkslategray: 3100495,
  37496. darkslategrey: 3100495,
  37497. darkturquoise: 52945,
  37498. darkviolet: 9699539,
  37499. deeppink: 16716947,
  37500. deepskyblue: 49151,
  37501. dimgray: 6908265,
  37502. dimgrey: 6908265,
  37503. dodgerblue: 2003199,
  37504. firebrick: 11674146,
  37505. floralwhite: 16775920,
  37506. forestgreen: 2263842,
  37507. fuchsia: 16711935,
  37508. gainsboro: 14474460,
  37509. ghostwhite: 16316671,
  37510. gold: 16766720,
  37511. goldenrod: 14329120,
  37512. gray: 8421504,
  37513. green: 32768,
  37514. greenyellow: 11403055,
  37515. grey: 8421504,
  37516. honeydew: 15794160,
  37517. hotpink: 16738740,
  37518. indianred: 13458524,
  37519. indigo: 4915330,
  37520. ivory: 16777200,
  37521. khaki: 15787660,
  37522. lavender: 15132410,
  37523. lavenderblush: 16773365,
  37524. lawngreen: 8190976,
  37525. lemonchiffon: 16775885,
  37526. lightblue: 11393254,
  37527. lightcoral: 15761536,
  37528. lightcyan: 14745599,
  37529. lightgoldenrodyellow: 16448210,
  37530. lightgray: 13882323,
  37531. lightgreen: 9498256,
  37532. lightgrey: 13882323,
  37533. lightpink: 16758465,
  37534. lightsalmon: 16752762,
  37535. lightseagreen: 2142890,
  37536. lightskyblue: 8900346,
  37537. lightslategray: 7833753,
  37538. lightslategrey: 7833753,
  37539. lightsteelblue: 11584734,
  37540. lightyellow: 16777184,
  37541. lime: 65280,
  37542. limegreen: 3329330,
  37543. linen: 16445670,
  37544. magenta: 16711935,
  37545. maroon: 8388608,
  37546. mediumaquamarine: 6737322,
  37547. mediumblue: 205,
  37548. mediumorchid: 12211667,
  37549. mediumpurple: 9662683,
  37550. mediumseagreen: 3978097,
  37551. mediumslateblue: 8087790,
  37552. mediumspringgreen: 64154,
  37553. mediumturquoise: 4772300,
  37554. mediumvioletred: 13047173,
  37555. midnightblue: 1644912,
  37556. mintcream: 16121850,
  37557. mistyrose: 16770273,
  37558. moccasin: 16770229,
  37559. navajowhite: 16768685,
  37560. navy: 128,
  37561. oldlace: 16643558,
  37562. olive: 8421376,
  37563. olivedrab: 7048739,
  37564. orange: 16753920,
  37565. orangered: 16729344,
  37566. orchid: 14315734,
  37567. palegoldenrod: 15657130,
  37568. palegreen: 10025880,
  37569. paleturquoise: 11529966,
  37570. palevioletred: 14381203,
  37571. papayawhip: 16773077,
  37572. peachpuff: 16767673,
  37573. peru: 13468991,
  37574. pink: 16761035,
  37575. plum: 14524637,
  37576. powderblue: 11591910,
  37577. purple: 8388736,
  37578. red: 16711680,
  37579. rosybrown: 12357519,
  37580. royalblue: 4286945,
  37581. saddlebrown: 9127187,
  37582. salmon: 16416882,
  37583. sandybrown: 16032864,
  37584. seagreen: 3050327,
  37585. seashell: 16774638,
  37586. sienna: 10506797,
  37587. silver: 12632256,
  37588. skyblue: 8900331,
  37589. slateblue: 6970061,
  37590. slategray: 7372944,
  37591. slategrey: 7372944,
  37592. snow: 16775930,
  37593. springgreen: 65407,
  37594. steelblue: 4620980,
  37595. tan: 13808780,
  37596. teal: 32896,
  37597. thistle: 14204888,
  37598. tomato: 16737095,
  37599. turquoise: 4251856,
  37600. violet: 15631086,
  37601. wheat: 16113331,
  37602. white: 16777215,
  37603. whitesmoke: 16119285,
  37604. yellow: 16776960,
  37605. yellowgreen: 10145074
  37606. },
  37607. Ci.Quaternion = function(e, t, i, n) {
  37608. this._x = e || 0,
  37609. this._y = t || 0,
  37610. this._z = i || 0,
  37611. this._w = void 0 !== n ? n : 1
  37612. }
  37613. ,
  37614. Ci.Quaternion.prototype = {
  37615. constructor: Ci.Quaternion,
  37616. get x() {
  37617. return this._x
  37618. },
  37619. set x(e) {
  37620. this._x = e,
  37621. this.onChangeCallback()
  37622. },
  37623. get y() {
  37624. return this._y
  37625. },
  37626. set y(e) {
  37627. this._y = e,
  37628. this.onChangeCallback()
  37629. },
  37630. get z() {
  37631. return this._z
  37632. },
  37633. set z(e) {
  37634. this._z = e,
  37635. this.onChangeCallback()
  37636. },
  37637. get w() {
  37638. return this._w
  37639. },
  37640. set w(e) {
  37641. this._w = e,
  37642. this.onChangeCallback()
  37643. },
  37644. set: function(e, t, i, n) {
  37645. return this._x = e,
  37646. this._y = t,
  37647. this._z = i,
  37648. this._w = n,
  37649. this.onChangeCallback(),
  37650. this
  37651. },
  37652. clone: function() {
  37653. return new this.constructor(this._x,this._y,this._z,this._w)
  37654. },
  37655. toObject:function(){//add
  37656. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37657. },
  37658. copy: function(e) {
  37659. return this._x = e.x,
  37660. this._y = e.y,
  37661. this._z = e.z,
  37662. this._w = e.w,
  37663. this.onChangeCallback(),
  37664. this
  37665. },
  37666. setFromEuler: function(e, t) {
  37667. if (e instanceof Ci.Euler == 0)
  37668. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37669. var i = Math.cos(e._x / 2)
  37670. , n = Math.cos(e._y / 2)
  37671. , r = Math.cos(e._z / 2)
  37672. , o = Math.sin(e._x / 2)
  37673. , a = Math.sin(e._y / 2)
  37674. , s = Math.sin(e._z / 2)
  37675. , l = e.order;
  37676. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37677. this._y = i * a * r - o * n * s,
  37678. this._z = i * n * s + o * a * r,
  37679. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37680. this._y = i * a * r - o * n * s,
  37681. this._z = i * n * s - o * a * r,
  37682. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37683. this._y = i * a * r + o * n * s,
  37684. this._z = i * n * s + o * a * r,
  37685. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37686. this._y = i * a * r + o * n * s,
  37687. this._z = i * n * s - o * a * r,
  37688. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37689. this._y = i * a * r + o * n * s,
  37690. this._z = i * n * s - o * a * r,
  37691. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37692. this._y = i * a * r - o * n * s,
  37693. this._z = i * n * s + o * a * r,
  37694. this._w = i * n * r + o * a * s),
  37695. !1 !== t && this.onChangeCallback(),
  37696. this
  37697. },
  37698. setFromAxisAngle: function(e, t) {
  37699. var i = t / 2
  37700. , n = Math.sin(i);
  37701. return this._x = e.x * n,
  37702. this._y = e.y * n,
  37703. this._z = e.z * n,
  37704. this._w = Math.cos(i),
  37705. this.onChangeCallback(),
  37706. this
  37707. },
  37708. setFromRotationMatrix: function(e) {
  37709. 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;
  37710. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37711. this._w = .25 / t,
  37712. this._x = (h - l) * t,
  37713. this._y = (o - c) * t,
  37714. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37715. this._w = (h - l) / t,
  37716. this._x = .25 * t,
  37717. this._y = (r + a) / t,
  37718. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37719. this._w = (o - c) / t,
  37720. this._x = (r + a) / t,
  37721. this._y = .25 * t,
  37722. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37723. this._w = (a - r) / t,
  37724. this._x = (o + c) / t,
  37725. this._y = (l + h) / t,
  37726. this._z = .25 * t),
  37727. this.onChangeCallback(),
  37728. this
  37729. },
  37730. setFromUnitVectors: function(e, t) {
  37731. return void 0 === Be && (Be = new Ci.Vector3),
  37732. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37733. 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),
  37734. this._x = Be.x,
  37735. this._y = Be.y,
  37736. this._z = Be.z,
  37737. this._w = Ve,
  37738. this.normalize(),
  37739. this
  37740. },
  37741. inverse: function() {
  37742. return this.conjugate().normalize(),
  37743. this
  37744. },
  37745. conjugate: function() {
  37746. return this._x *= -1,
  37747. this._y *= -1,
  37748. this._z *= -1,
  37749. this.onChangeCallback(),
  37750. this
  37751. },
  37752. dot: function(e) {
  37753. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37754. },
  37755. lengthSq: function() {
  37756. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37757. },
  37758. length: function() {
  37759. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37760. },
  37761. normalize: function() {
  37762. var e = this.length();
  37763. return 0 === e ? (this._x = 0,
  37764. this._y = 0,
  37765. this._z = 0,
  37766. this._w = 1) : (e = 1 / e,
  37767. this._x = this._x * e,
  37768. this._y = this._y * e,
  37769. this._z = this._z * e,
  37770. this._w = this._w * e),
  37771. this.onChangeCallback(),
  37772. this
  37773. },
  37774. multiply: function(e, t) {
  37775. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37776. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37777. },
  37778. multiplyQuaternions: function(e, t) {
  37779. var i = e._x
  37780. , n = e._y
  37781. , r = e._z
  37782. , o = e._w
  37783. , a = t._x
  37784. , s = t._y
  37785. , l = t._z
  37786. , c = t._w;
  37787. return this._x = i * c + o * a + n * l - r * s,
  37788. this._y = n * c + o * s + r * a - i * l,
  37789. this._z = r * c + o * l + i * s - n * a,
  37790. this._w = o * c - i * a - n * s - r * l,
  37791. this.onChangeCallback(),
  37792. this
  37793. },
  37794. slerp: function(e, t) {
  37795. if (0 === t)
  37796. return this;
  37797. if (1 === t)
  37798. return this.copy(e);
  37799. var i = this._x
  37800. , n = this._y
  37801. , r = this._z
  37802. , o = this._w
  37803. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37804. if (a < 0 ? (this._w = -e._w,
  37805. this._x = -e._x,
  37806. this._y = -e._y,
  37807. this._z = -e._z,
  37808. a = -a) : this.copy(e),
  37809. 1 <= a)
  37810. return this._w = o,
  37811. this._x = i,
  37812. this._y = n,
  37813. this._z = r,
  37814. this;
  37815. var s = Math.sqrt(1 - a * a);
  37816. if (Math.abs(s) < .001)
  37817. return this._w = .5 * (o + this._w),
  37818. this._x = .5 * (i + this._x),
  37819. this._y = .5 * (n + this._y),
  37820. this._z = .5 * (r + this._z),
  37821. this;
  37822. var l = Math.atan2(s, a)
  37823. , c = Math.sin((1 - t) * l) / s
  37824. , h = Math.sin(t * l) / s;
  37825. return this._w = o * c + this._w * h,
  37826. this._x = i * c + this._x * h,
  37827. this._y = n * c + this._y * h,
  37828. this._z = r * c + this._z * h,
  37829. this.onChangeCallback(),
  37830. this
  37831. },
  37832. equals: function(e) {
  37833. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37834. },
  37835. fromArray: function(e, t) {
  37836. return void 0 === t && (t = 0),
  37837. this._x = e[t],
  37838. this._y = e[t + 1],
  37839. this._z = e[t + 2],
  37840. this._w = e[t + 3],
  37841. this.onChangeCallback(),
  37842. this
  37843. },
  37844. toArray: function(e, t) {
  37845. return void 0 === e && (e = []),
  37846. void 0 === t && (t = 0),
  37847. e[t] = this._x,
  37848. e[t + 1] = this._y,
  37849. e[t + 2] = this._z,
  37850. e[t + 3] = this._w,
  37851. e
  37852. },
  37853. onChange: function(e) {
  37854. return this.onChangeCallback = e,
  37855. this
  37856. },
  37857. onChangeCallback: function() {}
  37858. },
  37859. Object.assign(Ci.Quaternion, {
  37860. slerp: function(e, t, i, n) {
  37861. return i.copy(e).slerp(t, n)
  37862. },
  37863. slerpFlat: function(e, t, i, n, r, o, a) {
  37864. var s = i[n + 0]
  37865. , l = i[n + 1]
  37866. , c = i[n + 2]
  37867. , h = i[n + 3]
  37868. , u = r[o + 0]
  37869. , d = r[o + 1]
  37870. , p = r[o + 2]
  37871. , f = r[o + 3];
  37872. if (h !== f || s !== u || l !== d || c !== p) {
  37873. var g = 1 - a
  37874. , m = s * u + l * d + c * p + h * f
  37875. , v = 0 <= m ? 1 : -1
  37876. , y = 1 - m * m;
  37877. if (y > Number.EPSILON) {
  37878. var A = Math.sqrt(y)
  37879. , C = Math.atan2(A, m * v);
  37880. g = Math.sin(g * C) / A,
  37881. a = Math.sin(a * C) / A
  37882. }
  37883. var I = a * v;
  37884. if (s = s * g + u * I,
  37885. l = l * g + d * I,
  37886. c = c * g + p * I,
  37887. h = h * g + f * I,
  37888. g === 1 - a) {
  37889. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37890. s *= E,
  37891. l *= E,
  37892. c *= E,
  37893. h *= E
  37894. }
  37895. }
  37896. e[t] = s,
  37897. e[t + 1] = l,
  37898. e[t + 2] = c,
  37899. e[t + 3] = h
  37900. }
  37901. }),
  37902. Ci.Vector2 = function(e, t) {
  37903. this.x = e || 0,
  37904. this.y = t || 0
  37905. }
  37906. ,
  37907. Ci.Vector2.prototype = {
  37908. constructor: Ci.Vector2,
  37909. get width() {
  37910. return this.x
  37911. },
  37912. set width(e) {
  37913. this.x = e
  37914. },
  37915. get height() {
  37916. return this.y
  37917. },
  37918. set height(e) {
  37919. this.y = e
  37920. },
  37921. set: function(e, t) {
  37922. return this.x = e,
  37923. this.y = t,
  37924. this
  37925. },
  37926. setScalar: function(e) {
  37927. return this.x = e,
  37928. this.y = e,
  37929. this
  37930. },
  37931. setX: function(e) {
  37932. return this.x = e,
  37933. this
  37934. },
  37935. setY: function(e) {
  37936. return this.y = e,
  37937. this
  37938. },
  37939. setComponent: function(e, t) {
  37940. switch (e) {
  37941. case 0:
  37942. this.x = t;
  37943. break;
  37944. case 1:
  37945. this.y = t;
  37946. break;
  37947. default:
  37948. throw new Error("index is out of range: " + e)
  37949. }
  37950. },
  37951. getComponent: function(e) {
  37952. switch (e) {
  37953. case 0:
  37954. return this.x;
  37955. case 1:
  37956. return this.y;
  37957. default:
  37958. throw new Error("index is out of range: " + e)
  37959. }
  37960. },
  37961. clone: function() {
  37962. return new this.constructor(this.x,this.y)
  37963. },
  37964. copy: function(e) {
  37965. return this.x = e.x,
  37966. this.y = e.y,
  37967. this
  37968. },
  37969. add: function(e, t) {
  37970. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37971. this.addVectors(e, t)) : (this.x += e.x,
  37972. this.y += e.y,
  37973. this)
  37974. },
  37975. addScalar: function(e) {
  37976. return this.x += e,
  37977. this.y += e,
  37978. this
  37979. },
  37980. addVectors: function(e, t) {
  37981. return this.x = e.x + t.x,
  37982. this.y = e.y + t.y,
  37983. this
  37984. },
  37985. addScaledVector: function(e, t) {
  37986. return this.x += e.x * t,
  37987. this.y += e.y * t,
  37988. this
  37989. },
  37990. sub: function(e, t) {
  37991. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37992. this.subVectors(e, t)) : (this.x -= e.x,
  37993. this.y -= e.y,
  37994. this)
  37995. },
  37996. subScalar: function(e) {
  37997. return this.x -= e,
  37998. this.y -= e,
  37999. this
  38000. },
  38001. subVectors: function(e, t) {
  38002. return this.x = e.x - t.x,
  38003. this.y = e.y - t.y,
  38004. this
  38005. },
  38006. multiply: function(e) {
  38007. return this.x *= e.x,
  38008. this.y *= e.y,
  38009. this
  38010. },
  38011. multiplyScalar: function(e) {
  38012. return isFinite(e) ? (this.x *= e,
  38013. this.y *= e) : (this.x = 0,
  38014. this.y = 0),
  38015. this
  38016. },
  38017. divide: function(e) {
  38018. return this.x /= e.x,
  38019. this.y /= e.y,
  38020. this
  38021. },
  38022. divideScalar: function(e) {
  38023. return this.multiplyScalar(1 / e)
  38024. },
  38025. min: function(e) {
  38026. return this.x = Math.min(this.x, e.x),
  38027. this.y = Math.min(this.y, e.y),
  38028. this
  38029. },
  38030. max: function(e) {
  38031. return this.x = Math.max(this.x, e.x),
  38032. this.y = Math.max(this.y, e.y),
  38033. this
  38034. },
  38035. clamp: function(e, t) {
  38036. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38037. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38038. this
  38039. },
  38040. clampScalar: function(e, t) {
  38041. return void 0 === Ne && (Ne = new Ci.Vector2,
  38042. Fe = new Ci.Vector2),
  38043. Ne.set(e, e),
  38044. Fe.set(t, t),
  38045. this.clamp(Ne, Fe)
  38046. },
  38047. clampLength: function(e, t) {
  38048. var i = this.length();
  38049. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38050. this
  38051. },
  38052. floor: function() {
  38053. return this.x = Math.floor(this.x),
  38054. this.y = Math.floor(this.y),
  38055. this
  38056. },
  38057. ceil: function() {
  38058. return this.x = Math.ceil(this.x),
  38059. this.y = Math.ceil(this.y),
  38060. this
  38061. },
  38062. round: function() {
  38063. return this.x = Math.round(this.x),
  38064. this.y = Math.round(this.y),
  38065. this
  38066. },
  38067. roundToZero: function() {
  38068. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38069. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38070. this
  38071. },
  38072. negate: function() {
  38073. return this.x = -this.x,
  38074. this.y = -this.y,
  38075. this
  38076. },
  38077. dot: function(e) {
  38078. return this.x * e.x + this.y * e.y
  38079. },
  38080. lengthSq: function() {
  38081. return this.x * this.x + this.y * this.y
  38082. },
  38083. length: function() {
  38084. return Math.sqrt(this.x * this.x + this.y * this.y)
  38085. },
  38086. lengthManhattan: function() {
  38087. return Math.abs(this.x) + Math.abs(this.y)
  38088. },
  38089. normalize: function() {
  38090. return this.divideScalar(this.length())
  38091. },
  38092. angle: function() {
  38093. var e = Math.atan2(this.y, this.x);
  38094. return e < 0 && (e += 2 * Math.PI),
  38095. e
  38096. },
  38097. distanceTo: function(e) {
  38098. return Math.sqrt(this.distanceToSquared(e))
  38099. },
  38100. distanceToSquared: function(e) {
  38101. var t = this.x - e.x
  38102. , i = this.y - e.y;
  38103. return t * t + i * i
  38104. },
  38105. setLength: function(e) {
  38106. return this.multiplyScalar(e / this.length())
  38107. },
  38108. lerp: function(e, t) {
  38109. return this.x += (e.x - this.x) * t,
  38110. this.y += (e.y - this.y) * t,
  38111. this
  38112. },
  38113. lerpVectors: function(e, t, i) {
  38114. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38115. this
  38116. },
  38117. equals: function(e) {
  38118. return e.x === this.x && e.y === this.y
  38119. },
  38120. fromArray: function(e, t) {
  38121. return void 0 === t && (t = 0),
  38122. this.x = e[t],
  38123. this.y = e[t + 1],
  38124. this
  38125. },
  38126. toArray: function(e, t) {
  38127. return void 0 === e && (e = []),
  38128. void 0 === t && (t = 0),
  38129. e[t] = this.x,
  38130. e[t + 1] = this.y,
  38131. e
  38132. },
  38133. fromAttribute: function(e, t, i) {
  38134. return void 0 === i && (i = 0),
  38135. t = t * e.itemSize + i,
  38136. this.x = e.array[t],
  38137. this.y = e.array[t + 1],
  38138. this
  38139. },
  38140. rotateAround: function(e, t) {
  38141. var i = Math.cos(t)
  38142. , n = Math.sin(t)
  38143. , r = this.x - e.x
  38144. , o = this.y - e.y;
  38145. return this.x = r * i - o * n + e.x,
  38146. this.y = r * n + o * i + e.y,
  38147. this
  38148. }
  38149. },
  38150. Ci.Vector3 = function(e, t, i) {
  38151. this.x = e || 0,
  38152. this.y = t || 0,
  38153. this.z = i || 0
  38154. }
  38155. ,
  38156. Ci.Vector3.prototype = {
  38157. constructor: Ci.Vector3,
  38158. set: function(e, t, i) {
  38159. return this.x = e,
  38160. this.y = t,
  38161. this.z = i,
  38162. this
  38163. },
  38164. setScalar: function(e) {
  38165. return this.x = e,
  38166. this.y = e,
  38167. this.z = e,
  38168. this
  38169. },
  38170. setX: function(e) {
  38171. return this.x = e,
  38172. this
  38173. },
  38174. setY: function(e) {
  38175. return this.y = e,
  38176. this
  38177. },
  38178. setZ: function(e) {
  38179. return this.z = e,
  38180. this
  38181. },
  38182. setComponent: function(e, t) {
  38183. switch (e) {
  38184. case 0:
  38185. this.x = t;
  38186. break;
  38187. case 1:
  38188. this.y = t;
  38189. break;
  38190. case 2:
  38191. this.z = t;
  38192. break;
  38193. default:
  38194. throw new Error("index is out of range: " + e)
  38195. }
  38196. },
  38197. getComponent: function(e) {
  38198. switch (e) {
  38199. case 0:
  38200. return this.x;
  38201. case 1:
  38202. return this.y;
  38203. case 2:
  38204. return this.z;
  38205. default:
  38206. throw new Error("index is out of range: " + e)
  38207. }
  38208. },
  38209. clone: function() {
  38210. return new this.constructor(this.x,this.y,this.z)
  38211. },
  38212. copy: function(e) {
  38213. return this.x = e.x,
  38214. this.y = e.y,
  38215. this.z = e.z,
  38216. this
  38217. },
  38218. add: function(e, t) {
  38219. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38220. this.addVectors(e, t)) : (this.x += e.x,
  38221. this.y += e.y,
  38222. this.z += e.z,
  38223. this)
  38224. },
  38225. addScalar: function(e) {
  38226. return this.x += e,
  38227. this.y += e,
  38228. this.z += e,
  38229. this
  38230. },
  38231. addVectors: function(e, t) {
  38232. return this.x = e.x + t.x,
  38233. this.y = e.y + t.y,
  38234. this.z = e.z + t.z,
  38235. this
  38236. },
  38237. addScaledVector: function(e, t) {
  38238. return this.x += e.x * t,
  38239. this.y += e.y * t,
  38240. this.z += e.z * t,
  38241. this
  38242. },
  38243. sub: function(e, t) {
  38244. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38245. this.subVectors(e, t)) : (this.x -= e.x,
  38246. this.y -= e.y,
  38247. this.z -= e.z,
  38248. this)
  38249. },
  38250. subScalar: function(e) {
  38251. return this.x -= e,
  38252. this.y -= e,
  38253. this.z -= e,
  38254. this
  38255. },
  38256. subVectors: function(e, t) {
  38257. return this.x = e.x - t.x,
  38258. this.y = e.y - t.y,
  38259. this.z = e.z - t.z,
  38260. this
  38261. },
  38262. multiply: function(e, t) {
  38263. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38264. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38265. this.y *= e.y,
  38266. this.z *= e.z,
  38267. this)
  38268. },
  38269. multiplyScalar: function(e) {
  38270. return isFinite(e) ? (this.x *= e,
  38271. this.y *= e,
  38272. this.z *= e) : (this.x = 0,
  38273. this.y = 0,
  38274. this.z = 0),
  38275. this
  38276. },
  38277. multiplyVectors: function(e, t) {
  38278. return this.x = e.x * t.x,
  38279. this.y = e.y * t.y,
  38280. this.z = e.z * t.z,
  38281. this
  38282. },
  38283. applyEuler: function(e) {
  38284. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38285. void 0 === De && (De = new Ci.Quaternion),
  38286. this.applyQuaternion(De.setFromEuler(e)),
  38287. this
  38288. },
  38289. applyAxisAngle: function(e, t) {
  38290. return void 0 === Le && (Le = new Ci.Quaternion),
  38291. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38292. this
  38293. },
  38294. applyMatrix3: function(e) {
  38295. var t = this.x
  38296. , i = this.y
  38297. , n = this.z
  38298. , r = e.elements;
  38299. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38300. this.y = r[1] * t + r[4] * i + r[7] * n,
  38301. this.z = r[2] * t + r[5] * i + r[8] * n,
  38302. this
  38303. },
  38304. applyMatrix4: function(e) {
  38305. var t = this.x
  38306. , i = this.y
  38307. , n = this.z
  38308. , r = e.elements;
  38309. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38310. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38311. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38312. this
  38313. },
  38314. applyProjection: function(e) {
  38315. var t = this.x
  38316. , i = this.y
  38317. , n = this.z
  38318. , r = e.elements
  38319. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38320. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38321. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38322. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38323. this
  38324. },
  38325. applyQuaternion: function(e) {
  38326. var t = this.x
  38327. , i = this.y
  38328. , n = this.z
  38329. , r = e.x
  38330. , o = e.y
  38331. , a = e.z
  38332. , s = e.w
  38333. , l = s * t + o * n - a * i
  38334. , c = s * i + a * t - r * n
  38335. , h = s * n + r * i - o * t
  38336. , u = -r * t - o * i - a * n;
  38337. return this.x = l * s + u * -r + c * -a - h * -o,
  38338. this.y = c * s + u * -o + h * -r - l * -a,
  38339. this.z = h * s + u * -a + l * -o - c * -r,
  38340. this
  38341. },
  38342. project: function(e) {
  38343. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38344. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38345. this.applyProjection(Oe)
  38346. },
  38347. unproject: function(e) {
  38348. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38349. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38350. this.applyProjection(Pe)
  38351. },
  38352. transformDirection: function(e) {
  38353. var t = this.x
  38354. , i = this.y
  38355. , n = this.z
  38356. , r = e.elements;
  38357. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38358. this.y = r[1] * t + r[5] * i + r[9] * n,
  38359. this.z = r[2] * t + r[6] * i + r[10] * n,
  38360. this.normalize(),
  38361. this
  38362. },
  38363. divide: function(e) {
  38364. return this.x /= e.x,
  38365. this.y /= e.y,
  38366. this.z /= e.z,
  38367. this
  38368. },
  38369. divideScalar: function(e) {
  38370. return this.multiplyScalar(1 / e)
  38371. },
  38372. min: function(e) {
  38373. return this.x = Math.min(this.x, e.x),
  38374. this.y = Math.min(this.y, e.y),
  38375. this.z = Math.min(this.z, e.z),
  38376. this
  38377. },
  38378. max: function(e) {
  38379. return this.x = Math.max(this.x, e.x),
  38380. this.y = Math.max(this.y, e.y),
  38381. this.z = Math.max(this.z, e.z),
  38382. this
  38383. },
  38384. clamp: function(e, t) {
  38385. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38386. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38387. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38388. this
  38389. },
  38390. clampScalar: function(e, t) {
  38391. return void 0 === Me && (Me = new Ci.Vector3,
  38392. Re = new Ci.Vector3),
  38393. Me.set(e, e, e),
  38394. Re.set(t, t, t),
  38395. this.clamp(Me, Re)
  38396. },
  38397. clampLength: function(e, t) {
  38398. var i = this.length();
  38399. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38400. this
  38401. },
  38402. floor: function() {
  38403. return this.x = Math.floor(this.x),
  38404. this.y = Math.floor(this.y),
  38405. this.z = Math.floor(this.z),
  38406. this
  38407. },
  38408. ceil: function() {
  38409. return this.x = Math.ceil(this.x),
  38410. this.y = Math.ceil(this.y),
  38411. this.z = Math.ceil(this.z),
  38412. this
  38413. },
  38414. round: function() {
  38415. return this.x = Math.round(this.x),
  38416. this.y = Math.round(this.y),
  38417. this.z = Math.round(this.z),
  38418. this
  38419. },
  38420. roundToZero: function() {
  38421. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38422. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38423. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38424. this
  38425. },
  38426. negate: function() {
  38427. return this.x = -this.x,
  38428. this.y = -this.y,
  38429. this.z = -this.z,
  38430. this
  38431. },
  38432. dot: function(e) {
  38433. return this.x * e.x + this.y * e.y + this.z * e.z
  38434. },
  38435. lengthSq: function() {
  38436. return this.x * this.x + this.y * this.y + this.z * this.z
  38437. },
  38438. length: function() {
  38439. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38440. },
  38441. lengthManhattan: function() {
  38442. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38443. },
  38444. normalize: function() {
  38445. return this.divideScalar(this.length())
  38446. },
  38447. setLength: function(e) {
  38448. return this.multiplyScalar(e / this.length())
  38449. },
  38450. lerp: function(e, t) {
  38451. return this.x += (e.x - this.x) * t,
  38452. this.y += (e.y - this.y) * t,
  38453. this.z += (e.z - this.z) * t,
  38454. this
  38455. },
  38456. lerpVectors: function(e, t, i) {
  38457. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38458. this
  38459. },
  38460. cross: function(e, t) {
  38461. if (void 0 !== t)
  38462. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38463. this.crossVectors(e, t);
  38464. var i = this.x
  38465. , n = this.y
  38466. , r = this.z;
  38467. return this.x = n * e.z - r * e.y,
  38468. this.y = r * e.x - i * e.z,
  38469. this.z = i * e.y - n * e.x,
  38470. this
  38471. },
  38472. crossVectors: function(e, t) {
  38473. var i = e.x
  38474. , n = e.y
  38475. , r = e.z
  38476. , o = t.x
  38477. , a = t.y
  38478. , s = t.z;
  38479. return this.x = n * s - r * a,
  38480. this.y = r * o - i * s,
  38481. this.z = i * a - n * o,
  38482. this
  38483. },
  38484. projectOnVector: function(e) {
  38485. return void 0 === xe && (xe = new Ci.Vector3),
  38486. xe.copy(e).normalize(),
  38487. Se = this.dot(xe),
  38488. this.copy(xe).multiplyScalar(Se)
  38489. },
  38490. projectOnPlane: function(e) {
  38491. return void 0 === Te && (Te = new Ci.Vector3),
  38492. Te.copy(this).projectOnVector(e),
  38493. this.sub(Te)
  38494. },
  38495. reflect: function(e) {
  38496. return void 0 === we && (we = new Ci.Vector3),
  38497. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38498. },
  38499. angleTo: function(e) {
  38500. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38501. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38502. },
  38503. distanceTo: function(e) {
  38504. return Math.sqrt(this.distanceToSquared(e))
  38505. },
  38506. distanceToSquared: function(e) {
  38507. var t = this.x - e.x
  38508. , i = this.y - e.y
  38509. , n = this.z - e.z;
  38510. return t * t + i * i + n * n
  38511. },
  38512. setFromSpherical: function(e) {
  38513. var t = Math.sin(e.phi) * e.radius;
  38514. return this.x = t * Math.sin(e.theta),
  38515. this.y = Math.cos(e.phi) * e.radius,
  38516. this.z = t * Math.cos(e.theta),
  38517. this
  38518. },
  38519. setFromMatrixPosition: function(e) {
  38520. return this.setFromMatrixColumn(e, 3)
  38521. },
  38522. setFromMatrixScale: function(e) {
  38523. var t = this.setFromMatrixColumn(e, 0).length()
  38524. , i = this.setFromMatrixColumn(e, 1).length()
  38525. , n = this.setFromMatrixColumn(e, 2).length();
  38526. return this.x = t,
  38527. this.y = i,
  38528. this.z = n,
  38529. this
  38530. },
  38531. setFromMatrixColumn: function(e, t) {
  38532. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38533. t = e = t),
  38534. this.fromArray(e.elements, 4 * t)
  38535. },
  38536. equals: function(e) {
  38537. return e.x === this.x && e.y === this.y && e.z === this.z
  38538. },
  38539. fromArray: function(e, t) {
  38540. return void 0 === t && (t = 0),
  38541. this.x = e[t],
  38542. this.y = e[t + 1],
  38543. this.z = e[t + 2],
  38544. this
  38545. },
  38546. toArray: function(e, t) {
  38547. return void 0 === e && (e = []),
  38548. void 0 === t && (t = 0),
  38549. e[t] = this.x,
  38550. e[t + 1] = this.y,
  38551. e[t + 2] = this.z,
  38552. e
  38553. },
  38554. fromAttribute: function(e, t, i) {
  38555. return void 0 === i && (i = 0),
  38556. t = t * e.itemSize + i,
  38557. this.x = e.array[t],
  38558. this.y = e.array[t + 1],
  38559. this.z = e.array[t + 2],
  38560. this
  38561. }
  38562. },
  38563. Ci.Vector4 = function(e, t, i, n) {
  38564. this.x = e || 0,
  38565. this.y = t || 0,
  38566. this.z = i || 0,
  38567. this.w = void 0 !== n ? n : 1
  38568. }
  38569. ,
  38570. Ci.Vector4.prototype = {
  38571. constructor: Ci.Vector4,
  38572. set: function(e, t, i, n) {
  38573. return this.x = e,
  38574. this.y = t,
  38575. this.z = i,
  38576. this.w = n,
  38577. this
  38578. },
  38579. setScalar: function(e) {
  38580. return this.x = e,
  38581. this.y = e,
  38582. this.z = e,
  38583. this.w = e,
  38584. this
  38585. },
  38586. setX: function(e) {
  38587. return this.x = e,
  38588. this
  38589. },
  38590. setY: function(e) {
  38591. return this.y = e,
  38592. this
  38593. },
  38594. setZ: function(e) {
  38595. return this.z = e,
  38596. this
  38597. },
  38598. setW: function(e) {
  38599. return this.w = e,
  38600. this
  38601. },
  38602. setComponent: function(e, t) {
  38603. switch (e) {
  38604. case 0:
  38605. this.x = t;
  38606. break;
  38607. case 1:
  38608. this.y = t;
  38609. break;
  38610. case 2:
  38611. this.z = t;
  38612. break;
  38613. case 3:
  38614. this.w = t;
  38615. break;
  38616. default:
  38617. throw new Error("index is out of range: " + e)
  38618. }
  38619. },
  38620. getComponent: function(e) {
  38621. switch (e) {
  38622. case 0:
  38623. return this.x;
  38624. case 1:
  38625. return this.y;
  38626. case 2:
  38627. return this.z;
  38628. case 3:
  38629. return this.w;
  38630. default:
  38631. throw new Error("index is out of range: " + e)
  38632. }
  38633. },
  38634. clone: function() {
  38635. return new this.constructor(this.x,this.y,this.z,this.w)
  38636. },
  38637. copy: function(e) {
  38638. return this.x = e.x,
  38639. this.y = e.y,
  38640. this.z = e.z,
  38641. this.w = void 0 !== e.w ? e.w : 1,
  38642. this
  38643. },
  38644. add: function(e, t) {
  38645. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38646. this.addVectors(e, t)) : (this.x += e.x,
  38647. this.y += e.y,
  38648. this.z += e.z,
  38649. this.w += e.w,
  38650. this)
  38651. },
  38652. addScalar: function(e) {
  38653. return this.x += e,
  38654. this.y += e,
  38655. this.z += e,
  38656. this.w += e,
  38657. this
  38658. },
  38659. addVectors: function(e, t) {
  38660. return this.x = e.x + t.x,
  38661. this.y = e.y + t.y,
  38662. this.z = e.z + t.z,
  38663. this.w = e.w + t.w,
  38664. this
  38665. },
  38666. addScaledVector: function(e, t) {
  38667. return this.x += e.x * t,
  38668. this.y += e.y * t,
  38669. this.z += e.z * t,
  38670. this.w += e.w * t,
  38671. this
  38672. },
  38673. sub: function(e, t) {
  38674. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38675. this.subVectors(e, t)) : (this.x -= e.x,
  38676. this.y -= e.y,
  38677. this.z -= e.z,
  38678. this.w -= e.w,
  38679. this)
  38680. },
  38681. subScalar: function(e) {
  38682. return this.x -= e,
  38683. this.y -= e,
  38684. this.z -= e,
  38685. this.w -= e,
  38686. this
  38687. },
  38688. subVectors: function(e, t) {
  38689. return this.x = e.x - t.x,
  38690. this.y = e.y - t.y,
  38691. this.z = e.z - t.z,
  38692. this.w = e.w - t.w,
  38693. this
  38694. },
  38695. multiplyScalar: function(e) {
  38696. return isFinite(e) ? (this.x *= e,
  38697. this.y *= e,
  38698. this.z *= e,
  38699. this.w *= e) : (this.x = 0,
  38700. this.y = 0,
  38701. this.z = 0,
  38702. this.w = 0),
  38703. this
  38704. },
  38705. applyMatrix4: function(e) {
  38706. var t = this.x
  38707. , i = this.y
  38708. , n = this.z
  38709. , r = this.w
  38710. , o = e.elements;
  38711. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38712. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38713. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38714. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38715. this
  38716. },
  38717. divideScalar: function(e) {
  38718. return this.multiplyScalar(1 / e)
  38719. },
  38720. setAxisAngleFromQuaternion: function(e) {
  38721. this.w = 2 * Math.acos(e.w);
  38722. var t = Math.sqrt(1 - e.w * e.w);
  38723. return t < 1e-4 ? (this.x = 1,
  38724. this.y = 0,
  38725. this.z = 0) : (this.x = e.x / t,
  38726. this.y = e.y / t,
  38727. this.z = e.z / t),
  38728. this
  38729. },
  38730. setAxisAngleFromRotationMatrix: function(e) {
  38731. 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];
  38732. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38733. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38734. return this.set(1, 0, 0, 0),
  38735. this;
  38736. t = Math.PI;
  38737. var g = (a + 1) / 2
  38738. , m = (h + 1) / 2
  38739. , v = (f + 1) / 2
  38740. , y = (s + c) / 4
  38741. , A = (l + d) / 4
  38742. , C = (u + p) / 4;
  38743. return m < g && v < g ? r = g < .01 ? (i = 0,
  38744. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38745. A / i) : v < m ? r = m < .01 ? (n = 0,
  38746. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38747. C / n) : v < .01 ? (n = i = .707106781,
  38748. r = 0) : (i = A / (r = Math.sqrt(v)),
  38749. n = C / r),
  38750. this.set(i, n, r, t),
  38751. this
  38752. }
  38753. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38754. return Math.abs(I) < .001 && (I = 1),
  38755. this.x = (p - u) / I,
  38756. this.y = (l - d) / I,
  38757. this.z = (c - s) / I,
  38758. this.w = Math.acos((a + h + f - 1) / 2),
  38759. this
  38760. },
  38761. min: function(e) {
  38762. return this.x = Math.min(this.x, e.x),
  38763. this.y = Math.min(this.y, e.y),
  38764. this.z = Math.min(this.z, e.z),
  38765. this.w = Math.min(this.w, e.w),
  38766. this
  38767. },
  38768. max: function(e) {
  38769. return this.x = Math.max(this.x, e.x),
  38770. this.y = Math.max(this.y, e.y),
  38771. this.z = Math.max(this.z, e.z),
  38772. this.w = Math.max(this.w, e.w),
  38773. this
  38774. },
  38775. clamp: function(e, t) {
  38776. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38777. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38778. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38779. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38780. this
  38781. },
  38782. clampScalar: function(e, t) {
  38783. return void 0 === _e && (_e = new Ci.Vector4,
  38784. be = new Ci.Vector4),
  38785. _e.set(e, e, e, e),
  38786. be.set(t, t, t, t),
  38787. this.clamp(_e, be)
  38788. },
  38789. floor: function() {
  38790. return this.x = Math.floor(this.x),
  38791. this.y = Math.floor(this.y),
  38792. this.z = Math.floor(this.z),
  38793. this.w = Math.floor(this.w),
  38794. this
  38795. },
  38796. ceil: function() {
  38797. return this.x = Math.ceil(this.x),
  38798. this.y = Math.ceil(this.y),
  38799. this.z = Math.ceil(this.z),
  38800. this.w = Math.ceil(this.w),
  38801. this
  38802. },
  38803. round: function() {
  38804. return this.x = Math.round(this.x),
  38805. this.y = Math.round(this.y),
  38806. this.z = Math.round(this.z),
  38807. this.w = Math.round(this.w),
  38808. this
  38809. },
  38810. roundToZero: function() {
  38811. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38812. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38813. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38814. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38815. this
  38816. },
  38817. negate: function() {
  38818. return this.x = -this.x,
  38819. this.y = -this.y,
  38820. this.z = -this.z,
  38821. this.w = -this.w,
  38822. this
  38823. },
  38824. dot: function(e) {
  38825. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38826. },
  38827. lengthSq: function() {
  38828. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38829. },
  38830. length: function() {
  38831. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38832. },
  38833. lengthManhattan: function() {
  38834. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38835. },
  38836. normalize: function() {
  38837. return this.divideScalar(this.length())
  38838. },
  38839. setLength: function(e) {
  38840. return this.multiplyScalar(e / this.length())
  38841. },
  38842. lerp: function(e, t) {
  38843. return this.x += (e.x - this.x) * t,
  38844. this.y += (e.y - this.y) * t,
  38845. this.z += (e.z - this.z) * t,
  38846. this.w += (e.w - this.w) * t,
  38847. this
  38848. },
  38849. lerpVectors: function(e, t, i) {
  38850. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38851. this
  38852. },
  38853. equals: function(e) {
  38854. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38855. },
  38856. fromArray: function(e, t) {
  38857. return void 0 === t && (t = 0),
  38858. this.x = e[t],
  38859. this.y = e[t + 1],
  38860. this.z = e[t + 2],
  38861. this.w = e[t + 3],
  38862. this
  38863. },
  38864. toArray: function(e, t) {
  38865. return void 0 === e && (e = []),
  38866. void 0 === t && (t = 0),
  38867. e[t] = this.x,
  38868. e[t + 1] = this.y,
  38869. e[t + 2] = this.z,
  38870. e[t + 3] = this.w,
  38871. e
  38872. },
  38873. fromAttribute: function(e, t, i) {
  38874. return void 0 === i && (i = 0),
  38875. t = t * e.itemSize + i,
  38876. this.x = e.array[t],
  38877. this.y = e.array[t + 1],
  38878. this.z = e.array[t + 2],
  38879. this.w = e.array[t + 3],
  38880. this
  38881. }
  38882. },
  38883. Ci.Euler = function(e, t, i, n) {
  38884. this._x = e || 0,
  38885. this._y = t || 0,
  38886. this._z = i || 0,
  38887. this._order = n || Ci.Euler.DefaultOrder
  38888. }
  38889. ,
  38890. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38891. Ci.Euler.DefaultOrder = "XYZ",
  38892. Ci.Euler.prototype = {
  38893. constructor: Ci.Euler,
  38894. get x() {
  38895. return this._x
  38896. },
  38897. set x(e) {
  38898. this._x = e,
  38899. this.onChangeCallback()
  38900. },
  38901. get y() {
  38902. return this._y
  38903. },
  38904. set y(e) {
  38905. this._y = e,
  38906. this.onChangeCallback()
  38907. },
  38908. get z() {
  38909. return this._z
  38910. },
  38911. set z(e) {
  38912. this._z = e,
  38913. this.onChangeCallback()
  38914. },
  38915. get order() {
  38916. return this._order
  38917. },
  38918. set order(e) {
  38919. this._order = e,
  38920. this.onChangeCallback()
  38921. },
  38922. set: function(e, t, i, n) {
  38923. return this._x = e,
  38924. this._y = t,
  38925. this._z = i,
  38926. this._order = n || this._order,
  38927. this.onChangeCallback(),
  38928. this
  38929. },
  38930. clone: function() {
  38931. return new this.constructor(this._x,this._y,this._z,this._order)
  38932. },
  38933. copy: function(e) {
  38934. return this._x = e._x,
  38935. this._y = e._y,
  38936. this._z = e._z,
  38937. this._order = e._order,
  38938. this.onChangeCallback(),
  38939. this
  38940. },
  38941. toObject: function() {//xzw
  38942. return {x:this.x,y:this.y,z:this.z}
  38943. },
  38944. setFromRotationMatrix: function(e, t, i) {
  38945. var n = Ci.Math.clamp
  38946. , r = e.elements
  38947. , o = r[0]
  38948. , a = r[4]
  38949. , s = r[8]
  38950. , l = r[1]
  38951. , c = r[5]
  38952. , h = r[9]
  38953. , u = r[2]
  38954. , d = r[6]
  38955. , p = r[10];
  38956. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38957. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38958. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38959. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38960. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38961. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38962. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38963. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38964. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38965. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38966. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38967. this._z = Math.atan2(l, o)) : (this._x = 0,
  38968. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38969. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38970. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38971. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38972. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38973. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38974. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38975. this._order = t,
  38976. !1 !== i && this.onChangeCallback(),
  38977. this
  38978. },
  38979. setFromQuaternion: function(e, t, i) {
  38980. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38981. Ee.makeRotationFromQuaternion(e),
  38982. this.setFromRotationMatrix(Ee, t, i),
  38983. this
  38984. },
  38985. setFromVector3: function(e, t) {
  38986. return this.set(e.x, e.y, e.z, t || this._order)
  38987. },
  38988. reorder: (Ie = new Ci.Quaternion,
  38989. function(e) {
  38990. Ie.setFromEuler(this),
  38991. this.setFromQuaternion(Ie, e)
  38992. }
  38993. ),
  38994. equals: function(e) {
  38995. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38996. },
  38997. fromArray: function(e) {
  38998. return this._x = e[0],
  38999. this._y = e[1],
  39000. this._z = e[2],
  39001. void 0 !== e[3] && (this._order = e[3]),
  39002. this.onChangeCallback(),
  39003. this
  39004. },
  39005. toArray: function(e, t) {
  39006. return void 0 === e && (e = []),
  39007. void 0 === t && (t = 0),
  39008. e[t] = this._x,
  39009. e[t + 1] = this._y,
  39010. e[t + 2] = this._z,
  39011. e[t + 3] = this._order,
  39012. e
  39013. },
  39014. toVector3: function(e) {
  39015. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  39016. },
  39017. onChange: function(e) {
  39018. return this.onChangeCallback = e,
  39019. this
  39020. },
  39021. onChangeCallback: function() {}
  39022. },
  39023. Ci.Line3 = function(e, t) {
  39024. this.start = void 0 !== e ? e : new Ci.Vector3,
  39025. this.end = void 0 !== t ? t : new Ci.Vector3
  39026. }
  39027. ,
  39028. Ci.Line3.prototype = {
  39029. constructor: Ci.Line3,
  39030. set: function(e, t) {
  39031. return this.start.copy(e),
  39032. this.end.copy(t),
  39033. this
  39034. },
  39035. clone: function() {
  39036. return (new this.constructor).copy(this)
  39037. },
  39038. copy: function(e) {
  39039. return this.start.copy(e.start),
  39040. this.end.copy(e.end),
  39041. this
  39042. },
  39043. center: function(e) {
  39044. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  39045. },
  39046. delta: function(e) {
  39047. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39048. },
  39049. distanceSq: function() {
  39050. return this.start.distanceToSquared(this.end)
  39051. },
  39052. distance: function() {
  39053. return this.start.distanceTo(this.end)
  39054. },
  39055. at: function(e, t) {
  39056. var i = t || new Ci.Vector3;
  39057. return this.delta(i).multiplyScalar(e).add(this.start)
  39058. },
  39059. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39060. Ce = new Ci.Vector3,
  39061. function(e, t) {
  39062. Ae.subVectors(e, this.start),
  39063. Ce.subVectors(this.end, this.start);
  39064. var i = Ce.dot(Ce)
  39065. , n = Ce.dot(Ae) / i;
  39066. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39067. n
  39068. }
  39069. ),
  39070. closestPointToPoint: function(e, t, i) {
  39071. var n = this.closestPointToPointParameter(e, t)
  39072. , r = i || new Ci.Vector3;
  39073. return this.delta(r).multiplyScalar(n).add(this.start)
  39074. },
  39075. applyMatrix4: function(e) {
  39076. return this.start.applyMatrix4(e),
  39077. this.end.applyMatrix4(e),
  39078. this
  39079. },
  39080. equals: function(e) {
  39081. return e.start.equals(this.start) && e.end.equals(this.end)
  39082. }
  39083. },
  39084. Ci.Box2 = function(e, t) {
  39085. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39086. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39087. }
  39088. ,
  39089. Ci.Box2.prototype = {
  39090. constructor: Ci.Box2,
  39091. set: function(e, t) {
  39092. return this.min.copy(e),
  39093. this.max.copy(t),
  39094. this
  39095. },
  39096. setFromPoints: function(e) {
  39097. this.makeEmpty();
  39098. for (var t = 0, i = e.length; t < i; t++)
  39099. this.expandByPoint(e[t]);
  39100. return this
  39101. },
  39102. setFromCenterAndSize: (ye = new Ci.Vector2,
  39103. function(e, t) {
  39104. var i = ye.copy(t).multiplyScalar(.5);
  39105. return this.min.copy(e).sub(i),
  39106. this.max.copy(e).add(i),
  39107. this
  39108. }
  39109. ),
  39110. clone: function() {
  39111. return (new this.constructor).copy(this)
  39112. },
  39113. copy: function(e) {
  39114. return this.min.copy(e.min),
  39115. this.max.copy(e.max),
  39116. this
  39117. },
  39118. makeEmpty: function() {
  39119. return this.min.x = this.min.y = 1 / 0,
  39120. this.max.x = this.max.y = -1 / 0,
  39121. this
  39122. },
  39123. isEmpty: function() {
  39124. return this.max.x < this.min.x || this.max.y < this.min.y
  39125. },
  39126. center: function(e) {
  39127. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39128. },
  39129. size: function(e) {
  39130. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39131. },
  39132. expandByPoint: function(e) {
  39133. return this.min.min(e),
  39134. this.max.max(e),
  39135. this
  39136. },
  39137. expandByVector: function(e) {
  39138. return this.min.sub(e),
  39139. this.max.add(e),
  39140. this
  39141. },
  39142. expandByScalar: function(e) {
  39143. return this.min.addScalar(-e),
  39144. this.max.addScalar(e),
  39145. this
  39146. },
  39147. containsPoint: function(e) {
  39148. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39149. },
  39150. containsBox: function(e) {
  39151. 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
  39152. },
  39153. getParameter: function(e, t) {
  39154. 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))
  39155. },
  39156. intersectsBox: function(e) {
  39157. 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)
  39158. },
  39159. clampPoint: function(e, t) {
  39160. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39161. },
  39162. distanceToPoint: (ve = new Ci.Vector2,
  39163. function(e) {
  39164. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39165. }
  39166. ),
  39167. intersect: function(e) {
  39168. return this.min.max(e.min),
  39169. this.max.min(e.max),
  39170. this
  39171. },
  39172. union: function(e) {
  39173. return this.min.min(e.min),
  39174. this.max.max(e.max),
  39175. this
  39176. },
  39177. translate: function(e) {
  39178. return this.min.add(e),
  39179. this.max.add(e),
  39180. this
  39181. },
  39182. equals: function(e) {
  39183. return e.min.equals(this.min) && e.max.equals(this.max)
  39184. }
  39185. },
  39186. Ci.Box3 = function(e, t) {
  39187. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39188. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39189. }
  39190. ,
  39191. Ci.Box3.prototype = {
  39192. constructor: Ci.Box3,
  39193. set: function(e, t) {
  39194. return this.min.copy(e),
  39195. this.max.copy(t),
  39196. this
  39197. },
  39198. setFromArray: function(e) {
  39199. this.makeEmpty();
  39200. 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) {
  39201. var c = e[s]
  39202. , h = e[s + 1]
  39203. , u = e[s + 2];
  39204. c < t && (t = c),
  39205. h < i && (i = h),
  39206. u < n && (n = u),
  39207. r < c && (r = c),
  39208. o < h && (o = h),
  39209. a < u && (a = u)
  39210. }
  39211. this.min.set(t, i, n),
  39212. this.max.set(r, o, a)
  39213. },
  39214. setFromPoints: function(e) {
  39215. this.makeEmpty();
  39216. for (var t = 0, i = e.length; t < i; t++)
  39217. this.expandByPoint(e[t]);
  39218. return this
  39219. },
  39220. setFromCenterAndSize: (me = new Ci.Vector3,
  39221. function(e, t) {
  39222. var i = me.copy(t).multiplyScalar(.5);
  39223. return this.min.copy(e).sub(i),
  39224. this.max.copy(e).add(i),
  39225. this
  39226. }
  39227. ),
  39228. setFromObject: function(e) {
  39229. void 0 === ge && (ge = new Ci.Box3);
  39230. var i = this;
  39231. return this.makeEmpty(),
  39232. e.updateMatrixWorld(!0),
  39233. e.traverse(function(e) {
  39234. var t = e.geometry;
  39235. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39236. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39237. ge.applyMatrix4(e.matrixWorld),
  39238. i.union(ge)))
  39239. }),
  39240. this
  39241. },
  39242. clone: function() {
  39243. return (new this.constructor).copy(this)
  39244. },
  39245. copy: function(e) {
  39246. return this.min.copy(e.min),
  39247. this.max.copy(e.max),
  39248. this
  39249. },
  39250. makeEmpty: function() {
  39251. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39252. this.max.x = this.max.y = this.max.z = -1 / 0,
  39253. this
  39254. },
  39255. isEmpty: function() {
  39256. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39257. },
  39258. center: function(e) {
  39259. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39260. },
  39261. size: function(e) {
  39262. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39263. },
  39264. expandByPoint: function(e) {
  39265. return this.min.min(e),
  39266. this.max.max(e),
  39267. this
  39268. },
  39269. expandByVector: function(e) {
  39270. return this.min.sub(e),
  39271. this.max.add(e),
  39272. this
  39273. },
  39274. expandByScalar: function(e) {
  39275. return this.min.addScalar(-e),
  39276. this.max.addScalar(e),
  39277. this
  39278. },
  39279. containsPoint: function(e) {
  39280. 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)
  39281. },
  39282. containsBox: function(e) {
  39283. 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
  39284. },
  39285. getParameter: function(e, t) {
  39286. 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))
  39287. },
  39288. intersectsBox: function(e) {
  39289. 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)
  39290. },
  39291. intersectsSphere: function(e) {
  39292. return void 0 === fe && (fe = new Ci.Vector3),
  39293. this.clampPoint(e.center, fe),
  39294. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39295. },
  39296. intersectsPlane: function(e) {
  39297. var t, i;
  39298. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39299. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39300. e.normal.x * this.min.x),
  39301. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39302. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39303. i += e.normal.y * this.min.y),
  39304. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39305. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39306. i += e.normal.z * this.min.z),
  39307. t <= e.constant && i >= e.constant
  39308. },
  39309. clampPoint: function(e, t) {
  39310. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39311. },
  39312. distanceToPoint: (pe = new Ci.Vector3,
  39313. function(e) {
  39314. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39315. }
  39316. ),
  39317. getBoundingSphere: (de = new Ci.Vector3,
  39318. function(e) {
  39319. var t = e || new Ci.Sphere;
  39320. return t.center = this.center(),
  39321. t.radius = .5 * this.size(de).length(),
  39322. t
  39323. }
  39324. ),
  39325. intersect: function(e) {
  39326. return this.min.max(e.min),
  39327. this.max.min(e.max),
  39328. this
  39329. },
  39330. union: function(e) {
  39331. return this.min.min(e.min),
  39332. this.max.max(e.max),
  39333. this
  39334. },
  39335. 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],
  39336. function(e) {
  39337. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39338. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39339. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39340. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39341. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39342. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39343. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39344. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39345. this.makeEmpty(),
  39346. this.setFromPoints(ue),
  39347. this
  39348. }
  39349. ),
  39350. translate: function(e) {
  39351. return this.min.add(e),
  39352. this.max.add(e),
  39353. this
  39354. },
  39355. equals: function(e) {
  39356. return e.min.equals(this.min) && e.max.equals(this.max)
  39357. }
  39358. },
  39359. Ci.Matrix3 = function() {
  39360. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39361. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39362. }
  39363. ,
  39364. Ci.Matrix3.prototype = {
  39365. constructor: Ci.Matrix3,
  39366. set: function(e, t, i, n, r, o, a, s, l) {
  39367. var c = this.elements;
  39368. return c[0] = e,
  39369. c[1] = n,
  39370. c[2] = a,
  39371. c[3] = t,
  39372. c[4] = r,
  39373. c[5] = s,
  39374. c[6] = i,
  39375. c[7] = o,
  39376. c[8] = l,
  39377. this
  39378. },
  39379. identity: function() {
  39380. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39381. this
  39382. },
  39383. clone: function() {
  39384. return (new this.constructor).fromArray(this.elements)
  39385. },
  39386. copy: function(e) {
  39387. var t = e.elements;
  39388. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39389. this
  39390. },
  39391. setFromMatrix4: function(e) {
  39392. var t = e.elements;
  39393. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39394. this
  39395. },
  39396. applyToVector3Array: function(e, t, i) {
  39397. void 0 === he && (he = new Ci.Vector3),
  39398. void 0 === t && (t = 0),
  39399. void 0 === i && (i = e.length);
  39400. for (var n = 0, r = t; n < i; n += 3,
  39401. r += 3)
  39402. he.fromArray(e, r),
  39403. he.applyMatrix3(this),
  39404. he.toArray(e, r);
  39405. return e
  39406. },
  39407. applyToBuffer: function(e, t, i) {
  39408. void 0 === ce && (ce = new Ci.Vector3),
  39409. void 0 === t && (t = 0),
  39410. void 0 === i && (i = e.length / e.itemSize);
  39411. for (var n = 0, r = t; n < i; n++,
  39412. r++)
  39413. ce.x = e.getX(r),
  39414. ce.y = e.getY(r),
  39415. ce.z = e.getZ(r),
  39416. ce.applyMatrix3(this),
  39417. e.setXYZ(ce.x, ce.y, ce.z);
  39418. return e
  39419. },
  39420. multiplyScalar: function(e) {
  39421. var t = this.elements;
  39422. return t[0] *= e,
  39423. t[3] *= e,
  39424. t[6] *= e,
  39425. t[1] *= e,
  39426. t[4] *= e,
  39427. t[7] *= e,
  39428. t[2] *= e,
  39429. t[5] *= e,
  39430. t[8] *= e,
  39431. this
  39432. },
  39433. determinant: function() {
  39434. var e = this.elements
  39435. , t = e[0]
  39436. , i = e[1]
  39437. , n = e[2]
  39438. , r = e[3]
  39439. , o = e[4]
  39440. , a = e[5]
  39441. , s = e[6]
  39442. , l = e[7]
  39443. , c = e[8];
  39444. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39445. },
  39446. getInverse: function(e, t) {
  39447. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39448. var i = e.elements
  39449. , n = this.elements
  39450. , r = i[0]
  39451. , o = i[1]
  39452. , a = i[2]
  39453. , s = i[3]
  39454. , l = i[4]
  39455. , c = i[5]
  39456. , h = i[6]
  39457. , u = i[7]
  39458. , d = i[8]
  39459. , p = d * l - c * u
  39460. , f = c * h - d * s
  39461. , g = u * s - l * h
  39462. , m = r * p + o * f + a * g;
  39463. if (0 != m)
  39464. return n[0] = p,
  39465. n[1] = a * u - d * o,
  39466. n[2] = c * o - a * l,
  39467. n[3] = f,
  39468. n[4] = d * r - a * h,
  39469. n[5] = a * s - c * r,
  39470. n[6] = g,
  39471. n[7] = o * h - u * r,
  39472. n[8] = l * r - o * s,
  39473. this.multiplyScalar(1 / m);
  39474. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39475. if (t)
  39476. throw new Error(v);
  39477. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39478. },
  39479. transpose: function() {
  39480. var e, t = this.elements;
  39481. return e = t[1],
  39482. t[1] = t[3],
  39483. t[3] = e,
  39484. e = t[2],
  39485. t[2] = t[6],
  39486. t[6] = e,
  39487. e = t[5],
  39488. t[5] = t[7],
  39489. t[7] = e,
  39490. this
  39491. },
  39492. flattenToArrayOffset: function(e, t) {
  39493. var i = this.elements;
  39494. return e[t] = i[0],
  39495. e[t + 1] = i[1],
  39496. e[t + 2] = i[2],
  39497. e[t + 3] = i[3],
  39498. e[t + 4] = i[4],
  39499. e[t + 5] = i[5],
  39500. e[t + 6] = i[6],
  39501. e[t + 7] = i[7],
  39502. e[t + 8] = i[8],
  39503. e
  39504. },
  39505. getNormalMatrix: function(e) {
  39506. return this.setFromMatrix4(e).getInverse(this).transpose()
  39507. },
  39508. transposeIntoArray: function(e) {
  39509. var t = this.elements;
  39510. return e[0] = t[0],
  39511. e[1] = t[3],
  39512. e[2] = t[6],
  39513. e[3] = t[1],
  39514. e[4] = t[4],
  39515. e[5] = t[7],
  39516. e[6] = t[2],
  39517. e[7] = t[5],
  39518. e[8] = t[8],
  39519. this
  39520. },
  39521. fromArray: function(e) {
  39522. return this.elements.set(e),
  39523. this
  39524. },
  39525. toArray: function() {
  39526. var e = this.elements;
  39527. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39528. }
  39529. },
  39530. Ci.Matrix4 = function() {
  39531. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39532. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39533. }
  39534. ,
  39535. Ci.Matrix4.prototype = {
  39536. constructor: Ci.Matrix4,
  39537. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39538. var m = this.elements;
  39539. return m[0] = e,
  39540. m[4] = t,
  39541. m[8] = i,
  39542. m[12] = n,
  39543. m[1] = r,
  39544. m[5] = o,
  39545. m[9] = a,
  39546. m[13] = s,
  39547. m[2] = l,
  39548. m[6] = c,
  39549. m[10] = h,
  39550. m[14] = u,
  39551. m[3] = d,
  39552. m[7] = p,
  39553. m[11] = f,
  39554. m[15] = g,
  39555. this
  39556. },
  39557. identity: function() {
  39558. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39559. this
  39560. },
  39561. clone: function() {
  39562. return (new Ci.Matrix4).fromArray(this.elements)
  39563. },
  39564. copy: function(e) {
  39565. return this.elements.set(e.elements),
  39566. this
  39567. },
  39568. copyPosition: function(e) {
  39569. var t = this.elements
  39570. , i = e.elements;
  39571. return t[12] = i[12],
  39572. t[13] = i[13],
  39573. t[14] = i[14],
  39574. this
  39575. },
  39576. extractBasis: function(e, t, i) {
  39577. return e.setFromMatrixColumn(this, 0),
  39578. t.setFromMatrixColumn(this, 1),
  39579. i.setFromMatrixColumn(this, 2),
  39580. this
  39581. },
  39582. makeBasis: function(e, t, i) {
  39583. 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),
  39584. this
  39585. },
  39586. extractRotation: function(e) {
  39587. void 0 === le && (le = new Ci.Vector3);
  39588. var t = this.elements
  39589. , i = e.elements
  39590. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39591. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39592. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39593. return t[0] = i[0] * n,
  39594. t[1] = i[1] * n,
  39595. t[2] = i[2] * n,
  39596. t[4] = i[4] * r,
  39597. t[5] = i[5] * r,
  39598. t[6] = i[6] * r,
  39599. t[8] = i[8] * o,
  39600. t[9] = i[9] * o,
  39601. t[10] = i[10] * o,
  39602. this
  39603. },
  39604. makeRotationFromEuler: function(e) {
  39605. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39606. var t = this.elements
  39607. , i = e.x
  39608. , n = e.y
  39609. , r = e.z
  39610. , o = Math.cos(i)
  39611. , a = Math.sin(i)
  39612. , s = Math.cos(n)
  39613. , l = Math.sin(n)
  39614. , c = Math.cos(r)
  39615. , h = Math.sin(r);
  39616. if ("XYZ" === e.order) {
  39617. var u = o * c
  39618. , d = o * h
  39619. , p = a * c
  39620. , f = a * h;
  39621. t[0] = s * c,
  39622. t[4] = -s * h,
  39623. t[8] = l,
  39624. t[1] = d + p * l,
  39625. t[5] = u - f * l,
  39626. t[9] = -a * s,
  39627. t[2] = f - u * l,
  39628. t[6] = p + d * l,
  39629. t[10] = o * s
  39630. } else if ("YXZ" === e.order) {
  39631. var g = s * c
  39632. , m = s * h
  39633. , v = l * c
  39634. , y = l * h;
  39635. t[0] = g + y * a,
  39636. t[4] = v * a - m,
  39637. t[8] = o * l,
  39638. t[1] = o * h,
  39639. t[5] = o * c,
  39640. t[9] = -a,
  39641. t[2] = m * a - v,
  39642. t[6] = y + g * a,
  39643. t[10] = o * s
  39644. } else if ("ZXY" === e.order) {
  39645. g = s * c,
  39646. m = s * h,
  39647. v = l * c,
  39648. y = l * h;
  39649. t[0] = g - y * a,
  39650. t[4] = -o * h,
  39651. t[8] = v + m * a,
  39652. t[1] = m + v * a,
  39653. t[5] = o * c,
  39654. t[9] = y - g * a,
  39655. t[2] = -o * l,
  39656. t[6] = a,
  39657. t[10] = o * s
  39658. } else if ("ZYX" === e.order) {
  39659. u = o * c,
  39660. d = o * h,
  39661. p = a * c,
  39662. f = a * h;
  39663. t[0] = s * c,
  39664. t[4] = p * l - d,
  39665. t[8] = u * l + f,
  39666. t[1] = s * h,
  39667. t[5] = f * l + u,
  39668. t[9] = d * l - p,
  39669. t[2] = -l,
  39670. t[6] = a * s,
  39671. t[10] = o * s
  39672. } else if ("YZX" === e.order) {
  39673. var A = o * s
  39674. , C = o * l
  39675. , I = a * s
  39676. , E = a * l;
  39677. t[0] = s * c,
  39678. t[4] = E - A * h,
  39679. t[8] = I * h + C,
  39680. t[1] = h,
  39681. t[5] = o * c,
  39682. t[9] = -a * c,
  39683. t[2] = -l * c,
  39684. t[6] = C * h + I,
  39685. t[10] = A - E * h
  39686. } else if ("XZY" === e.order) {
  39687. A = o * s,
  39688. C = o * l,
  39689. I = a * s,
  39690. E = a * l;
  39691. t[0] = s * c,
  39692. t[4] = -h,
  39693. t[8] = l * c,
  39694. t[1] = A * h + E,
  39695. t[5] = o * c,
  39696. t[9] = C * h - I,
  39697. t[2] = I * h - C,
  39698. t[6] = a * c,
  39699. t[10] = E * h + A
  39700. }
  39701. return t[3] = 0,
  39702. t[7] = 0,
  39703. t[11] = 0,
  39704. t[12] = 0,
  39705. t[13] = 0,
  39706. t[14] = 0,
  39707. t[15] = 1,
  39708. this
  39709. },
  39710. makeRotationFromQuaternion: function(e) {
  39711. var t = this.elements
  39712. , i = e.x
  39713. , n = e.y
  39714. , r = e.z
  39715. , o = e.w
  39716. , a = i + i
  39717. , s = n + n
  39718. , l = r + r
  39719. , c = i * a
  39720. , h = i * s
  39721. , u = i * l
  39722. , d = n * s
  39723. , p = n * l
  39724. , f = r * l
  39725. , g = o * a
  39726. , m = o * s
  39727. , v = o * l;
  39728. return t[0] = 1 - (d + f),
  39729. t[4] = h - v,
  39730. t[8] = u + m,
  39731. t[1] = h + v,
  39732. t[5] = 1 - (c + f),
  39733. t[9] = p - g,
  39734. t[2] = u - m,
  39735. t[6] = p + g,
  39736. t[10] = 1 - (c + d),
  39737. t[3] = 0,
  39738. t[7] = 0,
  39739. t[11] = 0,
  39740. t[12] = 0,
  39741. t[13] = 0,
  39742. t[14] = 0,
  39743. t[15] = 1,
  39744. this
  39745. },
  39746. lookAt: function(e, t, i) {
  39747. void 0 === oe && (oe = new Ci.Vector3),
  39748. void 0 === ae && (ae = new Ci.Vector3),
  39749. void 0 === se && (se = new Ci.Vector3);
  39750. var n = this.elements;
  39751. return se.subVectors(e, t).normalize(),
  39752. 0 === se.lengthSq() && (se.z = 1),
  39753. oe.crossVectors(i, se).normalize(),
  39754. 0 === oe.lengthSq() && (se.x += 1e-4,
  39755. oe.crossVectors(i, se).normalize()),
  39756. ae.crossVectors(se, oe),
  39757. n[0] = oe.x,
  39758. n[4] = ae.x,
  39759. n[8] = se.x,
  39760. n[1] = oe.y,
  39761. n[5] = ae.y,
  39762. n[9] = se.y,
  39763. n[2] = oe.z,
  39764. n[6] = ae.z,
  39765. n[10] = se.z,
  39766. this
  39767. },
  39768. multiply: function(e, t) {
  39769. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39770. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39771. },
  39772. multiplyMatrices: function(e, t) {
  39773. var i = e.elements
  39774. , n = t.elements
  39775. , r = this.elements
  39776. , o = i[0]
  39777. , a = i[4]
  39778. , s = i[8]
  39779. , l = i[12]
  39780. , c = i[1]
  39781. , h = i[5]
  39782. , u = i[9]
  39783. , d = i[13]
  39784. , p = i[2]
  39785. , f = i[6]
  39786. , g = i[10]
  39787. , m = i[14]
  39788. , v = i[3]
  39789. , y = i[7]
  39790. , A = i[11]
  39791. , C = i[15]
  39792. , I = n[0]
  39793. , E = n[4]
  39794. , _ = n[8]
  39795. , b = n[12]
  39796. , w = n[1]
  39797. , T = n[5]
  39798. , x = n[9]
  39799. , S = n[13]
  39800. , M = n[2]
  39801. , R = n[6]
  39802. , P = n[10]
  39803. , O = n[14]
  39804. , L = n[3]
  39805. , D = n[7]
  39806. , N = n[11]
  39807. , F = n[15];
  39808. return r[0] = o * I + a * w + s * M + l * L,
  39809. r[4] = o * E + a * T + s * R + l * D,
  39810. r[8] = o * _ + a * x + s * P + l * N,
  39811. r[12] = o * b + a * S + s * O + l * F,
  39812. r[1] = c * I + h * w + u * M + d * L,
  39813. r[5] = c * E + h * T + u * R + d * D,
  39814. r[9] = c * _ + h * x + u * P + d * N,
  39815. r[13] = c * b + h * S + u * O + d * F,
  39816. r[2] = p * I + f * w + g * M + m * L,
  39817. r[6] = p * E + f * T + g * R + m * D,
  39818. r[10] = p * _ + f * x + g * P + m * N,
  39819. r[14] = p * b + f * S + g * O + m * F,
  39820. r[3] = v * I + y * w + A * M + C * L,
  39821. r[7] = v * E + y * T + A * R + C * D,
  39822. r[11] = v * _ + y * x + A * P + C * N,
  39823. r[15] = v * b + y * S + A * O + C * F,
  39824. this
  39825. },
  39826. multiplyToArray: function(e, t, i) {
  39827. var n = this.elements;
  39828. return this.multiplyMatrices(e, t),
  39829. i[0] = n[0],
  39830. i[1] = n[1],
  39831. i[2] = n[2],
  39832. i[3] = n[3],
  39833. i[4] = n[4],
  39834. i[5] = n[5],
  39835. i[6] = n[6],
  39836. i[7] = n[7],
  39837. i[8] = n[8],
  39838. i[9] = n[9],
  39839. i[10] = n[10],
  39840. i[11] = n[11],
  39841. i[12] = n[12],
  39842. i[13] = n[13],
  39843. i[14] = n[14],
  39844. i[15] = n[15],
  39845. this
  39846. },
  39847. multiplyScalar: function(e) {
  39848. var t = this.elements;
  39849. return t[0] *= e,
  39850. t[4] *= e,
  39851. t[8] *= e,
  39852. t[12] *= e,
  39853. t[1] *= e,
  39854. t[5] *= e,
  39855. t[9] *= e,
  39856. t[13] *= e,
  39857. t[2] *= e,
  39858. t[6] *= e,
  39859. t[10] *= e,
  39860. t[14] *= e,
  39861. t[3] *= e,
  39862. t[7] *= e,
  39863. t[11] *= e,
  39864. t[15] *= e,
  39865. this
  39866. },
  39867. applyToVector3Array: function(e, t, i) {
  39868. void 0 === re && (re = new Ci.Vector3),
  39869. void 0 === t && (t = 0),
  39870. void 0 === i && (i = e.length);
  39871. for (var n = 0, r = t; n < i; n += 3,
  39872. r += 3)
  39873. re.fromArray(e, r),
  39874. re.applyMatrix4(this),
  39875. re.toArray(e, r);
  39876. return e
  39877. },
  39878. applyToBuffer: function(e, t, i) {
  39879. void 0 === ne && (ne = new Ci.Vector3),
  39880. void 0 === t && (t = 0),
  39881. void 0 === i && (i = e.length / e.itemSize);
  39882. for (var n = 0, r = t; n < i; n++,
  39883. r++)
  39884. ne.x = e.getX(r),
  39885. ne.y = e.getY(r),
  39886. ne.z = e.getZ(r),
  39887. ne.applyMatrix4(this),
  39888. e.setXYZ(ne.x, ne.y, ne.z);
  39889. return e
  39890. },
  39891. determinant: function() {
  39892. var e = this.elements
  39893. , t = e[0]
  39894. , i = e[4]
  39895. , n = e[8]
  39896. , r = e[12]
  39897. , o = e[1]
  39898. , a = e[5]
  39899. , s = e[9]
  39900. , l = e[13]
  39901. , c = e[2]
  39902. , h = e[6]
  39903. , u = e[10]
  39904. , d = e[14];
  39905. 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)
  39906. },
  39907. transpose: function() {
  39908. var e, t = this.elements;
  39909. return e = t[1],
  39910. t[1] = t[4],
  39911. t[4] = e,
  39912. e = t[2],
  39913. t[2] = t[8],
  39914. t[8] = e,
  39915. e = t[6],
  39916. t[6] = t[9],
  39917. t[9] = e,
  39918. e = t[3],
  39919. t[3] = t[12],
  39920. t[12] = e,
  39921. e = t[7],
  39922. t[7] = t[13],
  39923. t[13] = e,
  39924. e = t[11],
  39925. t[11] = t[14],
  39926. t[14] = e,
  39927. this
  39928. },
  39929. flattenToArrayOffset: function(e, t) {
  39930. var i = this.elements;
  39931. return e[t] = i[0],
  39932. e[t + 1] = i[1],
  39933. e[t + 2] = i[2],
  39934. e[t + 3] = i[3],
  39935. e[t + 4] = i[4],
  39936. e[t + 5] = i[5],
  39937. e[t + 6] = i[6],
  39938. e[t + 7] = i[7],
  39939. e[t + 8] = i[8],
  39940. e[t + 9] = i[9],
  39941. e[t + 10] = i[10],
  39942. e[t + 11] = i[11],
  39943. e[t + 12] = i[12],
  39944. e[t + 13] = i[13],
  39945. e[t + 14] = i[14],
  39946. e[t + 15] = i[15],
  39947. e
  39948. },
  39949. getPosition: function() {
  39950. return void 0 === ie && (ie = new Ci.Vector3),
  39951. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39952. ie.setFromMatrixColumn(this, 3)
  39953. },
  39954. setPosition: function(e) {
  39955. var t = this.elements;
  39956. return t[12] = e.x,
  39957. t[13] = e.y,
  39958. t[14] = e.z,
  39959. this
  39960. },
  39961. getInverse: function(e, t) {
  39962. var i = this.elements
  39963. , n = e.elements
  39964. , r = n[0]
  39965. , o = n[1]
  39966. , a = n[2]
  39967. , s = n[3]
  39968. , l = n[4]
  39969. , c = n[5]
  39970. , h = n[6]
  39971. , u = n[7]
  39972. , d = n[8]
  39973. , p = n[9]
  39974. , f = n[10]
  39975. , g = n[11]
  39976. , m = n[12]
  39977. , v = n[13]
  39978. , y = n[14]
  39979. , A = n[15]
  39980. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39981. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39982. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39983. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39984. , b = r * C + o * I + a * E + s * _;
  39985. if (0 != b)
  39986. return i[0] = C,
  39987. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39988. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39989. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39990. i[4] = I,
  39991. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39992. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39993. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39994. i[8] = E,
  39995. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39996. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39997. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39998. i[12] = _,
  39999. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  40000. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  40001. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40002. this.multiplyScalar(1 / b);
  40003. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40004. if (t)
  40005. throw new Error(w);
  40006. return console.warn(w),
  40007. this.identity()
  40008. },
  40009. scale: function(e) {
  40010. var t = this.elements
  40011. , i = e.x
  40012. , n = e.y
  40013. , r = e.z;
  40014. return t[0] *= i,
  40015. t[4] *= n,
  40016. t[8] *= r,
  40017. t[1] *= i,
  40018. t[5] *= n,
  40019. t[9] *= r,
  40020. t[2] *= i,
  40021. t[6] *= n,
  40022. t[10] *= r,
  40023. t[3] *= i,
  40024. t[7] *= n,
  40025. t[11] *= r,
  40026. this
  40027. },
  40028. getMaxScaleOnAxis: function() {
  40029. var e = this.elements
  40030. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40031. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40032. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40033. return Math.sqrt(Math.max(t, i, n))
  40034. },
  40035. makeTranslation: function(e, t, i) {
  40036. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40037. this
  40038. },
  40039. makeRotationX: function(e) {
  40040. var t = Math.cos(e)
  40041. , i = Math.sin(e);
  40042. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40043. this
  40044. },
  40045. makeRotationY: function(e) {
  40046. var t = Math.cos(e)
  40047. , i = Math.sin(e);
  40048. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40049. this
  40050. },
  40051. makeRotationZ: function(e) {
  40052. var t = Math.cos(e)
  40053. , i = Math.sin(e);
  40054. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40055. this
  40056. },
  40057. makeRotationAxis: function(e, t) {
  40058. var i = Math.cos(t)
  40059. , n = Math.sin(t)
  40060. , r = 1 - i
  40061. , o = e.x
  40062. , a = e.y
  40063. , s = e.z
  40064. , l = r * o
  40065. , c = r * a;
  40066. 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),
  40067. this
  40068. },
  40069. makeScale: function(e, t, i) {
  40070. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40071. this
  40072. },
  40073. compose: function(e, t, i) {
  40074. return this.makeRotationFromQuaternion(t),
  40075. this.scale(i),
  40076. this.setPosition(e),
  40077. this
  40078. },
  40079. decompose: function(e, t, i) {
  40080. void 0 === ee && (ee = new Ci.Vector3),
  40081. void 0 === te && (te = new Ci.Matrix4);
  40082. var n = this.elements
  40083. , r = ee.set(n[0], n[1], n[2]).length()
  40084. , o = ee.set(n[4], n[5], n[6]).length()
  40085. , a = ee.set(n[8], n[9], n[10]).length();
  40086. this.determinant() < 0 && (r = -r),
  40087. e.x = n[12],
  40088. e.y = n[13],
  40089. e.z = n[14],
  40090. te.elements.set(this.elements);
  40091. var s = 1 / r
  40092. , l = 1 / o
  40093. , c = 1 / a;
  40094. return te.elements[0] *= s,
  40095. te.elements[1] *= s,
  40096. te.elements[2] *= s,
  40097. te.elements[4] *= l,
  40098. te.elements[5] *= l,
  40099. te.elements[6] *= l,
  40100. te.elements[8] *= c,
  40101. te.elements[9] *= c,
  40102. te.elements[10] *= c,
  40103. t.setFromRotationMatrix(te),
  40104. i.x = r,
  40105. i.y = o,
  40106. i.z = a,
  40107. this
  40108. },
  40109. makeFrustum: function(e, t, i, n, r, o) {
  40110. var a = this.elements
  40111. , s = 2 * r / (t - e)
  40112. , l = 2 * r / (n - i)
  40113. , c = (t + e) / (t - e)
  40114. , h = (n + i) / (n - i)
  40115. , u = -(o + r) / (o - r)
  40116. , d = -2 * o * r / (o - r);
  40117. return a[0] = s,
  40118. a[4] = 0,
  40119. a[8] = c,
  40120. a[12] = 0,
  40121. a[1] = 0,
  40122. a[5] = l,
  40123. a[9] = h,
  40124. a[13] = 0,
  40125. a[2] = 0,
  40126. a[6] = 0,
  40127. a[10] = u,
  40128. a[14] = d,
  40129. a[3] = 0,
  40130. a[7] = 0,
  40131. a[11] = -1,
  40132. a[15] = 0,
  40133. this
  40134. },
  40135. makePerspective: function(e, t, i, n) {
  40136. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40137. , o = -r
  40138. , a = o * t
  40139. , s = r * t;
  40140. return this.makeFrustum(a, s, o, r, i, n)
  40141. },
  40142. makeOrthographic: function(e, t, i, n, r, o) {
  40143. var a = this.elements
  40144. , s = 1 / (t - e)
  40145. , l = 1 / (i - n)
  40146. , c = 1 / (o - r)
  40147. , h = (t + e) * s
  40148. , u = (i + n) * l
  40149. , d = (o + r) * c;
  40150. return a[0] = 2 * s,
  40151. a[4] = 0,
  40152. a[8] = 0,
  40153. a[12] = -h,
  40154. a[1] = 0,
  40155. a[5] = 2 * l,
  40156. a[9] = 0,
  40157. a[13] = -u,
  40158. a[2] = 0,
  40159. a[6] = 0,
  40160. a[10] = -2 * c,
  40161. a[14] = -d,
  40162. a[3] = 0,
  40163. a[7] = 0,
  40164. a[11] = 0,
  40165. a[15] = 1,
  40166. this
  40167. },
  40168. equals: function(e) {
  40169. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40170. if (t[n] !== i[n])
  40171. return !1;
  40172. return !0
  40173. },
  40174. fromArray: function(e) {
  40175. return this.elements.set(e),
  40176. this
  40177. },
  40178. toArray: function() {
  40179. var e = this.elements;
  40180. 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]]
  40181. }
  40182. },
  40183. Ci.Ray = function(e, t) {
  40184. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40185. this.direction = void 0 !== t ? t : new Ci.Vector3
  40186. }
  40187. ,
  40188. Ci.Ray.prototype = {
  40189. constructor: Ci.Ray,
  40190. set: function(e, t) {
  40191. return this.origin.copy(e),
  40192. this.direction.copy(t),
  40193. this
  40194. },
  40195. clone: function() {
  40196. return (new this.constructor).copy(this)
  40197. },
  40198. copy: function(e) {
  40199. return this.origin.copy(e.origin),
  40200. this.direction.copy(e.direction),
  40201. this
  40202. },
  40203. at: function(e, t) {
  40204. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40205. },
  40206. lookAt: function(e) {
  40207. this.direction.copy(e).sub(this.origin).normalize()
  40208. },
  40209. recast: ($ = new Ci.Vector3,
  40210. function(e) {
  40211. return this.origin.copy(this.at(e, $)),
  40212. this
  40213. }
  40214. ),
  40215. closestPointToPoint: function(e, t) {
  40216. var i = t || new Ci.Vector3;
  40217. i.subVectors(e, this.origin);
  40218. var n = i.dot(this.direction);
  40219. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40220. },
  40221. distanceToPoint: function(e) {
  40222. return Math.sqrt(this.distanceSqToPoint(e))
  40223. },
  40224. distanceSqToPoint: (J = new Ci.Vector3,
  40225. function(e) {
  40226. var t = J.subVectors(e, this.origin).dot(this.direction);
  40227. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40228. J.distanceToSquared(e))
  40229. }
  40230. ),
  40231. distanceSqToSegment: (Z = new Ci.Vector3,
  40232. K = new Ci.Vector3,
  40233. Q = new Ci.Vector3,
  40234. function(e, t, i, n) {
  40235. Z.copy(e).add(t).multiplyScalar(.5),
  40236. K.copy(t).sub(e).normalize(),
  40237. Q.copy(this.origin).sub(Z);
  40238. 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);
  40239. if (0 < p)
  40240. if (o = c * h - u,
  40241. s = l * p,
  40242. 0 <= (r = c * u - h))
  40243. if (-s <= o)
  40244. if (o <= s) {
  40245. var f = 1 / p;
  40246. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40247. } else
  40248. o = l,
  40249. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40250. else
  40251. o = -l,
  40252. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40253. else
  40254. 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,
  40255. (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;
  40256. else
  40257. o = 0 < c ? -l : l,
  40258. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40259. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40260. n && n.copy(K).multiplyScalar(o).add(Z),
  40261. a
  40262. }
  40263. ),
  40264. intersectSphere: (X = new Ci.Vector3,
  40265. function(e, t) {
  40266. X.subVectors(e.center, this.origin);
  40267. var i = X.dot(this.direction)
  40268. , n = X.dot(X) - i * i
  40269. , r = e.radius * e.radius;
  40270. if (r < n)
  40271. return null;
  40272. var o = Math.sqrt(r - n)
  40273. , a = i - o
  40274. , s = i + o;
  40275. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40276. }
  40277. ),
  40278. intersectsSphere: function(e) {
  40279. return this.distanceToPoint(e.center) <= e.radius
  40280. },
  40281. distanceToPlane: function(e) {
  40282. var t = e.normal.dot(this.direction);
  40283. if (0 === t)
  40284. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40285. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40286. return 0 <= i ? i : null
  40287. },
  40288. intersectPlane: function(e, t) {
  40289. var i = this.distanceToPlane(e);
  40290. return null === i ? null : this.at(i, t)
  40291. },
  40292. intersectsPlane: function(e) {
  40293. var t = e.distanceToPoint(this.origin);
  40294. return 0 === t || e.normal.dot(this.direction) * t < 0
  40295. },
  40296. intersectBox: function(e, t) {
  40297. 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;
  40298. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40299. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40300. (e.min.x - u.x) * l),
  40301. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40302. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40303. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40304. (o < n || n != n) && (n = o),
  40305. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40306. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40307. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40308. (s < n || n != n) && (n = s),
  40309. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40310. },
  40311. intersectsBox: (q = new Ci.Vector3,
  40312. function(e) {
  40313. return null !== this.intersectBox(e, q)
  40314. }
  40315. ),
  40316. intersectTriangle: (G = new Ci.Vector3,
  40317. W = new Ci.Vector3,
  40318. j = new Ci.Vector3,
  40319. Y = new Ci.Vector3,
  40320. function(e, t, i, n, r) {
  40321. W.subVectors(t, e),
  40322. j.subVectors(i, e),
  40323. Y.crossVectors(W, j);
  40324. var o, a = this.direction.dot(Y);
  40325. if (0 < a) {
  40326. if (n)
  40327. return null;
  40328. o = 1
  40329. } else {
  40330. if (!(a < 0))
  40331. return null;
  40332. o = -1,
  40333. a = -a
  40334. }
  40335. G.subVectors(this.origin, e);
  40336. var s = o * this.direction.dot(j.crossVectors(G, j));
  40337. if (s < 0)
  40338. return null;
  40339. var l = o * this.direction.dot(W.cross(G));
  40340. if (l < 0)
  40341. return null;
  40342. if (a < s + l)
  40343. return null;
  40344. var c = -o * G.dot(Y);
  40345. return c < 0 ? null : this.at(c / a, r)
  40346. }
  40347. ),
  40348. applyMatrix4: function(e) {
  40349. return this.direction.add(this.origin).applyMatrix4(e),
  40350. this.origin.applyMatrix4(e),
  40351. this.direction.sub(this.origin),
  40352. this.direction.normalize(),
  40353. this
  40354. },
  40355. equals: function(e) {
  40356. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40357. }
  40358. },
  40359. Ci.Sphere = function(e, t) {
  40360. this.center = void 0 !== e ? e : new Ci.Vector3,
  40361. this.radius = void 0 !== t ? t : 0
  40362. }
  40363. ,
  40364. Ci.Sphere.prototype = {
  40365. constructor: Ci.Sphere,
  40366. set: function(e, t) {
  40367. return this.center.copy(e),
  40368. this.radius = t,
  40369. this
  40370. },
  40371. setFromPoints: (z = new Ci.Box3,
  40372. function(e, t) {
  40373. var i = this.center;
  40374. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40375. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40376. n = Math.max(n, i.distanceToSquared(e[r]));
  40377. return this.radius = Math.sqrt(n),
  40378. this
  40379. }
  40380. ),
  40381. clone: function() {
  40382. return (new this.constructor).copy(this)
  40383. },
  40384. copy: function(e) {
  40385. return this.center.copy(e.center),
  40386. this.radius = e.radius,
  40387. this
  40388. },
  40389. empty: function() {
  40390. return this.radius <= 0
  40391. },
  40392. containsPoint: function(e) {
  40393. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40394. },
  40395. distanceToPoint: function(e) {
  40396. return e.distanceTo(this.center) - this.radius
  40397. },
  40398. intersectsSphere: function(e) {
  40399. var t = this.radius + e.radius;
  40400. return e.center.distanceToSquared(this.center) <= t * t
  40401. },
  40402. intersectsBox: function(e) {
  40403. return e.intersectsSphere(this)
  40404. },
  40405. intersectsPlane: function(e) {
  40406. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40407. },
  40408. clampPoint: function(e, t) {
  40409. var i = this.center.distanceToSquared(e)
  40410. , n = t || new Ci.Vector3;
  40411. return n.copy(e),
  40412. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40413. n.multiplyScalar(this.radius).add(this.center)),
  40414. n
  40415. },
  40416. getBoundingBox: function(e) {
  40417. var t = e || new Ci.Box3;
  40418. return t.set(this.center, this.center),
  40419. t.expandByScalar(this.radius),
  40420. t
  40421. },
  40422. applyMatrix4: function(e) {
  40423. return this.center.applyMatrix4(e),
  40424. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40425. this
  40426. },
  40427. translate: function(e) {
  40428. return this.center.add(e),
  40429. this
  40430. },
  40431. equals: function(e) {
  40432. return e.center.equals(this.center) && e.radius === this.radius
  40433. }
  40434. },
  40435. Ci.Frustum = function(e, t, i, n, r, o) {
  40436. 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]
  40437. }
  40438. ,
  40439. Ci.Frustum.prototype = {
  40440. constructor: Ci.Frustum,
  40441. set: function(e, t, i, n, r, o) {
  40442. var a = this.planes;
  40443. return a[0].copy(e),
  40444. a[1].copy(t),
  40445. a[2].copy(i),
  40446. a[3].copy(n),
  40447. a[4].copy(r),
  40448. a[5].copy(o),
  40449. this
  40450. },
  40451. clone: function() {
  40452. return (new this.constructor).copy(this)
  40453. },
  40454. copy: function(e) {
  40455. for (var t = this.planes, i = 0; i < 6; i++)
  40456. t[i].copy(e.planes[i]);
  40457. return this
  40458. },
  40459. setFromMatrix: function(e) {
  40460. var t = this.planes
  40461. , i = e.elements
  40462. , n = i[0]
  40463. , r = i[1]
  40464. , o = i[2]
  40465. , a = i[3]
  40466. , s = i[4]
  40467. , l = i[5]
  40468. , c = i[6]
  40469. , h = i[7]
  40470. , u = i[8]
  40471. , d = i[9]
  40472. , p = i[10]
  40473. , f = i[11]
  40474. , g = i[12]
  40475. , m = i[13]
  40476. , v = i[14]
  40477. , y = i[15];
  40478. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40479. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40480. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40481. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40482. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40483. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40484. this
  40485. },
  40486. intersectsObject: (H = new Ci.Sphere,
  40487. function(e) {
  40488. var t = e.geometry;
  40489. return null === t.boundingSphere && t.computeBoundingSphere(),
  40490. H.copy(t.boundingSphere),
  40491. H.applyMatrix4(e.matrixWorld),
  40492. this.intersectsSphere(H)
  40493. }
  40494. ),
  40495. intersectsSphere: function(e) {
  40496. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40497. if (t[r].distanceToPoint(i) < n)
  40498. return !1
  40499. }
  40500. return !0
  40501. },
  40502. intersectsBox: (k = new Ci.Vector3,
  40503. U = new Ci.Vector3,
  40504. function(e) {
  40505. for (var t = this.planes, i = 0; i < 6; i++) {
  40506. var n = t[i];
  40507. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40508. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40509. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40510. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40511. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40512. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40513. var r = n.distanceToPoint(k)
  40514. , o = n.distanceToPoint(U);
  40515. if (r < 0 && o < 0)
  40516. return !1
  40517. }
  40518. return !0
  40519. }
  40520. ),
  40521. containsPoint: function(e) {
  40522. for (var t = this.planes, i = 0; i < 6; i++)
  40523. if (t[i].distanceToPoint(e) < 0)
  40524. return !1;
  40525. return !0
  40526. }
  40527. },
  40528. Ci.Plane = function(e, t) {
  40529. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40530. this.constant = void 0 !== t ? t : 0
  40531. }
  40532. ,
  40533. Ci.Plane.prototype = {
  40534. constructor: Ci.Plane,
  40535. set: function(e, t) {
  40536. return this.normal.copy(e),
  40537. this.constant = t,
  40538. this
  40539. },
  40540. setComponents: function(e, t, i, n) {
  40541. return this.normal.set(e, t, i),
  40542. this.constant = n,
  40543. this
  40544. },
  40545. setFromNormalAndCoplanarPoint: function(e, t) {
  40546. return this.normal.copy(e),
  40547. this.constant = -t.dot(this.normal),
  40548. this
  40549. },
  40550. setFromCoplanarPoints: (B = new Ci.Vector3,
  40551. V = new Ci.Vector3,
  40552. function(e, t, i) {
  40553. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40554. return this.setFromNormalAndCoplanarPoint(n, e),
  40555. this
  40556. }
  40557. ),
  40558. clone: function() {
  40559. return (new this.constructor).copy(this)
  40560. },
  40561. copy: function(e) {
  40562. return this.normal.copy(e.normal),
  40563. this.constant = e.constant,
  40564. this
  40565. },
  40566. normalize: function() {
  40567. var e = 1 / this.normal.length();
  40568. return this.normal.multiplyScalar(e),
  40569. this.constant *= e,
  40570. this
  40571. },
  40572. negate: function() {
  40573. return this.constant *= -1,
  40574. this.normal.negate(),
  40575. this
  40576. },
  40577. distanceToPoint: function(e) {
  40578. return this.normal.dot(e) + this.constant
  40579. },
  40580. distanceToSphere: function(e) {
  40581. return this.distanceToPoint(e.center) - e.radius
  40582. },
  40583. projectPoint: function(e, t) {
  40584. return this.orthoPoint(e, t).sub(e).negate()
  40585. },
  40586. orthoPoint: function(e, t) {
  40587. var i = this.distanceToPoint(e);
  40588. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40589. },
  40590. intersectLine: (F = new Ci.Vector3,
  40591. function(e, t) {
  40592. var i = t || new Ci.Vector3
  40593. , n = e.delta(F)
  40594. , r = this.normal.dot(n);
  40595. if (0 !== r) {
  40596. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40597. if (!(o < 0 || 1 < o))
  40598. return i.copy(n).multiplyScalar(o).add(e.start)
  40599. } else if (0 === this.distanceToPoint(e.start))
  40600. return i.copy(e.start)
  40601. }
  40602. ),
  40603. intersectsLine: function(e) {
  40604. var t = this.distanceToPoint(e.start)
  40605. , i = this.distanceToPoint(e.end);
  40606. return t < 0 && 0 < i || i < 0 && 0 < t
  40607. },
  40608. intersectsBox: function(e) {
  40609. return e.intersectsPlane(this)
  40610. },
  40611. intersectsSphere: function(e) {
  40612. return e.intersectsPlane(this)
  40613. },
  40614. coplanarPoint: function(e) {
  40615. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40616. },
  40617. applyMatrix4: (L = new Ci.Vector3,
  40618. D = new Ci.Vector3,
  40619. N = new Ci.Matrix3,
  40620. function(e, t) {
  40621. var i = t || N.getNormalMatrix(e)
  40622. , n = L.copy(this.normal).applyMatrix3(i)
  40623. , r = this.coplanarPoint(D);
  40624. return r.applyMatrix4(e),
  40625. this.setFromNormalAndCoplanarPoint(n, r),
  40626. this
  40627. }
  40628. ),
  40629. translate: function(e) {
  40630. return this.constant = this.constant - e.dot(this.normal),
  40631. this
  40632. },
  40633. equals: function(e) {
  40634. return e.normal.equals(this.normal) && e.constant === this.constant
  40635. }
  40636. },
  40637. Ci.Spherical = function(e, t, i) {
  40638. return this.radius = void 0 !== e ? e : 1,
  40639. this.phi = void 0 !== t ? t : 0,
  40640. this.theta = void 0 !== i ? i : 0,
  40641. this
  40642. }
  40643. ,
  40644. Ci.Spherical.prototype = {
  40645. constructor: Ci.Spherical,
  40646. set: function(e, t, i) {
  40647. this.radius = e,
  40648. this.phi = t,
  40649. this.theta = i
  40650. },
  40651. clone: function() {
  40652. return (new this.constructor).copy(this)
  40653. },
  40654. copy: function(e) {
  40655. return this.radius.copy(e.radius),
  40656. this.phi.copy(e.phi),
  40657. this.theta.copy(e.theta),
  40658. this
  40659. },
  40660. makeSafe: function() {
  40661. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40662. },
  40663. setFromVector3: function(e) {
  40664. return this.radius = e.length(),
  40665. 0 === this.radius ? (this.theta = 0,
  40666. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40667. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40668. this
  40669. }
  40670. },
  40671. Ci.Math = {
  40672. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40673. P = new Array(36),
  40674. O = 0,
  40675. function() {
  40676. for (var e = 0; e < 36; e++)
  40677. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40678. M = 15 & O,
  40679. O >>= 4,
  40680. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40681. return P.join("")
  40682. }
  40683. ),
  40684. clamp: function(e, t, i) {
  40685. return Math.max(t, Math.min(i, e))
  40686. },
  40687. euclideanModulo: function(e, t) {
  40688. return (e % t + t) % t
  40689. },
  40690. mapLinear: function(e, t, i, n, r) {
  40691. return n + (e - t) * (r - n) / (i - t)
  40692. },
  40693. smoothstep: function(e, t, i) {
  40694. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40695. },
  40696. smootherstep: function(e, t, i) {
  40697. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40698. },
  40699. random16: function() {
  40700. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40701. Math.random()
  40702. },
  40703. randInt: function(e, t) {
  40704. return e + Math.floor(Math.random() * (t - e + 1))
  40705. },
  40706. randFloat: function(e, t) {
  40707. return e + Math.random() * (t - e)
  40708. },
  40709. randFloatSpread: function(e) {
  40710. return e * (.5 - Math.random())
  40711. },
  40712. degToRad: (S = Math.PI / 180,
  40713. function(e) {
  40714. return e * S
  40715. }
  40716. ),
  40717. radToDeg: (x = 180 / Math.PI,
  40718. function(e) {
  40719. return e * x
  40720. }
  40721. ),
  40722. isPowerOfTwo: function(e) {
  40723. return 0 == (e & e - 1) && 0 !== e
  40724. },
  40725. nearestPowerOfTwo: function(e) {
  40726. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40727. },
  40728. nextPowerOfTwo: function(e) {
  40729. return e--,
  40730. e |= e >> 1,
  40731. e |= e >> 2,
  40732. e |= e >> 4,
  40733. e |= e >> 8,
  40734. e |= e >> 16,
  40735. ++e
  40736. }
  40737. },
  40738. Ci.Spline = function(e) {
  40739. function t(e, t, i, n, r, o, a) {
  40740. var s = .5 * (i - e)
  40741. , l = .5 * (n - t);
  40742. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40743. }
  40744. this.points = e;
  40745. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40746. x: 0,
  40747. y: 0,
  40748. z: 0
  40749. };
  40750. this.initFromArray = function(e) {
  40751. this.points = [];
  40752. for (var t = 0; t < e.length; t++)
  40753. this.points[t] = {
  40754. x: e[t][0],
  40755. y: e[t][1],
  40756. z: e[t][2]
  40757. }
  40758. }
  40759. ,
  40760. this.getPoint = function(e) {
  40761. return i = (this.points.length - 1) * e,
  40762. n = Math.floor(i),
  40763. r = i - n,
  40764. u[0] = 0 === n ? n : n - 1,
  40765. u[1] = n,
  40766. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40767. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40768. s = this.points[u[0]],
  40769. l = this.points[u[1]],
  40770. c = this.points[u[2]],
  40771. h = this.points[u[3]],
  40772. a = r * (o = r * r),
  40773. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40774. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40775. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40776. d
  40777. }
  40778. ,
  40779. this.getControlPointsArray = function() {
  40780. var e, t, i = this.points.length, n = [];
  40781. for (e = 0; e < i; e++)
  40782. t = this.points[e],
  40783. n[e] = [t.x, t.y, t.z];
  40784. return n
  40785. }
  40786. ,
  40787. this.getLength = function(e) {
  40788. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40789. for (h[0] = 0,
  40790. e = e || 100,
  40791. n = this.points.length * e,
  40792. l.copy(this.points[0]),
  40793. t = 1; t < n; t++)
  40794. i = t / n,
  40795. r = this.getPoint(i),
  40796. c.copy(r),
  40797. u += c.distanceTo(l),
  40798. l.copy(r),
  40799. o = (this.points.length - 1) * i,
  40800. (a = Math.floor(o)) !== s && (h[a] = u,
  40801. s = a);
  40802. return h[h.length] = u,
  40803. {
  40804. chunks: h,
  40805. total: u
  40806. }
  40807. }
  40808. ,
  40809. this.reparametrizeByArcLength = function(e) {
  40810. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40811. for (c.push(h.copy(this.points[0]).clone()),
  40812. t = 1; t < this.points.length; t++) {
  40813. for (a = u.chunks[t] - u.chunks[t - 1],
  40814. s = Math.ceil(e * a / u.total),
  40815. r = (t - 1) / (this.points.length - 1),
  40816. o = t / (this.points.length - 1),
  40817. i = 1; i < s - 1; i++)
  40818. n = r + i * (1 / s) * (o - r),
  40819. l = this.getPoint(n),
  40820. c.push(h.copy(l).clone());
  40821. c.push(h.copy(this.points[t]).clone())
  40822. }
  40823. this.points = c
  40824. }
  40825. }
  40826. ,
  40827. Ci.Triangle = function(e, t, i) {
  40828. this.a = void 0 !== e ? e : new Ci.Vector3,
  40829. this.b = void 0 !== t ? t : new Ci.Vector3,
  40830. this.c = void 0 !== i ? i : new Ci.Vector3
  40831. }
  40832. ,
  40833. Ci.Triangle.normal = (T = new Ci.Vector3,
  40834. function(e, t, i, n) {
  40835. var r = n || new Ci.Vector3;
  40836. r.subVectors(i, t),
  40837. T.subVectors(e, t),
  40838. r.cross(T);
  40839. var o = r.lengthSq();
  40840. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40841. }
  40842. ),
  40843. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40844. b = new Ci.Vector3,
  40845. w = new Ci.Vector3,
  40846. function(e, t, i, n, r) {
  40847. _.subVectors(n, t),
  40848. b.subVectors(i, t),
  40849. w.subVectors(e, t);
  40850. var o = _.dot(_)
  40851. , a = _.dot(b)
  40852. , s = _.dot(w)
  40853. , l = b.dot(b)
  40854. , c = b.dot(w)
  40855. , h = o * l - a * a
  40856. , u = r || new Ci.Vector3;
  40857. if (0 == h)
  40858. return u.set(-2, -1, -1);
  40859. var d = 1 / h
  40860. , p = (l * s - a * c) * d
  40861. , f = (o * c - a * s) * d;
  40862. return u.set(1 - p - f, f, p)
  40863. }
  40864. ),
  40865. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40866. function(e, t, i, n) {
  40867. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40868. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40869. }
  40870. ),
  40871. Ci.Triangle.prototype = {
  40872. constructor: Ci.Triangle,
  40873. set: function(e, t, i) {
  40874. return this.a.copy(e),
  40875. this.b.copy(t),
  40876. this.c.copy(i),
  40877. this
  40878. },
  40879. setFromPointsAndIndices: function(e, t, i, n) {
  40880. return this.a.copy(e[t]),
  40881. this.b.copy(e[i]),
  40882. this.c.copy(e[n]),
  40883. this
  40884. },
  40885. clone: function() {
  40886. return (new this.constructor).copy(this)
  40887. },
  40888. copy: function(e) {
  40889. return this.a.copy(e.a),
  40890. this.b.copy(e.b),
  40891. this.c.copy(e.c),
  40892. this
  40893. },
  40894. area: (C = new Ci.Vector3,
  40895. I = new Ci.Vector3,
  40896. function() {
  40897. return C.subVectors(this.c, this.b),
  40898. I.subVectors(this.a, this.b),
  40899. .5 * C.cross(I).length()
  40900. }
  40901. ),
  40902. midpoint: function(e) {
  40903. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40904. },
  40905. normal: function(e) {
  40906. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40907. },
  40908. plane: function(e) {
  40909. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40910. },
  40911. barycoordFromPoint: function(e, t) {
  40912. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40913. },
  40914. containsPoint: function(e) {
  40915. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40916. },
  40917. equals: function(e) {
  40918. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40919. }
  40920. },
  40921. Ci.Interpolant = function(e, t, i, n) {
  40922. this.parameterPositions = e,
  40923. this._cachedIndex = 0,
  40924. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40925. this.sampleValues = t,
  40926. this.valueSize = i
  40927. }
  40928. ,
  40929. Ci.Interpolant.prototype = {
  40930. constructor: Ci.Interpolant,
  40931. evaluate: function(e) {
  40932. var t = this.parameterPositions
  40933. , i = this._cachedIndex
  40934. , n = t[i]
  40935. , r = t[i - 1];
  40936. e: {
  40937. t: {
  40938. var o;
  40939. i: {
  40940. n: if (!(e < n)) {
  40941. for (var a = i + 2; ; ) {
  40942. if (void 0 === n) {
  40943. if (e < r)
  40944. break n;
  40945. return i = t.length,
  40946. this._cachedIndex = i,
  40947. this.afterEnd_(i - 1, e, r)
  40948. }
  40949. if (i === a)
  40950. break;
  40951. if (r = n,
  40952. e < (n = t[++i]))
  40953. break t
  40954. }
  40955. o = t.length;
  40956. break i
  40957. }
  40958. if (r <= e)
  40959. break e;
  40960. var s = t[1];
  40961. e < s && (i = 2,
  40962. r = s);
  40963. for (a = i - 2; ; ) {
  40964. if (void 0 === r)
  40965. return this._cachedIndex = 0,
  40966. this.beforeStart_(0, e, n);
  40967. if (i === a)
  40968. break;
  40969. if (n = r,
  40970. (r = t[--i - 1]) <= e)
  40971. break t
  40972. }
  40973. o = i,
  40974. i = 0
  40975. }
  40976. for (; i < o; ) {
  40977. var l = i + o >>> 1;
  40978. e < t[l] ? o = l : i = 1 + l
  40979. }
  40980. if (n = t[i],
  40981. void 0 === (r = t[i - 1]))
  40982. return this._cachedIndex = 0,
  40983. this.beforeStart_(0, e, n);
  40984. if (void 0 === n)
  40985. return i = t.length,
  40986. this._cachedIndex = i,
  40987. this.afterEnd_(i - 1, r, e)
  40988. }
  40989. this._cachedIndex = i,
  40990. this.intervalChanged_(i, r, n)
  40991. }
  40992. return this.interpolate_(i, r, e, n)
  40993. },
  40994. settings: null,
  40995. DefaultSettings_: {},
  40996. getSettings_: function() {
  40997. return this.settings || this.DefaultSettings_
  40998. },
  40999. copySampleValue_: function(e) {
  41000. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41001. t[o] = i[r + o];
  41002. return t
  41003. },
  41004. interpolate_: function(e, t, i, n) {
  41005. throw new Error("call to abstract method")
  41006. },
  41007. intervalChanged_: function(e, t, i) {}
  41008. },
  41009. Object.assign(Ci.Interpolant.prototype, {
  41010. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  41011. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  41012. }),
  41013. Ci.CubicInterpolant = function(e, t, i, n) {
  41014. Ci.Interpolant.call(this, e, t, i, n),
  41015. this._weightPrev = -0,
  41016. this._offsetPrev = -0,
  41017. this._weightNext = -0,
  41018. this._offsetNext = -0
  41019. }
  41020. ,
  41021. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41022. constructor: Ci.CubicInterpolant,
  41023. DefaultSettings_: {
  41024. endingStart: Ci.ZeroCurvatureEnding,
  41025. endingEnd: Ci.ZeroCurvatureEnding
  41026. },
  41027. intervalChanged_: function(e, t, i) {
  41028. var n = this.parameterPositions
  41029. , r = e - 2
  41030. , o = e + 1
  41031. , a = n[r]
  41032. , s = n[o];
  41033. if (void 0 === a)
  41034. switch (this.getSettings_().endingStart) {
  41035. case Ci.ZeroSlopeEnding:
  41036. r = e,
  41037. a = 2 * t - i;
  41038. break;
  41039. case Ci.WrapAroundEnding:
  41040. a = t + n[r = n.length - 2] - n[r + 1];
  41041. break;
  41042. default:
  41043. r = e,
  41044. a = i
  41045. }
  41046. if (void 0 === s)
  41047. switch (this.getSettings_().endingEnd) {
  41048. case Ci.ZeroSlopeEnding:
  41049. o = e,
  41050. s = 2 * i - t;
  41051. break;
  41052. case Ci.WrapAroundEnding:
  41053. s = i + n[o = 1] - n[0];
  41054. break;
  41055. default:
  41056. o = e - 1,
  41057. s = t
  41058. }
  41059. var l = .5 * (i - t)
  41060. , c = this.valueSize;
  41061. this._weightPrev = l / (t - a),
  41062. this._weightNext = l / (s - i),
  41063. this._offsetPrev = r * c,
  41064. this._offsetNext = o * c
  41065. },
  41066. interpolate_: function(e, t, i, n) {
  41067. 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)
  41068. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41069. return r
  41070. }
  41071. }),
  41072. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41073. Ci.Interpolant.call(this, e, t, i, n)
  41074. }
  41075. ,
  41076. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41077. constructor: Ci.DiscreteInterpolant,
  41078. interpolate_: function(e, t, i, n) {
  41079. return this.copySampleValue_(e - 1)
  41080. }
  41081. }),
  41082. Ci.LinearInterpolant = function(e, t, i, n) {
  41083. Ci.Interpolant.call(this, e, t, i, n)
  41084. }
  41085. ,
  41086. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41087. constructor: Ci.LinearInterpolant,
  41088. interpolate_: function(e, t, i, n) {
  41089. 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)
  41090. r[u] = o[l + u] * h + o[s + u] * c;
  41091. return r
  41092. }
  41093. }),
  41094. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41095. Ci.Interpolant.call(this, e, t, i, n)
  41096. }
  41097. ,
  41098. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41099. constructor: Ci.QuaternionLinearInterpolant,
  41100. interpolate_: function(e, t, i, n) {
  41101. 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)
  41102. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41103. return r
  41104. }
  41105. }),
  41106. Ci.Clock = function(e) {
  41107. this.autoStart = void 0 === e || e,
  41108. this.startTime = 0,
  41109. this.oldTime = 0,
  41110. this.elapsedTime = 0,
  41111. this.running = !1
  41112. }
  41113. ,
  41114. Ci.Clock.prototype = {
  41115. constructor: Ci.Clock,
  41116. start: function() {
  41117. this.startTime = performance.now(),
  41118. this.oldTime = this.startTime,
  41119. this.running = !0
  41120. },
  41121. stop: function() {
  41122. this.getElapsedTime(),
  41123. this.running = !1
  41124. },
  41125. getElapsedTime: function() {
  41126. return this.getDelta(),
  41127. this.elapsedTime
  41128. },
  41129. getDelta: function() {
  41130. var e = 0;
  41131. if (this.autoStart && !this.running && this.start(),
  41132. this.running) {
  41133. var t = performance.now();
  41134. e = .001 * (t - this.oldTime),
  41135. this.oldTime = t,
  41136. this.elapsedTime += e
  41137. }
  41138. return e
  41139. }
  41140. },
  41141. Ci.EventDispatcher = function() {}
  41142. ,
  41143. Ci.EventDispatcher.prototype = {
  41144. constructor: Ci.EventDispatcher,
  41145. apply: function(e) {
  41146. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41147. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41148. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41149. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41150. },
  41151. addEventListener: function(e, t) {
  41152. void 0 === this._listeners && (this._listeners = {});
  41153. var i = this._listeners;
  41154. void 0 === i[e] && (i[e] = []),
  41155. -1 === i[e].indexOf(t) && i[e].push(t)
  41156. },
  41157. hasEventListener: function(e, t) {
  41158. if (void 0 === this._listeners)
  41159. return !1;
  41160. var i = this._listeners;
  41161. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41162. },
  41163. removeEventListener: function(e, t) {
  41164. if (void 0 !== this._listeners) {
  41165. var i = this._listeners[e];
  41166. if (void 0 !== i) {
  41167. var n = i.indexOf(t);
  41168. -1 !== n && i.splice(n, 1)
  41169. }
  41170. }
  41171. },
  41172. dispatchEvent: function(e) {
  41173. if (void 0 !== this._listeners) {
  41174. var t = this._listeners[e.type];
  41175. if (void 0 !== t) {
  41176. e.target = this;
  41177. for (var i = [], n = t.length, r = 0; r < n; r++)
  41178. i[r] = t[r];
  41179. for (r = 0; r < n; r++)
  41180. i[r].call(this, e)
  41181. }
  41182. }
  41183. }
  41184. },
  41185. Ci.Layers = function() {
  41186. this.mask = 1
  41187. }
  41188. ,
  41189. Ci.Layers.prototype = {
  41190. constructor: Ci.Layers,
  41191. set: function(e) {
  41192. this.mask = 1 << e
  41193. },
  41194. enable: function(e) {
  41195. this.mask |= 1 << e
  41196. },
  41197. toggle: function(e) {
  41198. this.mask ^= 1 << e
  41199. },
  41200. disable: function(e) {
  41201. this.mask &= ~(1 << e)
  41202. },
  41203. test: function(e) {
  41204. return 0 != (this.mask & e.mask)
  41205. }
  41206. },
  41207. (A = Ci).Raycaster = function(e, t, i, n) {
  41208. this.ray = new A.Ray(e,t),
  41209. this.near = i || 0,
  41210. this.far = n || 1 / 0,
  41211. this.params = {
  41212. Mesh: {},
  41213. Line: {},
  41214. LOD: {},
  41215. Points: {
  41216. threshold: 1
  41217. },
  41218. Sprite: {}
  41219. },
  41220. Object.defineProperties(this.params, {
  41221. PointCloud: {
  41222. get: function() {
  41223. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41224. this.Points
  41225. }
  41226. }
  41227. })
  41228. }
  41229. ,
  41230. A.Raycaster.prototype = {
  41231. constructor: A.Raycaster,
  41232. linePrecision: 1,
  41233. set: function(e, t) {
  41234. this.ray.set(e, t)
  41235. },
  41236. setFromCamera: function(e, t) {
  41237. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41238. 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),
  41239. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41240. },
  41241. intersectObject: function(e, t) {
  41242. var i = [];
  41243. return Ei(e, this, i, t),
  41244. i.sort(Ii),
  41245. i
  41246. },
  41247. intersectObjects: function(e, t) {
  41248. var i = [];
  41249. if (!1 === Array.isArray(e))
  41250. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41251. i;
  41252. for (var n = 0, r = e.length; n < r; n++)
  41253. Ei(e[n], this, i, t);
  41254. return i.sort(Ii),
  41255. i
  41256. }
  41257. },
  41258. Ci.Object3D = function() {
  41259. Object.defineProperty(this, "id", {
  41260. value: Ci.Object3DIdCount++
  41261. }),
  41262. this.uuid = Ci.Math.generateUUID(),
  41263. this.name = "",
  41264. this.type = "Object3D",
  41265. this.parent = null,
  41266. this.children = [],
  41267. this.up = Ci.Object3D.DefaultUp.clone();
  41268. var e = new Ci.Vector3
  41269. , t = new Ci.Euler
  41270. , i = new Ci.Quaternion
  41271. , n = new Ci.Vector3(1,1,1);
  41272. t.onChange(function() {
  41273. i.setFromEuler(t, !1)
  41274. }),
  41275. i.onChange(function() {
  41276. t.setFromQuaternion(i, void 0, !1)
  41277. }),
  41278. Object.defineProperties(this, {
  41279. position: {
  41280. enumerable: !0,
  41281. value: e
  41282. },
  41283. rotation: {
  41284. enumerable: !0,
  41285. value: t
  41286. },
  41287. quaternion: {
  41288. enumerable: !0,
  41289. value: i
  41290. },
  41291. scale: {
  41292. enumerable: !0,
  41293. value: n
  41294. },
  41295. modelViewMatrix: {
  41296. value: new Ci.Matrix4
  41297. },
  41298. normalMatrix: {
  41299. value: new Ci.Matrix3
  41300. }
  41301. }),
  41302. this.rotationAutoUpdate = !0,
  41303. this.matrix = new Ci.Matrix4,
  41304. this.matrixWorld = new Ci.Matrix4,
  41305. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41306. this.matrixWorldNeedsUpdate = !1,
  41307. this.layers = new Ci.Layers,
  41308. this.visible = !0,
  41309. this.castShadow = !1,
  41310. this.receiveShadow = !1,
  41311. this.frustumCulled = !0,
  41312. this.renderOrder = 0,
  41313. this.userData = {}
  41314. }
  41315. ,
  41316. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41317. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41318. Ci.Object3D.prototype = {
  41319. constructor: Ci.Object3D,
  41320. applyMatrix: function(e) {
  41321. this.matrix.multiplyMatrices(e, this.matrix),
  41322. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41323. },
  41324. setRotationFromAxisAngle: function(e, t) {
  41325. this.quaternion.setFromAxisAngle(e, t)
  41326. },
  41327. setRotationFromEuler: function(e) {
  41328. this.quaternion.setFromEuler(e, !0)
  41329. },
  41330. setRotationFromMatrix: function(e) {
  41331. this.quaternion.setFromRotationMatrix(e)
  41332. },
  41333. setRotationFromQuaternion: function(e) {
  41334. this.quaternion.copy(e)
  41335. },
  41336. rotateOnAxis: (y = new Ci.Quaternion,
  41337. function(e, t) {
  41338. return y.setFromAxisAngle(e, t),
  41339. this.quaternion.multiply(y),
  41340. this
  41341. }
  41342. ),
  41343. rotateX: (v = new Ci.Vector3(1,0,0),
  41344. function(e) {
  41345. return this.rotateOnAxis(v, e)
  41346. }
  41347. ),
  41348. rotateY: (m = new Ci.Vector3(0,1,0),
  41349. function(e) {
  41350. return this.rotateOnAxis(m, e)
  41351. }
  41352. ),
  41353. rotateZ: (g = new Ci.Vector3(0,0,1),
  41354. function(e) {
  41355. return this.rotateOnAxis(g, e)
  41356. }
  41357. ),
  41358. translateOnAxis: (f = new Ci.Vector3,
  41359. function(e, t) {
  41360. return f.copy(e).applyQuaternion(this.quaternion),
  41361. this.position.add(f.multiplyScalar(t)),
  41362. this
  41363. }
  41364. ),
  41365. translateX: (p = new Ci.Vector3(1,0,0),
  41366. function(e) {
  41367. return this.translateOnAxis(p, e)
  41368. }
  41369. ),
  41370. translateY: (d = new Ci.Vector3(0,1,0),
  41371. function(e) {
  41372. return this.translateOnAxis(d, e)
  41373. }
  41374. ),
  41375. translateZ: (u = new Ci.Vector3(0,0,1),
  41376. function(e) {
  41377. return this.translateOnAxis(u, e)
  41378. }
  41379. ),
  41380. localToWorld: function(e) {
  41381. return e.applyMatrix4(this.matrixWorld)
  41382. },
  41383. worldToLocal: (h = new Ci.Matrix4,
  41384. function(e) {
  41385. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41386. }
  41387. ),
  41388. lookAt: (c = new Ci.Matrix4,
  41389. function(e) {
  41390. c.lookAt(e, this.position, this.up),
  41391. this.quaternion.setFromRotationMatrix(c)
  41392. }
  41393. ),
  41394. add: function(e) {
  41395. if (1 < arguments.length) {
  41396. for (var t = 0; t < arguments.length; t++)
  41397. this.add(arguments[t]);
  41398. return this
  41399. }
  41400. 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),
  41401. e.parent = this,
  41402. e.dispatchEvent({
  41403. type: "added"
  41404. }),
  41405. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41406. this
  41407. },
  41408. remove: function(e) {
  41409. if (1 < arguments.length)
  41410. for (var t = 0; t < arguments.length; t++)
  41411. this.remove(arguments[t]);
  41412. var i = this.children.indexOf(e);
  41413. -1 !== i && (e.parent = null,
  41414. e.dispatchEvent({
  41415. type: "removed"
  41416. }),
  41417. this.children.splice(i, 1))
  41418. },
  41419. getObjectById: function(e) {
  41420. return this.getObjectByProperty("id", e)
  41421. },
  41422. getObjectByName: function(e) {
  41423. return this.getObjectByProperty("name", e)
  41424. },
  41425. getObjectByProperty: function(e, t) {
  41426. if (this[e] === t)
  41427. return this;
  41428. for (var i = 0, n = this.children.length; i < n; i++) {
  41429. var r = this.children[i].getObjectByProperty(e, t);
  41430. if (void 0 !== r)
  41431. return r
  41432. }
  41433. },
  41434. getWorldPosition: function(e) {
  41435. var t = e || new Ci.Vector3;
  41436. return this.updateMatrixWorld(!0),
  41437. t.setFromMatrixPosition(this.matrixWorld)
  41438. },
  41439. getWorldQuaternion: (s = new Ci.Vector3,
  41440. l = new Ci.Vector3,
  41441. function(e) {
  41442. var t = e || new Ci.Quaternion;
  41443. return this.updateMatrixWorld(!0),
  41444. this.matrixWorld.decompose(s, t, l),
  41445. t
  41446. }
  41447. ),
  41448. getWorldRotation: (a = new Ci.Quaternion,
  41449. function(e) {
  41450. var t = e || new Ci.Euler;
  41451. return this.getWorldQuaternion(a),
  41452. t.setFromQuaternion(a, this.rotation.order, !1)
  41453. }
  41454. ),
  41455. getWorldScale: (r = new Ci.Vector3,
  41456. o = new Ci.Quaternion,
  41457. function(e) {
  41458. var t = e || new Ci.Vector3;
  41459. return this.updateMatrixWorld(!0),
  41460. this.matrixWorld.decompose(r, o, t),
  41461. t
  41462. }
  41463. ),
  41464. getWorldDirection: (n = new Ci.Quaternion,
  41465. function(e) {
  41466. var t = e || new Ci.Vector3;
  41467. return this.getWorldQuaternion(n),
  41468. t.set(0, 0, 1).applyQuaternion(n)
  41469. }
  41470. ),
  41471. raycast: function() {},
  41472. traverse: function(e) {
  41473. e(this);
  41474. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41475. t[i].traverse(e)
  41476. },
  41477. traverseVisible: function(e) {
  41478. if (!1 !== this.visible) {
  41479. e(this);
  41480. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41481. t[i].traverseVisible(e)
  41482. }
  41483. },
  41484. traverseAncestors: function(e) {
  41485. var t = this.parent;
  41486. null !== t && (e(t),
  41487. t.traverseAncestors(e))
  41488. },
  41489. updateMatrix: function() {
  41490. this.matrix.compose(this.position, this.quaternion, this.scale),
  41491. this.matrixWorldNeedsUpdate = !0
  41492. },
  41493. updateMatrixWorld: function(e) {
  41494. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41495. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41496. e = !(this.matrixWorldNeedsUpdate = !1));
  41497. for (var t = 0, i = this.children.length; t < i; t++)
  41498. this.children[t].updateMatrixWorld(e)
  41499. },
  41500. toJSON: function(e) {
  41501. function t(e) {
  41502. var t = [];
  41503. for (var i in e) {
  41504. var n = e[i];
  41505. delete n.metadata,
  41506. t.push(n)
  41507. }
  41508. return t
  41509. }
  41510. var i = void 0 === e
  41511. , n = {};
  41512. i && (e = {
  41513. geometries: {},
  41514. materials: {},
  41515. textures: {},
  41516. images: {}
  41517. },
  41518. n.metadata = {
  41519. version: 4.4,
  41520. type: "Object",
  41521. generator: "Object3D.toJSON"
  41522. });
  41523. var r = {};
  41524. if (r.uuid = this.uuid,
  41525. r.type = this.type,
  41526. "" !== this.name && (r.name = this.name),
  41527. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41528. !0 === this.castShadow && (r.castShadow = !0),
  41529. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41530. !1 === this.visible && (r.visible = !1),
  41531. r.matrix = this.matrix.toArray(),
  41532. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41533. r.geometry = this.geometry.uuid),
  41534. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41535. r.material = this.material.uuid),
  41536. 0 < this.children.length) {
  41537. r.children = [];
  41538. for (var o = 0; o < this.children.length; o++)
  41539. r.children.push(this.children[o].toJSON(e).object)
  41540. }
  41541. if (i) {
  41542. var a = t(e.geometries)
  41543. , s = t(e.materials)
  41544. , l = t(e.textures)
  41545. , c = t(e.images);
  41546. 0 < a.length && (n.geometries = a),
  41547. 0 < s.length && (n.materials = s),
  41548. 0 < l.length && (n.textures = l),
  41549. 0 < c.length && (n.images = c)
  41550. }
  41551. return n.object = r,
  41552. n
  41553. },
  41554. clone: function(e) {
  41555. return (new this.constructor).copy(this, e)
  41556. },
  41557. copy: function(e, t) {
  41558. if (void 0 === t && (t = !0),
  41559. this.name = e.name,
  41560. this.up.copy(e.up),
  41561. this.position.copy(e.position),
  41562. this.quaternion.copy(e.quaternion),
  41563. this.scale.copy(e.scale),
  41564. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41565. this.matrix.copy(e.matrix),
  41566. this.matrixWorld.copy(e.matrixWorld),
  41567. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41568. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41569. this.visible = e.visible,
  41570. this.castShadow = e.castShadow,
  41571. this.receiveShadow = e.receiveShadow,
  41572. this.frustumCulled = e.frustumCulled,
  41573. this.renderOrder = e.renderOrder,
  41574. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41575. !0 === t)
  41576. for (var i = 0; i < e.children.length; i++) {
  41577. var n = e.children[i];
  41578. this.add(n.clone())
  41579. }
  41580. return this
  41581. }
  41582. },
  41583. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41584. Ci.Object3DIdCount = 0,
  41585. Ci.Face3 = function(e, t, i, n, r, o) {
  41586. this.a = e,
  41587. this.b = t,
  41588. this.c = i,
  41589. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41590. this.vertexNormals = Array.isArray(n) ? n : [],
  41591. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41592. this.vertexColors = Array.isArray(r) ? r : [],
  41593. this.materialIndex = void 0 !== o ? o : 0
  41594. }
  41595. ,
  41596. Ci.Face3.prototype = {
  41597. constructor: Ci.Face3,
  41598. clone: function() {
  41599. return (new this.constructor).copy(this)
  41600. },
  41601. copy: function(e) {
  41602. this.a = e.a,
  41603. this.b = e.b,
  41604. this.c = e.c,
  41605. this.normal.copy(e.normal),
  41606. this.color.copy(e.color),
  41607. this.materialIndex = e.materialIndex;
  41608. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41609. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41610. for (t = 0,
  41611. i = e.vertexColors.length; t < i; t++)
  41612. this.vertexColors[t] = e.vertexColors[t].clone();
  41613. return this
  41614. }
  41615. },
  41616. Ci.BufferAttribute = function(e, t) {
  41617. this.uuid = Ci.Math.generateUUID(),
  41618. this.array = e,
  41619. this.itemSize = t,
  41620. this.dynamic = !1,
  41621. this.updateRange = {
  41622. offset: 0,
  41623. count: -1
  41624. },
  41625. this.version = 0
  41626. }
  41627. ,
  41628. Ci.BufferAttribute.prototype = {
  41629. constructor: Ci.BufferAttribute,
  41630. get count() {
  41631. return this.array.length / this.itemSize
  41632. },
  41633. set needsUpdate(e) {
  41634. !0 === e && this.version++
  41635. },
  41636. setDynamic: function(e) {
  41637. return this.dynamic = e,
  41638. this
  41639. },
  41640. copy: function(e) {
  41641. return this.array = new e.array.constructor(e.array),
  41642. this.itemSize = e.itemSize,
  41643. this.dynamic = e.dynamic,
  41644. this
  41645. },
  41646. copyAt: function(e, t, i) {
  41647. e *= this.itemSize,
  41648. i *= t.itemSize;
  41649. for (var n = 0, r = this.itemSize; n < r; n++)
  41650. this.array[e + n] = t.array[i + n];
  41651. return this
  41652. },
  41653. copyArray: function(e) {
  41654. return this.array.set(e),
  41655. this
  41656. },
  41657. copyColorsArray: function(e) {
  41658. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41659. var o = e[n];
  41660. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41661. o = new Ci.Color),
  41662. t[i++] = o.r,
  41663. t[i++] = o.g,
  41664. t[i++] = o.b
  41665. }
  41666. return this
  41667. },
  41668. copyIndicesArray: function(e) {
  41669. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41670. var o = e[n];
  41671. t[i++] = o.a,
  41672. t[i++] = o.b,
  41673. t[i++] = o.c
  41674. }
  41675. return this
  41676. },
  41677. copyVector2sArray: function(e) {
  41678. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41679. var o = e[n];
  41680. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41681. o = new Ci.Vector2),
  41682. t[i++] = o.x,
  41683. t[i++] = o.y
  41684. }
  41685. return this
  41686. },
  41687. copyVector3sArray: function(e) {
  41688. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41689. var o = e[n];
  41690. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41691. o = new Ci.Vector3),
  41692. t[i++] = o.x,
  41693. t[i++] = o.y,
  41694. t[i++] = o.z
  41695. }
  41696. return this
  41697. },
  41698. copyVector4sArray: function(e) {
  41699. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41700. var o = e[n];
  41701. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41702. o = new Ci.Vector4),
  41703. t[i++] = o.x,
  41704. t[i++] = o.y,
  41705. t[i++] = o.z,
  41706. t[i++] = o.w
  41707. }
  41708. return this
  41709. },
  41710. set: function(e, t) {
  41711. return void 0 === t && (t = 0),
  41712. this.array.set(e, t),
  41713. this
  41714. },
  41715. getX: function(e) {
  41716. return this.array[e * this.itemSize]
  41717. },
  41718. setX: function(e, t) {
  41719. return this.array[e * this.itemSize] = t,
  41720. this
  41721. },
  41722. getY: function(e) {
  41723. return this.array[e * this.itemSize + 1]
  41724. },
  41725. setY: function(e, t) {
  41726. return this.array[e * this.itemSize + 1] = t,
  41727. this
  41728. },
  41729. getZ: function(e) {
  41730. return this.array[e * this.itemSize + 2]
  41731. },
  41732. setZ: function(e, t) {
  41733. return this.array[e * this.itemSize + 2] = t,
  41734. this
  41735. },
  41736. getW: function(e) {
  41737. return this.array[e * this.itemSize + 3]
  41738. },
  41739. setW: function(e, t) {
  41740. return this.array[e * this.itemSize + 3] = t,
  41741. this
  41742. },
  41743. setXY: function(e, t, i) {
  41744. return e *= this.itemSize,
  41745. this.array[e + 0] = t,
  41746. this.array[e + 1] = i,
  41747. this
  41748. },
  41749. setXYZ: function(e, t, i, n) {
  41750. return e *= this.itemSize,
  41751. this.array[e + 0] = t,
  41752. this.array[e + 1] = i,
  41753. this.array[e + 2] = n,
  41754. this
  41755. },
  41756. setXYZW: function(e, t, i, n, r) {
  41757. return e *= this.itemSize,
  41758. this.array[e + 0] = t,
  41759. this.array[e + 1] = i,
  41760. this.array[e + 2] = n,
  41761. this.array[e + 3] = r,
  41762. this
  41763. },
  41764. clone: function() {
  41765. return (new this.constructor).copy(this)
  41766. }
  41767. },
  41768. Ci.Int8Attribute = function(e, t) {
  41769. return new Ci.BufferAttribute(new Int8Array(e),t)
  41770. }
  41771. ,
  41772. Ci.Uint8Attribute = function(e, t) {
  41773. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41774. }
  41775. ,
  41776. Ci.Uint8ClampedAttribute = function(e, t) {
  41777. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41778. }
  41779. ,
  41780. Ci.Int16Attribute = function(e, t) {
  41781. return new Ci.BufferAttribute(new Int16Array(e),t)
  41782. }
  41783. ,
  41784. Ci.Uint16Attribute = function(e, t) {
  41785. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41786. }
  41787. ,
  41788. Ci.Int32Attribute = function(e, t) {
  41789. return new Ci.BufferAttribute(new Int32Array(e),t)
  41790. }
  41791. ,
  41792. Ci.Uint32Attribute = function(e, t) {
  41793. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41794. }
  41795. ,
  41796. Ci.Float32Attribute = function(e, t) {
  41797. return new Ci.BufferAttribute(new Float32Array(e),t)
  41798. }
  41799. ,
  41800. Ci.Float64Attribute = function(e, t) {
  41801. return new Ci.BufferAttribute(new Float64Array(e),t)
  41802. }
  41803. ,
  41804. Ci.DynamicBufferAttribute = function(e, t) {
  41805. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41806. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41807. }
  41808. ,
  41809. Ci.InstancedBufferAttribute = function(e, t, i) {
  41810. Ci.BufferAttribute.call(this, e, t),
  41811. this.meshPerAttribute = i || 1
  41812. }
  41813. ,
  41814. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41815. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41816. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41817. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41818. this.meshPerAttribute = e.meshPerAttribute,
  41819. this
  41820. }
  41821. ,
  41822. Ci.InterleavedBuffer = function(e, t) {
  41823. this.uuid = Ci.Math.generateUUID(),
  41824. this.array = e,
  41825. this.stride = t,
  41826. this.dynamic = !1,
  41827. this.updateRange = {
  41828. offset: 0,
  41829. count: -1
  41830. },
  41831. this.version = 0
  41832. }
  41833. ,
  41834. Ci.InterleavedBuffer.prototype = {
  41835. constructor: Ci.InterleavedBuffer,
  41836. get length() {
  41837. return this.array.length
  41838. },
  41839. get count() {
  41840. return this.array.length / this.stride
  41841. },
  41842. set needsUpdate(e) {
  41843. !0 === e && this.version++
  41844. },
  41845. setDynamic: function(e) {
  41846. return this.dynamic = e,
  41847. this
  41848. },
  41849. copy: function(e) {
  41850. return this.array = new e.array.constructor(e.array),
  41851. this.stride = e.stride,
  41852. this.dynamic = e.dynamic,
  41853. this
  41854. },
  41855. copyAt: function(e, t, i) {
  41856. e *= this.stride,
  41857. i *= t.stride;
  41858. for (var n = 0, r = this.stride; n < r; n++)
  41859. this.array[e + n] = t.array[i + n];
  41860. return this
  41861. },
  41862. set: function(e, t) {
  41863. return void 0 === t && (t = 0),
  41864. this.array.set(e, t),
  41865. this
  41866. },
  41867. clone: function() {
  41868. return (new this.constructor).copy(this)
  41869. }
  41870. },
  41871. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41872. Ci.InterleavedBuffer.call(this, e, t),
  41873. this.meshPerAttribute = i || 1
  41874. }
  41875. ,
  41876. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41877. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41878. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41879. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41880. this.meshPerAttribute = e.meshPerAttribute,
  41881. this
  41882. }
  41883. ,
  41884. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41885. this.uuid = Ci.Math.generateUUID(),
  41886. this.data = e,
  41887. this.itemSize = t,
  41888. this.offset = i
  41889. }
  41890. ,
  41891. Ci.InterleavedBufferAttribute.prototype = {
  41892. constructor: Ci.InterleavedBufferAttribute,
  41893. get length() {
  41894. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41895. this.array.length
  41896. },
  41897. get count() {
  41898. return this.data.count
  41899. },
  41900. setX: function(e, t) {
  41901. return this.data.array[e * this.data.stride + this.offset] = t,
  41902. this
  41903. },
  41904. setY: function(e, t) {
  41905. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41906. this
  41907. },
  41908. setZ: function(e, t) {
  41909. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41910. this
  41911. },
  41912. setW: function(e, t) {
  41913. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41914. this
  41915. },
  41916. getX: function(e) {
  41917. return this.data.array[e * this.data.stride + this.offset]
  41918. },
  41919. getY: function(e) {
  41920. return this.data.array[e * this.data.stride + this.offset + 1]
  41921. },
  41922. getZ: function(e) {
  41923. return this.data.array[e * this.data.stride + this.offset + 2]
  41924. },
  41925. getW: function(e) {
  41926. return this.data.array[e * this.data.stride + this.offset + 3]
  41927. },
  41928. setXY: function(e, t, i) {
  41929. return e = e * this.data.stride + this.offset,
  41930. this.data.array[e + 0] = t,
  41931. this.data.array[e + 1] = i,
  41932. this
  41933. },
  41934. setXYZ: function(e, t, i, n) {
  41935. return e = e * this.data.stride + this.offset,
  41936. this.data.array[e + 0] = t,
  41937. this.data.array[e + 1] = i,
  41938. this.data.array[e + 2] = n,
  41939. this
  41940. },
  41941. setXYZW: function(e, t, i, n, r) {
  41942. return e = e * this.data.stride + this.offset,
  41943. this.data.array[e + 0] = t,
  41944. this.data.array[e + 1] = i,
  41945. this.data.array[e + 2] = n,
  41946. this.data.array[e + 3] = r,
  41947. this
  41948. }
  41949. },
  41950. Ci.Geometry = function() {
  41951. Object.defineProperty(this, "id", {
  41952. value: Ci.GeometryIdCount++
  41953. }),
  41954. this.uuid = Ci.Math.generateUUID(),
  41955. this.name = "",
  41956. this.type = "Geometry",
  41957. this.vertices = [],
  41958. this.colors = [],
  41959. this.faces = [],
  41960. this.faceVertexUvs = [[]],
  41961. this.morphTargets = [],
  41962. this.morphNormals = [],
  41963. this.skinWeights = [],
  41964. this.skinIndices = [],
  41965. this.lineDistances = [],
  41966. this.boundingBox = null,
  41967. this.boundingSphere = null,
  41968. this.verticesNeedUpdate = !1,
  41969. this.elementsNeedUpdate = !1,
  41970. this.uvsNeedUpdate = !1,
  41971. this.normalsNeedUpdate = !1,
  41972. this.colorsNeedUpdate = !1,
  41973. this.lineDistancesNeedUpdate = !1,
  41974. this.groupsNeedUpdate = !1
  41975. }
  41976. ,
  41977. Ci.Geometry.prototype = {
  41978. constructor: Ci.Geometry,
  41979. applyMatrix: function(e) {
  41980. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41981. this.vertices[i].applyMatrix4(e)
  41982. }
  41983. for (i = 0,
  41984. n = this.faces.length; i < n; i++) {
  41985. var r = this.faces[i];
  41986. r.normal.applyMatrix3(t).normalize();
  41987. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41988. r.vertexNormals[o].applyMatrix3(t).normalize()
  41989. }
  41990. return null !== this.boundingBox && this.computeBoundingBox(),
  41991. null !== this.boundingSphere && this.computeBoundingSphere(),
  41992. this.verticesNeedUpdate = !0,
  41993. this.normalsNeedUpdate = !0,
  41994. this
  41995. },
  41996. rotateX: function(e) {
  41997. return void 0 === mt && (mt = new Ci.Matrix4),
  41998. mt.makeRotationX(e),
  41999. this.applyMatrix(mt),
  42000. this
  42001. },
  42002. rotateY: function(e) {
  42003. return void 0 === gt && (gt = new Ci.Matrix4),
  42004. gt.makeRotationY(e),
  42005. this.applyMatrix(gt),
  42006. this
  42007. },
  42008. rotateZ: function(e) {
  42009. return void 0 === ft && (ft = new Ci.Matrix4),
  42010. ft.makeRotationZ(e),
  42011. this.applyMatrix(ft),
  42012. this
  42013. },
  42014. translate: function(e, t, i) {
  42015. return void 0 === pt && (pt = new Ci.Matrix4),
  42016. pt.makeTranslation(e, t, i),
  42017. this.applyMatrix(pt),
  42018. this
  42019. },
  42020. scale: function(e, t, i) {
  42021. return void 0 === dt && (dt = new Ci.Matrix4),
  42022. dt.makeScale(e, t, i),
  42023. this.applyMatrix(dt),
  42024. this
  42025. },
  42026. lookAt: function(e) {
  42027. void 0 === ut && (ut = new Ci.Object3D),
  42028. ut.lookAt(e),
  42029. ut.updateMatrix(),
  42030. this.applyMatrix(ut.matrix)
  42031. },
  42032. fromBufferGeometry: function(e) {
  42033. function t(e, t, i, n) {
  42034. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  42035. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  42036. , a = new Ci.Face3(e,t,i,r,o,n);
  42037. s.faces.push(a),
  42038. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  42039. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  42040. }
  42041. var s = this
  42042. , i = null !== e.index ? e.index.array : void 0
  42043. , n = e.attributes
  42044. , r = n.position.array
  42045. , l = void 0 !== n.normal ? n.normal.array : void 0
  42046. , c = void 0 !== n.color ? n.color.array : void 0
  42047. , h = void 0 !== n.uv ? n.uv.array : void 0
  42048. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42049. void 0 !== u && (this.faceVertexUvs[1] = []);
  42050. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42051. a += 2)
  42052. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42053. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42054. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42055. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42056. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42057. if (void 0 !== i) {
  42058. var g = e.groups;
  42059. if (0 < g.length)
  42060. for (o = 0; o < g.length; o++)
  42061. for (var m = g[o], v = m.start, y = (a = v,
  42062. v + m.count); a < y; a += 3)
  42063. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42064. else
  42065. for (o = 0; o < i.length; o += 3)
  42066. t(i[o], i[o + 1], i[o + 2])
  42067. } else
  42068. for (o = 0; o < r.length / 3; o += 3)
  42069. t(o, o + 1, o + 2);
  42070. return this.computeFaceNormals(),
  42071. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42072. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42073. this
  42074. },
  42075. center: function() {
  42076. this.computeBoundingBox();
  42077. var e = this.boundingBox.center().negate();
  42078. return this.translate(e.x, e.y, e.z),
  42079. e
  42080. },
  42081. normalize: function() {
  42082. this.computeBoundingSphere();
  42083. var e = this.boundingSphere.center
  42084. , t = this.boundingSphere.radius
  42085. , i = 0 === t ? 1 : 1 / t
  42086. , n = new Ci.Matrix4;
  42087. 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),
  42088. this.applyMatrix(n),
  42089. this
  42090. },
  42091. computeFaceNormals: function() {
  42092. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42093. var r = this.faces[i]
  42094. , o = this.vertices[r.a]
  42095. , a = this.vertices[r.b]
  42096. , s = this.vertices[r.c];
  42097. e.subVectors(s, a),
  42098. t.subVectors(o, a),
  42099. e.cross(t),
  42100. e.normalize(),
  42101. r.normal.copy(e)
  42102. }
  42103. },
  42104. computeVertexNormals: function(e) {
  42105. var t, i, n, r, o, a;
  42106. for (void 0 === e && (e = !0),
  42107. a = new Array(this.vertices.length),
  42108. t = 0,
  42109. i = this.vertices.length; t < i; t++)
  42110. a[t] = new Ci.Vector3;
  42111. if (e) {
  42112. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42113. for (n = 0,
  42114. r = this.faces.length; n < r; n++)
  42115. o = this.faces[n],
  42116. s = this.vertices[o.a],
  42117. l = this.vertices[o.b],
  42118. c = this.vertices[o.c],
  42119. h.subVectors(c, l),
  42120. u.subVectors(s, l),
  42121. h.cross(u),
  42122. a[o.a].add(h),
  42123. a[o.b].add(h),
  42124. a[o.c].add(h)
  42125. } else
  42126. for (n = 0,
  42127. r = this.faces.length; n < r; n++)
  42128. a[(o = this.faces[n]).a].add(o.normal),
  42129. a[o.b].add(o.normal),
  42130. a[o.c].add(o.normal);
  42131. for (t = 0,
  42132. i = this.vertices.length; t < i; t++)
  42133. a[t].normalize();
  42134. for (n = 0,
  42135. r = this.faces.length; n < r; n++) {
  42136. var d = (o = this.faces[n]).vertexNormals;
  42137. 3 === d.length ? (d[0].copy(a[o.a]),
  42138. d[1].copy(a[o.b]),
  42139. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42140. d[1] = a[o.b].clone(),
  42141. d[2] = a[o.c].clone())
  42142. }
  42143. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42144. },
  42145. computeMorphNormals: function() {
  42146. var e, t, i, n, r;
  42147. for (i = 0,
  42148. n = this.faces.length; i < n; i++)
  42149. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42150. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42151. e = 0,
  42152. t = r.vertexNormals.length; e < t; e++)
  42153. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42154. var o = new Ci.Geometry;
  42155. for (o.faces = this.faces,
  42156. e = 0,
  42157. t = this.morphTargets.length; e < t; e++) {
  42158. if (!this.morphNormals[e]) {
  42159. this.morphNormals[e] = {},
  42160. this.morphNormals[e].faceNormals = [],
  42161. this.morphNormals[e].vertexNormals = [];
  42162. var a = this.morphNormals[e].faceNormals
  42163. , s = this.morphNormals[e].vertexNormals;
  42164. for (i = 0,
  42165. n = this.faces.length; i < n; i++)
  42166. l = new Ci.Vector3,
  42167. c = {
  42168. a: new Ci.Vector3,
  42169. b: new Ci.Vector3,
  42170. c: new Ci.Vector3
  42171. },
  42172. a.push(l),
  42173. s.push(c)
  42174. }
  42175. var l, c, h = this.morphNormals[e];
  42176. for (o.vertices = this.morphTargets[e].vertices,
  42177. o.computeFaceNormals(),
  42178. o.computeVertexNormals(),
  42179. i = 0,
  42180. n = this.faces.length; i < n; i++)
  42181. r = this.faces[i],
  42182. l = h.faceNormals[i],
  42183. c = h.vertexNormals[i],
  42184. l.copy(r.normal),
  42185. c.a.copy(r.vertexNormals[0]),
  42186. c.b.copy(r.vertexNormals[1]),
  42187. c.c.copy(r.vertexNormals[2])
  42188. }
  42189. for (i = 0,
  42190. n = this.faces.length; i < n; i++)
  42191. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42192. r.vertexNormals = r.__originalVertexNormals
  42193. },
  42194. computeTangents: function() {
  42195. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42196. },
  42197. computeLineDistances: function() {
  42198. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42199. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42200. this.lineDistances[i] = e
  42201. },
  42202. computeBoundingBox: function() {
  42203. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42204. this.boundingBox.setFromPoints(this.vertices)
  42205. },
  42206. computeBoundingSphere: function() {
  42207. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42208. this.boundingSphere.setFromPoints(this.vertices)
  42209. },
  42210. merge: function(e, t, i) {
  42211. if (e instanceof Ci.Geometry != 0) {
  42212. 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];
  42213. void 0 === i && (i = 0),
  42214. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42215. for (var u = 0, d = a.length; u < d; u++) {
  42216. var p = a[u].clone();
  42217. void 0 !== t && p.applyMatrix4(t),
  42218. o.push(p)
  42219. }
  42220. for (u = 0,
  42221. d = l.length; u < d; u++) {
  42222. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42223. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42224. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42225. for (var C = 0, I = y.length; C < I; C++)
  42226. g = y[C].clone(),
  42227. void 0 !== n && g.applyMatrix3(n).normalize(),
  42228. f.vertexNormals.push(g);
  42229. f.color.copy(v.color);
  42230. for (C = 0,
  42231. I = A.length; C < I; C++)
  42232. m = A[C],
  42233. f.vertexColors.push(m.clone());
  42234. f.materialIndex = v.materialIndex + i,
  42235. s.push(f)
  42236. }
  42237. for (u = 0,
  42238. d = h.length; u < d; u++) {
  42239. var E = h[u]
  42240. , _ = [];
  42241. if (void 0 !== E) {
  42242. for (C = 0,
  42243. I = E.length; C < I; C++)
  42244. _.push(E[C].clone());
  42245. c.push(_)
  42246. }
  42247. }
  42248. } else
  42249. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42250. },
  42251. mergeMesh: function(e) {
  42252. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42253. void this.merge(e.geometry, e.matrix))
  42254. },
  42255. mergeVertices: function() {
  42256. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42257. for (i = 0,
  42258. n = this.vertices.length; i < n; i++)
  42259. e = this.vertices[i],
  42260. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42261. c.push(this.vertices[i]),
  42262. h[i] = c.length - 1) : h[i] = h[l[t]];
  42263. var d = [];
  42264. for (i = 0,
  42265. n = this.faces.length; i < n; i++) {
  42266. (r = this.faces[i]).a = h[r.a],
  42267. r.b = h[r.b],
  42268. r.c = h[r.c],
  42269. o = [r.a, r.b, r.c];
  42270. for (var p = 0; p < 3; p++)
  42271. if (o[p] === o[(p + 1) % 3]) {
  42272. p,
  42273. d.push(i);
  42274. break
  42275. }
  42276. }
  42277. for (i = d.length - 1; 0 <= i; i--) {
  42278. var f = d[i];
  42279. for (this.faces.splice(f, 1),
  42280. a = 0,
  42281. s = this.faceVertexUvs.length; a < s; a++)
  42282. this.faceVertexUvs[a].splice(f, 1)
  42283. }
  42284. var g = this.vertices.length - c.length;
  42285. return this.vertices = c,
  42286. g
  42287. },
  42288. sortFacesByMaterialIndex: function() {
  42289. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42290. e[i]._id = i;
  42291. e.sort(function(e, t) {
  42292. return e.materialIndex - t.materialIndex
  42293. });
  42294. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42295. o && o.length === t && (n = []),
  42296. a && a.length === t && (r = []);
  42297. for (i = 0; i < t; i++) {
  42298. var s = e[i]._id;
  42299. n && n.push(o[s]),
  42300. r && r.push(a[s])
  42301. }
  42302. n && (this.faceVertexUvs[0] = n),
  42303. r && (this.faceVertexUvs[1] = r)
  42304. },
  42305. toJSON: function() {
  42306. function e(e, t, i) {
  42307. return i ? e | 1 << t : e & ~(1 << t)
  42308. }
  42309. function t(e) {
  42310. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42311. return void 0 !== d[t] || (d[t] = u.length / 3,
  42312. u.push(e.x, e.y, e.z)),
  42313. d[t]
  42314. }
  42315. function i(e) {
  42316. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42317. return void 0 !== f[t] || (f[t] = p.length,
  42318. p.push(e.getHex())),
  42319. f[t]
  42320. }
  42321. function n(e) {
  42322. var t = e.x.toString() + e.y.toString();
  42323. return void 0 !== m[t] || (m[t] = g.length / 2,
  42324. g.push(e.x, e.y)),
  42325. m[t]
  42326. }
  42327. var r = {
  42328. metadata: {
  42329. version: 4.4,
  42330. type: "Geometry",
  42331. generator: "Geometry.toJSON"
  42332. }
  42333. };
  42334. if (r.uuid = this.uuid,
  42335. r.type = this.type,
  42336. "" !== this.name && (r.name = this.name),
  42337. void 0 !== this.parameters) {
  42338. var o = this.parameters;
  42339. for (var a in o)
  42340. void 0 !== o[a] && (r[a] = o[a]);
  42341. return r
  42342. }
  42343. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42344. var c = this.vertices[l];
  42345. s.push(c.x, c.y, c.z)
  42346. }
  42347. var h = []
  42348. , u = []
  42349. , d = {}
  42350. , p = []
  42351. , f = {}
  42352. , g = []
  42353. , m = {};
  42354. for (l = 0; l < this.faces.length; l++) {
  42355. var v = this.faces[l]
  42356. , y = void 0 !== this.faceVertexUvs[0][l]
  42357. , A = 0 < v.normal.length()
  42358. , C = 0 < v.vertexNormals.length
  42359. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42360. , E = 0 < v.vertexColors.length
  42361. , _ = 0;
  42362. 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),
  42363. h.push(_),
  42364. h.push(v.a, v.b, v.c),
  42365. h.push(v.materialIndex),
  42366. y) {
  42367. var b = this.faceVertexUvs[0][l];
  42368. h.push(n(b[0]), n(b[1]), n(b[2]))
  42369. }
  42370. if (A && h.push(t(v.normal)),
  42371. C) {
  42372. var w = v.vertexNormals;
  42373. h.push(t(w[0]), t(w[1]), t(w[2]))
  42374. }
  42375. if (I && h.push(i(v.color)),
  42376. E) {
  42377. var T = v.vertexColors;
  42378. h.push(i(T[0]), i(T[1]), i(T[2]))
  42379. }
  42380. }
  42381. return r.data = {},
  42382. r.data.vertices = s,
  42383. r.data.normals = u,
  42384. 0 < p.length && (r.data.colors = p),
  42385. 0 < g.length && (r.data.uvs = [g]),
  42386. r.data.faces = h,
  42387. r
  42388. },
  42389. clone: function() {
  42390. return (new Ci.Geometry).copy(this)
  42391. },
  42392. copy: function(e) {
  42393. this.vertices = [],
  42394. this.faces = [],
  42395. this.faceVertexUvs = [[]];
  42396. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42397. this.vertices.push(t[i].clone());
  42398. var r = e.faces;
  42399. for (i = 0,
  42400. n = r.length; i < n; i++)
  42401. this.faces.push(r[i].clone());
  42402. for (i = 0,
  42403. n = e.faceVertexUvs.length; i < n; i++) {
  42404. var o = e.faceVertexUvs[i];
  42405. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42406. for (var a = 0, s = o.length; a < s; a++) {
  42407. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42408. var d = l[h];
  42409. c.push(d.clone())
  42410. }
  42411. this.faceVertexUvs[i].push(c)
  42412. }
  42413. }
  42414. return this
  42415. },
  42416. dispose: function() {
  42417. this.dispatchEvent({
  42418. type: "dispose"
  42419. })
  42420. }
  42421. },
  42422. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42423. Ci.GeometryIdCount = 0,
  42424. Ci.DirectGeometry = function() {
  42425. Object.defineProperty(this, "id", {
  42426. value: Ci.GeometryIdCount++
  42427. }),
  42428. this.uuid = Ci.Math.generateUUID(),
  42429. this.name = "",
  42430. this.type = "DirectGeometry",
  42431. this.indices = [],
  42432. this.vertices = [],
  42433. this.normals = [],
  42434. this.colors = [],
  42435. this.uvs = [],
  42436. this.uvs2 = [],
  42437. this.groups = [],
  42438. this.morphTargets = {},
  42439. this.skinWeights = [],
  42440. this.skinIndices = [],
  42441. this.boundingBox = null,
  42442. this.boundingSphere = null,
  42443. this.verticesNeedUpdate = !1,
  42444. this.normalsNeedUpdate = !1,
  42445. this.colorsNeedUpdate = !1,
  42446. this.uvsNeedUpdate = !1,
  42447. this.groupsNeedUpdate = !1
  42448. }
  42449. ,
  42450. Ci.DirectGeometry.prototype = {
  42451. constructor: Ci.DirectGeometry,
  42452. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42453. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42454. computeFaceNormals: function() {
  42455. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42456. },
  42457. computeVertexNormals: function() {
  42458. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42459. },
  42460. computeGroups: function(e) {
  42461. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42462. var a = r[o];
  42463. a.materialIndex !== i && (i = a.materialIndex,
  42464. void 0 !== t && (t.count = 3 * o - t.start,
  42465. n.push(t)),
  42466. t = {
  42467. start: 3 * o,
  42468. materialIndex: i
  42469. })
  42470. }
  42471. void 0 !== t && (t.count = 3 * o - t.start,
  42472. n.push(t)),
  42473. this.groups = n
  42474. },
  42475. fromGeometry: function(e) {
  42476. 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;
  42477. if (0 < l) {
  42478. t = [];
  42479. for (var c = 0; c < l; c++)
  42480. t[c] = [];
  42481. this.morphTargets.position = t
  42482. }
  42483. var h, u = e.morphNormals, d = u.length;
  42484. if (0 < d) {
  42485. h = [];
  42486. for (c = 0; c < d; c++)
  42487. h[c] = [];
  42488. this.morphTargets.normal = h
  42489. }
  42490. var p = e.skinIndices
  42491. , f = e.skinWeights
  42492. , g = p.length === n.length
  42493. , m = f.length === n.length;
  42494. for (c = 0; c < i.length; c++) {
  42495. var v = i[c];
  42496. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42497. var y = v.vertexNormals;
  42498. if (3 === y.length)
  42499. this.normals.push(y[0], y[1], y[2]);
  42500. else {
  42501. var A = v.normal;
  42502. this.normals.push(A, A, A)
  42503. }
  42504. var C, I = v.vertexColors;
  42505. if (3 === I.length)
  42506. this.colors.push(I[0], I[1], I[2]);
  42507. else {
  42508. var E = v.color;
  42509. this.colors.push(E, E, E)
  42510. }
  42511. if (!0 === o)
  42512. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42513. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42514. if (!0 === a)
  42515. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42516. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42517. for (var _ = 0; _ < l; _++) {
  42518. var b = s[_].vertices;
  42519. t[_].push(b[v.a], b[v.b], b[v.c])
  42520. }
  42521. for (_ = 0; _ < d; _++) {
  42522. var w = u[_].vertexNormals[c];
  42523. h[_].push(w.a, w.b, w.c)
  42524. }
  42525. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42526. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42527. }
  42528. return this.computeGroups(e),
  42529. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42530. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42531. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42532. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42533. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42534. this
  42535. },
  42536. dispose: function() {
  42537. this.dispatchEvent({
  42538. type: "dispose"
  42539. })
  42540. }
  42541. },
  42542. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42543. Ci.BufferGeometry = function() {
  42544. Object.defineProperty(this, "id", {
  42545. value: Ci.GeometryIdCount++
  42546. }),
  42547. this.uuid = Ci.Math.generateUUID(),
  42548. this.name = "",
  42549. this.type = "BufferGeometry",
  42550. this.index = null,
  42551. this.attributes = {},
  42552. this.morphAttributes = {},
  42553. this.groups = [],
  42554. this.boundingBox = null,
  42555. this.boundingSphere = null,
  42556. this.drawRange = {
  42557. start: 0,
  42558. count: 1 / 0
  42559. }
  42560. }
  42561. ,
  42562. Ci.BufferGeometry.prototype = {
  42563. constructor: Ci.BufferGeometry,
  42564. getIndex: function() {
  42565. return this.index
  42566. },
  42567. setIndex: function(e) {
  42568. this.index = e
  42569. },
  42570. addAttribute: function(e, t) {
  42571. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42572. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42573. void this.setIndex(t)) : (this.attributes[e] = t,
  42574. this)
  42575. },
  42576. getAttribute: function(e) {
  42577. return this.attributes[e]
  42578. },
  42579. removeAttribute: function(e) {
  42580. return delete this.attributes[e],
  42581. this
  42582. },
  42583. addGroup: function(e, t, i) {
  42584. this.groups.push({
  42585. start: e,
  42586. count: t,
  42587. materialIndex: void 0 !== i ? i : 0
  42588. })
  42589. },
  42590. clearGroups: function() {
  42591. this.groups = []
  42592. },
  42593. setDrawRange: function(e, t) {
  42594. this.drawRange.start = e,
  42595. this.drawRange.count = t
  42596. },
  42597. applyMatrix: function(e) {
  42598. var t = this.attributes.position;
  42599. void 0 !== t && (e.applyToVector3Array(t.array),
  42600. t.needsUpdate = !0);
  42601. var i = this.attributes.normal;
  42602. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42603. i.needsUpdate = !0);
  42604. return null !== this.boundingBox && this.computeBoundingBox(),
  42605. null !== this.boundingSphere && this.computeBoundingSphere(),
  42606. this
  42607. },
  42608. rotateX: function(e) {
  42609. return void 0 === ht && (ht = new Ci.Matrix4),
  42610. ht.makeRotationX(e),
  42611. this.applyMatrix(ht),
  42612. this
  42613. },
  42614. rotateY: function(e) {
  42615. return void 0 === ct && (ct = new Ci.Matrix4),
  42616. ct.makeRotationY(e),
  42617. this.applyMatrix(ct),
  42618. this
  42619. },
  42620. rotateZ: function(e) {
  42621. return void 0 === lt && (lt = new Ci.Matrix4),
  42622. lt.makeRotationZ(e),
  42623. this.applyMatrix(lt),
  42624. this
  42625. },
  42626. translate: function(e, t, i) {
  42627. return void 0 === st && (st = new Ci.Matrix4),
  42628. st.makeTranslation(e, t, i),
  42629. this.applyMatrix(st),
  42630. this
  42631. },
  42632. scale: function(e, t, i) {
  42633. return void 0 === at && (at = new Ci.Matrix4),
  42634. at.makeScale(e, t, i),
  42635. this.applyMatrix(at),
  42636. this
  42637. },
  42638. lookAt: function(e) {
  42639. void 0 === ot && (ot = new Ci.Object3D),
  42640. ot.lookAt(e),
  42641. ot.updateMatrix(),
  42642. this.applyMatrix(ot.matrix)
  42643. },
  42644. center: function() {
  42645. this.computeBoundingBox();
  42646. var e = this.boundingBox.center().negate();
  42647. return this.translate(e.x, e.y, e.z),
  42648. e
  42649. },
  42650. setFromObject: function(e) {
  42651. var t = e.geometry;
  42652. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42653. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42654. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42655. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42656. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42657. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42658. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42659. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42660. }
  42661. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42662. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42663. } else
  42664. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42665. return this
  42666. },
  42667. updateFromObject: function(e) {
  42668. var t, i = e.geometry;
  42669. if (e instanceof Ci.Mesh) {
  42670. var n = i.__directGeometry;
  42671. if (void 0 === n)
  42672. return this.fromGeometry(i);
  42673. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42674. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42675. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42676. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42677. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42678. i.verticesNeedUpdate = !1,
  42679. i.normalsNeedUpdate = !1,
  42680. i.colorsNeedUpdate = !1,
  42681. i.uvsNeedUpdate = !1,
  42682. i.groupsNeedUpdate = !1,
  42683. i = n
  42684. }
  42685. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42686. t.needsUpdate = !0),
  42687. i.verticesNeedUpdate = !1);
  42688. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42689. t.needsUpdate = !0),
  42690. i.normalsNeedUpdate = !1);
  42691. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42692. t.needsUpdate = !0),
  42693. i.colorsNeedUpdate = !1);
  42694. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42695. t.needsUpdate = !0),
  42696. i.uvsNeedUpdate = !1);
  42697. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42698. t.needsUpdate = !0),
  42699. i.lineDistancesNeedUpdate = !1);
  42700. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42701. this.groups = i.groups,
  42702. i.groupsNeedUpdate = !1),
  42703. this
  42704. },
  42705. fromGeometry: function(e) {
  42706. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42707. this.fromDirectGeometry(e.__directGeometry)
  42708. },
  42709. fromDirectGeometry: function(e) {
  42710. var t = new Float32Array(3 * e.vertices.length);
  42711. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42712. 0 < e.normals.length) {
  42713. var i = new Float32Array(3 * e.normals.length);
  42714. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42715. }
  42716. if (0 < e.colors.length) {
  42717. var n = new Float32Array(3 * e.colors.length);
  42718. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42719. }
  42720. if (0 < e.uvs.length) {
  42721. var r = new Float32Array(2 * e.uvs.length);
  42722. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42723. }
  42724. if (0 < e.uvs2.length) {
  42725. var o = new Float32Array(2 * e.uvs2.length);
  42726. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42727. }
  42728. if (0 < e.indices.length) {
  42729. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42730. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42731. }
  42732. for (var s in this.groups = e.groups,
  42733. e.morphTargets) {
  42734. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42735. var d = c[h]
  42736. , p = new Ci.Float32Attribute(3 * d.length,3);
  42737. l.push(p.copyVector3sArray(d))
  42738. }
  42739. this.morphAttributes[s] = l
  42740. }
  42741. if (0 < e.skinIndices.length) {
  42742. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42743. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42744. }
  42745. if (0 < e.skinWeights.length) {
  42746. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42747. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42748. }
  42749. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42750. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42751. this
  42752. },
  42753. computeBoundingBox: (new Ci.Vector3,
  42754. function() {
  42755. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42756. var e = this.attributes.position.array;
  42757. e && this.boundingBox.setFromArray(e),
  42758. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42759. this.boundingBox.max.set(0, 0, 0)),
  42760. (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)
  42761. }
  42762. ),
  42763. computeBoundingSphere: (nt = new Ci.Box3,
  42764. rt = new Ci.Vector3,
  42765. function() {
  42766. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42767. var e = this.attributes.position.array;
  42768. if (e) {
  42769. var t = this.boundingSphere.center;
  42770. nt.setFromArray(e),
  42771. nt.center(t);
  42772. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42773. rt.fromArray(e, n),
  42774. i = Math.max(i, t.distanceToSquared(rt));
  42775. this.boundingSphere.radius = Math.sqrt(i),
  42776. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42777. }
  42778. }
  42779. ),
  42780. computeFaceNormals: function() {},
  42781. computeVertexNormals: function() {
  42782. var e = this.index
  42783. , t = this.attributes
  42784. , i = this.groups;
  42785. if (t.position) {
  42786. var n = t.position.array;
  42787. if (void 0 === t.normal)
  42788. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42789. else
  42790. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42791. r[o] = 0;
  42792. 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;
  42793. if (e) {
  42794. var m = e.array;
  42795. 0 === i.length && this.addGroup(0, m.length);
  42796. for (var v = 0, y = i.length; v < y; ++v) {
  42797. var A = i[v]
  42798. , C = A.start;
  42799. for (o = C,
  42800. a = C + A.count; o < a; o += 3)
  42801. s = 3 * m[o + 0],
  42802. l = 3 * m[o + 1],
  42803. c = 3 * m[o + 2],
  42804. u.fromArray(n, s),
  42805. d.fromArray(n, l),
  42806. p.fromArray(n, c),
  42807. f.subVectors(p, d),
  42808. g.subVectors(u, d),
  42809. f.cross(g),
  42810. h[s] += f.x,
  42811. h[1 + s] += f.y,
  42812. h[2 + s] += f.z,
  42813. h[l] += f.x,
  42814. h[1 + l] += f.y,
  42815. h[2 + l] += f.z,
  42816. h[c] += f.x,
  42817. h[1 + c] += f.y,
  42818. h[2 + c] += f.z
  42819. }
  42820. } else
  42821. for (o = 0,
  42822. a = n.length; o < a; o += 9)
  42823. u.fromArray(n, o),
  42824. d.fromArray(n, o + 3),
  42825. p.fromArray(n, o + 6),
  42826. f.subVectors(p, d),
  42827. g.subVectors(u, d),
  42828. f.cross(g),
  42829. h[o] = f.x,
  42830. h[o + 1] = f.y,
  42831. h[o + 2] = f.z,
  42832. h[o + 3] = f.x,
  42833. h[o + 4] = f.y,
  42834. h[o + 5] = f.z,
  42835. h[o + 6] = f.x,
  42836. h[o + 7] = f.y,
  42837. h[o + 8] = f.z;
  42838. this.normalizeNormals(),
  42839. t.normal.needsUpdate = !0
  42840. }
  42841. },
  42842. merge: function(e, t) {
  42843. if (e instanceof Ci.BufferGeometry != 0) {
  42844. void 0 === t && (t = 0);
  42845. var i = this.attributes;
  42846. for (var n in i)
  42847. if (void 0 !== e.attributes[n])
  42848. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42849. l++)
  42850. r[l] = a[s];
  42851. return this
  42852. }
  42853. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42854. },
  42855. normalizeNormals: function() {
  42856. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42857. e = r[o],
  42858. t = r[o + 1],
  42859. i = r[o + 2],
  42860. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42861. r[o] *= n,
  42862. r[o + 1] *= n,
  42863. r[o + 2] *= n
  42864. },
  42865. toNonIndexed: function() {
  42866. if (null === this.index)
  42867. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42868. this;
  42869. var e = new Ci.BufferGeometry
  42870. , t = this.index.array
  42871. , i = this.attributes;
  42872. for (var n in i) {
  42873. 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++) {
  42874. l = t[h] * a;
  42875. for (var d = 0; d < a; d++)
  42876. s[c++] = o[l++]
  42877. }
  42878. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42879. }
  42880. return e
  42881. },
  42882. toJSON: function() {
  42883. var e = {
  42884. metadata: {
  42885. version: 4.4,
  42886. type: "BufferGeometry",
  42887. generator: "BufferGeometry.toJSON"
  42888. }
  42889. };
  42890. if (e.uuid = this.uuid,
  42891. e.type = this.type,
  42892. "" !== this.name && (e.name = this.name),
  42893. void 0 !== this.parameters) {
  42894. var t = this.parameters;
  42895. for (var i in t)
  42896. void 0 !== t[i] && (e[i] = t[i]);
  42897. return e
  42898. }
  42899. e.data = {
  42900. attributes: {}
  42901. };
  42902. var n = this.index;
  42903. if (null !== n) {
  42904. var r = Array.prototype.slice.call(n.array);
  42905. e.data.index = {
  42906. type: n.array.constructor.name,
  42907. array: r
  42908. }
  42909. }
  42910. var o = this.attributes;
  42911. for (var i in o) {
  42912. var a = o[i];
  42913. r = Array.prototype.slice.call(a.array);
  42914. e.data.attributes[i] = {
  42915. itemSize: a.itemSize,
  42916. type: a.array.constructor.name,
  42917. array: r
  42918. }
  42919. }
  42920. var s = this.groups;
  42921. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42922. var l = this.boundingSphere;
  42923. return null !== l && (e.data.boundingSphere = {
  42924. center: l.center.toArray(),
  42925. radius: l.radius
  42926. }),
  42927. e
  42928. },
  42929. clone: function() {
  42930. return (new Ci.BufferGeometry).copy(this)
  42931. },
  42932. copy: function(e) {
  42933. var t = e.index;
  42934. null !== t && this.setIndex(t.clone());
  42935. var i = e.attributes;
  42936. for (var n in i) {
  42937. var r = i[n];
  42938. this.addAttribute(n, r.clone())
  42939. }
  42940. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42941. var l = o[a];
  42942. this.addGroup(l.start, l.count)
  42943. }
  42944. return this
  42945. },
  42946. dispose: function() {
  42947. this.dispatchEvent({
  42948. type: "dispose"
  42949. })
  42950. }
  42951. },
  42952. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42953. Ci.BufferGeometry.MaxIndex = 65535,
  42954. Ci.InstancedBufferGeometry = function() {
  42955. Ci.BufferGeometry.call(this),
  42956. this.type = "InstancedBufferGeometry",
  42957. this.maxInstancedCount = void 0
  42958. }
  42959. ,
  42960. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42961. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42962. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42963. this.groups.push({
  42964. start: e,
  42965. count: t,
  42966. instances: i
  42967. })
  42968. }
  42969. ,
  42970. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42971. var t = e.index;
  42972. null !== t && this.setIndex(t.clone());
  42973. var i = e.attributes;
  42974. for (var n in i) {
  42975. var r = i[n];
  42976. this.addAttribute(n, r.clone())
  42977. }
  42978. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42979. var l = o[a];
  42980. this.addGroup(l.start, l.count, l.instances)
  42981. }
  42982. return this
  42983. }
  42984. ,
  42985. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42986. Ci.Uniform = function(e, t) {
  42987. this.type = e,
  42988. this.value = t,
  42989. this.dynamic = !1
  42990. }
  42991. ,
  42992. Ci.Uniform.prototype = {
  42993. constructor: Ci.Uniform,
  42994. onUpdate: function(e) {
  42995. return this.dynamic = !0,
  42996. this.onUpdateCallback = e,
  42997. this
  42998. }
  42999. },
  43000. Ci.AnimationClip = function(e, t, i) {
  43001. this.name = e || Ci.Math.generateUUID(),
  43002. this.tracks = i,
  43003. this.duration = void 0 !== t ? t : -1,
  43004. this.duration < 0 && this.resetDuration(),
  43005. this.trim(),
  43006. this.optimize()
  43007. }
  43008. ,
  43009. Ci.AnimationClip.prototype = {
  43010. constructor: Ci.AnimationClip,
  43011. resetDuration: function() {
  43012. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  43013. var n = this.tracks[t];
  43014. e = Math.max(e, n.times[n.times.length - 1])
  43015. }
  43016. this.duration = e
  43017. },
  43018. trim: function() {
  43019. for (var e = 0; e < this.tracks.length; e++)
  43020. this.tracks[e].trim(0, this.duration);
  43021. return this
  43022. },
  43023. optimize: function() {
  43024. for (var e = 0; e < this.tracks.length; e++)
  43025. this.tracks[e].optimize();
  43026. return this
  43027. }
  43028. },
  43029. Object.assign(Ci.AnimationClip, {
  43030. parse: function(e) {
  43031. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  43032. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  43033. return new Ci.AnimationClip(e.name,e.duration,t)
  43034. },
  43035. toJSON: function(e) {
  43036. for (var t = [], i = e.tracks, n = {
  43037. name: e.name,
  43038. duration: e.duration,
  43039. tracks: t
  43040. }, r = 0, o = i.length; r !== o; ++r)
  43041. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  43042. return n
  43043. },
  43044. CreateFromMorphTargetSequence: function(e, t, i) {
  43045. for (var n = t.length, r = [], o = 0; o < n; o++) {
  43046. var a = []
  43047. , s = [];
  43048. a.push((o + n - 1) % n, o, (o + 1) % n),
  43049. s.push(0, 1, 0);
  43050. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43051. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43052. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43053. 0 === a[0] && (a.push(n),
  43054. s.push(s[0])),
  43055. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43056. }
  43057. return new Ci.AnimationClip(e,-1,r)
  43058. },
  43059. findByName: function(e, t) {
  43060. for (var i = 0; i < e.length; i++)
  43061. if (e[i].name === t)
  43062. return e[i];
  43063. return null
  43064. },
  43065. CreateClipsFromMorphTargetSequences: function(e, t) {
  43066. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43067. var a = e[r]
  43068. , s = a.name.match(n);
  43069. if (s && 1 < s.length) {
  43070. var l = i[h = s[1]];
  43071. l || (i[h] = l = []),
  43072. l.push(a)
  43073. }
  43074. }
  43075. var c = [];
  43076. for (var h in i)
  43077. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43078. return c
  43079. },
  43080. parseAnimation: function(e, t, i) {
  43081. if (!e)
  43082. return console.error(" no animation in JSONLoader data"),
  43083. null;
  43084. function n(e, t, i, n, r) {
  43085. if (0 !== i.length) {
  43086. var o = []
  43087. , a = [];
  43088. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43089. 0 !== o.length && r.push(new e(t,o,a))
  43090. }
  43091. }
  43092. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43093. var h = l[c].keys;
  43094. if (h && 0 != h.length)
  43095. if (h[0].morphTargets) {
  43096. for (var u = {}, d = 0; d < h.length; d++)
  43097. if (h[d].morphTargets)
  43098. for (var p = 0; p < h[d].morphTargets.length; p++)
  43099. u[h[d].morphTargets[p]] = -1;
  43100. for (var f in u) {
  43101. var g = []
  43102. , m = [];
  43103. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43104. var v = h[d];
  43105. g.push(v.time),
  43106. m.push(v.morphTarget === f ? 1 : 0)
  43107. }
  43108. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43109. }
  43110. a = u.length * (s || 1)
  43111. } else {
  43112. var y = ".bones[" + t[c].name + "]";
  43113. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43114. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43115. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43116. }
  43117. }
  43118. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43119. }
  43120. }),
  43121. Ci.AnimationMixer = function(e) {
  43122. this._root = e,
  43123. this._initMemoryManager(),
  43124. this._accuIndex = 0,
  43125. this.time = 0,
  43126. this.timeScale = 1
  43127. }
  43128. ,
  43129. Ci.AnimationMixer.prototype = {
  43130. constructor: Ci.AnimationMixer,
  43131. clipAction: function(e, t) {
  43132. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43133. if (void 0 !== a) {
  43134. var s = a.actionByRoot[n];
  43135. if (void 0 !== s)
  43136. return s;
  43137. if (o = (i = a.knownActions[0])._clip,
  43138. e !== r && e !== o)
  43139. throw new Error("Different clips with the same name detected!")
  43140. }
  43141. if (null === o)
  43142. return null;
  43143. var l = new Ci.AnimationMixer._Action(this,o,t);
  43144. return this._bindAction(l, i),
  43145. this._addInactiveAction(l, r, n),
  43146. l
  43147. },
  43148. existingAction: function(e, t) {
  43149. var i = (t || this._root).uuid
  43150. , n = "string" == typeof e ? e : e.name
  43151. , r = this._actionsByClip[n];
  43152. return void 0 !== r && r.actionByRoot[i] || null
  43153. },
  43154. stopAllAction: function() {
  43155. var e = this._actions
  43156. , t = this._nActiveActions
  43157. , i = this._bindings
  43158. , n = this._nActiveBindings;
  43159. this._nActiveActions = 0;
  43160. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43161. e[r].reset();
  43162. for (r = 0; r !== n; ++r)
  43163. i[r].useCount = 0;
  43164. return this
  43165. },
  43166. update: function(e) {
  43167. e *= this.timeScale;
  43168. 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) {
  43169. var s = t[a];
  43170. s.enabled && s._update(n, e, r, o)
  43171. }
  43172. var l = this._bindings
  43173. , c = this._nActiveBindings;
  43174. for (a = 0; a !== c; ++a)
  43175. l[a].apply(o);
  43176. return this
  43177. },
  43178. getRoot: function() {
  43179. return this._root
  43180. },
  43181. uncacheClip: function(e) {
  43182. var t = this._actions
  43183. , i = e.name
  43184. , n = this._actionsByClip
  43185. , r = n[i];
  43186. if (void 0 !== r) {
  43187. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43188. var l = o[a];
  43189. this._deactivateAction(l);
  43190. var c = l._cacheIndex
  43191. , h = t[t.length - 1];
  43192. l._cacheIndex = null,
  43193. l._byClipCacheIndex = null,
  43194. t[h._cacheIndex = c] = h,
  43195. t.pop(),
  43196. this._removeInactiveBindingsForAction(l)
  43197. }
  43198. delete n[i]
  43199. }
  43200. },
  43201. uncacheRoot: function(e) {
  43202. var t = e.uuid
  43203. , i = this._actionsByClip;
  43204. for (var n in i) {
  43205. var r = i[n].actionByRoot[t];
  43206. void 0 !== r && (this._deactivateAction(r),
  43207. this._removeInactiveAction(r))
  43208. }
  43209. var o = this._bindingsByRootAndName[t];
  43210. if (void 0 !== o)
  43211. for (var a in o) {
  43212. var s = o[a];
  43213. s.restoreOriginalState(),
  43214. this._removeInactiveBinding(s)
  43215. }
  43216. },
  43217. uncacheAction: function(e, t) {
  43218. var i = this.existingAction(e, t);
  43219. null !== i && (this._deactivateAction(i),
  43220. this._removeInactiveAction(i))
  43221. }
  43222. },
  43223. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43224. Ci.AnimationMixer._Action = function(e, t, i) {
  43225. this._mixer = e,
  43226. this._clip = t,
  43227. this._localRoot = i || null;
  43228. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43229. endingStart: Ci.ZeroCurvatureEnding,
  43230. endingEnd: Ci.ZeroCurvatureEnding
  43231. }, s = 0; s !== r; ++s) {
  43232. var l = n[s].createInterpolant(null);
  43233. (o[s] = l).settings = a
  43234. }
  43235. this._interpolantSettings = a,
  43236. this._interpolants = o,
  43237. this._propertyBindings = new Array(r),
  43238. this._cacheIndex = null,
  43239. this._byClipCacheIndex = null,
  43240. this._timeScaleInterpolant = null,
  43241. this._weightInterpolant = null,
  43242. this.loop = Ci.LoopRepeat,
  43243. this._loopCount = -1,
  43244. this._startTime = null,
  43245. this.time = 0,
  43246. this.timeScale = 1,
  43247. this._effectiveTimeScale = 1,
  43248. this.weight = 1,
  43249. this._effectiveWeight = 1,
  43250. this.repetitions = 1 / 0,
  43251. this.paused = !1,
  43252. this.enabled = !0,
  43253. this.clampWhenFinished = !1,
  43254. this.zeroSlopeAtStart = !0,
  43255. this.zeroSlopeAtEnd = !0
  43256. }
  43257. ,
  43258. Ci.AnimationMixer._Action.prototype = {
  43259. constructor: Ci.AnimationMixer._Action,
  43260. play: function() {
  43261. return this._mixer._activateAction(this),
  43262. this
  43263. },
  43264. stop: function() {
  43265. return this._mixer._deactivateAction(this),
  43266. this.reset()
  43267. },
  43268. reset: function() {
  43269. return this.paused = !1,
  43270. this.enabled = !0,
  43271. this.time = 0,
  43272. this._loopCount = -1,
  43273. this._startTime = null,
  43274. this.stopFading().stopWarping()
  43275. },
  43276. isRunning: function() {
  43277. return this._startTime,
  43278. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43279. },
  43280. isScheduled: function() {
  43281. return this._mixer._isActiveAction(this)
  43282. },
  43283. startAt: function(e) {
  43284. return this._startTime = e,
  43285. this
  43286. },
  43287. setLoop: function(e, t) {
  43288. return this.loop = e,
  43289. this.repetitions = t,
  43290. this
  43291. },
  43292. setEffectiveWeight: function(e) {
  43293. return this.weight = e,
  43294. this._effectiveWeight = this.enabled ? e : 0,
  43295. this.stopFading()
  43296. },
  43297. getEffectiveWeight: function() {
  43298. return this._effectiveWeight
  43299. },
  43300. fadeIn: function(e) {
  43301. return this._scheduleFading(e, 0, 1)
  43302. },
  43303. fadeOut: function(e) {
  43304. return this._scheduleFading(e, 1, 0)
  43305. },
  43306. crossFadeFrom: function(e, t, i) {
  43307. if (this._mixer,
  43308. e.fadeOut(t),
  43309. this.fadeIn(t),
  43310. i) {
  43311. var n = this._clip.duration
  43312. , r = e._clip.duration
  43313. , o = r / n
  43314. , a = n / r;
  43315. e.warp(1, o, t),
  43316. this.warp(a, 1, t)
  43317. }
  43318. return this
  43319. },
  43320. crossFadeTo: function(e, t, i) {
  43321. return e.crossFadeFrom(this, t, i)
  43322. },
  43323. stopFading: function() {
  43324. var e = this._weightInterpolant;
  43325. return null !== e && (this._weightInterpolant = null,
  43326. this._mixer._takeBackControlInterpolant(e)),
  43327. this
  43328. },
  43329. setEffectiveTimeScale: function(e) {
  43330. return this.timeScale = e,
  43331. this._effectiveTimeScale = this.paused ? 0 : e,
  43332. this.stopWarping()
  43333. },
  43334. getEffectiveTimeScale: function() {
  43335. return this._effectiveTimeScale
  43336. },
  43337. setDuration: function(e) {
  43338. return this.timeScale = this._clip.duration / e,
  43339. this.stopWarping()
  43340. },
  43341. syncWith: function(e) {
  43342. return this.time = e.time,
  43343. this.timeScale = e.timeScale,
  43344. this.stopWarping()
  43345. },
  43346. halt: function(e) {
  43347. return this.warp(this._currentTimeScale, 0, e)
  43348. },
  43349. warp: function(e, t, i) {
  43350. var n = this._mixer
  43351. , r = n.time
  43352. , o = this._timeScaleInterpolant
  43353. , a = this.timeScale;
  43354. null === o && (o = n._lendControlInterpolant(),
  43355. this._timeScaleInterpolant = o);
  43356. var s = o.parameterPositions
  43357. , l = o.sampleValues;
  43358. return s[0] = r,
  43359. s[1] = r + i,
  43360. l[0] = e / a,
  43361. l[1] = t / a,
  43362. this
  43363. },
  43364. stopWarping: function() {
  43365. var e = this._timeScaleInterpolant;
  43366. return null !== e && (this._timeScaleInterpolant = null,
  43367. this._mixer._takeBackControlInterpolant(e)),
  43368. this
  43369. },
  43370. getMixer: function() {
  43371. return this._mixer
  43372. },
  43373. getClip: function() {
  43374. return this._clip
  43375. },
  43376. getRoot: function() {
  43377. return this._localRoot || this._mixer._root
  43378. },
  43379. _update: function(e, t, i, n) {
  43380. var r = this._startTime;
  43381. if (null !== r) {
  43382. var o = (e - r) * i;
  43383. if (o < 0 || 0 === i)
  43384. return;
  43385. this._startTime = null,
  43386. t = i * o
  43387. }
  43388. t *= this._updateTimeScale(e);
  43389. var a = this._updateTime(t)
  43390. , s = this._updateWeight(e);
  43391. if (0 < s)
  43392. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43393. l[h].evaluate(a),
  43394. c[h].accumulate(n, s)
  43395. },
  43396. _updateWeight: function(e) {
  43397. var t = 0;
  43398. if (this.enabled) {
  43399. t = this.weight;
  43400. var i = this._weightInterpolant;
  43401. if (null !== i) {
  43402. var n = i.evaluate(e)[0];
  43403. t *= n,
  43404. e > i.parameterPositions[1] && (this.stopFading(),
  43405. 0 === n && (this.enabled = !1))
  43406. }
  43407. }
  43408. return this._effectiveWeight = t
  43409. },
  43410. _updateTimeScale: function(e) {
  43411. var t = 0;
  43412. if (!this.paused) {
  43413. t = this.timeScale;
  43414. var i = this._timeScaleInterpolant;
  43415. if (null !== i)
  43416. t *= i.evaluate(e)[0],
  43417. e > i.parameterPositions[1] && (this.stopWarping(),
  43418. 0 === t ? this.pause = !0 : this.timeScale = t)
  43419. }
  43420. return this._effectiveTimeScale = t
  43421. },
  43422. _updateTime: function(e) {
  43423. var t = this.time + e;
  43424. if (0 === e)
  43425. return t;
  43426. var i = this._clip.duration
  43427. , n = this.loop
  43428. , r = this._loopCount
  43429. , o = !1;
  43430. switch (n) {
  43431. case Ci.LoopOnce:
  43432. if (-1 === r && (this.loopCount = 0,
  43433. this._setEndings(!0, !0, !1)),
  43434. i <= t)
  43435. t = i;
  43436. else {
  43437. if (!(t < 0))
  43438. break;
  43439. t = 0
  43440. }
  43441. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43442. this._mixer.dispatchEvent({
  43443. type: "finished",
  43444. action: this,
  43445. direction: e < 0 ? -1 : 1
  43446. });
  43447. break;
  43448. case Ci.LoopPingPong:
  43449. o = !0;
  43450. case Ci.LoopRepeat:
  43451. if (-1 === r && (0 < e ? (r = 0,
  43452. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43453. i <= t || t < 0) {
  43454. var a = Math.floor(t / i);
  43455. t -= i * a,
  43456. r += Math.abs(a);
  43457. var s = this.repetitions - r;
  43458. if (s < 0) {
  43459. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43460. t = 0 < e ? i : 0,
  43461. this._mixer.dispatchEvent({
  43462. type: "finished",
  43463. action: this,
  43464. direction: 0 < e ? 1 : -1
  43465. });
  43466. break
  43467. }
  43468. if (0 == s) {
  43469. var l = e < 0;
  43470. this._setEndings(l, !l, o)
  43471. } else
  43472. this._setEndings(!1, !1, o);
  43473. this._loopCount = r,
  43474. this._mixer.dispatchEvent({
  43475. type: "loop",
  43476. action: this,
  43477. loopDelta: a
  43478. })
  43479. }
  43480. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43481. return i - (this.time = t)
  43482. }
  43483. return this.time = t
  43484. },
  43485. _setEndings: function(e, t, i) {
  43486. var n = this._interpolantSettings;
  43487. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43488. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43489. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43490. },
  43491. _scheduleFading: function(e, t, i) {
  43492. var n = this._mixer
  43493. , r = n.time
  43494. , o = this._weightInterpolant;
  43495. null === o && (o = n._lendControlInterpolant(),
  43496. this._weightInterpolant = o);
  43497. var a = o.parameterPositions
  43498. , s = o.sampleValues;
  43499. return a[0] = r,
  43500. s[0] = t,
  43501. a[1] = r + e,
  43502. s[1] = i,
  43503. this
  43504. }
  43505. },
  43506. Object.assign(Ci.AnimationMixer.prototype, {
  43507. _bindAction: function(e, t) {
  43508. var i = e._localRoot || this._root
  43509. , n = e._clip.tracks
  43510. , r = n.length
  43511. , o = e._propertyBindings
  43512. , a = e._interpolants
  43513. , s = i.uuid
  43514. , l = this._bindingsByRootAndName
  43515. , c = l[s];
  43516. void 0 === c && (c = {},
  43517. l[s] = c);
  43518. for (var h = 0; h !== r; ++h) {
  43519. var u = n[h]
  43520. , d = u.name
  43521. , p = c[d];
  43522. if (void 0 !== p)
  43523. o[h] = p;
  43524. else {
  43525. if (void 0 !== (p = o[h])) {
  43526. null === p._cacheIndex && (++p.referenceCount,
  43527. this._addInactiveBinding(p, s, d));
  43528. continue
  43529. }
  43530. var f = t && t._propertyBindings[h].binding.parsedPath;
  43531. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43532. this._addInactiveBinding(p, s, d),
  43533. o[h] = p
  43534. }
  43535. a[h].resultBuffer = p.buffer
  43536. }
  43537. },
  43538. _activateAction: function(e) {
  43539. if (!this._isActiveAction(e)) {
  43540. if (null === e._cacheIndex) {
  43541. var t = (e._localRoot || this._root).uuid
  43542. , i = e._clip.name
  43543. , n = this._actionsByClip[i];
  43544. this._bindAction(e, n && n.knownActions[0]),
  43545. this._addInactiveAction(e, i, t)
  43546. }
  43547. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43548. var s = r[o];
  43549. 0 == s.useCount++ && (this._lendBinding(s),
  43550. s.saveOriginalState())
  43551. }
  43552. this._lendAction(e)
  43553. }
  43554. },
  43555. _deactivateAction: function(e) {
  43556. if (this._isActiveAction(e)) {
  43557. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43558. var r = t[i];
  43559. 0 == --r.useCount && (r.restoreOriginalState(),
  43560. this._takeBackBinding(r))
  43561. }
  43562. this._takeBackAction(e)
  43563. }
  43564. },
  43565. _initMemoryManager: function() {
  43566. this._actions = [],
  43567. this._nActiveActions = 0,
  43568. this._actionsByClip = {},
  43569. this._bindings = [],
  43570. this._nActiveBindings = 0,
  43571. this._bindingsByRootAndName = {},
  43572. this._controlInterpolants = [],
  43573. this._nActiveControlInterpolants = 0;
  43574. var e = this;
  43575. this.stats = {
  43576. actions: {
  43577. get total() {
  43578. return e._actions.length
  43579. },
  43580. get inUse() {
  43581. return e._nActiveActions
  43582. }
  43583. },
  43584. bindings: {
  43585. get total() {
  43586. return e._bindings.length
  43587. },
  43588. get inUse() {
  43589. return e._nActiveBindings
  43590. }
  43591. },
  43592. controlInterpolants: {
  43593. get total() {
  43594. return e._controlInterpolants.length
  43595. },
  43596. get inUse() {
  43597. return e._nActiveControlInterpolants
  43598. }
  43599. }
  43600. }
  43601. },
  43602. _isActiveAction: function(e) {
  43603. var t = e._cacheIndex;
  43604. return null !== t && t < this._nActiveActions
  43605. },
  43606. _addInactiveAction: function(e, t, i) {
  43607. var n = this._actions
  43608. , r = this._actionsByClip
  43609. , o = r[t];
  43610. if (void 0 === o)
  43611. o = {
  43612. knownActions: [e],
  43613. actionByRoot: {}
  43614. },
  43615. e._byClipCacheIndex = 0,
  43616. r[t] = o;
  43617. else {
  43618. var a = o.knownActions;
  43619. e._byClipCacheIndex = a.length,
  43620. a.push(e)
  43621. }
  43622. e._cacheIndex = n.length,
  43623. n.push(e),
  43624. o.actionByRoot[i] = e
  43625. },
  43626. _removeInactiveAction: function(e) {
  43627. var t = this._actions
  43628. , i = t[t.length - 1]
  43629. , n = e._cacheIndex;
  43630. t[i._cacheIndex = n] = i,
  43631. t.pop(),
  43632. e._cacheIndex = null;
  43633. var r = e._clip.name
  43634. , o = this._actionsByClip
  43635. , a = o[r]
  43636. , s = a.knownActions
  43637. , l = s[s.length - 1]
  43638. , c = e._byClipCacheIndex;
  43639. s[l._byClipCacheIndex = c] = l,
  43640. s.pop(),
  43641. e._byClipCacheIndex = null,
  43642. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43643. 0 === s.length && delete o[r],
  43644. this._removeInactiveBindingsForAction(e)
  43645. },
  43646. _removeInactiveBindingsForAction: function(e) {
  43647. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43648. var r = t[i];
  43649. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43650. }
  43651. },
  43652. _lendAction: function(e) {
  43653. var t = this._actions
  43654. , i = e._cacheIndex
  43655. , n = this._nActiveActions++
  43656. , r = t[n];
  43657. t[e._cacheIndex = n] = e,
  43658. t[r._cacheIndex = i] = r
  43659. },
  43660. _takeBackAction: function(e) {
  43661. var t = this._actions
  43662. , i = e._cacheIndex
  43663. , n = --this._nActiveActions
  43664. , r = t[n];
  43665. t[e._cacheIndex = n] = e,
  43666. t[r._cacheIndex = i] = r
  43667. },
  43668. _addInactiveBinding: function(e, t, i) {
  43669. var n = this._bindingsByRootAndName
  43670. , r = n[t]
  43671. , o = this._bindings;
  43672. void 0 === r && (r = {},
  43673. n[t] = r),
  43674. (r[i] = e)._cacheIndex = o.length,
  43675. o.push(e)
  43676. },
  43677. _removeInactiveBinding: function(e) {
  43678. var t = this._bindings
  43679. , i = e.binding
  43680. , n = i.rootNode.uuid
  43681. , r = i.path
  43682. , o = this._bindingsByRootAndName
  43683. , a = o[n]
  43684. , s = t[t.length - 1]
  43685. , l = e._cacheIndex;
  43686. t[s._cacheIndex = l] = s,
  43687. t.pop(),
  43688. delete a[r];
  43689. e: {
  43690. for (var c in a)
  43691. break e;
  43692. delete o[n]
  43693. }
  43694. },
  43695. _lendBinding: function(e) {
  43696. var t = this._bindings
  43697. , i = e._cacheIndex
  43698. , n = this._nActiveBindings++
  43699. , r = t[n];
  43700. t[e._cacheIndex = n] = e,
  43701. t[r._cacheIndex = i] = r
  43702. },
  43703. _takeBackBinding: function(e) {
  43704. var t = this._bindings
  43705. , i = e._cacheIndex
  43706. , n = --this._nActiveBindings
  43707. , r = t[n];
  43708. t[e._cacheIndex = n] = e,
  43709. t[r._cacheIndex = i] = r
  43710. },
  43711. _lendControlInterpolant: function() {
  43712. var e = this._controlInterpolants
  43713. , t = this._nActiveControlInterpolants++
  43714. , i = e[t];
  43715. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43716. i
  43717. },
  43718. _takeBackControlInterpolant: function(e) {
  43719. var t = this._controlInterpolants
  43720. , i = e.__cacheIndex
  43721. , n = --this._nActiveControlInterpolants
  43722. , r = t[n];
  43723. t[e.__cacheIndex = n] = e,
  43724. t[r.__cacheIndex = i] = r
  43725. },
  43726. _controlInterpolantsResultBuffer: new Float32Array(1)
  43727. }),
  43728. Ci.AnimationObjectGroup = function(e) {
  43729. this.uuid = Ci.Math.generateUUID(),
  43730. this._objects = Array.prototype.slice.call(arguments),
  43731. this.nCachedObjects_ = 0;
  43732. var t = {};
  43733. this._indicesByUUID = t;
  43734. for (var i = 0, n = arguments.length; i !== n; ++i)
  43735. t[arguments[i].uuid] = i;
  43736. this._paths = [],
  43737. this._parsedPaths = [],
  43738. this._bindings = [],
  43739. this._bindingsIndicesByPath = {};
  43740. var r = this;
  43741. this.stats = {
  43742. objects: {
  43743. get total() {
  43744. return r._objects.length
  43745. },
  43746. get inUse() {
  43747. return this.total - r.nCachedObjects_
  43748. }
  43749. },
  43750. get bindingsPerObject() {
  43751. return r._bindings.length
  43752. }
  43753. }
  43754. }
  43755. ,
  43756. Ci.AnimationObjectGroup.prototype = {
  43757. constructor: Ci.AnimationObjectGroup,
  43758. add: function(e) {
  43759. 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) {
  43760. var u = arguments[c]
  43761. , d = u.uuid
  43762. , p = r[d];
  43763. if (void 0 === p) {
  43764. p = i++,
  43765. r[d] = p,
  43766. t.push(u);
  43767. for (var f = 0, g = l; f !== g; ++f)
  43768. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43769. } else if (p < n) {
  43770. var m = t[p]
  43771. , v = --n
  43772. , y = t[v];
  43773. t[r[y.uuid] = p] = y,
  43774. t[r[d] = v] = u;
  43775. for (f = 0,
  43776. g = l; f !== g; ++f) {
  43777. var A = s[f]
  43778. , C = A[v]
  43779. , I = A[p];
  43780. A[p] = C,
  43781. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43782. A[v] = I
  43783. }
  43784. } else
  43785. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43786. }
  43787. this.nCachedObjects_ = n
  43788. },
  43789. remove: function(e) {
  43790. for (var t = this._objects, i = (t.length,
  43791. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43792. var l = arguments[a]
  43793. , c = l.uuid
  43794. , h = n[c];
  43795. if (void 0 !== h && i <= h) {
  43796. var u = i++
  43797. , d = t[u];
  43798. t[n[d.uuid] = h] = d,
  43799. t[n[c] = u] = l;
  43800. for (var p = 0, f = o; p !== f; ++p) {
  43801. var g = r[p]
  43802. , m = g[u]
  43803. , v = g[h];
  43804. g[h] = m,
  43805. g[u] = v
  43806. }
  43807. }
  43808. }
  43809. this.nCachedObjects_ = i
  43810. },
  43811. uncache: function(e) {
  43812. 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) {
  43813. var c = arguments[s].uuid
  43814. , h = r[c];
  43815. if (void 0 !== h)
  43816. if (delete r[c],
  43817. h < n) {
  43818. var u = --n
  43819. , d = t[u]
  43820. , p = t[y = --i];
  43821. t[r[d.uuid] = h] = d,
  43822. t[r[p.uuid] = u] = p,
  43823. t.pop();
  43824. for (var f = 0, g = a; f !== g; ++f) {
  43825. var m = (A = o[f])[u]
  43826. , v = A[y];
  43827. A[h] = m,
  43828. A[u] = v,
  43829. A.pop()
  43830. }
  43831. } else {
  43832. var y;
  43833. t[r[(p = t[y = --i]).uuid] = h] = p,
  43834. t.pop();
  43835. for (f = 0,
  43836. g = a; f !== g; ++f) {
  43837. var A;
  43838. (A = o[f])[h] = A[y],
  43839. A.pop()
  43840. }
  43841. }
  43842. }
  43843. this.nCachedObjects_ = n
  43844. },
  43845. subscribe_: function(e, t) {
  43846. var i = this._bindingsIndicesByPath
  43847. , n = i[e]
  43848. , r = this._bindings;
  43849. if (void 0 !== n)
  43850. return r[n];
  43851. var o = this._paths
  43852. , a = this._parsedPaths
  43853. , s = this._objects
  43854. , l = s.length
  43855. , c = this.nCachedObjects_
  43856. , h = new Array(l);
  43857. n = r.length,
  43858. i[e] = n,
  43859. o.push(e),
  43860. a.push(t),
  43861. r.push(h);
  43862. for (var u = c, d = s.length; u !== d; ++u) {
  43863. var p = s[u];
  43864. h[u] = new Ci.PropertyBinding(p,e,t)
  43865. }
  43866. return h
  43867. },
  43868. unsubscribe_: function(e) {
  43869. var t = this._bindingsIndicesByPath
  43870. , i = t[e];
  43871. if (void 0 !== i) {
  43872. var n = this._paths
  43873. , r = this._parsedPaths
  43874. , o = this._bindings
  43875. , a = o.length - 1
  43876. , s = o[a];
  43877. o[t[e[a]] = i] = s,
  43878. o.pop(),
  43879. r[i] = r[a],
  43880. r.pop(),
  43881. n[i] = n[a],
  43882. n.pop()
  43883. }
  43884. }
  43885. },
  43886. Ci.AnimationUtils = {
  43887. arraySlice: function(e, t, i) {
  43888. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43889. },
  43890. convertArray: function(e, t, i) {
  43891. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43892. },
  43893. isTypedArray: function(e) {
  43894. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43895. },
  43896. getKeyframeOrder: function(i) {
  43897. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43898. t[n] = n;
  43899. return t.sort(function(e, t) {
  43900. return i[e] - i[t]
  43901. }),
  43902. t
  43903. },
  43904. sortedArray: function(e, t, i) {
  43905. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43906. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43907. r[a++] = e[s + l];
  43908. return r
  43909. },
  43910. flattenJSON: function(e, t, i, n) {
  43911. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43912. o = e[r++];
  43913. if (void 0 !== o) {
  43914. var a = o[n];
  43915. if (void 0 !== a)
  43916. if (Array.isArray(a))
  43917. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43918. i.push.apply(i, a)),
  43919. void 0 !== (o = e[r++]); )
  43920. ;
  43921. else if (void 0 !== a.toArray)
  43922. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43923. a.toArray(i, i.length)),
  43924. void 0 !== (o = e[r++]); )
  43925. ;
  43926. else
  43927. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43928. i.push(a)),
  43929. void 0 !== (o = e[r++]); )
  43930. ;
  43931. }
  43932. }
  43933. },
  43934. Ci.KeyframeTrack = function(e, t, i, n) {
  43935. if (void 0 === e)
  43936. throw new Error("track name is undefined");
  43937. if (void 0 === t || 0 === t.length)
  43938. throw new Error("no keyframes in track named " + e);
  43939. this.name = e,
  43940. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43941. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43942. this.setInterpolation(n || this.DefaultInterpolation),
  43943. this.validate(),
  43944. this.optimize()
  43945. }
  43946. ,
  43947. Ci.KeyframeTrack.prototype = {
  43948. constructor: Ci.KeyframeTrack,
  43949. TimeBufferType: Float32Array,
  43950. ValueBufferType: Float32Array,
  43951. DefaultInterpolation: Ci.InterpolateLinear,
  43952. InterpolantFactoryMethodDiscrete: function(e) {
  43953. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43954. },
  43955. InterpolantFactoryMethodLinear: function(e) {
  43956. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43957. },
  43958. InterpolantFactoryMethodSmooth: function(e) {
  43959. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43960. },
  43961. setInterpolation: function(e) {
  43962. var t = void 0;
  43963. switch (e) {
  43964. case Ci.InterpolateDiscrete:
  43965. t = this.InterpolantFactoryMethodDiscrete;
  43966. break;
  43967. case Ci.InterpolateLinear:
  43968. t = this.InterpolantFactoryMethodLinear;
  43969. break;
  43970. case Ci.InterpolateSmooth:
  43971. t = this.InterpolantFactoryMethodSmooth
  43972. }
  43973. if (void 0 !== t)
  43974. this.createInterpolant = t;
  43975. else {
  43976. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43977. if (void 0 === this.createInterpolant) {
  43978. if (e === this.DefaultInterpolation)
  43979. throw new Error(i);
  43980. this.setInterpolation(this.DefaultInterpolation)
  43981. }
  43982. console.warn(i)
  43983. }
  43984. },
  43985. getInterpolation: function() {
  43986. switch (this.createInterpolant) {
  43987. case this.InterpolantFactoryMethodDiscrete:
  43988. return Ci.InterpolateDiscrete;
  43989. case this.InterpolantFactoryMethodLinear:
  43990. return Ci.InterpolateLinear;
  43991. case this.InterpolantFactoryMethodSmooth:
  43992. return Ci.InterpolateSmooth
  43993. }
  43994. },
  43995. getValueSize: function() {
  43996. return this.values.length / this.times.length
  43997. },
  43998. shift: function(e) {
  43999. if (0 !== e)
  44000. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44001. t[i] += e;
  44002. return this
  44003. },
  44004. scale: function(e) {
  44005. if (1 !== e)
  44006. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44007. t[i] *= e;
  44008. return this
  44009. },
  44010. trim: function(e, t) {
  44011. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  44012. ++r;
  44013. for (; -1 !== o && i[o] > t; )
  44014. --o;
  44015. if (++o,
  44016. 0 !== r || o !== n) {
  44017. o <= r && (r = (o = Math.max(o, 1)) - 1);
  44018. var a = this.getValueSize();
  44019. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  44020. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  44021. }
  44022. return this
  44023. },
  44024. validate: function() {
  44025. var e = !0
  44026. , t = this.getValueSize();
  44027. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  44028. e = !1);
  44029. var i = this.times
  44030. , n = this.values
  44031. , r = i.length;
  44032. 0 === r && (console.error("track is empty", this),
  44033. e = !1);
  44034. for (var o = null, a = 0; a !== r; a++) {
  44035. var s = i[a];
  44036. if ("number" == typeof s && isNaN(s)) {
  44037. console.error("time is not a valid number", this, a, s),
  44038. e = !1;
  44039. break
  44040. }
  44041. if (null !== o && s < o) {
  44042. console.error("out of order keys", this, a, s, o),
  44043. e = !1;
  44044. break
  44045. }
  44046. o = s
  44047. }
  44048. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44049. a = 0;
  44050. for (var l = n.length; a !== l; ++a) {
  44051. var c = n[a];
  44052. if (isNaN(c)) {
  44053. console.error("value is not a valid number", this, a, c),
  44054. e = !1;
  44055. break
  44056. }
  44057. }
  44058. }
  44059. return e
  44060. },
  44061. optimize: function() {
  44062. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44063. var a = !1
  44064. , s = e[r];
  44065. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44066. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44067. var d = t[l + u];
  44068. if (d !== t[c + u] || d !== t[h + u]) {
  44069. a = !0;
  44070. break
  44071. }
  44072. }
  44073. if (a) {
  44074. if (r !== n) {
  44075. e[n] = e[r];
  44076. var p = r * i
  44077. , f = n * i;
  44078. for (u = 0; u !== i; ++u)
  44079. t[f + u] = t[p + u]
  44080. }
  44081. ++n
  44082. }
  44083. }
  44084. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44085. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44086. this
  44087. }
  44088. },
  44089. Object.assign(Ci.KeyframeTrack, {
  44090. parse: function(e) {
  44091. if (void 0 === e.type)
  44092. throw new Error("track type undefined, can not parse");
  44093. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44094. if (void 0 === e.times) {
  44095. console.warn("legacy JSON format detected, converting");
  44096. var i = []
  44097. , n = [];
  44098. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44099. e.times = i,
  44100. e.values = n
  44101. }
  44102. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44103. },
  44104. toJSON: function(e) {
  44105. var t, i = e.constructor;
  44106. if (void 0 !== i.toJSON)
  44107. t = i.toJSON(e);
  44108. else {
  44109. t = {
  44110. name: e.name,
  44111. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44112. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44113. };
  44114. var n = e.getInterpolation();
  44115. n !== e.DefaultInterpolation && (t.interpolation = n)
  44116. }
  44117. return t.type = e.ValueTypeName,
  44118. t
  44119. },
  44120. _getTrackTypeForValueTypeName: function(e) {
  44121. switch (e.toLowerCase()) {
  44122. case "scalar":
  44123. case "double":
  44124. case "float":
  44125. case "number":
  44126. case "integer":
  44127. return Ci.NumberKeyframeTrack;
  44128. case "vector":
  44129. case "vector2":
  44130. case "vector3":
  44131. case "vector4":
  44132. return Ci.VectorKeyframeTrack;
  44133. case "color":
  44134. return Ci.ColorKeyframeTrack;
  44135. case "quaternion":
  44136. return Ci.QuaternionKeyframeTrack;
  44137. case "bool":
  44138. case "boolean":
  44139. return Ci.BooleanKeyframeTrack;
  44140. case "string":
  44141. return Ci.StringKeyframeTrack
  44142. }
  44143. throw new Error("Unsupported typeName: " + e)
  44144. }
  44145. }),
  44146. Ci.PropertyBinding = function(e, t, i) {
  44147. this.path = t,
  44148. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44149. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44150. this.rootNode = e
  44151. }
  44152. ,
  44153. Ci.PropertyBinding.prototype = {
  44154. constructor: Ci.PropertyBinding,
  44155. getValue: function(e, t) {
  44156. this.bind(),
  44157. this.getValue(e, t)
  44158. },
  44159. setValue: function(e, t) {
  44160. this.bind(),
  44161. this.setValue(e, t)
  44162. },
  44163. bind: function() {
  44164. var e = this.node
  44165. , t = this.parsedPath
  44166. , i = t.objectName
  44167. , n = t.propertyName
  44168. , r = t.propertyIndex;
  44169. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44170. this.node = e),
  44171. this.getValue = this._getValue_unavailable,
  44172. this.setValue = this._setValue_unavailable,
  44173. e) {
  44174. if (i) {
  44175. var o = t.objectIndex;
  44176. switch (i) {
  44177. case "materials":
  44178. if (!e.material)
  44179. return void console.error(" can not bind to material as node does not have a material", this);
  44180. if (!e.material.materials)
  44181. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44182. e = e.material.materials;
  44183. break;
  44184. case "bones":
  44185. if (!e.skeleton)
  44186. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44187. e = e.skeleton.bones;
  44188. for (var a = 0; a < e.length; a++)
  44189. if (e[a].name === o) {
  44190. o = a;
  44191. break
  44192. }
  44193. break;
  44194. default:
  44195. if (void 0 === e[i])
  44196. return void console.error(" can not bind to objectName of node, undefined", this);
  44197. e = e[i]
  44198. }
  44199. if (void 0 !== o) {
  44200. if (void 0 === e[o])
  44201. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44202. e = e[o]
  44203. }
  44204. }
  44205. var s = e[n];
  44206. if (s) {
  44207. var l = this.Versioning.None;
  44208. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44209. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44210. this.targetObject = e);
  44211. var c = this.BindingType.Direct;
  44212. if (void 0 !== r) {
  44213. if ("morphTargetInfluences" === n) {
  44214. if (!e.geometry)
  44215. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44216. if (!e.geometry.morphTargets)
  44217. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44218. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44219. if (e.geometry.morphTargets[a].name === r) {
  44220. r = a;
  44221. break
  44222. }
  44223. }
  44224. c = this.BindingType.ArrayElement,
  44225. this.resolvedProperty = s,
  44226. this.propertyIndex = r
  44227. } else
  44228. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44229. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44230. this.resolvedProperty = s) : this.propertyName = n;
  44231. this.getValue = this.GetterByBindingType[c],
  44232. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44233. } else {
  44234. var h = t.nodeName;
  44235. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44236. }
  44237. } else
  44238. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44239. },
  44240. unbind: function() {
  44241. this.node = null,
  44242. this.getValue = this._getValue_unbound,
  44243. this.setValue = this._setValue_unbound
  44244. }
  44245. },
  44246. Object.assign(Ci.PropertyBinding.prototype, {
  44247. _getValue_unavailable: function() {},
  44248. _setValue_unavailable: function() {},
  44249. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44250. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44251. BindingType: {
  44252. Direct: 0,
  44253. EntireArray: 1,
  44254. ArrayElement: 2,
  44255. HasFromToArray: 3
  44256. },
  44257. Versioning: {
  44258. None: 0,
  44259. NeedsUpdate: 1,
  44260. MatrixWorldNeedsUpdate: 2
  44261. },
  44262. GetterByBindingType: [function(e, t) {
  44263. e[t] = this.node[this.propertyName]
  44264. }
  44265. , function(e, t) {
  44266. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44267. e[t++] = i[n]
  44268. }
  44269. , function(e, t) {
  44270. e[t] = this.resolvedProperty[this.propertyIndex]
  44271. }
  44272. , function(e, t) {
  44273. this.resolvedProperty.toArray(e, t)
  44274. }
  44275. ],
  44276. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44277. this.node[this.propertyName] = e[t]
  44278. }
  44279. , function(e, t) {
  44280. this.node[this.propertyName] = e[t],
  44281. this.targetObject.needsUpdate = !0
  44282. }
  44283. , function(e, t) {
  44284. this.node[this.propertyName] = e[t],
  44285. this.targetObject.matrixWorldNeedsUpdate = !0
  44286. }
  44287. ], [function(e, t) {
  44288. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44289. i[n] = e[t++]
  44290. }
  44291. , function(e, t) {
  44292. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44293. i[n] = e[t++];
  44294. this.targetObject.needsUpdate = !0
  44295. }
  44296. , function(e, t) {
  44297. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44298. i[n] = e[t++];
  44299. this.targetObject.matrixWorldNeedsUpdate = !0
  44300. }
  44301. ], [function(e, t) {
  44302. this.resolvedProperty[this.propertyIndex] = e[t]
  44303. }
  44304. , function(e, t) {
  44305. this.resolvedProperty[this.propertyIndex] = e[t],
  44306. this.targetObject.needsUpdate = !0
  44307. }
  44308. , function(e, t) {
  44309. this.resolvedProperty[this.propertyIndex] = e[t],
  44310. this.targetObject.matrixWorldNeedsUpdate = !0
  44311. }
  44312. ], [function(e, t) {
  44313. this.resolvedProperty.fromArray(e, t)
  44314. }
  44315. , function(e, t) {
  44316. this.resolvedProperty.fromArray(e, t),
  44317. this.targetObject.needsUpdate = !0
  44318. }
  44319. , function(e, t) {
  44320. this.resolvedProperty.fromArray(e, t),
  44321. this.targetObject.matrixWorldNeedsUpdate = !0
  44322. }
  44323. ]]
  44324. }),
  44325. Ci.PropertyBinding.Composite = function(e, t, i) {
  44326. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44327. this._targetGroup = e,
  44328. this._bindings = e.subscribe_(t, n)
  44329. }
  44330. ,
  44331. Ci.PropertyBinding.Composite.prototype = {
  44332. constructor: Ci.PropertyBinding.Composite,
  44333. getValue: function(e, t) {
  44334. this.bind();
  44335. var i = this._targetGroup.nCachedObjects_
  44336. , n = this._bindings[i];
  44337. void 0 !== n && n.getValue(e, t)
  44338. },
  44339. setValue: function(e, t) {
  44340. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44341. i[n].setValue(e, t)
  44342. },
  44343. bind: function() {
  44344. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44345. e[t].bind()
  44346. },
  44347. unbind: function() {
  44348. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44349. e[t].unbind()
  44350. }
  44351. },
  44352. Ci.PropertyBinding.create = function(e, t, i) {
  44353. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44354. }
  44355. ,
  44356. Ci.PropertyBinding.parseTrackName = function(e) {
  44357. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44358. , i = t.exec(e);
  44359. if (!i)
  44360. throw new Error("cannot parse trackName at all: " + e);
  44361. i.index === t.lastIndex && t.lastIndex++;
  44362. var n = {
  44363. nodeName: i[3],
  44364. objectName: i[5],
  44365. objectIndex: i[7],
  44366. propertyName: i[9],
  44367. propertyIndex: i[11]
  44368. };
  44369. if (null === n.propertyName || 0 === n.propertyName.length)
  44370. throw new Error("can not parse propertyName from trackName: " + e);
  44371. return n
  44372. }
  44373. ,
  44374. Ci.PropertyBinding.findNode = function(e, r) {
  44375. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44376. return e;
  44377. if (e.skeleton) {
  44378. var t = function(e) {
  44379. for (var t = 0; t < e.bones.length; t++) {
  44380. var i = e.bones[t];
  44381. if (i.name === r)
  44382. return i
  44383. }
  44384. return null
  44385. }(e.skeleton);
  44386. if (t)
  44387. return t
  44388. }
  44389. if (e.children) {
  44390. var o = function(e) {
  44391. for (var t = 0; t < e.length; t++) {
  44392. var i = e[t];
  44393. if (i.name === r || i.uuid === r)
  44394. return i;
  44395. var n = o(i.children);
  44396. if (n)
  44397. return n
  44398. }
  44399. return null
  44400. }
  44401. , i = o(e.children);
  44402. if (i)
  44403. return i
  44404. }
  44405. return null
  44406. }
  44407. ,
  44408. Ci.PropertyMixer = function(e, t, i) {
  44409. this.binding = e,
  44410. this.valueSize = i;
  44411. var n, r = Float64Array;
  44412. switch (t) {
  44413. case "quaternion":
  44414. n = this._slerp;
  44415. break;
  44416. case "string":
  44417. case "bool":
  44418. r = Array,
  44419. n = this._select;
  44420. break;
  44421. default:
  44422. n = this._lerp
  44423. }
  44424. this.buffer = new r(4 * i),
  44425. this._mixBufferRegion = n,
  44426. this.cumulativeWeight = 0,
  44427. this.useCount = 0,
  44428. this.referenceCount = 0
  44429. }
  44430. ,
  44431. Ci.PropertyMixer.prototype = {
  44432. constructor: Ci.PropertyMixer,
  44433. accumulate: function(e, t) {
  44434. var i = this.buffer
  44435. , n = this.valueSize
  44436. , r = e * n + n
  44437. , o = this.cumulativeWeight;
  44438. if (0 === o) {
  44439. for (var a = 0; a !== n; ++a)
  44440. i[r + a] = i[a];
  44441. o = t
  44442. } else {
  44443. var s = t / (o += t);
  44444. this._mixBufferRegion(i, r, 0, s, n)
  44445. }
  44446. this.cumulativeWeight = o
  44447. },
  44448. apply: function(e) {
  44449. var t = this.valueSize
  44450. , i = this.buffer
  44451. , n = e * t + t
  44452. , r = this.cumulativeWeight
  44453. , o = this.binding;
  44454. if (this.cumulativeWeight = 0,
  44455. r < 1) {
  44456. var a = 3 * t;
  44457. this._mixBufferRegion(i, n, a, 1 - r, t)
  44458. }
  44459. for (var s = t, l = t + t; s !== l; ++s)
  44460. if (i[s] !== i[s + t]) {
  44461. o.setValue(i, n);
  44462. break
  44463. }
  44464. },
  44465. saveOriginalState: function() {
  44466. var e = this.binding
  44467. , t = this.buffer
  44468. , i = this.valueSize
  44469. , n = 3 * i;
  44470. e.getValue(t, n);
  44471. for (var r = i, o = n; r !== o; ++r)
  44472. t[r] = t[n + r % i];
  44473. this.cumulativeWeight = 0
  44474. },
  44475. restoreOriginalState: function() {
  44476. var e = 3 * this.valueSize;
  44477. this.binding.setValue(this.buffer, e)
  44478. },
  44479. _select: function(e, t, i, n, r) {
  44480. if (.5 <= n)
  44481. for (var o = 0; o !== r; ++o)
  44482. e[t + o] = e[i + o]
  44483. },
  44484. _slerp: function(e, t, i, n, r) {
  44485. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44486. },
  44487. _lerp: function(e, t, i, n, r) {
  44488. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44489. var s = t + a;
  44490. e[s] = e[s] * o + e[i + a] * n
  44491. }
  44492. }
  44493. },
  44494. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44495. Ci.KeyframeTrack.call(this, e, t, i)
  44496. }
  44497. ,
  44498. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44499. constructor: Ci.BooleanKeyframeTrack,
  44500. ValueTypeName: "bool",
  44501. ValueBufferType: Array,
  44502. DefaultInterpolation: Ci.IntepolateDiscrete,
  44503. InterpolantFactoryMethodLinear: void 0,
  44504. InterpolantFactoryMethodSmooth: void 0
  44505. }),
  44506. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44507. Ci.KeyframeTrack.call(this, e, t, i, n)
  44508. }
  44509. ,
  44510. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44511. constructor: Ci.NumberKeyframeTrack,
  44512. ValueTypeName: "number"
  44513. }),
  44514. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44515. Ci.KeyframeTrack.call(this, e, t, i, n)
  44516. }
  44517. ,
  44518. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44519. constructor: Ci.QuaternionKeyframeTrack,
  44520. ValueTypeName: "quaternion",
  44521. DefaultInterpolation: Ci.InterpolateLinear,
  44522. InterpolantFactoryMethodLinear: function(e) {
  44523. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44524. },
  44525. InterpolantFactoryMethodSmooth: void 0
  44526. }),
  44527. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44528. Ci.KeyframeTrack.call(this, e, t, i, n)
  44529. }
  44530. ,
  44531. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44532. constructor: Ci.StringKeyframeTrack,
  44533. ValueTypeName: "string",
  44534. ValueBufferType: Array,
  44535. DefaultInterpolation: Ci.IntepolateDiscrete,
  44536. InterpolantFactoryMethodLinear: void 0,
  44537. InterpolantFactoryMethodSmooth: void 0
  44538. }),
  44539. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44540. Ci.KeyframeTrack.call(this, e, t, i, n)
  44541. }
  44542. ,
  44543. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44544. constructor: Ci.VectorKeyframeTrack,
  44545. ValueTypeName: "vector"
  44546. }),
  44547. Ci.Audio = function(e) {
  44548. Ci.Object3D.call(this),
  44549. this.type = "Audio",
  44550. this.context = e.context,
  44551. this.source = this.context.createBufferSource(),
  44552. this.source.onended = this.onEnded.bind(this),
  44553. this.gain = this.context.createGain(),
  44554. this.gain.connect(e.getInput()),
  44555. this.autoplay = !1,
  44556. this.startTime = 0,
  44557. this.playbackRate = 1,
  44558. this.isPlaying = !1,
  44559. this.hasPlaybackControl = !0,
  44560. this.sourceType = "empty",
  44561. this.filter = null
  44562. }
  44563. ,
  44564. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44565. Ci.Audio.prototype.constructor = Ci.Audio,
  44566. Ci.Audio.prototype.getOutput = function() {
  44567. return this.gain
  44568. }
  44569. ,
  44570. Ci.Audio.prototype.load = function(e) {
  44571. var t = new Ci.AudioBuffer(this.context);
  44572. return t.load(e),
  44573. this.setBuffer(t),
  44574. this
  44575. }
  44576. ,
  44577. Ci.Audio.prototype.setNodeSource = function(e) {
  44578. return this.hasPlaybackControl = !1,
  44579. this.sourceType = "audioNode",
  44580. this.source = e,
  44581. this.connect(),
  44582. this
  44583. }
  44584. ,
  44585. Ci.Audio.prototype.setBuffer = function(e) {
  44586. var t = this;
  44587. return e.onReady(function(e) {
  44588. t.source.buffer = e,
  44589. t.sourceType = "buffer",
  44590. t.autoplay && t.play()
  44591. }),
  44592. this
  44593. }
  44594. ,
  44595. Ci.Audio.prototype.play = function() {
  44596. if (!0 !== this.isPlaying)
  44597. if (!1 !== this.hasPlaybackControl) {
  44598. var e = this.context.createBufferSource();
  44599. e.buffer = this.source.buffer,
  44600. e.loop = this.source.loop,
  44601. e.onended = this.source.onended,
  44602. e.start(0, this.startTime),
  44603. e.playbackRate.value = this.playbackRate,
  44604. this.isPlaying = !0,
  44605. this.source = e,
  44606. this.connect()
  44607. } else
  44608. console.warn("THREE.Audio: this Audio has no playback control.");
  44609. else
  44610. console.warn("THREE.Audio: Audio is already playing.")
  44611. }
  44612. ,
  44613. Ci.Audio.prototype.pause = function() {
  44614. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44615. void (this.startTime = this.context.currentTime))
  44616. }
  44617. ,
  44618. Ci.Audio.prototype.stop = function() {
  44619. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44620. void (this.startTime = 0))
  44621. }
  44622. ,
  44623. Ci.Audio.prototype.connect = function() {
  44624. null !== this.filter ? (this.source.connect(this.filter),
  44625. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44626. }
  44627. ,
  44628. Ci.Audio.prototype.disconnect = function() {
  44629. null !== this.filter ? (this.source.disconnect(this.filter),
  44630. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44631. }
  44632. ,
  44633. Ci.Audio.prototype.getFilter = function() {
  44634. return this.filter
  44635. }
  44636. ,
  44637. Ci.Audio.prototype.setFilter = function(e) {
  44638. void 0 === e && (e = null),
  44639. !0 === this.isPlaying ? (this.disconnect(),
  44640. this.filter = e,
  44641. this.connect()) : this.filter = e
  44642. }
  44643. ,
  44644. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44645. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44646. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44647. }
  44648. ,
  44649. Ci.Audio.prototype.getPlaybackRate = function() {
  44650. return this.playbackRate
  44651. }
  44652. ,
  44653. Ci.Audio.prototype.onEnded = function() {
  44654. this.isPlaying = !1
  44655. }
  44656. ,
  44657. Ci.Audio.prototype.setLoop = function(e) {
  44658. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44659. }
  44660. ,
  44661. Ci.Audio.prototype.getLoop = function() {
  44662. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44663. !1) : this.source.loop
  44664. }
  44665. ,
  44666. Ci.Audio.prototype.setVolume = function(e) {
  44667. this.gain.gain.value = e
  44668. }
  44669. ,
  44670. Ci.Audio.prototype.getVolume = function() {
  44671. return this.gain.gain.value
  44672. }
  44673. ,
  44674. Ci.AudioAnalyser = function(e, t) {
  44675. this.analyser = e.context.createAnalyser(),
  44676. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44677. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44678. e.getOutput().connect(this.analyser)
  44679. }
  44680. ,
  44681. Ci.AudioAnalyser.prototype = {
  44682. constructor: Ci.AudioAnalyser,
  44683. getData: function() {
  44684. return this.analyser.getByteFrequencyData(this.data),
  44685. this.data
  44686. }
  44687. },
  44688. Ci.AudioBuffer = function(e) {
  44689. this.context = e,
  44690. this.ready = !1,
  44691. this.readyCallbacks = []
  44692. }
  44693. ,
  44694. Ci.AudioBuffer.prototype.load = function(e) {
  44695. var i = this
  44696. , t = new XMLHttpRequest;
  44697. return t.open("GET", e, !0),
  44698. t.responseType = "arraybuffer",
  44699. t.onload = function(e) {
  44700. i.context.decodeAudioData(this.response, function(e) {
  44701. i.buffer = e,
  44702. i.ready = !0;
  44703. for (var t = 0; t < i.readyCallbacks.length; t++)
  44704. i.readyCallbacks[t](i.buffer);
  44705. i.readyCallbacks = []
  44706. })
  44707. }
  44708. ,
  44709. t.send(),
  44710. this
  44711. }
  44712. ,
  44713. Ci.AudioBuffer.prototype.onReady = function(e) {
  44714. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44715. }
  44716. ,
  44717. Ci.PositionalAudio = function(e) {
  44718. Ci.Audio.call(this, e),
  44719. this.panner = this.context.createPanner(),
  44720. this.panner.connect(this.gain)
  44721. }
  44722. ,
  44723. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44724. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44725. Ci.PositionalAudio.prototype.getOutput = function() {
  44726. return this.panner
  44727. }
  44728. ,
  44729. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44730. this.panner.refDistance = e
  44731. }
  44732. ,
  44733. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44734. return this.panner.refDistance
  44735. }
  44736. ,
  44737. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44738. this.panner.rolloffFactor = e
  44739. }
  44740. ,
  44741. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44742. return this.panner.rolloffFactor
  44743. }
  44744. ,
  44745. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44746. this.panner.distanceModel = e
  44747. }
  44748. ,
  44749. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44750. return this.panner.distanceModel
  44751. }
  44752. ,
  44753. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44754. this.panner.maxDistance = e
  44755. }
  44756. ,
  44757. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44758. return this.panner.maxDistance
  44759. }
  44760. ,
  44761. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44762. function(e) {
  44763. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44764. it.setFromMatrixPosition(this.matrixWorld),
  44765. this.panner.setPosition(it.x, it.y, it.z)
  44766. }
  44767. ),
  44768. Ci.AudioListener = function() {
  44769. Ci.Object3D.call(this),
  44770. this.type = "AudioListener",
  44771. this.context = new (window.AudioContext || window.webkitAudioContext),
  44772. this.gain = this.context.createGain(),
  44773. this.gain.connect(this.context.destination),
  44774. this.filter = null
  44775. }
  44776. ,
  44777. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44778. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44779. Ci.AudioListener.prototype.getInput = function() {
  44780. return this.gain
  44781. }
  44782. ,
  44783. Ci.AudioListener.prototype.removeFilter = function() {
  44784. null !== this.filter && (this.gain.disconnect(this.filter),
  44785. this.filter.disconnect(this.context.destination),
  44786. this.gain.connect(this.context.destination),
  44787. this.filter = null)
  44788. }
  44789. ,
  44790. Ci.AudioListener.prototype.setFilter = function(e) {
  44791. null !== this.filter ? (this.gain.disconnect(this.filter),
  44792. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44793. this.filter = e,
  44794. this.gain.connect(this.filter),
  44795. this.filter.connect(this.context.destination)
  44796. }
  44797. ,
  44798. Ci.AudioListener.prototype.getFilter = function() {
  44799. return this.filter
  44800. }
  44801. ,
  44802. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44803. this.gain.gain.value = e
  44804. }
  44805. ,
  44806. Ci.AudioListener.prototype.getMasterVolume = function() {
  44807. return this.gain.gain.value
  44808. }
  44809. ,
  44810. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44811. $e = new Ci.Quaternion,
  44812. et = new Ci.Vector3,
  44813. tt = new Ci.Vector3,
  44814. function(e) {
  44815. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44816. var t = this.context.listener
  44817. , i = this.up;
  44818. this.matrixWorld.decompose(Je, $e, et),
  44819. tt.set(0, 0, -1).applyQuaternion($e),
  44820. t.setPosition(Je.x, Je.y, Je.z),
  44821. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44822. }
  44823. ),
  44824. Ci.Camera = function() {
  44825. Ci.Object3D.call(this),
  44826. this.type = "Camera",
  44827. this.matrixWorldInverse = new Ci.Matrix4,
  44828. this.projectionMatrix = new Ci.Matrix4
  44829. }
  44830. ,
  44831. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44832. Ci.Camera.prototype.constructor = Ci.Camera,
  44833. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44834. function(e) {
  44835. var t = e || new Ci.Vector3;
  44836. return this.getWorldQuaternion(Qe),
  44837. t.set(0, 0, -1).applyQuaternion(Qe)
  44838. }
  44839. ),
  44840. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44841. function(e) {
  44842. Ke.lookAt(this.position, e, this.up),
  44843. this.quaternion.setFromRotationMatrix(Ke)
  44844. }
  44845. ),
  44846. Ci.Camera.prototype.clone = function() {
  44847. return (new this.constructor).copy(this)
  44848. }
  44849. ,
  44850. Ci.Camera.prototype.copy = function(e) {
  44851. return Ci.Object3D.prototype.copy.call(this, e),
  44852. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44853. this.projectionMatrix.copy(e.projectionMatrix),
  44854. this
  44855. }
  44856. ,
  44857. Ci.CubeCamera = function(e, t, i) {
  44858. Ci.Object3D.call(this),
  44859. this.type = "CubeCamera";
  44860. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44861. r.up.set(0, -1, 0),
  44862. r.lookAt(new Ci.Vector3(1,0,0)),
  44863. this.add(r);
  44864. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44865. o.up.set(0, -1, 0),
  44866. o.lookAt(new Ci.Vector3(-1,0,0)),
  44867. this.add(o);
  44868. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44869. a.up.set(0, 0, 1),
  44870. a.lookAt(new Ci.Vector3(0,1,0)),
  44871. this.add(a);
  44872. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44873. s.up.set(0, 0, -1),
  44874. s.lookAt(new Ci.Vector3(0,-1,0)),
  44875. this.add(s);
  44876. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44877. l.up.set(0, -1, 0),
  44878. l.lookAt(new Ci.Vector3(0,0,1)),
  44879. this.add(l);
  44880. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44881. c.up.set(0, -1, 0),
  44882. c.lookAt(new Ci.Vector3(0,0,-1)),
  44883. this.add(c);
  44884. var n = {
  44885. format: Ci.RGBFormat,
  44886. magFilter: Ci.LinearFilter,
  44887. minFilter: Ci.LinearFilter
  44888. };
  44889. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44890. this.updateCubeMap = function(e, t) {
  44891. null === this.parent && this.updateMatrixWorld();
  44892. var i = this.renderTarget
  44893. , n = i.texture.generateMipmaps;
  44894. i.texture.generateMipmaps = !1,
  44895. i.activeCubeFace = 0,
  44896. e.render(t, r, i),
  44897. i.activeCubeFace = 1,
  44898. e.render(t, o, i),
  44899. i.activeCubeFace = 2,
  44900. e.render(t, a, i),
  44901. i.activeCubeFace = 3,
  44902. e.render(t, s, i),
  44903. i.activeCubeFace = 4,
  44904. e.render(t, l, i),
  44905. i.texture.generateMipmaps = n,
  44906. i.activeCubeFace = 5,
  44907. e.render(t, c, i),
  44908. e.setRenderTarget(null)
  44909. }
  44910. }
  44911. ,
  44912. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44913. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44914. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44915. Ci.Camera.call(this),
  44916. this.type = "OrthographicCamera",
  44917. this.zoom = 1,
  44918. this.left = e,
  44919. this.right = t,
  44920. this.top = i,
  44921. this.bottom = n,
  44922. this.near = void 0 !== r ? r : .1,
  44923. this.far = void 0 !== o ? o : 2e3,
  44924. this.updateProjectionMatrix()
  44925. }
  44926. ,
  44927. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44928. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44929. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44930. var e = (this.right - this.left) / (2 * this.zoom)
  44931. , t = (this.top - this.bottom) / (2 * this.zoom)
  44932. , i = (this.right + this.left) / 2
  44933. , n = (this.top + this.bottom) / 2;
  44934. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44935. }
  44936. ,
  44937. Ci.OrthographicCamera.prototype.copy = function(e) {
  44938. return Ci.Camera.prototype.copy.call(this, e),
  44939. this.left = e.left,
  44940. this.right = e.right,
  44941. this.top = e.top,
  44942. this.bottom = e.bottom,
  44943. this.near = e.near,
  44944. this.far = e.far,
  44945. this.zoom = e.zoom,
  44946. this
  44947. }
  44948. ,
  44949. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44950. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44951. return t.object.zoom = this.zoom,
  44952. t.object.left = this.left,
  44953. t.object.right = this.right,
  44954. t.object.top = this.top,
  44955. t.object.bottom = this.bottom,
  44956. t.object.near = this.near,
  44957. t.object.far = this.far,
  44958. t
  44959. }
  44960. ,
  44961. Ci.PerspectiveCamera = function(e, t, i, n) {
  44962. Ci.Camera.call(this),
  44963. this.type = "PerspectiveCamera",
  44964. this.focalLength = 10,
  44965. this.zoom = 1,
  44966. this.fov = void 0 !== e ? e : 50,
  44967. this.aspect = void 0 !== t ? t : 1,
  44968. this.near = void 0 !== i ? i : .1,
  44969. this.far = void 0 !== n ? n : 2e3,
  44970. this.updateProjectionMatrix()
  44971. }
  44972. ,
  44973. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44974. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44975. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44976. void 0 === t && (t = 24),
  44977. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44978. this.updateProjectionMatrix()
  44979. }
  44980. ,
  44981. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44982. this.fullWidth = e,
  44983. this.fullHeight = t,
  44984. this.x = i,
  44985. this.y = n,
  44986. this.width = r,
  44987. this.height = o,
  44988. this.updateProjectionMatrix()
  44989. }
  44990. ,
  44991. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44992. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44993. if (this.fullWidth) {
  44994. var t = this.fullWidth / this.fullHeight
  44995. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44996. , n = -i
  44997. , r = t * n
  44998. , o = t * i
  44999. , a = Math.abs(o - r)
  45000. , s = Math.abs(i - n);
  45001. 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)
  45002. } else
  45003. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45004. }
  45005. ,
  45006. Ci.PerspectiveCamera.prototype.copy = function(e) {
  45007. return Ci.Camera.prototype.copy.call(this, e),
  45008. this.focalLength = e.focalLength,
  45009. this.zoom = e.zoom,
  45010. this.fov = e.fov,
  45011. this.aspect = e.aspect,
  45012. this.near = e.near,
  45013. this.far = e.far,
  45014. this
  45015. }
  45016. ,
  45017. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  45018. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45019. return t.object.focalLength = this.focalLength,
  45020. t.object.zoom = this.zoom,
  45021. t.object.fov = this.fov,
  45022. t.object.aspect = this.aspect,
  45023. t.object.near = this.near,
  45024. t.object.far = this.far,
  45025. t
  45026. }
  45027. ,
  45028. Ci.StereoCamera = function() {
  45029. this.type = "StereoCamera",
  45030. this.aspect = 1,
  45031. this.cameraL = new Ci.PerspectiveCamera,
  45032. this.cameraL.layers.enable(1),
  45033. this.cameraL.matrixAutoUpdate = !1,
  45034. this.cameraR = new Ci.PerspectiveCamera,
  45035. this.cameraR.layers.enable(2),
  45036. this.cameraR.matrixAutoUpdate = !1
  45037. }
  45038. ,
  45039. Ci.StereoCamera.prototype = {
  45040. constructor: Ci.StereoCamera,
  45041. update: (Xe = new Ci.Matrix4,
  45042. Ze = new Ci.Matrix4,
  45043. function(e) {
  45044. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  45045. Ge = e.focalLength,
  45046. We = e.fov,
  45047. je = e.aspect * this.aspect,
  45048. Ye = e.near,
  45049. qe = e.far;
  45050. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45051. Ze.elements[12] = -.032,
  45052. Xe.elements[12] = .032,
  45053. t = -o * je + r,
  45054. i = o * je + r,
  45055. n.elements[0] = 2 * Ye / (i - t),
  45056. n.elements[8] = (i + t) / (i - t),
  45057. this.cameraL.projectionMatrix.copy(n),
  45058. t = -o * je - r,
  45059. i = o * je - r,
  45060. n.elements[0] = 2 * Ye / (i - t),
  45061. n.elements[8] = (i + t) / (i - t),
  45062. this.cameraR.projectionMatrix.copy(n)
  45063. }
  45064. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45065. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45066. }
  45067. )
  45068. },
  45069. Ci.Light = function(e, t) {
  45070. Ci.Object3D.call(this),
  45071. this.type = "Light",
  45072. this.color = new Ci.Color(e),
  45073. this.intensity = void 0 !== t ? t : 1,
  45074. this.receiveShadow = void 0
  45075. }
  45076. ,
  45077. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45078. Ci.Light.prototype.constructor = Ci.Light,
  45079. Ci.Light.prototype.copy = function(e) {
  45080. return Ci.Object3D.prototype.copy.call(this, e),
  45081. this.color.copy(e.color),
  45082. this.intensity = e.intensity,
  45083. this
  45084. }
  45085. ,
  45086. Ci.Light.prototype.toJSON = function(e) {
  45087. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45088. return t.object.color = this.color.getHex(),
  45089. t.object.intensity = this.intensity,
  45090. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45091. void 0 !== this.distance && (t.object.distance = this.distance),
  45092. void 0 !== this.angle && (t.object.angle = this.angle),
  45093. void 0 !== this.decay && (t.object.decay = this.decay),
  45094. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45095. t
  45096. }
  45097. ,
  45098. Ci.LightShadow = function(e) {
  45099. this.camera = e,
  45100. this.bias = 0,
  45101. this.radius = 1,
  45102. this.mapSize = new Ci.Vector2(512,512),
  45103. this.map = null,
  45104. this.matrix = new Ci.Matrix4
  45105. }
  45106. ,
  45107. Ci.LightShadow.prototype = {
  45108. constructor: Ci.LightShadow,
  45109. copy: function(e) {
  45110. return this.camera = e.camera.clone(),
  45111. this.bias = e.bias,
  45112. this.radius = e.radius,
  45113. this.mapSize.copy(e.mapSize),
  45114. this
  45115. },
  45116. clone: function() {
  45117. return (new this.constructor).copy(this)
  45118. }
  45119. },
  45120. Ci.AmbientLight = function(e, t) {
  45121. Ci.Light.call(this, e, t),
  45122. this.type = "AmbientLight",
  45123. this.castShadow = void 0
  45124. }
  45125. ,
  45126. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45127. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45128. Ci.DirectionalLight = function(e, t) {
  45129. Ci.Light.call(this, e, t),
  45130. this.type = "DirectionalLight",
  45131. this.position.set(0, 1, 0),
  45132. this.updateMatrix(),
  45133. this.target = new Ci.Object3D,
  45134. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45135. }
  45136. ,
  45137. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45138. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45139. Ci.DirectionalLight.prototype.copy = function(e) {
  45140. return Ci.Light.prototype.copy.call(this, e),
  45141. this.target = e.target.clone(),
  45142. this.shadow = e.shadow.clone(),
  45143. this
  45144. }
  45145. ,
  45146. Ci.HemisphereLight = function(e, t, i) {
  45147. Ci.Light.call(this, e, i),
  45148. this.type = "HemisphereLight",
  45149. this.castShadow = void 0,
  45150. this.position.set(0, 1, 0),
  45151. this.updateMatrix(),
  45152. this.groundColor = new Ci.Color(t)
  45153. }
  45154. ,
  45155. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45156. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45157. Ci.HemisphereLight.prototype.copy = function(e) {
  45158. return Ci.Light.prototype.copy.call(this, e),
  45159. this.groundColor.copy(e.groundColor),
  45160. this
  45161. }
  45162. ,
  45163. Ci.PointLight = function(e, t, i, n) {
  45164. Ci.Light.call(this, e, t),
  45165. this.type = "PointLight",
  45166. this.distance = void 0 !== i ? i : 0,
  45167. this.decay = void 0 !== n ? n : 1,
  45168. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45169. }
  45170. ,
  45171. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45172. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45173. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45174. get: function() {
  45175. return 4 * this.intensity * Math.PI
  45176. },
  45177. set: function(e) {
  45178. this.intensity = e / (4 * Math.PI)
  45179. }
  45180. }),
  45181. Ci.PointLight.prototype.copy = function(e) {
  45182. return Ci.Light.prototype.copy.call(this, e),
  45183. this.distance = e.distance,
  45184. this.decay = e.decay,
  45185. this.shadow = e.shadow.clone(),
  45186. this
  45187. }
  45188. ,
  45189. Ci.SpotLight = function(e, t, i, n, r, o) {
  45190. Ci.Light.call(this, e, t),
  45191. this.type = "SpotLight",
  45192. this.position.set(0, 1, 0),
  45193. this.updateMatrix(),
  45194. this.target = new Ci.Object3D,
  45195. this.distance = void 0 !== i ? i : 0,
  45196. this.angle = void 0 !== n ? n : Math.PI / 3,
  45197. this.penumbra = void 0 !== r ? r : 0,
  45198. this.decay = void 0 !== o ? o : 1,
  45199. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45200. }
  45201. ,
  45202. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45203. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45204. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45205. get: function() {
  45206. return this.intensity * Math.PI
  45207. },
  45208. set: function(e) {
  45209. this.intensity = e / Math.PI
  45210. }
  45211. }),
  45212. Ci.SpotLight.prototype.copy = function(e) {
  45213. return Ci.Light.prototype.copy.call(this, e),
  45214. this.distance = e.distance,
  45215. this.angle = e.angle,
  45216. this.penumbra = e.penumbra,
  45217. this.decay = e.decay,
  45218. this.target = e.target.clone(),
  45219. this.shadow = e.shadow.clone(),
  45220. this
  45221. }
  45222. ,
  45223. Ci.Cache = {
  45224. enabled: !1,
  45225. files: {},
  45226. add: function(e, t) {
  45227. !1 !== this.enabled && (this.files[e] = t)
  45228. },
  45229. get: function(e) {
  45230. if (!1 !== this.enabled)
  45231. return this.files[e]
  45232. },
  45233. remove: function(e) {
  45234. delete this.files[e]
  45235. },
  45236. clear: function() {
  45237. this.files = {}
  45238. }
  45239. },
  45240. Ci.Loader = function() {
  45241. this.onLoadStart = function() {}
  45242. ,
  45243. this.onLoadProgress = function() {}
  45244. ,
  45245. this.onLoadComplete = function() {}
  45246. }
  45247. ,
  45248. Ci.Loader.prototype = {
  45249. constructor: Ci.Loader,
  45250. crossOrigin: void 0,
  45251. extractUrlBase: function(e) {
  45252. var t = e.split("/");
  45253. return 1 === t.length ? "./" : (t.pop(),
  45254. t.join("/") + "/")
  45255. },
  45256. initMaterials: function(e, t, i) {
  45257. for (var n = [], r = 0; r < e.length; ++r)
  45258. n[r] = this.createMaterial(e[r], t, i);
  45259. return n
  45260. },
  45261. createMaterial: function(e, c, h) {
  45262. function t(e, t, i, n, r) {
  45263. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45264. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45265. He.load(a)),
  45266. void 0 !== t && (o.repeat.fromArray(t),
  45267. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45268. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45269. void 0 !== i && o.offset.fromArray(i),
  45270. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45271. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45272. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45273. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45274. void 0 !== r && (o.anisotropy = r);
  45275. var l = Ci.Math.generateUUID();
  45276. return u[l] = o,
  45277. l
  45278. }
  45279. void 0 === Ue && (Ue = new Ci.Color),
  45280. void 0 === He && (He = new Ci.TextureLoader),
  45281. void 0 === ze && (ze = new Ci.MaterialLoader);
  45282. var u = {}
  45283. , i = {
  45284. uuid: Ci.Math.generateUUID(),
  45285. type: "MeshLambertMaterial"
  45286. };
  45287. for (var n in e) {
  45288. var r = e[n];
  45289. switch (n) {
  45290. case "DbgColor":
  45291. case "DbgIndex":
  45292. case "opticalDensity":
  45293. case "illumination":
  45294. break;
  45295. case "DbgName":
  45296. i.name = r;
  45297. break;
  45298. case "blending":
  45299. i.blending = Ci[r];
  45300. break;
  45301. case "colorAmbient":
  45302. case "mapAmbient":
  45303. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45304. break;
  45305. case "colorDiffuse":
  45306. i.color = Ue.fromArray(r).getHex();
  45307. break;
  45308. case "colorSpecular":
  45309. i.specular = Ue.fromArray(r).getHex();
  45310. break;
  45311. case "colorEmissive":
  45312. i.emissive = Ue.fromArray(r).getHex();
  45313. break;
  45314. case "specularCoef":
  45315. i.shininess = r;
  45316. break;
  45317. case "shading":
  45318. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45319. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45320. break;
  45321. case "mapDiffuse":
  45322. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45323. break;
  45324. case "mapDiffuseRepeat":
  45325. case "mapDiffuseOffset":
  45326. case "mapDiffuseWrap":
  45327. case "mapDiffuseAnisotropy":
  45328. break;
  45329. case "mapLight":
  45330. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45331. break;
  45332. case "mapLightRepeat":
  45333. case "mapLightOffset":
  45334. case "mapLightWrap":
  45335. case "mapLightAnisotropy":
  45336. break;
  45337. case "mapAO":
  45338. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45339. break;
  45340. case "mapAORepeat":
  45341. case "mapAOOffset":
  45342. case "mapAOWrap":
  45343. case "mapAOAnisotropy":
  45344. break;
  45345. case "mapBump":
  45346. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45347. break;
  45348. case "mapBumpScale":
  45349. i.bumpScale = r;
  45350. break;
  45351. case "mapBumpRepeat":
  45352. case "mapBumpOffset":
  45353. case "mapBumpWrap":
  45354. case "mapBumpAnisotropy":
  45355. break;
  45356. case "mapNormal":
  45357. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45358. break;
  45359. case "mapNormalFactor":
  45360. i.normalScale = [r, r];
  45361. break;
  45362. case "mapNormalRepeat":
  45363. case "mapNormalOffset":
  45364. case "mapNormalWrap":
  45365. case "mapNormalAnisotropy":
  45366. break;
  45367. case "mapSpecular":
  45368. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45369. break;
  45370. case "mapSpecularRepeat":
  45371. case "mapSpecularOffset":
  45372. case "mapSpecularWrap":
  45373. case "mapSpecularAnisotropy":
  45374. break;
  45375. case "mapAlpha":
  45376. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45377. break;
  45378. case "mapAlphaRepeat":
  45379. case "mapAlphaOffset":
  45380. case "mapAlphaWrap":
  45381. case "mapAlphaAnisotropy":
  45382. break;
  45383. case "flipSided":
  45384. i.side = Ci.BackSide;
  45385. break;
  45386. case "doubleSided":
  45387. i.side = Ci.DoubleSide;
  45388. break;
  45389. case "transparency":
  45390. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45391. i.opacity = r;
  45392. break;
  45393. case "depthTest":
  45394. case "depthWrite":
  45395. case "colorWrite":
  45396. case "opacity":
  45397. case "reflectivity":
  45398. case "transparent":
  45399. case "visible":
  45400. case "wireframe":
  45401. i[n] = r;
  45402. break;
  45403. case "vertexColors":
  45404. !0 === r && (i.vertexColors = Ci.VertexColors),
  45405. "face" === r && (i.vertexColors = Ci.FaceColors);
  45406. break;
  45407. default:
  45408. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45409. }
  45410. }
  45411. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45412. "MeshPhongMaterial" !== i.type && delete i.specular,
  45413. i.opacity < 1 && (i.transparent = !0),
  45414. ze.setTextures(u),
  45415. ze.parse(i)
  45416. }
  45417. },
  45418. Ci.Loader.Handlers = {
  45419. handlers: [],
  45420. add: function(e, t) {
  45421. this.handlers.push(e, t)
  45422. },
  45423. get: function(e) {
  45424. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45425. var r = t[i]
  45426. , o = t[i + 1];
  45427. if (r.test(e))
  45428. return o
  45429. }
  45430. return null
  45431. }
  45432. },
  45433. Ci.XHRLoader = function(e) {
  45434. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45435. }
  45436. ,
  45437. Ci.XHRLoader.prototype = {
  45438. constructor: Ci.XHRLoader,
  45439. load: function(i, n, t, r) {
  45440. void 0 !== this.path && (i = this.path + i);
  45441. var o = this
  45442. , e = Ci.Cache.get(i);
  45443. if (void 0 !== e)
  45444. return n && setTimeout(function() {
  45445. n(e)
  45446. }, 0),
  45447. e;
  45448. var a = new XMLHttpRequest;
  45449. return a.overrideMimeType("text/plain"),
  45450. a.open("GET", i, !0),
  45451. a.addEventListener("load", function(e) {
  45452. var t = e.target.response;
  45453. Ci.Cache.add(i, t),
  45454. 200 === this.status ? (n && n(t),
  45455. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45456. n && n(t),
  45457. o.manager.itemEnd(i)) : (r && r(e),
  45458. o.manager.itemError(i))
  45459. }, !1),
  45460. void 0 !== t && a.addEventListener("progress", function(e) {
  45461. t(e)
  45462. }, !1),
  45463. a.addEventListener("error", function(e) {
  45464. r && r(e),
  45465. o.manager.itemError(i)
  45466. }, !1),
  45467. void 0 !== this.responseType && (a.responseType = this.responseType),
  45468. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45469. a.send(null),
  45470. o.manager.itemStart(i),
  45471. a
  45472. },
  45473. setPath: function(e) {
  45474. this.path = e
  45475. },
  45476. setResponseType: function(e) {
  45477. this.responseType = e
  45478. },
  45479. setWithCredentials: function(e) {
  45480. this.withCredentials = e
  45481. }
  45482. },
  45483. Ci.FontLoader = function(e) {
  45484. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45485. }
  45486. ,
  45487. Ci.FontLoader.prototype = {
  45488. constructor: Ci.FontLoader,
  45489. load: function(e, t, i, n) {
  45490. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45491. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45492. }, i, n)
  45493. }
  45494. },
  45495. Ci.ImageLoader = function(e) {
  45496. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45497. }
  45498. ,
  45499. Ci.ImageLoader.prototype = {
  45500. constructor: Ci.ImageLoader,
  45501. load: function(t, i, n, r) {
  45502. void 0 !== this.path && (t = this.path + t);
  45503. var o = this
  45504. , e = Ci.Cache.get(t);
  45505. if (void 0 !== e)
  45506. return o.manager.itemStart(t),
  45507. i ? setTimeout(function() {
  45508. i(e),
  45509. o.manager.itemEnd(t)
  45510. }, 0) : o.manager.itemEnd(t),
  45511. e;
  45512. var a = document.createElement("img");
  45513. return a.addEventListener("load", function(e) {
  45514. Ci.Cache.add(t, this),
  45515. i && i(this),
  45516. o.manager.itemEnd(t)
  45517. }, !1),
  45518. void 0 !== n && a.addEventListener("progress", function(e) {
  45519. n(e)
  45520. }, !1),
  45521. a.addEventListener("error", function(e) {
  45522. r && r(e),
  45523. o.manager.itemError(t)
  45524. }, !1),
  45525. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45526. o.manager.itemStart(t),
  45527. a.src = t,
  45528. a
  45529. },
  45530. setCrossOrigin: function(e) {
  45531. this.crossOrigin = e
  45532. },
  45533. setPath: function(e) {
  45534. this.path = e
  45535. }
  45536. },
  45537. Ci.JSONLoader = function(e) {
  45538. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45539. e = void 0),
  45540. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45541. this.withCredentials = !1
  45542. }
  45543. ,
  45544. Ci.JSONLoader.prototype = {
  45545. constructor: Ci.JSONLoader,
  45546. get statusDomElement() {
  45547. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45548. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45549. this._statusDomElement
  45550. },
  45551. load: function(o, a, e, t) {
  45552. var s = this
  45553. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45554. , i = new Ci.XHRLoader(this.manager);
  45555. i.setWithCredentials(this.withCredentials),
  45556. i.load(o, function(e) {
  45557. var t = JSON.parse(e)
  45558. , i = t.metadata;
  45559. if (void 0 !== i) {
  45560. var n = i.type;
  45561. if (void 0 !== n) {
  45562. if ("object" === n.toLowerCase())
  45563. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45564. if ("scene" === n.toLowerCase())
  45565. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45566. }
  45567. }
  45568. var r = s.parse(t, l);
  45569. a(r.geometry, r.materials)
  45570. }, e, t)
  45571. },
  45572. setTexturePath: function(e) {
  45573. this.texturePath = e
  45574. },
  45575. parse: function(D, e) {
  45576. var N = new Ci.Geometry
  45577. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45578. if (function(e) {
  45579. function t(e, t) {
  45580. return e & 1 << t
  45581. }
  45582. 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;
  45583. if (void 0 !== D.uvs) {
  45584. for (i = 0; i < D.uvs.length; i++)
  45585. D.uvs[i].length && L++;
  45586. for (i = 0; i < L; i++)
  45587. N.faceVertexUvs[i] = []
  45588. }
  45589. for (o = 0,
  45590. a = R.length; o < a; )
  45591. (A = new Ci.Vector3).x = R[o++] * e,
  45592. A.y = R[o++] * e,
  45593. A.z = R[o++] * e,
  45594. N.vertices.push(A);
  45595. for (o = 0,
  45596. a = M.length; o < a; )
  45597. if (d = t(u = M[o++], 0),
  45598. p = t(u, 1),
  45599. f = t(u, 3),
  45600. g = t(u, 4),
  45601. m = t(u, 5),
  45602. v = t(u, 6),
  45603. y = t(u, 7),
  45604. d) {
  45605. if ((I = new Ci.Face3).a = M[o],
  45606. I.b = M[o + 1],
  45607. I.c = M[o + 3],
  45608. (E = new Ci.Face3).a = M[o + 1],
  45609. E.b = M[o + 2],
  45610. E.c = M[o + 3],
  45611. o += 4,
  45612. p && (h = M[o++],
  45613. I.materialIndex = h,
  45614. E.materialIndex = h),
  45615. r = N.faces.length,
  45616. f)
  45617. for (i = 0; i < L; i++)
  45618. for (w = D.uvs[i],
  45619. N.faceVertexUvs[i][r] = [],
  45620. N.faceVertexUvs[i][r + 1] = [],
  45621. n = 0; n < 4; n++)
  45622. x = w[2 * (c = M[o++])],
  45623. S = w[2 * c + 1],
  45624. T = new Ci.Vector2(x,S),
  45625. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45626. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45627. if (g && (l = 3 * M[o++],
  45628. I.normal.set(P[l++], P[l++], P[l]),
  45629. E.normal.copy(I.normal)),
  45630. m)
  45631. for (i = 0; i < 4; i++)
  45632. l = 3 * M[o++],
  45633. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45634. 2 !== i && I.vertexNormals.push(b),
  45635. 0 !== i && E.vertexNormals.push(b);
  45636. if (v && (_ = O[s = M[o++]],
  45637. I.color.setHex(_),
  45638. E.color.setHex(_)),
  45639. y)
  45640. for (i = 0; i < 4; i++)
  45641. _ = O[s = M[o++]],
  45642. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45643. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45644. N.faces.push(I),
  45645. N.faces.push(E)
  45646. } else {
  45647. if ((C = new Ci.Face3).a = M[o++],
  45648. C.b = M[o++],
  45649. C.c = M[o++],
  45650. p && (h = M[o++],
  45651. C.materialIndex = h),
  45652. r = N.faces.length,
  45653. f)
  45654. for (i = 0; i < L; i++)
  45655. for (w = D.uvs[i],
  45656. N.faceVertexUvs[i][r] = [],
  45657. n = 0; n < 3; n++)
  45658. x = w[2 * (c = M[o++])],
  45659. S = w[2 * c + 1],
  45660. T = new Ci.Vector2(x,S),
  45661. N.faceVertexUvs[i][r].push(T);
  45662. if (g && (l = 3 * M[o++],
  45663. C.normal.set(P[l++], P[l++], P[l])),
  45664. m)
  45665. for (i = 0; i < 3; i++)
  45666. l = 3 * M[o++],
  45667. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45668. C.vertexNormals.push(b);
  45669. if (v && (s = M[o++],
  45670. C.color.setHex(O[s])),
  45671. y)
  45672. for (i = 0; i < 3; i++)
  45673. s = M[o++],
  45674. C.vertexColors.push(new Ci.Color(O[s]));
  45675. N.faces.push(C)
  45676. }
  45677. }(t),
  45678. function() {
  45679. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45680. if (D.skinWeights)
  45681. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45682. var n = D.skinWeights[t]
  45683. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45684. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45685. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45686. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45687. }
  45688. if (D.skinIndices)
  45689. for (t = 0,
  45690. i = D.skinIndices.length; t < i; t += e) {
  45691. var s = D.skinIndices[t]
  45692. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45693. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45694. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45695. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45696. }
  45697. N.bones = D.bones,
  45698. 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.")
  45699. }(),
  45700. function(e) {
  45701. if (void 0 !== D.morphTargets)
  45702. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45703. N.morphTargets[t] = {},
  45704. N.morphTargets[t].name = D.morphTargets[t].name,
  45705. N.morphTargets[t].vertices = [];
  45706. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45707. var s = new Ci.Vector3;
  45708. s.x = r[o] * e,
  45709. s.y = r[o + 1] * e,
  45710. s.z = r[o + 2] * e,
  45711. n.push(s)
  45712. }
  45713. }
  45714. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45715. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45716. var l = N.faces
  45717. , c = D.morphColors[0].colors;
  45718. for (t = 0,
  45719. i = l.length; t < i; t++)
  45720. l[t].color.fromArray(c, 3 * t)
  45721. }
  45722. }(t),
  45723. function() {
  45724. var e = []
  45725. , t = [];
  45726. void 0 !== D.animation && t.push(D.animation),
  45727. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45728. for (var i = 0; i < t.length; i++) {
  45729. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45730. n && e.push(n)
  45731. }
  45732. if (N.morphTargets) {
  45733. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45734. e = e.concat(r)
  45735. }
  45736. 0 < e.length && (N.animations = e)
  45737. }(),
  45738. N.computeFaceNormals(),
  45739. N.computeBoundingSphere(),
  45740. void 0 === D.materials || 0 === D.materials.length)
  45741. return {
  45742. geometry: N
  45743. };
  45744. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45745. return {
  45746. geometry: N,
  45747. materials: i
  45748. }
  45749. }
  45750. },
  45751. Ci.LoadingManager = function(e, t, i) {
  45752. var n = this
  45753. , r = !1
  45754. , o = 0
  45755. , a = 0;
  45756. this.onStart = void 0,
  45757. this.onLoad = e,
  45758. this.onProgress = t,
  45759. this.onError = i,
  45760. this.itemStart = function(e) {
  45761. a++,
  45762. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45763. r = !0
  45764. }
  45765. ,
  45766. this.itemEnd = function(e) {
  45767. o++,
  45768. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45769. o === a && (r = !1,
  45770. void 0 !== n.onLoad && n.onLoad())
  45771. }
  45772. ,
  45773. this.itemError = function(e) {
  45774. void 0 !== n.onError && n.onError(e)
  45775. }
  45776. }
  45777. ,
  45778. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45779. Ci.BufferGeometryLoader = function(e) {
  45780. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45781. }
  45782. ,
  45783. Ci.BufferGeometryLoader.prototype = {
  45784. constructor: Ci.BufferGeometryLoader,
  45785. load: function(e, t, i, n) {
  45786. var r = this;
  45787. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45788. t(r.parse(JSON.parse(e)))
  45789. }, i, n)
  45790. },
  45791. parse: function(e) {
  45792. var t = new Ci.BufferGeometry
  45793. , i = e.data.index
  45794. , n = {
  45795. Int8Array: Int8Array,
  45796. Uint8Array: Uint8Array,
  45797. Uint8ClampedArray: Uint8ClampedArray,
  45798. Int16Array: Int16Array,
  45799. Uint16Array: Uint16Array,
  45800. Int32Array: Int32Array,
  45801. Uint32Array: Uint32Array,
  45802. Float32Array: Float32Array,
  45803. Float64Array: Float64Array
  45804. };
  45805. if (void 0 !== i) {
  45806. var r = new n[i.type](i.array);
  45807. t.setIndex(new Ci.BufferAttribute(r,1))
  45808. }
  45809. var o = e.data.attributes;
  45810. for (var a in o) {
  45811. var s = o[a];
  45812. r = new n[s.type](s.array);
  45813. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45814. }
  45815. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45816. if (void 0 !== l)
  45817. for (var c = 0, h = l.length; c !== h; ++c) {
  45818. var u = l[c];
  45819. t.addGroup(u.start, u.count, u.materialIndex)
  45820. }
  45821. var d = e.data.boundingSphere;
  45822. if (void 0 !== d) {
  45823. var p = new Ci.Vector3;
  45824. void 0 !== d.center && p.fromArray(d.center),
  45825. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45826. }
  45827. return t
  45828. }
  45829. },
  45830. Ci.MaterialLoader = function(e) {
  45831. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45832. this.textures = {}
  45833. }
  45834. ,
  45835. Ci.MaterialLoader.prototype = {
  45836. constructor: Ci.MaterialLoader,
  45837. load: function(e, t, i, n) {
  45838. var r = this;
  45839. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45840. t(r.parse(JSON.parse(e)))
  45841. }, i, n)
  45842. },
  45843. setTextures: function(e) {
  45844. this.textures = e
  45845. },
  45846. getTexture: function(e) {
  45847. var t = this.textures;
  45848. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45849. t[e]
  45850. },
  45851. parse: function(e) {
  45852. var t = new Ci[e.type];
  45853. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45854. void 0 !== e.name && (t.name = e.name),
  45855. void 0 !== e.color && t.color.setHex(e.color),
  45856. void 0 !== e.roughness && (t.roughness = e.roughness),
  45857. void 0 !== e.metalness && (t.metalness = e.metalness),
  45858. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45859. void 0 !== e.specular && t.specular.setHex(e.specular),
  45860. void 0 !== e.shininess && (t.shininess = e.shininess),
  45861. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45862. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45863. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45864. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45865. void 0 !== e.shading && (t.shading = e.shading),
  45866. void 0 !== e.blending && (t.blending = e.blending),
  45867. void 0 !== e.side && (t.side = e.side),
  45868. void 0 !== e.opacity && (t.opacity = e.opacity),
  45869. void 0 !== e.transparent && (t.transparent = e.transparent),
  45870. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45871. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45872. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45873. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45874. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45875. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45876. void 0 !== e.size && (t.size = e.size),
  45877. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45878. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45879. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45880. t.transparent = !0),
  45881. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45882. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45883. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45884. void 0 !== e.normalScale) {
  45885. var i = e.normalScale;
  45886. !1 === Array.isArray(i) && (i = [i, i]),
  45887. t.normalScale = (new Ci.Vector2).fromArray(i)
  45888. }
  45889. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45890. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45891. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45892. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45893. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45894. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45895. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45896. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45897. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45898. t.combine = Ci.MultiplyOperation),
  45899. e.reflectivity && (t.reflectivity = e.reflectivity),
  45900. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45901. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45902. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45903. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45904. void 0 !== e.materials)
  45905. for (var n = 0, r = e.materials.length; n < r; n++)
  45906. t.materials.push(this.parse(e.materials[n]));
  45907. return t
  45908. }
  45909. },
  45910. Ci.ObjectLoader = function(e) {
  45911. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45912. this.texturePath = ""
  45913. }
  45914. ,
  45915. Ci.ObjectLoader.prototype = {
  45916. constructor: Ci.ObjectLoader,
  45917. load: function(e, t, i, n) {
  45918. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45919. var r = this;
  45920. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45921. r.parse(JSON.parse(e), t)
  45922. }, i, n)
  45923. },
  45924. setTexturePath: function(e) {
  45925. this.texturePath = e
  45926. },
  45927. setCrossOrigin: function(e) {
  45928. this.crossOrigin = e
  45929. },
  45930. parse: function(e, t) {
  45931. var i = this.parseGeometries(e.geometries)
  45932. , n = this.parseImages(e.images, function() {
  45933. void 0 !== t && t(a)
  45934. })
  45935. , r = this.parseTextures(e.textures, n)
  45936. , o = this.parseMaterials(e.materials, r)
  45937. , a = this.parseObject(e.object, i, o);
  45938. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45939. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45940. a
  45941. },
  45942. parseGeometries: function(e) {
  45943. var t = {};
  45944. if (void 0 !== e)
  45945. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45946. var a, s = e[r];
  45947. switch (s.type) {
  45948. case "PlaneGeometry":
  45949. case "PlaneBufferGeometry":
  45950. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45951. break;
  45952. case "BoxGeometry":
  45953. case "BoxBufferGeometry":
  45954. case "CubeGeometry":
  45955. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45956. break;
  45957. case "CircleGeometry":
  45958. case "CircleBufferGeometry":
  45959. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45960. break;
  45961. case "CylinderGeometry":
  45962. case "CylinderBufferGeometry":
  45963. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45964. break;
  45965. case "SphereGeometry":
  45966. case "SphereBufferGeometry":
  45967. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45968. break;
  45969. case "DodecahedronGeometry":
  45970. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45971. break;
  45972. case "IcosahedronGeometry":
  45973. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45974. break;
  45975. case "OctahedronGeometry":
  45976. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45977. break;
  45978. case "TetrahedronGeometry":
  45979. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45980. break;
  45981. case "RingGeometry":
  45982. case "RingBufferGeometry":
  45983. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45984. break;
  45985. case "TorusGeometry":
  45986. case "TorusBufferGeometry":
  45987. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45988. break;
  45989. case "TorusKnotGeometry":
  45990. case "TorusKnotBufferGeometry":
  45991. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45992. break;
  45993. case "LatheGeometry":
  45994. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45995. break;
  45996. case "BufferGeometry":
  45997. a = n.parse(s);
  45998. break;
  45999. case "Geometry":
  46000. a = i.parse(s.data, this.texturePath).geometry;
  46001. break;
  46002. default:
  46003. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  46004. continue
  46005. }
  46006. a.uuid = s.uuid,
  46007. void 0 !== s.name && (a.name = s.name),
  46008. t[s.uuid] = a
  46009. }
  46010. return t
  46011. },
  46012. parseMaterials: function(e, t) {
  46013. var i = {};
  46014. if (void 0 !== e) {
  46015. var n = new Ci.MaterialLoader;
  46016. n.setTextures(t);
  46017. for (var r = 0, o = e.length; r < o; r++) {
  46018. var a = n.parse(e[r]);
  46019. i[a.uuid] = a
  46020. }
  46021. }
  46022. return i
  46023. },
  46024. parseAnimations: function(e) {
  46025. for (var t = [], i = 0; i < e.length; i++) {
  46026. var n = Ci.AnimationClip.parse(e[i]);
  46027. t.push(n)
  46028. }
  46029. return t
  46030. },
  46031. parseImages: function(e, t) {
  46032. function i(e) {
  46033. return n.manager.itemStart(e),
  46034. a.load(e, function() {
  46035. n.manager.itemEnd(e)
  46036. })
  46037. }
  46038. var n = this
  46039. , r = {};
  46040. if (void 0 !== e && 0 < e.length) {
  46041. var o = new Ci.LoadingManager(t)
  46042. , a = new Ci.ImageLoader(o);
  46043. a.setCrossOrigin(this.crossOrigin);
  46044. for (var s = 0, l = e.length; s < l; s++) {
  46045. var c = e[s]
  46046. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46047. r[c.uuid] = i(h)
  46048. }
  46049. }
  46050. return r
  46051. },
  46052. parseTextures: function(e, t) {
  46053. function i(e) {
  46054. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46055. Ci[e])
  46056. }
  46057. var n = {};
  46058. if (void 0 !== e)
  46059. for (var r = 0, o = e.length; r < o; r++) {
  46060. var a = e[r];
  46061. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46062. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46063. var s = new Ci.Texture(t[a.image]);
  46064. s.needsUpdate = !0,
  46065. s.uuid = a.uuid,
  46066. void 0 !== a.name && (s.name = a.name),
  46067. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46068. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46069. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46070. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46071. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46072. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46073. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46074. s.wrapT = i(a.wrap[1])),
  46075. n[a.uuid] = s
  46076. }
  46077. return n
  46078. },
  46079. parseObject: (ke = new Ci.Matrix4,
  46080. function(e, t, i) {
  46081. function n(e) {
  46082. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46083. t[e]
  46084. }
  46085. function r(e) {
  46086. if (void 0 !== e)
  46087. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46088. i[e]
  46089. }
  46090. var o;
  46091. switch (e.type) {
  46092. case "Scene":
  46093. o = new Ci.Scene;
  46094. break;
  46095. case "PerspectiveCamera":
  46096. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46097. break;
  46098. case "OrthographicCamera":
  46099. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46100. break;
  46101. case "AmbientLight":
  46102. o = new Ci.AmbientLight(e.color,e.intensity);
  46103. break;
  46104. case "DirectionalLight":
  46105. o = new Ci.DirectionalLight(e.color,e.intensity);
  46106. break;
  46107. case "PointLight":
  46108. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46109. break;
  46110. case "SpotLight":
  46111. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46112. break;
  46113. case "HemisphereLight":
  46114. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46115. break;
  46116. case "Mesh":
  46117. var a = n(e.geometry)
  46118. , s = r(e.material);
  46119. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46120. break;
  46121. case "LOD":
  46122. o = new Ci.LOD;
  46123. break;
  46124. case "Line":
  46125. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46126. break;
  46127. case "PointCloud":
  46128. case "Points":
  46129. o = new Ci.Points(n(e.geometry),r(e.material));
  46130. break;
  46131. case "Sprite":
  46132. o = new Ci.Sprite(r(e.material));
  46133. break;
  46134. case "Group":
  46135. o = new Ci.Group;
  46136. break;
  46137. default:
  46138. o = new Ci.Object3D
  46139. }
  46140. if (o.uuid = e.uuid,
  46141. void 0 !== e.name && (o.name = e.name),
  46142. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46143. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46144. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46145. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46146. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46147. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46148. void 0 !== e.visible && (o.visible = e.visible),
  46149. void 0 !== e.userData && (o.userData = e.userData),
  46150. void 0 !== e.children)
  46151. for (var l in e.children)
  46152. o.add(this.parseObject(e.children[l], t, i));
  46153. if ("LOD" === e.type)
  46154. for (var c = e.levels, h = 0; h < c.length; h++) {
  46155. var u = c[h];
  46156. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46157. }
  46158. return o
  46159. }
  46160. )
  46161. },
  46162. Ci.TextureLoader = function(e) {
  46163. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46164. }
  46165. ,
  46166. Ci.TextureLoader.prototype = {
  46167. constructor: Ci.TextureLoader,
  46168. load: function(e, t, i, n) {
  46169. var r = new Ci.Texture
  46170. , o = new Ci.ImageLoader(this.manager);
  46171. return o.setCrossOrigin(this.crossOrigin),
  46172. o.setPath(this.path),
  46173. o.load(e, function(e) {
  46174. r.image = e,
  46175. r.needsUpdate = !0,
  46176. void 0 !== t && t(r)
  46177. }, i, n),
  46178. r
  46179. },
  46180. setCrossOrigin: function(e) {
  46181. this.crossOrigin = e
  46182. },
  46183. setPath: function(e) {
  46184. this.path = e
  46185. }
  46186. },
  46187. Ci.CubeTextureLoader = function(e) {
  46188. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46189. }
  46190. ,
  46191. Ci.CubeTextureLoader.prototype = {
  46192. constructor: Ci.CubeTextureLoader,
  46193. load: function(e, i, t, n) {
  46194. function r(t) {
  46195. a.load(e[t], function(e) {
  46196. o.images[t] = e,
  46197. 6 === ++s && (o.needsUpdate = !0,
  46198. i && i(o))
  46199. }, void 0, n)
  46200. }
  46201. var o = new Ci.CubeTexture
  46202. , a = new Ci.ImageLoader(this.manager);
  46203. a.setCrossOrigin(this.crossOrigin),
  46204. a.setPath(this.path);
  46205. for (var s = 0, l = 0; l < e.length; ++l)
  46206. r(l);
  46207. return o
  46208. },
  46209. setCrossOrigin: function(e) {
  46210. this.crossOrigin = e
  46211. },
  46212. setPath: function(e) {
  46213. this.path = e
  46214. }
  46215. },
  46216. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46217. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46218. this._parser = null
  46219. }
  46220. ,
  46221. Ci.BinaryTextureLoader.prototype = {
  46222. constructor: Ci.BinaryTextureLoader,
  46223. load: function(e, i, t, n) {
  46224. var r = this
  46225. , o = new Ci.DataTexture
  46226. , a = new Ci.XHRLoader(this.manager);
  46227. return a.setResponseType("arraybuffer"),
  46228. a.load(e, function(e) {
  46229. var t = r._parser(e);
  46230. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46231. o.image.height = t.height,
  46232. o.image.data = t.data),
  46233. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46234. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46235. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46236. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46237. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46238. void 0 !== t.format && (o.format = t.format),
  46239. void 0 !== t.type && (o.type = t.type),
  46240. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46241. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46242. o.needsUpdate = !0,
  46243. i && i(o, t))
  46244. }, t, n),
  46245. o
  46246. }
  46247. },
  46248. Ci.CompressedTextureLoader = function(e) {
  46249. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46250. this._parser = null
  46251. }
  46252. ,
  46253. Ci.CompressedTextureLoader.prototype = {
  46254. constructor: Ci.CompressedTextureLoader,
  46255. load: function(e, o, t, n) {
  46256. function i(i) {
  46257. r.load(e[i], function(e) {
  46258. var t = a._parser(e, !0);
  46259. s[i] = {
  46260. width: t.width,
  46261. height: t.height,
  46262. format: t.format,
  46263. mipmaps: t.mipmaps
  46264. },
  46265. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46266. l.format = t.format,
  46267. l.needsUpdate = !0,
  46268. o && o(l))
  46269. }, t, n)
  46270. }
  46271. var a = this
  46272. , s = []
  46273. , l = new Ci.CompressedTexture;
  46274. l.image = s;
  46275. var r = new Ci.XHRLoader(this.manager);
  46276. if (r.setPath(this.path),
  46277. r.setResponseType("arraybuffer"),
  46278. Array.isArray(e))
  46279. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46280. i(h);
  46281. else
  46282. r.load(e, function(e) {
  46283. var t = a._parser(e, !0);
  46284. if (t.isCubemap)
  46285. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46286. s[n] = {
  46287. mipmaps: []
  46288. };
  46289. for (var r = 0; r < t.mipmapCount; r++)
  46290. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46291. s[n].format = t.format,
  46292. s[n].width = t.width,
  46293. s[n].height = t.height
  46294. }
  46295. else
  46296. l.image.width = t.width,
  46297. l.image.height = t.height,
  46298. l.mipmaps = t.mipmaps;
  46299. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46300. l.format = t.format,
  46301. l.needsUpdate = !0,
  46302. o && o(l)
  46303. }, t, n);
  46304. return l
  46305. },
  46306. setPath: function(e) {
  46307. this.path = e
  46308. }
  46309. },
  46310. Ci.Material = function() {
  46311. Object.defineProperty(this, "id", {
  46312. value: Ci.MaterialIdCount++
  46313. }),
  46314. this.uuid = Ci.Math.generateUUID(),
  46315. this.name = "",
  46316. this.type = "Material",
  46317. this.side = Ci.FrontSide,
  46318. this.opacity = 1,
  46319. this.transparent = !1,
  46320. this.blending = Ci.NormalBlending,
  46321. this.blendSrc = Ci.SrcAlphaFactor,
  46322. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46323. this.blendEquation = Ci.AddEquation,
  46324. this.blendSrcAlpha = null,
  46325. this.blendDstAlpha = null,
  46326. this.blendEquationAlpha = null,
  46327. this.depthFunc = Ci.LessEqualDepth,
  46328. this.depthTest = !0,
  46329. this.depthWrite = !0,
  46330. this.colorWrite = !0,
  46331. this.precision = null,
  46332. this.polygonOffset = !1,
  46333. this.polygonOffsetFactor = 0,
  46334. this.polygonOffsetUnits = 0,
  46335. this.alphaTest = 0,
  46336. this.premultipliedAlpha = !1,
  46337. this.overdraw = 0,
  46338. this.visible = !0,
  46339. this._needsUpdate = !0
  46340. }
  46341. ,
  46342. Ci.Material.prototype = {
  46343. constructor: Ci.Material,
  46344. get needsUpdate() {
  46345. return this._needsUpdate
  46346. },
  46347. set needsUpdate(e) {
  46348. !0 === e && this.update(),
  46349. this._needsUpdate = e
  46350. },
  46351. setValues: function(e) {
  46352. if (void 0 !== e)
  46353. for (var t in e) {
  46354. var i = e[t];
  46355. if (void 0 !== i) {
  46356. var n = this[t];
  46357. 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.")
  46358. } else
  46359. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46360. }
  46361. },
  46362. toJSON: function(e) {
  46363. function t(e) {
  46364. var t = [];
  46365. for (var i in e) {
  46366. var n = e[i];
  46367. delete n.metadata,
  46368. t.push(n)
  46369. }
  46370. return t
  46371. }
  46372. var i = void 0 === e;
  46373. i && (e = {
  46374. textures: {},
  46375. images: {}
  46376. });
  46377. var n = {
  46378. metadata: {
  46379. version: 4.4,
  46380. type: "Material",
  46381. generator: "Material.toJSON"
  46382. }
  46383. };
  46384. if (n.uuid = this.uuid,
  46385. n.type = this.type,
  46386. "" !== this.name && (n.name = this.name),
  46387. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46388. .5 !== this.roughness && (n.roughness = this.roughness),
  46389. .5 !== this.metalness && (n.metalness = this.metalness),
  46390. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46391. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46392. void 0 !== this.shininess && (n.shininess = this.shininess),
  46393. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46394. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46395. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46396. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46397. n.bumpScale = this.bumpScale),
  46398. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46399. n.normalScale = this.normalScale.toArray()),
  46400. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46401. n.displacementScale = this.displacementScale,
  46402. n.displacementBias = this.displacementBias),
  46403. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46404. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46405. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46406. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46407. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46408. n.reflectivity = this.reflectivity),
  46409. void 0 !== this.size && (n.size = this.size),
  46410. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46411. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46412. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46413. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46414. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46415. this.opacity < 1 && (n.opacity = this.opacity),
  46416. !0 === this.transparent && (n.transparent = this.transparent),
  46417. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46418. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46419. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46420. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46421. i) {
  46422. var r = t(e.textures)
  46423. , o = t(e.images);
  46424. 0 < r.length && (n.textures = r),
  46425. 0 < o.length && (n.images = o)
  46426. }
  46427. return n
  46428. },
  46429. clone: function() {
  46430. return (new this.constructor).copy(this)
  46431. },
  46432. copy: function(e) {
  46433. return this.name = e.name,
  46434. this.side = e.side,
  46435. this.opacity = e.opacity,
  46436. this.transparent = e.transparent,
  46437. this.blending = e.blending,
  46438. this.blendSrc = e.blendSrc,
  46439. this.blendDst = e.blendDst,
  46440. this.blendEquation = e.blendEquation,
  46441. this.blendSrcAlpha = e.blendSrcAlpha,
  46442. this.blendDstAlpha = e.blendDstAlpha,
  46443. this.blendEquationAlpha = e.blendEquationAlpha,
  46444. this.depthFunc = e.depthFunc,
  46445. this.depthTest = e.depthTest,
  46446. this.depthWrite = e.depthWrite,
  46447. this.colorWrite = e.colorWrite,
  46448. this.precision = e.precision,
  46449. this.polygonOffset = e.polygonOffset,
  46450. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46451. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46452. this.alphaTest = e.alphaTest,
  46453. this.premultipliedAlpha = e.premultipliedAlpha,
  46454. this.overdraw = e.overdraw,
  46455. this.visible = e.visible,
  46456. this
  46457. },
  46458. update: function() {
  46459. this.dispatchEvent({
  46460. type: "update"
  46461. })
  46462. },
  46463. dispose: function() {
  46464. this.dispatchEvent({
  46465. type: "dispose"
  46466. })
  46467. }
  46468. },
  46469. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46470. Ci.MaterialIdCount = 0,
  46471. Ci.LineBasicMaterial = function(e) {
  46472. Ci.Material.call(this),
  46473. this.type = "LineBasicMaterial",
  46474. this.color = new Ci.Color(16777215),
  46475. this.linewidth = 1,
  46476. this.linecap = "round",
  46477. this.linejoin = "round",
  46478. this.blending = Ci.NormalBlending,
  46479. this.vertexColors = Ci.NoColors,
  46480. this.fog = !0,
  46481. this.setValues(e)
  46482. }
  46483. ,
  46484. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46485. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46486. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46487. return Ci.Material.prototype.copy.call(this, e),
  46488. this.color.copy(e.color),
  46489. this.linewidth = e.linewidth,
  46490. this.linecap = e.linecap,
  46491. this.linejoin = e.linejoin,
  46492. this.vertexColors = e.vertexColors,
  46493. this.fog = e.fog,
  46494. this
  46495. }
  46496. ,
  46497. Ci.LineDashedMaterial = function(e) {
  46498. Ci.Material.call(this),
  46499. this.type = "LineDashedMaterial",
  46500. this.color = new Ci.Color(16777215),
  46501. this.linewidth = 1,
  46502. this.scale = 1,
  46503. this.dashSize = 3,
  46504. this.gapSize = 1,
  46505. this.blending = Ci.NormalBlending,
  46506. this.vertexColors = Ci.NoColors,
  46507. this.fog = !0,
  46508. this.setValues(e)
  46509. }
  46510. ,
  46511. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46512. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46513. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46514. return Ci.Material.prototype.copy.call(this, e),
  46515. this.color.copy(e.color),
  46516. this.linewidth = e.linewidth,
  46517. this.scale = e.scale,
  46518. this.dashSize = e.dashSize,
  46519. this.gapSize = e.gapSize,
  46520. this.vertexColors = e.vertexColors,
  46521. this.fog = e.fog,
  46522. this
  46523. }
  46524. ,
  46525. Ci.MeshBasicMaterial = function(e) {
  46526. Ci.Material.call(this),
  46527. this.type = "MeshBasicMaterial",
  46528. this.color = new Ci.Color(16777215),
  46529. this.map = null,
  46530. this.aoMap = null,
  46531. this.aoMapIntensity = 1,
  46532. this.specularMap = null,
  46533. this.alphaMap = null,
  46534. this.envMap = null,
  46535. this.combine = Ci.MultiplyOperation,
  46536. this.reflectivity = 1,
  46537. this.refractionRatio = .98,
  46538. this.fog = !0,
  46539. this.shading = Ci.SmoothShading,
  46540. this.blending = Ci.NormalBlending,
  46541. this.wireframe = !1,
  46542. this.wireframeLinewidth = 1,
  46543. this.wireframeLinecap = "round",
  46544. this.wireframeLinejoin = "round",
  46545. this.vertexColors = Ci.NoColors,
  46546. this.skinning = !1,
  46547. this.morphTargets = !1,
  46548. this.setValues(e)
  46549. }
  46550. ,
  46551. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46552. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46553. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46554. return Ci.Material.prototype.copy.call(this, e),
  46555. this.color.copy(e.color),
  46556. this.map = e.map,
  46557. this.aoMap = e.aoMap,
  46558. this.aoMapIntensity = e.aoMapIntensity,
  46559. this.specularMap = e.specularMap,
  46560. this.alphaMap = e.alphaMap,
  46561. this.envMap = e.envMap,
  46562. this.combine = e.combine,
  46563. this.reflectivity = e.reflectivity,
  46564. this.refractionRatio = e.refractionRatio,
  46565. this.fog = e.fog,
  46566. this.shading = e.shading,
  46567. this.wireframe = e.wireframe,
  46568. this.wireframeLinewidth = e.wireframeLinewidth,
  46569. this.wireframeLinecap = e.wireframeLinecap,
  46570. this.wireframeLinejoin = e.wireframeLinejoin,
  46571. this.vertexColors = e.vertexColors,
  46572. this.skinning = e.skinning,
  46573. this.morphTargets = e.morphTargets,
  46574. this
  46575. }
  46576. ,
  46577. Ci.MeshLambertMaterial = function(e) {
  46578. Ci.Material.call(this),
  46579. this.type = "MeshLambertMaterial",
  46580. this.color = new Ci.Color(16777215),
  46581. this.map = null,
  46582. this.lightMap = null,
  46583. this.lightMapIntensity = 1,
  46584. this.aoMap = null,
  46585. this.aoMapIntensity = 1,
  46586. this.emissive = new Ci.Color(0),
  46587. this.emissiveIntensity = 1,
  46588. this.emissiveMap = null,
  46589. this.specularMap = null,
  46590. this.alphaMap = null,
  46591. this.envMap = null,
  46592. this.combine = Ci.MultiplyOperation,
  46593. this.reflectivity = 1,
  46594. this.refractionRatio = .98,
  46595. this.fog = !0,
  46596. this.blending = Ci.NormalBlending,
  46597. this.wireframe = !1,
  46598. this.wireframeLinewidth = 1,
  46599. this.wireframeLinecap = "round",
  46600. this.wireframeLinejoin = "round",
  46601. this.vertexColors = Ci.NoColors,
  46602. this.skinning = !1,
  46603. this.morphTargets = !1,
  46604. this.morphNormals = !1,
  46605. this.setValues(e)
  46606. }
  46607. ,
  46608. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46609. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46610. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46611. return Ci.Material.prototype.copy.call(this, e),
  46612. this.color.copy(e.color),
  46613. this.map = e.map,
  46614. this.lightMap = e.lightMap,
  46615. this.lightMapIntensity = e.lightMapIntensity,
  46616. this.aoMap = e.aoMap,
  46617. this.aoMapIntensity = e.aoMapIntensity,
  46618. this.emissive.copy(e.emissive),
  46619. this.emissiveMap = e.emissiveMap,
  46620. this.emissiveIntensity = e.emissiveIntensity,
  46621. this.specularMap = e.specularMap,
  46622. this.alphaMap = e.alphaMap,
  46623. this.envMap = e.envMap,
  46624. this.combine = e.combine,
  46625. this.reflectivity = e.reflectivity,
  46626. this.refractionRatio = e.refractionRatio,
  46627. this.fog = e.fog,
  46628. this.wireframe = e.wireframe,
  46629. this.wireframeLinewidth = e.wireframeLinewidth,
  46630. this.wireframeLinecap = e.wireframeLinecap,
  46631. this.wireframeLinejoin = e.wireframeLinejoin,
  46632. this.vertexColors = e.vertexColors,
  46633. this.skinning = e.skinning,
  46634. this.morphTargets = e.morphTargets,
  46635. this.morphNormals = e.morphNormals,
  46636. this
  46637. }
  46638. ,
  46639. Ci.MeshPhongMaterial = function(e) {
  46640. Ci.Material.call(this),
  46641. this.type = "MeshPhongMaterial",
  46642. this.color = new Ci.Color(16777215),
  46643. this.specular = new Ci.Color(1118481),
  46644. this.shininess = 30,
  46645. this.map = null,
  46646. this.lightMap = null,
  46647. this.lightMapIntensity = 1,
  46648. this.aoMap = null,
  46649. this.aoMapIntensity = 1,
  46650. this.emissive = new Ci.Color(0),
  46651. this.emissiveIntensity = 1,
  46652. this.emissiveMap = null,
  46653. this.bumpMap = null,
  46654. this.bumpScale = 1,
  46655. this.normalMap = null,
  46656. this.normalScale = new Ci.Vector2(1,1),
  46657. this.displacementMap = null,
  46658. this.displacementScale = 1,
  46659. this.displacementBias = 0,
  46660. this.specularMap = null,
  46661. this.alphaMap = null,
  46662. this.envMap = null,
  46663. this.combine = Ci.MultiplyOperation,
  46664. this.reflectivity = 1,
  46665. this.refractionRatio = .98,
  46666. this.fog = !0,
  46667. this.shading = Ci.SmoothShading,
  46668. this.blending = Ci.NormalBlending,
  46669. this.wireframe = !1,
  46670. this.wireframeLinewidth = 1,
  46671. this.wireframeLinecap = "round",
  46672. this.wireframeLinejoin = "round",
  46673. this.vertexColors = Ci.NoColors,
  46674. this.skinning = !1,
  46675. this.morphTargets = !1,
  46676. this.morphNormals = !1,
  46677. this.setValues(e)
  46678. }
  46679. ,
  46680. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46681. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46682. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46683. return Ci.Material.prototype.copy.call(this, e),
  46684. this.color.copy(e.color),
  46685. this.specular.copy(e.specular),
  46686. this.shininess = e.shininess,
  46687. this.map = e.map,
  46688. this.lightMap = e.lightMap,
  46689. this.lightMapIntensity = e.lightMapIntensity,
  46690. this.aoMap = e.aoMap,
  46691. this.aoMapIntensity = e.aoMapIntensity,
  46692. this.emissive.copy(e.emissive),
  46693. this.emissiveMap = e.emissiveMap,
  46694. this.emissiveIntensity = e.emissiveIntensity,
  46695. this.bumpMap = e.bumpMap,
  46696. this.bumpScale = e.bumpScale,
  46697. this.normalMap = e.normalMap,
  46698. this.normalScale.copy(e.normalScale),
  46699. this.displacementMap = e.displacementMap,
  46700. this.displacementScale = e.displacementScale,
  46701. this.displacementBias = e.displacementBias,
  46702. this.specularMap = e.specularMap,
  46703. this.alphaMap = e.alphaMap,
  46704. this.envMap = e.envMap,
  46705. this.combine = e.combine,
  46706. this.reflectivity = e.reflectivity,
  46707. this.refractionRatio = e.refractionRatio,
  46708. this.fog = e.fog,
  46709. this.shading = e.shading,
  46710. this.wireframe = e.wireframe,
  46711. this.wireframeLinewidth = e.wireframeLinewidth,
  46712. this.wireframeLinecap = e.wireframeLinecap,
  46713. this.wireframeLinejoin = e.wireframeLinejoin,
  46714. this.vertexColors = e.vertexColors,
  46715. this.skinning = e.skinning,
  46716. this.morphTargets = e.morphTargets,
  46717. this.morphNormals = e.morphNormals,
  46718. this
  46719. }
  46720. ,
  46721. Ci.MeshStandardMaterial = function(e) {
  46722. Ci.Material.call(this),
  46723. this.type = "MeshStandardMaterial",
  46724. this.color = new Ci.Color(16777215),
  46725. this.roughness = .5,
  46726. this.metalness = .5,
  46727. this.map = null,
  46728. this.lightMap = null,
  46729. this.lightMapIntensity = 1,
  46730. this.aoMap = null,
  46731. this.aoMapIntensity = 1,
  46732. this.emissive = new Ci.Color(0),
  46733. this.emissiveIntensity = 1,
  46734. this.emissiveMap = null,
  46735. this.bumpMap = null,
  46736. this.bumpScale = 1,
  46737. this.normalMap = null,
  46738. this.normalScale = new Ci.Vector2(1,1),
  46739. this.displacementMap = null,
  46740. this.displacementScale = 1,
  46741. this.displacementBias = 0,
  46742. this.roughnessMap = null,
  46743. this.metalnessMap = null,
  46744. this.alphaMap = null,
  46745. this.envMap = null,
  46746. this.envMapIntensity = 1,
  46747. this.refractionRatio = .98,
  46748. this.fog = !0,
  46749. this.shading = Ci.SmoothShading,
  46750. this.blending = Ci.NormalBlending,
  46751. this.wireframe = !1,
  46752. this.wireframeLinewidth = 1,
  46753. this.wireframeLinecap = "round",
  46754. this.wireframeLinejoin = "round",
  46755. this.vertexColors = Ci.NoColors,
  46756. this.skinning = !1,
  46757. this.morphTargets = !1,
  46758. this.morphNormals = !1,
  46759. this.setValues(e)
  46760. }
  46761. ,
  46762. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46763. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46764. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46765. return Ci.Material.prototype.copy.call(this, e),
  46766. this.color.copy(e.color),
  46767. this.roughness = e.roughness,
  46768. this.metalness = e.metalness,
  46769. this.map = e.map,
  46770. this.lightMap = e.lightMap,
  46771. this.lightMapIntensity = e.lightMapIntensity,
  46772. this.aoMap = e.aoMap,
  46773. this.aoMapIntensity = e.aoMapIntensity,
  46774. this.emissive.copy(e.emissive),
  46775. this.emissiveMap = e.emissiveMap,
  46776. this.emissiveIntensity = e.emissiveIntensity,
  46777. this.bumpMap = e.bumpMap,
  46778. this.bumpScale = e.bumpScale,
  46779. this.normalMap = e.normalMap,
  46780. this.normalScale.copy(e.normalScale),
  46781. this.displacementMap = e.displacementMap,
  46782. this.displacementScale = e.displacementScale,
  46783. this.displacementBias = e.displacementBias,
  46784. this.roughnessMap = e.roughnessMap,
  46785. this.metalnessMap = e.metalnessMap,
  46786. this.alphaMap = e.alphaMap,
  46787. this.envMap = e.envMap,
  46788. this.envMapIntensity = e.envMapIntensity,
  46789. this.refractionRatio = e.refractionRatio,
  46790. this.fog = e.fog,
  46791. this.shading = e.shading,
  46792. this.wireframe = e.wireframe,
  46793. this.wireframeLinewidth = e.wireframeLinewidth,
  46794. this.wireframeLinecap = e.wireframeLinecap,
  46795. this.wireframeLinejoin = e.wireframeLinejoin,
  46796. this.vertexColors = e.vertexColors,
  46797. this.skinning = e.skinning,
  46798. this.morphTargets = e.morphTargets,
  46799. this.morphNormals = e.morphNormals,
  46800. this
  46801. }
  46802. ,
  46803. Ci.MeshDepthMaterial = function(e) {
  46804. Ci.Material.call(this),
  46805. this.type = "MeshDepthMaterial",
  46806. this.morphTargets = !1,
  46807. this.wireframe = !1,
  46808. this.wireframeLinewidth = 1,
  46809. this.setValues(e)
  46810. }
  46811. ,
  46812. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46813. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46814. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46815. return Ci.Material.prototype.copy.call(this, e),
  46816. this.wireframe = e.wireframe,
  46817. this.wireframeLinewidth = e.wireframeLinewidth,
  46818. this
  46819. }
  46820. ,
  46821. Ci.MeshNormalMaterial = function(e) {
  46822. Ci.Material.call(this, e),
  46823. this.type = "MeshNormalMaterial",
  46824. this.wireframe = !1,
  46825. this.wireframeLinewidth = 1,
  46826. this.morphTargets = !1,
  46827. this.setValues(e)
  46828. }
  46829. ,
  46830. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46831. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46832. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46833. return Ci.Material.prototype.copy.call(this, e),
  46834. this.wireframe = e.wireframe,
  46835. this.wireframeLinewidth = e.wireframeLinewidth,
  46836. this
  46837. }
  46838. ,
  46839. Ci.MultiMaterial = function(e) {
  46840. this.uuid = Ci.Math.generateUUID(),
  46841. this.type = "MultiMaterial",
  46842. this.materials = e instanceof Array ? e : [],
  46843. this.visible = !0
  46844. }
  46845. ,
  46846. Ci.MultiMaterial.prototype = {
  46847. constructor: Ci.MultiMaterial,
  46848. toJSON: function(e) {
  46849. for (var t = {
  46850. metadata: {
  46851. version: 4.2,
  46852. type: "material",
  46853. generator: "MaterialExporter"
  46854. },
  46855. uuid: this.uuid,
  46856. type: this.type,
  46857. materials: []
  46858. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46859. var o = i[n].toJSON(e);
  46860. delete o.metadata,
  46861. t.materials.push(o)
  46862. }
  46863. return t.visible = this.visible,
  46864. t
  46865. },
  46866. clone: function() {
  46867. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46868. e.materials.push(this.materials[t].clone());
  46869. return e.visible = this.visible,
  46870. e
  46871. }
  46872. },
  46873. Ci.PointsMaterial = function(e) {
  46874. Ci.Material.call(this),
  46875. this.type = "PointsMaterial",
  46876. this.color = new Ci.Color(16777215),
  46877. this.map = null,
  46878. this.size = 1,
  46879. this.sizeAttenuation = !0,
  46880. this.blending = Ci.NormalBlending,
  46881. this.vertexColors = Ci.NoColors,
  46882. this.fog = !0,
  46883. this.setValues(e)
  46884. }
  46885. ,
  46886. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46887. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46888. Ci.PointsMaterial.prototype.copy = function(e) {
  46889. return Ci.Material.prototype.copy.call(this, e),
  46890. this.color.copy(e.color),
  46891. this.map = e.map,
  46892. this.size = e.size,
  46893. this.sizeAttenuation = e.sizeAttenuation,
  46894. this.vertexColors = e.vertexColors,
  46895. this.fog = e.fog,
  46896. this
  46897. }
  46898. ,
  46899. Ci.ShaderMaterial = function(e) {
  46900. Ci.Material.call(this),
  46901. this.type = "ShaderMaterial",
  46902. this.defines = {},
  46903. this.uniforms = {},
  46904. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46905. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46906. this.shading = Ci.SmoothShading,
  46907. this.linewidth = 1,
  46908. this.wireframe = !1,
  46909. this.wireframeLinewidth = 1,
  46910. this.fog = !1,
  46911. this.lights = !1,
  46912. this.vertexColors = Ci.NoColors,
  46913. this.skinning = !1,
  46914. this.morphTargets = !1,
  46915. this.morphNormals = !1,
  46916. this.extensions = {
  46917. derivatives: !1,
  46918. fragDepth: !1,
  46919. drawBuffers: !1,
  46920. shaderTextureLOD: !1
  46921. },
  46922. this.defaultAttributeValues = {
  46923. color: [1, 1, 1],
  46924. uv: [0, 0],
  46925. uv2: [0, 0]
  46926. },
  46927. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46928. this.setValues(e))
  46929. }
  46930. ,
  46931. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46932. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46933. Ci.ShaderMaterial.prototype.copy = function(e) {
  46934. return Ci.Material.prototype.copy.call(this, e),
  46935. this.fragmentShader = e.fragmentShader,
  46936. this.vertexShader = e.vertexShader,
  46937. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46938. this.defines = e.defines,
  46939. this.shading = e.shading,
  46940. this.wireframe = e.wireframe,
  46941. this.wireframeLinewidth = e.wireframeLinewidth,
  46942. this.fog = e.fog,
  46943. this.lights = e.lights,
  46944. this.vertexColors = e.vertexColors,
  46945. this.skinning = e.skinning,
  46946. this.morphTargets = e.morphTargets,
  46947. this.morphNormals = e.morphNormals,
  46948. this.extensions = e.extensions,
  46949. this
  46950. }
  46951. ,
  46952. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46953. var t = Ci.Material.prototype.toJSON.call(this, e);
  46954. return t.uniforms = this.uniforms,
  46955. t.vertexShader = this.vertexShader,
  46956. t.fragmentShader = this.fragmentShader,
  46957. t
  46958. }
  46959. ,
  46960. Ci.RawShaderMaterial = function(e) {
  46961. Ci.ShaderMaterial.call(this, e),
  46962. this.type = "RawShaderMaterial"
  46963. }
  46964. ,
  46965. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46966. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46967. Ci.SpriteMaterial = function(e) {
  46968. Ci.Material.call(this),
  46969. this.type = "SpriteMaterial",
  46970. this.color = new Ci.Color(16777215),
  46971. this.map = null,
  46972. this.rotation = 0,
  46973. this.fog = !1,
  46974. this.setValues(e)
  46975. }
  46976. ,
  46977. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46978. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46979. Ci.SpriteMaterial.prototype.copy = function(e) {
  46980. return Ci.Material.prototype.copy.call(this, e),
  46981. this.color.copy(e.color),
  46982. this.map = e.map,
  46983. this.rotation = e.rotation,
  46984. this.fog = e.fog,
  46985. this
  46986. }
  46987. ,
  46988. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46989. Object.defineProperty(this, "id", {
  46990. value: Ci.TextureIdCount++
  46991. }),
  46992. this.uuid = Ci.Math.generateUUID(),
  46993. this.name = "",
  46994. this.sourceFile = "",
  46995. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46996. this.mipmaps = [],
  46997. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46998. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46999. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  47000. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  47001. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  47002. this.anisotropy = void 0 !== l ? l : 1,
  47003. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  47004. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  47005. this.offset = new Ci.Vector2(0,0),
  47006. this.repeat = new Ci.Vector2(1,1),
  47007. this.generateMipmaps = !0,
  47008. this.premultiplyAlpha = !1,
  47009. this.flipY = !0,
  47010. this.unpackAlignment = 4,
  47011. this.encoding = Ci.LinearEncoding,
  47012. this.version = 0,
  47013. this.onUpdate = null
  47014. }
  47015. ,
  47016. Ci.Texture.DEFAULT_IMAGE = void 0,
  47017. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  47018. Ci.Texture.prototype = {
  47019. constructor: Ci.Texture,
  47020. set needsUpdate(e) {
  47021. !0 === e && this.version++
  47022. },
  47023. clone: function() {
  47024. return (new this.constructor).copy(this)
  47025. },
  47026. copy: function(e) {
  47027. return this.image = e.image,
  47028. this.mipmaps = e.mipmaps.slice(0),
  47029. this.mapping = e.mapping,
  47030. this.wrapS = e.wrapS,
  47031. this.wrapT = e.wrapT,
  47032. this.magFilter = e.magFilter,
  47033. this.minFilter = e.minFilter,
  47034. this.anisotropy = e.anisotropy,
  47035. this.format = e.format,
  47036. this.type = e.type,
  47037. this.offset.copy(e.offset),
  47038. this.repeat.copy(e.repeat),
  47039. this.generateMipmaps = e.generateMipmaps,
  47040. this.premultiplyAlpha = e.premultiplyAlpha,
  47041. this.flipY = e.flipY,
  47042. this.unpackAlignment = e.unpackAlignment,
  47043. this.encoding = e.encoding,
  47044. this
  47045. },
  47046. toJSON: function(e) {
  47047. if (void 0 !== e.textures[this.uuid])
  47048. return e.textures[this.uuid];
  47049. var t, i, n = {
  47050. metadata: {
  47051. version: 4.4,
  47052. type: "Texture",
  47053. generator: "Texture.toJSON"
  47054. },
  47055. uuid: this.uuid,
  47056. name: this.name,
  47057. mapping: this.mapping,
  47058. repeat: [this.repeat.x, this.repeat.y],
  47059. offset: [this.offset.x, this.offset.y],
  47060. wrap: [this.wrapS, this.wrapT],
  47061. minFilter: this.minFilter,
  47062. magFilter: this.magFilter,
  47063. anisotropy: this.anisotropy
  47064. };
  47065. if (void 0 !== this.image) {
  47066. var r = this.image;
  47067. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47068. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47069. uuid: r.uuid,
  47070. url: (t = r,
  47071. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47072. i.height = t.height,
  47073. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47074. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47075. }),
  47076. n.image = r.uuid
  47077. }
  47078. return e.textures[this.uuid] = n
  47079. },
  47080. dispose: function() {
  47081. this.dispatchEvent({
  47082. type: "dispose"
  47083. })
  47084. },
  47085. transformUv: function(e) {
  47086. if (this.mapping === Ci.UVMapping) {
  47087. if (e.multiply(this.repeat),
  47088. e.add(this.offset),
  47089. e.x < 0 || 1 < e.x)
  47090. switch (this.wrapS) {
  47091. case Ci.RepeatWrapping:
  47092. e.x = e.x - Math.floor(e.x);
  47093. break;
  47094. case Ci.ClampToEdgeWrapping:
  47095. e.x = e.x < 0 ? 0 : 1;
  47096. break;
  47097. case Ci.MirroredRepeatWrapping:
  47098. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47099. }
  47100. if (e.y < 0 || 1 < e.y)
  47101. switch (this.wrapT) {
  47102. case Ci.RepeatWrapping:
  47103. e.y = e.y - Math.floor(e.y);
  47104. break;
  47105. case Ci.ClampToEdgeWrapping:
  47106. e.y = e.y < 0 ? 0 : 1;
  47107. break;
  47108. case Ci.MirroredRepeatWrapping:
  47109. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47110. }
  47111. this.flipY && (e.y = 1 - e.y)
  47112. }
  47113. }
  47114. },
  47115. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47116. Ci.TextureIdCount = 0,
  47117. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47118. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47119. this.needsUpdate = !0
  47120. }
  47121. ,
  47122. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47123. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47124. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47125. e = void 0 !== e ? e : [],
  47126. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47127. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47128. this.flipY = !1
  47129. }
  47130. ,
  47131. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47132. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47133. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47134. get: function() {
  47135. return this.image
  47136. },
  47137. set: function(e) {
  47138. this.image = e
  47139. }
  47140. }),
  47141. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47142. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47143. this.image = {
  47144. width: t,
  47145. height: i
  47146. },
  47147. this.mipmaps = e,
  47148. this.flipY = !1,
  47149. this.generateMipmaps = !1
  47150. }
  47151. ,
  47152. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47153. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47154. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47155. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47156. this.image = {
  47157. data: e,
  47158. width: t,
  47159. height: i
  47160. },
  47161. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47162. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47163. this.flipY = !1,
  47164. this.generateMipmaps = !1
  47165. }
  47166. ,
  47167. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47168. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47169. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47170. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47171. this.generateMipmaps = !1;
  47172. var c = this;
  47173. !function e() {
  47174. requestAnimationFrame(e),
  47175. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47176. }()
  47177. }
  47178. ,
  47179. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47180. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47181. Ci.Group = function() {
  47182. Ci.Object3D.call(this),
  47183. this.type = "Group"
  47184. }
  47185. ,
  47186. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47187. Ci.Group.prototype.constructor = Ci.Group,
  47188. Ci.Points = function(e, t) {
  47189. Ci.Object3D.call(this),
  47190. this.type = "Points",
  47191. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47192. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47193. color: 16777215 * Math.random()
  47194. })
  47195. }
  47196. ,
  47197. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47198. Ci.Points.prototype.constructor = Ci.Points,
  47199. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47200. jt = new Ci.Ray,
  47201. Yt = new Ci.Sphere,
  47202. function(o, a) {
  47203. function e(e, t) {
  47204. var i = jt.distanceSqToPoint(e);
  47205. if (i < c) {
  47206. var n = jt.closestPointToPoint(e);
  47207. n.applyMatrix4(l);
  47208. var r = o.ray.origin.distanceTo(n);
  47209. if (r < o.near || r > o.far)
  47210. return;
  47211. a.push({
  47212. distance: r,
  47213. distanceToRay: Math.sqrt(i),
  47214. point: n.clone(),
  47215. index: t,
  47216. face: null,
  47217. object: s
  47218. })
  47219. }
  47220. }
  47221. var s = this
  47222. , t = this.geometry
  47223. , l = this.matrixWorld
  47224. , i = o.params.Points.threshold;
  47225. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47226. Yt.copy(t.boundingSphere),
  47227. Yt.applyMatrix4(l),
  47228. !1 !== o.ray.intersectsSphere(Yt)) {
  47229. Wt.getInverse(l),
  47230. jt.copy(o.ray).applyMatrix4(Wt);
  47231. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47232. , c = n * n
  47233. , r = new Ci.Vector3;
  47234. if (t instanceof Ci.BufferGeometry) {
  47235. var h = t.index
  47236. , u = t.attributes.position.array;
  47237. if (null !== h)
  47238. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47239. var g = d[p];
  47240. r.fromArray(u, 3 * g),
  47241. e(r, g)
  47242. }
  47243. else {
  47244. p = 0;
  47245. for (var m = u.length / 3; p < m; p++)
  47246. r.fromArray(u, 3 * p),
  47247. e(r, p)
  47248. }
  47249. } else {
  47250. var v = t.vertices;
  47251. for (p = 0,
  47252. m = v.length; p < m; p++)
  47253. e(v[p], p)
  47254. }
  47255. }
  47256. }
  47257. ),
  47258. Ci.Points.prototype.clone = function() {
  47259. return new this.constructor(this.geometry,this.material).copy(this)
  47260. }
  47261. ,
  47262. Ci.Line = function(e, t, i) {
  47263. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47264. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47265. this.type = "Line",
  47266. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47267. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47268. color: 16777215 * Math.random()
  47269. })))
  47270. }
  47271. ,
  47272. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47273. Ci.Line.prototype.constructor = Ci.Line,
  47274. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47275. zt = new Ci.Ray,
  47276. Gt = new Ci.Sphere,
  47277. function(e, t) {
  47278. var i = e.linePrecision
  47279. , n = i * i
  47280. , r = this.geometry
  47281. , o = this.matrixWorld;
  47282. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47283. Gt.copy(r.boundingSphere),
  47284. Gt.applyMatrix4(o),
  47285. !1 !== e.ray.intersectsSphere(Gt)) {
  47286. Ht.getInverse(o),
  47287. zt.copy(e.ray).applyMatrix4(Ht);
  47288. var a = new Ci.Vector3
  47289. , s = new Ci.Vector3
  47290. , l = new Ci.Vector3
  47291. , c = new Ci.Vector3
  47292. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47293. if (r instanceof Ci.BufferGeometry) {
  47294. var u = r.index
  47295. , d = r.attributes.position.array;
  47296. if (null !== u)
  47297. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47298. var m = p[f]
  47299. , v = p[f + 1];
  47300. a.fromArray(d, 3 * m),
  47301. s.fromArray(d, 3 * v),
  47302. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47303. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47304. distance: C,
  47305. point: l.clone().applyMatrix4(this.matrixWorld),
  47306. index: f,
  47307. face: null,
  47308. faceIndex: null,
  47309. object: this
  47310. }))
  47311. }
  47312. else
  47313. for (f = 0,
  47314. g = d.length / 3 - 1; f < g; f += h)
  47315. a.fromArray(d, 3 * f),
  47316. s.fromArray(d, 3 * f + 3),
  47317. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47318. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47319. distance: C,
  47320. point: l.clone().applyMatrix4(this.matrixWorld),
  47321. index: f,
  47322. face: null,
  47323. faceIndex: null,
  47324. object: this
  47325. }))
  47326. } else if (r instanceof Ci.Geometry) {
  47327. var y = r.vertices
  47328. , A = y.length;
  47329. for (f = 0; f < A - 1; f += h) {
  47330. var C;
  47331. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47332. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47333. distance: C,
  47334. point: l.clone().applyMatrix4(this.matrixWorld),
  47335. index: f,
  47336. face: null,
  47337. faceIndex: null,
  47338. object: this
  47339. }))
  47340. }
  47341. }
  47342. }
  47343. }
  47344. ),
  47345. Ci.Line.prototype.clone = function() {
  47346. return new this.constructor(this.geometry,this.material).copy(this)
  47347. }
  47348. ,
  47349. Ci.LineStrip = 0,
  47350. Ci.LinePieces = 1,
  47351. Ci.LineSegments = function(e, t) {
  47352. Ci.Line.call(this, e, t),
  47353. this.type = "LineSegments"
  47354. }
  47355. ,
  47356. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47357. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47358. Ci.Mesh = function(e, t) {
  47359. Ci.Object3D.call(this),
  47360. this.type = "Mesh",
  47361. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47362. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47363. color: 16777215 * Math.random()
  47364. }),
  47365. this.drawMode = Ci.TrianglesDrawMode,
  47366. this.updateMorphTargets()
  47367. }
  47368. ,
  47369. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47370. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47371. Ci.Mesh.prototype.setDrawMode = function(e) {
  47372. this.drawMode = e
  47373. }
  47374. ,
  47375. Ci.Mesh.prototype.updateMorphTargets = function() {
  47376. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47377. this.morphTargetBase = -1,
  47378. this.morphTargetInfluences = [],
  47379. this.morphTargetDictionary = {};
  47380. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47381. this.morphTargetInfluences.push(0),
  47382. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47383. }
  47384. }
  47385. ,
  47386. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47387. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47388. 0)
  47389. }
  47390. ,
  47391. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47392. xt = new Ci.Ray,
  47393. St = new Ci.Sphere,
  47394. Mt = new Ci.Vector3,
  47395. Rt = new Ci.Vector3,
  47396. Pt = new Ci.Vector3,
  47397. Ot = new Ci.Vector3,
  47398. Lt = new Ci.Vector3,
  47399. Dt = new Ci.Vector3,
  47400. Nt = new Ci.Vector2,
  47401. Ft = new Ci.Vector2,
  47402. Bt = new Ci.Vector2,
  47403. Vt = new Ci.Vector3,
  47404. kt = new Ci.Vector3,
  47405. Ut = new Ci.Vector3,
  47406. function(e, t) {
  47407. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47408. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47409. St.copy(r.boundingSphere),
  47410. St.applyMatrix4(a),
  47411. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47412. xt.copy(e.ray).applyMatrix4(Tt),
  47413. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47414. if (r instanceof Ci.BufferGeometry) {
  47415. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47416. if (void 0 !== u.uv && (i = u.uv.array),
  47417. null !== h)
  47418. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47419. s = p[f],
  47420. l = p[f + 1],
  47421. c = p[f + 2],
  47422. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47423. t.push(n));
  47424. else
  47425. for (f = 0,
  47426. g = d.length; f < g; f += 9)
  47427. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47428. t.push(n))
  47429. } else if (r instanceof Ci.Geometry) {
  47430. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47431. 0 < _.length && (i = _);
  47432. for (var b = 0, w = E.length; b < w; b++) {
  47433. var T = E[b]
  47434. , x = 1 == A ? C[T.materialIndex] : o;
  47435. if (void 0 !== x) {
  47436. if (m = I[T.a],
  47437. v = I[T.b],
  47438. y = I[T.c],
  47439. !0 === x.morphTargets) {
  47440. var S = r.morphTargets
  47441. , M = this.morphTargetInfluences;
  47442. Mt.set(0, 0, 0),
  47443. Rt.set(0, 0, 0),
  47444. Pt.set(0, 0, 0);
  47445. for (var R = 0, P = S.length; R < P; R++) {
  47446. var O = M[R];
  47447. if (0 !== O) {
  47448. var L = S[R].vertices;
  47449. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47450. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47451. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47452. }
  47453. }
  47454. Mt.add(m),
  47455. Rt.add(v),
  47456. Pt.add(y),
  47457. m = Mt,
  47458. v = Rt,
  47459. y = Pt
  47460. }
  47461. if (n = wi(this, e, xt, m, v, y, kt)) {
  47462. if (i) {
  47463. var D = i[b];
  47464. Nt.copy(D[0]),
  47465. Ft.copy(D[1]),
  47466. Bt.copy(D[2]),
  47467. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47468. }
  47469. n.face = T,
  47470. n.faceIndex = b,
  47471. t.push(n)
  47472. }
  47473. }
  47474. }
  47475. }
  47476. }
  47477. ),
  47478. Ci.Mesh.prototype.clone = function() {
  47479. return new this.constructor(this.geometry,this.material).copy(this)
  47480. }
  47481. ,
  47482. Ci.Bone = function(e) {
  47483. Ci.Object3D.call(this),
  47484. this.type = "Bone",
  47485. this.skin = e
  47486. }
  47487. ,
  47488. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47489. Ci.Bone.prototype.constructor = Ci.Bone,
  47490. Ci.Bone.prototype.copy = function(e) {
  47491. return Ci.Object3D.prototype.copy.call(this, e),
  47492. this.skin = e.skin,
  47493. this
  47494. }
  47495. ,
  47496. Ci.Skeleton = function(e, t, i) {
  47497. if (this.useVertexTexture = void 0 === i || i,
  47498. this.identityMatrix = new Ci.Matrix4,
  47499. e = e || [],
  47500. this.bones = e.slice(0),
  47501. this.useVertexTexture) {
  47502. var n = Math.sqrt(4 * this.bones.length);
  47503. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47504. n = Math.max(n, 4),
  47505. this.boneTextureWidth = n,
  47506. this.boneTextureHeight = n,
  47507. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47508. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47509. } else
  47510. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47511. if (void 0 === t)
  47512. this.calculateInverses();
  47513. else if (this.bones.length === t.length)
  47514. this.boneInverses = t.slice(0);
  47515. else {
  47516. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47517. this.boneInverses = [];
  47518. for (var r = 0, o = this.bones.length; r < o; r++)
  47519. this.boneInverses.push(new Ci.Matrix4)
  47520. }
  47521. }
  47522. ,
  47523. Ci.Skeleton.prototype.calculateInverses = function() {
  47524. this.boneInverses = [];
  47525. for (var e = 0, t = this.bones.length; e < t; e++) {
  47526. var i = new Ci.Matrix4;
  47527. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47528. this.boneInverses.push(i)
  47529. }
  47530. }
  47531. ,
  47532. Ci.Skeleton.prototype.pose = function() {
  47533. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47534. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47535. for (t = 0,
  47536. i = this.bones.length; t < i; t++)
  47537. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47538. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47539. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47540. }
  47541. ,
  47542. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47543. function() {
  47544. for (var e = 0, t = this.bones.length; e < t; e++) {
  47545. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47546. wt.multiplyMatrices(i, this.boneInverses[e]),
  47547. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47548. }
  47549. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47550. }
  47551. ),
  47552. Ci.Skeleton.prototype.clone = function() {
  47553. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47554. }
  47555. ,
  47556. Ci.SkinnedMesh = function(e, t, i) {
  47557. Ci.Mesh.call(this, e, t),
  47558. this.type = "SkinnedMesh",
  47559. this.bindMode = "attached",
  47560. this.bindMatrix = new Ci.Matrix4,
  47561. this.bindMatrixInverse = new Ci.Matrix4;
  47562. var n = [];
  47563. if (this.geometry && void 0 !== this.geometry.bones) {
  47564. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47565. o = this.geometry.bones[a],
  47566. r = new Ci.Bone(this),
  47567. n.push(r),
  47568. r.name = o.name,
  47569. r.position.fromArray(o.pos),
  47570. r.quaternion.fromArray(o.rotq),
  47571. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47572. for (a = 0,
  47573. s = this.geometry.bones.length; a < s; ++a)
  47574. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47575. }
  47576. this.normalizeSkinWeights(),
  47577. this.updateMatrixWorld(!0),
  47578. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47579. }
  47580. ,
  47581. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47582. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47583. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47584. this.skeleton = e,
  47585. void 0 === t && (this.updateMatrixWorld(!0),
  47586. this.skeleton.calculateInverses(),
  47587. t = this.matrixWorld),
  47588. this.bindMatrix.copy(t),
  47589. this.bindMatrixInverse.getInverse(t)
  47590. }
  47591. ,
  47592. Ci.SkinnedMesh.prototype.pose = function() {
  47593. this.skeleton.pose()
  47594. }
  47595. ,
  47596. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47597. if (this.geometry instanceof Ci.Geometry)
  47598. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47599. var t = this.geometry.skinWeights[e];
  47600. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47601. }
  47602. else if (this.geometry instanceof Ci.BufferGeometry) {
  47603. var i = new Ci.Vector4
  47604. , n = this.geometry.attributes.skinWeight;
  47605. for (e = 0; e < n.count; e++) {
  47606. var r;
  47607. i.x = n.getX(e),
  47608. i.y = n.getY(e),
  47609. i.z = n.getZ(e),
  47610. i.w = n.getW(e),
  47611. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47612. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47613. }
  47614. }
  47615. }
  47616. ,
  47617. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47618. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47619. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47620. }
  47621. ,
  47622. Ci.SkinnedMesh.prototype.clone = function() {
  47623. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47624. }
  47625. ,
  47626. Ci.LOD = function() {
  47627. Ci.Object3D.call(this),
  47628. this.type = "LOD",
  47629. Object.defineProperties(this, {
  47630. levels: {
  47631. enumerable: !0,
  47632. value: []
  47633. },
  47634. objects: {
  47635. get: function() {
  47636. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47637. this.levels
  47638. }
  47639. }
  47640. })
  47641. }
  47642. ,
  47643. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47644. Ci.LOD.prototype.constructor = Ci.LOD,
  47645. Ci.LOD.prototype.addLevel = function(e, t) {
  47646. void 0 === t && (t = 0),
  47647. t = Math.abs(t);
  47648. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47649. ;
  47650. i.splice(n, 0, {
  47651. distance: t,
  47652. object: e
  47653. }),
  47654. this.add(e)
  47655. }
  47656. ,
  47657. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47658. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47659. ;
  47660. return t[i - 1].object
  47661. }
  47662. ,
  47663. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47664. function(e, t) {
  47665. bt.setFromMatrixPosition(this.matrixWorld);
  47666. var i = e.ray.origin.distanceTo(bt);
  47667. this.getObjectForDistance(i).raycast(e, t)
  47668. }
  47669. ),
  47670. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47671. _t = new Ci.Vector3,
  47672. function(e) {
  47673. var t = this.levels;
  47674. if (1 < t.length) {
  47675. Et.setFromMatrixPosition(e.matrixWorld),
  47676. _t.setFromMatrixPosition(this.matrixWorld);
  47677. var i = Et.distanceTo(_t);
  47678. t[0].object.visible = !0;
  47679. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47680. t[n - 1].object.visible = !1,
  47681. t[n].object.visible = !0;
  47682. for (; n < r; n++)
  47683. t[n].object.visible = !1
  47684. }
  47685. }
  47686. ),
  47687. Ci.LOD.prototype.copy = function(e) {
  47688. Ci.Object3D.prototype.copy.call(this, e, !1);
  47689. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47690. var r = t[i];
  47691. this.addLevel(r.object.clone(), r.distance)
  47692. }
  47693. return this
  47694. }
  47695. ,
  47696. Ci.LOD.prototype.toJSON = function(e) {
  47697. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47698. t.object.levels = [];
  47699. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47700. var o = i[n];
  47701. t.object.levels.push({
  47702. object: o.object.uuid,
  47703. distance: o.distance
  47704. })
  47705. }
  47706. return t
  47707. }
  47708. ,
  47709. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47710. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47711. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47712. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47713. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47714. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47715. function(e) {
  47716. Ci.Object3D.call(this),
  47717. this.type = "Sprite",
  47718. this.geometry = It,
  47719. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47720. }
  47721. ),
  47722. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47723. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47724. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47725. function(e, t) {
  47726. vt.setFromMatrixPosition(this.matrixWorld);
  47727. var i = e.ray.distanceSqToPoint(vt);
  47728. this.scale.x * this.scale.y < i || t.push({
  47729. distance: Math.sqrt(i),
  47730. point: this.position,
  47731. face: null,
  47732. object: this
  47733. })
  47734. }
  47735. ),
  47736. Ci.Sprite.prototype.clone = function() {
  47737. return new this.constructor(this.material).copy(this)
  47738. }
  47739. ,
  47740. Ci.Particle = Ci.Sprite,
  47741. Ci.LensFlare = function(e, t, i, n, r) {
  47742. Ci.Object3D.call(this),
  47743. this.lensFlares = [],
  47744. this.positionScreen = new Ci.Vector3,
  47745. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47746. }
  47747. ,
  47748. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47749. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47750. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47751. void 0 === t && (t = -1),
  47752. void 0 === i && (i = 0),
  47753. void 0 === o && (o = 1),
  47754. void 0 === r && (r = new Ci.Color(16777215)),
  47755. void 0 === n && (n = Ci.NormalBlending),
  47756. i = Math.min(i, Math.max(0, i)),
  47757. this.lensFlares.push({
  47758. texture: e,
  47759. size: t,
  47760. distance: i,
  47761. x: 0,
  47762. y: 0,
  47763. z: 0,
  47764. scale: 1,
  47765. rotation: 0,
  47766. opacity: o,
  47767. color: r,
  47768. blending: n
  47769. })
  47770. }
  47771. ,
  47772. Ci.LensFlare.prototype.updateLensFlares = function() {
  47773. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47774. for (e = 0; e < i; e++)
  47775. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47776. t.y = this.positionScreen.y + r * t.distance,
  47777. t.wantedRotation = t.x * Math.PI * .25,
  47778. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47779. }
  47780. ,
  47781. Ci.LensFlare.prototype.copy = function(e) {
  47782. Ci.Object3D.prototype.copy.call(this, e),
  47783. this.positionScreen.copy(e.positionScreen),
  47784. this.customUpdateCallback = e.customUpdateCallback;
  47785. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47786. this.lensFlares.push(e.lensFlares[t]);
  47787. return this
  47788. }
  47789. ,
  47790. Ci.Scene = function() {
  47791. Ci.Object3D.call(this),
  47792. this.type = "Scene",
  47793. this.fog = null,
  47794. this.overrideMaterial = null,
  47795. this.autoUpdate = !0
  47796. }
  47797. ,
  47798. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47799. Ci.Scene.prototype.constructor = Ci.Scene,
  47800. Ci.Scene.prototype.copy = function(e, t) {
  47801. return Ci.Object3D.prototype.copy.call(this, e, t),
  47802. null !== e.fog && (this.fog = e.fog.clone()),
  47803. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47804. this.autoUpdate = e.autoUpdate,
  47805. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47806. this
  47807. }
  47808. ,
  47809. Ci.Fog = function(e, t, i) {
  47810. this.name = "",
  47811. this.color = new Ci.Color(e),
  47812. this.near = void 0 !== t ? t : 1,
  47813. this.far = void 0 !== i ? i : 1e3
  47814. }
  47815. ,
  47816. Ci.Fog.prototype.clone = function() {
  47817. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47818. }
  47819. ,
  47820. Ci.FogExp2 = function(e, t) {
  47821. this.name = "",
  47822. this.color = new Ci.Color(e),
  47823. this.density = void 0 !== t ? t : 25e-5
  47824. }
  47825. ,
  47826. Ci.FogExp2.prototype.clone = function() {
  47827. return new Ci.FogExp2(this.color.getHex(),this.density)
  47828. }
  47829. ,
  47830. Ci.ShaderChunk = {},
  47831. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47832. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47833. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47834. 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",
  47835. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47836. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47837. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47838. 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",
  47839. 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",
  47840. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47841. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47842. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47843. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47844. 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",
  47845. 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",
  47846. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47847. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47848. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47849. 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",
  47850. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47851. 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",
  47852. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47853. 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",
  47854. 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",
  47855. 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",
  47856. 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",
  47857. 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",
  47858. 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",
  47859. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47860. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47861. 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",
  47862. 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",
  47863. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47864. 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",
  47865. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47866. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47867. 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",
  47868. 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",
  47869. 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",
  47870. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47871. 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",
  47872. 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",
  47873. 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",
  47874. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47875. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47876. 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",
  47877. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47878. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47879. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47880. 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",
  47881. 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",
  47882. 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",
  47883. 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",
  47884. 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",
  47885. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47886. 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",
  47887. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47888. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47889. 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",
  47890. 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",
  47891. 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",
  47892. 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",
  47893. 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",
  47894. 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",
  47895. 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",
  47896. 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",
  47897. 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",
  47898. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47899. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47900. 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",
  47901. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47902. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47903. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47904. 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",
  47905. 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",
  47906. 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",
  47907. 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",
  47908. Ci.UniformsUtils = {
  47909. merge: function(e) {
  47910. for (var t = {}, i = 0; i < e.length; i++) {
  47911. var n = this.clone(e[i]);
  47912. for (var r in n)
  47913. t[r] = n[r]
  47914. }
  47915. return t
  47916. },
  47917. clone: function(e) {
  47918. var t = {};
  47919. for (var i in e)
  47920. for (var n in t[i] = {},
  47921. e[i]) {
  47922. var r = e[i][n];
  47923. 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
  47924. }
  47925. return t
  47926. }
  47927. },
  47928. Ci.UniformsLib = {
  47929. common: {
  47930. diffuse: {
  47931. type: "c",
  47932. value: new Ci.Color(15658734)
  47933. },
  47934. opacity: {
  47935. type: "f",
  47936. value: 1
  47937. },
  47938. map: {
  47939. type: "t",
  47940. value: null
  47941. },
  47942. offsetRepeat: {
  47943. type: "v4",
  47944. value: new Ci.Vector4(0,0,1,1)
  47945. },
  47946. specularMap: {
  47947. type: "t",
  47948. value: null
  47949. },
  47950. alphaMap: {
  47951. type: "t",
  47952. value: null
  47953. },
  47954. envMap: {
  47955. type: "t",
  47956. value: null
  47957. },
  47958. flipEnvMap: {
  47959. type: "f",
  47960. value: -1
  47961. },
  47962. reflectivity: {
  47963. type: "f",
  47964. value: 1
  47965. },
  47966. refractionRatio: {
  47967. type: "f",
  47968. value: .98
  47969. }
  47970. },
  47971. aomap: {
  47972. aoMap: {
  47973. type: "t",
  47974. value: null
  47975. },
  47976. aoMapIntensity: {
  47977. type: "f",
  47978. value: 1
  47979. }
  47980. },
  47981. lightmap: {
  47982. lightMap: {
  47983. type: "t",
  47984. value: null
  47985. },
  47986. lightMapIntensity: {
  47987. type: "f",
  47988. value: 1
  47989. }
  47990. },
  47991. emissivemap: {
  47992. emissiveMap: {
  47993. type: "t",
  47994. value: null
  47995. }
  47996. },
  47997. bumpmap: {
  47998. bumpMap: {
  47999. type: "t",
  48000. value: null
  48001. },
  48002. bumpScale: {
  48003. type: "f",
  48004. value: 1
  48005. }
  48006. },
  48007. normalmap: {
  48008. normalMap: {
  48009. type: "t",
  48010. value: null
  48011. },
  48012. normalScale: {
  48013. type: "v2",
  48014. value: new Ci.Vector2(1,1)
  48015. }
  48016. },
  48017. displacementmap: {
  48018. displacementMap: {
  48019. type: "t",
  48020. value: null
  48021. },
  48022. displacementScale: {
  48023. type: "f",
  48024. value: 1
  48025. },
  48026. displacementBias: {
  48027. type: "f",
  48028. value: 0
  48029. }
  48030. },
  48031. roughnessmap: {
  48032. roughnessMap: {
  48033. type: "t",
  48034. value: null
  48035. }
  48036. },
  48037. metalnessmap: {
  48038. metalnessMap: {
  48039. type: "t",
  48040. value: null
  48041. }
  48042. },
  48043. fog: {
  48044. fogDensity: {
  48045. type: "f",
  48046. value: 25e-5
  48047. },
  48048. fogNear: {
  48049. type: "f",
  48050. value: 1
  48051. },
  48052. fogFar: {
  48053. type: "f",
  48054. value: 2e3
  48055. },
  48056. fogColor: {
  48057. type: "c",
  48058. value: new Ci.Color(16777215)
  48059. }
  48060. },
  48061. lights: {
  48062. ambientLightColor: {
  48063. type: "fv",
  48064. value: []
  48065. },
  48066. directionalLights: {
  48067. type: "sa",
  48068. value: [],
  48069. properties: {
  48070. direction: {
  48071. type: "v3"
  48072. },
  48073. color: {
  48074. type: "c"
  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. directionalShadowMap: {
  48091. type: "tv",
  48092. value: []
  48093. },
  48094. directionalShadowMatrix: {
  48095. type: "m4v",
  48096. value: []
  48097. },
  48098. spotLights: {
  48099. type: "sa",
  48100. value: [],
  48101. properties: {
  48102. color: {
  48103. type: "c"
  48104. },
  48105. position: {
  48106. type: "v3"
  48107. },
  48108. direction: {
  48109. type: "v3"
  48110. },
  48111. distance: {
  48112. type: "f"
  48113. },
  48114. coneCos: {
  48115. type: "f"
  48116. },
  48117. penumbraCos: {
  48118. type: "f"
  48119. },
  48120. decay: {
  48121. type: "f"
  48122. },
  48123. shadow: {
  48124. type: "i"
  48125. },
  48126. shadowBias: {
  48127. type: "f"
  48128. },
  48129. shadowRadius: {
  48130. type: "f"
  48131. },
  48132. shadowMapSize: {
  48133. type: "v2"
  48134. }
  48135. }
  48136. },
  48137. spotShadowMap: {
  48138. type: "tv",
  48139. value: []
  48140. },
  48141. spotShadowMatrix: {
  48142. type: "m4v",
  48143. value: []
  48144. },
  48145. pointLights: {
  48146. type: "sa",
  48147. value: [],
  48148. properties: {
  48149. color: {
  48150. type: "c"
  48151. },
  48152. position: {
  48153. type: "v3"
  48154. },
  48155. decay: {
  48156. type: "f"
  48157. },
  48158. distance: {
  48159. type: "f"
  48160. },
  48161. shadow: {
  48162. type: "i"
  48163. },
  48164. shadowBias: {
  48165. type: "f"
  48166. },
  48167. shadowRadius: {
  48168. type: "f"
  48169. },
  48170. shadowMapSize: {
  48171. type: "v2"
  48172. }
  48173. }
  48174. },
  48175. pointShadowMap: {
  48176. type: "tv",
  48177. value: []
  48178. },
  48179. pointShadowMatrix: {
  48180. type: "m4v",
  48181. value: []
  48182. },
  48183. hemisphereLights: {
  48184. type: "sa",
  48185. value: [],
  48186. properties: {
  48187. direction: {
  48188. type: "v3"
  48189. },
  48190. skyColor: {
  48191. type: "c"
  48192. },
  48193. groundColor: {
  48194. type: "c"
  48195. }
  48196. }
  48197. }
  48198. },
  48199. points: {
  48200. diffuse: {
  48201. type: "c",
  48202. value: new Ci.Color(15658734)
  48203. },
  48204. opacity: {
  48205. type: "f",
  48206. value: 1
  48207. },
  48208. size: {
  48209. type: "f",
  48210. value: 1
  48211. },
  48212. scale: {
  48213. type: "f",
  48214. value: 1
  48215. },
  48216. map: {
  48217. type: "t",
  48218. value: null
  48219. },
  48220. offsetRepeat: {
  48221. type: "v4",
  48222. value: new Ci.Vector4(0,0,1,1)
  48223. }
  48224. }
  48225. },
  48226. 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",
  48227. 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",
  48228. 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",
  48229. 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",
  48230. 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",
  48231. 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",
  48232. 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",
  48233. 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",
  48234. 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",
  48235. 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",
  48236. 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",
  48237. 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",
  48238. 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",
  48239. 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",
  48240. 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",
  48241. 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",
  48242. 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",
  48243. 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",
  48244. 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",
  48245. 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",
  48246. 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",
  48247. 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",
  48248. 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",
  48249. 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",
  48250. Ci.ShaderLib = {
  48251. basic: {
  48252. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48253. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48254. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48255. },
  48256. lambert: {
  48257. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48258. emissive: {
  48259. type: "c",
  48260. value: new Ci.Color(0)
  48261. }
  48262. }]),
  48263. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48264. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48265. },
  48266. phong: {
  48267. 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, {
  48268. emissive: {
  48269. type: "c",
  48270. value: new Ci.Color(0)
  48271. },
  48272. specular: {
  48273. type: "c",
  48274. value: new Ci.Color(1118481)
  48275. },
  48276. shininess: {
  48277. type: "f",
  48278. value: 30
  48279. }
  48280. }]),
  48281. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48282. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48283. },
  48284. standard: {
  48285. 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, {
  48286. emissive: {
  48287. type: "c",
  48288. value: new Ci.Color(0)
  48289. },
  48290. roughness: {
  48291. type: "f",
  48292. value: .5
  48293. },
  48294. metalness: {
  48295. type: "f",
  48296. value: 0
  48297. },
  48298. envMapIntensity: {
  48299. type: "f",
  48300. value: 1
  48301. }
  48302. }]),
  48303. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48304. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48305. },
  48306. points: {
  48307. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48308. vertexShader: Ci.ShaderChunk.points_vert,
  48309. fragmentShader: Ci.ShaderChunk.points_frag
  48310. },
  48311. dashed: {
  48312. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48313. scale: {
  48314. type: "f",
  48315. value: 1
  48316. },
  48317. dashSize: {
  48318. type: "f",
  48319. value: 1
  48320. },
  48321. totalSize: {
  48322. type: "f",
  48323. value: 2
  48324. }
  48325. }]),
  48326. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48327. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48328. },
  48329. depth: {
  48330. uniforms: {
  48331. mNear: {
  48332. type: "f",
  48333. value: 1
  48334. },
  48335. mFar: {
  48336. type: "f",
  48337. value: 2e3
  48338. },
  48339. opacity: {
  48340. type: "f",
  48341. value: 1
  48342. }
  48343. },
  48344. vertexShader: Ci.ShaderChunk.depth_vert,
  48345. fragmentShader: Ci.ShaderChunk.depth_frag
  48346. },
  48347. normal: {
  48348. uniforms: {
  48349. opacity: {
  48350. type: "f",
  48351. value: 1
  48352. }
  48353. },
  48354. vertexShader: Ci.ShaderChunk.normal_vert,
  48355. fragmentShader: Ci.ShaderChunk.normal_frag
  48356. },
  48357. cube: {
  48358. uniforms: {
  48359. tCube: {
  48360. type: "t",
  48361. value: null
  48362. },
  48363. tFlip: {
  48364. type: "f",
  48365. value: -1
  48366. }
  48367. },
  48368. vertexShader: Ci.ShaderChunk.cube_vert,
  48369. fragmentShader: Ci.ShaderChunk.cube_frag
  48370. },
  48371. equirect: {
  48372. uniforms: {
  48373. tEquirect: {
  48374. type: "t",
  48375. value: null
  48376. },
  48377. tFlip: {
  48378. type: "f",
  48379. value: -1
  48380. }
  48381. },
  48382. vertexShader: Ci.ShaderChunk.equirect_vert,
  48383. fragmentShader: Ci.ShaderChunk.equirect_frag
  48384. },
  48385. depthRGBA: {
  48386. uniforms: {},
  48387. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48388. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48389. },
  48390. distanceRGBA: {
  48391. uniforms: {
  48392. lightPos: {
  48393. type: "v3",
  48394. value: new Ci.Vector3(0,0,0)
  48395. }
  48396. },
  48397. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48398. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48399. }
  48400. },
  48401. Ci.WebGLRenderer = function(e) {
  48402. function S() {
  48403. return null === Q ? he : 1
  48404. }
  48405. function i(e, t, i, n) {
  48406. !0 === V && (e *= n,
  48407. t *= n,
  48408. i *= n),
  48409. _e.clearColor(e, t, i, n)
  48410. }
  48411. function t() {
  48412. _e.init(),
  48413. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48414. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48415. i(ae.r, ae.g, ae.b, se)
  48416. }
  48417. function n() {
  48418. te = K = null,
  48419. ee = "",
  48420. $ = -1,
  48421. _e.reset()
  48422. }
  48423. function r(e) {
  48424. e.preventDefault(),
  48425. n(),
  48426. t(),
  48427. be.clear()
  48428. }
  48429. function f(e) {
  48430. var t = e.target;
  48431. t.removeEventListener("dispose", f),
  48432. function(e) {
  48433. var t = be.get(e);
  48434. if (e.image && t.__image__webglTextureCube)
  48435. X.deleteTexture(t.__image__webglTextureCube);
  48436. else {
  48437. if (void 0 === t.__webglInit)
  48438. return;
  48439. X.deleteTexture(t.__webglTexture)
  48440. }
  48441. be.delete(e)
  48442. }(t),
  48443. ye.textures--
  48444. }
  48445. function a(e) {
  48446. var t = e.target;
  48447. t.removeEventListener("dispose", a),
  48448. function(e) {
  48449. var t = be.get(e)
  48450. , i = be.get(e.texture);
  48451. if (e && void 0 !== i.__webglTexture) {
  48452. if (X.deleteTexture(i.__webglTexture),
  48453. e instanceof Ci.WebGLRenderTargetCube)
  48454. for (var n = 0; n < 6; n++)
  48455. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48456. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48457. else
  48458. X.deleteFramebuffer(t.__webglFramebuffer),
  48459. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48460. be.delete(e.texture),
  48461. be.delete(e)
  48462. }
  48463. }(t),
  48464. ye.textures--
  48465. }
  48466. function v(e) {
  48467. var t = e.target;
  48468. t.removeEventListener("dispose", v),
  48469. function(e) {
  48470. y(e),
  48471. be.delete(e)
  48472. }(t)
  48473. }
  48474. function y(e) {
  48475. var t = be.get(e).program;
  48476. (e.program = void 0) !== t && Te.releaseProgram(t)
  48477. }
  48478. function M(e, t) {
  48479. return Math.abs(t[0]) - Math.abs(e[0])
  48480. }
  48481. function s(e, t) {
  48482. 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
  48483. }
  48484. function l(e, t) {
  48485. 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
  48486. }
  48487. function d(e, t, i, n, r) {
  48488. var o, a;
  48489. a = i.transparent ? (o = G,
  48490. ++W) : (o = H,
  48491. ++z);
  48492. var s = o[a];
  48493. void 0 !== s ? (s.id = e.id,
  48494. s.object = e,
  48495. s.geometry = t,
  48496. s.material = i,
  48497. s.z = me.z,
  48498. s.group = r) : (s = {
  48499. id: e.id,
  48500. object: e,
  48501. geometry: t,
  48502. material: i,
  48503. z: me.z,
  48504. group: r
  48505. },
  48506. o.push(s))
  48507. }
  48508. function c(e, t, i, n) {
  48509. for (var r = 0, o = e.length; r < o; r++) {
  48510. var a = e[r]
  48511. , s = a.object
  48512. , l = a.geometry
  48513. , c = void 0 === n ? a.material : n
  48514. , h = a.group;
  48515. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48516. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48517. s instanceof Ci.ImmediateRenderObject) {
  48518. R(c);
  48519. var u = P(t, i, c, s);
  48520. ee = "",
  48521. s.render(function(e) {
  48522. Z.renderBufferImmediate(e, u, c)
  48523. })
  48524. } else
  48525. Z.renderBufferDirect(t, i, l, c, s, h)
  48526. }
  48527. }
  48528. function R(e) {
  48529. (function(e) {
  48530. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48531. _e.setFlipSided(e.side === Ci.BackSide)
  48532. }
  48533. )(e),
  48534. !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),
  48535. _e.setDepthFunc(e.depthFunc),
  48536. _e.setDepthTest(e.depthTest),
  48537. _e.setDepthWrite(e.depthWrite),
  48538. _e.setColorWrite(e.colorWrite),
  48539. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48540. }
  48541. function P(e, t, i, n) {
  48542. oe = 0;
  48543. var r = be.get(i);
  48544. void 0 === r.program && (i.needsUpdate = !0),
  48545. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48546. i.needsUpdate && (function(e, t, i) {
  48547. var n = be.get(e)
  48548. , r = Te.getParameters(e, ve, t, i)
  48549. , o = Te.getProgramCode(e, r)
  48550. , a = n.program
  48551. , s = !0;
  48552. if (void 0 === a)
  48553. e.addEventListener("dispose", v);
  48554. else if (a.code !== o)
  48555. y(e);
  48556. else {
  48557. if (void 0 !== r.shaderID)
  48558. return;
  48559. s = !1
  48560. }
  48561. if (s) {
  48562. if (r.shaderID) {
  48563. var l = Ci.ShaderLib[r.shaderID];
  48564. n.__webglShader = {
  48565. name: e.type,
  48566. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48567. vertexShader: l.vertexShader,
  48568. fragmentShader: l.fragmentShader
  48569. }
  48570. } else
  48571. n.__webglShader = {
  48572. name: e.type,
  48573. uniforms: e.uniforms,
  48574. vertexShader: e.vertexShader,
  48575. fragmentShader: e.fragmentShader
  48576. };
  48577. e.__webglShader = n.__webglShader,
  48578. a = Te.acquireProgram(e, r, o),
  48579. n.program = a,
  48580. e.program = a
  48581. }
  48582. var c = a.getAttributes();
  48583. if (e.morphTargets)
  48584. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48585. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48586. if (e.morphNormals)
  48587. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48588. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48589. n.uniformsList = [];
  48590. var u = n.__webglShader.uniforms
  48591. , d = n.program.getUniforms();
  48592. for (var p in u) {
  48593. var f = d[p];
  48594. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48595. }
  48596. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48597. u.ambientLightColor.value = ve.ambient,
  48598. u.directionalLights.value = ve.directional,
  48599. u.spotLights.value = ve.spot,
  48600. u.pointLights.value = ve.point,
  48601. u.hemisphereLights.value = ve.hemi,
  48602. u.directionalShadowMap.value = ve.directionalShadowMap,
  48603. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48604. u.spotShadowMap.value = ve.spotShadowMap,
  48605. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48606. u.pointShadowMap.value = ve.pointShadowMap,
  48607. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48608. n.hasDynamicUniforms = !1;
  48609. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48610. if (!0 === n.uniformsList[g][0].dynamic) {
  48611. n.hasDynamicUniforms = !0;
  48612. break
  48613. }
  48614. }
  48615. }(i, t, n),
  48616. i.needsUpdate = !1);
  48617. var o = !1
  48618. , a = !1
  48619. , s = !1
  48620. , l = r.program
  48621. , c = l.getUniforms()
  48622. , h = r.__webglShader.uniforms;
  48623. if (l.id !== K && (X.useProgram(l.program),
  48624. K = l.id,
  48625. s = a = o = !0),
  48626. i.id !== $ && ($ = i.id,
  48627. a = !0),
  48628. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48629. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48630. e !== te && (te = e,
  48631. s = a = !0),
  48632. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48633. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48634. (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),
  48635. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48636. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48637. i.skinning)
  48638. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48639. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48640. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48641. if (void 0 !== c.boneTexture) {
  48642. var u = A();
  48643. X.uniform1i(c.boneTexture, u),
  48644. Z.setTexture(n.skeleton.boneTexture, u)
  48645. }
  48646. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48647. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48648. } else
  48649. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48650. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48651. e.ambientLightColor.needsUpdate = t,
  48652. e.directionalLights.needsUpdate = t,
  48653. e.pointLights.needsUpdate = t,
  48654. e.spotLights.needsUpdate = t,
  48655. e.hemisphereLights.needsUpdate = t
  48656. }(h, s),
  48657. t && i.fog && function(e, t) {
  48658. e.fogColor.value = t.color,
  48659. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48660. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48661. }(h, t),
  48662. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48663. var i;
  48664. if (e.opacity.value = t.opacity,
  48665. e.diffuse.value = t.color,
  48666. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48667. e.map.value = t.map,
  48668. e.specularMap.value = t.specularMap,
  48669. e.alphaMap.value = t.alphaMap,
  48670. t.aoMap && (e.aoMap.value = t.aoMap,
  48671. e.aoMapIntensity.value = t.aoMapIntensity),
  48672. 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),
  48673. void 0 !== i) {
  48674. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48675. var n = i.offset
  48676. , r = i.repeat;
  48677. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48678. }
  48679. e.envMap.value = t.envMap,
  48680. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48681. e.reflectivity.value = t.reflectivity,
  48682. e.refractionRatio.value = t.refractionRatio
  48683. }(h, i),
  48684. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48685. function(e, t) {
  48686. e.dashSize.value = t.dashSize,
  48687. e.totalSize.value = t.dashSize + t.gapSize,
  48688. e.scale.value = t.scale
  48689. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48690. if (e.diffuse.value = t.color,
  48691. e.opacity.value = t.opacity,
  48692. e.size.value = t.size * he,
  48693. e.scale.value = O.clientHeight / 2,
  48694. e.map.value = t.map,
  48695. null !== t.map) {
  48696. var i = t.map.offset
  48697. , n = t.map.repeat;
  48698. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48699. }
  48700. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48701. t.lightMap && (e.lightMap.value = t.lightMap,
  48702. e.lightMapIntensity.value = t.lightMapIntensity),
  48703. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48704. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48705. e.specular.value = t.specular,
  48706. e.shininess.value = Math.max(t.shininess, 1e-4),
  48707. t.lightMap && (e.lightMap.value = t.lightMap,
  48708. e.lightMapIntensity.value = t.lightMapIntensity),
  48709. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48710. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48711. e.bumpScale.value = t.bumpScale),
  48712. t.normalMap && (e.normalMap.value = t.normalMap,
  48713. e.normalScale.value.copy(t.normalScale)),
  48714. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48715. e.displacementScale.value = t.displacementScale,
  48716. e.displacementBias.value = t.displacementBias)
  48717. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48718. e.roughness.value = t.roughness,
  48719. e.metalness.value = t.metalness,
  48720. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48721. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48722. t.lightMap && (e.lightMap.value = t.lightMap,
  48723. e.lightMapIntensity.value = t.lightMapIntensity),
  48724. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48725. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48726. e.bumpScale.value = t.bumpScale),
  48727. t.normalMap && (e.normalMap.value = t.normalMap,
  48728. e.normalScale.value.copy(t.normalScale)),
  48729. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48730. e.displacementScale.value = t.displacementScale,
  48731. e.displacementBias.value = t.displacementBias),
  48732. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48733. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48734. h.mFar.value = e.far,
  48735. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48736. g(r.uniformsList)),
  48737. function(e, t) {
  48738. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48739. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48740. }(c, n),
  48741. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48742. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48743. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48744. var a = e[r][0]
  48745. , s = a.onUpdateCallback;
  48746. void 0 !== s && (s.bind(a)(t, i),
  48747. n.push(e[r]))
  48748. }
  48749. g(n)
  48750. }(r.uniformsList, n, e),
  48751. l
  48752. }
  48753. function p(e, t) {
  48754. e.diffuse.value = t.color,
  48755. e.opacity.value = t.opacity
  48756. }
  48757. function A() {
  48758. var e = oe;
  48759. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48760. oe += 1,
  48761. e
  48762. }
  48763. function C(e, t, i, n) {
  48764. var r, o;
  48765. if ("1i" === t)
  48766. X.uniform1i(i, n);
  48767. else if ("1f" === t)
  48768. X.uniform1f(i, n);
  48769. else if ("2f" === t)
  48770. X.uniform2f(i, n[0], n[1]);
  48771. else if ("3f" === t)
  48772. X.uniform3f(i, n[0], n[1], n[2]);
  48773. else if ("4f" === t)
  48774. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48775. else if ("1iv" === t)
  48776. X.uniform1iv(i, n);
  48777. else if ("3iv" === t)
  48778. X.uniform3iv(i, n);
  48779. else if ("1fv" === t)
  48780. X.uniform1fv(i, n);
  48781. else if ("2fv" === t)
  48782. X.uniform2fv(i, n);
  48783. else if ("3fv" === t)
  48784. X.uniform3fv(i, n);
  48785. else if ("4fv" === t)
  48786. X.uniform4fv(i, n);
  48787. else if ("Matrix2fv" === t)
  48788. X.uniformMatrix2fv(i, !1, n);
  48789. else if ("Matrix3fv" === t)
  48790. X.uniformMatrix3fv(i, !1, n);
  48791. else if ("Matrix4fv" === t)
  48792. X.uniformMatrix4fv(i, !1, n);
  48793. else if ("i" === t)
  48794. X.uniform1i(i, n);
  48795. else if ("f" === t)
  48796. X.uniform1f(i, n);
  48797. else if ("v2" === t)
  48798. X.uniform2f(i, n.x, n.y);
  48799. else if ("v3" === t)
  48800. X.uniform3f(i, n.x, n.y, n.z);
  48801. else if ("v4" === t)
  48802. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48803. else if ("c" === t)
  48804. X.uniform3f(i, n.r, n.g, n.b);
  48805. else if ("s" === t) {
  48806. var a = e.properties;
  48807. for (var s in a) {
  48808. var l = a[s]
  48809. , c = i[s]
  48810. , h = n[s];
  48811. C(l, l.type, c, h)
  48812. }
  48813. } else if ("sa" === t) {
  48814. a = e.properties;
  48815. for (var u = 0, d = n.length; u < d; u++)
  48816. for (var s in a) {
  48817. l = a[s],
  48818. c = i[u][s],
  48819. h = n[u][s];
  48820. C(l, l.type, c, h)
  48821. }
  48822. } else if ("iv1" === t)
  48823. X.uniform1iv(i, n);
  48824. else if ("iv" === t)
  48825. X.uniform3iv(i, n);
  48826. else if ("fv1" === t)
  48827. X.uniform1fv(i, n);
  48828. else if ("fv" === t)
  48829. X.uniform3fv(i, n);
  48830. else if ("v2v" === t) {
  48831. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48832. u = 0;
  48833. for (var p = 0, f = n.length; u < f; u++,
  48834. p += 2)
  48835. e._array[p + 0] = n[u].x,
  48836. e._array[p + 1] = n[u].y;
  48837. X.uniform2fv(i, e._array)
  48838. } else if ("v3v" === t) {
  48839. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48840. u = 0;
  48841. var g = 0;
  48842. for (f = n.length; u < f; u++,
  48843. g += 3)
  48844. e._array[g + 0] = n[u].x,
  48845. e._array[g + 1] = n[u].y,
  48846. e._array[g + 2] = n[u].z;
  48847. X.uniform3fv(i, e._array)
  48848. } else if ("v4v" === t) {
  48849. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48850. u = 0;
  48851. var m = 0;
  48852. for (f = n.length; u < f; u++,
  48853. m += 4)
  48854. e._array[m + 0] = n[u].x,
  48855. e._array[m + 1] = n[u].y,
  48856. e._array[m + 2] = n[u].z,
  48857. e._array[m + 3] = n[u].w;
  48858. X.uniform4fv(i, e._array)
  48859. } else if ("m2" === t)
  48860. X.uniformMatrix2fv(i, !1, n.elements);
  48861. else if ("m3" === t)
  48862. X.uniformMatrix3fv(i, !1, n.elements);
  48863. else if ("m3v" === t) {
  48864. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48865. for (u = 0,
  48866. f = n.length; u < f; u++)
  48867. n[u].flattenToArrayOffset(e._array, 9 * u);
  48868. X.uniformMatrix3fv(i, !1, e._array)
  48869. } else if ("m4" === t)
  48870. X.uniformMatrix4fv(i, !1, n.elements);
  48871. else if ("m4v" === t) {
  48872. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48873. for (u = 0,
  48874. f = n.length; u < f; u++)
  48875. n[u].flattenToArrayOffset(e._array, 16 * u);
  48876. X.uniformMatrix4fv(i, !1, e._array)
  48877. } else if ("t" === t) {
  48878. if (r = n,
  48879. o = A(),
  48880. X.uniform1i(i, o),
  48881. !r)
  48882. return;
  48883. 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)
  48884. } else if ("tv" === t) {
  48885. void 0 === e._array && (e._array = []);
  48886. for (u = 0,
  48887. f = e.value.length; u < f; u++)
  48888. e._array[u] = A();
  48889. X.uniform1iv(i, e._array);
  48890. for (u = 0,
  48891. f = e.value.length; u < f; u++)
  48892. r = e.value[u],
  48893. o = e._array[u],
  48894. 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))
  48895. } else
  48896. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48897. }
  48898. function g(e) {
  48899. for (var t = 0, i = e.length; t < i; t++) {
  48900. var n = e[t][0];
  48901. if (!1 !== n.needsUpdate)
  48902. C(n, n.type, e[t][1], n.value)
  48903. }
  48904. }
  48905. function m(e, t, i) {
  48906. var n;
  48907. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48908. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48909. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48910. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48911. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48912. 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),
  48913. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48914. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48915. 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)),
  48916. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48917. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48918. return;
  48919. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48920. return;
  48921. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48922. be.get(t).__currentAnisotropy = t.anisotropy)
  48923. }
  48924. }
  48925. function o(e, t, i) {
  48926. void 0 === e.__webglInit && (e.__webglInit = !0,
  48927. t.addEventListener("dispose", f),
  48928. e.__webglTexture = X.createTexture(),
  48929. ye.textures++),
  48930. _e.activeTexture(X.TEXTURE0 + i),
  48931. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48932. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48933. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48934. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48935. var n = I(t.image, Ee.maxTextureSize);
  48936. !function(e) {
  48937. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48938. }(t) || !1 !== E(n) || (n = function(e) {
  48939. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48940. var t = document.createElement("canvas");
  48941. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48942. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48943. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48944. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48945. t
  48946. }
  48947. return e
  48948. }(n));
  48949. var r = E(n)
  48950. , o = x(t.format)
  48951. , a = x(t.type);
  48952. m(X.TEXTURE_2D, t, r);
  48953. var s, l = t.mipmaps;
  48954. if (t instanceof Ci.DataTexture)
  48955. if (0 < l.length && r) {
  48956. for (var c = 0, h = l.length; c < h; c++)
  48957. s = l[c],
  48958. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48959. t.generateMipmaps = !1
  48960. } else
  48961. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48962. else if (t instanceof Ci.CompressedTexture)
  48963. for (c = 0,
  48964. h = l.length; c < h; c++)
  48965. s = l[c],
  48966. 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);
  48967. else if (0 < l.length && r) {
  48968. for (c = 0,
  48969. h = l.length; c < h; c++)
  48970. s = l[c],
  48971. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48972. t.generateMipmaps = !1
  48973. } else
  48974. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48975. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48976. e.__version = t.version,
  48977. t.onUpdate && t.onUpdate(t)
  48978. }
  48979. function I(e, t) {
  48980. if (e.width > t || e.height > t) {
  48981. var i = t / Math.max(e.width, e.height)
  48982. , n = document.createElement("canvas");
  48983. return n.width = Math.floor(e.width * i),
  48984. n.height = Math.floor(e.height * i),
  48985. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48986. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48987. n
  48988. }
  48989. return e
  48990. }
  48991. function E(e) {
  48992. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48993. }
  48994. function _(e, t) {
  48995. var i = be.get(e);
  48996. if (6 === e.image.length)
  48997. if (0 < e.version && i.__version !== e.version) {
  48998. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48999. i.__image__webglTextureCube = X.createTexture(),
  49000. ye.textures++),
  49001. _e.activeTexture(X.TEXTURE0 + t),
  49002. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49003. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49004. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  49005. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  49006. var s = E(o[0])
  49007. , l = x(e.format)
  49008. , c = x(e.type);
  49009. m(X.TEXTURE_CUBE_MAP, e, s);
  49010. for (a = 0; a < 6; a++)
  49011. if (n)
  49012. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  49013. h = u[d],
  49014. 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);
  49015. else
  49016. 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]);
  49017. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49018. i.__version = e.version,
  49019. e.onUpdate && e.onUpdate(e)
  49020. } else
  49021. _e.activeTexture(X.TEXTURE0 + t),
  49022. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49023. }
  49024. function b(e, t) {
  49025. _e.activeTexture(X.TEXTURE0 + t),
  49026. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  49027. }
  49028. function h(e, t, i, n) {
  49029. var r = x(t.texture.format)
  49030. , o = x(t.texture.type);
  49031. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49032. X.bindFramebuffer(X.FRAMEBUFFER, e),
  49033. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  49034. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49035. }
  49036. function u(e, t) {
  49037. X.bindRenderbuffer(X.RENDERBUFFER, e),
  49038. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  49039. 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),
  49040. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  49041. X.bindRenderbuffer(X.RENDERBUFFER, null)
  49042. }
  49043. function w(e) {
  49044. var t = be.get(e)
  49045. , i = be.get(e.texture);
  49046. e.addEventListener("dispose", a),
  49047. i.__webglTexture = X.createTexture(),
  49048. ye.textures++;
  49049. var n = e instanceof Ci.WebGLRenderTargetCube
  49050. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49051. if (n) {
  49052. t.__webglFramebuffer = [];
  49053. for (var o = 0; o < 6; o++)
  49054. t.__webglFramebuffer[o] = X.createFramebuffer()
  49055. } else
  49056. t.__webglFramebuffer = X.createFramebuffer();
  49057. if (n) {
  49058. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49059. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49060. for (o = 0; o < 6; o++)
  49061. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49062. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49063. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49064. } else
  49065. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49066. m(X.TEXTURE_2D, e.texture, r),
  49067. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49068. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49069. _e.bindTexture(X.TEXTURE_2D, null);
  49070. e.depthBuffer && function(e) {
  49071. var t = be.get(e);
  49072. if (e instanceof Ci.WebGLRenderTargetCube) {
  49073. t.__webglDepthbuffer = [];
  49074. for (var i = 0; i < 6; i++)
  49075. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49076. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49077. u(t.__webglDepthbuffer[i], e)
  49078. } else
  49079. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49080. t.__webglDepthbuffer = X.createRenderbuffer(),
  49081. u(t.__webglDepthbuffer, e);
  49082. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49083. }(e)
  49084. }
  49085. function T(e) {
  49086. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49087. }
  49088. function x(e) {
  49089. var t;
  49090. if (e === Ci.RepeatWrapping)
  49091. return X.REPEAT;
  49092. if (e === Ci.ClampToEdgeWrapping)
  49093. return X.CLAMP_TO_EDGE;
  49094. if (e === Ci.MirroredRepeatWrapping)
  49095. return X.MIRRORED_REPEAT;
  49096. if (e === Ci.NearestFilter)
  49097. return X.NEAREST;
  49098. if (e === Ci.NearestMipMapNearestFilter)
  49099. return X.NEAREST_MIPMAP_NEAREST;
  49100. if (e === Ci.NearestMipMapLinearFilter)
  49101. return X.NEAREST_MIPMAP_LINEAR;
  49102. if (e === Ci.LinearFilter)
  49103. return X.LINEAR;
  49104. if (e === Ci.LinearMipMapNearestFilter)
  49105. return X.LINEAR_MIPMAP_NEAREST;
  49106. if (e === Ci.LinearMipMapLinearFilter)
  49107. return X.LINEAR_MIPMAP_LINEAR;
  49108. if (e === Ci.UnsignedByteType)
  49109. return X.UNSIGNED_BYTE;
  49110. if (e === Ci.UnsignedShort4444Type)
  49111. return X.UNSIGNED_SHORT_4_4_4_4;
  49112. if (e === Ci.UnsignedShort5551Type)
  49113. return X.UNSIGNED_SHORT_5_5_5_1;
  49114. if (e === Ci.UnsignedShort565Type)
  49115. return X.UNSIGNED_SHORT_5_6_5;
  49116. if (e === Ci.ByteType)
  49117. return X.BYTE;
  49118. if (e === Ci.ShortType)
  49119. return X.SHORT;
  49120. if (e === Ci.UnsignedShortType)
  49121. return X.UNSIGNED_SHORT;
  49122. if (e === Ci.IntType)
  49123. return X.INT;
  49124. if (e === Ci.UnsignedIntType)
  49125. return X.UNSIGNED_INT;
  49126. if (e === Ci.FloatType)
  49127. return X.FLOAT;
  49128. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49129. return t.HALF_FLOAT_OES;
  49130. if (e === Ci.AlphaFormat)
  49131. return X.ALPHA;
  49132. if (e === Ci.RGBFormat)
  49133. return X.RGB;
  49134. if (e === Ci.RGBAFormat)
  49135. return X.RGBA;
  49136. if (e === Ci.LuminanceFormat)
  49137. return X.LUMINANCE;
  49138. if (e === Ci.LuminanceAlphaFormat)
  49139. return X.LUMINANCE_ALPHA;
  49140. if (e === Ci.AddEquation)
  49141. return X.FUNC_ADD;
  49142. if (e === Ci.SubtractEquation)
  49143. return X.FUNC_SUBTRACT;
  49144. if (e === Ci.ReverseSubtractEquation)
  49145. return X.FUNC_REVERSE_SUBTRACT;
  49146. if (e === Ci.ZeroFactor)
  49147. return X.ZERO;
  49148. if (e === Ci.OneFactor)
  49149. return X.ONE;
  49150. if (e === Ci.SrcColorFactor)
  49151. return X.SRC_COLOR;
  49152. if (e === Ci.OneMinusSrcColorFactor)
  49153. return X.ONE_MINUS_SRC_COLOR;
  49154. if (e === Ci.SrcAlphaFactor)
  49155. return X.SRC_ALPHA;
  49156. if (e === Ci.OneMinusSrcAlphaFactor)
  49157. return X.ONE_MINUS_SRC_ALPHA;
  49158. if (e === Ci.DstAlphaFactor)
  49159. return X.DST_ALPHA;
  49160. if (e === Ci.OneMinusDstAlphaFactor)
  49161. return X.ONE_MINUS_DST_ALPHA;
  49162. if (e === Ci.DstColorFactor)
  49163. return X.DST_COLOR;
  49164. if (e === Ci.OneMinusDstColorFactor)
  49165. return X.ONE_MINUS_DST_COLOR;
  49166. if (e === Ci.SrcAlphaSaturateFactor)
  49167. return X.SRC_ALPHA_SATURATE;
  49168. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49169. if (e === Ci.RGB_S3TC_DXT1_Format)
  49170. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49171. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49172. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49173. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49174. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49175. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49176. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49177. }
  49178. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49179. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49180. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49181. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49182. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49183. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49184. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49185. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49186. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49187. }
  49188. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49189. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49190. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49191. if (e === Ci.MinEquation)
  49192. return t.MIN_EXT;
  49193. if (e === Ci.MaxEquation)
  49194. return t.MAX_EXT
  49195. }
  49196. return 0
  49197. }
  49198. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49199. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49200. , L = void 0 !== e.context ? e.context : null
  49201. , D = void 0 !== e.alpha && e.alpha
  49202. , N = void 0 === e.depth || e.depth
  49203. , F = void 0 === e.stencil || e.stencil
  49204. , B = void 0 !== e.antialias && e.antialias
  49205. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49206. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49207. , U = []
  49208. , H = []
  49209. , z = -1
  49210. , G = []
  49211. , W = -1
  49212. , j = new Float32Array(8)
  49213. , Y = []
  49214. , q = [];
  49215. this.domElement = O,
  49216. this.context = null,
  49217. this.autoClear = !0,
  49218. this.autoClearColor = !0,
  49219. this.autoClearDepth = !0,
  49220. this.autoClearStencil = !0,
  49221. this.sortObjects = !0,
  49222. this.gammaFactor = 2,
  49223. this.gammaInput = !1,
  49224. this.gammaOutput = !1,
  49225. this.physicallyCorrectLights = !1,
  49226. this.toneMapping = Ci.LinearToneMapping,
  49227. this.toneMappingExposure = 1,
  49228. this.toneMappingWhitePoint = 1,
  49229. this.maxMorphTargets = 8,
  49230. this.maxMorphNormals = 4,
  49231. this.autoScaleCubemaps = !0;
  49232. 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 = {
  49233. hash: "",
  49234. ambient: [0, 0, 0],
  49235. directional: [],
  49236. directionalShadowMap: [],
  49237. directionalShadowMatrix: [],
  49238. spot: [],
  49239. spotShadowMap: [],
  49240. spotShadowMatrix: [],
  49241. point: [],
  49242. pointShadowMap: [],
  49243. pointShadowMatrix: [],
  49244. hemi: [],
  49245. shadows: [],
  49246. shadowsPointLight: 0
  49247. }, ye = {
  49248. geometries: 0,
  49249. textures: 0
  49250. }, Ae = {
  49251. calls: 0,
  49252. vertices: 0,
  49253. faces: 0,
  49254. points: 0
  49255. };
  49256. this.info = {
  49257. render: Ae,
  49258. memory: ye,
  49259. programs: null
  49260. };
  49261. try {
  49262. var Ce = {
  49263. alpha: D,
  49264. depth: N,
  49265. stencil: F,
  49266. antialias: B,
  49267. premultipliedAlpha: V,
  49268. preserveDrawingBuffer: k
  49269. };
  49270. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49271. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49272. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49273. return {
  49274. rangeMin: 1,
  49275. rangeMax: 1,
  49276. precision: 1
  49277. }
  49278. }
  49279. ),
  49280. O.addEventListener("webglcontextlost", r, !1)
  49281. } catch (e) {
  49282. console.error("THREE.WebGLRenderer: " + e)
  49283. }
  49284. var Ie = new Ci.WebGLExtensions(X);
  49285. Ie.get("OES_texture_float"),
  49286. Ie.get("OES_texture_float_linear"),
  49287. Ie.get("OES_texture_half_float"),
  49288. Ie.get("OES_texture_half_float_linear"),
  49289. Ie.get("OES_standard_derivatives"),
  49290. Ie.get("ANGLE_instanced_arrays"),
  49291. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49292. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49293. , _e = new Ci.WebGLState(X,Ie,x)
  49294. , be = new Ci.WebGLProperties
  49295. , we = new Ci.WebGLObjects(X,be,this.info)
  49296. , Te = new Ci.WebGLPrograms(this,Ee)
  49297. , xe = new Ci.WebGLLights;
  49298. this.info.programs = Te.programs;
  49299. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49300. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49301. t(),
  49302. this.context = X,
  49303. this.capabilities = Ee,
  49304. this.extensions = Ie,
  49305. this.properties = be,
  49306. this.state = _e;
  49307. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49308. this.shadowMap = Re;
  49309. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49310. this.getContext = function() {
  49311. return X
  49312. }
  49313. ,
  49314. this.getContextAttributes = function() {
  49315. return X.getContextAttributes()
  49316. }
  49317. ,
  49318. this.forceContextLoss = function() {
  49319. Ie.get("WEBGL_lose_context").loseContext()
  49320. }
  49321. ,
  49322. this.getMaxAnisotropy = function() {
  49323. if (void 0 !== Pe)
  49324. return Pe;
  49325. var e = Ie.get("EXT_texture_filter_anisotropic");
  49326. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49327. }
  49328. ,
  49329. this.getPrecision = function() {
  49330. return Ee.precision
  49331. }
  49332. ,
  49333. this.getPixelRatio = function() {
  49334. return he
  49335. }
  49336. ,
  49337. this.setPixelRatio = function(e) {
  49338. void 0 !== e && (he = e,
  49339. this.setSize(pe.z, pe.w, !1))
  49340. }
  49341. ,
  49342. this.getSize = function() {
  49343. return {
  49344. width: le,
  49345. height: ce
  49346. }
  49347. }
  49348. ,
  49349. this.setSize = function(e, t, i, n) {
  49350. null != n && (he = n),
  49351. le = e,
  49352. ce = t,
  49353. O.width = e * he,
  49354. O.height = t * he,
  49355. !1 !== i && (O.style.width = e + "px",
  49356. O.style.height = t + "px"),
  49357. this.setViewport(0, 0, e, t)
  49358. }
  49359. ,
  49360. this.setViewport = function(e, t, i, n) {
  49361. _e.viewport(pe.set(e, t, i, n))
  49362. }
  49363. ,
  49364. this.setScissor = function(e, t, i, n) {
  49365. _e.scissor(ue.set(e, t, i, n))
  49366. }
  49367. ,
  49368. this.setScissorTest = function(e) {
  49369. _e.setScissorTest(de = e)
  49370. }
  49371. ,
  49372. this.getClearColor = function() {
  49373. return ae
  49374. }
  49375. ,
  49376. this.setClearColor = function(e, t) {
  49377. ae.set(e),
  49378. se = void 0 !== t ? t : 1,
  49379. i(ae.r, ae.g, ae.b, se)
  49380. }
  49381. ,
  49382. this.getClearAlpha = function() {
  49383. return se
  49384. }
  49385. ,
  49386. this.setClearAlpha = function(e) {
  49387. se = e,
  49388. i(ae.r, ae.g, ae.b, se)
  49389. }
  49390. ,
  49391. this.clear = function(e, t, i) {
  49392. var n = 0;
  49393. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49394. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49395. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49396. X.clear(n)
  49397. }
  49398. ,
  49399. this.clearColor = function() {
  49400. this.clear(!0, !1, !1)
  49401. }
  49402. ,
  49403. this.clearDepth = function() {
  49404. this.clear(!1, !0, !1)
  49405. }
  49406. ,
  49407. this.clearStencil = function() {
  49408. this.clear(!1, !1, !0)
  49409. }
  49410. ,
  49411. this.clearTarget = function(e, t, i, n) {
  49412. this.setRenderTarget(e),
  49413. this.clear(t, i, n)
  49414. }
  49415. ,
  49416. this.resetGLState = n,
  49417. this.dispose = function() {
  49418. O.removeEventListener("webglcontextlost", r, !1)
  49419. }
  49420. ,
  49421. this.renderBufferImmediate = function(e, t, i) {
  49422. _e.initAttributes();
  49423. var n = be.get(e);
  49424. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49425. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49426. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49427. e.hasColors && !n.color && (n.color = X.createBuffer());
  49428. var r = t.getAttributes();
  49429. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49430. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49431. _e.enableAttribute(r.position),
  49432. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49433. e.hasNormals) {
  49434. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49435. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49436. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49437. var s = e.normalArray
  49438. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49439. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49440. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49441. s[o + 0] = l,
  49442. s[o + 1] = c,
  49443. s[o + 2] = h,
  49444. s[o + 3] = l,
  49445. s[o + 4] = c,
  49446. s[o + 5] = h,
  49447. s[o + 6] = l,
  49448. s[o + 7] = c,
  49449. s[o + 8] = h
  49450. }
  49451. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49452. _e.enableAttribute(r.normal),
  49453. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49454. }
  49455. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49456. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49457. _e.enableAttribute(r.uv),
  49458. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49459. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49460. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49461. _e.enableAttribute(r.color),
  49462. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49463. _e.disableUnusedAttributes(),
  49464. X.drawArrays(X.TRIANGLES, 0, e.count),
  49465. e.count = 0
  49466. }
  49467. ,
  49468. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49469. R(n);
  49470. var a = P(e, t, n, r)
  49471. , s = !1
  49472. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49473. l !== ee && (ee = l,
  49474. s = !0);
  49475. var c = r.morphTargetInfluences;
  49476. if (void 0 !== c) {
  49477. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49478. var p = c[u];
  49479. h.push([p, u])
  49480. }
  49481. h.sort(M),
  49482. 8 < h.length && (h.length = 8);
  49483. var f = i.morphAttributes;
  49484. for (u = 0,
  49485. d = h.length; u < d; u++) {
  49486. p = h[u];
  49487. if (j[u] = p[0],
  49488. 0 !== p[0]) {
  49489. var g = p[1];
  49490. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49491. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49492. } else
  49493. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49494. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49495. }
  49496. var m = a.getUniforms();
  49497. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49498. s = !0
  49499. }
  49500. g = i.index;
  49501. var v, y = i.attributes.position;
  49502. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49503. null !== g ? (v = Me).setIndex(g) : v = Se,
  49504. s && (function(e, t, i, n) {
  49505. var r;
  49506. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49507. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49508. else {
  49509. void 0 === n && (n = 0),
  49510. _e.initAttributes();
  49511. var o = i.attributes
  49512. , a = t.getAttributes()
  49513. , s = e.defaultAttributeValues;
  49514. for (var l in a) {
  49515. var c = a[l];
  49516. if (0 <= c) {
  49517. var h = o[l];
  49518. if (void 0 !== h) {
  49519. var u = h.itemSize
  49520. , d = we.getAttributeBuffer(h);
  49521. if (h instanceof Ci.InterleavedBufferAttribute) {
  49522. var p = h.data
  49523. , f = p.stride
  49524. , g = h.offset;
  49525. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49526. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49527. X.bindBuffer(X.ARRAY_BUFFER, d),
  49528. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49529. } else
  49530. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49531. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49532. X.bindBuffer(X.ARRAY_BUFFER, d),
  49533. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49534. } else if (void 0 !== s) {
  49535. var m = s[l];
  49536. if (void 0 !== m)
  49537. switch (m.length) {
  49538. case 2:
  49539. X.vertexAttrib2fv(c, m);
  49540. break;
  49541. case 3:
  49542. X.vertexAttrib3fv(c, m);
  49543. break;
  49544. case 4:
  49545. X.vertexAttrib4fv(c, m);
  49546. break;
  49547. default:
  49548. X.vertexAttrib1fv(c, m)
  49549. }
  49550. }
  49551. }
  49552. }
  49553. _e.disableUnusedAttributes()
  49554. }
  49555. }(n, a, i),
  49556. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49557. var A = 1 / 0;
  49558. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49559. var C = i.drawRange.start
  49560. , I = i.drawRange.count
  49561. , E = null !== o ? o.start : 0
  49562. , _ = null !== o ? o.count : 1 / 0
  49563. , b = Math.max(0, C, E)
  49564. , w = Math.min(0 + A, C + I, E + _) - 1
  49565. , T = Math.max(0, w - b + 1);
  49566. if (r instanceof Ci.Mesh)
  49567. if (!0 === n.wireframe)
  49568. _e.setLineWidth(n.wireframeLinewidth * S()),
  49569. v.setMode(X.LINES);
  49570. else
  49571. switch (r.drawMode) {
  49572. case Ci.TrianglesDrawMode:
  49573. v.setMode(X.TRIANGLES);
  49574. break;
  49575. case Ci.TriangleStripDrawMode:
  49576. v.setMode(X.TRIANGLE_STRIP);
  49577. break;
  49578. case Ci.TriangleFanDrawMode:
  49579. v.setMode(X.TRIANGLE_FAN)
  49580. }
  49581. else if (r instanceof Ci.Line) {
  49582. var x = n.linewidth;
  49583. void 0 === x && (x = 1),
  49584. _e.setLineWidth(x * S()),
  49585. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49586. } else
  49587. r instanceof Ci.Points && v.setMode(X.POINTS);
  49588. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49589. }
  49590. ,
  49591. this.render = function(e, t, i, n) {
  49592. if (t instanceof Ci.Camera != 0) {
  49593. var r = e.fog;
  49594. if (ee = "",
  49595. $ = -1,
  49596. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49597. null === t.parent && t.updateMatrixWorld(),
  49598. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49599. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49600. fe.setFromMatrix(ge),
  49601. U.length = 0,
  49602. W = z = -1,
  49603. Y.length = 0,
  49604. q.length = 0,
  49605. function e(t, i) {
  49606. if (!1 !== t.visible) {
  49607. if (t.layers.test(i.layers))
  49608. if (t instanceof Ci.Light)
  49609. U.push(t);
  49610. else if (t instanceof Ci.Sprite)
  49611. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49612. else if (t instanceof Ci.LensFlare)
  49613. q.push(t);
  49614. else if (t instanceof Ci.ImmediateRenderObject)
  49615. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49616. me.applyProjection(ge)),
  49617. d(t, null, t.material, me.z, null);
  49618. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49619. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49620. var n = t.material;
  49621. if (!0 === n.visible) {
  49622. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49623. me.applyProjection(ge));
  49624. var r = we.update(t);
  49625. if (n instanceof Ci.MultiMaterial)
  49626. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49627. var c = o[s]
  49628. , h = a[c.materialIndex];
  49629. !0 === h.visible && d(t, r, h, me.z, c)
  49630. }
  49631. else
  49632. d(t, r, n, me.z, null)
  49633. }
  49634. }
  49635. var u = t.children;
  49636. for (s = 0,
  49637. l = u.length; s < l; s++)
  49638. e(u[s], i)
  49639. }
  49640. }(e, t),
  49641. H.length = z + 1,
  49642. G.length = W + 1,
  49643. !0 === Z.sortObjects && (H.sort(s),
  49644. G.sort(l)),
  49645. function(e, t) {
  49646. 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;
  49647. for (i = ve.shadowsPointLight = 0,
  49648. n = e.length; i < n; i++)
  49649. if (o = (r = e[i]).color,
  49650. a = r.intensity,
  49651. s = r.distance,
  49652. r instanceof Ci.AmbientLight)
  49653. l += o.r * a,
  49654. c += o.g * a,
  49655. h += o.b * a;
  49656. else if (r instanceof Ci.DirectionalLight) {
  49657. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49658. v.direction.setFromMatrixPosition(r.matrixWorld),
  49659. me.setFromMatrixPosition(r.target.matrixWorld),
  49660. v.direction.sub(me),
  49661. v.direction.transformDirection(u),
  49662. v.shadow = r.castShadow,
  49663. r.castShadow && (v.shadowBias = r.shadow.bias,
  49664. v.shadowRadius = r.shadow.radius,
  49665. v.shadowMapSize = r.shadow.mapSize,
  49666. ve.shadows[m++] = r),
  49667. ve.directionalShadowMap[d] = r.shadow.map,
  49668. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49669. ve.directional[d++] = v
  49670. } else if (r instanceof Ci.SpotLight) {
  49671. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49672. v.position.applyMatrix4(u),
  49673. v.color.copy(o).multiplyScalar(a),
  49674. v.distance = s,
  49675. v.direction.setFromMatrixPosition(r.matrixWorld),
  49676. me.setFromMatrixPosition(r.target.matrixWorld),
  49677. v.direction.sub(me),
  49678. v.direction.transformDirection(u),
  49679. v.coneCos = Math.cos(r.angle),
  49680. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49681. v.decay = 0 === r.distance ? 0 : r.decay,
  49682. v.shadow = r.castShadow,
  49683. r.castShadow && (v.shadowBias = r.shadow.bias,
  49684. v.shadowRadius = r.shadow.radius,
  49685. v.shadowMapSize = r.shadow.mapSize,
  49686. ve.shadows[m++] = r),
  49687. ve.spotShadowMap[f] = r.shadow.map,
  49688. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49689. ve.spot[f++] = v
  49690. } else if (r instanceof Ci.PointLight) {
  49691. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49692. v.position.applyMatrix4(u),
  49693. v.color.copy(r.color).multiplyScalar(r.intensity),
  49694. v.distance = r.distance,
  49695. v.decay = 0 === r.distance ? 0 : r.decay,
  49696. v.shadow = r.castShadow,
  49697. r.castShadow && (v.shadowBias = r.shadow.bias,
  49698. v.shadowRadius = r.shadow.radius,
  49699. v.shadowMapSize = r.shadow.mapSize,
  49700. ve.shadows[m++] = r),
  49701. ve.pointShadowMap[p] = r.shadow.map,
  49702. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49703. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49704. ve.pointShadowMatrix[p].identity().setPosition(me),
  49705. ve.point[p++] = v
  49706. } else if (r instanceof Ci.HemisphereLight) {
  49707. var v;
  49708. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49709. v.direction.transformDirection(u),
  49710. v.direction.normalize(),
  49711. v.skyColor.copy(r.color).multiplyScalar(a),
  49712. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49713. ve.hemi[g++] = v
  49714. }
  49715. ve.ambient[0] = l,
  49716. ve.ambient[1] = c,
  49717. ve.ambient[2] = h,
  49718. ve.directional.length = d,
  49719. ve.spot.length = f,
  49720. ve.point.length = p,
  49721. ve.hemi.length = g,
  49722. ve.shadows.length = m,
  49723. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49724. }(U, t),
  49725. Re.render(e, t),
  49726. Ae.calls = 0,
  49727. Ae.vertices = 0,
  49728. Ae.faces = 0,
  49729. void (Ae.points = 0) === i && (i = null),
  49730. this.setRenderTarget(i),
  49731. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49732. e.overrideMaterial) {
  49733. var o = e.overrideMaterial;
  49734. c(H, t, r, o),
  49735. c(G, t, r, o)
  49736. } else
  49737. _e.setBlending(Ci.NoBlending),
  49738. c(H, t, r),
  49739. c(G, t, r);
  49740. if (Oe.render(e, t),
  49741. Le.render(e, t, re),
  49742. i) {
  49743. var a = i.texture;
  49744. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49745. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49746. , i = be.get(e.texture).__webglTexture;
  49747. _e.bindTexture(t, i),
  49748. X.generateMipmap(t),
  49749. _e.bindTexture(t, null)
  49750. }(i)
  49751. }
  49752. _e.setDepthTest(!0),
  49753. _e.setDepthWrite(!0),
  49754. _e.setColorWrite(!0)
  49755. } else
  49756. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49757. }
  49758. ,
  49759. this.setFaceCulling = function(e, t) {
  49760. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49761. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49762. _e.enable(X.CULL_FACE))
  49763. }
  49764. ,
  49765. this.setTexture = function(e, t) {
  49766. var i = be.get(e);
  49767. if (0 < e.version && i.__version !== e.version) {
  49768. var n = e.image;
  49769. 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)
  49770. }
  49771. _e.activeTexture(X.TEXTURE0 + t),
  49772. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49773. }
  49774. ,
  49775. this.getCurrentRenderTarget = function() {
  49776. return Q
  49777. }
  49778. ,
  49779. this.setRenderTarget = function(e) {
  49780. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49781. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49782. if (e) {
  49783. var n = be.get(e);
  49784. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49785. ie.copy(e.scissor),
  49786. ne = e.scissorTest,
  49787. re.copy(e.viewport)
  49788. } else
  49789. t = null,
  49790. ie.copy(ue).multiplyScalar(he),
  49791. ne = de,
  49792. re.copy(pe).multiplyScalar(he);
  49793. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49794. J = t),
  49795. _e.scissor(ie),
  49796. _e.setScissorTest(ne),
  49797. _e.viewport(re),
  49798. i) {
  49799. var r = be.get(e.texture);
  49800. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49801. }
  49802. }
  49803. ,
  49804. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49805. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49806. var a = be.get(e).__webglFramebuffer;
  49807. if (a) {
  49808. var s = !1;
  49809. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49810. s = !0);
  49811. try {
  49812. var l = e.texture;
  49813. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49814. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49815. 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")))
  49816. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49817. 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.")
  49818. } finally {
  49819. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49820. }
  49821. }
  49822. } else
  49823. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49824. }
  49825. }
  49826. ,
  49827. Ci.WebGLRenderTarget = function(e, t, i) {
  49828. this.uuid = Ci.Math.generateUUID(),
  49829. this.width = e,
  49830. this.height = t,
  49831. this.scissor = new Ci.Vector4(0,0,e,t),
  49832. this.scissorTest = !1,
  49833. this.viewport = new Ci.Vector4(0,0,e,t),
  49834. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49835. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49836. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49837. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49838. }
  49839. ,
  49840. Ci.WebGLRenderTarget.prototype = {
  49841. constructor: Ci.WebGLRenderTarget,
  49842. setSize: function(e, t) {
  49843. this.width === e && this.height === t || (this.width = e,
  49844. this.height = t,
  49845. this.dispose()),
  49846. this.viewport.set(0, 0, e, t),
  49847. this.scissor.set(0, 0, e, t)
  49848. },
  49849. clone: function() {
  49850. return (new this.constructor).copy(this)
  49851. },
  49852. copy: function(e) {
  49853. return this.width = e.width,
  49854. this.height = e.height,
  49855. this.viewport.copy(e.viewport),
  49856. this.texture = e.texture.clone(),
  49857. this.depthBuffer = e.depthBuffer,
  49858. this.stencilBuffer = e.stencilBuffer,
  49859. this
  49860. },
  49861. dispose: function() {
  49862. this.dispatchEvent({
  49863. type: "dispose"
  49864. })
  49865. }
  49866. },
  49867. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49868. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49869. Ci.WebGLRenderTarget.call(this, e, t, i),
  49870. this.activeCubeFace = 0,
  49871. this.activeMipMapLevel = 0
  49872. }
  49873. ,
  49874. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49875. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49876. Ci.WebGLBufferRenderer = function(r, o, a) {
  49877. var s;
  49878. this.setMode = function(e) {
  49879. s = e
  49880. }
  49881. ,
  49882. this.render = function(e, t) {
  49883. r.drawArrays(s, e, t),
  49884. a.calls++,
  49885. a.vertices += t,
  49886. s === r.TRIANGLES && (a.faces += t / 3)
  49887. }
  49888. ,
  49889. this.renderInstances = function(e) {
  49890. var t = o.get("ANGLE_instanced_arrays");
  49891. if (null !== t) {
  49892. var i = e.attributes.position
  49893. , n = 0;
  49894. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49895. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49896. a.calls++,
  49897. a.vertices += n * e.maxInstancedCount,
  49898. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49899. } else
  49900. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49901. }
  49902. }
  49903. ,
  49904. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49905. var s, l, c;
  49906. this.setMode = function(e) {
  49907. s = e
  49908. }
  49909. ,
  49910. this.setIndex = function(e) {
  49911. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49912. 4) : (l = r.UNSIGNED_SHORT,
  49913. 2)
  49914. }
  49915. ,
  49916. this.render = function(e, t) {
  49917. r.drawElements(s, t, l, e * c),
  49918. a.calls++,
  49919. a.vertices += t,
  49920. s === r.TRIANGLES && (a.faces += t / 3)
  49921. }
  49922. ,
  49923. this.renderInstances = function(e, t, i) {
  49924. var n = o.get("ANGLE_instanced_arrays");
  49925. 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),
  49926. a.calls++,
  49927. a.vertices += i * e.maxInstancedCount,
  49928. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49929. }
  49930. }
  49931. ,
  49932. Ci.WebGLExtensions = function(i) {
  49933. var n = {};
  49934. this.get = function(e) {
  49935. if (void 0 !== n[e])
  49936. return n[e];
  49937. var t;
  49938. switch (e) {
  49939. case "EXT_texture_filter_anisotropic":
  49940. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49941. break;
  49942. case "WEBGL_compressed_texture_s3tc":
  49943. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49944. break;
  49945. case "WEBGL_compressed_texture_pvrtc":
  49946. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49947. break;
  49948. case "WEBGL_compressed_texture_etc1":
  49949. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49950. break;
  49951. default:
  49952. t = i.getExtension(e)
  49953. }
  49954. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49955. n[e] = t
  49956. }
  49957. }
  49958. ,
  49959. Ci.WebGLCapabilities = function(t, e, i) {
  49960. function n(e) {
  49961. if ("highp" === e) {
  49962. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49963. return "highp";
  49964. e = "mediump"
  49965. }
  49966. 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"
  49967. }
  49968. this.getMaxPrecision = n,
  49969. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49970. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49971. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49972. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49973. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49974. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49975. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49976. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49977. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49978. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49979. this.vertexTextures = 0 < this.maxVertexTextures,
  49980. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49981. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49982. var r = n(this.precision);
  49983. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49984. this.precision = r),
  49985. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49986. }
  49987. ,
  49988. Ci.WebGLGeometries = function(i, o, a) {
  49989. function s(e) {
  49990. var t = e.target
  49991. , i = c[t.id];
  49992. null !== i.index && l(i.index),
  49993. function(e) {
  49994. for (var t in e)
  49995. l(e[t])
  49996. }(i.attributes),
  49997. t.removeEventListener("dispose", s),
  49998. delete c[t.id];
  49999. var n = o.get(t);
  50000. n.wireframe && l(n.wireframe),
  50001. o.delete(t);
  50002. var r = o.get(i);
  50003. r.wireframe && l(r.wireframe),
  50004. o.delete(i),
  50005. a.memory.geometries--
  50006. }
  50007. function l(e) {
  50008. var t = function(e) {
  50009. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  50010. }(e);
  50011. void 0 !== t && (i.deleteBuffer(t),
  50012. function(e) {
  50013. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  50014. }(e))
  50015. }
  50016. var c = {};
  50017. this.get = function(e) {
  50018. var t, i = e.geometry;
  50019. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  50020. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  50021. t = i._bufferGeometry),
  50022. c[i.id] = t,
  50023. a.memory.geometries++,
  50024. t)
  50025. }
  50026. }
  50027. ,
  50028. Ci.WebGLLights = function() {
  50029. var i = {};
  50030. this.get = function(e) {
  50031. if (void 0 !== i[e.id])
  50032. return i[e.id];
  50033. var t;
  50034. switch (e.type) {
  50035. case "DirectionalLight":
  50036. t = {
  50037. direction: new Ci.Vector3,
  50038. color: new Ci.Color,
  50039. shadow: !1,
  50040. shadowBias: 0,
  50041. shadowRadius: 1,
  50042. shadowMapSize: new Ci.Vector2
  50043. };
  50044. break;
  50045. case "SpotLight":
  50046. t = {
  50047. position: new Ci.Vector3,
  50048. direction: new Ci.Vector3,
  50049. color: new Ci.Color,
  50050. distance: 0,
  50051. coneCos: 0,
  50052. penumbraCos: 0,
  50053. decay: 0,
  50054. shadow: !1,
  50055. shadowBias: 0,
  50056. shadowRadius: 1,
  50057. shadowMapSize: new Ci.Vector2
  50058. };
  50059. break;
  50060. case "PointLight":
  50061. t = {
  50062. position: new Ci.Vector3,
  50063. color: new Ci.Color,
  50064. distance: 0,
  50065. decay: 0,
  50066. shadow: !1,
  50067. shadowBias: 0,
  50068. shadowRadius: 1,
  50069. shadowMapSize: new Ci.Vector2
  50070. };
  50071. break;
  50072. case "HemisphereLight":
  50073. t = {
  50074. direction: new Ci.Vector3,
  50075. skyColor: new Ci.Color,
  50076. groundColor: new Ci.Color
  50077. }
  50078. }
  50079. return i[e.id] = t
  50080. }
  50081. }
  50082. ,
  50083. Ci.WebGLObjects = function(g, m, e) {
  50084. function v(e, t) {
  50085. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50086. , n = m.get(i);
  50087. void 0 === n.__webglBuffer ? function(e, t, i) {
  50088. e.__webglBuffer = g.createBuffer(),
  50089. g.bindBuffer(i, e.__webglBuffer);
  50090. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50091. g.bufferData(i, t.array, n),
  50092. e.version = t.version
  50093. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50094. g.bindBuffer(i, e.__webglBuffer),
  50095. !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)),
  50096. t.updateRange.count = 0),
  50097. e.version = t.version
  50098. }(n, i, t)
  50099. }
  50100. function y(e, t, i) {
  50101. if (i < t) {
  50102. var n = t;
  50103. t = i,
  50104. i = n
  50105. }
  50106. var r = e[t];
  50107. return void 0 === r ? (e[t] = [i],
  50108. !0) : -1 === r.indexOf(i) && (r.push(i),
  50109. !0)
  50110. }
  50111. var c = new Ci.WebGLGeometries(g,m,e);
  50112. this.getAttributeBuffer = function(e) {
  50113. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50114. }
  50115. ,
  50116. this.getWireframeAttribute = function(e) {
  50117. var t = m.get(e);
  50118. if (void 0 !== t.wireframe)
  50119. return t.wireframe;
  50120. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50121. if (null !== r)
  50122. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50123. var h = i[l + 0]
  50124. , u = i[l + 1]
  50125. , d = i[l + 2];
  50126. y(s, h, u) && n.push(h, u),
  50127. y(s, u, d) && n.push(u, d),
  50128. y(s, d, h) && n.push(d, h)
  50129. }
  50130. else
  50131. for (l = 0,
  50132. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50133. h = l + 0,
  50134. u = l + 1,
  50135. d = l + 2;
  50136. n.push(h, u, u, d, d, h)
  50137. }
  50138. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50139. , f = new Ci.BufferAttribute(new p(n),1);
  50140. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50141. t.wireframe = f
  50142. }
  50143. ,
  50144. this.update = function(e) {
  50145. var t = c.get(e);
  50146. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50147. var i = t.index
  50148. , n = t.attributes;
  50149. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50150. n)
  50151. v(n[r], g.ARRAY_BUFFER);
  50152. var o = t.morphAttributes;
  50153. for (var r in o)
  50154. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50155. v(a[s], g.ARRAY_BUFFER);
  50156. return t
  50157. }
  50158. }
  50159. ,
  50160. Ci.WebGLProgram = (Qt = 0,
  50161. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50162. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50163. ei = /^([\w\d_]+)\[0\]$/,
  50164. function(e, t, i, n) {
  50165. var r = e.context
  50166. , o = i.extensions
  50167. , a = i.defines
  50168. , s = i.__webglShader.vertexShader
  50169. , l = i.__webglShader.fragmentShader
  50170. , c = "SHADOWMAP_TYPE_BASIC";
  50171. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50172. var h = "ENVMAP_TYPE_CUBE"
  50173. , u = "ENVMAP_MODE_REFLECTION"
  50174. , d = "ENVMAP_BLENDING_MULTIPLY";
  50175. if (n.envMap) {
  50176. switch (i.envMap.mapping) {
  50177. case Ci.CubeReflectionMapping:
  50178. case Ci.CubeRefractionMapping:
  50179. h = "ENVMAP_TYPE_CUBE";
  50180. break;
  50181. case Ci.CubeUVReflectionMapping:
  50182. case Ci.CubeUVRefractionMapping:
  50183. h = "ENVMAP_TYPE_CUBE_UV";
  50184. break;
  50185. case Ci.EquirectangularReflectionMapping:
  50186. case Ci.EquirectangularRefractionMapping:
  50187. h = "ENVMAP_TYPE_EQUIREC";
  50188. break;
  50189. case Ci.SphericalReflectionMapping:
  50190. h = "ENVMAP_TYPE_SPHERE"
  50191. }
  50192. switch (i.envMap.mapping) {
  50193. case Ci.CubeRefractionMapping:
  50194. case Ci.EquirectangularRefractionMapping:
  50195. u = "ENVMAP_MODE_REFRACTION"
  50196. }
  50197. switch (i.combine) {
  50198. case Ci.MultiplyOperation:
  50199. d = "ENVMAP_BLENDING_MULTIPLY";
  50200. break;
  50201. case Ci.MixOperation:
  50202. d = "ENVMAP_BLENDING_MIX";
  50203. break;
  50204. case Ci.AddOperation:
  50205. d = "ENVMAP_BLENDING_ADD"
  50206. }
  50207. }
  50208. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50209. 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")
  50210. }(o, n, e.extensions), v = function(e) {
  50211. var t = [];
  50212. for (var i in e) {
  50213. var n = e[i];
  50214. !1 !== n && t.push("#define " + i + " " + n)
  50215. }
  50216. return t.join("\n")
  50217. }(a), y = r.createProgram();
  50218. 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"),
  50219. [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) {
  50220. var i;
  50221. switch (t) {
  50222. case Ci.LinearToneMapping:
  50223. i = "Linear";
  50224. break;
  50225. case Ci.ReinhardToneMapping:
  50226. i = "Reinhard";
  50227. break;
  50228. case Ci.Uncharted2ToneMapping:
  50229. i = "Uncharted2";
  50230. break;
  50231. case Ci.CineonToneMapping:
  50232. i = "OptimizedCineon";
  50233. break;
  50234. default:
  50235. throw new Error("unsupported toneMapping: " + t)
  50236. }
  50237. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50238. }("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) {
  50239. var i = Mi(t);
  50240. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50241. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50242. s = Oi(s = Li(s), n),
  50243. l = Oi(l = Li(l), n),
  50244. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50245. l = Di(l));
  50246. var A = p + s
  50247. , C = f + l
  50248. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50249. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50250. r.attachShader(y, I),
  50251. r.attachShader(y, E),
  50252. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50253. r.linkProgram(y);
  50254. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50255. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50256. 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),
  50257. M && (this.diagnostics = {
  50258. runnable: S,
  50259. material: i,
  50260. programLog: w,
  50261. vertexShader: {
  50262. log: T,
  50263. prefix: p
  50264. },
  50265. fragmentShader: {
  50266. log: x,
  50267. prefix: f
  50268. }
  50269. }),
  50270. r.deleteShader(I),
  50271. r.deleteShader(E),
  50272. this.getUniforms = function() {
  50273. return void 0 === _ && (_ = function(e, t) {
  50274. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50275. var o = e.getActiveUniform(t, r).name
  50276. , a = e.getUniformLocation(t, o)
  50277. , s = Jt.exec(o);
  50278. if (s) {
  50279. var l = s[1]
  50280. , c = s[2]
  50281. , h = i[l];
  50282. (h = h || (i[l] = {}))[c] = a
  50283. } else if (s = $t.exec(o)) {
  50284. var u = s[1]
  50285. , d = s[2]
  50286. , p = s[3]
  50287. , f = i[u]
  50288. , g = (f = f || (i[u] = []))[d];
  50289. (g = g || (f[d] = {}))[p] = a
  50290. } else
  50291. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50292. }
  50293. return i
  50294. }(r, y)),
  50295. _
  50296. }
  50297. ,
  50298. this.getAttributes = function() {
  50299. return void 0 === b && (b = function(e, t) {
  50300. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50301. var o = e.getActiveAttrib(t, r).name;
  50302. i[o] = e.getAttribLocation(t, o)
  50303. }
  50304. return i
  50305. }(r, y)),
  50306. b
  50307. }
  50308. ,
  50309. this.destroy = function() {
  50310. r.deleteProgram(y),
  50311. this.program = void 0
  50312. }
  50313. ,
  50314. Object.defineProperties(this, {
  50315. uniforms: {
  50316. get: function() {
  50317. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50318. this.getUniforms()
  50319. }
  50320. },
  50321. attributes: {
  50322. get: function() {
  50323. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50324. this.getAttributes()
  50325. }
  50326. }
  50327. }),
  50328. this.id = Qt++,
  50329. this.code = t,
  50330. this.usedTimes = 1,
  50331. this.program = y,
  50332. this.vertexShader = I,
  50333. this.fragmentShader = E,
  50334. this
  50335. }
  50336. ),
  50337. Ci.WebGLPrograms = function(s, l) {
  50338. function c(e, t) {
  50339. var i;
  50340. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50341. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50342. i
  50343. }
  50344. var h = []
  50345. , u = {
  50346. MeshDepthMaterial: "depth",
  50347. MeshNormalMaterial: "normal",
  50348. MeshBasicMaterial: "basic",
  50349. MeshLambertMaterial: "lambert",
  50350. MeshPhongMaterial: "phong",
  50351. MeshStandardMaterial: "standard",
  50352. LineBasicMaterial: "basic",
  50353. LineDashedMaterial: "dashed",
  50354. PointsMaterial: "points"
  50355. }
  50356. , 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"];
  50357. this.getParameters = function(e, t, i, n) {
  50358. var r = u[e.type]
  50359. , o = function(e) {
  50360. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50361. return 1024;
  50362. var t = l.maxVertexUniforms
  50363. , i = Math.floor((t - 20) / 4);
  50364. 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)")),
  50365. i
  50366. }(n)
  50367. , a = s.getPrecision();
  50368. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50369. {
  50370. shaderID: r,
  50371. precision: a,
  50372. supportsVertexTextures: l.vertexTextures,
  50373. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50374. map: !!e.map,
  50375. mapEncoding: c(e.map, s.gammaInput),
  50376. envMap: !!e.envMap,
  50377. envMapMode: e.envMap && e.envMap.mapping,
  50378. envMapEncoding: c(e.envMap, s.gammaInput),
  50379. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50380. lightMap: !!e.lightMap,
  50381. aoMap: !!e.aoMap,
  50382. emissiveMap: !!e.emissiveMap,
  50383. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50384. bumpMap: !!e.bumpMap,
  50385. normalMap: !!e.normalMap,
  50386. displacementMap: !!e.displacementMap,
  50387. roughnessMap: !!e.roughnessMap,
  50388. metalnessMap: !!e.metalnessMap,
  50389. specularMap: !!e.specularMap,
  50390. alphaMap: !!e.alphaMap,
  50391. combine: e.combine,
  50392. vertexColors: e.vertexColors,
  50393. fog: i,
  50394. useFog: e.fog,
  50395. fogExp: i instanceof Ci.FogExp2,
  50396. flatShading: e.shading === Ci.FlatShading,
  50397. sizeAttenuation: e.sizeAttenuation,
  50398. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50399. skinning: e.skinning,
  50400. maxBones: o,
  50401. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50402. morphTargets: e.morphTargets,
  50403. morphNormals: e.morphNormals,
  50404. maxMorphTargets: s.maxMorphTargets,
  50405. maxMorphNormals: s.maxMorphNormals,
  50406. numDirLights: t.directional.length,
  50407. numPointLights: t.point.length,
  50408. numSpotLights: t.spot.length,
  50409. numHemiLights: t.hemi.length,
  50410. pointLightShadows: t.shadowsPointLight,
  50411. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50412. shadowMapType: s.shadowMap.type,
  50413. toneMapping: s.toneMapping,
  50414. physicallyCorrectLights: s.physicallyCorrectLights,
  50415. premultipliedAlpha: e.premultipliedAlpha,
  50416. alphaTest: e.alphaTest,
  50417. doubleSided: e.side === Ci.DoubleSide,
  50418. flipSided: e.side === Ci.BackSide
  50419. }
  50420. }
  50421. ,
  50422. this.getProgramCode = function(e, t) {
  50423. var i = [];
  50424. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50425. i.push(e.vertexShader)),
  50426. void 0 !== e.defines)
  50427. for (var n in e.defines)
  50428. i.push(n),
  50429. i.push(e.defines[n]);
  50430. for (var r = 0; r < a.length; r++) {
  50431. var o = a[r];
  50432. i.push(o),
  50433. i.push(t[o])
  50434. }
  50435. return i.join()
  50436. }
  50437. ,
  50438. this.acquireProgram = function(e, t, i) {
  50439. for (var n, r = 0, o = h.length; r < o; r++) {
  50440. var a = h[r];
  50441. if (a.code === i) {
  50442. ++(n = a).usedTimes;
  50443. break
  50444. }
  50445. }
  50446. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50447. h.push(n)),
  50448. n
  50449. }
  50450. ,
  50451. this.releaseProgram = function(e) {
  50452. if (0 == --e.usedTimes) {
  50453. var t = h.indexOf(e);
  50454. h[t] = h[h.length - 1],
  50455. h.pop(),
  50456. e.destroy()
  50457. }
  50458. }
  50459. ,
  50460. this.programs = h
  50461. }
  50462. ,
  50463. Ci.WebGLProperties = function() {
  50464. var n = {};
  50465. this.get = function(e) {
  50466. var t = e.uuid
  50467. , i = n[t];
  50468. return void 0 === i && (i = {},
  50469. n[t] = i),
  50470. i
  50471. }
  50472. ,
  50473. this.delete = function(e) {
  50474. delete n[e.uuid]
  50475. }
  50476. ,
  50477. this.clear = function() {
  50478. n = {}
  50479. }
  50480. }
  50481. ,
  50482. Ci.WebGLShader = function(e, t, i) {
  50483. var n = e.createShader(t);
  50484. return e.shaderSource(n, i),
  50485. e.compileShader(n),
  50486. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50487. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50488. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50489. t[i] = i + 1 + ": " + t[i];
  50490. return t.join("\n")
  50491. }(i)),
  50492. n
  50493. }
  50494. ,
  50495. Ci.WebGLShadowMap = function(P, O, L) {
  50496. function D(e, t, i, n) {
  50497. var r = e.geometry
  50498. , o = null
  50499. , a = p
  50500. , s = e.customDepthMaterial;
  50501. if (i && (a = f,
  50502. s = e.customDistanceMaterial),
  50503. s)
  50504. o = s;
  50505. else {
  50506. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50507. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50508. , h = 0;
  50509. l && (h |= u),
  50510. c && (h |= d),
  50511. o = a[h]
  50512. }
  50513. return o.visible = t.visible,
  50514. o.wireframe = t.wireframe,
  50515. o.wireframeLinewidth = t.wireframeLinewidth,
  50516. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50517. o
  50518. }
  50519. function N(e, t, i) {
  50520. if (!1 !== e.visible) {
  50521. 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)))
  50522. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50523. G.push(e));
  50524. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50525. N(n[r], t, i)
  50526. }
  50527. }
  50528. 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) {
  50529. var a = 0 != (o & u)
  50530. , s = 0 != (o & d)
  50531. , l = new Ci.ShaderMaterial({
  50532. uniforms: i,
  50533. vertexShader: t.vertexShader,
  50534. fragmentShader: t.fragmentShader,
  50535. morphTargets: a,
  50536. skinning: s
  50537. });
  50538. p[o] = l;
  50539. var c = new Ci.ShaderMaterial({
  50540. defines: {
  50541. USE_SHADOWMAP: ""
  50542. },
  50543. uniforms: r,
  50544. vertexShader: n.vertexShader,
  50545. fragmentShader: n.fragmentShader,
  50546. morphTargets: a,
  50547. skinning: s
  50548. });
  50549. f[o] = c
  50550. }
  50551. var q = this;
  50552. this.enabled = !1,
  50553. this.autoUpdate = !0,
  50554. this.needsUpdate = !1,
  50555. this.type = Ci.PCFShadowMap,
  50556. this.cullFace = Ci.CullFaceFront,
  50557. this.render = function(e, t) {
  50558. var i, n, r = O.shadows;
  50559. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50560. B.clearColor(1, 1, 1, 1),
  50561. B.disable(F.BLEND),
  50562. B.enable(F.CULL_FACE),
  50563. F.frontFace(F.CCW),
  50564. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50565. B.setDepthTest(!0),
  50566. B.setScissorTest(!1);
  50567. for (var o = 0, a = r.length; o < a; o++) {
  50568. var s = r[o]
  50569. , l = s.shadow
  50570. , c = l.camera;
  50571. if (U.copy(l.mapSize),
  50572. s instanceof Ci.PointLight) {
  50573. i = 6,
  50574. n = !0;
  50575. var h = U.x
  50576. , u = U.y;
  50577. Y[0].set(2 * h, u, h, u),
  50578. Y[1].set(0, u, h, u),
  50579. Y[2].set(3 * h, u, h, u),
  50580. Y[3].set(h, u, h, u),
  50581. Y[4].set(3 * h, 0, h, u),
  50582. Y[5].set(h, 0, h, u),
  50583. U.x *= 4,
  50584. U.y *= 2
  50585. } else
  50586. n = !(i = 1);
  50587. if (null === l.map) {
  50588. var d = {
  50589. minFilter: Ci.NearestFilter,
  50590. magFilter: Ci.NearestFilter,
  50591. format: Ci.RGBAFormat
  50592. };
  50593. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50594. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50595. c.updateProjectionMatrix()
  50596. }
  50597. var p = l.map
  50598. , f = l.matrix;
  50599. z.setFromMatrixPosition(s.matrixWorld),
  50600. c.position.copy(z),
  50601. P.setRenderTarget(p),
  50602. P.clear();
  50603. for (var g = 0; g < i; g++) {
  50604. if (n) {
  50605. H.copy(c.position),
  50606. H.add(W[g]),
  50607. c.up.copy(j[g]),
  50608. c.lookAt(H);
  50609. var m = Y[g];
  50610. B.viewport(m)
  50611. } else
  50612. H.setFromMatrixPosition(s.target.matrixWorld),
  50613. c.lookAt(H);
  50614. c.updateMatrixWorld(),
  50615. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50616. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50617. f.multiply(c.projectionMatrix),
  50618. f.multiply(c.matrixWorldInverse),
  50619. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50620. V.setFromMatrix(k),
  50621. G.length = 0,
  50622. N(e, t, c);
  50623. for (var v = 0, y = G.length; v < y; v++) {
  50624. var A = G[v]
  50625. , C = L.update(A)
  50626. , I = A.material;
  50627. if (I instanceof Ci.MultiMaterial)
  50628. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50629. var T = E[b]
  50630. , x = _[T.materialIndex];
  50631. if (!0 === x.visible) {
  50632. var S = D(A, x, n, z);
  50633. P.renderBufferDirect(c, null, C, S, A, T)
  50634. }
  50635. }
  50636. else {
  50637. S = D(A, I, n, z);
  50638. P.renderBufferDirect(c, null, C, S, A, null)
  50639. }
  50640. }
  50641. }
  50642. }
  50643. var M = P.getClearColor()
  50644. , R = P.getClearAlpha();
  50645. P.setClearColor(M, R),
  50646. B.enable(F.BLEND),
  50647. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50648. q.needsUpdate = !1
  50649. }
  50650. }
  50651. }
  50652. ,
  50653. Ci.WebGLState = function(l, i, c) {
  50654. var n = this
  50655. , r = new Ci.Vector4
  50656. , o = new Uint8Array(16)
  50657. , a = new Uint8Array(16)
  50658. , s = new Uint8Array(16)
  50659. , t = {}
  50660. , h = null
  50661. , u = null
  50662. , d = null
  50663. , p = null
  50664. , f = null
  50665. , g = null
  50666. , m = null
  50667. , v = null
  50668. , y = !1
  50669. , A = null
  50670. , C = null
  50671. , I = null
  50672. , E = null
  50673. , _ = null
  50674. , b = null
  50675. , w = null
  50676. , T = null
  50677. , x = null
  50678. , S = null
  50679. , M = null
  50680. , R = null
  50681. , P = null
  50682. , O = null
  50683. , L = null
  50684. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50685. , N = void 0
  50686. , F = {}
  50687. , B = new Ci.Vector4
  50688. , V = null
  50689. , k = null
  50690. , U = new Ci.Vector4
  50691. , H = new Ci.Vector4
  50692. , z = l.createTexture();
  50693. l.bindTexture(l.TEXTURE_2D, z),
  50694. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50695. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50696. this.init = function() {
  50697. this.clearColor(0, 0, 0, 1),
  50698. this.clearDepth(1),
  50699. this.clearStencil(0),
  50700. this.enable(l.DEPTH_TEST),
  50701. l.depthFunc(l.LEQUAL),
  50702. l.frontFace(l.CCW),
  50703. l.cullFace(l.BACK),
  50704. this.enable(l.CULL_FACE),
  50705. this.enable(l.BLEND),
  50706. l.blendEquation(l.FUNC_ADD),
  50707. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50708. }
  50709. ,
  50710. this.initAttributes = function() {
  50711. for (var e = 0, t = o.length; e < t; e++)
  50712. o[e] = 0
  50713. }
  50714. ,
  50715. this.enableAttribute = function(e) {
  50716. o[e] = 1,
  50717. 0 === a[e] && (l.enableVertexAttribArray(e),
  50718. a[e] = 1),
  50719. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50720. s[e] = 0)
  50721. }
  50722. ,
  50723. this.enableAttributeAndDivisor = function(e, t, i) {
  50724. o[e] = 1,
  50725. 0 === a[e] && (l.enableVertexAttribArray(e),
  50726. a[e] = 1),
  50727. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50728. s[e] = t)
  50729. }
  50730. ,
  50731. this.disableUnusedAttributes = function() {
  50732. for (var e = 0, t = a.length; e < t; e++)
  50733. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50734. a[e] = 0)
  50735. }
  50736. ,
  50737. this.enable = function(e) {
  50738. !0 !== t[e] && (l.enable(e),
  50739. t[e] = !0)
  50740. }
  50741. ,
  50742. this.disable = function(e) {
  50743. !1 !== t[e] && (l.disable(e),
  50744. t[e] = !1)
  50745. }
  50746. ,
  50747. this.getCompressedTextureFormats = function() {
  50748. if (null === h && (h = [],
  50749. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50750. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50751. h.push(e[t]);
  50752. return h
  50753. }
  50754. ,
  50755. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50756. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50757. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50758. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50759. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50760. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50761. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50762. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50763. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50764. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50765. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50766. u = e,
  50767. y = s),
  50768. e === Ci.CustomBlending ? (r = r || t,
  50769. o = o || i,
  50770. a = a || n,
  50771. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50772. d = t,
  50773. g = r),
  50774. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50775. p = i,
  50776. f = n,
  50777. m = o,
  50778. v = a)) : v = m = g = f = p = d = null
  50779. }
  50780. ,
  50781. this.setDepthFunc = function(e) {
  50782. if (A !== e) {
  50783. if (e)
  50784. switch (e) {
  50785. case Ci.NeverDepth:
  50786. l.depthFunc(l.NEVER);
  50787. break;
  50788. case Ci.AlwaysDepth:
  50789. l.depthFunc(l.ALWAYS);
  50790. break;
  50791. case Ci.LessDepth:
  50792. l.depthFunc(l.LESS);
  50793. break;
  50794. case Ci.LessEqualDepth:
  50795. l.depthFunc(l.LEQUAL);
  50796. break;
  50797. case Ci.EqualDepth:
  50798. l.depthFunc(l.EQUAL);
  50799. break;
  50800. case Ci.GreaterEqualDepth:
  50801. l.depthFunc(l.GEQUAL);
  50802. break;
  50803. case Ci.GreaterDepth:
  50804. l.depthFunc(l.GREATER);
  50805. break;
  50806. case Ci.NotEqualDepth:
  50807. l.depthFunc(l.NOTEQUAL);
  50808. break;
  50809. default:
  50810. l.depthFunc(l.LEQUAL)
  50811. }
  50812. else
  50813. l.depthFunc(l.LEQUAL);
  50814. A = e
  50815. }
  50816. }
  50817. ,
  50818. this.setDepthTest = function(e) {
  50819. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50820. }
  50821. ,
  50822. this.setDepthWrite = function(e) {
  50823. C !== e && (l.depthMask(e),
  50824. C = e)
  50825. }
  50826. ,
  50827. this.setColorWrite = function(e) {
  50828. I !== e && (l.colorMask(e, e, e, e),
  50829. I = e)
  50830. }
  50831. ,
  50832. this.setStencilFunc = function(e, t, i) {
  50833. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50834. _ = e,
  50835. b = t,
  50836. w = i)
  50837. }
  50838. ,
  50839. this.setStencilOp = function(e, t, i) {
  50840. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50841. T = e,
  50842. x = t,
  50843. S = i)
  50844. }
  50845. ,
  50846. this.setStencilTest = function(e) {
  50847. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50848. }
  50849. ,
  50850. this.setStencilWrite = function(e) {
  50851. E !== e && (l.stencilMask(e),
  50852. E = e)
  50853. }
  50854. ,
  50855. this.setFlipSided = function(e) {
  50856. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50857. M = e)
  50858. }
  50859. ,
  50860. this.setLineWidth = function(e) {
  50861. e !== R && (l.lineWidth(e),
  50862. R = e)
  50863. }
  50864. ,
  50865. this.setPolygonOffset = function(e, t, i) {
  50866. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50867. !e || P === t && O === i || (l.polygonOffset(t, i),
  50868. P = t,
  50869. O = i)
  50870. }
  50871. ,
  50872. this.getScissorTest = function() {
  50873. return L
  50874. }
  50875. ,
  50876. this.setScissorTest = function(e) {
  50877. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50878. }
  50879. ,
  50880. this.activeTexture = function(e) {
  50881. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50882. N !== e && (l.activeTexture(e),
  50883. N = e)
  50884. }
  50885. ,
  50886. this.bindTexture = function(e, t) {
  50887. void 0 === N && n.activeTexture();
  50888. var i = F[N];
  50889. void 0 === i && (i = {
  50890. type: void 0,
  50891. texture: void 0
  50892. },
  50893. F[N] = i),
  50894. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50895. i.type = e,
  50896. i.texture = t)
  50897. }
  50898. ,
  50899. this.compressedTexImage2D = function() {
  50900. try {
  50901. l.compressedTexImage2D.apply(l, arguments)
  50902. } catch (e) {
  50903. console.error(e)
  50904. }
  50905. }
  50906. ,
  50907. this.texImage2D = function() {
  50908. try {
  50909. l.texImage2D.apply(l, arguments)
  50910. } catch (e) {
  50911. console.error(e)
  50912. }
  50913. }
  50914. ,
  50915. this.clearColor = function(e, t, i, n) {
  50916. r.set(e, t, i, n),
  50917. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50918. B.copy(r))
  50919. }
  50920. ,
  50921. this.clearDepth = function(e) {
  50922. V !== e && (l.clearDepth(e),
  50923. V = e)
  50924. }
  50925. ,
  50926. this.clearStencil = function(e) {
  50927. k !== e && (l.clearStencil(e),
  50928. k = e)
  50929. }
  50930. ,
  50931. this.scissor = function(e) {
  50932. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50933. U.copy(e))
  50934. }
  50935. ,
  50936. this.viewport = function(e) {
  50937. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50938. H.copy(e))
  50939. }
  50940. ,
  50941. this.reset = function() {
  50942. for (var e = 0; e < a.length; e++)
  50943. 1 === a[e] && (l.disableVertexAttribArray(e),
  50944. a[e] = 0);
  50945. t = {},
  50946. N = void 0,
  50947. F = {},
  50948. M = E = C = I = u = h = null
  50949. }
  50950. }
  50951. ,
  50952. Ci.LensFlarePlugin = function(v, y) {
  50953. function A() {
  50954. 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]);
  50955. C = S.createBuffer(),
  50956. I = S.createBuffer(),
  50957. S.bindBuffer(S.ARRAY_BUFFER, C),
  50958. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50959. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50960. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50961. T = S.createTexture(),
  50962. x = S.createTexture(),
  50963. M.bindTexture(S.TEXTURE_2D, T),
  50964. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50965. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50966. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50967. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50968. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50969. M.bindTexture(S.TEXTURE_2D, x),
  50970. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50971. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50972. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50973. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50974. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50975. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50976. 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"),
  50977. 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")
  50978. } : {
  50979. 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"),
  50980. 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")
  50981. },
  50982. E = function(e) {
  50983. var t = S.createProgram()
  50984. , i = S.createShader(S.FRAGMENT_SHADER)
  50985. , n = S.createShader(S.VERTEX_SHADER)
  50986. , r = "precision " + v.getPrecision() + " float;\n";
  50987. return S.shaderSource(i, r + e.fragmentShader),
  50988. S.shaderSource(n, r + e.vertexShader),
  50989. S.compileShader(i),
  50990. S.compileShader(n),
  50991. S.attachShader(t, i),
  50992. S.attachShader(t, n),
  50993. S.linkProgram(t),
  50994. t
  50995. }(e),
  50996. _ = {
  50997. vertex: S.getAttribLocation(E, "position"),
  50998. uv: S.getAttribLocation(E, "uv")
  50999. },
  51000. b = {
  51001. renderType: S.getUniformLocation(E, "renderType"),
  51002. map: S.getUniformLocation(E, "map"),
  51003. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  51004. opacity: S.getUniformLocation(E, "opacity"),
  51005. color: S.getUniformLocation(E, "color"),
  51006. scale: S.getUniformLocation(E, "scale"),
  51007. rotation: S.getUniformLocation(E, "rotation"),
  51008. screenPosition: S.getUniformLocation(E, "screenPosition")
  51009. }
  51010. }
  51011. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  51012. this.render = function(e, t, i) {
  51013. if (0 !== y.length) {
  51014. var n = new Ci.Vector3
  51015. , r = i.w / i.z
  51016. , o = .5 * i.z
  51017. , a = .5 * i.w
  51018. , s = 16 / i.w
  51019. , l = new Ci.Vector2(s * r,s)
  51020. , c = new Ci.Vector3(1,1,0)
  51021. , h = new Ci.Vector2(1,1);
  51022. void 0 === E && A(),
  51023. S.useProgram(E),
  51024. M.initAttributes(),
  51025. M.enableAttribute(_.vertex),
  51026. M.enableAttribute(_.uv),
  51027. M.disableUnusedAttributes(),
  51028. S.uniform1i(b.occlusionMap, 0),
  51029. S.uniform1i(b.map, 1),
  51030. S.bindBuffer(S.ARRAY_BUFFER, C),
  51031. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  51032. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  51033. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51034. M.disable(S.CULL_FACE),
  51035. M.setDepthWrite(!1);
  51036. for (var u = 0, d = y.length; u < d; u++) {
  51037. s = 16 / i.w,
  51038. l.set(s * r, s);
  51039. var p = y[u];
  51040. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  51041. n.applyMatrix4(t.matrixWorldInverse),
  51042. n.applyProjection(t.projectionMatrix),
  51043. c.copy(n),
  51044. h.x = c.x * o + o,
  51045. h.y = c.y * a + a,
  51046. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51047. M.activeTexture(S.TEXTURE0),
  51048. M.bindTexture(S.TEXTURE_2D, null),
  51049. M.activeTexture(S.TEXTURE1),
  51050. M.bindTexture(S.TEXTURE_2D, T),
  51051. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51052. S.uniform1i(b.renderType, 0),
  51053. S.uniform2f(b.scale, l.x, l.y),
  51054. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51055. M.disable(S.BLEND),
  51056. M.enable(S.DEPTH_TEST),
  51057. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51058. M.activeTexture(S.TEXTURE0),
  51059. M.bindTexture(S.TEXTURE_2D, x),
  51060. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51061. S.uniform1i(b.renderType, 1),
  51062. M.disable(S.DEPTH_TEST),
  51063. M.activeTexture(S.TEXTURE1),
  51064. M.bindTexture(S.TEXTURE_2D, T),
  51065. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51066. p.positionScreen.copy(c),
  51067. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51068. S.uniform1i(b.renderType, 2),
  51069. M.enable(S.BLEND);
  51070. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51071. var m = p.lensFlares[f];
  51072. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51073. c.y = m.y,
  51074. c.z = m.z,
  51075. s = m.size * m.scale / i.w,
  51076. l.x = s * r,
  51077. l.y = s,
  51078. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51079. S.uniform2f(b.scale, l.x, l.y),
  51080. S.uniform1f(b.rotation, m.rotation),
  51081. S.uniform1f(b.opacity, m.opacity),
  51082. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51083. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51084. v.setTexture(m.texture, 1),
  51085. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51086. }
  51087. }
  51088. }
  51089. M.enable(S.CULL_FACE),
  51090. M.enable(S.DEPTH_TEST),
  51091. M.setDepthWrite(!0),
  51092. v.resetGLState()
  51093. }
  51094. }
  51095. }
  51096. ,
  51097. Ci.SpritePlugin = function(u, d) {
  51098. function p() {
  51099. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51100. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51101. g = I.createBuffer(),
  51102. m = I.createBuffer(),
  51103. I.bindBuffer(I.ARRAY_BUFFER, g),
  51104. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51105. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51106. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51107. v = function() {
  51108. var e = I.createProgram()
  51109. , t = I.createShader(I.VERTEX_SHADER)
  51110. , i = I.createShader(I.FRAGMENT_SHADER);
  51111. 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")),
  51112. 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")),
  51113. I.compileShader(t),
  51114. I.compileShader(i),
  51115. I.attachShader(e, t),
  51116. I.attachShader(e, i),
  51117. I.linkProgram(e),
  51118. e
  51119. }(),
  51120. y = {
  51121. position: I.getAttribLocation(v, "position"),
  51122. uv: I.getAttribLocation(v, "uv")
  51123. },
  51124. A = {
  51125. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51126. uvScale: I.getUniformLocation(v, "uvScale"),
  51127. rotation: I.getUniformLocation(v, "rotation"),
  51128. scale: I.getUniformLocation(v, "scale"),
  51129. color: I.getUniformLocation(v, "color"),
  51130. map: I.getUniformLocation(v, "map"),
  51131. opacity: I.getUniformLocation(v, "opacity"),
  51132. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51133. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51134. fogType: I.getUniformLocation(v, "fogType"),
  51135. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51136. fogNear: I.getUniformLocation(v, "fogNear"),
  51137. fogFar: I.getUniformLocation(v, "fogFar"),
  51138. fogColor: I.getUniformLocation(v, "fogColor"),
  51139. alphaTest: I.getUniformLocation(v, "alphaTest")
  51140. };
  51141. var i = document.createElement("canvas");
  51142. i.width = 8,
  51143. i.height = 8;
  51144. var n = i.getContext("2d");
  51145. n.fillStyle = "white",
  51146. n.fillRect(0, 0, 8, 8),
  51147. (C = new Ci.Texture(i)).needsUpdate = !0
  51148. }
  51149. function f(e, t) {
  51150. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51151. }
  51152. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51153. this.render = function(e, t) {
  51154. if (0 !== d.length) {
  51155. void 0 === v && p(),
  51156. I.useProgram(v),
  51157. E.initAttributes(),
  51158. E.enableAttribute(y.position),
  51159. E.enableAttribute(y.uv),
  51160. E.disableUnusedAttributes(),
  51161. E.disable(I.CULL_FACE),
  51162. E.enable(I.BLEND),
  51163. I.bindBuffer(I.ARRAY_BUFFER, g),
  51164. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51165. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51166. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51167. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51168. E.activeTexture(I.TEXTURE0),
  51169. I.uniform1i(A.map, 0);
  51170. var i = 0
  51171. , n = 0
  51172. , r = e.fog;
  51173. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51174. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51175. I.uniform1f(A.fogFar, r.far),
  51176. I.uniform1i(A.fogType, 1),
  51177. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51178. I.uniform1i(A.fogType, 2),
  51179. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51180. n = i = 0);
  51181. for (var o = 0, a = d.length; o < a; o++) {
  51182. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51183. l.z = -l.modelViewMatrix.elements[14]
  51184. }
  51185. d.sort(f);
  51186. var s = [];
  51187. for (o = 0,
  51188. a = d.length; o < a; o++) {
  51189. var l, c = (l = d[o]).material;
  51190. I.uniform1f(A.alphaTest, c.alphaTest),
  51191. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51192. l.matrixWorld.decompose(_, b, w),
  51193. s[0] = w.x,
  51194. s[1] = w.y;
  51195. var h = 0;
  51196. e.fog && c.fog && (h = n),
  51197. i !== h && (I.uniform1i(A.fogType, h),
  51198. i = h),
  51199. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51200. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51201. I.uniform2f(A.uvScale, 1, 1)),
  51202. I.uniform1f(A.opacity, c.opacity),
  51203. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51204. I.uniform1f(A.rotation, c.rotation),
  51205. I.uniform2fv(A.scale, s),
  51206. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51207. E.setDepthTest(c.depthTest),
  51208. E.setDepthWrite(c.depthWrite),
  51209. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51210. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51211. }
  51212. E.enable(I.CULL_FACE),
  51213. u.resetGLState()
  51214. }
  51215. }
  51216. }
  51217. ,
  51218. Object.defineProperties(Ci.Box2.prototype, {
  51219. empty: {
  51220. value: function() {
  51221. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51222. this.isEmpty()
  51223. }
  51224. },
  51225. isIntersectionBox: {
  51226. value: function(e) {
  51227. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51228. this.intersectsBox(e)
  51229. }
  51230. }
  51231. }),
  51232. Object.defineProperties(Ci.Box3.prototype, {
  51233. empty: {
  51234. value: function() {
  51235. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51236. this.isEmpty()
  51237. }
  51238. },
  51239. isIntersectionBox: {
  51240. value: function(e) {
  51241. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51242. this.intersectsBox(e)
  51243. }
  51244. },
  51245. isIntersectionSphere: {
  51246. value: function(e) {
  51247. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51248. this.intersectsSphere(e)
  51249. }
  51250. }
  51251. }),
  51252. Object.defineProperties(Ci.Matrix3.prototype, {
  51253. multiplyVector3: {
  51254. value: function(e) {
  51255. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51256. e.applyMatrix3(this)
  51257. }
  51258. },
  51259. multiplyVector3Array: {
  51260. value: function(e) {
  51261. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51262. this.applyToVector3Array(e)
  51263. }
  51264. }
  51265. }),
  51266. Object.defineProperties(Ci.Matrix4.prototype, {
  51267. extractPosition: {
  51268. value: function(e) {
  51269. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51270. this.copyPosition(e)
  51271. }
  51272. },
  51273. setRotationFromQuaternion: {
  51274. value: function(e) {
  51275. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51276. this.makeRotationFromQuaternion(e)
  51277. }
  51278. },
  51279. multiplyVector3: {
  51280. value: function(e) {
  51281. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51282. e.applyProjection(this)
  51283. }
  51284. },
  51285. multiplyVector4: {
  51286. value: function(e) {
  51287. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51288. e.applyMatrix4(this)
  51289. }
  51290. },
  51291. multiplyVector3Array: {
  51292. value: function(e) {
  51293. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51294. this.applyToVector3Array(e)
  51295. }
  51296. },
  51297. rotateAxis: {
  51298. value: function(e) {
  51299. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51300. e.transformDirection(this)
  51301. }
  51302. },
  51303. crossVector: {
  51304. value: function(e) {
  51305. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51306. e.applyMatrix4(this)
  51307. }
  51308. },
  51309. translate: {
  51310. value: function(e) {
  51311. console.error("THREE.Matrix4: .translate() has been removed.")
  51312. }
  51313. },
  51314. rotateX: {
  51315. value: function(e) {
  51316. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51317. }
  51318. },
  51319. rotateY: {
  51320. value: function(e) {
  51321. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51322. }
  51323. },
  51324. rotateZ: {
  51325. value: function(e) {
  51326. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51327. }
  51328. },
  51329. rotateByAxis: {
  51330. value: function(e, t) {
  51331. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51332. }
  51333. }
  51334. }),
  51335. Object.defineProperties(Ci.Plane.prototype, {
  51336. isIntersectionLine: {
  51337. value: function(e) {
  51338. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51339. this.intersectsLine(e)
  51340. }
  51341. }
  51342. }),
  51343. Object.defineProperties(Ci.Quaternion.prototype, {
  51344. multiplyVector3: {
  51345. value: function(e) {
  51346. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51347. e.applyQuaternion(this)
  51348. }
  51349. }
  51350. }),
  51351. Object.defineProperties(Ci.Ray.prototype, {
  51352. isIntersectionBox: {
  51353. value: function(e) {
  51354. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51355. this.intersectsBox(e)
  51356. }
  51357. },
  51358. isIntersectionPlane: {
  51359. value: function(e) {
  51360. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51361. this.intersectsPlane(e)
  51362. }
  51363. },
  51364. isIntersectionSphere: {
  51365. value: function(e) {
  51366. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51367. this.intersectsSphere(e)
  51368. }
  51369. }
  51370. }),
  51371. Object.defineProperties(Ci.Vector3.prototype, {
  51372. setEulerFromRotationMatrix: {
  51373. value: function() {
  51374. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51375. }
  51376. },
  51377. setEulerFromQuaternion: {
  51378. value: function() {
  51379. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51380. }
  51381. },
  51382. getPositionFromMatrix: {
  51383. value: function(e) {
  51384. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51385. this.setFromMatrixPosition(e)
  51386. }
  51387. },
  51388. getScaleFromMatrix: {
  51389. value: function(e) {
  51390. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51391. this.setFromMatrixScale(e)
  51392. }
  51393. },
  51394. getColumnFromMatrix: {
  51395. value: function(e, t) {
  51396. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51397. this.setFromMatrixColumn(e, t)
  51398. }
  51399. }
  51400. }),
  51401. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51402. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51403. new Ci.Face3(e,t,i,r,o,a)
  51404. }
  51405. ,
  51406. Ci.Vertex = function(e, t, i) {
  51407. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51408. new Ci.Vector3(e,t,i)
  51409. }
  51410. ,
  51411. Object.defineProperties(Ci.Object3D.prototype, {
  51412. eulerOrder: {
  51413. get: function() {
  51414. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51415. this.rotation.order
  51416. },
  51417. set: function(e) {
  51418. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51419. this.rotation.order = e
  51420. }
  51421. },
  51422. getChildByName: {
  51423. value: function(e) {
  51424. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51425. this.getObjectByName(e)
  51426. }
  51427. },
  51428. renderDepth: {
  51429. set: function(e) {
  51430. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51431. }
  51432. },
  51433. translate: {
  51434. value: function(e, t) {
  51435. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51436. this.translateOnAxis(t, e)
  51437. }
  51438. },
  51439. useQuaternion: {
  51440. get: function() {
  51441. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51442. },
  51443. set: function(e) {
  51444. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51445. }
  51446. }
  51447. }),
  51448. Object.defineProperties(Ci, {
  51449. PointCloud: {
  51450. value: function(e, t) {
  51451. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51452. new Ci.Points(e,t)
  51453. }
  51454. },
  51455. ParticleSystem: {
  51456. value: function(e, t) {
  51457. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51458. new Ci.Points(e,t)
  51459. }
  51460. }
  51461. }),
  51462. Object.defineProperties(Ci.Light.prototype, {
  51463. onlyShadow: {
  51464. set: function(e) {
  51465. console.warn("THREE.Light: .onlyShadow has been removed.")
  51466. }
  51467. },
  51468. shadowCameraFov: {
  51469. set: function(e) {
  51470. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51471. this.shadow.camera.fov = e
  51472. }
  51473. },
  51474. shadowCameraLeft: {
  51475. set: function(e) {
  51476. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51477. this.shadow.camera.left = e
  51478. }
  51479. },
  51480. shadowCameraRight: {
  51481. set: function(e) {
  51482. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51483. this.shadow.camera.right = e
  51484. }
  51485. },
  51486. shadowCameraTop: {
  51487. set: function(e) {
  51488. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51489. this.shadow.camera.top = e
  51490. }
  51491. },
  51492. shadowCameraBottom: {
  51493. set: function(e) {
  51494. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51495. this.shadow.camera.bottom = e
  51496. }
  51497. },
  51498. shadowCameraNear: {
  51499. set: function(e) {
  51500. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51501. this.shadow.camera.near = e
  51502. }
  51503. },
  51504. shadowCameraFar: {
  51505. set: function(e) {
  51506. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51507. this.shadow.camera.far = e
  51508. }
  51509. },
  51510. shadowCameraVisible: {
  51511. set: function(e) {
  51512. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51513. }
  51514. },
  51515. shadowBias: {
  51516. set: function(e) {
  51517. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51518. this.shadow.bias = e
  51519. }
  51520. },
  51521. shadowDarkness: {
  51522. set: function(e) {
  51523. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51524. }
  51525. },
  51526. shadowMapWidth: {
  51527. set: function(e) {
  51528. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51529. this.shadow.mapSize.width = e
  51530. }
  51531. },
  51532. shadowMapHeight: {
  51533. set: function(e) {
  51534. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51535. this.shadow.mapSize.height = e
  51536. }
  51537. }
  51538. }),
  51539. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51540. length: {
  51541. get: function() {
  51542. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51543. this.array.length
  51544. }
  51545. }
  51546. }),
  51547. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51548. drawcalls: {
  51549. get: function() {
  51550. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51551. this.groups
  51552. }
  51553. },
  51554. offsets: {
  51555. get: function() {
  51556. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51557. this.groups
  51558. }
  51559. },
  51560. addIndex: {
  51561. value: function(e) {
  51562. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51563. this.setIndex(e)
  51564. }
  51565. },
  51566. addDrawCall: {
  51567. value: function(e, t, i) {
  51568. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51569. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51570. this.addGroup(e, t)
  51571. }
  51572. },
  51573. clearDrawCalls: {
  51574. value: function() {
  51575. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51576. this.clearGroups()
  51577. }
  51578. },
  51579. computeTangents: {
  51580. value: function() {
  51581. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51582. }
  51583. },
  51584. computeOffsets: {
  51585. value: function() {
  51586. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51587. }
  51588. }
  51589. }),
  51590. Object.defineProperties(Ci.Material.prototype, {
  51591. wrapAround: {
  51592. get: function() {
  51593. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51594. },
  51595. set: function(e) {
  51596. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51597. }
  51598. },
  51599. wrapRGB: {
  51600. get: function() {
  51601. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51602. new Ci.Color
  51603. }
  51604. }
  51605. }),
  51606. Object.defineProperties(Ci, {
  51607. PointCloudMaterial: {
  51608. value: function(e) {
  51609. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51610. new Ci.PointsMaterial(e)
  51611. }
  51612. },
  51613. ParticleBasicMaterial: {
  51614. value: function(e) {
  51615. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51616. new Ci.PointsMaterial(e)
  51617. }
  51618. },
  51619. ParticleSystemMaterial: {
  51620. value: function(e) {
  51621. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51622. new Ci.PointsMaterial(e)
  51623. }
  51624. }
  51625. }),
  51626. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51627. metal: {
  51628. get: function() {
  51629. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51630. !1
  51631. },
  51632. set: function(e) {
  51633. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51634. }
  51635. }
  51636. }),
  51637. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51638. derivatives: {
  51639. get: function() {
  51640. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51641. this.extensions.derivatives
  51642. },
  51643. set: function(e) {
  51644. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51645. this.extensions.derivatives = e
  51646. }
  51647. }
  51648. }),
  51649. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51650. supportsFloatTextures: {
  51651. value: function() {
  51652. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51653. this.extensions.get("OES_texture_float")
  51654. }
  51655. },
  51656. supportsHalfFloatTextures: {
  51657. value: function() {
  51658. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51659. this.extensions.get("OES_texture_half_float")
  51660. }
  51661. },
  51662. supportsStandardDerivatives: {
  51663. value: function() {
  51664. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51665. this.extensions.get("OES_standard_derivatives")
  51666. }
  51667. },
  51668. supportsCompressedTextureS3TC: {
  51669. value: function() {
  51670. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51671. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51672. }
  51673. },
  51674. supportsCompressedTexturePVRTC: {
  51675. value: function() {
  51676. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51677. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51678. }
  51679. },
  51680. supportsBlendMinMax: {
  51681. value: function() {
  51682. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51683. this.extensions.get("EXT_blend_minmax")
  51684. }
  51685. },
  51686. supportsVertexTextures: {
  51687. value: function() {
  51688. return this.capabilities.vertexTextures
  51689. }
  51690. },
  51691. supportsInstancedArrays: {
  51692. value: function() {
  51693. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51694. this.extensions.get("ANGLE_instanced_arrays")
  51695. }
  51696. },
  51697. enableScissorTest: {
  51698. value: function(e) {
  51699. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51700. this.setScissorTest(e)
  51701. }
  51702. },
  51703. initMaterial: {
  51704. value: function() {
  51705. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51706. }
  51707. },
  51708. addPrePlugin: {
  51709. value: function() {
  51710. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51711. }
  51712. },
  51713. addPostPlugin: {
  51714. value: function() {
  51715. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51716. }
  51717. },
  51718. updateShadowMap: {
  51719. value: function() {
  51720. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51721. }
  51722. },
  51723. shadowMapEnabled: {
  51724. get: function() {
  51725. return this.shadowMap.enabled
  51726. },
  51727. set: function(e) {
  51728. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51729. this.shadowMap.enabled = e
  51730. }
  51731. },
  51732. shadowMapType: {
  51733. get: function() {
  51734. return this.shadowMap.type
  51735. },
  51736. set: function(e) {
  51737. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51738. this.shadowMap.type = e
  51739. }
  51740. },
  51741. shadowMapCullFace: {
  51742. get: function() {
  51743. return this.shadowMap.cullFace
  51744. },
  51745. set: function(e) {
  51746. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51747. this.shadowMap.cullFace = e
  51748. }
  51749. }
  51750. }),
  51751. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51752. wrapS: {
  51753. get: function() {
  51754. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51755. this.texture.wrapS
  51756. },
  51757. set: function(e) {
  51758. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51759. this.texture.wrapS = e
  51760. }
  51761. },
  51762. wrapT: {
  51763. get: function() {
  51764. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51765. this.texture.wrapT
  51766. },
  51767. set: function(e) {
  51768. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51769. this.texture.wrapT = e
  51770. }
  51771. },
  51772. magFilter: {
  51773. get: function() {
  51774. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51775. this.texture.magFilter
  51776. },
  51777. set: function(e) {
  51778. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51779. this.texture.magFilter = e
  51780. }
  51781. },
  51782. minFilter: {
  51783. get: function() {
  51784. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51785. this.texture.minFilter
  51786. },
  51787. set: function(e) {
  51788. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51789. this.texture.minFilter = e
  51790. }
  51791. },
  51792. anisotropy: {
  51793. get: function() {
  51794. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51795. this.texture.anisotropy
  51796. },
  51797. set: function(e) {
  51798. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51799. this.texture.anisotropy = e
  51800. }
  51801. },
  51802. offset: {
  51803. get: function() {
  51804. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51805. this.texture.offset
  51806. },
  51807. set: function(e) {
  51808. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51809. this.texture.offset = e
  51810. }
  51811. },
  51812. repeat: {
  51813. get: function() {
  51814. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51815. this.texture.repeat
  51816. },
  51817. set: function(e) {
  51818. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51819. this.texture.repeat = e
  51820. }
  51821. },
  51822. format: {
  51823. get: function() {
  51824. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51825. this.texture.format
  51826. },
  51827. set: function(e) {
  51828. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51829. this.texture.format = e
  51830. }
  51831. },
  51832. type: {
  51833. get: function() {
  51834. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51835. this.texture.type
  51836. },
  51837. set: function(e) {
  51838. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51839. this.texture.type = e
  51840. }
  51841. },
  51842. generateMipmaps: {
  51843. get: function() {
  51844. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51845. this.texture.generateMipmaps
  51846. },
  51847. set: function(e) {
  51848. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51849. this.texture.generateMipmaps = e
  51850. }
  51851. }
  51852. }),
  51853. Ci.GeometryUtils = {
  51854. merge: function(e, t, i) {
  51855. var n;
  51856. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51857. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51858. n = t.matrix,
  51859. t = t.geometry),
  51860. e.merge(t, n, i)
  51861. },
  51862. center: function(e) {
  51863. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51864. e.center()
  51865. }
  51866. },
  51867. Ci.ImageUtils = {
  51868. crossOrigin: void 0,
  51869. loadTexture: function(e, t, i, n) {
  51870. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51871. var r = new Ci.TextureLoader;
  51872. r.setCrossOrigin(this.crossOrigin);
  51873. var o = r.load(e, i, void 0, n);
  51874. return t && (o.mapping = t),
  51875. o
  51876. },
  51877. loadTextureCube: function(e, t, i, n) {
  51878. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51879. var r = new Ci.CubeTextureLoader;
  51880. r.setCrossOrigin(this.crossOrigin);
  51881. var o = r.load(e, i, void 0, n);
  51882. return t && (o.mapping = t),
  51883. o
  51884. },
  51885. loadCompressedTexture: function() {
  51886. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51887. },
  51888. loadCompressedTextureCube: function() {
  51889. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51890. }
  51891. },
  51892. Ci.Projector = function() {
  51893. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51894. this.projectVector = function(e, t) {
  51895. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51896. e.project(t)
  51897. }
  51898. ,
  51899. this.unprojectVector = function(e, t) {
  51900. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51901. e.unproject(t)
  51902. }
  51903. ,
  51904. this.pickingRay = function(e, t) {
  51905. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51906. }
  51907. }
  51908. ,
  51909. Ci.CanvasRenderer = function() {
  51910. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51911. this.domElement = document.createElement("canvas"),
  51912. this.clear = function() {}
  51913. ,
  51914. this.render = function() {}
  51915. ,
  51916. this.setClearColor = function() {}
  51917. ,
  51918. this.setSize = function() {}
  51919. }
  51920. ,
  51921. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51922. Ci.CurveUtils = {
  51923. tangentQuadraticBezier: function(e, t, i, n) {
  51924. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51925. },
  51926. tangentCubicBezier: function(e, t, i, n, r) {
  51927. 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
  51928. },
  51929. tangentSpline: function(e, t, i, n, r) {
  51930. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51931. },
  51932. interpolate: function(e, t, i, n, r) {
  51933. var o = .5 * (i - e)
  51934. , a = .5 * (n - t)
  51935. , s = r * r;
  51936. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51937. }
  51938. },
  51939. Ci.SceneUtils = {
  51940. createMultiMaterialObject: function(e, t) {
  51941. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51942. i.add(new Ci.Mesh(e,t[n]));
  51943. return i
  51944. },
  51945. detach: function(e, t, i) {
  51946. e.applyMatrix(t.matrixWorld),
  51947. t.remove(e),
  51948. i.add(e)
  51949. },
  51950. attach: function(e, t, i) {
  51951. var n = new Ci.Matrix4;
  51952. n.getInverse(i.matrixWorld),
  51953. e.applyMatrix(n),
  51954. t.remove(e),
  51955. i.add(e)
  51956. }
  51957. },
  51958. Ci.ShapeUtils = {
  51959. area: function(e) {
  51960. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51961. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51962. return .5 * i
  51963. },
  51964. triangulate: function(e, t) {
  51965. var i = e.length;
  51966. if (i < 3)
  51967. return null;
  51968. var n, r, o, a = [], s = [], l = [];
  51969. if (0 < Ci.ShapeUtils.area(e))
  51970. for (r = 0; r < i; r++)
  51971. s[r] = r;
  51972. else
  51973. for (r = 0; r < i; r++)
  51974. s[r] = i - 1 - r;
  51975. var c = i
  51976. , h = 2 * c;
  51977. for (r = c - 1; 2 < c; ) {
  51978. if (h-- <= 0)
  51979. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51980. t ? l : a;
  51981. if (c <= (n = r) && (n = 0),
  51982. c <= (r = n + 1) && (r = 0),
  51983. c <= (o = r + 1) && (o = 0),
  51984. Si(e, n, r, o, c, s)) {
  51985. var u, d, p, f, g;
  51986. for (u = s[n],
  51987. d = s[r],
  51988. p = s[o],
  51989. a.push([e[u], e[d], e[p]]),
  51990. l.push([s[n], s[r], s[o]]),
  51991. g = (f = r) + 1; g < c; f++,
  51992. g++)
  51993. s[f] = s[g];
  51994. h = 2 * --c
  51995. }
  51996. }
  51997. return t ? l : a
  51998. },
  51999. triangulateShape: function(e, t) {
  52000. function w(e, t, i) {
  52001. 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
  52002. }
  52003. function b(e, t, i, n, r) {
  52004. var o = t.x - e.x
  52005. , a = t.y - e.y
  52006. , s = n.x - i.x
  52007. , l = n.y - i.y
  52008. , c = e.x - i.x
  52009. , h = e.y - i.y
  52010. , u = a * s - o * l
  52011. , d = a * c - o * h;
  52012. if (Math.abs(u) > Number.EPSILON) {
  52013. var p;
  52014. if (0 < u) {
  52015. if (d < 0 || u < d)
  52016. return [];
  52017. if ((p = l * c - s * h) < 0 || u < p)
  52018. return []
  52019. } else {
  52020. if (0 < d || d < u)
  52021. return [];
  52022. if (0 < (p = l * c - s * h) || p < u)
  52023. return []
  52024. }
  52025. if (0 === p)
  52026. return !r || 0 != d && d != u ? [e] : [];
  52027. if (p === u)
  52028. return !r || 0 != d && d != u ? [t] : [];
  52029. if (0 == d)
  52030. return [i];
  52031. if (d == u)
  52032. return [n];
  52033. var f = p / u;
  52034. return [{
  52035. x: e.x + f * o,
  52036. y: e.y + f * a
  52037. }]
  52038. }
  52039. if (0 != d || l * c != s * h)
  52040. return [];
  52041. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  52042. 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,
  52043. (m = t).x) : (v = (g = t).x,
  52044. (m = e).x),
  52045. i.x < n.x ? (I = (A = i).x,
  52046. (C = n).x) : (I = (A = n).x,
  52047. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52048. (m = t).y) : (v = (g = t).y,
  52049. (m = e).y),
  52050. i.y < n.y ? (I = (A = i).y,
  52051. (C = n).y) : (I = (A = n).y,
  52052. (C = i).y)),
  52053. 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])
  52054. }
  52055. function T(e, t, i, n) {
  52056. var r = t.x - e.x
  52057. , o = t.y - e.y
  52058. , a = i.x - e.x
  52059. , s = i.y - e.y
  52060. , l = n.x - e.x
  52061. , c = n.y - e.y
  52062. , h = r * s - o * a
  52063. , u = r * c - o * l;
  52064. if (Math.abs(h) > Number.EPSILON) {
  52065. var d = l * s - c * a;
  52066. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52067. }
  52068. return 0 < u
  52069. }
  52070. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52071. Array.prototype.push.apply(c, t[h]);
  52072. for (i = 0,
  52073. n = c.length; i < n; i++)
  52074. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52075. l[a] = i;
  52076. var d = function(e, a) {
  52077. function t(e, t) {
  52078. var i = m.length - 1
  52079. , n = e - 1;
  52080. n < 0 && (n = i);
  52081. var r = e + 1;
  52082. i < r && (r = 0);
  52083. var o = T(m[e], m[n], m[r], c[t]);
  52084. if (!o)
  52085. return !1;
  52086. var a = c.length - 1
  52087. , s = t - 1;
  52088. s < 0 && (s = a);
  52089. var l = t + 1;
  52090. return a < l && (l = 0),
  52091. !!(o = T(c[t], c[s], c[l], m[e]))
  52092. }
  52093. function i(e, t) {
  52094. var i, n;
  52095. for (i = 0; i < m.length; i++)
  52096. if (n = i + 1,
  52097. n %= m.length,
  52098. 0 < b(e, t, m[i], m[n], !0).length)
  52099. return !0;
  52100. return !1
  52101. }
  52102. function n(e, t) {
  52103. var i, n, r, o;
  52104. for (i = 0; i < v.length; i++)
  52105. for (n = a[v[i]],
  52106. r = 0; r < n.length; r++)
  52107. if (o = r + 1,
  52108. o %= n.length,
  52109. 0 < b(e, t, n[r], n[o], !0).length)
  52110. return !0;
  52111. return !1
  52112. }
  52113. 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++)
  52114. v.push(A);
  52115. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52116. if (--E < 0) {
  52117. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52118. break
  52119. }
  52120. for (o = I; o < m.length; o++) {
  52121. s = m[o],
  52122. r = -1;
  52123. for (A = 0; A < v.length; A++)
  52124. if (h = v[A],
  52125. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52126. c = a[h];
  52127. for (var _ = 0; _ < c.length; _++)
  52128. if (l = c[_],
  52129. t(o, _) && !i(s, l) && !n(s, l)) {
  52130. r = _,
  52131. v.splice(A, 1),
  52132. d = m.slice(0, o + 1),
  52133. p = m.slice(o),
  52134. f = c.slice(r),
  52135. g = c.slice(0, r + 1),
  52136. m = d.concat(f).concat(g).concat(p),
  52137. I = o;
  52138. break
  52139. }
  52140. if (0 <= r)
  52141. break;
  52142. y[u] = !0
  52143. }
  52144. if (0 <= r)
  52145. break
  52146. }
  52147. }
  52148. return m
  52149. }(e, t)
  52150. , p = Ci.ShapeUtils.triangulate(d, !1);
  52151. for (i = 0,
  52152. n = p.length; i < n; i++)
  52153. for (o = p[i],
  52154. r = 0; r < 3; r++)
  52155. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52156. return p.concat()
  52157. },
  52158. isClockWise: function(e) {
  52159. return Ci.ShapeUtils.area(e) < 0
  52160. },
  52161. b2: function(e, t, i, n) {
  52162. return function(e, t) {
  52163. var i = 1 - e;
  52164. return i * i * t
  52165. }(e, t) + function(e, t) {
  52166. return 2 * (1 - e) * e * t
  52167. }(e, i) + function(e, t) {
  52168. return e * e * t
  52169. }(e, n)
  52170. },
  52171. b3: function(e, t, i, n, r) {
  52172. return function(e, t) {
  52173. var i = 1 - e;
  52174. return i * i * i * t
  52175. }(e, t) + function(e, t) {
  52176. var i = 1 - e;
  52177. return 3 * i * i * e * t
  52178. }(e, i) + function(e, t) {
  52179. return 3 * (1 - e) * e * e * t
  52180. }(e, n) + function(e, t) {
  52181. return e * e * e * t
  52182. }(e, r)
  52183. }
  52184. },
  52185. Ci.Curve = function() {}
  52186. ,
  52187. Ci.Curve.prototype = {
  52188. constructor: Ci.Curve,
  52189. getPoint: function(e) {
  52190. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52191. null
  52192. },
  52193. getPointAt: function(e) {
  52194. var t = this.getUtoTmapping(e);
  52195. return this.getPoint(t)
  52196. },
  52197. getPoints: function(e) {
  52198. e = e || 5;
  52199. var t, i = [];
  52200. for (t = 0; t <= e; t++)
  52201. i.push(this.getPoint(t / e));
  52202. return i
  52203. },
  52204. getSpacedPoints: function(e) {
  52205. e = e || 5;
  52206. var t, i = [];
  52207. for (t = 0; t <= e; t++)
  52208. i.push(this.getPointAt(t / e));
  52209. return i
  52210. },
  52211. getLength: function() {
  52212. var e = this.getLengths();
  52213. return e[e.length - 1]
  52214. },
  52215. getLengths: function(e) {
  52216. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52217. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52218. return this.cacheArcLengths;
  52219. this.needsUpdate = !1;
  52220. var t, i, n = [], r = this.getPoint(0), o = 0;
  52221. for (n.push(0),
  52222. i = 1; i <= e; i++)
  52223. o += (t = this.getPoint(i / e)).distanceTo(r),
  52224. n.push(o),
  52225. r = t;
  52226. return this.cacheArcLengths = n
  52227. },
  52228. updateArcLengths: function() {
  52229. this.needsUpdate = !0,
  52230. this.getLengths()
  52231. },
  52232. getUtoTmapping: function(e, t) {
  52233. var i, n = this.getLengths(), r = 0, o = n.length;
  52234. i = t || e * n[o - 1];
  52235. for (var a, s = 0, l = o - 1; s <= l; )
  52236. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52237. s = r + 1;
  52238. else {
  52239. if (!(0 < a)) {
  52240. l = r;
  52241. break
  52242. }
  52243. l = r - 1
  52244. }
  52245. if (n[r = l] === i)
  52246. return r / (o - 1);
  52247. var c = n[r];
  52248. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52249. },
  52250. getTangent: function(e) {
  52251. var t = e - 1e-4
  52252. , i = e + 1e-4;
  52253. t < 0 && (t = 0),
  52254. 1 < i && (i = 1);
  52255. var n = this.getPoint(t);
  52256. return this.getPoint(i).clone().sub(n).normalize()
  52257. },
  52258. getTangentAt: function(e) {
  52259. var t = this.getUtoTmapping(e);
  52260. return this.getTangent(t)
  52261. }
  52262. },
  52263. Ci.Curve.create = function(e, t) {
  52264. return e.prototype = Object.create(Ci.Curve.prototype),
  52265. (e.prototype.constructor = e).prototype.getPoint = t,
  52266. e
  52267. }
  52268. ,
  52269. Ci.CurvePath = function() {
  52270. this.curves = [],
  52271. this.autoClose = !1
  52272. }
  52273. ,
  52274. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52275. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52276. Ci.CurvePath.prototype.add = function(e) {
  52277. this.curves.push(e)
  52278. }
  52279. ,
  52280. Ci.CurvePath.prototype.closePath = function() {
  52281. var e = this.curves[0].getPoint(0)
  52282. , t = this.curves[this.curves.length - 1].getPoint(1);
  52283. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52284. }
  52285. ,
  52286. Ci.CurvePath.prototype.getPoint = function(e) {
  52287. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52288. if (i[n] >= t) {
  52289. var r = i[n] - t
  52290. , o = this.curves[n]
  52291. , a = 1 - r / o.getLength();
  52292. return o.getPointAt(a)
  52293. }
  52294. n++
  52295. }
  52296. return null
  52297. }
  52298. ,
  52299. Ci.CurvePath.prototype.getLength = function() {
  52300. var e = this.getCurveLengths();
  52301. return e[e.length - 1]
  52302. }
  52303. ,
  52304. Ci.CurvePath.prototype.getCurveLengths = function() {
  52305. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52306. return this.cacheLengths;
  52307. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52308. t += this.curves[i].getLength(),
  52309. e.push(t);
  52310. return this.cacheLengths = e
  52311. }
  52312. ,
  52313. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52314. var t = this.getPoints(e);
  52315. return this.createGeometry(t)
  52316. }
  52317. ,
  52318. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52319. var t = this.getSpacedPoints(e);
  52320. return this.createGeometry(t)
  52321. }
  52322. ,
  52323. Ci.CurvePath.prototype.createGeometry = function(e) {
  52324. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52325. var r = e[i];
  52326. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52327. }
  52328. return t
  52329. }
  52330. ,
  52331. Ci.Font = function(e) {
  52332. this.data = e
  52333. }
  52334. ,
  52335. Ci.Font.prototype = {
  52336. constructor: Ci.Font,
  52337. generateShapes: function(e, s, b) {
  52338. function l(e, t, i) {
  52339. var n = w.glyphs[e] || w.glyphs["?"];
  52340. if (n) {
  52341. 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;
  52342. if (n.o)
  52343. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52344. switch (A[C++]) {
  52345. case "m":
  52346. r = A[C++] * t + i,
  52347. o = A[C++] * t,
  52348. g.moveTo(r, o);
  52349. break;
  52350. case "l":
  52351. r = A[C++] * t + i,
  52352. o = A[C++] * t,
  52353. g.lineTo(r, o);
  52354. break;
  52355. case "q":
  52356. if (a = A[C++] * t + i,
  52357. s = A[C++] * t,
  52358. h = A[C++] * t + i,
  52359. u = A[C++] * t,
  52360. g.quadraticCurveTo(h, u, a, s),
  52361. f = m[m.length - 1]) {
  52362. l = f.x,
  52363. c = f.y;
  52364. for (var E = 1; E <= b; E++) {
  52365. v(_ = E / b, l, h, a),
  52366. v(_, c, u, s)
  52367. }
  52368. }
  52369. break;
  52370. case "b":
  52371. if (a = A[C++] * t + i,
  52372. s = A[C++] * t,
  52373. h = A[C++] * t + i,
  52374. u = A[C++] * t,
  52375. d = A[C++] * t + i,
  52376. p = A[C++] * t,
  52377. g.bezierCurveTo(h, u, d, p, a, s),
  52378. f = m[m.length - 1]) {
  52379. l = f.x,
  52380. c = f.y;
  52381. for (E = 1; E <= b; E++) {
  52382. var _;
  52383. y(_ = E / b, l, h, d, a),
  52384. y(_, c, u, p, s)
  52385. }
  52386. }
  52387. }
  52388. }
  52389. return {
  52390. offset: n.ha * t,
  52391. path: g
  52392. }
  52393. }
  52394. }
  52395. void 0 === s && (s = 100),
  52396. void 0 === b && (b = 4);
  52397. for (var w = this.data, t = function(e) {
  52398. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52399. var a = l(t[o], i, n);
  52400. n += a.offset,
  52401. r.push(a.path)
  52402. }
  52403. return r
  52404. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52405. Array.prototype.push.apply(i, t[n].toShapes());
  52406. return i
  52407. }
  52408. },
  52409. Ci.Path = function(e) {
  52410. Ci.CurvePath.call(this),
  52411. this.actions = [],
  52412. e && this.fromPoints(e)
  52413. }
  52414. ,
  52415. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52416. Ci.Path.prototype.constructor = Ci.Path,
  52417. Ci.Path.prototype.fromPoints = function(e) {
  52418. this.moveTo(e[0].x, e[0].y);
  52419. for (var t = 1, i = e.length; t < i; t++)
  52420. this.lineTo(e[t].x, e[t].y)
  52421. }
  52422. ,
  52423. Ci.Path.prototype.moveTo = function(e, t) {
  52424. this.actions.push({
  52425. action: "moveTo",
  52426. args: [e, t]
  52427. })
  52428. }
  52429. ,
  52430. Ci.Path.prototype.lineTo = function(e, t) {
  52431. var i = this.actions[this.actions.length - 1].args
  52432. , n = i[i.length - 2]
  52433. , r = i[i.length - 1]
  52434. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52435. this.curves.push(o),
  52436. this.actions.push({
  52437. action: "lineTo",
  52438. args: [e, t]
  52439. })
  52440. }
  52441. ,
  52442. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52443. var r = this.actions[this.actions.length - 1].args
  52444. , o = r[r.length - 2]
  52445. , a = r[r.length - 1]
  52446. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52447. this.curves.push(s),
  52448. this.actions.push({
  52449. action: "quadraticCurveTo",
  52450. args: [e, t, i, n]
  52451. })
  52452. }
  52453. ,
  52454. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52455. var a = this.actions[this.actions.length - 1].args
  52456. , s = a[a.length - 2]
  52457. , l = a[a.length - 1]
  52458. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52459. this.curves.push(c),
  52460. this.actions.push({
  52461. action: "bezierCurveTo",
  52462. args: [e, t, i, n, r, o]
  52463. })
  52464. }
  52465. ,
  52466. Ci.Path.prototype.splineThru = function(e) {
  52467. var t = Array.prototype.slice.call(arguments)
  52468. , i = this.actions[this.actions.length - 1].args
  52469. , n = i[i.length - 2]
  52470. , r = i[i.length - 1]
  52471. , o = [new Ci.Vector2(n,r)];
  52472. Array.prototype.push.apply(o, e);
  52473. var a = new Ci.SplineCurve(o);
  52474. this.curves.push(a),
  52475. this.actions.push({
  52476. action: "splineThru",
  52477. args: t
  52478. })
  52479. }
  52480. ,
  52481. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52482. var a = this.actions[this.actions.length - 1].args
  52483. , s = a[a.length - 2]
  52484. , l = a[a.length - 1];
  52485. this.absarc(e + s, t + l, i, n, r, o)
  52486. }
  52487. ,
  52488. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52489. this.absellipse(e, t, i, i, n, r, o)
  52490. }
  52491. ,
  52492. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52493. var l = this.actions[this.actions.length - 1].args
  52494. , c = l[l.length - 2]
  52495. , h = l[l.length - 1];
  52496. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52497. }
  52498. ,
  52499. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52500. var l = [e, t, i, n, r, o, a, s || 0]
  52501. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52502. this.curves.push(c);
  52503. var h = c.getPoint(1);
  52504. l.push(h.x),
  52505. l.push(h.y),
  52506. this.actions.push({
  52507. action: "ellipse",
  52508. args: l
  52509. })
  52510. }
  52511. ,
  52512. Ci.Path.prototype.getSpacedPoints = function(e) {
  52513. e = e || 40;
  52514. for (var t = [], i = 0; i < e; i++)
  52515. t.push(this.getPoint(i / e));
  52516. return this.autoClose && t.push(t[0]),
  52517. t
  52518. }
  52519. ,
  52520. Ci.Path.prototype.getPoints = function(e) {
  52521. e = e || 12;
  52522. 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++) {
  52523. var v = this.actions[g]
  52524. , y = v.action
  52525. , A = v.args;
  52526. switch (y) {
  52527. case "moveTo":
  52528. case "lineTo":
  52529. f.push(new Ci.Vector2(A[0],A[1]));
  52530. break;
  52531. case "quadraticCurveTo":
  52532. t = A[2],
  52533. i = A[3],
  52534. o = A[0],
  52535. a = A[1],
  52536. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52537. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52538. c[c.length - 1]);
  52539. for (var C = 1; C <= e; C++) {
  52540. h = d(O = C / e, s, o, t),
  52541. u = d(O, l, a, i),
  52542. f.push(new Ci.Vector2(h,u))
  52543. }
  52544. break;
  52545. case "bezierCurveTo":
  52546. t = A[4],
  52547. i = A[5],
  52548. o = A[0],
  52549. a = A[1],
  52550. n = A[2],
  52551. r = A[3],
  52552. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52553. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52554. c[c.length - 1]);
  52555. for (C = 1; C <= e; C++) {
  52556. h = p(O = C / e, s, o, n, t),
  52557. u = p(O, l, a, r, i),
  52558. f.push(new Ci.Vector2(h,u))
  52559. }
  52560. break;
  52561. case "splineThru":
  52562. c = this.actions[g - 1].args;
  52563. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52564. , E = e * A[0].length;
  52565. I = I.concat(A[0]);
  52566. var _ = new Ci.SplineCurve(I);
  52567. for (C = 1; C <= E; C++)
  52568. f.push(_.getPointAt(C / E));
  52569. break;
  52570. case "arc":
  52571. var b = A[0]
  52572. , w = A[1]
  52573. , T = A[2]
  52574. , x = A[3]
  52575. , S = A[4]
  52576. , M = !!A[5]
  52577. , R = S - x
  52578. , P = 2 * e;
  52579. for (C = 1; C <= P; C++) {
  52580. var O = C / P;
  52581. M || (O = 1 - O),
  52582. L = x + O * R,
  52583. h = b + T * Math.cos(L),
  52584. u = w + T * Math.sin(L),
  52585. f.push(new Ci.Vector2(h,u))
  52586. }
  52587. break;
  52588. case "ellipse":
  52589. b = A[0],
  52590. w = A[1];
  52591. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52592. S = A[5],
  52593. M = !!A[6],
  52594. A[7]);
  52595. R = S - x,
  52596. P = 2 * e;
  52597. 0 !== V && (D = Math.cos(V),
  52598. N = Math.sin(V));
  52599. for (C = 1; C <= P; C++) {
  52600. O = C / P;
  52601. if (M || (O = 1 - O),
  52602. L = x + O * R,
  52603. h = b + F * Math.cos(L),
  52604. u = w + B * Math.sin(L),
  52605. 0 !== V) {
  52606. var k = h;
  52607. h = (k - b) * D - (u - w) * N + b,
  52608. u = (k - b) * N + (u - w) * D + w
  52609. }
  52610. f.push(new Ci.Vector2(h,u))
  52611. }
  52612. }
  52613. }
  52614. var U = f[f.length - 1];
  52615. 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),
  52616. this.autoClose && f.push(f[0]),
  52617. f
  52618. }
  52619. ,
  52620. Ci.Path.prototype.toShapes = function(e, t) {
  52621. function i(e) {
  52622. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52623. var r = e[i]
  52624. , o = new Ci.Shape;
  52625. o.actions = r.actions,
  52626. o.curves = r.curves,
  52627. t.push(o)
  52628. }
  52629. return t
  52630. }
  52631. function n(e, t) {
  52632. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52633. var a = t[r]
  52634. , s = t[o]
  52635. , l = s.x - a.x
  52636. , c = s.y - a.y;
  52637. if (Math.abs(c) > Number.EPSILON) {
  52638. if (c < 0 && (a = t[o],
  52639. l = -l,
  52640. s = t[r],
  52641. c = -c),
  52642. e.y < a.y || e.y > s.y)
  52643. continue;
  52644. if (e.y === a.y) {
  52645. if (e.x === a.x)
  52646. return !0
  52647. } else {
  52648. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52649. if (0 == h)
  52650. return !0;
  52651. if (h < 0)
  52652. continue;
  52653. n = !n
  52654. }
  52655. } else {
  52656. if (e.y !== a.y)
  52657. continue;
  52658. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52659. return !0
  52660. }
  52661. }
  52662. return n
  52663. }
  52664. var r = Ci.ShapeUtils.isClockWise
  52665. , o = function(e) {
  52666. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52667. var o = e[n]
  52668. , a = o.args
  52669. , s = o.action;
  52670. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52671. i = new Ci.Path),
  52672. i[s].apply(i, a)
  52673. }
  52674. return 0 !== i.actions.length && t.push(i),
  52675. t
  52676. }(this.actions);
  52677. if (0 === o.length)
  52678. return [];
  52679. if (!0 === t)
  52680. return i(o);
  52681. var a, s, l, c = [];
  52682. if (1 === o.length)
  52683. return s = o[0],
  52684. (l = new Ci.Shape).actions = s.actions,
  52685. l.curves = s.curves,
  52686. c.push(l),
  52687. c;
  52688. var h = !r(o[0].getPoints());
  52689. h = e ? !h : h;
  52690. var u, d = [], p = [], f = [], g = 0;
  52691. p[g] = void 0,
  52692. f[g] = [];
  52693. for (var m = 0, v = o.length; m < v; m++)
  52694. a = r(u = (s = o[m]).getPoints()),
  52695. (a = e ? !a : a) ? (!h && p[g] && g++,
  52696. p[g] = {
  52697. s: new Ci.Shape,
  52698. p: u
  52699. },
  52700. p[g].s.actions = s.actions,
  52701. p[g].s.curves = s.curves,
  52702. h && g++,
  52703. f[g] = []) : f[g].push({
  52704. h: s,
  52705. p: u[0]
  52706. });
  52707. if (!p[0])
  52708. return i(o);
  52709. if (1 < p.length) {
  52710. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52711. d[C] = [];
  52712. for (C = 0,
  52713. I = p.length; C < I; C++)
  52714. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52715. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52716. n(b.p, p[T].p) && (C !== T && A.push({
  52717. froms: C,
  52718. tos: T,
  52719. hole: _
  52720. }),
  52721. w ? (w = !1,
  52722. d[T].push(b)) : y = !0);
  52723. w && d[C].push(b)
  52724. }
  52725. 0 < A.length && (y || (f = d))
  52726. }
  52727. m = 0;
  52728. for (var x, S = p.length; m < S; m++) {
  52729. l = p[m].s,
  52730. c.push(l);
  52731. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52732. l.holes.push(x[M].h)
  52733. }
  52734. return c
  52735. }
  52736. ,
  52737. Ci.Shape = function() {
  52738. Ci.Path.apply(this, arguments),
  52739. this.holes = []
  52740. }
  52741. ,
  52742. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52743. Ci.Shape.prototype.constructor = Ci.Shape,
  52744. Ci.Shape.prototype.extrude = function(e) {
  52745. return new Ci.ExtrudeGeometry(this,e)
  52746. }
  52747. ,
  52748. Ci.Shape.prototype.makeGeometry = function(e) {
  52749. return new Ci.ShapeGeometry(this,e)
  52750. }
  52751. ,
  52752. Ci.Shape.prototype.getPointsHoles = function(e) {
  52753. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52754. t[i] = this.holes[i].getPoints(e);
  52755. return t
  52756. }
  52757. ,
  52758. Ci.Shape.prototype.extractAllPoints = function(e) {
  52759. return {
  52760. shape: this.getPoints(e),
  52761. holes: this.getPointsHoles(e)
  52762. }
  52763. }
  52764. ,
  52765. Ci.Shape.prototype.extractPoints = function(e) {
  52766. return this.extractAllPoints(e)
  52767. }
  52768. ,
  52769. Ci.LineCurve = function(e, t) {
  52770. this.v1 = e,
  52771. this.v2 = t
  52772. }
  52773. ,
  52774. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52775. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52776. Ci.LineCurve.prototype.getPoint = function(e) {
  52777. var t = this.v2.clone().sub(this.v1);
  52778. return t.multiplyScalar(e).add(this.v1),
  52779. t
  52780. }
  52781. ,
  52782. Ci.LineCurve.prototype.getPointAt = function(e) {
  52783. return this.getPoint(e)
  52784. }
  52785. ,
  52786. Ci.LineCurve.prototype.getTangent = function(e) {
  52787. return this.v2.clone().sub(this.v1).normalize()
  52788. }
  52789. ,
  52790. Ci.QuadraticBezierCurve = function(e, t, i) {
  52791. this.v0 = e,
  52792. this.v1 = t,
  52793. this.v2 = i
  52794. }
  52795. ,
  52796. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52797. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52798. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52799. var t = Ci.ShapeUtils.b2;
  52800. 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))
  52801. }
  52802. ,
  52803. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52804. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52805. 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()
  52806. }
  52807. ,
  52808. Ci.CubicBezierCurve = function(e, t, i, n) {
  52809. this.v0 = e,
  52810. this.v1 = t,
  52811. this.v2 = i,
  52812. this.v3 = n
  52813. }
  52814. ,
  52815. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52816. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52817. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52818. var t = Ci.ShapeUtils.b3;
  52819. 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))
  52820. }
  52821. ,
  52822. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52823. var t = Ci.CurveUtils.tangentCubicBezier;
  52824. 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()
  52825. }
  52826. ,
  52827. Ci.SplineCurve = function(e) {
  52828. this.points = null == e ? [] : e
  52829. }
  52830. ,
  52831. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52832. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52833. Ci.SplineCurve.prototype.getPoint = function(e) {
  52834. var t = this.points
  52835. , i = (t.length - 1) * e
  52836. , n = Math.floor(i)
  52837. , r = i - n
  52838. , o = t[0 === n ? n : n - 1]
  52839. , a = t[n]
  52840. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52841. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52842. , c = Ci.CurveUtils.interpolate;
  52843. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52844. }
  52845. ,
  52846. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52847. this.aX = e,
  52848. this.aY = t,
  52849. this.xRadius = i,
  52850. this.yRadius = n,
  52851. this.aStartAngle = r,
  52852. this.aEndAngle = o,
  52853. this.aClockwise = a,
  52854. this.aRotation = s || 0
  52855. }
  52856. ,
  52857. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52858. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52859. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52860. var t, i = this.aEndAngle - this.aStartAngle;
  52861. i < 0 && (i += 2 * Math.PI),
  52862. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52863. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52864. var n = this.aX + this.xRadius * Math.cos(t)
  52865. , r = this.aY + this.yRadius * Math.sin(t);
  52866. if (0 !== this.aRotation) {
  52867. var o = Math.cos(this.aRotation)
  52868. , a = Math.sin(this.aRotation)
  52869. , s = n
  52870. , l = r;
  52871. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52872. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52873. }
  52874. return new Ci.Vector2(n,r)
  52875. }
  52876. ,
  52877. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52878. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52879. }
  52880. ,
  52881. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52882. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52883. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52884. this.v1 = e,
  52885. this.v2 = t
  52886. }, function(e) {
  52887. var t = new Ci.Vector3;
  52888. return t.subVectors(this.v2, this.v1),
  52889. t.multiplyScalar(e),
  52890. t.add(this.v1),
  52891. t
  52892. }),
  52893. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52894. this.v0 = e,
  52895. this.v1 = t,
  52896. this.v2 = i
  52897. }, function(e) {
  52898. var t = Ci.ShapeUtils.b2;
  52899. 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))
  52900. }),
  52901. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52902. this.v0 = e,
  52903. this.v1 = t,
  52904. this.v2 = i,
  52905. this.v3 = n
  52906. }, function(e) {
  52907. var t = Ci.ShapeUtils.b3;
  52908. 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))
  52909. }),
  52910. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52911. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52912. this.points = null == e ? [] : e
  52913. }, function(e) {
  52914. var t = this.points
  52915. , i = (t.length - 1) * e
  52916. , n = Math.floor(i)
  52917. , r = i - n
  52918. , o = t[0 == n ? n : n - 1]
  52919. , a = t[n]
  52920. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52921. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52922. , c = Ci.CurveUtils.interpolate;
  52923. 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))
  52924. }),
  52925. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52926. Xt = new xi,
  52927. Zt = new xi,
  52928. Kt = new xi,
  52929. xi.prototype.init = function(e, t, i, n) {
  52930. this.c0 = e,
  52931. this.c1 = i,
  52932. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52933. this.c3 = 2 * e - 2 * t + i + n
  52934. }
  52935. ,
  52936. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52937. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52938. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52939. s *= o,
  52940. l *= o,
  52941. this.init(t, i, s, l)
  52942. }
  52943. ,
  52944. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52945. this.init(t, i, r * (i - e), r * (n - t))
  52946. }
  52947. ,
  52948. xi.prototype.calc = function(e) {
  52949. var t = e * e
  52950. , i = t * e;
  52951. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52952. }
  52953. ,
  52954. Ci.Curve.create(function(e) {
  52955. this.points = e || [],
  52956. this.closed = !1
  52957. }, function(e) {
  52958. var t, i, n, r, o, a, s, l, c = this.points;
  52959. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52960. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52961. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52962. n = 1),
  52963. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52964. qt),
  52965. a = c[i % r],
  52966. s = c[(i + 1) % r],
  52967. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52968. qt),
  52969. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52970. var h = "chordal" === this.type ? .5 : .25
  52971. , u = Math.pow(o.distanceToSquared(a), h)
  52972. , d = Math.pow(a.distanceToSquared(s), h)
  52973. , p = Math.pow(s.distanceToSquared(l), h);
  52974. d < 1e-4 && (d = 1),
  52975. u < 1e-4 && (u = d),
  52976. p < 1e-4 && (p = d),
  52977. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52978. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52979. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52980. } else if ("catmullrom" === this.type) {
  52981. var f = void 0 !== this.tension ? this.tension : .5;
  52982. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52983. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52984. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52985. }
  52986. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52987. })),
  52988. Ci.ClosedSplineCurve3 = function(e) {
  52989. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52990. Ci.CatmullRomCurve3.call(this, e),
  52991. this.type = "catmullrom",
  52992. this.closed = !0
  52993. }
  52994. ,
  52995. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52996. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52997. Ci.Geometry.call(this),
  52998. this.type = "BoxGeometry",
  52999. this.parameters = {
  53000. width: e,
  53001. height: t,
  53002. depth: i,
  53003. widthSegments: n,
  53004. heightSegments: r,
  53005. depthSegments: o
  53006. },
  53007. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  53008. this.mergeVertices()
  53009. }
  53010. ,
  53011. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53012. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  53013. Ci.CubeGeometry = Ci.BoxGeometry,
  53014. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  53015. function a(e, t, i, n, r, o, a, s, l, c, h) {
  53016. 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++)
  53017. for (var E = I * d - f, _ = 0; _ < m; _++) {
  53018. var b = _ * u - p;
  53019. C[e] = b * n,
  53020. C[t] = E * r,
  53021. C[i] = g,
  53022. P[D] = C.x,
  53023. P[D + 1] = C.y,
  53024. P[D + 2] = C.z,
  53025. C[e] = 0,
  53026. C[t] = 0,
  53027. C[i] = 0 < s ? 1 : -1,
  53028. O[D] = C.x,
  53029. O[D + 1] = C.y,
  53030. O[D + 2] = C.z,
  53031. L[N] = _ / l,
  53032. L[N + 1] = 1 - I / c,
  53033. D += 3,
  53034. N += 2,
  53035. y += 1
  53036. }
  53037. for (I = 0; I < c; I++)
  53038. for (_ = 0; _ < l; _++) {
  53039. var w = B + _ + m * I
  53040. , T = B + _ + m * (I + 1)
  53041. , x = B + (_ + 1) + m * (I + 1)
  53042. , S = B + (_ + 1) + m * I;
  53043. R[F] = w,
  53044. R[F + 1] = T,
  53045. R[F + 2] = S,
  53046. R[F + 3] = T,
  53047. R[F + 4] = x,
  53048. R[F + 5] = S,
  53049. F += 6,
  53050. A += 6
  53051. }
  53052. M.addGroup(V, A, h),
  53053. V += A,
  53054. B += y
  53055. }
  53056. Ci.BufferGeometry.call(this),
  53057. this.type = "BoxBufferGeometry",
  53058. this.parameters = {
  53059. width: e,
  53060. height: t,
  53061. depth: i,
  53062. widthSegments: n,
  53063. heightSegments: r,
  53064. depthSegments: o
  53065. };
  53066. var M = this;
  53067. n = Math.floor(n) || 1,
  53068. r = Math.floor(r) || 1,
  53069. o = Math.floor(o) || 1;
  53070. var s, l, c, h, u = (h = 0,
  53071. h += (s = n) * (l = r) * 2,
  53072. h += s * (c = o) * 2,
  53073. 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;
  53074. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53075. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53076. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53077. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53078. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53079. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53080. this.setIndex(new Ci.BufferAttribute(R,1)),
  53081. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53082. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53083. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53084. }
  53085. ,
  53086. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53087. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53088. Ci.CircleGeometry = function(e, t, i, n) {
  53089. Ci.Geometry.call(this),
  53090. this.type = "CircleGeometry",
  53091. this.parameters = {
  53092. radius: e,
  53093. segments: t,
  53094. thetaStart: i,
  53095. thetaLength: n
  53096. },
  53097. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53098. }
  53099. ,
  53100. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53101. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53102. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53103. Ci.BufferGeometry.call(this),
  53104. this.type = "CircleBufferGeometry",
  53105. this.parameters = {
  53106. radius: e,
  53107. segments: t,
  53108. thetaStart: i,
  53109. thetaLength: n
  53110. },
  53111. e = e || 50,
  53112. t = void 0 !== t ? Math.max(3, t) : 8,
  53113. i = void 0 !== i ? i : 0,
  53114. n = void 0 !== n ? n : 2 * Math.PI;
  53115. var r = t + 2
  53116. , o = new Float32Array(3 * r)
  53117. , a = new Float32Array(3 * r)
  53118. , s = new Float32Array(2 * r);
  53119. a[2] = 1,
  53120. s[0] = .5,
  53121. s[1] = .5;
  53122. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53123. c += 3,
  53124. h += 2) {
  53125. var u = i + l / t * n;
  53126. o[c] = e * Math.cos(u),
  53127. o[c + 1] = e * Math.sin(u),
  53128. a[c + 2] = 1,
  53129. s[h] = (o[c] / e + 1) / 2,
  53130. s[h + 1] = (o[c + 1] / e + 1) / 2
  53131. }
  53132. var d = [];
  53133. for (c = 1; c <= t; c++)
  53134. d.push(c, c + 1, 0);
  53135. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53136. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53137. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53138. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53139. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53140. }
  53141. ,
  53142. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53143. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53144. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53145. function t(e) {
  53146. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53147. for (i = b,
  53148. t = 1; t <= m; t++)
  53149. I.setXYZ(b, 0, x * s, 0),
  53150. E.setXYZ(b, 0, s, 0),
  53151. !0 === e ? (r.x = t / m,
  53152. r.y = 0) : (r.x = (t - 1) / m,
  53153. r.y = 1),
  53154. _.setXY(b, r.x, r.y),
  53155. b++;
  53156. for (n = b,
  53157. t = 0; t <= m; t++) {
  53158. var l = t / m;
  53159. o.x = a * Math.sin(l * A + y),
  53160. o.y = x * s,
  53161. o.z = a * Math.cos(l * A + y),
  53162. I.setXYZ(b, o.x, o.y, o.z),
  53163. E.setXYZ(b, 0, s, 0),
  53164. _.setXY(b, l, !0 === e ? 1 : 0),
  53165. b++
  53166. }
  53167. for (t = 0; t < m; t++) {
  53168. var c = i + t
  53169. , h = n + t;
  53170. !0 === e ? (C.setX(w, h),
  53171. w++,
  53172. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53173. w++,
  53174. C.setX(w, h)),
  53175. w++,
  53176. C.setX(w, c),
  53177. w++
  53178. }
  53179. }
  53180. Ci.BufferGeometry.call(this),
  53181. this.type = "CylinderBufferGeometry",
  53182. this.parameters = {
  53183. radiusTop: p,
  53184. radiusBottom: f,
  53185. height: g,
  53186. radialSegments: m,
  53187. heightSegments: v,
  53188. openEnded: e,
  53189. thetaStart: y,
  53190. thetaLength: A
  53191. },
  53192. p = void 0 !== p ? p : 20,
  53193. f = void 0 !== f ? f : 20,
  53194. g = void 0 !== g ? g : 100,
  53195. m = Math.floor(m) || 8,
  53196. v = Math.floor(v) || 1,
  53197. e = void 0 !== e && e,
  53198. y = void 0 !== y ? y : 0,
  53199. A = void 0 !== A ? A : 2 * Math.PI;
  53200. var i, n, r = (n = (m + 1) * (v + 1),
  53201. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53202. n), o = (i = m * v * 2 * 3,
  53203. !1 === e && (i += 2 * m * 3),
  53204. 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;
  53205. (function() {
  53206. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53207. for (t = 0; t <= v; t++) {
  53208. var o = []
  53209. , a = t / v
  53210. , s = a * (f - p) + p;
  53211. for (e = 0; e <= m; e++) {
  53212. var l = e / m;
  53213. n.x = s * Math.sin(l * A + y),
  53214. n.y = -a * g + x,
  53215. n.z = s * Math.cos(l * A + y),
  53216. I.setXYZ(b, n.x, n.y, n.z),
  53217. i.copy(n),
  53218. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53219. i.z = Math.cos(l * A + y)),
  53220. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53221. E.setXYZ(b, i.x, i.y, i.z),
  53222. _.setXY(b, l, 1 - a),
  53223. o.push(b),
  53224. b++
  53225. }
  53226. T.push(o)
  53227. }
  53228. for (e = 0; e < m; e++)
  53229. for (t = 0; t < v; t++) {
  53230. var c = T[t][e]
  53231. , h = T[t + 1][e]
  53232. , u = T[t + 1][e + 1]
  53233. , d = T[t][e + 1];
  53234. C.setX(w, c),
  53235. w++,
  53236. C.setX(w, h),
  53237. w++,
  53238. C.setX(w, d),
  53239. w++,
  53240. C.setX(w, h),
  53241. w++,
  53242. C.setX(w, u),
  53243. w++,
  53244. C.setX(w, d),
  53245. w++
  53246. }
  53247. }
  53248. )(),
  53249. !1 === e && (0 < p && t(!0),
  53250. 0 < f && t(!1)),
  53251. this.setIndex(C),
  53252. this.addAttribute("position", I),
  53253. this.addAttribute("normal", E),
  53254. this.addAttribute("uv", _)
  53255. }
  53256. ,
  53257. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53258. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53259. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53260. Ci.Geometry.call(this),
  53261. this.type = "CylinderGeometry",
  53262. this.parameters = {
  53263. radiusTop: e,
  53264. radiusBottom: t,
  53265. height: i,
  53266. radialSegments: n,
  53267. heightSegments: r,
  53268. openEnded: o,
  53269. thetaStart: a,
  53270. thetaLength: s
  53271. },
  53272. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53273. this.mergeVertices()
  53274. }
  53275. ,
  53276. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53277. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53278. Ci.EdgesGeometry = function(e, t) {
  53279. function i(e, t) {
  53280. return e - t
  53281. }
  53282. Ci.BufferGeometry.call(this),
  53283. t = void 0 !== t ? t : 1;
  53284. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53285. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53286. n.mergeVertices(),
  53287. n.computeFaceNormals();
  53288. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53289. for (var d = c[h], p = 0; p < 3; p++) {
  53290. o[0] = d[s[p]],
  53291. o[1] = d[s[(p + 1) % 3]],
  53292. o.sort(i),
  53293. void 0 === a[g = o.toString()] ? a[g] = {
  53294. vert1: o[0],
  53295. vert2: o[1],
  53296. face1: h,
  53297. face2: void 0
  53298. } : a[g].face2 = h
  53299. }
  53300. var f = [];
  53301. for (var g in a) {
  53302. var m = a[g];
  53303. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53304. var v = l[m.vert1];
  53305. f.push(v.x),
  53306. f.push(v.y),
  53307. f.push(v.z),
  53308. v = l[m.vert2],
  53309. f.push(v.x),
  53310. f.push(v.y),
  53311. f.push(v.z)
  53312. }
  53313. }
  53314. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53315. }
  53316. ,
  53317. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53318. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53319. Ci.ExtrudeGeometry = function(e, t) {
  53320. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53321. this.type = "ExtrudeGeometry",
  53322. e = Array.isArray(e) ? e : [e],
  53323. this.addShapeList(e, t),
  53324. void this.computeFaceNormals())
  53325. }
  53326. ;
  53327. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53328. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53329. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53330. for (var i = e.length, n = 0; n < i; n++) {
  53331. var r = e[n];
  53332. this.addShape(r, t)
  53333. }
  53334. }
  53335. ,
  53336. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53337. function i(e, t, i) {
  53338. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53339. t.clone().multiplyScalar(i).add(e)
  53340. }
  53341. function n(e, t, i) {
  53342. 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;
  53343. if (Math.abs(u) > Number.EPSILON) {
  53344. var d = Math.sqrt(h)
  53345. , p = Math.sqrt(l * l + c * c)
  53346. , f = t.x - s / d
  53347. , g = t.y + a / d
  53348. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53349. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53350. if (v <= 2)
  53351. return new Ci.Vector2(n,r);
  53352. o = Math.sqrt(v / 2)
  53353. } else {
  53354. var y = !1;
  53355. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53356. o = y ? (n = -s,
  53357. r = a,
  53358. Math.sqrt(h)) : (n = a,
  53359. r = s,
  53360. Math.sqrt(h / 2))
  53361. }
  53362. return new Ci.Vector2(n / o,r / o)
  53363. }
  53364. function r(e, t) {
  53365. var i, n;
  53366. for (G = e.length; 0 <= --G; ) {
  53367. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53368. var r = 0
  53369. , o = A + 2 * m;
  53370. for (r = 0; r < o; r++) {
  53371. var a = U * r
  53372. , s = U * (r + 1);
  53373. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53374. }
  53375. }
  53376. }
  53377. function o(e, t, i) {
  53378. T.vertices.push(new Ci.Vector3(e,t,i))
  53379. }
  53380. function a(e, t, i) {
  53381. e += x,
  53382. t += x,
  53383. i += x,
  53384. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53385. var n = E.generateTopUV(T, e, t, i);
  53386. T.faceVertexUvs[0].push(n)
  53387. }
  53388. function l(e, t, i, n) {
  53389. e += x,
  53390. t += x,
  53391. i += x,
  53392. n += x,
  53393. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53394. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53395. var r = E.generateSideWallUV(T, e, t, i, n);
  53396. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53397. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53398. }
  53399. 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;
  53400. C && (s = C.getSpacedPoints(A),
  53401. v = !(I = !0),
  53402. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53403. h = new Ci.Vector3,
  53404. u = new Ci.Vector3,
  53405. d = new Ci.Vector3),
  53406. v || (g = f = m = 0);
  53407. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53408. if (P) {
  53409. for (M = M.reverse(),
  53410. b = 0,
  53411. w = R.length; b < w; b++)
  53412. _ = R[b],
  53413. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53414. P = !1
  53415. }
  53416. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53417. , L = M;
  53418. for (b = 0,
  53419. w = R.length; b < w; b++)
  53420. _ = R[b],
  53421. M = M.concat(_);
  53422. 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++,
  53423. j++,
  53424. Y++)
  53425. j === W && (j = 0),
  53426. Y === W && (Y = 0),
  53427. z[G] = n(L[G], L[j], L[Y]);
  53428. var q, X, Z = [], K = z.concat();
  53429. for (b = 0,
  53430. w = R.length; b < w; b++) {
  53431. for (_ = R[b],
  53432. q = [],
  53433. G = 0,
  53434. j = (W = _.length) - 1,
  53435. Y = G + 1; G < W; G++,
  53436. j++,
  53437. Y++)
  53438. j === W && (j = 0),
  53439. Y === W && (Y = 0),
  53440. q[G] = n(_[G], _[j], _[Y]);
  53441. Z.push(q),
  53442. K = K.concat(q)
  53443. }
  53444. for (D = 0; D < m; D++) {
  53445. for (B = f * (1 - (F = D / m)),
  53446. N = g * Math.sin(F * Math.PI / 2),
  53447. G = 0,
  53448. W = L.length; G < W; G++)
  53449. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53450. for (b = 0,
  53451. w = R.length; b < w; b++)
  53452. for (_ = R[b],
  53453. q = Z[b],
  53454. G = 0,
  53455. W = _.length; G < W; G++)
  53456. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53457. }
  53458. for (N = g,
  53459. G = 0; G < U; G++)
  53460. V = v ? i(M[G], K[G], N) : M[G],
  53461. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53462. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53463. d.copy(s[0]).add(u).add(h),
  53464. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53465. for (X = 1; X <= A; X++)
  53466. for (G = 0; G < U; G++)
  53467. V = v ? i(M[G], K[G], N) : M[G],
  53468. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53469. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53470. d.copy(s[X]).add(u).add(h),
  53471. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53472. for (D = m - 1; 0 <= D; D--) {
  53473. for (B = f * (1 - (F = D / m)),
  53474. N = g * Math.sin(F * Math.PI / 2),
  53475. G = 0,
  53476. W = L.length; G < W; G++)
  53477. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53478. for (b = 0,
  53479. w = R.length; b < w; b++)
  53480. for (_ = R[b],
  53481. q = Z[b],
  53482. G = 0,
  53483. W = _.length; G < W; G++)
  53484. V = i(_[G], q[G], N),
  53485. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53486. }
  53487. (function() {
  53488. if (v) {
  53489. var e = 0
  53490. , t = U * e;
  53491. for (G = 0; G < H; G++)
  53492. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53493. for (t = U * (e = A + 2 * m),
  53494. G = 0; G < H; G++)
  53495. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53496. } else {
  53497. for (G = 0; G < H; G++)
  53498. a((k = O[G])[2], k[1], k[0]);
  53499. for (G = 0; G < H; G++)
  53500. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53501. }
  53502. }
  53503. )(),
  53504. function() {
  53505. var e = 0;
  53506. for (r(L, e),
  53507. e += L.length,
  53508. b = 0,
  53509. w = R.length; b < w; b++)
  53510. r(_ = R[b], e),
  53511. e += _.length
  53512. }()
  53513. }
  53514. ,
  53515. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53516. generateTopUV: function(e, t, i, n) {
  53517. var r = e.vertices
  53518. , o = r[t]
  53519. , a = r[i]
  53520. , s = r[n];
  53521. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53522. },
  53523. generateSideWallUV: function(e, t, i, n, r) {
  53524. var o = e.vertices
  53525. , a = o[t]
  53526. , s = o[i]
  53527. , l = o[n]
  53528. , c = o[r];
  53529. 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)]
  53530. }
  53531. },
  53532. Ci.ShapeGeometry = function(e, t) {
  53533. Ci.Geometry.call(this),
  53534. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53535. this.addShapeList(e, t),
  53536. this.computeFaceNormals()
  53537. }
  53538. ,
  53539. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53540. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53541. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53542. for (var i = 0, n = e.length; i < n; i++)
  53543. this.addShape(e[i], t);
  53544. return this
  53545. }
  53546. ,
  53547. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53548. void 0 === t && (t = {});
  53549. 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);
  53550. if (d) {
  53551. for (h = h.reverse(),
  53552. i = 0,
  53553. n = u.length; i < n; i++)
  53554. r = u[i],
  53555. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53556. d = !1
  53557. }
  53558. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53559. for (i = 0,
  53560. n = u.length; i < n; i++)
  53561. r = u[i],
  53562. h = h.concat(r);
  53563. var f, g, m = h.length, v = p.length;
  53564. for (i = 0; i < m; i++)
  53565. f = h[i],
  53566. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53567. for (i = 0; i < v; i++) {
  53568. var y = (g = p[i])[0] + l
  53569. , A = g[1] + l
  53570. , C = g[2] + l;
  53571. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53572. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53573. }
  53574. }
  53575. ,
  53576. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53577. Ci.BufferGeometry.call(this),
  53578. this.type = "LatheBufferGeometry",
  53579. this.parameters = {
  53580. points: e,
  53581. segments: t,
  53582. phiStart: i,
  53583. phiLength: n
  53584. },
  53585. t = Math.floor(t) || 12,
  53586. i = i || 0,
  53587. n = n || 2 * Math.PI,
  53588. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53589. 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,
  53590. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53591. for (o = 0; o <= t; o++) {
  53592. var v = i + o * f * n
  53593. , y = Math.sin(v)
  53594. , A = Math.cos(v);
  53595. for (a = 0; a <= e.length - 1; a++)
  53596. g.x = e[a].x * y,
  53597. g.y = e[a].y,
  53598. g.z = e[a].x * A,
  53599. h.setXYZ(d, g.x, g.y, g.z),
  53600. m.x = o / t,
  53601. m.y = a / (e.length - 1),
  53602. u.setXY(d, m.x, m.y),
  53603. d++
  53604. }
  53605. for (o = 0; o < t; o++)
  53606. for (a = 0; a < e.length - 1; a++) {
  53607. var C = r = a + o * e.length
  53608. , I = r + e.length
  53609. , E = r + e.length + 1
  53610. , _ = r + 1;
  53611. c.setX(p, C),
  53612. p++,
  53613. c.setX(p, I),
  53614. p++,
  53615. c.setX(p, _),
  53616. p++,
  53617. c.setX(p, I),
  53618. p++,
  53619. c.setX(p, E),
  53620. p++,
  53621. c.setX(p, _),
  53622. p++
  53623. }
  53624. if (this.setIndex(c),
  53625. this.addAttribute("position", h),
  53626. this.addAttribute("uv", u),
  53627. this.computeVertexNormals(),
  53628. n === 2 * Math.PI) {
  53629. var b = this.attributes.normal.array
  53630. , w = new Ci.Vector3
  53631. , T = new Ci.Vector3
  53632. , x = new Ci.Vector3;
  53633. for (r = t * e.length * 3,
  53634. a = o = 0; o < e.length; o++,
  53635. a += 3)
  53636. w.x = b[a + 0],
  53637. w.y = b[a + 1],
  53638. w.z = b[a + 2],
  53639. T.x = b[r + a + 0],
  53640. T.y = b[r + a + 1],
  53641. T.z = b[r + a + 2],
  53642. x.addVectors(w, T).normalize(),
  53643. b[a + 0] = b[r + a + 0] = x.x,
  53644. b[a + 1] = b[r + a + 1] = x.y,
  53645. b[a + 2] = b[r + a + 2] = x.z
  53646. }
  53647. }
  53648. ,
  53649. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53650. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53651. Ci.LatheGeometry = function(e, t, i, n) {
  53652. Ci.Geometry.call(this),
  53653. this.type = "LatheGeometry",
  53654. this.parameters = {
  53655. points: e,
  53656. segments: t,
  53657. phiStart: i,
  53658. phiLength: n
  53659. },
  53660. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53661. this.mergeVertices()
  53662. }
  53663. ,
  53664. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53665. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53666. Ci.PlaneGeometry = function(e, t, i, n) {
  53667. Ci.Geometry.call(this),
  53668. this.type = "PlaneGeometry",
  53669. this.parameters = {
  53670. width: e,
  53671. height: t,
  53672. widthSegments: i,
  53673. heightSegments: n
  53674. },
  53675. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53676. }
  53677. ,
  53678. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53679. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53680. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53681. Ci.BufferGeometry.call(this),
  53682. this.type = "PlaneBufferGeometry",
  53683. this.parameters = {
  53684. width: e,
  53685. height: t,
  53686. widthSegments: i,
  53687. heightSegments: n
  53688. };
  53689. 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++)
  53690. for (var y = v * u - o, A = 0; A < l; A++) {
  53691. var C = A * h - r;
  53692. d[g] = C,
  53693. d[g + 1] = -y,
  53694. p[g + 2] = 1,
  53695. f[m] = A / a,
  53696. f[m + 1] = 1 - v / s,
  53697. g += 3,
  53698. m += 2
  53699. }
  53700. g = 0;
  53701. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53702. for (v = 0; v < s; v++)
  53703. for (A = 0; A < a; A++) {
  53704. var E = A + l * v
  53705. , _ = A + l * (v + 1)
  53706. , b = A + 1 + l * (v + 1)
  53707. , w = A + 1 + l * v;
  53708. I[g] = E,
  53709. I[g + 1] = _,
  53710. I[g + 2] = w,
  53711. I[g + 3] = _,
  53712. I[g + 4] = b,
  53713. I[g + 5] = w,
  53714. g += 6
  53715. }
  53716. this.setIndex(new Ci.BufferAttribute(I,1)),
  53717. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53718. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53719. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53720. }
  53721. ,
  53722. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53723. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53724. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53725. Ci.BufferGeometry.call(this),
  53726. this.type = "RingBufferGeometry",
  53727. this.parameters = {
  53728. innerRadius: e,
  53729. outerRadius: t,
  53730. thetaSegments: i,
  53731. phiSegments: n,
  53732. thetaStart: r,
  53733. thetaLength: o
  53734. },
  53735. e = e || 20,
  53736. t = t || 50,
  53737. r = void 0 !== r ? r : 0,
  53738. o = void 0 !== o ? o : 2 * Math.PI;
  53739. 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;
  53740. for (s = 0; s <= n; s++) {
  53741. for (l = 0; l <= i; l++)
  53742. a = r + l / i * o,
  53743. A.x = v * Math.cos(a),
  53744. A.y = v * Math.sin(a),
  53745. d.setXYZ(g, A.x, A.y, A.z),
  53746. p.setXYZ(g, 0, 0, 1),
  53747. C.x = (A.x / t + 1) / 2,
  53748. C.y = (A.y / t + 1) / 2,
  53749. f.setXY(g, C.x, C.y),
  53750. g++;
  53751. v += y
  53752. }
  53753. for (s = 0; s < n; s++) {
  53754. var I = s * (i + 1);
  53755. for (l = 0; l < i; l++) {
  53756. var E = a = l + I
  53757. , _ = a + i + 1
  53758. , b = a + i + 2
  53759. , w = a + 1;
  53760. u.setX(m, E),
  53761. m++,
  53762. u.setX(m, _),
  53763. m++,
  53764. u.setX(m, b),
  53765. m++,
  53766. u.setX(m, E),
  53767. m++,
  53768. u.setX(m, b),
  53769. m++,
  53770. u.setX(m, w),
  53771. m++
  53772. }
  53773. }
  53774. this.setIndex(u),
  53775. this.addAttribute("position", d),
  53776. this.addAttribute("normal", p),
  53777. this.addAttribute("uv", f)
  53778. }
  53779. ,
  53780. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53781. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53782. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53783. Ci.Geometry.call(this),
  53784. this.type = "RingGeometry",
  53785. this.parameters = {
  53786. innerRadius: e,
  53787. outerRadius: t,
  53788. thetaSegments: i,
  53789. phiSegments: n,
  53790. thetaStart: r,
  53791. thetaLength: o
  53792. },
  53793. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53794. }
  53795. ,
  53796. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53797. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53798. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53799. Ci.Geometry.call(this),
  53800. this.type = "SphereGeometry",
  53801. this.parameters = {
  53802. radius: e,
  53803. widthSegments: t,
  53804. heightSegments: i,
  53805. phiStart: n,
  53806. phiLength: r,
  53807. thetaStart: o,
  53808. thetaLength: a
  53809. },
  53810. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53811. }
  53812. ,
  53813. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53814. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53815. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53816. Ci.BufferGeometry.call(this),
  53817. this.type = "SphereBufferGeometry",
  53818. this.parameters = {
  53819. radius: e,
  53820. widthSegments: t,
  53821. heightSegments: i,
  53822. phiStart: n,
  53823. phiLength: r,
  53824. thetaStart: o,
  53825. thetaLength: a
  53826. },
  53827. e = e || 50,
  53828. t = Math.max(3, Math.floor(t) || 8),
  53829. i = Math.max(2, Math.floor(i) || 6),
  53830. n = void 0 !== n ? n : 0,
  53831. r = void 0 !== r ? r : 2 * Math.PI;
  53832. 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++) {
  53833. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53834. var A = y / t
  53835. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53836. , I = e * Math.cos(o + v * a)
  53837. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53838. f.set(C, I, E).normalize(),
  53839. c.setXYZ(d, C, I, E),
  53840. h.setXYZ(d, f.x, f.y, f.z),
  53841. u.setXY(d, A, 1 - v),
  53842. m.push(d),
  53843. d++
  53844. }
  53845. p.push(m)
  53846. }
  53847. var _ = [];
  53848. for (g = 0; g < i; g++)
  53849. for (y = 0; y < t; y++) {
  53850. var b = p[g][y + 1]
  53851. , w = p[g][y]
  53852. , T = p[g + 1][y]
  53853. , x = p[g + 1][y + 1];
  53854. (0 !== g || 0 < o) && _.push(b, w, x),
  53855. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53856. }
  53857. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53858. this.addAttribute("position", c),
  53859. this.addAttribute("normal", h),
  53860. this.addAttribute("uv", u),
  53861. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53862. }
  53863. ,
  53864. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53865. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53866. Ci.TextGeometry = function(e, t) {
  53867. var i = (t = t || {}).font;
  53868. if (i instanceof Ci.Font == 0)
  53869. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53870. new Ci.Geometry;
  53871. var n = i.generateShapes(e, t.size, t.curveSegments);
  53872. t.amount = void 0 !== t.height ? t.height : 50,
  53873. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53874. void 0 === t.bevelSize && (t.bevelSize = 8),
  53875. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53876. Ci.ExtrudeGeometry.call(this, n, t),
  53877. this.type = "TextGeometry"
  53878. }
  53879. ,
  53880. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53881. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53882. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53883. Ci.BufferGeometry.call(this),
  53884. this.type = "TorusBufferGeometry",
  53885. this.parameters = {
  53886. radius: e,
  53887. tube: t,
  53888. radialSegments: i,
  53889. tubularSegments: n,
  53890. arc: r
  53891. },
  53892. e = e || 100,
  53893. t = t || 40,
  53894. i = Math.floor(i) || 8,
  53895. n = Math.floor(n) || 6,
  53896. r = r || 2 * Math.PI;
  53897. 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;
  53898. for (o = 0; o <= i; o++)
  53899. for (a = 0; a <= n; a++) {
  53900. var A = a / n * r
  53901. , C = o / i * Math.PI * 2;
  53902. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53903. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53904. v.z = t * Math.sin(C),
  53905. h[p] = v.x,
  53906. h[p + 1] = v.y,
  53907. h[p + 2] = v.z,
  53908. m.x = e * Math.cos(A),
  53909. m.y = e * Math.sin(A),
  53910. y.subVectors(v, m).normalize(),
  53911. u[p] = y.x,
  53912. u[p + 1] = y.y,
  53913. u[p + 2] = y.z,
  53914. d[f] = a / n,
  53915. d[f + 1] = o / i,
  53916. p += 3,
  53917. f += 2
  53918. }
  53919. for (o = 1; o <= i; o++)
  53920. for (a = 1; a <= n; a++) {
  53921. var I = (n + 1) * o + a - 1
  53922. , E = (n + 1) * (o - 1) + a - 1
  53923. , _ = (n + 1) * (o - 1) + a
  53924. , b = (n + 1) * o + a;
  53925. c[g] = I,
  53926. c[g + 1] = E,
  53927. c[g + 2] = b,
  53928. c[g + 3] = E,
  53929. c[g + 4] = _,
  53930. c[g + 5] = b,
  53931. g += 6
  53932. }
  53933. this.setIndex(new Ci.BufferAttribute(c,1)),
  53934. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53935. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53936. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53937. }
  53938. ,
  53939. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53940. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53941. Ci.TorusGeometry = function(e, t, i, n, r) {
  53942. Ci.Geometry.call(this),
  53943. this.type = "TorusGeometry",
  53944. this.parameters = {
  53945. radius: e,
  53946. tube: t,
  53947. radialSegments: i,
  53948. tubularSegments: n,
  53949. arc: r
  53950. },
  53951. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53952. }
  53953. ,
  53954. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53955. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53956. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53957. function a(e, t, i, n, r) {
  53958. var o = Math.cos(e)
  53959. , a = Math.sin(e)
  53960. , s = i / t * e
  53961. , l = Math.cos(s);
  53962. r.x = n * (2 + l) * .5 * o,
  53963. r.y = n * (2 + l) * a * .5,
  53964. r.z = n * Math.sin(s) * .5
  53965. }
  53966. Ci.BufferGeometry.call(this),
  53967. this.type = "TorusKnotBufferGeometry",
  53968. this.parameters = {
  53969. radius: e,
  53970. tube: t,
  53971. tubularSegments: i,
  53972. radialSegments: n,
  53973. p: r,
  53974. q: o
  53975. },
  53976. e = e || 100,
  53977. t = t || 40,
  53978. i = Math.floor(i) || 64,
  53979. r = r || 2,
  53980. o = o || 3;
  53981. 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;
  53982. for (s = 0; s <= i; ++s) {
  53983. var w = s / i * r * Math.PI * 2;
  53984. for (a(w, r, o, e, C),
  53985. a(.01 + w, r, o, e, I),
  53986. _.subVectors(I, C),
  53987. b.addVectors(I, C),
  53988. E.crossVectors(_, b),
  53989. b.crossVectors(E, _),
  53990. E.normalize(),
  53991. b.normalize(),
  53992. l = 0; l <= n; ++l) {
  53993. var T = l / n * Math.PI * 2
  53994. , x = -t * Math.cos(T)
  53995. , S = t * Math.sin(T);
  53996. v.x = C.x + (x * b.x + S * E.x),
  53997. v.y = C.y + (x * b.y + S * E.y),
  53998. v.z = C.z + (x * b.z + S * E.z),
  53999. d.setXYZ(g, v.x, v.y, v.z),
  54000. y.subVectors(v, C).normalize(),
  54001. p.setXYZ(g, y.x, y.y, y.z),
  54002. A.x = s / i,
  54003. A.y = l / n,
  54004. f.setXY(g, A.x, A.y),
  54005. g++
  54006. }
  54007. }
  54008. for (l = 1; l <= i; l++)
  54009. for (s = 1; s <= n; s++) {
  54010. var M = (n + 1) * (l - 1) + (s - 1)
  54011. , R = (n + 1) * l + (s - 1)
  54012. , P = (n + 1) * l + s
  54013. , O = (n + 1) * (l - 1) + s;
  54014. u.setX(m, M),
  54015. m++,
  54016. u.setX(m, R),
  54017. m++,
  54018. u.setX(m, O),
  54019. m++,
  54020. u.setX(m, R),
  54021. m++,
  54022. u.setX(m, P),
  54023. m++,
  54024. u.setX(m, O),
  54025. m++
  54026. }
  54027. this.setIndex(u),
  54028. this.addAttribute("position", d),
  54029. this.addAttribute("normal", p),
  54030. this.addAttribute("uv", f)
  54031. }
  54032. ,
  54033. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54034. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  54035. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  54036. Ci.Geometry.call(this),
  54037. this.type = "TorusKnotGeometry",
  54038. this.parameters = {
  54039. radius: e,
  54040. tube: t,
  54041. tubularSegments: i,
  54042. radialSegments: n,
  54043. p: r,
  54044. q: o
  54045. },
  54046. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54047. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54048. this.mergeVertices()
  54049. }
  54050. ,
  54051. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54052. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54053. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54054. Ci.Geometry.call(this),
  54055. this.type = "TubeGeometry",
  54056. this.parameters = {
  54057. path: e,
  54058. segments: t,
  54059. radius: i,
  54060. radialSegments: n,
  54061. closed: r,
  54062. taper: o
  54063. },
  54064. t = t || 64,
  54065. i = i || 1,
  54066. n = n || 8,
  54067. r = r || !1,
  54068. o = o || Ci.TubeGeometry.NoTaper;
  54069. 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;
  54070. for (this.tangents = D,
  54071. this.normals = N,
  54072. this.binormals = F,
  54073. f = 0; f < P; f++)
  54074. for (M[f] = [],
  54075. l = f / (P - 1),
  54076. p = e.getPointAt(l),
  54077. D[f],
  54078. a = N[f],
  54079. s = F[f],
  54080. h = i * o(l),
  54081. g = 0; g < n; g++)
  54082. c = g / n * 2 * Math.PI,
  54083. u = -h * Math.cos(c),
  54084. d = h * Math.sin(c),
  54085. O.copy(p),
  54086. O.x += u * a.x + d * s.x,
  54087. O.y += u * a.y + d * s.y,
  54088. O.z += u * a.z + d * s.z,
  54089. M[f][g] = (T = O.x,
  54090. x = O.y,
  54091. S = O.z,
  54092. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54093. for (f = 0; f < t; f++)
  54094. for (g = 0; g < n; g++)
  54095. m = r ? (f + 1) % t : f + 1,
  54096. v = (g + 1) % n,
  54097. y = M[f][g],
  54098. A = M[m][g],
  54099. C = M[m][v],
  54100. I = M[f][v],
  54101. E = new Ci.Vector2(f / t,g / n),
  54102. _ = new Ci.Vector2((f + 1) / t,g / n),
  54103. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54104. w = new Ci.Vector2(f / t,(g + 1) / n),
  54105. this.faces.push(new Ci.Face3(y,A,I)),
  54106. this.faceVertexUvs[0].push([E, _, w]),
  54107. this.faces.push(new Ci.Face3(A,C,I)),
  54108. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54109. this.computeFaceNormals(),
  54110. this.computeVertexNormals()
  54111. }
  54112. ,
  54113. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54114. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54115. Ci.TubeGeometry.NoTaper = function(e) {
  54116. return 1
  54117. }
  54118. ,
  54119. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54120. return Math.sin(Math.PI * e)
  54121. }
  54122. ,
  54123. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54124. 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;
  54125. for (this.tangents = u,
  54126. this.normals = d,
  54127. this.binormals = p,
  54128. l = 0; l < m; l++)
  54129. c = l / (m - 1),
  54130. u[l] = e.getTangentAt(c),
  54131. u[l].normalize();
  54132. for (d[0] = new Ci.Vector3,
  54133. p[0] = new Ci.Vector3,
  54134. r = Number.MAX_VALUE,
  54135. o = Math.abs(u[0].x),
  54136. a = Math.abs(u[0].y),
  54137. s = Math.abs(u[0].z),
  54138. o <= r && (r = o,
  54139. h.set(1, 0, 0)),
  54140. a <= r && (r = a,
  54141. h.set(0, 1, 0)),
  54142. s <= r && h.set(0, 0, 1),
  54143. f.crossVectors(u[0], h).normalize(),
  54144. d[0].crossVectors(u[0], f),
  54145. p[0].crossVectors(u[0], d[0]),
  54146. l = 1; l < m; l++)
  54147. d[l] = d[l - 1].clone(),
  54148. p[l] = p[l - 1].clone(),
  54149. f.crossVectors(u[l - 1], u[l]),
  54150. f.length() > Number.EPSILON && (f.normalize(),
  54151. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54152. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54153. p[l].crossVectors(u[l], d[l]);
  54154. if (i)
  54155. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54156. n /= m - 1,
  54157. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54158. l = 1; l < m; l++)
  54159. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54160. p[l].crossVectors(u[l], d[l])
  54161. }
  54162. ,
  54163. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54164. function f(e) {
  54165. var t = e.normalize().clone();
  54166. t.index = m.vertices.push(t) - 1;
  54167. var i = a(e) / 2 / Math.PI + .5
  54168. , n = function(e) {
  54169. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54170. }(e) / Math.PI + .5;
  54171. return t.uv = new Ci.Vector2(i,1 - n),
  54172. t
  54173. }
  54174. function g(e, t, i, n) {
  54175. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54176. m.faces.push(r),
  54177. y.copy(e).add(t).add(i).divideScalar(3);
  54178. var o = a(y);
  54179. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54180. }
  54181. function r(e, t) {
  54182. 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++) {
  54183. a[l] = [];
  54184. 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++)
  54185. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54186. }
  54187. for (l = 0; l < i; l++)
  54188. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54189. var p = Math.floor(d / 2);
  54190. 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)
  54191. }
  54192. }
  54193. function a(e) {
  54194. return Math.atan2(e.z, -e.x)
  54195. }
  54196. function s(e, t, i) {
  54197. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54198. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54199. e.clone()
  54200. }
  54201. Ci.Geometry.call(this),
  54202. this.type = "PolyhedronGeometry",
  54203. this.parameters = {
  54204. vertices: e,
  54205. indices: t,
  54206. radius: i,
  54207. detail: n
  54208. },
  54209. i = i || 1,
  54210. n = n || 0;
  54211. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54212. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54213. var c = this.vertices
  54214. , h = []
  54215. , u = (o = 0,
  54216. 0);
  54217. for (l = t.length; o < l; o += 3,
  54218. u++) {
  54219. var d = c[t[o]]
  54220. , p = c[t[o + 1]]
  54221. , v = c[t[o + 2]];
  54222. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54223. }
  54224. var y = new Ci.Vector3;
  54225. for (o = 0,
  54226. l = h.length; o < l; o++)
  54227. r(h[o], n);
  54228. for (o = 0,
  54229. l = this.faceVertexUvs[0].length; o < l; o++) {
  54230. var A = this.faceVertexUvs[0][o]
  54231. , C = A[0].x
  54232. , I = A[1].x
  54233. , E = A[2].x
  54234. , _ = Math.max(C, I, E)
  54235. , b = Math.min(C, I, E);
  54236. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54237. I < .2 && (A[1].x += 1),
  54238. E < .2 && (A[2].x += 1))
  54239. }
  54240. for (o = 0,
  54241. l = this.vertices.length; o < l; o++)
  54242. this.vertices[o].multiplyScalar(i);
  54243. this.mergeVertices(),
  54244. this.computeFaceNormals(),
  54245. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54246. }
  54247. ,
  54248. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54249. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54250. Ci.DodecahedronGeometry = function(e, t) {
  54251. var i = (1 + Math.sqrt(5)) / 2
  54252. , n = 1 / i
  54253. , 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];
  54254. 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),
  54255. this.type = "DodecahedronGeometry",
  54256. this.parameters = {
  54257. radius: e,
  54258. detail: t
  54259. }
  54260. }
  54261. ,
  54262. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54263. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54264. Ci.IcosahedronGeometry = function(e, t) {
  54265. var i = (1 + Math.sqrt(5)) / 2
  54266. , 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];
  54267. 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),
  54268. this.type = "IcosahedronGeometry",
  54269. this.parameters = {
  54270. radius: e,
  54271. detail: t
  54272. }
  54273. }
  54274. ,
  54275. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54276. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54277. Ci.OctahedronGeometry = function(e, t) {
  54278. 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),
  54279. this.type = "OctahedronGeometry",
  54280. this.parameters = {
  54281. radius: e,
  54282. detail: t
  54283. }
  54284. }
  54285. ,
  54286. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54287. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54288. Ci.TetrahedronGeometry = function(e, t) {
  54289. 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),
  54290. this.type = "TetrahedronGeometry",
  54291. this.parameters = {
  54292. radius: e,
  54293. detail: t
  54294. }
  54295. }
  54296. ,
  54297. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54298. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54299. Ci.ParametricGeometry = function(e, t, i) {
  54300. Ci.Geometry.call(this),
  54301. this.type = "ParametricGeometry",
  54302. this.parameters = {
  54303. func: e,
  54304. slices: t,
  54305. stacks: i
  54306. };
  54307. 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;
  54308. for (n = 0; n <= i; n++)
  54309. for (a = n / i,
  54310. r = 0; r <= t; r++)
  54311. o = e(r / t, a),
  54312. g.push(o);
  54313. for (n = 0; n < i; n++)
  54314. for (r = 0; r < t; r++)
  54315. l = (s = n * y + r) + 1,
  54316. c = (n + 1) * y + r + 1,
  54317. h = (n + 1) * y + r,
  54318. u = new Ci.Vector2(r / t,n / i),
  54319. d = new Ci.Vector2((r + 1) / t,n / i),
  54320. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54321. f = new Ci.Vector2(r / t,(n + 1) / i),
  54322. m.push(new Ci.Face3(s,l,h)),
  54323. v.push([u, d, f]),
  54324. m.push(new Ci.Face3(l,c,h)),
  54325. v.push([d.clone(), p, f.clone()]);
  54326. this.computeFaceNormals(),
  54327. this.computeVertexNormals()
  54328. }
  54329. ,
  54330. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54331. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54332. Ci.WireframeGeometry = function(e) {
  54333. function t(e, t) {
  54334. return e - t
  54335. }
  54336. Ci.BufferGeometry.call(this);
  54337. var i = [0, 0]
  54338. , n = {}
  54339. , r = ["a", "b", "c"];
  54340. if (e instanceof Ci.Geometry) {
  54341. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54342. for (var u = a[c], d = 0; d < 3; d++) {
  54343. i[0] = u[r[d]],
  54344. i[1] = u[r[(d + 1) % 3]],
  54345. i.sort(t),
  54346. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54347. l[2 * s + 1] = i[1],
  54348. n[E] = !0,
  54349. s++)
  54350. }
  54351. var p = new Float32Array(2 * s * 3);
  54352. for (c = 0,
  54353. h = s; c < h; c++)
  54354. for (d = 0; d < 2; d++) {
  54355. var f = o[l[2 * c + d]];
  54356. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54357. p[_ + 1] = f.y,
  54358. p[_ + 2] = f.z
  54359. }
  54360. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54361. } else if (e instanceof Ci.BufferGeometry)
  54362. if (null !== e.index) {
  54363. var g = e.index.array
  54364. , m = (o = e.attributes.position,
  54365. e.groups);
  54366. s = 0;
  54367. 0 === m.length && e.addGroup(0, g.length);
  54368. l = new Uint32Array(2 * g.length);
  54369. for (var v = 0, y = m.length; v < y; ++v)
  54370. for (var A = m[v], C = A.start, I = (c = C,
  54371. C + A.count); c < I; c += 3)
  54372. for (d = 0; d < 3; d++) {
  54373. var E;
  54374. i[0] = g[c + d],
  54375. i[1] = g[c + (d + 1) % 3],
  54376. i.sort(t),
  54377. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54378. l[2 * s + 1] = i[1],
  54379. n[E] = !0,
  54380. s++)
  54381. }
  54382. for (p = new Float32Array(2 * s * 3),
  54383. c = 0,
  54384. h = s; c < h; c++)
  54385. for (d = 0; d < 2; d++) {
  54386. var _ = 6 * c + 3 * d
  54387. , b = l[2 * c + d];
  54388. p[_ + 0] = o.getX(b),
  54389. p[_ + 1] = o.getY(b),
  54390. p[_ + 2] = o.getZ(b)
  54391. }
  54392. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54393. } else {
  54394. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54395. for (p = new Float32Array(2 * s * 3),
  54396. c = 0,
  54397. h = w; c < h; c++)
  54398. for (d = 0; d < 3; d++) {
  54399. var T = 9 * c + 3 * d;
  54400. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54401. p[_ + 1] = o[1 + T],
  54402. p[_ + 2] = o[2 + T];
  54403. b = 9 * c + (d + 1) % 3 * 3;
  54404. p[_ + 3] = o[b],
  54405. p[_ + 4] = o[b + 1],
  54406. p[_ + 5] = o[b + 2]
  54407. }
  54408. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54409. }
  54410. }
  54411. ,
  54412. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54413. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54414. Ci.AxisHelper = function(e) {
  54415. e = e || 1;
  54416. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54417. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54418. , n = new Ci.BufferGeometry;
  54419. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54420. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54421. var r = new Ci.LineBasicMaterial({
  54422. vertexColors: Ci.VertexColors
  54423. });
  54424. Ci.LineSegments.call(this, n, r)
  54425. }
  54426. ,
  54427. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54428. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54429. Ci.ArrowHelper = function() {
  54430. var a = new Ci.Geometry;
  54431. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54432. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54433. return s.translate(0, -.5, 0),
  54434. function(e, t, i, n, r, o) {
  54435. Ci.Object3D.call(this),
  54436. void 0 === n && (n = 16776960),
  54437. void 0 === i && (i = 1),
  54438. void 0 === r && (r = .2 * i),
  54439. void 0 === o && (o = .2 * r),
  54440. this.position.copy(t),
  54441. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54442. color: n
  54443. })),
  54444. this.line.matrixAutoUpdate = !1,
  54445. this.add(this.line),
  54446. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54447. color: n
  54448. })),
  54449. this.cone.matrixAutoUpdate = !1,
  54450. this.add(this.cone),
  54451. this.setDirection(e),
  54452. this.setLength(i, r, o)
  54453. }
  54454. }(),
  54455. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54456. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54457. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54458. function(e) {
  54459. .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(),
  54460. yi = Math.acos(e.y),
  54461. this.quaternion.setFromAxisAngle(Ai, yi))
  54462. }
  54463. ),
  54464. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54465. void 0 === t && (t = .2 * e),
  54466. void 0 === i && (i = .2 * t),
  54467. this.line.scale.set(1, Math.max(0, e - t), 1),
  54468. this.line.updateMatrix(),
  54469. this.cone.scale.set(i, t, i),
  54470. this.cone.position.y = e,
  54471. this.cone.updateMatrix()
  54472. }
  54473. ,
  54474. Ci.ArrowHelper.prototype.setColor = function(e) {
  54475. this.line.material.color.set(e),
  54476. this.cone.material.color.set(e)
  54477. }
  54478. ,
  54479. Ci.BoxHelper = function(e) {
  54480. 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])
  54481. , i = new Float32Array(24)
  54482. , n = new Ci.BufferGeometry;
  54483. n.setIndex(new Ci.BufferAttribute(t,1)),
  54484. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54485. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54486. color: 16776960
  54487. })),
  54488. void 0 !== e && this.update(e)
  54489. }
  54490. ,
  54491. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54492. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54493. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54494. function(e) {
  54495. if (vi.setFromObject(e),
  54496. !vi.isEmpty()) {
  54497. var t = vi.min
  54498. , i = vi.max
  54499. , n = this.geometry.attributes.position
  54500. , r = n.array;
  54501. r[0] = i.x,
  54502. r[1] = i.y,
  54503. r[2] = i.z,
  54504. r[3] = t.x,
  54505. r[4] = i.y,
  54506. r[5] = i.z,
  54507. r[6] = t.x,
  54508. r[7] = t.y,
  54509. r[8] = i.z,
  54510. r[9] = i.x,
  54511. r[10] = t.y,
  54512. r[11] = i.z,
  54513. r[12] = i.x,
  54514. r[13] = i.y,
  54515. r[14] = t.z,
  54516. r[15] = t.x,
  54517. r[16] = i.y,
  54518. r[17] = t.z,
  54519. r[18] = t.x,
  54520. r[19] = t.y,
  54521. r[20] = t.z,
  54522. r[21] = i.x,
  54523. r[22] = t.y,
  54524. r[23] = t.z,
  54525. n.needsUpdate = !0,
  54526. this.geometry.computeBoundingSphere()
  54527. }
  54528. }
  54529. ),
  54530. Ci.BoundingBoxHelper = function(e, t) {
  54531. var i = void 0 !== t ? t : 8947848;
  54532. this.object = e,
  54533. this.box = new Ci.Box3,
  54534. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54535. color: i,
  54536. wireframe: !0
  54537. }))
  54538. }
  54539. ,
  54540. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54541. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54542. Ci.BoundingBoxHelper.prototype.update = function() {
  54543. this.box.setFromObject(this.object),
  54544. this.box.size(this.scale),
  54545. this.box.center(this.position)
  54546. }
  54547. ,
  54548. Ci.CameraHelper = function(e) {
  54549. function t(e, t, i) {
  54550. n(e, i),
  54551. n(t, i)
  54552. }
  54553. function n(e, t) {
  54554. i.vertices.push(new Ci.Vector3),
  54555. i.colors.push(new Ci.Color(t)),
  54556. void 0 === o[e] && (o[e] = []),
  54557. o[e].push(i.vertices.length - 1)
  54558. }
  54559. var i = new Ci.Geometry
  54560. , r = new Ci.LineBasicMaterial({
  54561. color: 16777215,
  54562. vertexColors: Ci.FaceColors
  54563. })
  54564. , o = {}
  54565. , a = 16755200
  54566. , s = 16711680
  54567. , l = 3355443;
  54568. t("n1", "n2", a),
  54569. t("n2", "n4", a),
  54570. t("n4", "n3", a),
  54571. t("n3", "n1", a),
  54572. t("f1", "f2", a),
  54573. t("f2", "f4", a),
  54574. t("f4", "f3", a),
  54575. t("f3", "f1", a),
  54576. t("n1", "f1", a),
  54577. t("n2", "f2", a),
  54578. t("n3", "f3", a),
  54579. t("n4", "f4", a),
  54580. t("p", "n1", s),
  54581. t("p", "n2", s),
  54582. t("p", "n3", s),
  54583. t("p", "n4", s),
  54584. t("u1", "u2", 43775),
  54585. t("u2", "u3", 43775),
  54586. t("u3", "u1", 43775),
  54587. t("c", "t", 16777215),
  54588. t("p", "c", l),
  54589. t("cn1", "cn2", l),
  54590. t("cn3", "cn4", l),
  54591. t("cf1", "cf2", l),
  54592. t("cf3", "cf4", l),
  54593. Ci.LineSegments.call(this, i, r),
  54594. this.camera = e,
  54595. this.camera.updateProjectionMatrix(),
  54596. this.matrix = e.matrixWorld,
  54597. this.matrixAutoUpdate = !1,
  54598. this.pointMap = o,
  54599. this.update()
  54600. }
  54601. ,
  54602. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54603. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54604. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54605. mi = new Ci.Camera,
  54606. function() {
  54607. pi = this.geometry,
  54608. fi = this.pointMap,
  54609. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54610. Ni("c", 0, 0, -1),
  54611. Ni("t", 0, 0, 1),
  54612. Ni("n1", -1, -1, -1),
  54613. Ni("n2", 1, -1, -1),
  54614. Ni("n3", -1, 1, -1),
  54615. Ni("n4", 1, 1, -1),
  54616. Ni("f1", -1, -1, 1),
  54617. Ni("f2", 1, -1, 1),
  54618. Ni("f3", -1, 1, 1),
  54619. Ni("f4", 1, 1, 1),
  54620. Ni("u1", .7, 1.1, -1),
  54621. Ni("u2", -.7, 1.1, -1),
  54622. Ni("u3", 0, 2, -1),
  54623. Ni("cf1", -1, 0, 1),
  54624. Ni("cf2", 1, 0, 1),
  54625. Ni("cf3", 0, -1, 1),
  54626. Ni("cf4", 0, 1, 1),
  54627. Ni("cn1", -1, 0, -1),
  54628. Ni("cn2", 1, 0, -1),
  54629. Ni("cn3", 0, -1, -1),
  54630. Ni("cn4", 0, 1, -1),
  54631. pi.verticesNeedUpdate = !0
  54632. }
  54633. ),
  54634. Ci.DirectionalLightHelper = function(e, t) {
  54635. Ci.Object3D.call(this),
  54636. this.light = e,
  54637. this.light.updateMatrixWorld(),
  54638. this.matrix = e.matrixWorld,
  54639. this.matrixAutoUpdate = !1,
  54640. t = t || 1;
  54641. var i = new Ci.Geometry;
  54642. 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));
  54643. var n = new Ci.LineBasicMaterial({
  54644. fog: !1
  54645. });
  54646. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54647. this.lightPlane = new Ci.Line(i,n),
  54648. this.add(this.lightPlane),
  54649. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54650. (n = new Ci.LineBasicMaterial({
  54651. fog: !1
  54652. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54653. this.targetLine = new Ci.Line(i,n),
  54654. this.add(this.targetLine),
  54655. this.update()
  54656. }
  54657. ,
  54658. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54659. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54660. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54661. this.lightPlane.geometry.dispose(),
  54662. this.lightPlane.material.dispose(),
  54663. this.targetLine.geometry.dispose(),
  54664. this.targetLine.material.dispose()
  54665. }
  54666. ,
  54667. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54668. ui = new Ci.Vector3,
  54669. di = new Ci.Vector3,
  54670. function() {
  54671. hi.setFromMatrixPosition(this.light.matrixWorld),
  54672. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54673. di.subVectors(ui, hi),
  54674. this.lightPlane.lookAt(di),
  54675. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54676. this.targetLine.geometry.vertices[1].copy(di),
  54677. this.targetLine.geometry.verticesNeedUpdate = !0,
  54678. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54679. }
  54680. ),
  54681. Ci.EdgesHelper = function(e, t, i) {
  54682. var n = void 0 !== t ? t : 16777215;
  54683. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54684. color: n
  54685. })),
  54686. this.matrix = e.matrixWorld,
  54687. this.matrixAutoUpdate = !1
  54688. }
  54689. ,
  54690. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54691. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54692. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54693. this.object = e,
  54694. this.size = void 0 !== t ? t : 1;
  54695. var r = void 0 !== i ? i : 16776960
  54696. , o = void 0 !== n ? n : 1
  54697. , a = 0
  54698. , s = this.object.geometry;
  54699. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54700. var l = new Ci.BufferGeometry
  54701. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54702. l.addAttribute("position", c),
  54703. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54704. color: r,
  54705. linewidth: o
  54706. })),
  54707. this.matrixAutoUpdate = !1,
  54708. this.update()
  54709. }
  54710. ,
  54711. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54712. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54713. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54714. li = new Ci.Vector3,
  54715. ci = new Ci.Matrix3,
  54716. function() {
  54717. this.object.updateMatrixWorld(!0),
  54718. ci.getNormalMatrix(this.object.matrixWorld);
  54719. 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++) {
  54720. var l = r[a]
  54721. , c = l.normal;
  54722. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54723. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54724. t.setXYZ(o, si.x, si.y, si.z),
  54725. o += 1,
  54726. t.setXYZ(o, li.x, li.y, li.z),
  54727. o += 1
  54728. }
  54729. return t.needsUpdate = !0,
  54730. this
  54731. }
  54732. ),
  54733. Ci.GridHelper = function(e, t) {
  54734. var i = new Ci.Geometry
  54735. , n = new Ci.LineBasicMaterial({
  54736. vertexColors: Ci.VertexColors
  54737. });
  54738. this.color1 = new Ci.Color(4473924),
  54739. this.color2 = new Ci.Color(8947848);
  54740. for (var r = -e; r <= e; r += t) {
  54741. 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));
  54742. var o = 0 === r ? this.color1 : this.color2;
  54743. i.colors.push(o, o, o, o)
  54744. }
  54745. Ci.LineSegments.call(this, i, n)
  54746. }
  54747. ,
  54748. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54749. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54750. Ci.GridHelper.prototype.setColors = function(e, t) {
  54751. this.color1.set(e),
  54752. this.color2.set(t),
  54753. this.geometry.colorsNeedUpdate = !0
  54754. }
  54755. ,
  54756. Ci.HemisphereLightHelper = function(e, t) {
  54757. Ci.Object3D.call(this),
  54758. this.light = e,
  54759. this.light.updateMatrixWorld(),
  54760. this.matrix = e.matrixWorld,
  54761. this.matrixAutoUpdate = !1,
  54762. this.colors = [new Ci.Color, new Ci.Color];
  54763. var i = new Ci.SphereGeometry(t,4,2);
  54764. i.rotateX(-Math.PI / 2);
  54765. for (var n = 0; n < 8; n++)
  54766. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54767. var r = new Ci.MeshBasicMaterial({
  54768. vertexColors: Ci.FaceColors,
  54769. wireframe: !0
  54770. });
  54771. this.lightSphere = new Ci.Mesh(i,r),
  54772. this.add(this.lightSphere),
  54773. this.update()
  54774. }
  54775. ,
  54776. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54777. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54778. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54779. this.lightSphere.geometry.dispose(),
  54780. this.lightSphere.material.dispose()
  54781. }
  54782. ,
  54783. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54784. function() {
  54785. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54786. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54787. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54788. this.lightSphere.geometry.colorsNeedUpdate = !0
  54789. }
  54790. ),
  54791. Ci.PointLightHelper = function(e, t) {
  54792. this.light = e,
  54793. this.light.updateMatrixWorld();
  54794. var i = new Ci.SphereGeometry(t,4,2)
  54795. , n = new Ci.MeshBasicMaterial({
  54796. wireframe: !0,
  54797. fog: !1
  54798. });
  54799. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54800. Ci.Mesh.call(this, i, n),
  54801. this.matrix = this.light.matrixWorld,
  54802. this.matrixAutoUpdate = !1
  54803. }
  54804. ,
  54805. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54806. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54807. Ci.PointLightHelper.prototype.dispose = function() {
  54808. this.geometry.dispose(),
  54809. this.material.dispose()
  54810. }
  54811. ,
  54812. Ci.PointLightHelper.prototype.update = function() {
  54813. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54814. }
  54815. ,
  54816. Ci.SkeletonHelper = function(e) {
  54817. this.bones = this.getBoneList(e);
  54818. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54819. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54820. t.vertices.push(new Ci.Vector3),
  54821. t.colors.push(new Ci.Color(0,0,1)),
  54822. t.colors.push(new Ci.Color(0,1,0)))
  54823. }
  54824. t.dynamic = !0;
  54825. var n = new Ci.LineBasicMaterial({
  54826. vertexColors: Ci.VertexColors,
  54827. depthTest: !1,
  54828. depthWrite: !1,
  54829. transparent: !0
  54830. });
  54831. Ci.LineSegments.call(this, t, n),
  54832. this.root = e,
  54833. this.matrix = e.matrixWorld,
  54834. this.matrixAutoUpdate = !1,
  54835. this.update()
  54836. }
  54837. ,
  54838. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54839. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54840. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54841. var t = [];
  54842. e instanceof Ci.Bone && t.push(e);
  54843. for (var i = 0; i < e.children.length; i++)
  54844. t.push.apply(t, this.getBoneList(e.children[i]));
  54845. return t
  54846. }
  54847. ,
  54848. Ci.SkeletonHelper.prototype.update = function() {
  54849. 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++) {
  54850. var o = this.bones[r];
  54851. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54852. e.vertices[n].setFromMatrixPosition(i),
  54853. i.multiplyMatrices(t, o.parent.matrixWorld),
  54854. e.vertices[n + 1].setFromMatrixPosition(i),
  54855. n += 2)
  54856. }
  54857. e.verticesNeedUpdate = !0,
  54858. e.computeBoundingSphere()
  54859. }
  54860. ,
  54861. Ci.SpotLightHelper = function(e) {
  54862. Ci.Object3D.call(this),
  54863. this.light = e,
  54864. this.light.updateMatrixWorld(),
  54865. this.matrix = e.matrixWorld,
  54866. this.matrixAutoUpdate = !1;
  54867. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54868. t.translate(0, -.5, 0),
  54869. t.rotateX(-Math.PI / 2);
  54870. var i = new Ci.MeshBasicMaterial({
  54871. wireframe: !0,
  54872. fog: !1
  54873. });
  54874. this.cone = new Ci.Mesh(t,i),
  54875. this.add(this.cone),
  54876. this.update()
  54877. }
  54878. ,
  54879. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54880. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54881. Ci.SpotLightHelper.prototype.dispose = function() {
  54882. this.cone.geometry.dispose(),
  54883. this.cone.material.dispose()
  54884. }
  54885. ,
  54886. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54887. oi = new Ci.Vector3,
  54888. function() {
  54889. var e = this.light.distance ? this.light.distance : 1e4
  54890. , t = e * Math.tan(this.light.angle);
  54891. this.cone.scale.set(t, t, e),
  54892. ri.setFromMatrixPosition(this.light.matrixWorld),
  54893. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54894. this.cone.lookAt(oi.sub(ri)),
  54895. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54896. }
  54897. ),
  54898. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54899. this.object = e,
  54900. this.size = void 0 !== t ? t : 1;
  54901. var r = void 0 !== i ? i : 16711680
  54902. , o = void 0 !== n ? n : 1
  54903. , a = 0
  54904. , s = this.object.geometry;
  54905. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54906. var l = new Ci.BufferGeometry
  54907. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54908. l.addAttribute("position", c),
  54909. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54910. color: r,
  54911. linewidth: o
  54912. })),
  54913. this.matrixAutoUpdate = !1,
  54914. this.update()
  54915. }
  54916. ,
  54917. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54918. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54919. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54920. ii = new Ci.Vector3,
  54921. ni = new Ci.Matrix3,
  54922. function() {
  54923. var e = ["a", "b", "c"];
  54924. this.object.updateMatrixWorld(!0),
  54925. ni.getNormalMatrix(this.object.matrixWorld);
  54926. var t = this.object.matrixWorld
  54927. , i = this.geometry.attributes.position
  54928. , n = this.object.geometry;
  54929. if (n instanceof Ci.Geometry)
  54930. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54931. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54932. var d = r[c[e[h]]]
  54933. , p = c.vertexNormals[h];
  54934. ti.copy(d).applyMatrix4(t),
  54935. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54936. i.setXYZ(a, ti.x, ti.y, ti.z),
  54937. a += 1,
  54938. i.setXYZ(a, ii.x, ii.y, ii.z),
  54939. a += 1
  54940. }
  54941. else if (n instanceof Ci.BufferGeometry) {
  54942. var f = n.attributes.position
  54943. , g = n.attributes.normal;
  54944. for (h = a = 0,
  54945. u = f.count; h < u; h++)
  54946. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54947. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54948. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54949. i.setXYZ(a, ti.x, ti.y, ti.z),
  54950. a += 1,
  54951. i.setXYZ(a, ii.x, ii.y, ii.z),
  54952. a += 1
  54953. }
  54954. return i.needsUpdate = !0,
  54955. this
  54956. }
  54957. ),
  54958. Ci.WireframeHelper = function(e, t) {
  54959. var i = void 0 !== t ? t : 16777215;
  54960. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54961. color: i
  54962. })),
  54963. this.matrix = e.matrixWorld,
  54964. this.matrixAutoUpdate = !1
  54965. }
  54966. ,
  54967. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54968. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54969. Ci.ImmediateRenderObject = function(e) {
  54970. Ci.Object3D.call(this),
  54971. this.material = e,
  54972. this.render = function(e) {}
  54973. }
  54974. ,
  54975. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54976. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54977. Ci.MorphBlendMesh = function(e, t) {
  54978. Ci.Mesh.call(this, e, t),
  54979. this.animationsMap = {},
  54980. this.animationsList = [];
  54981. var i = this.geometry.morphTargets.length
  54982. , n = i - 1
  54983. , r = i / 1;
  54984. this.createAnimation("__default", 0, n, r),
  54985. this.setAnimationWeight("__default", 1)
  54986. }
  54987. ,
  54988. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54989. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54990. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54991. var r = {
  54992. start: t,
  54993. end: i,
  54994. length: i - t + 1,
  54995. fps: n,
  54996. duration: (i - t) / n,
  54997. lastFrame: 0,
  54998. currentFrame: 0,
  54999. active: !1,
  55000. time: 0,
  55001. direction: 1,
  55002. weight: 1,
  55003. directionBackwards: !1,
  55004. mirroredLoop: !1
  55005. };
  55006. this.animationsMap[e] = r,
  55007. this.animationsList.push(r)
  55008. }
  55009. ,
  55010. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55011. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55012. var s = r.morphTargets[o].name.match(i);
  55013. if (s && 1 < s.length)
  55014. n[l = s[1]] || (n[l] = {
  55015. start: 1 / 0,
  55016. end: -1 / 0
  55017. }),
  55018. o < (c = n[l]).start && (c.start = o),
  55019. o > c.end && (c.end = o),
  55020. t = t || l
  55021. }
  55022. for (var l in n) {
  55023. var c = n[l];
  55024. this.createAnimation(l, c.start, c.end, e)
  55025. }
  55026. this.firstAnimation = t
  55027. }
  55028. ,
  55029. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55030. var t = this.animationsMap[e];
  55031. t && (t.direction = 1,
  55032. t.directionBackwards = !1)
  55033. }
  55034. ,
  55035. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55036. var t = this.animationsMap[e];
  55037. t && (t.direction = -1,
  55038. t.directionBackwards = !0)
  55039. }
  55040. ,
  55041. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55042. var i = this.animationsMap[e];
  55043. i && (i.fps = t,
  55044. i.duration = (i.end - i.start) / i.fps)
  55045. }
  55046. ,
  55047. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55048. var i = this.animationsMap[e];
  55049. i && (i.duration = t,
  55050. i.fps = (i.end - i.start) / i.duration)
  55051. }
  55052. ,
  55053. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55054. var i = this.animationsMap[e];
  55055. i && (i.weight = t)
  55056. }
  55057. ,
  55058. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55059. var i = this.animationsMap[e];
  55060. i && (i.time = t)
  55061. }
  55062. ,
  55063. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55064. var t = 0
  55065. , i = this.animationsMap[e];
  55066. return i && (t = i.time),
  55067. t
  55068. }
  55069. ,
  55070. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55071. var t = -1
  55072. , i = this.animationsMap[e];
  55073. return i && (t = i.duration),
  55074. t
  55075. }
  55076. ,
  55077. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55078. var t = this.animationsMap[e];
  55079. t ? (t.time = 0,
  55080. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55081. }
  55082. ,
  55083. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55084. var t = this.animationsMap[e];
  55085. t && (t.active = !1)
  55086. }
  55087. ,
  55088. Ci.MorphBlendMesh.prototype.update = function(e) {
  55089. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55090. var n = this.animationsList[t];
  55091. if (n.active) {
  55092. var r = n.duration / n.length;
  55093. n.time += n.direction * e,
  55094. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55095. n.time > n.duration && (n.time = n.duration,
  55096. n.directionBackwards = !0),
  55097. n.time < 0 && (n.time = 0,
  55098. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55099. n.time < 0 && (n.time += n.duration));
  55100. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55101. , a = n.weight;
  55102. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55103. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55104. this.morphTargetInfluences[o] = 0,
  55105. n.lastFrame = n.currentFrame,
  55106. n.currentFrame = o);
  55107. var s = n.time % r / r;
  55108. n.directionBackwards && (s = 1 - s),
  55109. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55110. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55111. }
  55112. }
  55113. }
  55114. ,
  55115. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55116. i.THREE = Ci) : this.THREE = Ci
  55117. window.THREE = Ci
  55118. getObjLoader()
  55119. initByTHREE(THREE)
  55120. }
  55121. , {}]
  55122. }, {}, [116]);