main看看的.js 2.5 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573
  1. /* 一些须知见mainEdit.js */
  2. !function() {
  3. "use strict";
  4. function t(t, i) {
  5. return typeof t === i
  6. }
  7. function i(t, i) {
  8. return t instanceof i
  9. }
  10. function n(t) {
  11. return t && t.nodeType
  12. }
  13. function e(t) {
  14. return n(t) ? t : i(t, g) ? t[0] : void 0
  15. }
  16. function o(t, i, n) {
  17. return g.each(t, function(t, e) {
  18. n = i.call(e, n, t, e)
  19. }),
  20. n
  21. }
  22. function r(t, i, n) {
  23. var e, o, r;
  24. if (t === i)
  25. return !0;
  26. if (!t || !i || t.constructor !== i.constructor)
  27. return !1;
  28. for (e = 0,
  29. o = n.length; o > e; e += 1) {
  30. if (r = n[e],
  31. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  32. return !1;
  33. if (t[r] !== i[r])
  34. return !1
  35. }
  36. return !0
  37. }
  38. function s(t, i, n, e) {
  39. this.left = E(t),
  40. this.top = E(i),
  41. this.width = E(n),
  42. this.height = E(e),
  43. this.right = this.left + this.width,
  44. this.bottom = this.top + this.height
  45. }
  46. function h(t, i, n, e) {
  47. this.visible = t || 0,
  48. this.viewport = i || 0,
  49. this.possible = n || 0,
  50. this.rects = e && T({}, e) || null
  51. }
  52. function l(t, i) {
  53. this.els = t,
  54. this.viewport = i
  55. }
  56. function c(t, i, n) {
  57. var e;
  58. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  59. e ? e[n] : 0
  60. }
  61. function u(t, i) {
  62. return t.val - i.val
  63. }
  64. function a(t, i) {
  65. return i.val - t.val
  66. }
  67. function f(t) {
  68. var i = s.ofContent(t, !0)
  69. , n = s.ofViewport(t, !0)
  70. , e = i.width - n.width
  71. , o = i.height - n.height;
  72. this.content = i,
  73. this.viewport = n,
  74. this.width = 0 >= e ? null : n.left / e,
  75. this.height = 0 >= o ? null : n.top / o,
  76. this.left = n.left,
  77. this.top = n.top,
  78. this.right = i.right - n.right,
  79. this.bottom = i.bottom - n.bottom
  80. }
  81. function p(t) {
  82. this.el = t || window
  83. }
  84. function d(t, i) {
  85. this.context = t,
  86. this.viewport = i,
  87. this.init()
  88. }
  89. function v(t, i, n, e) {
  90. this.context = new l(t,i),
  91. this.property = n,
  92. this.descending = e,
  93. this.init()
  94. }
  95. function w(t) {
  96. t && t !== window && t !== document ? (this.context = t,
  97. this.$autoTarget = g(t)) : this.context = window,
  98. this.init()
  99. }
  100. var g = jQuery
  101. , m = g(window)
  102. , b = g(document)
  103. , T = g.extend
  104. , y = g.isFunction
  105. , k = Math.max
  106. , V = Math.min
  107. , E = Math.round
  108. , x = function() {
  109. var t = {}
  110. , i = 1;
  111. return function(n) {
  112. return n ? (t[n] || (t[n] = i,
  113. i += 1),
  114. t[n]) : 0
  115. }
  116. }();
  117. T(s.prototype, {
  118. equals: function(t) {
  119. return r(this, t, ["left", "top", "width", "height"])
  120. },
  121. area: function() {
  122. return this.width * this.height
  123. },
  124. relativeTo: function(t) {
  125. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  126. },
  127. intersection: function(t) {
  128. if (!i(t, s))
  129. return null;
  130. var n = k(this.left, t.left)
  131. , e = V(this.right, t.right)
  132. , o = k(this.top, t.top)
  133. , r = V(this.bottom, t.bottom)
  134. , h = e - n
  135. , l = r - o;
  136. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  137. },
  138. envelope: function(t) {
  139. if (!i(t, s))
  140. return this;
  141. var n = V(this.left, t.left)
  142. , e = k(this.right, t.right)
  143. , o = V(this.top, t.top)
  144. , r = k(this.bottom, t.bottom)
  145. , h = e - n
  146. , l = r - o;
  147. return new s(n,o,h,l)
  148. }
  149. }),
  150. T(s, {
  151. ofContent: function(t, i) {
  152. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  153. },
  154. ofViewport: function(t, i) {
  155. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  156. },
  157. ofElement: function(t) {
  158. var i = g(t);
  159. if (!i.is(":visible"))
  160. return null;
  161. var n = i.offset();
  162. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  163. }
  164. }),
  165. T(h.prototype, {
  166. equals: function(t) {
  167. return this.fracsEqual(t) && this.rectsEqual(t)
  168. },
  169. fracsEqual: function(t) {
  170. return r(this, t, ["visible", "viewport", "possible"])
  171. },
  172. rectsEqual: function(t) {
  173. return r(this.rects, t.rects, ["document", "element", "viewport"])
  174. }
  175. }),
  176. T(h, {
  177. of: function(t, i) {
  178. var e, o, r;
  179. return t = n(t) && s.ofElement(t) || t,
  180. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  181. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  182. r = V(t.width, i.width) * V(t.height, i.height),
  183. new h(o / t.area(),o / i.area(),o / r,{
  184. document: e,
  185. element: e.relativeTo(t),
  186. viewport: e.relativeTo(i)
  187. })) : new h
  188. }
  189. });
  190. var q = ["width", "height", "left", "right", "top", "bottom"]
  191. , S = ["possible", "visible", "viewport"];
  192. T(l.prototype, {
  193. sorted: function(t, i) {
  194. var n = this.viewport;
  195. return g.map(this.els, function(i) {
  196. return {
  197. el: i,
  198. val: c(i, n, t)
  199. }
  200. }).sort(i ? a : u)
  201. },
  202. best: function(t, i) {
  203. return this.els.length ? this.sorted(t, i)[0] : null
  204. }
  205. }),
  206. T(f.prototype, {
  207. equals: function(t) {
  208. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  209. }
  210. }),
  211. T(p.prototype, {
  212. equals: function(t) {
  213. return r(this, t, ["el"])
  214. },
  215. scrollState: function() {
  216. return new f(this.el)
  217. },
  218. scrollTo: function(t, i, n) {
  219. var e = g(this.el === window ? "html,body" : this.el);
  220. t = t || 0,
  221. i = i || 0,
  222. n = isNaN(n) ? 1e3 : n,
  223. e.stop(!0).animate({
  224. scrollLeft: t,
  225. scrollTop: i
  226. }, n)
  227. },
  228. scroll: function(t, i, n) {
  229. var e = this.el === window ? m : g(this.el);
  230. t = t || 0,
  231. i = i || 0,
  232. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  233. },
  234. scrollToRect: function(t, i, n, e) {
  235. i = i || 0,
  236. n = n || 0,
  237. this.scrollTo(t.left - i, t.top - n, e)
  238. },
  239. scrollToElement: function(t, i, n, e) {
  240. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  241. this.scrollToRect(o, i, n, e)
  242. }
  243. });
  244. var C = {
  245. init: function() {
  246. this.callbacks = g.Callbacks("memory unique"),
  247. this.currVal = null,
  248. this.prevVal = null,
  249. this.checkProxy = g.proxy(this.check, this),
  250. this.autoCheck()
  251. },
  252. bind: function(t) {
  253. this.callbacks.add(t)
  254. },
  255. unbind: function(t) {
  256. t ? this.callbacks.remove(t) : this.callbacks.empty()
  257. },
  258. trigger: function() {
  259. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  260. },
  261. check: function(t) {
  262. var i = this.updatedValue(t);
  263. return void 0 !== i && (this.prevVal = this.currVal,
  264. this.currVal = i,
  265. this.trigger(),
  266. !0)
  267. },
  268. $autoTarget: m,
  269. autoEvents: "load resize scroll",
  270. autoCheck: function(t) {
  271. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  272. }
  273. };
  274. T(d.prototype, C, {
  275. updatedValue: function() {
  276. var t = h.of(this.context, this.viewport);
  277. return this.currVal && this.currVal.equals(t) ? void 0 : t
  278. }
  279. }),
  280. T(v.prototype, C, {
  281. updatedValue: function() {
  282. var t = this.context.best(this.property, this.descending);
  283. return t && (t = t.val > 0 ? t.el : null,
  284. this.currVal !== t) ? t : void 0
  285. }
  286. }),
  287. T(w.prototype, C, {
  288. updatedValue: function() {
  289. var t = new f(this.context);
  290. return this.currVal && this.currVal.equals(t) ? void 0 : t
  291. }
  292. });
  293. var L = function(t, i) {
  294. var n = [].slice
  295. , e = jQuery
  296. , o = e.extend
  297. , r = e.isFunction
  298. , s = o({}, i)
  299. , h = function(i, n, o, s) {
  300. return o = r(o) ? o.apply(i, n) : o,
  301. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  302. }
  303. , l = function() {
  304. return h(this, n.call(arguments), s.defaultStatic, l)
  305. }
  306. , c = function(t) {
  307. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  308. }
  309. , u = function(t) {
  310. t && (o(l, t.statics),
  311. o(c, t.methods)),
  312. l.modplug = u
  313. };
  314. u.prev = {
  315. statics: e[t],
  316. methods: e.fn[t]
  317. },
  318. u(i),
  319. e[t] = l,
  320. e.fn[t] = c
  321. }
  322. , M = "fracs";
  323. L(M, {
  324. statics: {
  325. version: "0.15.0",
  326. Rect: s,
  327. Fractions: h,
  328. Group: l,
  329. ScrollState: f,
  330. Viewport: p,
  331. FracsCallbacks: d,
  332. GroupCallbacks: v,
  333. ScrollStateCallbacks: w,
  334. fracs: function(t, i) {
  335. return h.of(t, i)
  336. }
  337. },
  338. methods: {
  339. content: function(t) {
  340. return this.length ? s.ofContent(this[0], t) : null
  341. },
  342. envelope: function() {
  343. return o(this, function(t) {
  344. var i = s.ofElement(this);
  345. return t ? t.envelope(i) : i
  346. })
  347. },
  348. fracs: function(i, n, o) {
  349. t(i, "string") || (o = n,
  350. n = i,
  351. i = null),
  352. y(n) || (o = n,
  353. n = null),
  354. o = e(o);
  355. var r = M + ".fracs." + x(o);
  356. return "unbind" === i ? this.each(function() {
  357. var t = g(this).data(r);
  358. t && t.unbind(n)
  359. }) : "check" === i ? this.each(function() {
  360. var t = g(this).data(r);
  361. t && t.check()
  362. }) : y(n) ? this.each(function() {
  363. var t = g(this)
  364. , i = t.data(r);
  365. i || (i = new d(this,o),
  366. t.data(r, i)),
  367. i.bind(n)
  368. }) : this.length ? h.of(this[0], o) : null
  369. },
  370. intersection: function() {
  371. return o(this, function(t) {
  372. var i = s.ofElement(this);
  373. return t ? t.intersection(i) : i
  374. })
  375. },
  376. max: function(t, i, n) {
  377. return y(i) || (n = i,
  378. i = null),
  379. n = e(n),
  380. i ? (new v(this,n,t,!0).bind(i),
  381. this) : this.pushStack(new l(this,n).best(t, !0).el)
  382. },
  383. min: function(t, i, n) {
  384. return y(i) || (n = i,
  385. i = null),
  386. n = e(n),
  387. i ? (new v(this,n,t).bind(i),
  388. this) : this.pushStack(new l(this,n).best(t).el)
  389. },
  390. rect: function() {
  391. return this.length ? s.ofElement(this[0]) : null
  392. },
  393. scrollState: function(i, n) {
  394. var e = M + ".scrollState";
  395. return t(i, "string") || (n = i,
  396. i = null),
  397. "unbind" === i ? this.each(function() {
  398. var t = g(this).data(e);
  399. t && t.unbind(n)
  400. }) : "check" === i ? this.each(function() {
  401. var t = g(this).data(e);
  402. t && t.check()
  403. }) : y(n) ? this.each(function() {
  404. var t = g(this)
  405. , i = t.data(e);
  406. i || (i = new w(this),
  407. t.data(e, i)),
  408. i.bind(n)
  409. }) : this.length ? new f(this[0]) : null
  410. },
  411. scroll: function(t, i, n) {
  412. return this.each(function() {
  413. new p(this).scroll(t, i, n)
  414. })
  415. },
  416. scrollTo: function(t, i, n, o) {
  417. return g.isNumeric(t) && (o = n,
  418. n = i,
  419. i = t,
  420. t = null),
  421. t = e(t),
  422. this.each(function() {
  423. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  424. })
  425. },
  426. scrollToThis: function(t, i, n, o) {
  427. return o = new p(e(o)),
  428. o.scrollToElement(this[0], t, i, n),
  429. this
  430. },
  431. softLink: function(t, i, n, o) {
  432. return o = new p(e(o)),
  433. this.filter("a[href^=#]").each(function() {
  434. var e = g(this);
  435. e.on("click", function() {
  436. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  437. })
  438. })
  439. },
  440. sort: function(i, n, o) {
  441. return t(n, "boolean") || (o = n,
  442. n = null),
  443. o = e(o),
  444. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  445. return t.el
  446. }))
  447. },
  448. viewport: function(t) {
  449. return this.length ? s.ofViewport(this[0], t) : null
  450. }
  451. },
  452. defaultStatic: "fracs",
  453. defaultMethod: "fracs"
  454. })
  455. }();
  456. if ("undefined" == typeof jQuery)
  457. throw new Error("Bootstrap's JavaScript requires jQuery");
  458. +function(t) {
  459. "use strict";
  460. function e(e) {
  461. return this.each(function() {
  462. var o = t(this)
  463. , s = o.data("bs.tooltip")
  464. , n = "object" == typeof e && e;
  465. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  466. "string" == typeof e && s[e]())
  467. })
  468. }
  469. var i = function(t, e) {
  470. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  471. this.init("tooltip", t, e)
  472. };
  473. i.VERSION = "3.2.0",
  474. i.DEFAULTS = {
  475. animation: !0,
  476. placement: "top",
  477. selector: !1,
  478. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  479. trigger: "hover focus",
  480. title: "",
  481. delay: 0,
  482. html: !1,
  483. container: !1,
  484. viewport: {
  485. selector: "body",
  486. padding: 0
  487. }
  488. },
  489. i.prototype.init = function(e, i, o) {
  490. this.enabled = !0,
  491. this.type = e,
  492. this.$element = t(i),
  493. this.options = this.getOptions(o),
  494. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  495. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  496. var r = s[n];
  497. if ("click" == r)
  498. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  499. else if ("manual" != r) {
  500. var a = "hover" == r ? "mouseenter" : "focusin"
  501. , l = "hover" == r ? "mouseleave" : "focusout";
  502. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  503. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  504. }
  505. }
  506. this.options.selector ? this._options = t.extend({}, this.options, {
  507. trigger: "manual",
  508. selector: ""
  509. }) : this.fixTitle()
  510. }
  511. ,
  512. i.prototype.getDefaults = function() {
  513. return i.DEFAULTS
  514. }
  515. ,
  516. i.prototype.getOptions = function(e) {
  517. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  518. e.delay && "number" == typeof e.delay && (e.delay = {
  519. show: e.delay,
  520. hide: e.delay
  521. }),
  522. e
  523. }
  524. ,
  525. i.prototype.getDelegateOptions = function() {
  526. var e = {}
  527. , i = this.getDefaults();
  528. return this._options && t.each(this._options, function(t, o) {
  529. i[t] != o && (e[t] = o)
  530. }),
  531. e
  532. }
  533. ,
  534. i.prototype.enter = function(e) {
  535. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  536. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  537. t(e.currentTarget).data("bs." + this.type, i)),
  538. clearTimeout(i.timeout),
  539. i.hoverState = "in",
  540. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  541. "in" == i.hoverState && i.show()
  542. }, i.options.delay.show)) : i.show()
  543. }
  544. ,
  545. i.prototype.leave = function(e) {
  546. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  547. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  548. t(e.currentTarget).data("bs." + this.type, i)),
  549. clearTimeout(i.timeout),
  550. i.hoverState = "out",
  551. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  552. "out" == i.hoverState && i.hide()
  553. }, i.options.delay.hide)) : i.hide()
  554. }
  555. ,
  556. i.prototype.show = function() {
  557. var e = t.Event("show.bs." + this.type);
  558. if (this.hasContent() && this.enabled) {
  559. this.$element.trigger(e);
  560. var i = t.contains(document.documentElement, this.$element[0]);
  561. if (e.isDefaultPrevented() || !i)
  562. return;
  563. var o = this
  564. , s = this.tip()
  565. , n = this.getUID(this.type);
  566. this.setContent(),
  567. s.attr("id", n),
  568. this.$element.attr("aria-describedby", n),
  569. this.options.animation && s.addClass("fade");
  570. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  571. , a = /\s?auto?\s?/i
  572. , l = a.test(r);
  573. l && (r = r.replace(a, "") || "top"),
  574. s.detach().css({
  575. top: 0,
  576. left: 0,
  577. display: "block"
  578. }).addClass(r).data("bs." + this.type, this),
  579. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  580. var p = this.getPosition()
  581. , h = s[0].offsetWidth
  582. , f = s[0].offsetHeight;
  583. if (l) {
  584. var u = r
  585. , c = this.$element.parent()
  586. , d = this.getPosition(c);
  587. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  588. s.removeClass(u).addClass(r)
  589. }
  590. var g = this.getCalculatedOffset(r, p, h, f);
  591. this.applyPlacement(g, r);
  592. var y = function() {
  593. o.$element.trigger("shown.bs." + o.type),
  594. o.hoverState = null
  595. };
  596. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  597. }
  598. }
  599. ,
  600. i.prototype.applyPlacement = function(e, i) {
  601. var o = this.tip()
  602. , s = o[0].offsetWidth
  603. , n = o[0].offsetHeight
  604. , r = parseInt(o.css("margin-top"), 10)
  605. , a = parseInt(o.css("margin-left"), 10);
  606. isNaN(r) && (r = 0),
  607. isNaN(a) && (a = 0),
  608. e.top = e.top + r,
  609. e.left = e.left + a,
  610. t.offset.setOffset(o[0], t.extend({
  611. using: function(t) {
  612. o.css({
  613. top: Math.round(t.top),
  614. left: Math.round(t.left)
  615. })
  616. }
  617. }, e), 0),
  618. o.addClass("in");
  619. var l = o[0].offsetWidth
  620. , p = o[0].offsetHeight;
  621. "top" == i && p != n && (e.top = e.top + n - p);
  622. var h = this.getViewportAdjustedDelta(i, e, l, p);
  623. h.left ? e.left += h.left : e.top += h.top;
  624. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  625. , u = h.left ? "left" : "top"
  626. , c = h.left ? "offsetWidth" : "offsetHeight";
  627. o.offset(e),
  628. this.replaceArrow(f, o[0][c], u)
  629. }
  630. ,
  631. i.prototype.replaceArrow = function(t, e, i) {
  632. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  633. }
  634. ,
  635. i.prototype.setContent = function() {
  636. var t = this.tip()
  637. , e = this.getTitle();
  638. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  639. t.removeClass("fade in top bottom left right")
  640. }
  641. ,
  642. i.prototype.hide = function() {
  643. function e() {
  644. "in" != i.hoverState && o.detach(),
  645. i.$element.trigger("hidden.bs." + i.type)
  646. }
  647. var i = this
  648. , o = this.tip()
  649. , s = t.Event("hide.bs." + this.type);
  650. if (this.$element.removeAttr("aria-describedby"),
  651. this.$element.trigger(s),
  652. !s.isDefaultPrevented())
  653. return o.removeClass("in"),
  654. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  655. this.hoverState = null,
  656. this
  657. }
  658. ,
  659. i.prototype.fixTitle = function() {
  660. var t = this.$element;
  661. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  662. }
  663. ,
  664. i.prototype.hasContent = function() {
  665. return this.getTitle()
  666. }
  667. ,
  668. i.prototype.getPosition = function(e) {
  669. e = e || this.$element;
  670. var i = e[0]
  671. , o = "BODY" == i.tagName;
  672. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  673. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  674. width: o ? t(window).width() : e.outerWidth(),
  675. height: o ? t(window).height() : e.outerHeight()
  676. }, o ? {
  677. top: 0,
  678. left: 0
  679. } : e.offset())
  680. }
  681. ,
  682. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  683. return "bottom" == t ? {
  684. top: e.top + e.height,
  685. left: e.left + e.width / 2 - i / 2
  686. } : "top" == t ? {
  687. top: e.top - o,
  688. left: e.left + e.width / 2 - i / 2
  689. } : "left" == t ? {
  690. top: e.top + e.height / 2 - o / 2,
  691. left: e.left - i
  692. } : {
  693. top: e.top + e.height / 2 - o / 2,
  694. left: e.left + e.width
  695. }
  696. }
  697. ,
  698. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  699. var s = {
  700. top: 0,
  701. left: 0
  702. };
  703. if (!this.$viewport)
  704. return s;
  705. var n = this.options.viewport && this.options.viewport.padding || 0
  706. , r = this.getPosition(this.$viewport);
  707. if (/right|left/.test(t)) {
  708. var a = e.top - n - r.scroll
  709. , l = e.top + n - r.scroll + o;
  710. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  711. } else {
  712. var p = e.left - n
  713. , h = e.left + n + i;
  714. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  715. }
  716. return s
  717. }
  718. ,
  719. i.prototype.getTitle = function() {
  720. var t, e = this.$element, i = this.options;
  721. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  722. }
  723. ,
  724. i.prototype.getUID = function(t) {
  725. do
  726. t += ~~(1e6 * Math.random());
  727. while (document.getElementById(t));return t
  728. }
  729. ,
  730. i.prototype.tip = function() {
  731. return this.$tip = this.$tip || t(this.options.template)
  732. }
  733. ,
  734. i.prototype.arrow = function() {
  735. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  736. }
  737. ,
  738. i.prototype.validate = function() {
  739. this.$element[0].parentNode || (this.hide(),
  740. this.$element = null,
  741. this.options = null)
  742. }
  743. ,
  744. i.prototype.enable = function() {
  745. this.enabled = !0
  746. }
  747. ,
  748. i.prototype.disable = function() {
  749. this.enabled = !1
  750. }
  751. ,
  752. i.prototype.toggleEnabled = function() {
  753. this.enabled = !this.enabled
  754. }
  755. ,
  756. i.prototype.toggle = function(e) {
  757. var i = this;
  758. e && (i = t(e.currentTarget).data("bs." + this.type),
  759. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  760. t(e.currentTarget).data("bs." + this.type, i))),
  761. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  762. }
  763. ,
  764. i.prototype.destroy = function() {
  765. clearTimeout(this.timeout),
  766. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  767. }
  768. ;
  769. var o = t.fn.tooltip;
  770. t.fn.tooltip = e,
  771. t.fn.tooltip.Constructor = i,
  772. t.fn.tooltip.noConflict = function() {
  773. return t.fn.tooltip = o,
  774. this
  775. }
  776. }(jQuery);
  777. !function(e, t, n) {
  778. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  779. }("Keen", this, function() {
  780. "use strict";
  781. function Keen() {
  782. return _init.apply(this, arguments)
  783. }
  784. function _init(e) {
  785. if (_isUndefined(e))
  786. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  787. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  788. throw new Error("Please provide a projectId");
  789. this.configure(e)
  790. }
  791. function _extend(e) {
  792. for (var t = 1; t < arguments.length; t++)
  793. for (var n in arguments[t])
  794. e[n] = arguments[t][n];
  795. return e
  796. }
  797. function _isUndefined(e) {
  798. return void 0 === e
  799. }
  800. function _type(e) {
  801. var t = e && e.constructor ? e.constructor.toString() : void 0;
  802. return t ? t.match(/function (.*)\(/)[1] : "Null"
  803. }
  804. function _each(e, t, n) {
  805. var r;
  806. if (!e)
  807. return 0;
  808. if (n = n ? n : e,
  809. "array" === _type(e)) {
  810. for (r = 0; r < e.length; r++)
  811. if (t.call(n, e[r], r, e) === !1)
  812. return 0
  813. } else
  814. for (r in e)
  815. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  816. return 0;
  817. return 1
  818. }
  819. function _parse_params(e) {
  820. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  821. return decodeURIComponent(e.replace(r, " "))
  822. }, a = e.split("?")[1]; t = i.exec(a); )
  823. n[o(t[1])] = o(t[2]);
  824. return n
  825. }
  826. function _set_protocol(e) {
  827. switch (e) {
  828. case "http":
  829. return "http";
  830. case "auto":
  831. return location.protocol.replace(/:/g, "");
  832. case "https":
  833. case void 0:
  834. default:
  835. return "https"
  836. }
  837. }
  838. function _set_request_type(e) {
  839. var t = e || "jsonp"
  840. , n = !1;
  841. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  842. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  843. }
  844. function _build_url(e) {
  845. return this.client.endpoint + "/projects/" + this.client.projectId + e
  846. }
  847. function _uploadEvent(e, t, n, r, i) {
  848. var o = _build_url.apply(this, ["/events/" + e])
  849. , a = {};
  850. n = n !== !1,
  851. this.client.globalProperties && (a = this.client.globalProperties(e));
  852. for (var c in t)
  853. t.hasOwnProperty(c) && (a[c] = t[c]);
  854. switch (this.client.requestType) {
  855. case "xhr":
  856. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  857. break;
  858. case "jsonp":
  859. var s = JSON.stringify(a)
  860. , l = Keen.Base64.encode(s);
  861. o = o + "?api_key=" + this.client.writeKey,
  862. o = o + "&data=" + l,
  863. o = o + "&modified=" + (new Date).getTime(),
  864. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  865. break;
  866. case "beacon":
  867. var s = JSON.stringify(a)
  868. , l = Keen.Base64.encode(s);
  869. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  870. o = o + "&data=" + encodeURIComponent(l),
  871. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  872. o += "&c=clv1",
  873. _request.beacon.apply(this, [o, null, r, i])
  874. }
  875. }
  876. Keen.prototype.configure = function(e) {
  877. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  878. e.protocol = _set_protocol(e.protocol),
  879. e.requestType = _set_request_type(e.requestType),
  880. this.client = {
  881. projectId: e.projectId,
  882. writeKey: e.writeKey,
  883. readKey: e.readKey,
  884. globalProperties: null,
  885. endpoint: e.protocol + "://" + e.host,
  886. requestType: e.requestType
  887. },
  888. Keen.trigger("client", this, e),
  889. this.trigger("ready"),
  890. this
  891. }
  892. ;
  893. var _request = {
  894. xhr: function(e, t, n, r, i, o, a, c) {
  895. if (!i)
  896. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  897. var s = new XMLHttpRequest;
  898. if (s.onreadystatechange = function() {
  899. if (4 == s.readyState)
  900. if (s.status >= 200 && s.status < 300) {
  901. var e;
  902. try {
  903. e = JSON.parse(s.responseText)
  904. } catch (e) {
  905. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  906. c && c(s, e)
  907. }
  908. a && e && a(e)
  909. } else
  910. Keen.log("HTTP request failed."),
  911. c && c(s, null)
  912. }
  913. ,
  914. s.open(e, t, o),
  915. i && s.setRequestHeader("Authorization", i),
  916. r && s.setRequestHeader("Content-Type", "application/json"),
  917. n)
  918. for (var l in n)
  919. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  920. var u = r ? JSON.stringify(r) : null;
  921. s.send(u)
  922. },
  923. jsonp: function(e, t, n, r) {
  924. if (!t)
  925. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  926. if (t && e.indexOf("api_key") < 0) {
  927. var i = e.indexOf("?") > 0 ? "&" : "?";
  928. e = e + i + "api_key=" + t
  929. }
  930. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  931. o += "a";
  932. var a = !1;
  933. window[o] = function(e) {
  934. a = !0,
  935. n && e && n(e),
  936. window[o] = void 0
  937. }
  938. ,
  939. e = e + "&jsonp=" + o;
  940. var c = document.createElement("script");
  941. c.id = "keen-jsonp",
  942. c.src = e,
  943. document.getElementsByTagName("head")[0].appendChild(c),
  944. c.onreadystatechange = function() {
  945. a === !1 && "loaded" === this.readyState && (a = !0,
  946. r && r())
  947. }
  948. ,
  949. c.onerror = function() {
  950. a === !1 && (a = !0,
  951. r && r())
  952. }
  953. },
  954. beacon: function(e, t, n, r) {
  955. if (t && e.indexOf("api_key") < 0) {
  956. var i = e.indexOf("?") > 0 ? "&" : "?";
  957. e = e + i + "api_key=" + t
  958. }
  959. var o = !1
  960. , a = document.createElement("img");
  961. a.onload = function() {
  962. if (o = !0,
  963. "naturalHeight"in this) {
  964. if (this.naturalHeight + this.naturalWidth === 0)
  965. return void this.onerror()
  966. } else if (this.width + this.height === 0)
  967. return void this.onerror();
  968. n && n({
  969. created: !0
  970. })
  971. }
  972. ,
  973. a.onerror = function() {
  974. o = !0,
  975. r && r()
  976. }
  977. ,
  978. a.src = e
  979. }
  980. }
  981. , Events = Keen.Events = {
  982. on: function(e, t) {
  983. this.listeners || (this.listeners = {});
  984. var n = this.listeners[e] || (this.listeners[e] = []);
  985. return n.push({
  986. callback: t
  987. }),
  988. this
  989. },
  990. off: function(e, t) {
  991. if (!e && !t)
  992. return this.listeners = void 0,
  993. delete this.listeners,
  994. this;
  995. for (var n = this.listeners[e] || [], r = n.length; r--; )
  996. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  997. t && 0 != n.length || (this.listeners[e] = void 0,
  998. delete this.listeners[e]);
  999. return this
  1000. },
  1001. trigger: function(e) {
  1002. if (!this.listeners)
  1003. return this;
  1004. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1005. n[r].callback.apply(this, t);
  1006. return this
  1007. }
  1008. };
  1009. _extend(Keen.prototype, Events),
  1010. _extend(Keen, Events),
  1011. Keen.loaded = !0,
  1012. Keen.utils = {
  1013. each: _each,
  1014. extend: _extend,
  1015. parseParams: _parse_params
  1016. },
  1017. Keen.ready = function(e) {
  1018. Keen.loaded ? e() : Keen.on("ready", e)
  1019. }
  1020. ,
  1021. Keen.log = function(e) {
  1022. "object" == typeof console && console.log("[Keen IO]", e)
  1023. }
  1024. ;
  1025. var Plugins = Keen.Plugins = {};
  1026. Keen.prototype.addEvent = function() {
  1027. _uploadEvent.apply(this, arguments)
  1028. }
  1029. ,
  1030. Keen.prototype.addEventSync = function(e, t, n, r) {
  1031. _uploadEvent.apply(this, [e, t, !1, n, r])
  1032. }
  1033. ,
  1034. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1035. var o = e
  1036. , a = o.metaKey
  1037. , c = o.target
  1038. , s = !1
  1039. , l = function() {};
  1040. return void 0 === r && (r = 500),
  1041. "A" === c.nodeName ? l = function() {
  1042. a || s || (s = !0,
  1043. window.location = c.href)
  1044. }
  1045. : "FORM" === c.nodeName && (l = function() {
  1046. s || (s = !0,
  1047. c.submit())
  1048. }
  1049. ),
  1050. i && (l = function() {
  1051. s || (s = !0,
  1052. i())
  1053. }
  1054. ),
  1055. _uploadEvent.call(this, t, n, l, l),
  1056. setTimeout(function() {
  1057. l()
  1058. }, r),
  1059. !!a && void 0
  1060. }
  1061. ,
  1062. Keen.prototype.setGlobalProperties = function(e) {
  1063. if (!this.client)
  1064. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1065. if (!e || "function" != typeof e)
  1066. throw new Error("Invalid value for global properties: " + e);
  1067. this.client.globalProperties = e
  1068. }
  1069. ,
  1070. Keen.Base64 = {
  1071. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1072. encode: function(e) {
  1073. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1074. for (e = this.utf8.encode(e); l < e.length; )
  1075. t = e.charCodeAt(l++),
  1076. n = e.charCodeAt(l++),
  1077. r = e.charCodeAt(l++),
  1078. i = t >> 2,
  1079. o = (3 & t) << 4 | n >> 4,
  1080. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1081. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1082. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1083. return s
  1084. },
  1085. decode: function(e) {
  1086. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1087. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1088. t = u.indexOf(e.charAt(l++)),
  1089. n = u.indexOf(e.charAt(l++)),
  1090. r = u.indexOf(e.charAt(l++)),
  1091. i = u.indexOf(e.charAt(l++)),
  1092. o = t << 2 | n >> 4,
  1093. a = (15 & n) << 4 | r >> 2,
  1094. c = (3 & r) << 6 | i,
  1095. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1096. return this.utf8.decode(s)
  1097. },
  1098. utf8: {
  1099. encode: function(e) {
  1100. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1101. t = e.charCodeAt(r++),
  1102. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1103. return n
  1104. },
  1105. decode: function(e) {
  1106. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1107. n = e.charCodeAt(i),
  1108. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1109. return r
  1110. }
  1111. }
  1112. },
  1113. "object" != typeof JSON && (JSON = {}),
  1114. function() {
  1115. function f(e) {
  1116. return 10 > e ? "0" + e : e
  1117. }
  1118. function quote(e) {
  1119. return escapable.lastIndex = 0,
  1120. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1121. var t = meta[e];
  1122. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1123. }) + '"' : '"' + e + '"'
  1124. }
  1125. function str(e, t) {
  1126. var n, r, i, o, a, c = gap, s = t[e];
  1127. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1128. "function" == typeof rep && (s = rep.call(t, e, s)),
  1129. typeof s) {
  1130. case "string":
  1131. return quote(s);
  1132. case "number":
  1133. return isFinite(s) ? String(s) : "null";
  1134. case "boolean":
  1135. case "null":
  1136. return String(s);
  1137. case "object":
  1138. if (!s)
  1139. return "null";
  1140. if (gap += indent,
  1141. a = [],
  1142. "[object Array]" === Object.prototype.toString.apply(s)) {
  1143. for (o = s.length,
  1144. n = 0; o > n; n += 1)
  1145. a[n] = str(n, s) || "null";
  1146. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1147. gap = c,
  1148. i
  1149. }
  1150. if (rep && "object" == typeof rep)
  1151. for (o = rep.length,
  1152. n = 0; o > n; n += 1)
  1153. "string" == typeof rep[n] && (r = rep[n],
  1154. i = str(r, s),
  1155. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1156. else
  1157. for (r in s)
  1158. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1159. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1160. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1161. gap = c,
  1162. i
  1163. }
  1164. }
  1165. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1166. 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
  1167. }
  1168. ,
  1169. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1170. return this.valueOf()
  1171. }
  1172. );
  1173. 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 = {
  1174. "\b": "\\b",
  1175. "\t": "\\t",
  1176. "\n": "\\n",
  1177. "\f": "\\f",
  1178. "\r": "\\r",
  1179. '"': '\\"',
  1180. "\\": "\\\\"
  1181. }, rep;
  1182. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1183. var r;
  1184. if (gap = "",
  1185. indent = "",
  1186. "number" == typeof n)
  1187. for (r = 0; n > r; r += 1)
  1188. indent += " ";
  1189. else
  1190. "string" == typeof n && (indent = n);
  1191. if (rep = t,
  1192. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1193. throw new Error("JSON.stringify");
  1194. return str("", {
  1195. "": e
  1196. })
  1197. }
  1198. ),
  1199. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1200. function walk(e, t) {
  1201. var n, r, i = e[t];
  1202. if (i && "object" == typeof i)
  1203. for (n in i)
  1204. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1205. void 0 !== r ? i[n] = r : delete i[n]);
  1206. return reviver.call(e, t, i)
  1207. }
  1208. var j;
  1209. if (text = String(text),
  1210. cx.lastIndex = 0,
  1211. cx.test(text) && (text = text.replace(cx, function(e) {
  1212. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1213. })),
  1214. /^[\],:{}\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, "")))
  1215. return j = eval("(" + text + ")"),
  1216. "function" == typeof reviver ? walk({
  1217. "": j
  1218. }, "") : j;
  1219. throw new SyntaxError("JSON.parse")
  1220. }
  1221. )
  1222. }(),
  1223. !function(e, t, n) {
  1224. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1225. }("domready", Keen.utils, function(e) {
  1226. function t(e) {
  1227. for (d = 1; e = r.shift(); )
  1228. e()
  1229. }
  1230. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1231. return o[l] && o[l](s, n = function() {
  1232. o.removeEventListener(s, n, i),
  1233. t()
  1234. }
  1235. , i),
  1236. c && o.attachEvent(u, n = function() {
  1237. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1238. t())
  1239. }
  1240. ),
  1241. e = c ? function(t) {
  1242. self != top ? d ? t() : r.push(t) : function() {
  1243. try {
  1244. a.doScroll("left")
  1245. } catch (n) {
  1246. return setTimeout(function() {
  1247. e(t)
  1248. }, 50)
  1249. }
  1250. t()
  1251. }()
  1252. }
  1253. : function(e) {
  1254. d ? e() : r.push(e)
  1255. }
  1256. });
  1257. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1258. if (loaded && cached) {
  1259. clients = cached.clients || {},
  1260. ready = cached.ready || [];
  1261. for (var instance in clients)
  1262. if (clients.hasOwnProperty(instance)) {
  1263. var client = clients[instance];
  1264. for (var method in Keen.prototype)
  1265. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1266. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1267. ,
  1268. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1269. ,
  1270. client._config && (client.configure.call(client, client._config),
  1271. delete client._config),
  1272. client._setGlobalProperties) {
  1273. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1274. client.setGlobalProperties.apply(client, globals[i]);
  1275. delete client._setGlobalProperties
  1276. }
  1277. if (client._addEvent) {
  1278. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1279. client.addEvent.apply(client, queue[i]);
  1280. delete client._addEvent
  1281. }
  1282. var callback = client._on || [];
  1283. if (client._on) {
  1284. for (var i = 0; i < callback.length; i++)
  1285. client.on.apply(client, callback[i]);
  1286. client.trigger("ready"),
  1287. delete client._on
  1288. }
  1289. }
  1290. for (var i = 0; i < ready.length; i++) {
  1291. var callback = ready[i];
  1292. Keen.on("ready", function() {
  1293. callback()
  1294. })
  1295. }
  1296. }
  1297. return Keen.loaded && setTimeout(function() {
  1298. Keen.utils.domready(function() {
  1299. Keen.trigger("ready")
  1300. })
  1301. }, 0),
  1302. Keen
  1303. });
  1304. !function() {
  1305. var t = window.analytics = window.analytics || [];
  1306. if (!t.initialize) {
  1307. if (t.invoked)
  1308. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1309. t.invoked = !0,
  1310. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1311. t.factory = function(e) {
  1312. return function() {
  1313. var n = Array.prototype.slice.call(arguments);
  1314. return n.unshift(e),
  1315. t.push(n),
  1316. t
  1317. }
  1318. }
  1319. ;
  1320. for (var e = 0; e < t.methods.length; e++) {
  1321. var n = t.methods[e];
  1322. t[n] = t.factory(n)
  1323. }
  1324. t.load = function(t) {
  1325. var e = document.createElement("script");
  1326. e.type = "text/javascript",
  1327. e.async = !0,
  1328. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1329. var n = document.getElementsByTagName("script")[0];
  1330. n.parentNode.insertBefore(e, n)
  1331. }
  1332. ,
  1333. t.SNIPPET_VERSION = "4.0.0"
  1334. }
  1335. }();
  1336. !function(i, e) {
  1337. "use strict";
  1338. var s = ""
  1339. , r = "?"
  1340. , o = "function"
  1341. , a = "undefined"
  1342. , n = "object"
  1343. , t = "major"
  1344. , d = "model"
  1345. , w = "name"
  1346. , l = "type"
  1347. , p = "vendor"
  1348. , m = "version"
  1349. , c = "architecture"
  1350. , u = "console"
  1351. , g = "mobile"
  1352. , f = "tablet"
  1353. , h = "smarttv"
  1354. , b = {
  1355. has: function(i, e) {
  1356. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1357. },
  1358. lowerize: function(i) {
  1359. return i.toLowerCase()
  1360. }
  1361. }
  1362. , y = {
  1363. rgx: function() {
  1364. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1365. var c = m[p]
  1366. , u = m[p + 1];
  1367. if (typeof i === a) {
  1368. i = {};
  1369. for (t in u)
  1370. d = u[t],
  1371. typeof d === n ? i[d[0]] = e : i[d] = e
  1372. }
  1373. for (s = r = 0; s < c.length; s++)
  1374. if (w = c[s].exec(this.getUA())) {
  1375. for (t = 0; t < u.length; t++)
  1376. l = w[++r],
  1377. d = u[t],
  1378. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1379. break
  1380. }
  1381. if (w)
  1382. break
  1383. }
  1384. return i
  1385. },
  1386. str: function(i, s) {
  1387. for (var o in s)
  1388. if (typeof s[o] === n && s[o].length > 0) {
  1389. for (var a = 0; a < s[o].length; a++)
  1390. if (b.has(s[o][a], i))
  1391. return o === r ? e : o
  1392. } else if (b.has(s[o], i))
  1393. return o === r ? e : o;
  1394. return i
  1395. }
  1396. }
  1397. , v = {
  1398. browser: {
  1399. oldsafari: {
  1400. major: {
  1401. 1: ["/8", "/1", "/3"],
  1402. 2: "/4",
  1403. "?": "/"
  1404. },
  1405. version: {
  1406. "1.0": "/8",
  1407. 1.2: "/1",
  1408. 1.3: "/3",
  1409. "2.0": "/412",
  1410. "2.0.2": "/416",
  1411. "2.0.3": "/417",
  1412. "2.0.4": "/419",
  1413. "?": "/"
  1414. }
  1415. }
  1416. },
  1417. device: {
  1418. sprint: {
  1419. model: {
  1420. "Evo Shift 4G": "7373KT"
  1421. },
  1422. vendor: {
  1423. HTC: "APA",
  1424. Sprint: "Sprint"
  1425. }
  1426. }
  1427. },
  1428. os: {
  1429. windows: {
  1430. version: {
  1431. ME: "4.90",
  1432. "NT 3.11": "NT3.51",
  1433. "NT 4.0": "NT4.0",
  1434. 2e3: "NT 5.0",
  1435. XP: ["NT 5.1", "NT 5.2"],
  1436. Vista: "NT 6.0",
  1437. 7: "NT 6.1",
  1438. 8: "NT 6.2",
  1439. 8.1: "NT 6.3",
  1440. RT: "ARM"
  1441. }
  1442. }
  1443. }
  1444. }
  1445. , k = {
  1446. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1447. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1448. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1449. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1450. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [w, m]]
  1451. }
  1452. , x = function(e) {
  1453. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1454. return this instanceof x ? (this.getBrowser = function() {
  1455. return y.rgx.apply(this, k.browser)
  1456. }
  1457. ,
  1458. this.getCPU = function() {
  1459. return y.rgx.apply(this, k.cpu)
  1460. }
  1461. ,
  1462. this.getDevice = function() {
  1463. return y.rgx.apply(this, k.device)
  1464. }
  1465. ,
  1466. this.getEngine = function() {
  1467. return y.rgx.apply(this, k.engine)
  1468. }
  1469. ,
  1470. this.getOS = function() {
  1471. return y.rgx.apply(this, k.os)
  1472. }
  1473. ,
  1474. this.getResult = function() {
  1475. return {
  1476. ua: this.getUA(),
  1477. browser: this.getBrowser(),
  1478. engine: this.getEngine(),
  1479. os: this.getOS(),
  1480. device: this.getDevice(),
  1481. cpu: this.getCPU()
  1482. }
  1483. }
  1484. ,
  1485. this.getUA = function() {
  1486. return r
  1487. }
  1488. ,
  1489. this.setUA = function(i) {
  1490. return r = i,
  1491. this
  1492. }
  1493. ,
  1494. void this.setUA(r)) : new x(e).getResult()
  1495. };
  1496. if (typeof exports !== a)
  1497. typeof module !== a && module.exports && (exports = module.exports = x),
  1498. exports.UAParser = x;
  1499. else if (i.UAParser = x,
  1500. typeof define === o && define.amd && define(function() {
  1501. return x
  1502. }),
  1503. typeof i.jQuery !== a) {
  1504. var A = i.jQuery
  1505. , _ = new x;
  1506. A.ua = _.getResult(),
  1507. A.ua.get = function() {
  1508. return _.getUA()
  1509. }
  1510. ,
  1511. A.ua.set = function(i) {
  1512. _.setUA(i);
  1513. var e = _.getResult();
  1514. for (var s in e)
  1515. A.ua[s] = e[s]
  1516. }
  1517. }
  1518. }(this);
  1519. window.Modernizr = function(n, e, t) {
  1520. function o(n) {
  1521. d.cssText = n
  1522. }
  1523. function r(n, e) {
  1524. return typeof n === e
  1525. }
  1526. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1527. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1528. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1529. return e in n && r(n.constructor.prototype[e], "undefined")
  1530. }
  1531. : function(n, e) {
  1532. return v.call(n, e)
  1533. }
  1534. ,
  1535. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1536. var e = this;
  1537. if ("function" != typeof e)
  1538. throw new TypeError;
  1539. var t = b.call(arguments, 1)
  1540. , o = function() {
  1541. if (this instanceof o) {
  1542. var r = function() {};
  1543. r.prototype = e.prototype;
  1544. var i = new r
  1545. , c = e.apply(i, t.concat(b.call(arguments)));
  1546. return Object(c) === c ? c : i
  1547. }
  1548. return e.apply(n, t.concat(b.call(arguments)))
  1549. };
  1550. return o
  1551. }
  1552. ),
  1553. y.webgl = function() {
  1554. return !!n.WebGLRenderingContext
  1555. }
  1556. ;
  1557. for (var h in y)
  1558. u(y, h) && (c = h.toLowerCase(),
  1559. f[c] = y[h](),
  1560. w.push((f[c] ? "" : "no-") + c));
  1561. return f.addTest = function(n, e) {
  1562. if ("object" == typeof n)
  1563. for (var o in n)
  1564. u(n, o) && f.addTest(o, n[o]);
  1565. else {
  1566. if (n = n.toLowerCase(),
  1567. f[n] !== t)
  1568. return f;
  1569. e = "function" == typeof e ? e() : e,
  1570. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1571. f[n] = e
  1572. }
  1573. return f
  1574. }
  1575. ,
  1576. o(""),
  1577. p = i = null,
  1578. f._version = a,
  1579. f
  1580. }(this, this.document);
  1581. !function(e, t, a) {
  1582. "use strict";
  1583. function n(t, h, m) {
  1584. function H(a) {
  1585. var n = 0
  1586. , i = Ee.length;
  1587. if (Ce.old = e.extend({}, Ce),
  1588. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1589. ke = Be[ge.horizontal ? "width" : "height"](),
  1590. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1591. Ee.length = 0,
  1592. Ce.start = 0,
  1593. Ce.end = q(ze - Ie, 0),
  1594. Re) {
  1595. n = Ne.length,
  1596. qe = Pe.children(ge.itemSelector),
  1597. Ne.length = 0;
  1598. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  1599. ze = 0,
  1600. qe.each(function(t, a) {
  1601. var n = e(a)
  1602. , i = a.getBoundingClientRect()
  1603. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1604. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1605. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1606. , h = l + d + p
  1607. , m = !d || !p
  1608. , g = {};
  1609. g.el = a,
  1610. g.size = m ? l : h,
  1611. g.half = g.size / 2,
  1612. g.start = ze + (m ? d : 0),
  1613. g.center = g.start - E(Ie / 2 - g.size / 2),
  1614. g.end = g.start - Ie + g.size,
  1615. t || (ze += s),
  1616. ze += h,
  1617. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1618. t === v && (g.end += o,
  1619. ze += o,
  1620. f = m ? p : 0),
  1621. Ne.push(g),
  1622. r = g
  1623. }),
  1624. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1625. ze -= f,
  1626. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1627. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1628. }
  1629. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1630. Q(),
  1631. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1632. Te = d(Te, ge.minHandleSize, ke),
  1633. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1634. xe.end = ke - Te,
  1635. it || j()),
  1636. !we && Ie > 0) {
  1637. var p = Ce.start
  1638. , h = "";
  1639. if (Re)
  1640. e.each(Ne, function(e, t) {
  1641. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1642. Ee.push(p),
  1643. p += Ie,
  1644. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1645. });
  1646. else
  1647. for (; p - Ie < Ce.end; )
  1648. Ee.push(p),
  1649. p += Ie;
  1650. if (De[0] && i !== Ee.length) {
  1651. for (var m = 0; m < Ee.length; m++)
  1652. h += ge.pageBuilder.call(ye, m);
  1653. Ae = De.html(h).children(),
  1654. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1655. }
  1656. }
  1657. if (Oe.slideeSize = ze,
  1658. Oe.frameSize = Ie,
  1659. Oe.sbSize = ke,
  1660. Oe.handleSize = Te,
  1661. Re) {
  1662. a && null != ge.startAt && (W(ge.startAt),
  1663. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1664. var g = Ne[Oe.activeItem];
  1665. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1666. } else
  1667. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1668. pe("load")
  1669. }
  1670. function X(e, t, a) {
  1671. if (Re && at.released && !a) {
  1672. var n = $(e)
  1673. , i = e > Ce.start && e < Ce.end;
  1674. Le ? (i && (e = Ne[n.centerItem].center),
  1675. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1676. }
  1677. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  1678. et.start = +new Date,
  1679. et.time = 0,
  1680. et.from = Ce.cur,
  1681. et.to = e,
  1682. et.delta = e - Ce.cur,
  1683. et.tweesing = at.tweese || at.init && !at.slidee,
  1684. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1685. at.tweese = 0,
  1686. e !== Ce.dest && (Ce.dest = e,
  1687. pe("change"),
  1688. it || Y()),
  1689. K(),
  1690. Q(),
  1691. Z(),
  1692. F()
  1693. }
  1694. function Y() {
  1695. if (ye.initialized) {
  1696. if (!it)
  1697. return it = w(Y),
  1698. void (at.released && pe("moveStart"));
  1699. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1700. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  1701. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1702. et.to === Ce.cur ? (Ce.cur = et.to,
  1703. at.tweese = it = 0) : it = w(Y),
  1704. pe("move"),
  1705. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  1706. !it && at.released && pe("moveEnd"),
  1707. j()
  1708. }
  1709. }
  1710. function j() {
  1711. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  1712. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1713. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1714. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1715. }
  1716. function F() {
  1717. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1718. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1719. pe("activePage", _e.page))
  1720. }
  1721. function M() {
  1722. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1723. ot = at.init ? w(M) : 0,
  1724. tt.now = +new Date,
  1725. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1726. X(at.init ? tt.pos : E(tt.pos)),
  1727. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1728. tt.lastTime = tt.now
  1729. }
  1730. function L(e, t, n) {
  1731. if ("boolean" === i(t) && (n = t,
  1732. t = a),
  1733. t === a)
  1734. X(Ce[e], n);
  1735. else {
  1736. if (Le && "center" !== e)
  1737. return;
  1738. var r = ye.getPos(t);
  1739. r && X(r[e], n, !Le)
  1740. }
  1741. }
  1742. function R(e) {
  1743. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1744. }
  1745. function U(e) {
  1746. return R(l(e) && 0 > e ? e + Ne.length : e)
  1747. }
  1748. function W(e, t) {
  1749. var a = R(e);
  1750. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1751. qe.eq(a).addClass(ge.activeClass),
  1752. _e.active = Oe.activeItem = a,
  1753. Z(),
  1754. pe("active", a)),
  1755. a)
  1756. }
  1757. function $(e) {
  1758. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1759. var t = {}
  1760. , a = Me ? 0 : Ie / 2;
  1761. if (!we)
  1762. for (var n = 0, i = Ee.length; i > n; n++) {
  1763. if (e >= Ce.end || n === Ee.length - 1) {
  1764. t.activePage = Ee.length - 1;
  1765. break
  1766. }
  1767. if (e <= Ee[n] + a) {
  1768. t.activePage = n;
  1769. break
  1770. }
  1771. }
  1772. if (Re) {
  1773. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1774. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1775. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1776. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1777. s = c;
  1778. break
  1779. }
  1780. t.firstItem = l(r) ? r : 0,
  1781. t.centerItem = l(o) ? o : t.firstItem,
  1782. t.lastItem = l(s) ? s : t.centerItem
  1783. }
  1784. return t
  1785. }
  1786. function Q(t) {
  1787. e.extend(Oe, $(t))
  1788. }
  1789. function Z() {
  1790. var e = Ce.dest <= Ce.start
  1791. , t = Ce.dest >= Ce.end
  1792. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1793. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1794. Je.is("button,input") && Je.prop("disabled", e),
  1795. Ke.is("button,input") && Ke.prop("disabled", t),
  1796. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1797. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1798. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1799. Qe.is("button,input") && Qe.prop("disabled", e),
  1800. $e.is("button,input") && $e.prop("disabled", t)),
  1801. Re && null != Oe.activeItem) {
  1802. var n = 0 === Oe.activeItem
  1803. , i = Oe.activeItem >= Ne.length - 1
  1804. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1805. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1806. Ze.is("button,input") && Ze.prop("disabled", n),
  1807. Ge.is("button,input") && Ge.prop("disabled", i),
  1808. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1809. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1810. }
  1811. }
  1812. function G(e, t, a) {
  1813. if (e = U(e),
  1814. t = U(t),
  1815. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1816. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1817. var n = t > e ? e : a ? t : t - 1
  1818. , i = e > t ? e : a ? t + 1 : t
  1819. , r = e > t;
  1820. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  1821. H()
  1822. }
  1823. }
  1824. function J(e, t) {
  1825. for (var a = 0, n = Ve[e].length; n > a; a++)
  1826. if (Ve[e][a] === t)
  1827. return a;
  1828. return -1
  1829. }
  1830. function K() {
  1831. at.released && !ye.isPaused && ye.resume()
  1832. }
  1833. function V(e) {
  1834. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1835. }
  1836. function _() {
  1837. at.history[0] = at.history[1],
  1838. at.history[1] = at.history[2],
  1839. at.history[2] = at.history[3],
  1840. at.history[3] = at.delta
  1841. }
  1842. function ee(e) {
  1843. at.released = 0,
  1844. at.source = e,
  1845. at.slidee = "slidee" === e
  1846. }
  1847. function te(t) {
  1848. var a = "touchstart" === t.type
  1849. , n = t.data.source
  1850. , i = "slidee" === n;
  1851. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  1852. ee(n),
  1853. at.init = 0,
  1854. at.$source = e(t.target),
  1855. at.touch = a,
  1856. at.pointer = a ? t.originalEvent.touches[0] : t,
  1857. at.initX = at.pointer.pageX,
  1858. at.initY = at.pointer.pageY,
  1859. at.initPos = i ? Ce.cur : xe.cur,
  1860. at.start = +new Date,
  1861. at.time = 0,
  1862. at.path = 0,
  1863. at.delta = 0,
  1864. at.locked = 0,
  1865. at.history = [0, 0, 0, 0],
  1866. at.pathToLock = i ? a ? 30 : 10 : 0,
  1867. b.on(a ? z : I, ae),
  1868. ye.pause(1),
  1869. (i ? Pe : Se).addClass(ge.draggedClass),
  1870. pe("moveStart"),
  1871. i && (rt = setInterval(_, 10)))
  1872. }
  1873. function ae(e) {
  1874. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1875. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1876. at.pathX = at.pointer.pageX - at.initX,
  1877. at.pathY = at.pointer.pageY - at.initY,
  1878. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1879. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1880. at.released || !(at.path < 1)) {
  1881. if (!at.init) {
  1882. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1883. return ne();
  1884. at.init = 1
  1885. }
  1886. r(e),
  1887. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1888. at.$source.on(B, s)),
  1889. at.released && (ne(),
  1890. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1891. at.delta += at.swing,
  1892. at.tweese = x(at.swing) > 10)),
  1893. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1894. }
  1895. }
  1896. function ne() {
  1897. clearInterval(rt),
  1898. at.released = !0,
  1899. b.off(at.touch ? z : I, ae),
  1900. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1901. setTimeout(function() {
  1902. at.$source.off(B, s)
  1903. }),
  1904. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1905. ye.resume(1),
  1906. at.init = 0
  1907. }
  1908. function ie(t) {
  1909. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1910. }
  1911. function re() {
  1912. ye.stop(),
  1913. b.off("mouseup", re)
  1914. }
  1915. function se(e) {
  1916. switch (r(e),
  1917. this) {
  1918. case $e[0]:
  1919. case Qe[0]:
  1920. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1921. b.on("mouseup", re);
  1922. break;
  1923. case Ze[0]:
  1924. ye.prev();
  1925. break;
  1926. case Ge[0]:
  1927. ye.next();
  1928. break;
  1929. case Je[0]:
  1930. ye.prevPage();
  1931. break;
  1932. case Ke[0]:
  1933. ye.nextPage()
  1934. }
  1935. }
  1936. function oe(e) {
  1937. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1938. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1939. Re ? (p = +new Date,
  1940. nt.last < p - nt.resetTime && (nt.delta = 0),
  1941. nt.last = p,
  1942. nt.delta += nt.curDelta,
  1943. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1944. nt.delta %= 1),
  1945. nt.finalDelta) : nt.curDelta
  1946. }
  1947. function le(e) {
  1948. e.originalEvent[g] = ye;
  1949. var t = +new Date;
  1950. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1951. return void (O = t);
  1952. if (ge.scrollBy && Ce.start !== Ce.end) {
  1953. var a = oe(e.originalEvent);
  1954. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1955. ye.slideBy(ge.scrollBy * a)
  1956. }
  1957. }
  1958. function ce(e) {
  1959. ge.clickBar && e.target === Be[0] && (r(e),
  1960. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1961. }
  1962. function de(e) {
  1963. if (ge.keyboardNavBy)
  1964. switch (e.which) {
  1965. case ge.horizontal ? 37 : 38:
  1966. r(e),
  1967. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1968. break;
  1969. case ge.horizontal ? 39 : 40:
  1970. r(e),
  1971. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1972. }
  1973. }
  1974. function ue(e) {
  1975. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1976. }
  1977. function fe() {
  1978. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1979. }
  1980. function ve(e) {
  1981. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1982. }
  1983. function pe(e, t) {
  1984. if (Ve[e]) {
  1985. for (me = Ve[e].length,
  1986. T.length = 0,
  1987. he = 0; me > he; he++)
  1988. T.push(Ve[e][he]);
  1989. for (he = 0; me > he; he++)
  1990. T[he].call(ye, e, t)
  1991. }
  1992. }
  1993. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  1994. start: 0,
  1995. center: 0,
  1996. end: 0,
  1997. cur: 0,
  1998. dest: 0
  1999. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2000. start: 0,
  2001. end: 0,
  2002. cur: 0
  2003. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2004. firstItem: 0,
  2005. lastItem: 0,
  2006. centerItem: 0,
  2007. activeItem: null,
  2008. activePage: 0
  2009. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2010. released: 1
  2011. }, nt = {
  2012. last: 0,
  2013. delta: 0,
  2014. resetTime: 200
  2015. }, it = 0, rt = 0, st = 0, ot = 0;
  2016. we || (t = be[0]),
  2017. ye.initialized = 0,
  2018. ye.frame = t,
  2019. ye.slidee = Pe[0],
  2020. ye.pos = Ce,
  2021. ye.rel = Oe,
  2022. ye.items = Ne,
  2023. ye.pages = Ee,
  2024. ye.isPaused = 0,
  2025. ye.options = ge,
  2026. ye.dragging = at,
  2027. ye.reload = function() {
  2028. H()
  2029. }
  2030. ,
  2031. ye.getPos = function(e) {
  2032. if (Re) {
  2033. var t = R(e);
  2034. return -1 !== t && Ne[t]
  2035. }
  2036. var a = Pe.find(e).eq(0);
  2037. if (a[0]) {
  2038. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2039. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2040. return {
  2041. start: n,
  2042. center: n - Ie / 2 + i / 2,
  2043. end: n - Ie + i,
  2044. size: i
  2045. }
  2046. }
  2047. return !1
  2048. }
  2049. ,
  2050. ye.moveBy = function(e) {
  2051. tt.speed = e,
  2052. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2053. tt.startPos = Ce.cur,
  2054. ee("button"),
  2055. at.init = 1,
  2056. pe("moveStart"),
  2057. y(ot),
  2058. M())
  2059. }
  2060. ,
  2061. ye.stop = function() {
  2062. "button" === at.source && (at.init = 0,
  2063. at.released = 1)
  2064. }
  2065. ,
  2066. ye.prev = function() {
  2067. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2068. }
  2069. ,
  2070. ye.next = function() {
  2071. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2072. }
  2073. ,
  2074. ye.prevPage = function() {
  2075. ye.activatePage(Oe.activePage - 1)
  2076. }
  2077. ,
  2078. ye.nextPage = function() {
  2079. ye.activatePage(Oe.activePage + 1)
  2080. }
  2081. ,
  2082. ye.slideBy = function(e, t) {
  2083. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2084. }
  2085. ,
  2086. ye.slideTo = function(e, t) {
  2087. X(e, t)
  2088. }
  2089. ,
  2090. ye.toStart = function(e, t) {
  2091. L("start", e, t)
  2092. }
  2093. ,
  2094. ye.toEnd = function(e, t) {
  2095. L("end", e, t)
  2096. }
  2097. ,
  2098. ye.toCenter = function(e, t) {
  2099. L("center", e, t)
  2100. }
  2101. ,
  2102. ye.getIndex = R,
  2103. ye.activate = function(e, t) {
  2104. var a = W(e);
  2105. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2106. }
  2107. ,
  2108. ye.activatePage = function(e, t) {
  2109. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2110. }
  2111. ,
  2112. ye.resume = function(e) {
  2113. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2114. st ? st = clearTimeout(st) : pe("resume"),
  2115. st = setTimeout(function() {
  2116. switch (pe("cycle"),
  2117. ge.cycleBy) {
  2118. case "items":
  2119. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2120. break;
  2121. case "pages":
  2122. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2123. }
  2124. }, ge.cycleInterval))
  2125. }
  2126. ,
  2127. ye.pause = function(e) {
  2128. e < ye.isPaused || (ye.isPaused = e || 100,
  2129. st && (st = clearTimeout(st),
  2130. pe("pause")))
  2131. }
  2132. ,
  2133. ye.toggle = function() {
  2134. ye[st ? "pause" : "resume"]()
  2135. }
  2136. ,
  2137. ye.set = function(t, a) {
  2138. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2139. }
  2140. ,
  2141. ye.add = function(t, a) {
  2142. var n = e(t);
  2143. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2144. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2145. H()
  2146. }
  2147. ,
  2148. ye.remove = function(t) {
  2149. if (Re) {
  2150. var a = U(t);
  2151. if (a > -1) {
  2152. qe.eq(a).remove();
  2153. var n = a === Oe.activeItem;
  2154. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2155. H(),
  2156. n && (_e.active = null,
  2157. ye.activate(Oe.activeItem))
  2158. }
  2159. } else
  2160. e(t).remove(),
  2161. H()
  2162. }
  2163. ,
  2164. ye.moveAfter = function(e, t) {
  2165. G(e, t, 1)
  2166. }
  2167. ,
  2168. ye.moveBefore = function(e, t) {
  2169. G(e, t)
  2170. }
  2171. ,
  2172. ye.on = function(e, t) {
  2173. if ("object" === i(e))
  2174. for (var a in e)
  2175. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2176. else if ("function" === i(t))
  2177. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2178. Ve[n[r]] = Ve[n[r]] || [],
  2179. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2180. else if ("array" === i(t))
  2181. for (var o = 0, l = t.length; l > o; o++)
  2182. ye.on(e, t[o])
  2183. }
  2184. ,
  2185. ye.one = function(e, t) {
  2186. function a() {
  2187. t.apply(ye, arguments),
  2188. ye.off(e, a)
  2189. }
  2190. ye.on(e, a)
  2191. }
  2192. ,
  2193. ye.off = function(e, t) {
  2194. if (t instanceof Array)
  2195. for (var a = 0, n = t.length; n > a; a++)
  2196. ye.off(e, t[a]);
  2197. else
  2198. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2199. if (Ve[i[r]] = Ve[i[r]] || [],
  2200. null == t)
  2201. Ve[i[r]].length = 0;
  2202. else {
  2203. var o = J(i[r], t);
  2204. -1 !== o && Ve[i[r]].splice(o, 1)
  2205. }
  2206. }
  2207. ,
  2208. ye.destroy = function() {
  2209. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2210. b.off("keydown", de),
  2211. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2212. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2213. De.empty(),
  2214. we || (be.off("." + g),
  2215. He.restore(),
  2216. Xe.restore(),
  2217. Ye.restore(),
  2218. je.restore(),
  2219. e.removeData(t, g)),
  2220. Ne.length = Ee.length = 0,
  2221. _e = {},
  2222. ye.initialized = 0,
  2223. ye
  2224. }
  2225. ,
  2226. ye.init = function() {
  2227. if (!ye.initialized) {
  2228. ye.on(m);
  2229. var e = ["overflow", "position"]
  2230. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2231. He.save.apply(He, e),
  2232. Ye.save.apply(Ye, e),
  2233. Xe.save.apply(Xe, t),
  2234. je.save.apply(je, t);
  2235. var a = Se;
  2236. return we || (a = a.add(Pe),
  2237. be.css("overflow", "hidden"),
  2238. f || "static" !== be.css("position") || be.css("position", "relative")),
  2239. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2240. a.css({
  2241. position: "absolute"
  2242. })),
  2243. ge.forward && $e.on(S, se),
  2244. ge.backward && Qe.on(S, se),
  2245. ge.prev && Ze.on(B, se),
  2246. ge.next && Ge.on(B, se),
  2247. ge.prevPage && Je.on(B, se),
  2248. ge.nextPage && Ke.on(B, se),
  2249. Ue.on(C, le),
  2250. Be[0] && Be.on(B, ce),
  2251. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2252. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2253. We.on(P, {
  2254. source: "slidee"
  2255. }, te),
  2256. Se && Se.on(P, {
  2257. source: "handle"
  2258. }, te),
  2259. b.on("keydown", de),
  2260. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2261. be.on("scroll." + g, o)),
  2262. ye.initialized = 1,
  2263. H(!0),
  2264. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2265. ye
  2266. }
  2267. }
  2268. }
  2269. function i(e) {
  2270. 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
  2271. }
  2272. function r(e, t) {
  2273. e.preventDefault(),
  2274. t && e.stopPropagation()
  2275. }
  2276. function s(t) {
  2277. r(t, 1),
  2278. e(this).off(t.type, s)
  2279. }
  2280. function o() {
  2281. this.scrollLeft = 0,
  2282. this.scrollTop = 0
  2283. }
  2284. function l(e) {
  2285. return !isNaN(parseFloat(e)) && isFinite(e)
  2286. }
  2287. function c(e, t) {
  2288. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2289. }
  2290. function d(e, t, a) {
  2291. return t > e ? t : e > a ? a : e
  2292. }
  2293. function u(e) {
  2294. var t = {};
  2295. return t.style = {},
  2296. t.save = function() {
  2297. if (e && e.nodeType) {
  2298. for (var a = 0; a < arguments.length; a++)
  2299. t.style[arguments[a]] = e.style[arguments[a]];
  2300. return t
  2301. }
  2302. }
  2303. ,
  2304. t.restore = function() {
  2305. if (e && e.nodeType) {
  2306. for (var a in t.style)
  2307. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2308. return t
  2309. }
  2310. }
  2311. ,
  2312. t
  2313. }
  2314. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2315. b.on(C, function(e) {
  2316. var t = e.originalEvent[g]
  2317. , a = +new Date;
  2318. (!t || t.options.scrollHijack < a - O) && (O = a)
  2319. }),
  2320. function(e) {
  2321. function t(e) {
  2322. var t = (new Date).getTime()
  2323. , n = Math.max(0, 16 - (t - a))
  2324. , i = setTimeout(e, n);
  2325. return a = t,
  2326. i
  2327. }
  2328. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2329. var a = (new Date).getTime()
  2330. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2331. y = function(t) {
  2332. n.call(e, t)
  2333. }
  2334. }(window),
  2335. function() {
  2336. function e(e) {
  2337. for (var n = 0, i = t.length; i > n; n++) {
  2338. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2339. if (null != a.style[r])
  2340. return r
  2341. }
  2342. }
  2343. var t = ["", "webkit", "moz", "ms", "o"]
  2344. , a = document.createElement("div");
  2345. f = e("transform"),
  2346. v = e("perspective") ? "translateZ(0) " : ""
  2347. }(),
  2348. t[m] = n,
  2349. e.fn[h] = function(t, a) {
  2350. var r, s;
  2351. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2352. s = Array.prototype.slice.call(arguments, 1)),
  2353. t = {}),
  2354. this.each(function(i, o) {
  2355. var l = e.data(o, g);
  2356. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2357. })
  2358. }
  2359. ,
  2360. n.defaults = {
  2361. slidee: null,
  2362. horizontal: !1,
  2363. itemNav: null,
  2364. itemSelector: null,
  2365. smart: !1,
  2366. activateOn: null,
  2367. activateMiddle: !1,
  2368. scrollSource: null,
  2369. scrollBy: 0,
  2370. scrollHijack: 300,
  2371. scrollTrap: !1,
  2372. dragSource: null,
  2373. mouseDragging: !1,
  2374. touchDragging: !1,
  2375. releaseSwing: !1,
  2376. swingSpeed: .2,
  2377. elasticBounds: !1,
  2378. interactive: null,
  2379. scrollBar: null,
  2380. dragHandle: !1,
  2381. dynamicHandle: !1,
  2382. minHandleSize: 50,
  2383. clickBar: !1,
  2384. syncSpeed: .5,
  2385. pagesBar: null,
  2386. activatePageOn: null,
  2387. pageBuilder: function(e) {
  2388. return "<li>" + (e + 1) + "</li>"
  2389. },
  2390. forward: null,
  2391. backward: null,
  2392. prev: null,
  2393. next: null,
  2394. prevPage: null,
  2395. nextPage: null,
  2396. cycleBy: null,
  2397. cycleInterval: 5e3,
  2398. pauseOnHover: !1,
  2399. startPaused: !1,
  2400. moveBy: 300,
  2401. speed: 0,
  2402. easing: "swing",
  2403. startAt: null,
  2404. keyboardNavBy: null,
  2405. draggedClass: "dragged",
  2406. activeClass: "active",
  2407. disabledClass: "disabled"
  2408. }
  2409. }(jQuery, window);
  2410. !function e(t, i, n) {
  2411. function r(a, s) {
  2412. if (!i[a]) {
  2413. if (!t[a]) {
  2414. var l = "function" == typeof require && require;
  2415. if (!s && l)
  2416. return l(a, !0);
  2417. if (o)
  2418. return o(a, !0);
  2419. var c = new Error("Cannot find module '" + a + "'");
  2420. throw c.code = "MODULE_NOT_FOUND",
  2421. c
  2422. }
  2423. var h = i[a] = {
  2424. exports: {}
  2425. };
  2426. t[a][0].call(h.exports, function(e) {
  2427. var i = t[a][1][e];
  2428. return r(i ? i : e)
  2429. }, h, h.exports, e, t, i, n)
  2430. }
  2431. return i[a].exports
  2432. }
  2433. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2434. r(n[a]);
  2435. return r
  2436. }({
  2437. 1: [function(e, t, i) {///js/DisplayController.js
  2438. (function(i) {
  2439. "use strict";
  2440. function n(e) {
  2441. this.player = null,
  2442. this.director = null,
  2443. this.modelManager = null,
  2444. this.container = null,
  2445. this.tagManager = null,
  2446. this.fadeInSpeed = e,
  2447. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2448. }
  2449. var r = e("three")
  2450. , o = e("./util/logger")
  2451. , a = (e("./util/common"),
  2452. e("./enum/PlayerEvents"))
  2453. , s = e("./enum/DirectorEvents")
  2454. , l = e("./settings")
  2455. , c = e("./enum/Viewmode")
  2456. , h = (e("./enum/WarpStyle"),
  2457. e("./enum/BlackoutStyle"),
  2458. e("./enum/ModelManagerEvents"))
  2459. , u = e("./enum/tagEvents")
  2460. , d = e("./util/transitions")
  2461. , p = e("./util/lerp")
  2462. , f = new o(i);
  2463. n.prototype.init = function(e, t, i, n, r) {
  2464. this.player = t,
  2465. this.director = e,
  2466. this.modelManager = i,
  2467. this.tagManager = n,
  2468. this.container = r,
  2469. this.updateModel(),
  2470. this.bindEvents()
  2471. }
  2472. ,
  2473. n.prototype.bindEvents = function() {
  2474. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2475. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2476. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2477. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2478. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2479. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2480. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2481. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2482. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2483. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2484. }
  2485. ,
  2486. n.prototype.updateModel = function() {
  2487. this.model = this.modelManager.getActiveModel()
  2488. }
  2489. ,
  2490. n.prototype.handleWarpStarted = function() {
  2491. this.hidePlayerReticule()
  2492. }
  2493. ,
  2494. n.prototype.ontagActivated = function() {
  2495. this.hidePlayerReticule()
  2496. }
  2497. ,
  2498. n.prototype.onNavigationTotag = function() {
  2499. this.hidePlayerReticule()
  2500. }
  2501. ,
  2502. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2503. var n = this.modelManager.getActiveModel()
  2504. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2505. n.fadePanoMarkers(r),
  2506. n.setMode(t)
  2507. }
  2508. ,
  2509. n.prototype.handlePlayerModeChanged = function(e, t) {
  2510. var i = this.modelManager.getActiveModel()
  2511. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2512. i.setSide(n),
  2513. i.setMode(t)
  2514. }
  2515. ,
  2516. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2517. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2518. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2519. }
  2520. ,
  2521. n.prototype.handleActionInterruption = function() {}
  2522. ,
  2523. n.prototype.handleStartInside = function(e) {
  2524. var t = l[this.player.mode]
  2525. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2526. this.fadeIn(this.fadeInSpeed),
  2527. this.model.alpha = 0,
  2528. this.model.skybox.material.uniforms.opacity.value = 1,
  2529. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2530. var n = this.player.reticule;
  2531. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2532. }
  2533. ,
  2534. n.prototype.handleStartOutside = function(e) {
  2535. this.fadeIn(e)
  2536. }
  2537. ,
  2538. n.prototype.fadeIn = function(e) {
  2539. null !== e && void 0 !== e || (e = 2e3,
  2540. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2541. $(this.container).fadeIn(e)
  2542. }
  2543. ,
  2544. n.prototype.hidePlayerReticule = function() {
  2545. this.player.reticule.hide()
  2546. }
  2547. ,
  2548. t.exports = n
  2549. }
  2550. ).call(this, "/js/DisplayController.js")
  2551. }
  2552. , {
  2553. "./enum/BlackoutStyle": 18,
  2554. "./enum/DirectorEvents": 23,
  2555. "./enum/tagEvents": 32,
  2556. "./enum/ModelManagerEvents": 33,
  2557. "./enum/PlayerEvents": 40,
  2558. "./enum/Viewmode": 51,
  2559. "./enum/WarpStyle": 52,
  2560. "./settings": 166,
  2561. "./util/common": 185,
  2562. "./util/lerp": 188,
  2563. "./util/logger": 189,
  2564. "./util/transitions": 195,
  2565. three: 217
  2566. }],
  2567. 2: [function(e, t, i) {//TimingDatas"
  2568. "use strict";
  2569. function n() {
  2570. this.baseStartTime = performance.timing.navigationStart,
  2571. this.loadingStartTime = null,
  2572. this.waitingStartTime = null,
  2573. this.appReadyTime = null
  2574. }
  2575. n.prototype.setBaseStartTime = function(e) {
  2576. this.baseStartTime = e || Date.now()
  2577. }
  2578. ,
  2579. n.prototype.setWaitingStartTime = function(e) {
  2580. this.waitingStartTime = e || Date.now()
  2581. }
  2582. ,
  2583. n.prototype.setLoadingStartTime = function(e) {
  2584. this.loadingStartTime = e || Date.now()
  2585. }
  2586. ,
  2587. n.prototype.setAppReadyTime = function(e) {
  2588. this.appReadyTime = e || Date.now()
  2589. }
  2590. ,
  2591. n.prototype.calcFullLoadingTime = function() {
  2592. var e = this.appReadyTime - this.baseStartTime;
  2593. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2594. e
  2595. }
  2596. ,
  2597. t.exports = n
  2598. }
  2599. , {}],
  2600. 3: [function(e, t, i) {///js/ab.js
  2601. (function(i) {
  2602. "use strict";
  2603. function n() {
  2604. return 100 * Math.random()
  2605. }
  2606. var r = e("./util/logger")
  2607. , o = e("./util/browser")
  2608. , a = new r(i)
  2609. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2610. initialized: !1,
  2611. init: function(e, t) {
  2612. if (t = t || {},
  2613. !this.initialized) {
  2614. this.initialized = !0,
  2615. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2616. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2617. for (var i in e) {
  2618. var r = i.match("^sc_tilegen_([0-9]+)$");
  2619. r && (s.tilegen = n() < parseInt(r[1]));
  2620. var l = i.match("^sc_imgopt_([0-9]+)$");
  2621. l && (s.imgopt = n() < parseInt(l[1]))
  2622. }
  2623. for (var c in t)
  2624. s[c] = t[c],
  2625. a.debug("A/B override:", c, s[c])
  2626. }
  2627. },
  2628. changeIfTileGenerating: function(e) {
  2629. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2630. e += "imgopt=1"),
  2631. e
  2632. },
  2633. changeIfImageOptimzing: function(e) {
  2634. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2635. e += "imgopt=1"),
  2636. e
  2637. },
  2638. tilegen: !1,
  2639. imgopt: !1
  2640. };
  2641. t.exports = s
  2642. }
  2643. ).call(this, "/js/ab.js")
  2644. }
  2645. , {
  2646. "./util/browser": 182,
  2647. "./util/logger": 189
  2648. }],
  2649. 4: [function(e, t, i) {///js/analytics.js
  2650. (function(i) {
  2651. "use strict";
  2652. function n() {
  2653. return {
  2654. addons: [{
  2655. name: "keen:ua_parser",
  2656. input: {
  2657. ua_string: "user_agent"
  2658. },
  2659. output: "parsed_user_agent"
  2660. }]
  2661. }
  2662. }
  2663. function r(e, t, i, n) {
  2664. function r(t) {
  2665. l[t.sid] = !0;
  2666. var i = t.billboard.media && t.billboard.media.type
  2667. , n = {
  2668. tag_id: t.sid,
  2669. tags_visited: Object.keys(l).length,
  2670. tag_count: Object.keys(e.tags).length,
  2671. tag_view_count: ++E,
  2672. has_media: !!i
  2673. };
  2674. i && (n.media_type = i),
  2675. u("tag_opened", n)
  2676. }
  2677. var l = {}
  2678. , h = Date.now() - N
  2679. , f = null;
  2680. n && (f = Date.now() - window.navigationStart);
  2681. var g;
  2682. try {
  2683. g = e.data.player_options.highlight_reel && e.heroLocations.length > 1
  2684. } catch (e) {
  2685. g = !1
  2686. }
  2687. var v, A = e.supportsVR;
  2688. A || (v = "VR disabled at the model/account level",
  2689. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  2690. u("model_loaded", {
  2691. duration: h,
  2692. duration_from_navigation_start: f,
  2693. has_hlr: g,
  2694. has_vr: A,
  2695. vr_reason: v
  2696. });
  2697. var I = 0;
  2698. e.panos.forEach(function(e) {
  2699. e.on("enter", function() {
  2700. c("pano_viewed", {
  2701. pano_id: e.id,
  2702. pano_view_count: ++I,
  2703. alignment_type: e.alignmentType,
  2704. interaction_source: O,
  2705. navigation_source: p
  2706. })
  2707. })
  2708. });
  2709. var E = 0;
  2710. for (var T in e.tags)
  2711. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2712. t.on("tour_auto", function(e) {
  2713. p = "tour_" + e
  2714. }),
  2715. t.on("tour_manual", function(e) {
  2716. O = "gui-" + e,
  2717. p = "tour_manual"
  2718. }),
  2719. i.on(C.InteractionKey, function() {
  2720. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2721. }),
  2722. i.on(C.InteractionDirect, function() {
  2723. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2724. }),
  2725. o(t),
  2726. a(),
  2727. s()
  2728. }
  2729. function o(e) {
  2730. I.on(T.OPENED, function() {
  2731. c("showcase_share_intent", {
  2732. pano_id: e.currentPano && e.currentPano.id
  2733. })
  2734. }),
  2735. I.on(T.LINK_CLICKED, function(t) {
  2736. c("showcase_share_action", {
  2737. channel: t.channel,
  2738. pano_id: e.currentPano && e.currentPano.id
  2739. })
  2740. }),
  2741. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2742. c("showcase_share_origin_link_clicked")
  2743. })
  2744. }
  2745. function a() {}
  2746. function s() {
  2747. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2748. gui_action: "click_vr_button"
  2749. })),
  2750. b.on(S.LAUNCH, function(e) {
  2751. c("showcase_gui", {
  2752. gui_action: "launch_vr",
  2753. vr_platform: e.vr_platform,
  2754. vr_app: e.vr_app
  2755. })
  2756. }),
  2757. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2758. gui_action: "vr_modal_prev"
  2759. })),
  2760. b.on(S.NEXT, function(e) {
  2761. c("showcase_gui", {
  2762. gui_action: e.nextAction
  2763. })
  2764. }),
  2765. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2766. gui_action: "vr_modal_close"
  2767. })),
  2768. b.on(S.falseICECHOSEN, function(e) {
  2769. c("showcase_gui", {
  2770. gui_action: e.name + " "
  2771. })
  2772. }),
  2773. b.on(S.STORE, function(e) {
  2774. c("showcase_gui", {
  2775. gui_action: "launch_store",
  2776. store: e
  2777. })
  2778. })
  2779. }
  2780. function l(e, t) {
  2781. if (f)
  2782. try {
  2783. f.addEvent(e, v.extendObject({
  2784. host: window.location.host,
  2785. keen: n(),
  2786. user_agent: "${keen.user_agent}",
  2787. referrer: {
  2788. url: v.normalizeUrl(document.referrer),
  2789. domain: v.domainFromUrl(document.referrer),
  2790. url_original: document.referrer
  2791. },
  2792. embedded: m.inIframe(),
  2793. is_mobile: m.isMobile(),
  2794. version: "2.25.6-0-gd87e5b1"
  2795. }, t))
  2796. } catch (e) {
  2797. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2798. }
  2799. }
  2800. function c(e, t) {
  2801. if (t = t || {},
  2802. L)
  2803. try {
  2804. window.analytics.track(e, v.extendObject(t, B), {
  2805. context: {
  2806. app: {
  2807. name: "showcase",
  2808. version: "2.25.6-0-gd87e5b1"
  2809. },
  2810. screen: {
  2811. width: window.screen.width,
  2812. height: window.screen.height,
  2813. density: window.devicePixelRatio
  2814. }
  2815. }
  2816. })
  2817. } catch (t) {
  2818. console.warn("Failed to send data to segment for " + e)
  2819. }
  2820. }
  2821. function h(e, t) {
  2822. if (t = t || {},
  2823. navigator.sendBeacon && L)
  2824. try {
  2825. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2826. event: e,
  2827. anonymousId: window.analytics.user().anonymousId(),
  2828. properties: v.extendObject(t, B),
  2829. writeKey: L,
  2830. sentAt: Date.now(),
  2831. type: "track",
  2832. context: {
  2833. userAgent: m.userAgent(),
  2834. library: {
  2835. name: "showcase-beacon",
  2836. version: "2.25.6-0-gd87e5b1"
  2837. },
  2838. app: {
  2839. name: "showcase",
  2840. version: "2.25.6-0-gd87e5b1"
  2841. }
  2842. }
  2843. }))
  2844. } catch (e) {
  2845. console.warn("Failed to send async segment request")
  2846. }
  2847. }
  2848. function u(e, t) {
  2849. t = t || {},
  2850. c(e, t)
  2851. }
  2852. function d(e, t) {
  2853. O = e === C.InteractionGui ? "gui-" + t : e,
  2854. p = "self_guided"
  2855. }
  2856. var p, f, g = (e("three"),
  2857. e("./util/ajax"),
  2858. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2859. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  2860. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2861. t.exports = {
  2862. report: function(e, t, i, n) {
  2863. l("Session starts", {
  2864. model: e,
  2865. status: t,
  2866. loadtime: Date.now() - (N || Date.now()),
  2867. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2868. autoplay: i,
  2869. quickstart: n,
  2870. ab_tilegen: g.tilegen,
  2871. ab_imgopt: g.imgopt
  2872. })
  2873. },
  2874. impression: function(e) {
  2875. e = e || {};
  2876. var t = void 0 === e.isVisible || e.isVisible
  2877. , i = (void 0 !== e.immediate && e.immediate,
  2878. window.location.search.substr(1).split("&"));
  2879. u("impression", {
  2880. visible: t,
  2881. url_params: i
  2882. })
  2883. },
  2884. initKeen: function(e) {
  2885. return e.token && e.appId ? void (f = new Keen({
  2886. projectId: e.appId,
  2887. writeKey: e.token,
  2888. readKey: "",
  2889. requestType: "xhr"
  2890. })) : void P.warn("no keen token/appId")
  2891. },
  2892. initSegment: function(e) {
  2893. return e.token ? (L = e.token,
  2894. window.analytics.load(e.token),
  2895. B = {
  2896. model_id: e.model,
  2897. start_source: e.startSource,
  2898. autoplay: e.autoplay,
  2899. quickstart: e.quickstart,
  2900. language_tag: A.languageTag,
  2901. is_mobile: m.isMobile(),
  2902. iframe: m.inIframe(),
  2903. aspect_ratio: m.aspectRatio(),
  2904. session_id: F,
  2905. window: {
  2906. width: $('#player').width(),
  2907. height: $('#player').height()
  2908. },
  2909. platform: {
  2910. browser: {
  2911. name: $.ua.browser.name,
  2912. major: $.ua.browser.major,
  2913. version: $.ua.browser.version
  2914. },
  2915. os: {
  2916. name: $.ua.os.name,
  2917. version: $.ua.os.version
  2918. },
  2919. device: {
  2920. vendor: $.ua.device.vendor,
  2921. model: $.ua.device.model,
  2922. type: $.ua.device.type
  2923. }
  2924. }
  2925. },
  2926. D = Math.random() < A.analytics.sessionTrackingRate,
  2927. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2928. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2929. },
  2930. sessionStart: function(e) {
  2931. P.debug("analytics user_session_start"),
  2932. c("session_started"),
  2933. N = Date.now(),
  2934. window.addEventListener("unload", function() {
  2935. h("session_ended", {
  2936. duration: Date.now() - N
  2937. })
  2938. })
  2939. },
  2940. modelLoaded: function(e, t, i, n) {
  2941. r(e, t, i, n)
  2942. },
  2943. loadComplete: function(e) {
  2944. var t = {
  2945. time_to_app_start: e
  2946. };
  2947. c("load_times", t)
  2948. },
  2949. track: function(e, t) {
  2950. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2951. c(e, t))
  2952. },
  2953. trackAlways: function(e, t) {
  2954. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2955. c(e, t)
  2956. },
  2957. getSessionId: function() {
  2958. return F
  2959. },
  2960. updateInteraction: d
  2961. }
  2962. }
  2963. ).call(this, "/js/analytics.js")
  2964. }
  2965. , {
  2966. "./ab": 3,
  2967. "./enum/ControlEvents": 21,
  2968. "./enum/PlayerEvents": 40,
  2969. "./enum/VROption": 47,
  2970. "./enum/VRPlatforms": 49,
  2971. "./enum/Viewmode": 51,
  2972. "./gui/sharing/ShareEvents": 76,
  2973. "./gui/sharing/modal": 77,
  2974. "./gui/title/TitleEvents": 80,
  2975. "./gui/title/titleBar": 82,
  2976. "./gui/vr/vrEvent": 85,
  2977. "./gui/vr/vrModal": 87,
  2978. "./localization/localize": 108,
  2979. "./tag/Billboard/BillboardEvent": 120,
  2980. "./settings": 166,
  2981. "./util/ajax": 181,
  2982. "./util/browser": 182,
  2983. "./util/common": 185,
  2984. "./util/logger": 189,
  2985. three: 217
  2986. }],
  2987. 5: [function(e, t, i) {//"../cameras/DollhouseCamera"
  2988. "use strict";
  2989. function n() {
  2990. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $('#player').width() / $('#player').height(), o.dollhouseNear, o.dollhouseFar),
  2991. this.controls = null
  2992. }
  2993. var r = e("three")
  2994. , o = e("../constants")
  2995. , a = e("../util/cameraLight");
  2996. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  2997. n.prototype.updateAspect = function(e) {
  2998. this.aspect = e,
  2999. this.updateProjectionMatrix()
  3000. }
  3001. ,
  3002. t.exports = n
  3003. }
  3004. , {
  3005. "../constants": 8,
  3006. "../util/cameraLight": 184,
  3007. three: 217
  3008. }],
  3009. 6: [function(e, t, i) {//"../cameras/FloorplanCamera"
  3010. "use strict";
  3011. function n() {
  3012. var e = $('#player').width() / $('#player').height();
  3013. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3014. this.controls = null,
  3015. this.updateAspect(e)
  3016. }
  3017. var r = e("three")
  3018. , o = e("../constants");
  3019. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3020. n.prototype.updateAspect = function(e) {
  3021. this.aspect = e,
  3022. this.top = o.orthoBase / e,
  3023. this.bottom = -o.orthoBase / e,
  3024. this.updateProjectionMatrix()
  3025. }
  3026. ,
  3027. t.exports = n
  3028. }
  3029. , {
  3030. "../constants": 8,
  3031. three: 217
  3032. }],
  3033. 7: [function(e, t, i) {//"./cameras/PanoramaCamera"
  3034. "use strict";
  3035. function n() {
  3036. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $('#player').width() / $('#player').height(), o.insideNear, o.insideFar),
  3037. this.controls = null
  3038. }
  3039. var r = e("three")
  3040. , o = e("../settings")
  3041. , a = e("../util/cameraLight");
  3042. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3043. n.prototype.updateAspect = function(e) {
  3044. this.aspect = e,
  3045. this.updateProjectionMatrix()
  3046. }
  3047. ,
  3048. t.exports = n
  3049. }
  3050. , {
  3051. "../settings": 166,
  3052. "../util/cameraLight": 184,
  3053. three: 217
  3054. }],
  3055. 8: [function(e, t, i) {//"../../constants"
  3056. "use strict";
  3057. t.exports = {
  3058. signedUrlDefaultExpireTime: 24e4,
  3059. signedUrlCheckInterval: 1e4,
  3060. signedUrlRefreshBuffer: 15e3,
  3061. dollhouseFOV: 70,
  3062. dollhouseNear: 1,
  3063. dollhouseFar: 5e3,
  3064. insideFOV: 70,
  3065. insideFOVMax: 120,
  3066. insideNear: .1,
  3067. insideFar: 5e3,
  3068. insideLookSpeed: .12,
  3069. insideLookLimitUp: 40,
  3070. insideLookLimitDown: -40,
  3071. orthoNear: 1,
  3072. orthoFar: 5e3,
  3073. orthoBase: 10,
  3074. narrowLandscapeHeight: 290,
  3075. reallyNarrowLandscapeHeight: 250,
  3076. visionTilingStartDate: new Date("8/26/2016"),
  3077. visionTilingStartVersion: "1.1.407.13667",
  3078. windowHeightHighQualityThreshold: 900,
  3079. tourStepDelayDefault: 3500,
  3080. tourStepDelaySlideShow: 5e3,
  3081. workshopApsect: 9 / 16,
  3082. highQualityMaxZoom: 2,
  3083. ultraHighQualityMaxZoom: 3
  3084. }
  3085. }
  3086. , {}],
  3087. 9: [function(e, t, i) {//"./controls/CameraControls"
  3088. "use strict";
  3089. function n() {
  3090. this.activeControl = null,
  3091. this.controls = {},
  3092. this.cameras = {}
  3093. }
  3094. var r = e("./PanoramaControls")
  3095. , o = e("./DollhouseControls")
  3096. , a = e("./FloorplanControls")
  3097. , s = e("../cameras/PanoramaCamera")
  3098. , l = e("../cameras/DollhouseCamera")
  3099. , c = e("../cameras/FloorplanCamera")
  3100. , h = e("events").EventEmitter
  3101. , u = e("../enum/ControlEvents")
  3102. , d = e("../enum/ModelManagerEvents")
  3103. , p = e("../enum/Viewmode")
  3104. , f = e("../settings");
  3105. n.prototype = Object.create(h.prototype),
  3106. n.prototype.init = function(e, t) {
  3107. this.setUpControls(),
  3108. this.bindEvents(e, t)
  3109. }
  3110. ,
  3111. n.prototype.activateControls = function(e) {
  3112. this.activeControl && (this.activeControl.reset(),
  3113. this.activeControl.enabled = !1),
  3114. this.controls[e] && (this.controls[e].enabled = !0),
  3115. this.activeControl = this.controls[e]
  3116. }
  3117. ,
  3118. n.prototype.setUpControls = function() {
  3119. var e = {}
  3120. , t = {}
  3121. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3122. , n = [s, l, c]
  3123. , h = [r, o, a];
  3124. i.forEach(function(i, r) {
  3125. e[i] = new n[r],
  3126. t[i] = new h[r](e[i]),
  3127. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3128. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3129. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3130. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3131. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3132. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3133. }
  3134. .bind(this)),
  3135. this.controls = t,
  3136. this.cameras = e
  3137. }
  3138. ,
  3139. n.prototype.bindEvents = function(e, t) {
  3140. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3141. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3142. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3143. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3144. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this)),
  3145. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3146. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3147. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3148. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3149. e.addEventListener("contextmenu", function(e) {
  3150. e.preventDefault()
  3151. }),
  3152. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3153. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3154. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3155. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3156. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3157. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3158. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3159. t.on(d.ActiveModelChanged, function(e) {
  3160. this.setModelForControls(e.model)
  3161. }
  3162. .bind(this))
  3163. }
  3164. ,
  3165. n.prototype.setModelForControls = function(e) {
  3166. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3167. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3168. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3169. this.controls[e].setBounds(t)
  3170. }
  3171. .bind(this))
  3172. }
  3173. ,
  3174. n.prototype.onMouseDown = function(e) {
  3175. e.preventDefault(),
  3176. this.activeControl && this.activeControl.onMouseDown(e)
  3177. }
  3178. ,
  3179. n.prototype.onMouseMove = function(e) {
  3180. e.preventDefault(),
  3181. this.activeControl && this.activeControl.onMouseMove(e)
  3182. }
  3183. ,
  3184. n.prototype.onMouseUp = function(e) {
  3185. e.preventDefault(),
  3186. this.activeControl && this.activeControl.onMouseUp(e)
  3187. }
  3188. ,
  3189. n.prototype.onMouseOver = function(e) {
  3190. e.preventDefault(),
  3191. this.activeControl && this.activeControl.onMouseOver(e)
  3192. }
  3193. ,
  3194. n.prototype.onMouseWheel = function(e) {
  3195. e.preventDefault(),
  3196. this.activeControl && this.activeControl.onMouseWheel(e)
  3197. }
  3198. ,
  3199. n.prototype.onTouchStart = function(e) {
  3200. e.preventDefault(),
  3201. this.activeControl && this.activeControl.onTouchStart(e)
  3202. }
  3203. ,
  3204. n.prototype.onTouchMove = function(e) {
  3205. e.preventDefault(),
  3206. this.activeControl && this.activeControl.onTouchMove(e)
  3207. }
  3208. ,
  3209. n.prototype.onTouchEnd = function(e) {
  3210. e.preventDefault(),
  3211. this.activeControl && this.activeControl.onTouchEnd(e)
  3212. }
  3213. ,
  3214. n.prototype.onPointerDown = function(e) {
  3215. if (e.preventDefault(),
  3216. this.activeControl)
  3217. switch (e.pointerType) {
  3218. case "mouse":
  3219. this.activeControl.onMouseDown(e);
  3220. break;
  3221. default:
  3222. this.activeControl.onPointerDown(e)
  3223. }
  3224. }
  3225. ,
  3226. n.prototype.onPointerMove = function(e) {
  3227. if (e.preventDefault(),
  3228. this.activeControl)
  3229. switch (e.pointerType) {
  3230. case "mouse":
  3231. this.activeControl.onMouseMove(e);
  3232. break;
  3233. default:
  3234. this.activeControl.onPointerMove(e)
  3235. }
  3236. }
  3237. ,
  3238. n.prototype.onPointerUp = function(e) {
  3239. if (e.preventDefault(),
  3240. this.activeControl)
  3241. switch (e.pointerType) {
  3242. case "mouse":
  3243. this.activeControl.onMouseUp(e);
  3244. break;
  3245. default:
  3246. this.activeControl.onPointerUp(e)
  3247. }
  3248. }
  3249. ,
  3250. n.prototype.onPointerCancel = function(e) {
  3251. e.preventDefault(),
  3252. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3253. }
  3254. ,
  3255. n.prototype.onKeyDown = function(e) {
  3256. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3257. this.activeControl && this.activeControl.onKeyDown(e))
  3258. }
  3259. ,
  3260. n.prototype.onKeyUp = function(e) {
  3261. e.preventDefault(),
  3262. this.activeControl && this.activeControl.onKeyUp(e)
  3263. }
  3264. ,
  3265. t.exports = n
  3266. }
  3267. , {
  3268. "../cameras/DollhouseCamera": 5,
  3269. "../cameras/FloorplanCamera": 6,
  3270. "../cameras/PanoramaCamera": 7,
  3271. "../enum/ControlEvents": 21,
  3272. "../enum/ModelManagerEvents": 33,
  3273. "../enum/Viewmode": 51,
  3274. "../settings": 166,
  3275. "./DollhouseControls": 10,
  3276. "./FloorplanControls": 11,
  3277. "./PanoramaControls": 13,
  3278. events: 202
  3279. }],
  3280. 10: [function(e, t, i) {//"./DollhouseControls"
  3281. "use strict";
  3282. function n(e) {
  3283. a.call(this, e),
  3284. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3285. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3286. this.minDistance = o.dollhouseDefault.minDistance,
  3287. this.maxDistance = o.dollhouseDefault.maxDistance,
  3288. this.adjustedMinDistance = this.minDistance,
  3289. this.adjustedMaxDistance = this.maxDistance
  3290. }
  3291. var r = e("three")
  3292. , o = e("../settings")
  3293. , a = e("./OutsideControls");
  3294. n.prototype = Object.create(a.prototype),
  3295. n.prototype.pan = function(e, t) {
  3296. this.camera.updateMatrix();
  3297. var i = this.camera.position.clone().sub(this.target).length();
  3298. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3299. this.panLeft(2 * e * i / window.innerHeight),
  3300. this.panUp(-2 * t * i / window.innerHeight)
  3301. }
  3302. ,
  3303. n.prototype.updateZoom = function() {
  3304. var e = this.offset.length();
  3305. return e * this.scale
  3306. }
  3307. ,
  3308. n.prototype.setZoomBounds = function(e) {
  3309. var t = e.min.distanceTo(e.max);
  3310. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3311. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3312. this.minDistance = this.adjustedMinDistance,
  3313. this.maxDistance = this.adjustedMaxDistance
  3314. }
  3315. ,
  3316. n.prototype.resetRanges = function(e, t) {
  3317. e ? (this.minDistance = Math.min(e, this.minDistance),
  3318. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3319. this.maxDistance = this.adjustedMaxDistance),
  3320. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3321. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3322. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3323. }
  3324. ,
  3325. n.prototype.toJSON = function() {
  3326. return a.prototype.toJSON.call(this)
  3327. }
  3328. ,
  3329. t.exports = n
  3330. }
  3331. , {
  3332. "../settings": 166,
  3333. "./OutsideControls": 12,
  3334. three: 217
  3335. }],
  3336. 11: [function(e, t, i) {//"./FloorplanControls"
  3337. "use strict";
  3338. function n(e) {
  3339. a.call(this, e),
  3340. this.minDistance = 15,
  3341. this.maxDistance = 50,
  3342. this.noRotateUpDown = !0,
  3343. this.minPolarAngle = 0,
  3344. this.maxPolarAngle = 0,
  3345. this.mouseActions[l.LEFT] = s.PAN,
  3346. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3347. this.mouseActions[l.RIGHT] = s.ROTATE,
  3348. this.touchActions[1] = s.PAN,
  3349. this.touchActions[2] = s.ROTATE_DOLLY,
  3350. this.absoluteScale = 1,
  3351. this.currentScale = 1
  3352. }
  3353. var r = e("three")
  3354. , o = e("../settings")
  3355. , a = e("./OutsideControls")
  3356. , s = e("../enum/ControlActions")
  3357. , l = e("../enum/MouseButton")
  3358. , c = e("../util/math")
  3359. , h = e("../util/browser");
  3360. n.prototype = Object.create(a.prototype),
  3361. n.prototype.zoomToContain = function(e) {
  3362. var t = Math.max(e.x, e.z)
  3363. , i = Math.min(e.x, e.z)
  3364. , n = Math.max(t, i * this.camera.aspect)
  3365. , r = Math.max(i, t * this.camera.aspect);
  3366. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3367. this.currentScale = this.absoluteScale
  3368. }
  3369. ,
  3370. n.prototype.rotateToView = function(e, t) {
  3371. var i = 0
  3372. , n = h.aspectRatio() < 1
  3373. , r = e.x < e.z;
  3374. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3375. this.rotateLeft(i),
  3376. this.update(0)
  3377. }
  3378. ,
  3379. n.prototype.pan = function(e, t) {
  3380. this.camera.updateMatrix(),
  3381. this.panLeft(e * (this.camera.right - this.camera.left) / $('#player').width()),
  3382. this.panUp(-t * (this.camera.top - this.camera.bottom) / $('#player').height())
  3383. }
  3384. ,
  3385. n.prototype.updateZoom = function() {
  3386. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3387. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3388. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3389. this.camera.left = -o.orthoBase * this.currentScale,
  3390. this.camera.right = o.orthoBase * this.currentScale,
  3391. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3392. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3393. this.camera.updateProjectionMatrix(),
  3394. this.offset.length()
  3395. }
  3396. ,
  3397. n.prototype.toJSON = function() {
  3398. var e = new r.Quaternion
  3399. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3400. , i = new r.Quaternion;
  3401. return function() {
  3402. var n = a.prototype.toJSON.call(this);
  3403. return e.copy(n.camera_quaternion),
  3404. i.copy(t),
  3405. i.multiply(e),
  3406. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3407. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3408. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3409. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3410. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3411. n
  3412. }
  3413. }(),
  3414. t.exports = n
  3415. }
  3416. , {
  3417. "../enum/ControlActions": 20,
  3418. "../enum/MouseButton": 34,
  3419. "../settings": 166,
  3420. "../util/browser": 182,
  3421. "../util/math": 190,
  3422. "./OutsideControls": 12,
  3423. three: 217
  3424. }],
  3425. 12: [function(e, t, i) {//"./OutsideControls"
  3426. "use strict";
  3427. function n(e) {
  3428. this.camera = e,
  3429. this.camera.controls = this,
  3430. this.enabled = !1,
  3431. this.target = new r.Vector3,
  3432. this.targetBounds = new r.Box3,
  3433. this.zoomSpeed = 1,
  3434. this.minDistance = 0,
  3435. this.maxDistance = 1 / 0,
  3436. this.noRotateUpDown = !1,
  3437. this.rotateSpeed = 1,
  3438. this.keyboardZoomSpeed = 0,
  3439. this.keyPanSpeed = 7,
  3440. this.autoRotate = !1,
  3441. this.autoRotateSpeed = 2,
  3442. this.autoPan = !1,
  3443. this.autoPanPosition = new r.Vector3,
  3444. this.minPolarAngle = r.Math.degToRad(25),
  3445. this.maxPolarAngle = r.Math.degToRad(65),
  3446. this.rotationAcceleration = new r.Vector2,
  3447. this.rotationSpeed = new r.Vector2,
  3448. this.panAcceleration = new r.Vector2,
  3449. this.panSpeed = new r.Vector2,
  3450. this.rotateStart = new r.Vector2,
  3451. this.rotateEnd = new r.Vector2,
  3452. this.rotateDelta = new r.Vector2,
  3453. this.panStart = new r.Vector2,
  3454. this.panEnd = new r.Vector2,
  3455. this.panDelta = new r.Vector2,
  3456. this.panOffset = new r.Vector3,
  3457. this.offset = new r.Vector3,
  3458. this.dollyStart = new r.Vector2,
  3459. this.dollyEnd = new r.Vector2,
  3460. this.dollyDelta = new r.Vector2,
  3461. this.phiDelta = 0,
  3462. this.thetaDelta = 0,
  3463. this.scale = 1,
  3464. this.panVector = new r.Vector3,
  3465. this.lastPosition = new r.Vector3,
  3466. this.state = c.NONE,
  3467. this.mouseActions = {},
  3468. this.mouseActions[h.LEFT] = c.ROTATE,
  3469. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3470. this.mouseActions[h.RIGHT] = c.PAN,
  3471. this.touchActions = {},
  3472. this.touchActions[1] = c.ROTATE,
  3473. this.touchActions[2] = c.PAN_DOLLY,
  3474. this.lastMoveTime = 0,
  3475. this.pointersLimit = 2,
  3476. this.pointers = []
  3477. }
  3478. var r = e("three")
  3479. , o = e("../settings")
  3480. , a = e("../util/common")
  3481. , s = e("../util/math")
  3482. , l = e("../enum/Vectors")
  3483. , c = e("../enum/ControlActions")
  3484. , h = e("../enum/MouseButton")
  3485. , u = e("../enum/Keys")
  3486. , d = e("../enum/ControlEvents")
  3487. , p = e("events").EventEmitter
  3488. , f = 1e-6;
  3489. n.prototype = Object.create(p.prototype),
  3490. n.prototype.setBounds = function(e) {
  3491. this.targetBounds = e
  3492. }
  3493. ,
  3494. n.prototype.isEngaged = function() {
  3495. return this.state !== c.NONE
  3496. }
  3497. ,
  3498. n.prototype.rotateLeft = function(e) {
  3499. void 0 === e && (e = this.getAutoRotationAngle()),
  3500. this.thetaDelta -= e
  3501. }
  3502. ,
  3503. n.prototype.rotateUp = function(e) {
  3504. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3505. this.phiDelta -= e)
  3506. }
  3507. ,
  3508. n.prototype.panLeft = function(e) {
  3509. var t = this.camera.matrix.elements;
  3510. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3511. this.panOffset.multiplyScalar(-e),
  3512. this.panVector.add(this.panOffset)
  3513. }
  3514. ,
  3515. n.prototype.panUp = function(e) {
  3516. var t = this.camera.matrix.elements;
  3517. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3518. this.panOffset.multiplyScalar(-e),
  3519. this.panVector.add(this.panOffset)
  3520. }
  3521. ,
  3522. n.prototype.startRotating = function(e, t) {
  3523. e && this.navRotationAcc("x", e),
  3524. t && this.navRotationAcc("y", t)
  3525. }
  3526. ,
  3527. n.prototype.stopRotating = function(e) {
  3528. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3529. this.navRotationAcc("x", 0),
  3530. this.navRotationAcc("y", 0)
  3531. }
  3532. ,
  3533. n.prototype.setAutoPanPosition = function(e, t) {
  3534. var i = new r.Vector3
  3535. , n = new r.Vector3;
  3536. return function(e, t) {
  3537. i.copy(this.camera.position),
  3538. void 0 === e && null === e || i.setX(e),
  3539. void 0 === t && null === t || i.setZ(t);
  3540. var r = this.camera.position.distanceTo(this.target)
  3541. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3542. this.targetClamped = !1,
  3543. n.copy(i).addScaledVector(o, r),
  3544. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3545. i.copy(n).addScaledVector(o, -r),
  3546. this.targetClamped = !0),
  3547. this.autoPanPosition.x = i.x,
  3548. this.autoPanPosition.z = i.z,
  3549. this.autoPan && this.stopAutoPanning()
  3550. }
  3551. }(),
  3552. n.prototype.stopAutoPanning = function() {
  3553. var e = this.autoPan;
  3554. this.autoPan = !1,
  3555. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3556. }
  3557. ,
  3558. n.prototype.dollyIn = function(e) {
  3559. void 0 === e && (e = this.getZoomScale()),
  3560. this.scale /= e
  3561. }
  3562. ,
  3563. n.prototype.dollyOut = function(e) {
  3564. void 0 === e && (e = this.getZoomScale()),
  3565. this.scale *= e
  3566. }
  3567. ,
  3568. n.prototype.updatePan = function(e) {
  3569. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3570. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3571. this.autoPan) {
  3572. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3573. t.setY(0).clampLength(0, 50 * e),
  3574. this.target.add(t),
  3575. this.camera.position.add(t),
  3576. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3577. this.stopAutoPanning())
  3578. }
  3579. }
  3580. ,
  3581. n.prototype.update = function(e) {
  3582. e || (e = 1 / 60),
  3583. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3584. this.rotateLeft(-this.rotationSpeed.x),
  3585. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3586. this.updatePan(e);
  3587. var t = this.camera.position;
  3588. this.offset.copy(t).sub(this.target);
  3589. var i = Math.atan2(this.offset.x, this.offset.z)
  3590. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3591. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3592. i += this.thetaDelta,
  3593. n += this.phiDelta,
  3594. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3595. n = Math.max(f, Math.min(Math.PI - f, n));
  3596. var r = this.updateZoom();
  3597. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3598. this.target.add(this.panVector),
  3599. this.targetBounds.clampPoint(this.target, this.target),
  3600. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3601. this.offset.y = r * Math.cos(n),
  3602. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3603. t.copy(this.target).add(this.offset),
  3604. this.camera.lookAt(this.target),
  3605. this.thetaDelta = 0,
  3606. this.phiDelta = 0,
  3607. this.scale = 1,
  3608. this.panVector.set(0, 0, 0),
  3609. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3610. }
  3611. ,
  3612. n.prototype.getAutoRotationAngle = function() {
  3613. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3614. }
  3615. ,
  3616. n.prototype.getZoomScale = function() {
  3617. return Math.pow(.95, this.zoomSpeed)
  3618. }
  3619. ,
  3620. n.prototype.onMouseDown = function(e) {
  3621. if (this.enabled) {
  3622. switch (e.preventDefault(),
  3623. this.stopAutoPanning(),
  3624. this.mouseDown = !0,
  3625. this.state = this.mouseActions[e.button],
  3626. this.state) {
  3627. case c.ROTATE:
  3628. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3629. this.rotationSpeed.set(0, 0);
  3630. break;
  3631. case c.DOLLY:
  3632. this.dollyStart.set(e.clientX, e.clientY);
  3633. break;
  3634. case c.PAN:
  3635. this.panStart.set(e.clientX, e.clientY)
  3636. }
  3637. this.emit(d.InputStart, "mouse")
  3638. }
  3639. }
  3640. ,
  3641. n.prototype.onMouseMove = function(e) {
  3642. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3643. switch (e.preventDefault(),
  3644. this.state) {
  3645. case c.ROTATE:
  3646. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3647. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3648. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $('#player').width() * this.rotateSpeed),
  3649. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $('#player').height() * this.rotateSpeed),
  3650. this.rotateStart.copy(this.rotateEnd);
  3651. break;
  3652. case c.DOLLY:
  3653. this.dollyEnd.set(e.clientX, e.clientY),
  3654. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3655. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3656. t.call(this),
  3657. this.dollyStart.copy(this.dollyEnd);
  3658. break;
  3659. case c.PAN:
  3660. this.panEnd.set(e.clientX, e.clientY),
  3661. this.panDelta.subVectors(this.panEnd, this.panStart),
  3662. this.pan(this.panDelta.x, this.panDelta.y),
  3663. this.panStart.copy(this.panEnd)
  3664. }
  3665. this.emit(d.Move, "mouse"),
  3666. this.lastMoveTime = e.timeStamp,
  3667. this.update()
  3668. }
  3669. }
  3670. ,
  3671. n.prototype.onMouseUp = function(e) {
  3672. this.enabled && (this.mouseDown = !1,
  3673. this.state = c.NONE,
  3674. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3675. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3676. this.update(),
  3677. this.rotationAcceleration.set(0, 0),
  3678. this.rotateDelta.set(0, 0)))
  3679. }
  3680. ,
  3681. n.prototype.onMouseOver = function(e) {
  3682. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3683. }
  3684. ,
  3685. n.prototype.onMouseWheel = function(e) {
  3686. if (this.enabled && o.useWheel) {
  3687. this.emit(d.Move, "wheel");
  3688. var t = e.wheelDelta || -e.detail
  3689. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3690. i.call(this),
  3691. this.update()
  3692. }
  3693. }
  3694. ,
  3695. n.prototype.onKeyDown = function(e) {
  3696. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3697. this.handleKeyDown(e.which)))
  3698. }
  3699. ,
  3700. n.prototype.navRotationAcc = function(e, t) {
  3701. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3702. }
  3703. ,
  3704. n.prototype.navPanAcc = function(e, t) {
  3705. this.stopAutoPanning(),
  3706. this.panAcceleration[e] = t
  3707. }
  3708. ,
  3709. n.prototype.handleKeyDown = function(e) {
  3710. var t = !0;
  3711. switch (e) {
  3712. case u.UPARROW:
  3713. case u.I:
  3714. this.navRotationAcc("y", 1);
  3715. break;
  3716. case u.DOWNARROW:
  3717. case u.K:
  3718. this.navRotationAcc("y", -1);
  3719. break;
  3720. case u.LEFTARROW:
  3721. case u.J:
  3722. this.navRotationAcc("x", -1);
  3723. break;
  3724. case u.RIGHTARROW:
  3725. case u.L:
  3726. this.navRotationAcc("x", 1);
  3727. break;
  3728. case u.W:
  3729. this.navPanAcc("y", 1);
  3730. break;
  3731. case u.S:
  3732. this.navPanAcc("y", -1);
  3733. break;
  3734. case u.A:
  3735. this.navPanAcc("x", -1);
  3736. break;
  3737. case u.D:
  3738. this.navPanAcc("x", 1);
  3739. break;
  3740. default:
  3741. t = !1
  3742. }
  3743. t && this.emit(d.Move, "key")
  3744. }
  3745. ,
  3746. n.prototype.onKeyUp = function(e) {
  3747. this.enabled && (e.preventDefault(),
  3748. e.stopPropagation(),
  3749. this.handleKeyUp(e.which))
  3750. }
  3751. ,
  3752. n.prototype.handleKeyUp = function(e) {
  3753. switch (e) {
  3754. case u.I:
  3755. case u.K:
  3756. case u.UPARROW:
  3757. case u.DOWNARROW:
  3758. this.keyboardZoomSpeed = 0,
  3759. this.rotationAcceleration.y = 0;
  3760. break;
  3761. case u.J:
  3762. case u.L:
  3763. case u.LEFTARROW:
  3764. case u.RIGHTARROW:
  3765. this.rotationAcceleration.x = 0;
  3766. break;
  3767. case u.S:
  3768. case u.W:
  3769. this.panAcceleration.y = 0;
  3770. break;
  3771. case u.A:
  3772. case u.D:
  3773. this.panAcceleration.x = 0
  3774. }
  3775. }
  3776. ,
  3777. n.prototype.onTouchStart = function(e) {
  3778. if (this.enabled || this.state === c.NONE) {
  3779. e.preventDefault(),
  3780. e.stopPropagation(),
  3781. this.stopAutoPanning();
  3782. var t = function() {
  3783. if (2 === e.touches.length) {
  3784. var t = e.touches[0].pageX - e.touches[1].pageX
  3785. , i = e.touches[0].pageY - e.touches[1].pageY;
  3786. this.dollyStart.set(t, i)
  3787. }
  3788. }
  3789. .bind(this)
  3790. , i = function() {
  3791. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3792. }
  3793. .bind(this)
  3794. , n = function() {
  3795. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3796. }
  3797. .bind(this);
  3798. switch (this.state = this.touchActions[e.touches.length],
  3799. this.state) {
  3800. case c.PAN_DOLLY:
  3801. t();
  3802. case c.PAN:
  3803. i();
  3804. break;
  3805. case c.ROTATE_DOLLY:
  3806. t();
  3807. case c.ROTATE:
  3808. n()
  3809. }
  3810. this.rotationSpeed.set(0, 0),
  3811. this.emit(d.InputStart, "touch")
  3812. }
  3813. }
  3814. ,
  3815. n.prototype.onTouchMove = function(e) {
  3816. if (this.enabled && this.state !== c.NONE) {
  3817. e.preventDefault(),
  3818. e.stopPropagation();
  3819. var t = function() {
  3820. var t = e.touches[0].pageX - e.touches[1].pageX
  3821. , i = e.touches[0].pageY - e.touches[1].pageY;
  3822. this.dollyEnd.set(t, i);
  3823. var n = this.dollyStart.length() - this.dollyEnd.length();
  3824. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3825. this.dollyStart.copy(this.dollyEnd)
  3826. }
  3827. .bind(this)
  3828. , i = function() {
  3829. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3830. this.panDelta.subVectors(this.panEnd, this.panStart),
  3831. this.pan(this.panDelta.x, this.panDelta.y),
  3832. this.panStart.copy(this.panEnd),
  3833. this.rotateDelta.set(0, 0)
  3834. }
  3835. .bind(this)
  3836. , n = function() {
  3837. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3838. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3839. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $('#player').width() * this.rotateSpeed),
  3840. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $('#player').height() * this.rotateSpeed),
  3841. this.rotateStart.copy(this.rotateEnd)
  3842. }
  3843. .bind(this)
  3844. , r = function() {
  3845. if (2 === e.touches.length) {
  3846. var i = window.devicePixelRatio || 1
  3847. , r = e.touches[1].pageX - e.touches[0].pageX
  3848. , s = e.touches[1].pageY - e.touches[0].pageY
  3849. , l = Math.sqrt(r * r + s * s)
  3850. , h = Math.abs(this.dollyStart.length() - l);
  3851. if (h > o.input.touchMoveThreshold * i)
  3852. this.state = c.DOLLY,
  3853. t();
  3854. else {
  3855. var u = a.average(e.touches, "pageX")
  3856. , d = a.average(e.touches, "pageY")
  3857. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3858. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3859. this.rotateStart.set(u, d),
  3860. n())
  3861. }
  3862. }
  3863. }
  3864. .bind(this);
  3865. switch (this.state) {
  3866. case c.PAN_DOLLY:
  3867. t();
  3868. case c.PAN:
  3869. i();
  3870. break;
  3871. case c.ROTATE_DOLLY:
  3872. r();
  3873. break;
  3874. case c.DOLLY:
  3875. t();
  3876. break;
  3877. case c.ROTATE:
  3878. n();
  3879. break;
  3880. default:
  3881. this.state = c.NONE
  3882. }
  3883. this.lastMoveTime = e.timeStamp,
  3884. this.emit(d.Move, "touch")
  3885. }
  3886. }
  3887. ,
  3888. n.prototype.onTouchEnd = function(e) {
  3889. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3890. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3891. this.state = c.NONE,
  3892. this.update(),
  3893. this.rotationAcceleration.set(0, 0),
  3894. this.rotateDelta.set(0, 0))
  3895. }
  3896. ,
  3897. n.prototype.onPointerDown = function(e) {
  3898. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3899. id: e.pointerId,
  3900. pageX: e.pageX,
  3901. pageY: e.pageY
  3902. }),
  3903. e.touches = this.pointers,
  3904. this.onTouchStart(e)),
  3905. this.emit(d.InputStart, "pointer"))
  3906. }
  3907. ,
  3908. n.prototype.onPointerMove = function(e) {
  3909. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3910. e.pointerId === t.id && (t.pageX = e.pageX,
  3911. t.pageY = e.pageY)
  3912. }),
  3913. e.touches = this.pointers,
  3914. this.onTouchMove(e))
  3915. }
  3916. ,
  3917. n.prototype.onPointerUp = function(e) {
  3918. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3919. e.pointerId === t.id && this.pointers.splice(i, 1)
  3920. }
  3921. .bind(this)),
  3922. e.touches = this.pointers,
  3923. this.onTouchEnd(e))
  3924. }
  3925. ,
  3926. n.prototype.reset = function() {
  3927. this.state = c.NONE,
  3928. this.stopAutoPanning(),
  3929. this.rotationSpeed.set(0, 0),
  3930. this.rotationAcceleration.set(0, 0),
  3931. this.panSpeed.set(0, 0),
  3932. this.panAcceleration.set(0, 0)
  3933. }
  3934. ,
  3935. n.prototype.toJSON = function() {
  3936. var e = {
  3937. camera_position: {
  3938. x: s.toPrecision(this.camera.position.x, 4),
  3939. y: s.toPrecision(this.camera.position.y, 4),
  3940. z: s.toPrecision(this.camera.position.z, 4)
  3941. },
  3942. camera_quaternion: {
  3943. x: s.toPrecision(this.camera.quaternion.x, 4),
  3944. y: s.toPrecision(this.camera.quaternion.y, 4),
  3945. z: s.toPrecision(this.camera.quaternion.z, 4),
  3946. w: s.toPrecision(this.camera.quaternion.w, 4)
  3947. }
  3948. };
  3949. return e
  3950. }
  3951. ,
  3952. t.exports = n
  3953. }
  3954. , {
  3955. "../enum/ControlActions": 20,
  3956. "../enum/ControlEvents": 21,
  3957. "../enum/Keys": 30,
  3958. "../enum/MouseButton": 34,
  3959. "../enum/Vectors": 50,
  3960. "../settings": 166,
  3961. "../util/common": 185,
  3962. "../util/math": 190,
  3963. events: 202,
  3964. three: 217
  3965. }],
  3966. 13: [function(e, t, i) {///js/controls/PanoramaControls.js
  3967. (function(i) {
  3968. "use strict";
  3969. function n(e) {
  3970. this.camera = e,
  3971. this.camera.controls = this,
  3972. this.target = new r.Vector3(0,0,0),
  3973. this.lookVector = new r.Vector3,
  3974. this.lookSpeed = .05,
  3975. this.rotationAcc = new r.Vector2,
  3976. this.rotationSpeed = new r.Vector2,
  3977. this.lat = 0,
  3978. this.lon = 0,
  3979. this.phi = 0,
  3980. this.theta = 0,
  3981. this.enabled = !1,
  3982. this.locked = !1,
  3983. this.pointer = new r.Vector2(0,0),
  3984. this.rotationHistory = [],
  3985. this.rotationDifference = new r.Vector2,
  3986. this.pointerDragOn = !1,
  3987. this.pointerDragStart = new r.Vector2(0,0),
  3988. this.pinchDistance = 0,
  3989. this.moveStart = new r.Vector2,
  3990. this.moveTolerance = .01,
  3991. this.pointersLimit = 2,
  3992. this.pointers = []
  3993. }
  3994. var r = e("three")
  3995. , o = e("../util/logger")
  3996. , a = e("../settings")
  3997. , s = e("../util/common")
  3998. , l = e("../util/math")
  3999. , c = (e("../enum/Vectors"),
  4000. e("../enum/MouseButton"))
  4001. , h = e("../enum/Keys")
  4002. , u = e("../enum/ControlEvents")
  4003. , d = e("events").EventEmitter;
  4004. new o(i);
  4005. n.prototype = Object.create(d.prototype),
  4006. n.prototype.usable = function() {
  4007. return this.enabled && !this.locked
  4008. }
  4009. ,
  4010. n.prototype.lookAt = function(e) {
  4011. var t = this.camera.position.clone().sub(e)
  4012. , i = Math.atan(t.z / t.x);
  4013. i += t.x < 0 ? Math.PI : 0,
  4014. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4015. this.lon = r.Math.radToDeg(i) + 180;
  4016. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4017. , o = Math.atan(t.y / n);
  4018. this.lat = -r.Math.radToDeg(o)
  4019. }
  4020. ,
  4021. n.prototype.startRotationFrom = function(e, t) {
  4022. l.convertScreenPositionToNDC(e, t, this.pointer),
  4023. this.pointerDragOn = !0,
  4024. this.pointerDragStart.copy(this.pointer),
  4025. this.moveStart.copy(this.pointer),
  4026. this.rotationHistory = [],
  4027. this.rotationSpeed.set(0, 0)
  4028. }
  4029. ,
  4030. n.prototype.onMouseOver = function(e) {
  4031. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4032. }
  4033. ,
  4034. n.prototype.onTouchStart = function(e) {
  4035. if (this.usable()) {
  4036. switch (e.preventDefault(),
  4037. e.stopPropagation(),
  4038. e.touches.length) {
  4039. case 1:
  4040. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4041. break;
  4042. case 2:
  4043. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width()
  4044. , i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height();
  4045. this.pinchDistance = Math.sqrt(t * t + i * i)
  4046. }
  4047. this.emit(u.InputStart, "touch")
  4048. }
  4049. }
  4050. ,
  4051. n.prototype.onPointerDown = function(e) {
  4052. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4053. id: e.pointerId,
  4054. clientX: e.clientX,
  4055. clientY: e.clientY
  4056. }),
  4057. e.touches = this.pointers,
  4058. this.onTouchStart(e),
  4059. this.emit(u.InputStart, "pointer"))
  4060. }
  4061. ,
  4062. n.prototype.onMouseDown = function(e) {
  4063. if (this.usable()) {
  4064. switch (e.preventDefault(),
  4065. e.stopPropagation(),
  4066. e.button) {
  4067. case c.LEFT:
  4068. this.startRotationFrom(e.clientX, e.clientY)
  4069. }
  4070. this.emit(u.InputStart, "mouse")
  4071. }
  4072. }
  4073. ,
  4074. n.prototype.updateRotation = function() {
  4075. if (this.usable() && this.pointerDragOn) {
  4076. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4077. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4078. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4079. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4080. , o = Math.atan2(e.y, i)
  4081. , a = Math.atan2(t.y, n);
  4082. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4083. e.y = 0,
  4084. t.y = 0;
  4085. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4086. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4087. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4088. this.pointerDragStart.copy(this.pointer)
  4089. }
  4090. }
  4091. ,
  4092. n.prototype.onMouseMove = function(e) {
  4093. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4094. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4095. }
  4096. ,
  4097. n.prototype.onTouchMove = function(e) {
  4098. if (this.usable())
  4099. switch (this.emit(u.Move, "touch"),
  4100. e.touches.length) {
  4101. case 1:
  4102. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4103. break;
  4104. case 2:
  4105. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width()
  4106. , i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
  4107. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4108. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4109. this.emit(u.Pinch, n),
  4110. this.pinchDistance -= n)
  4111. }
  4112. }
  4113. ,
  4114. n.prototype.onPointerMove = function(e) {
  4115. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4116. e.pointerId === t.id && (t.clientX = e.clientX,
  4117. t.clientY = e.clientY)
  4118. }),
  4119. e.touches = this.pointers,
  4120. this.onTouchMove(e))
  4121. }
  4122. ,
  4123. n.prototype.endRotation = function() {
  4124. this.pointerDragOn = !1;
  4125. var e = s.averageVectors(this.rotationHistory);
  4126. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4127. }
  4128. ,
  4129. n.prototype.onTouchEnd = function(e) {
  4130. this.usable() && (e.preventDefault(),
  4131. e.stopPropagation(),
  4132. this.endRotation())
  4133. }
  4134. ,
  4135. n.prototype.onMouseUp = function(e) {
  4136. this.usable() && (e.preventDefault(),
  4137. e.stopPropagation(),
  4138. this.endRotation())
  4139. }
  4140. ,
  4141. n.prototype.onPointerUp = function(e) {
  4142. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4143. e.pointerId === t.id && this.pointers.splice(i, 1)
  4144. }
  4145. .bind(this)),
  4146. e.touches = this.pointers,
  4147. this.onTouchEnd(e))
  4148. }
  4149. ,
  4150. n.prototype.update = function(e) {
  4151. this.lon,
  4152. this.lat;
  4153. for (this.updateRotation(),
  4154. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4155. this.rotationHistory.shift();
  4156. this.lon += this.rotationDifference.x,
  4157. this.lat += this.rotationDifference.y,
  4158. this.rotationDifference.set(0, 0),
  4159. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4160. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4161. this.lon += this.rotationSpeed.x * e,
  4162. this.lat += this.rotationSpeed.y * e,
  4163. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4164. this.phi = r.Math.degToRad(90 - this.lat),
  4165. this.theta = r.Math.degToRad(this.lon),
  4166. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4167. this.lookVector.y = Math.cos(this.phi),
  4168. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4169. this.target.copy(this.lookVector).add(this.camera.position),
  4170. this.camera.lookAt(this.target)
  4171. }
  4172. ,
  4173. n.prototype.onMouseWheel = function(e) {
  4174. if (this.usable()) {
  4175. var t = e.wheelDelta || -e.detail;
  4176. this.emit(u.InteractionDirect),
  4177. this.emit(u.Scroll, t)
  4178. }
  4179. }
  4180. ,
  4181. n.prototype.onKeyDown = function(e) {
  4182. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4183. this.handleKeyDown(e.which)))
  4184. }
  4185. ,
  4186. n.prototype.handleKeyDown = function(e) {
  4187. var t = function(e, t) {
  4188. this.rotationAcc[e] = t
  4189. }
  4190. .bind(this);
  4191. this.emit(u.InteractionKey);
  4192. var i = !0;
  4193. switch (e) {
  4194. case h.LEFTARROW:
  4195. case h.J:
  4196. t("x", -1);
  4197. break;
  4198. case h.RIGHTARROW:
  4199. case h.L:
  4200. t("x", 1);
  4201. break;
  4202. case h.I:
  4203. t("y", 1);
  4204. break;
  4205. case h.K:
  4206. t("y", -1);
  4207. break;
  4208. default:
  4209. i = !1
  4210. }
  4211. i && this.emit(u.Move, "key")
  4212. }
  4213. ,
  4214. n.prototype.onKeyUp = function(e) {
  4215. this.usable() && (e.preventDefault(),
  4216. e.stopPropagation(),
  4217. this.handleKeyUp(e.which))
  4218. }
  4219. ,
  4220. n.prototype.handleKeyUp = function(e) {
  4221. switch (e) {
  4222. case h.LEFTARROW:
  4223. case h.J:
  4224. case h.RIGHTARROW:
  4225. case h.L:
  4226. this.rotationAcc.x = 0;
  4227. break;
  4228. case h.I:
  4229. case h.K:
  4230. this.rotationAcc.y = 0
  4231. }
  4232. }
  4233. ,
  4234. n.prototype.startRotating = function(e, t) {
  4235. e && (this.rotationAcc.x = e),
  4236. t && (this.rotationAcc.y = t)
  4237. }
  4238. ,
  4239. n.prototype.stopRotating = function(e) {
  4240. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4241. this.rotationAcc.set(0, 0)
  4242. }
  4243. ,
  4244. n.prototype.reset = function() {
  4245. this.pointerDragOn = !1,
  4246. this.rotationAcc.set(0, 0),
  4247. this.rotationSpeed.set(0, 0),
  4248. this.pointers = []
  4249. }
  4250. ,
  4251. n.prototype.toJSON = function() {
  4252. var e = {
  4253. camera_position: {
  4254. x: l.toPrecision(this.camera.position.x, 4),
  4255. y: l.toPrecision(this.camera.position.y, 4),
  4256. z: l.toPrecision(this.camera.position.z, 4)
  4257. },
  4258. camera_quaternion: {
  4259. x: l.toPrecision(this.camera.quaternion.x, 4),
  4260. y: l.toPrecision(this.camera.quaternion.y, 4),
  4261. z: l.toPrecision(this.camera.quaternion.z, 4),
  4262. w: l.toPrecision(this.camera.quaternion.w, 4)
  4263. }
  4264. };
  4265. return e
  4266. }
  4267. ,
  4268. n.prototype.setStateFromJSON = function(e) {
  4269. this.camera.position.copy(e.camera_position),
  4270. this.camera.quaternion.copy(e.camera_quaternion)
  4271. }
  4272. ,
  4273. t.exports = n
  4274. }
  4275. ).call(this, "/js/controls/PanoramaControls.js")
  4276. }
  4277. , {
  4278. "../enum/ControlEvents": 21,
  4279. "../enum/Keys": 30,
  4280. "../enum/MouseButton": 34,
  4281. "../enum/Vectors": 50,
  4282. "../settings": 166,
  4283. "../util/common": 185,
  4284. "../util/logger": 189,
  4285. "../util/math": 190,
  4286. events: 202,
  4287. three: 217
  4288. }],
  4289. 14: [function(e, t, i) {///js/controls/serializer.js
  4290. (function(i) {
  4291. "use strict";
  4292. var n = e("three")
  4293. , r = e("../enum/Viewmode")
  4294. , o = e("../util/logger")
  4295. , a = new o(i);
  4296. t.exports = {
  4297. serialize: function(e) {
  4298. return encodeURI(JSON.stringify(e))
  4299. },
  4300. deserialize: function(e) {
  4301. function t(e) {
  4302. function t(e, t) {
  4303. return e && "number" == typeof t && !isNaN(t)
  4304. }
  4305. return e.reduce(t, !0)
  4306. }
  4307. try {
  4308. var i = JSON.parse(decodeURI(e))
  4309. , o = {
  4310. mode: r.fromInt(i.camera_mode),
  4311. panoId: i.scan_id,
  4312. position: (new n.Vector3).copy(i.camera_position),
  4313. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4314. zoom: i.ortho_zoom,
  4315. floorVisibility: i.floor_visibility
  4316. }
  4317. , s = o.position;
  4318. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4319. var l = o.quaternion;
  4320. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4321. o
  4322. } catch (i) {
  4323. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4324. try {
  4325. var c = e.split(",")
  4326. , h = {
  4327. x: parseFloat(c[2]),
  4328. y: parseFloat(c[3]),
  4329. z: parseFloat(c[4])
  4330. }
  4331. , u = {
  4332. x: parseFloat(c[5]),
  4333. y: parseFloat(c[6]),
  4334. z: parseFloat(c[7]),
  4335. w: parseFloat(c[8])
  4336. };
  4337. return t([h.x, h.y, h.z]) || (h.x = 0,
  4338. h.y = 0,
  4339. h.z = 0),
  4340. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4341. u.y = 0,
  4342. u.z = 0,
  4343. u.w = 1),
  4344. {
  4345. mode: r.fromInt(c[0]),
  4346. panoId: c[1],
  4347. position: (new n.Vector3).copy(h),
  4348. quaternion: (new n.Quaternion).copy(u)
  4349. }
  4350. } catch (t) {
  4351. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4352. }
  4353. }
  4354. return null
  4355. }
  4356. }
  4357. }
  4358. ).call(this, "/js/controls/serializer.js")
  4359. }
  4360. , {
  4361. "../enum/Viewmode": 51,
  4362. "../util/logger": 189,
  4363. three: 217
  4364. }],
  4365. 15: [function(e, t, i) {///js/director.js
  4366. (function(i) {
  4367. "use strict";
  4368. function n() {
  4369. this.endlessLoop = a.warp.loop,
  4370. this.clock = new r.Clock(!0),
  4371. this.model = null,
  4372. this.player = null,
  4373. this.currentItem = null,
  4374. this.destinationItem = null,
  4375. this.tourIsPlaying = !1,
  4376. this.transitionStage = y.None,
  4377. this.nextFunc = null,
  4378. this.onTheBus = !1,
  4379. this.tourInProgress = !1,
  4380. this.reachSource = null,
  4381. this.interrupted = !1,
  4382. this.nItems = 0,
  4383. this.walkingSectionPaused = !1
  4384. }
  4385. var r = e("three")
  4386. , o = e("./util/logger")
  4387. , a = e("./settings")
  4388. , s = e("./util/transitions")
  4389. , l = e("events").EventEmitter
  4390. , c = e("./enum/Viewmode")
  4391. , h = e("./analytics")
  4392. , u = e("./enum/WarpStyle")
  4393. , s = e("./util/transitions")
  4394. , d = (e("./model/ModelManager"),
  4395. e("./enum/ModelManagerEvents"))
  4396. , p = e("./enum/DirectorEvents")
  4397. , f = e("./enum/PlayerEvents")
  4398. , g = (e("./enum/ControlEvents"),
  4399. e("./enum/BlackoutStyle"))
  4400. , m = e("./enum/PathDiscardMode")
  4401. , v = e("./enum/PathDisplayMode")
  4402. , A = (e("./player"),
  4403. new o(i))
  4404. , y = Object.freeze({
  4405. None: 0,
  4406. Moving: 1,
  4407. Aiming: 2,
  4408. Interlude: 3
  4409. })
  4410. , C = Object.freeze({
  4411. Forward: 1,
  4412. NoChange: 0,
  4413. Backwards: -1
  4414. })
  4415. , I = s.getUniqueId();
  4416. n.prototype = Object.create(l.prototype),
  4417. n.prototype.init = function(e, t) {
  4418. this.player = e,
  4419. this.modelManager = t,
  4420. this.updateModel(),
  4421. this.resetAll(),
  4422. this.bindEvents()
  4423. }
  4424. ,
  4425. n.prototype.resetAll = function() {
  4426. if (this.currentItem = null,
  4427. this.destinationItem = null,
  4428. this.tourIsPlaying = !1,
  4429. this.transitionStage = y.None,
  4430. this.nextFunc = null,
  4431. this.onTheBus = !1,
  4432. this.reachSource = null,
  4433. this.interrupted = !1,
  4434. this.model) {
  4435. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4436. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4437. } else
  4438. this.defaultWarpStyle = u.BLACK,
  4439. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4440. this.resetSpecialTransition()
  4441. }
  4442. ,
  4443. n.prototype.updateModel = function() {
  4444. this.model = this.modelManager.getActiveModel(),
  4445. this.nItems = this.model.heroLocations.length
  4446. }
  4447. ,
  4448. n.prototype.bindEvents = function() {
  4449. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4450. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4451. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4452. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4453. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4454. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4455. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4456. this.player.once(f.Move, function() {
  4457. s.cancelById(I)
  4458. })
  4459. }
  4460. ,
  4461. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4462. return e === u.WALK && (this.interrupt(g.NONE),
  4463. this.pauseWalkingSection(),
  4464. this.player.fastForwardActivePanoFlight(),
  4465. !0)
  4466. }
  4467. ,
  4468. n.prototype.handlePlayerMove = function(e) {
  4469. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4470. this.emit("update.controls")
  4471. }
  4472. ,
  4473. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4474. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4475. this.emit("update.controls"))
  4476. }
  4477. ,
  4478. n.prototype.handlePlayerModeChanged = function(e, t) {
  4479. this.intermediateState() || e === t || (this.onTheBus = !1,
  4480. this.emit("update.controls"))
  4481. }
  4482. ,
  4483. n.prototype.handlePlayerInputStart = function(e) {
  4484. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4485. }
  4486. ,
  4487. n.prototype.handlePlayerFlyingStarted = function() {
  4488. this.clearWalkingSectionPaused()
  4489. }
  4490. ,
  4491. n.prototype.describe = function() {
  4492. return {
  4493. nItems: this.nItems,
  4494. currentItem: this.currentItem,
  4495. destinationItem: this.destinationItem,
  4496. tourIsPlaying: this.tourIsPlaying,
  4497. onTheBus: this.onTheBus,
  4498. endlessLoop: this.endlessLoop,
  4499. viewMode: this.player.mode,
  4500. inTransition: this._inTransition(),
  4501. transitionStage: this.transitionStage,
  4502. tourInProgress: this.tourInProgress
  4503. }
  4504. }
  4505. ,
  4506. n.prototype._inTransition = function() {
  4507. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4508. }
  4509. ,
  4510. n.prototype.bounceable = function() {
  4511. var e = this.clock.getDelta();
  4512. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4513. }
  4514. ,
  4515. n.prototype.currentMoveDirection = function() {
  4516. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4517. }
  4518. ,
  4519. n.prototype.clearPath = function() {
  4520. this._inTransition() || this.player.path.discardPathObject()
  4521. }
  4522. ,
  4523. n.prototype.allFloors = function() {
  4524. this.model.toggleAllFloors()
  4525. }
  4526. ,
  4527. n.prototype.actionComplete = function(e) {
  4528. if (this.interrupted = !1,
  4529. this.transitionStage = y.None,
  4530. this.resetSpecialTransition(),
  4531. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4532. this.tourIsPlaying || (this.player.disablePreRendering(),
  4533. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4534. this.emit("update.controls"),
  4535. this.nextFunc) {
  4536. var t = this.nextFunc;
  4537. this.nextFunc = null,
  4538. t()
  4539. }
  4540. }
  4541. ,
  4542. n.prototype.awaitCompletion = function(e, t) {
  4543. this.nextFunc = t,
  4544. e()
  4545. }
  4546. ,
  4547. n.prototype.updateSuccessFunction = function(e) {
  4548. this.nextFunc = e
  4549. }
  4550. ,
  4551. n.prototype.interrupt = function(e, t) {
  4552. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4553. this.tourIsPlaying = !1,
  4554. this.interrupted = !0,
  4555. this.nextFunc = null,
  4556. this.emit(p.ActionInterrupted),
  4557. null !== e && void 0 !== e || (e = g.BEGINNING),
  4558. this.player.interruptAndFastForward(e, t),
  4559. !0)
  4560. }
  4561. ,
  4562. n.prototype.wouldInterrupt = function() {
  4563. return this.transitionStage !== y.None
  4564. }
  4565. ,
  4566. n.prototype.intermediateState = function() {
  4567. return this.transitionStage !== y.None
  4568. }
  4569. ,
  4570. n.prototype.isInterrupted = function() {
  4571. return this.interrupted
  4572. }
  4573. ,
  4574. n.prototype.pauseWalkingSection = function() {
  4575. this.walkingSectionPaused = !0
  4576. }
  4577. ,
  4578. n.prototype.clearWalkingSectionPaused = function() {
  4579. this.walkingSectionPaused = !1
  4580. }
  4581. ,
  4582. n.prototype.autoTour = function() {
  4583. var e = Date.now();
  4584. this.model.auxDataPromise.then(function() {
  4585. e = Date.now() - e;
  4586. var t = a.warp.auto
  4587. , i = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4588. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4589. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4590. done: function() {
  4591. this.playTour()
  4592. }
  4593. .bind(this),
  4594. name: "_atr",
  4595. id: I
  4596. })
  4597. }
  4598. .bind(this))
  4599. }
  4600. ,
  4601. n.prototype.atDestinationPano = function() {
  4602. if (!this.player.currentPano || null === this.destinationItem)
  4603. return !1;
  4604. var e = this.player.currentPano.id;
  4605. if (void 0 === e)
  4606. return !1;
  4607. var t = this.model.heroLocations;
  4608. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4609. }
  4610. ,
  4611. n.prototype.redirectToItem = function(e, t) {
  4612. if (null === e || void 0 === e)
  4613. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4614. if (!this.wouldInterrupt())
  4615. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4616. if (this.player.mode === c.TRANSITIONING)
  4617. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4618. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4619. var i = function() {
  4620. s.setTimeout(function() {
  4621. this.setDestinationItem(e),
  4622. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4623. }
  4624. .bind(this), 0)
  4625. }
  4626. .bind(this);
  4627. this.interrupt(g.END, 0),
  4628. this.updateSuccessFunction(i)
  4629. }
  4630. ,
  4631. n.prototype.useSpecialTransition = function(e) {
  4632. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4633. this.nextWarpStyle = u.BLACK
  4634. }
  4635. ,
  4636. n.prototype.resetSpecialTransition = function() {
  4637. this.nextWarpStyle = this.defaultWarpStyle
  4638. }
  4639. ,
  4640. n.prototype.arrivedAtDestination = function(e) {
  4641. if (this.player.flying || this.player.isWarping())
  4642. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4643. else {
  4644. this.transitionStage = y.Aiming;
  4645. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4646. this.player.model.fadePanoMarkers(0),
  4647. this.awaitCompletion(function() {
  4648. this.resetSpecialTransition(),
  4649. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4650. }
  4651. .bind(this), t)
  4652. }
  4653. }
  4654. ,
  4655. n.prototype.goToDestination = function(e, t, i, n) {
  4656. if (this.onTheBus = !0,
  4657. this.emit("update.controls"),
  4658. this.player.updateLastView(),
  4659. !n && this.atDestinationPano())
  4660. return void this.arrivedAtDestination(!0);
  4661. if (this.player.flying || this.player.isWarping())
  4662. A.warn("Cannot go to new destination while player is flying or warping.");
  4663. else {
  4664. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4665. , o = null
  4666. , a = null;
  4667. if (r.isPano()) {
  4668. var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4669. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, t, i, this.actionComplete.bind(this)),
  4670. o = this.arrivedAtDestination.bind(this, !0)
  4671. } else
  4672. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4673. o = this.arrivedAtDestination.bind(this, !1);
  4674. this.transitionStage = y.Moving,
  4675. this.model.fadePanoMarkers(0),
  4676. this.awaitCompletion(function() {
  4677. a()
  4678. }
  4679. .bind(this), o),
  4680. this.emit("update.controls")
  4681. }
  4682. }
  4683. ,
  4684. n.prototype.tourInterlude = function() {
  4685. if (h.trackAlways("reach_highlight", {
  4686. reach_source: this.reachSource
  4687. }),
  4688. this.model.fadePanoMarkers(0),
  4689. this.emit("update.controls"),
  4690. this.tourIsPlaying)
  4691. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4692. this.stopTour(),
  4693. this.emit(p.TourEnd),
  4694. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4695. this.transitionStage = y.Interlude,
  4696. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4697. }
  4698. .bind(this), this.goNext.bind(this))
  4699. }
  4700. ,
  4701. n.prototype.playTour = function() {
  4702. if (!this.bounceable())
  4703. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4704. this.tourInProgress = !0,
  4705. this.reachSource = "play",
  4706. this.tourIsPlaying = !0,
  4707. this.wasZoomEnabled = this.player.zoomEnabled,
  4708. this.player.zoomEnabled = !1,
  4709. this.resetSpecialTransition(),
  4710. this.emit("update.controls"),
  4711. this.emit(p.TourStart),
  4712. this.player.enablePreRendering(),
  4713. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4714. this.goToDestination()) : this.goNext()))
  4715. }
  4716. ,
  4717. n.prototype.stopTour = function() {
  4718. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4719. this.tourIsPlaying = !1,
  4720. this.interrupt(),
  4721. this.clearWalkingSectionPaused(),
  4722. this.resetSpecialTransition(),
  4723. this.emit("update.controls"))
  4724. }
  4725. ,
  4726. n.prototype.endTourProgress = function() {
  4727. this.tourInProgress = !1,
  4728. this.emit("update.controls"),
  4729. this.emit(p.TourEnd)
  4730. }
  4731. ,
  4732. n.prototype.goToHighlight = function(e) {
  4733. if (this.wouldInterrupt())
  4734. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4735. else {
  4736. if (A.debug("<tour.goto " + e + ">"),
  4737. this.isInterrupted())
  4738. return;
  4739. this.clearWalkingSectionPaused(),
  4740. this.setDestinationItem(e),
  4741. this.useSpecialTransition("Hilight"),
  4742. this.goToDestination(),
  4743. h.trackAlways("reach_highlight", {
  4744. reach_source: "thumb"
  4745. })
  4746. }
  4747. }
  4748. ,
  4749. n.prototype.prevHighlight = function() {
  4750. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4751. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4752. this.reachSource = "prev",
  4753. this.goPrev()))
  4754. }
  4755. ,
  4756. n.prototype.nextHighlight = function() {
  4757. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4758. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4759. this.reachSource = "next",
  4760. this.goNext()))
  4761. }
  4762. ,
  4763. n.prototype.changeMode = function(e) {
  4764. var t = $.Deferred()
  4765. , i = t.resolve.bind(t)
  4766. , n = t.reject.bind(t);
  4767. this.emit(p.StartModeChange);
  4768. var r = function() {
  4769. return this.clearWalkingSectionPaused(),
  4770. !!this.wouldInterrupt() && (this.interrupt(),
  4771. !0)
  4772. }
  4773. .bind(this);
  4774. if (!r()) {
  4775. switch (e) {
  4776. case c.PANORAMA:
  4777. this.player.mode === c.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4778. break;
  4779. case c.DOLLHOUSE:
  4780. case c.FLOORPLAN:
  4781. this.player.flyToNewMode({
  4782. mode: e
  4783. }).done(i).fail(n);
  4784. break;
  4785. case c.OUTDOOR:
  4786. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4787. }
  4788. return t.promise()
  4789. }
  4790. }
  4791. ,
  4792. n.prototype.atEndOfTour = function() {
  4793. var e = this.currentItem >= this.nItems - 1;
  4794. return e
  4795. }
  4796. ,
  4797. n.prototype.firstDestination = function() {
  4798. return this.nItems > 0 ? 0 : null
  4799. }
  4800. ,
  4801. n.prototype.finalDestination = function() {
  4802. return this.nItems > 0 ? this.nItems - 1 : null
  4803. }
  4804. ,
  4805. n.prototype.goPrev = function() {
  4806. this.tourAdvance(-1)
  4807. }
  4808. ,
  4809. n.prototype.goNext = function() {
  4810. this.tourAdvance(1)
  4811. }
  4812. ,
  4813. n.prototype.setDestinationItem = function(e) {
  4814. this.destinationItem = e,
  4815. this.emit("update.controls")
  4816. }
  4817. ,
  4818. n.prototype.setCurrentItem = function(e) {
  4819. this.currentItem = e,
  4820. this.emit("update.controls")
  4821. }
  4822. ,
  4823. n.prototype.nextItem = function(e) {
  4824. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4825. }
  4826. ,
  4827. n.prototype.prevItem = function(e) {
  4828. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4829. }
  4830. ,
  4831. n.prototype.tourAdvance = function(e) {
  4832. A.debug("tourAdvance(" + e + ")"),
  4833. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4834. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4835. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4836. this.useSpecialTransition("looping back to start")),
  4837. this.goToDestination()
  4838. }
  4839. ,
  4840. t.exports = n
  4841. }
  4842. ).call(this, "/js/director.js")
  4843. }
  4844. , {
  4845. "./analytics": 4,
  4846. "./enum/BlackoutStyle": 18,
  4847. "./enum/ControlEvents": 21,
  4848. "./enum/DirectorEvents": 23,
  4849. "./enum/ModelManagerEvents": 33,
  4850. "./enum/PathDiscardMode": 38,
  4851. "./enum/PathDisplayMode": 39,
  4852. "./enum/PlayerEvents": 40,
  4853. "./enum/Viewmode": 51,
  4854. "./enum/WarpStyle": 52,
  4855. "./model/ModelManager": 140,
  4856. "./player": 155,
  4857. "./settings": 166,
  4858. "./util/logger": 189,
  4859. "./util/transitions": 195,
  4860. events: 202,
  4861. three: 217
  4862. }],
  4863. 16: [function(e, t, i) {//"./effects"
  4864. "use strict";
  4865. var n = e("three")
  4866. , r = e("./enum/Viewmode")
  4867. , o = (e("./settings"),
  4868. e("./util/transitions"))
  4869. , a = e("./enum/PlayerEvents")
  4870. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4871. , l = new n.ShaderPass(n.VerticalBlurShader);
  4872. l.renderToScreen = !0;
  4873. var c = $('#player').width() / $('#player').height();
  4874. isNaN(c) && (c = 1);
  4875. var h = {
  4876. currentBlur: 0,
  4877. aspect: c,
  4878. blurStrength: 1,
  4879. hblurPass: s,
  4880. vblurPass: l,
  4881. bindEvents: function(e) {
  4882. e.on(a.ModeChanged, function(e, t) {
  4883. e === r.PANORAMA && (o.cancel(h.blur),
  4884. o.cancel(h.addBlur),
  4885. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4886. })
  4887. },
  4888. blur: function(e) {
  4889. h.currentBlur = e;
  4890. var t = e * h.blurStrength;
  4891. l.uniforms.v.value = t / 512 * h.aspect,
  4892. s.uniforms.h.value = t / 512
  4893. },
  4894. addBlur: function(e) {
  4895. e = Math.max(e, h.currentBlur),
  4896. h.blur(e)
  4897. },
  4898. removeBlur: function(e) {
  4899. e = Math.min(1 - e, h.currentBlur),
  4900. h.blur(e)
  4901. }
  4902. };
  4903. h.blur(0),
  4904. t.exports = h
  4905. }
  4906. , {
  4907. "./enum/PlayerEvents": 40,
  4908. "./enum/Viewmode": 51,
  4909. "./settings": 166,
  4910. "./util/transitions": 195,
  4911. three: 217
  4912. }],
  4913. 17: [function(e, t, i) {//"../enum/AlignmentType
  4914. "use strict";
  4915. t.exports = {
  4916. UNKNOWN: 0,
  4917. ALIGNED: 1,
  4918. UNALIGNED: 2,
  4919. PLACED: 3
  4920. }
  4921. }
  4922. , {}],
  4923. 18: [function(e, t, i) {//"../enum/BlackoutStyle"
  4924. "use strict";
  4925. t.exports = {
  4926. NONE: 0,
  4927. MIDDLE: 1,
  4928. END: 2,
  4929. BEGINNING: 3,
  4930. FADEIN: 4
  4931. }
  4932. }
  4933. , {}],
  4934. 19: [function(e, t, i) {//"../enum/Colors"
  4935. "use strict";
  4936. var n = e("three");
  4937. t.exports = {
  4938. newBlue: new n.Color(4967932),
  4939. altBlue: new n.Color(47355),
  4940. tagDefault: new n.Color(223357),
  4941. classicBlue: new n.Color(53759),
  4942. mpYellow: new n.Color(16502016),
  4943. mpOrange: new n.Color(16428055),
  4944. mpBlue: new n.Color(12096),
  4945. mpLtGrey: new n.Color(13751252),
  4946. mpDkGrey: new n.Color(10000019),
  4947. mpRed: new n.Color(12525854),
  4948. mpOrangeDesat: new n.Color(16764529),
  4949. mpBlueDesat: new n.Color(4034734),
  4950. mpRedDesat: new n.Color(14705505),
  4951. white: new n.Color(16777215),
  4952. black: new n.Color(0),
  4953. _desat: function(e, t) {
  4954. var i = t || .3
  4955. , r = (new n.Color).copy(e).getHSL();
  4956. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  4957. },
  4958. _darken: function(e, t) {
  4959. var i = t || .2
  4960. , r = e.getHSL();
  4961. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  4962. }
  4963. }
  4964. }
  4965. , {
  4966. three: 217
  4967. }],
  4968. 20: [function(e, t, i) {//"../enum/ControlActions"
  4969. "use strict";
  4970. t.exports = {
  4971. NONE: -1,
  4972. ROTATE: 0,
  4973. DOLLY: 1,
  4974. PAN: 2,
  4975. ROTATE_DOLLY: 3,
  4976. PAN_DOLLY: 4
  4977. }
  4978. }
  4979. , {}],
  4980. 21: [function(e, t, i) {//"./enum/ControlEvents"
  4981. "use strict";
  4982. t.exports = {
  4983. Move: "move",
  4984. InteractionDirect: "interaction.direct",
  4985. InteractionKey: "interaction.key",
  4986. InteractionGui: "interaction.gui",
  4987. FlyInDirection: "fly.direction",
  4988. InputStart: "input.start",
  4989. Pinch: "input.pinch",
  4990. Scroll: "input.scroll",
  4991. AutoPanInterrupt: "autopan.interrupt",
  4992. AutoPanComplete: "autopan.complete",
  4993. AutoPanClamped: "autopan.clamped",
  4994. LongTap: "longtap"
  4995. }
  4996. }
  4997. , {}],
  4998. 22: [function(e, t, i) {//"../enum/Direction"
  4999. "use strict";
  5000. t.exports = Object.freeze({
  5001. FORWARD: "FORWARD",
  5002. LEFT: "LEFT",
  5003. RIGHT: "RIGHT",
  5004. BACK: "BACK",
  5005. UP: "UP",
  5006. DOWN: "DOWN"
  5007. })
  5008. }
  5009. , {}],
  5010. 23: [function(e, t, i) {//"../enum/DirectorEvents"
  5011. "use strict";
  5012. t.exports = {
  5013. ActionInterrupted: "action.interrupted",
  5014. TourStart: "tour.start",
  5015. TourEnd: "tour.end",
  5016. StartModeChange: "mode.startChange"
  5017. }
  5018. }
  5019. , {}],
  5020. 24: [function(e, t, i) {//"../enum/DownloadStatus"
  5021. "use strict";
  5022. t.exports = Object.freeze({
  5023. None: 0,
  5024. Queued: 1,
  5025. ForceQueued: 2,
  5026. Downloading: 3,
  5027. Downloaded: 4,
  5028. DownloadFailed: 5
  5029. })
  5030. }
  5031. , {}],
  5032. 25: [function(e, t, i) {//"../enum/GLCubeFaces"
  5033. "use strict";
  5034. t.exports = {
  5035. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5036. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5037. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5038. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5039. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5040. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5041. }
  5042. }
  5043. , {}],
  5044. 26: [function(e, t, i) {//"../enum/GLTextureType"
  5045. "use strict";
  5046. t.exports = {
  5047. Texture2D: 0,
  5048. TextureCube: 1
  5049. }
  5050. }
  5051. , {}],
  5052. 27: [function(e, t, i) {//"../enum/HelpModalSize
  5053. "use strict";
  5054. t.exports = {
  5055. SMALL: "small",
  5056. LARGE: "large"
  5057. }
  5058. }
  5059. , {}],
  5060. 28: [function(e, t, i) {//"../enum/HelpModalType"
  5061. "use strict";
  5062. var n = e("./Viewmode")
  5063. , r = {
  5064. LANDING: {},
  5065. NAVIGATION: "navigation",
  5066. MORE_HELP: "moreHelp",
  5067. TOUR_INTERACTION: {}
  5068. };
  5069. r.LANDING[n.PANORAMA] = "panorama.landing",
  5070. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5071. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5072. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5073. r.TOUR_INTERACTION.standard = "standard.tour",
  5074. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5075. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5076. t.exports = r
  5077. }
  5078. , {
  5079. "./Viewmode": 51
  5080. }],
  5081. 29: [function(e, t, i) {//"../enum/Joystick"
  5082. "use strict";
  5083. var n = {
  5084. UP: 1,
  5085. DOWN: -1,
  5086. LEFT: "L",
  5087. RIGHT: "R",
  5088. FORWARD: "F",
  5089. BACK: "B",
  5090. reverse: {},
  5091. opposite: function(e) {
  5092. return this.reverse[e.toString()]
  5093. }
  5094. };
  5095. !function() {
  5096. n.reverse[n.UP] = n.DOWN,
  5097. n.reverse[n.DOWN] = n.UP,
  5098. n.reverse[n.LEFT] = n.RIGHT,
  5099. n.reverse[n.RIGHT] = n.LEFT,
  5100. n.reverse[n.FORWARD] = n.BACK,
  5101. n.reverse[n.BACK] = n.FORWARD
  5102. }(),
  5103. t.exports = n
  5104. }
  5105. , {}],
  5106. 30: [function(e, t, i) {//"../enum/Keys"
  5107. "use strict";
  5108. var n = e("../util/browser")
  5109. , r = {
  5110. ZERO: 48,
  5111. ONE: 49,
  5112. TWO: 50,
  5113. THREE: 51,
  5114. FOUR: 52,
  5115. FIVE: 53,
  5116. SIX: 54,
  5117. SEVEN: 55,
  5118. EIGHT: 56,
  5119. NINE: 57,
  5120. LEFTARROW: 37,
  5121. UPARROW: 38,
  5122. RIGHTARROW: 39,
  5123. DOWNARROW: 40,
  5124. A: 65,
  5125. B: 66,
  5126. C: 67,
  5127. D: 68,
  5128. E: 69,
  5129. F: 70,
  5130. G: 71,
  5131. H: 72,
  5132. I: 73,
  5133. J: 74,
  5134. K: 75,
  5135. L: 76,
  5136. M: 77,
  5137. N: 78,
  5138. O: 79,
  5139. P: 80,
  5140. Q: 81,
  5141. R: 82,
  5142. S: 83,
  5143. T: 84,
  5144. U: 85,
  5145. V: 86,
  5146. W: 87,
  5147. X: 88,
  5148. Y: 89,
  5149. Z: 90,
  5150. SPACE: 32,
  5151. RETURN: 13,
  5152. SEMICOLON: 186,
  5153. PLUSEQUALS: 187,
  5154. DASHUNDERSCORE: 189,
  5155. OPENBRACKET: 219
  5156. };
  5157. n.detectFirefox() && (r.SEMICOLON = 59,
  5158. r.PLUSEQUALS = 61,
  5159. r.DASHUNDERSCORE = 173),
  5160. t.exports = r
  5161. }
  5162. , {
  5163. "../util/browser": 182
  5164. }],
  5165. 31: [function(e, t, i) {//"../enum/Locale"
  5166. "use strict";
  5167. t.exports = {
  5168. EN_US: "en-US",
  5169. ES_MX: "es-MX",
  5170. FR_FR: "fr-FR",
  5171. DE_DE: "de-DE",
  5172. RU_RU: "ru-RU",
  5173. CN_CN: "cn-CN",
  5174. JP_JP: "jp-JP"
  5175. }
  5176. }
  5177. , {}],
  5178. 32: [function(e, t, i) {//"../enum/tagEvents"
  5179. "use strict";
  5180. t.exports = {
  5181. TagActivated: "tag.activated",
  5182. TagDismissed: "tag.dismissed",
  5183. TagNavigation: "tag.navigation"
  5184. }
  5185. }
  5186. , {}],
  5187. 33: [function(e, t, i) {//../enum/ModelManagerEvents"
  5188. "use strict";
  5189. t.exports = {
  5190. ModelAdded: "model-added",
  5191. ActiveModelChanged: "active-model-changed"
  5192. }
  5193. }
  5194. , {}],
  5195. 34: [function(e, t, i) {//"../enum/MouseButton"
  5196. "use strict";
  5197. t.exports = {
  5198. LEFT: 0,
  5199. MIDDLE: 1,
  5200. RIGHT: 2
  5201. }
  5202. }
  5203. , {}],
  5204. 35: [function(e, t, i) {//"../enum/PanoRendererEvents"
  5205. "use strict";
  5206. t.exports = {
  5207. PanoRenderComplete: "panorama.render.complete",
  5208. TileRenderFailure: "panorama.tile.render.failed",
  5209. TileRenderSuccess: "panorama.tile.render.success",
  5210. TileUploadAttempted: "panorama.tile.upload.attempted",
  5211. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5212. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5213. }
  5214. }
  5215. , {}],
  5216. 36: [function(e, t, i) {//"./enum/PanoSizeClass"
  5217. "use strict";
  5218. t.exports = {
  5219. BASE: 1,
  5220. STANDARD: 2,
  5221. HIGH: 3,
  5222. ULTRAHIGH: 4
  5223. }
  5224. }
  5225. , {}],
  5226. 37: [function(e, t, i) {//"./enum/PanoramaEvents"
  5227. "use strict";
  5228. t.exports = {
  5229. LoadComplete: "panorama.load.complete",
  5230. LoadFailed: "panorama.load.failed",
  5231. TileLoaded: "panorama.tile.loaded"
  5232. }
  5233. }
  5234. , {}],
  5235. 38: [function(e, t, i) {//"../enum/PathDiscardMode"
  5236. "use strict";
  5237. t.exports = Object.freeze({
  5238. Standard: 0,
  5239. Slow: 1,
  5240. Retain: 2
  5241. })
  5242. }
  5243. , {}],
  5244. 39: [function(e, t, i) {//"../enum/PathDisplayMode
  5245. "use strict";
  5246. t.exports = Object.freeze({
  5247. Show: 0,
  5248. Hide: 1,
  5249. Retain: 2
  5250. })
  5251. }
  5252. , {}],
  5253. 40: [function(e, t, i) {//"./enum/PlayerEvents"
  5254. "use strict";
  5255. t.exports = {
  5256. Move: "move",
  5257. MoveComplete: "move.complete",
  5258. ModeChanged: "mode.changed",
  5259. ModeChanging: "mode.changing",
  5260. PanoChosen: "pano.chosen",
  5261. ClosestPanoChanging: "closest.pano.changing",
  5262. WarpStarted: "warp.started",
  5263. WarpInterrupted: "warp.interrupted",
  5264. WarpEnded: "warp.ended",
  5265. FlyinFinished: "flyin.finished",
  5266. FlyingStarted: "flying.started",
  5267. FlyingInterrupted: "flying.interrupted",
  5268. FlyingEnded: "flying.ended",
  5269. Ready: "ready",
  5270. StartInside: "start.inside",
  5271. StartOutside: "start.outside",
  5272. ViewChanged: "view.changed",
  5273. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5274. InputStart: "input.start"
  5275. }
  5276. }
  5277. , {}],
  5278. 41: [function(e, t, i) {//"./enum/RenderLayers"
  5279. "use strict";
  5280. t.exports = Object.freeze({
  5281. DEFAULT: 0,
  5282. PANOMARKERS: 1,
  5283. RETICULE: 2,
  5284. TAG: 3
  5285. })
  5286. }
  5287. , {}],
  5288. 42: [function(e, t, i) {//"../enum/RenderOrder"
  5289. "use strict";
  5290. t.exports = {
  5291. visibleFloor: 1,
  5292. ghostFloor: 3,
  5293. boundingSkybox: 1,
  5294. panoMarker: 2,
  5295. reticule: 3,
  5296. tagStem: 4,
  5297. tagDisc: 5,
  5298. ribbon: 100
  5299. }
  5300. }
  5301. , {}],
  5302. 43: [function(e, t, i) {//"../enum/SceneRendererEvents"
  5303. "use strict";
  5304. t.exports = {
  5305. ContextCreated: "scene-renderer-context-created",
  5306. AfterRender: "after-render",
  5307. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5308. }
  5309. }
  5310. , {}],
  5311. 44: [function(e, t, i) {//"../enum/TagStates"
  5312. "use strict";
  5313. t.exports = {
  5314. IDLE: "idle",
  5315. BROWSE: "browse",
  5316. EXAMINE: "examine"
  5317. }
  5318. }
  5319. , {}],
  5320. 45: [function(e, t, i) {//"../enum/TileDownloaderEvents"
  5321. "use strict";
  5322. t.exports = {
  5323. TileDownloadSuccess: "tiledownloader.download.success",
  5324. TileDownloadFailure: "tiledownloader.download.failure",
  5325. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5326. }
  5327. }
  5328. , {}],
  5329. 46: [function(e, t, i) {//"../../enum/VRApps"
  5330. "use strict";
  5331. t.exports = {
  5332. CardboardAndroid: "googlevr",
  5333. GearVR: "gearvr",
  5334. CardboardIOS: "googlevrios",
  5335. Cardboard: "googlevr"
  5336. }
  5337. }
  5338. , {}],
  5339. 47: [function(e, t, i) {//"../enum/VROption"
  5340. "use strict";
  5341. t.exports = {
  5342. NONE: 0,
  5343. CONTEXTUAL: 1,
  5344. ANDROID: 2
  5345. }
  5346. }
  5347. , {}],
  5348. 48: [function(e, t, i) {//"../../enum/VRPages"
  5349. "use strict";
  5350. var n = {
  5351. Title: 0,
  5352. Cardboard: 1
  5353. }
  5354. , r = {
  5355. Title: 0,
  5356. Cardboard: 1,
  5357. Gear: 2
  5358. };
  5359. !function() {
  5360. [n, r].forEach(function(e) {
  5361. e.pageCount = Object.keys(e).length
  5362. })
  5363. }(),
  5364. t.exports.ios = n,
  5365. t.exports.standard = r
  5366. }
  5367. , {}],
  5368. 49: [function(e, t, i) {//"../../enum/VRPlatforms"
  5369. "use strict";
  5370. t.exports = {
  5371. Android: "android",
  5372. IOS: "ios",
  5373. Desktop: "desktop",
  5374. UnsupportedAndroid: "android-unsupported"
  5375. }
  5376. }
  5377. , {}],
  5378. 50: [function(e, t, i) {//"../enum/Vectors"
  5379. "use strict";
  5380. var n = e("three");
  5381. t.exports = {
  5382. UP: new n.Vector3(0,1,0),
  5383. DOWN: new n.Vector3(0,-1,0),
  5384. LEFT: new n.Vector3(-1,0,0),
  5385. RIGHT: new n.Vector3(1,0,0),
  5386. FORWARD: new n.Vector3(0,0,-1),
  5387. BACK: new n.Vector3(0,0,1)
  5388. }
  5389. }
  5390. , {
  5391. three: 217
  5392. }],
  5393. 51: [function(e, t, i) {//"./enum/Viewmode"
  5394. "use strict";
  5395. var n = e("../exception/ViewmodeConvertException")
  5396. , r = e("./coreViewmodes")
  5397. , o = e("../util/common")
  5398. , a = {
  5399. MESH: "mesh",
  5400. OUTDOOR: "outdoor",
  5401. TRANSITIONING: "transitioning",
  5402. toInt: function(e) {
  5403. switch (e) {
  5404. case this.PANORAMA:
  5405. return 1;
  5406. case this.DOLLHOUSE:
  5407. return 2;
  5408. case this.FLOORPLAN:
  5409. return 3;
  5410. case this.OUTDOOR:
  5411. return 4;
  5412. case this.TRANSITIONING:
  5413. return -1
  5414. }
  5415. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5416. },
  5417. fromInt: function(e) {
  5418. switch (e) {
  5419. case "1":
  5420. case 1:
  5421. return this.PANORAMA;
  5422. case "2":
  5423. case 2:
  5424. return this.DOLLHOUSE;
  5425. case "3":
  5426. case 3:
  5427. return this.FLOORPLAN;
  5428. case "4":
  5429. case 4:
  5430. return this.OUTDOOR
  5431. }
  5432. throw new n("No known conversion for int to viewmode for int: " + e)
  5433. },
  5434. convertWorkshopModeInt: function(e) {
  5435. switch (e) {
  5436. case "0":
  5437. case 0:
  5438. return this.PANORAMA;
  5439. case "1":
  5440. case 1:
  5441. return this.FLOORPLAN;
  5442. case "2":
  5443. case 2:
  5444. return this.DOLLHOUSE;
  5445. case "3":
  5446. case 3:
  5447. return this.MESH
  5448. }
  5449. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5450. }
  5451. };
  5452. o.extendObject(a, r),
  5453. t.exports = a
  5454. }
  5455. , {
  5456. "../exception/ViewmodeConvertException": 58,
  5457. "../util/common": 185,
  5458. "./coreViewmodes": 54
  5459. }],
  5460. 52: [function(e, t, i) {//"./enum/WarpStyle"
  5461. "use strict";
  5462. t.exports = {
  5463. BLACK: "black",
  5464. STD: "std",
  5465. WALK: "walk"
  5466. }
  5467. }
  5468. , {}],
  5469. 53: [function(e, t, i) {//"../enum/ZoomEvents"
  5470. "use strict";
  5471. t.exports = {
  5472. ZoomIn: "zoom.in",
  5473. ZoomOut: "zoom.out",
  5474. ZoomMax: "zoom.max",
  5475. ZoomMin: "zoom.min"
  5476. }
  5477. }
  5478. , {}],
  5479. 54: [function(e, t, i) {//"./coreViewmodes"
  5480. "use strict";
  5481. t.exports = {
  5482. PANORAMA: "panorama",
  5483. DOLLHOUSE: "dollhouse",
  5484. FLOORPLAN: "floorplan"
  5485. }
  5486. }
  5487. , {}],
  5488. 55: [function(e, t, i) {//"./BasicException"
  5489. "use strict";
  5490. function n(e) {
  5491. this.message = e
  5492. }
  5493. t.exports = n
  5494. }
  5495. , {}],
  5496. 56: [function(e, t, i) {//"../exception/DeviceMismatchException"
  5497. "use strict";
  5498. function n(e) {
  5499. r.call(this, e)
  5500. }
  5501. var r = e("./BasicException");
  5502. n.prototype = Object.create(r.prototype),
  5503. t.exports = n
  5504. }
  5505. , {
  5506. "./BasicException": 55
  5507. }],
  5508. 57: [function(e, t, i) {//"../exception/RendererCreationException"
  5509. "use strict";
  5510. function n(e) {
  5511. r.call(this, e)
  5512. }
  5513. var r = e("./BasicException");
  5514. n.prototype = Object.create(r.prototype),
  5515. t.exports = n
  5516. }
  5517. , {
  5518. "./BasicException": 55
  5519. }],
  5520. 58: [function(e, t, i) {//"../exception/ViewmodeConvertException"
  5521. "use strict";
  5522. function n(e) {
  5523. r.call(this, e)
  5524. }
  5525. var r = e("./BasicException");
  5526. n.prototype = Object.create(r.prototype),
  5527. t.exports = n
  5528. }
  5529. , {
  5530. "./BasicException": 55
  5531. }],
  5532. 59: [function(e, t, i) {///js/featureflags.js
  5533. (function(i) {
  5534. "use strict";
  5535. function n(e) {
  5536. var t = {};
  5537. if (e) {
  5538. var i = e.flags;
  5539. if (i)
  5540. for (var n in i)
  5541. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5542. return t
  5543. }
  5544. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5545. null
  5546. }
  5547. var r = e("./util/ajax")
  5548. , o = e("./util/showcase")
  5549. , a = e("./util/logger")
  5550. //, s = "/api/v1/user/"
  5551. , s = "/data/"
  5552. , l = new a(i)
  5553. , c = {};
  5554. t.exports = {
  5555. loadFeatureFlags: function(e) {
  5556. var t = $.Deferred();
  5557. return r.get(e.urlBase + s, {
  5558. responseType: "json",
  5559. prefetchFrom: "user",
  5560. auth: o.getAuthorizationHeader()
  5561. }).done(function(e) {
  5562. c = n(e),
  5563. c ? t.resolve(c) : t.reject("loading-failed")
  5564. }).fail(function() {
  5565. l.debug("Retrieval of feature flags failed."),
  5566. t.reject("loading-failed")
  5567. }),
  5568. t.promise()
  5569. },
  5570. getFlags: function() {
  5571. return c
  5572. },
  5573. updateDependentSettings: function(e, t) {
  5574. e = e || c,
  5575. e.labels && (t.labels.enabled = !0),
  5576. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5577. e.showcase_sdk && (t.sdkInit = !0),
  5578. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5579. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5580. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5581. e.hide_sc_sharing && (t.share.enabled = !1)
  5582. }
  5583. }
  5584. }
  5585. ).call(this, "/js/featureflags.js")
  5586. }
  5587. , {
  5588. "./util/ajax": 181,
  5589. "./util/logger": 189,
  5590. "./util/showcase": 193
  5591. }],
  5592. 60: [function(e, t, i) {//../util/common
  5593. "use strict";
  5594. var n = (e("../util/common"),
  5595. {
  5596. status: 0,
  5597. set: function(e) {
  5598. var t = e
  5599. , i = $("#bar");
  5600. if (isNaN(t))
  5601. return !1;
  5602. var n = i.attr("r")
  5603. , r = Math.PI * (2 * n);
  5604. t = Math.max(Math.min(t, 100), 0);
  5605. var o = (100 - t) / 100 * r;
  5606. o = Math.max(Math.min(o, 295.3), 0),
  5607. i.css({
  5608. strokeDashoffset: o
  5609. }),
  5610. $("#cont").attr("data-pct", t),
  5611. this.status = e
  5612. },
  5613. done: function(e) {
  5614. return e || this.status ? (this.status = null,
  5615. this.set(100)) : this
  5616. }
  5617. });
  5618. t.exports.circleLoader = n
  5619. }
  5620. , {
  5621. "../util/common": 185
  5622. }],
  5623. 61: [function(e, t, i) {//"./closer/ModalCloserEvent"
  5624. "use strict";
  5625. t.exports = Object.freeze({
  5626. CLOSE: "modal.closer.close"
  5627. })
  5628. }
  5629. , {}],
  5630. 62: [function(e, t, i) {//"./closer/modalCloser"
  5631. "use strict";
  5632. function n(e, t) {
  5633. t && (t.stopPropagation(),
  5634. t.preventDefault()),
  5635. e && this.emit(l.CLOSE, e),
  5636. g.reset()
  5637. }
  5638. function r(e, t) {
  5639. function i() {
  5640. var t = e.offsetHeight >= $('#player').width() && e.offsetWidth >= $('#player').height();
  5641. t !== f && (f = t,
  5642. t ? (e.classList.add("closeByFooter"),
  5643. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5644. h.classList.remove("closeByFooter")))
  5645. }
  5646. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5647. }
  5648. var o = e("../../settings")
  5649. , a = (e("../../tag/Media/MediaEvent"),
  5650. e("../../util/browser"))
  5651. , s = e("../../util/common")
  5652. , l = e("./ModalCloserEvent")
  5653. , c = e("events").EventEmitter
  5654. , h = document.getElementsByClassName("footer")[0]
  5655. , u = h.querySelectorAll(".close")[0]
  5656. , d = null
  5657. , p = null
  5658. , f = null
  5659. , g = (a.isMobile(),
  5660. {
  5661. open: function(e) {
  5662. e && (r(e),
  5663. d && u.removeEventListener("click", d, !0),
  5664. d = n.bind(this, e.id),
  5665. u.addEventListener("click", d, !0),
  5666. p && window.removeEventListener("resize", p, !0),
  5667. p = r.bind(this, e),
  5668. window.addEventListener("resize", p, !0))
  5669. },
  5670. reset: function() {
  5671. h.classList.remove("closeByFooter"),
  5672. u.removeEventListener("click", d, !0),
  5673. window.removeEventListener("resize", p, !0),
  5674. d = p = f = null
  5675. }
  5676. });
  5677. s.extendObject(g, c.prototype),
  5678. t.exports = g
  5679. }
  5680. , {
  5681. "../../tag/Media/MediaEvent": 131,
  5682. "../../settings": 166,
  5683. "../../util/browser": 182,
  5684. "../../util/common": 185,
  5685. "./ModalCloserEvent": 61,
  5686. events: 202
  5687. }],
  5688. 63: [function(e, t, i) {//"./debug"
  5689. "use strict";
  5690. function n(e, t, i) {
  5691. var n = new r.GUI({
  5692. width: 400
  5693. })
  5694. , u = n.addFolder("Flydown from Dollhouse");
  5695. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5696. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5697. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5698. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5699. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5700. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5701. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5702. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5703. var d = n.addFolder("Transition between panos");
  5704. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5705. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5706. h.transition.flyTime = 0,
  5707. d.__controllers.forEach(function(e) {
  5708. e.updateDisplay()
  5709. })
  5710. }),
  5711. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5712. h.transition.flySpeed = 0,
  5713. d.__controllers.forEach(function(e) {
  5714. e.updateDisplay()
  5715. })
  5716. }),
  5717. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5718. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5719. d.add(h.transition, "movementEasing", Object.keys(a));
  5720. var p = n.addFolder("Path Display");
  5721. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5722. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5723. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5724. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5725. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5726. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5727. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5728. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5729. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5730. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5731. h.path.color = l[h.path.color],
  5732. h.path.colorUp = l._desat(h.path.color),
  5733. h.path.colorDown = l.darken(h.path.color)
  5734. }),
  5735. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5736. h.reticuleColor = l[h.reticuleColor]
  5737. });
  5738. var f = n.addFolder("Warping")
  5739. , g = f.addFolder("Warp/Teleport");
  5740. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5741. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5742. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5743. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5744. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5745. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5746. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5747. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5748. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5749. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5750. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5751. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5752. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5753. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5754. h.path.typ = c[h.path.typ]
  5755. }),
  5756. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5757. t.endlessLoop = h.warp.loop
  5758. }),
  5759. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5760. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5761. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5762. var m = f.addFolder("Long Warp Only");
  5763. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5764. h.warp.flySpeed = 0,
  5765. m.__controllers.forEach(function(e) {
  5766. e.updateDisplay()
  5767. })
  5768. }),
  5769. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5770. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5771. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5772. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5773. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5774. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5775. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5776. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5777. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5778. var v = n.addFolder("Warp Esoterica");
  5779. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5780. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5781. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5782. h.warp.minWarpTime = 0,
  5783. v.__controllers.forEach(function(e) {
  5784. e.updateDisplay()
  5785. })
  5786. }),
  5787. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5788. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5789. v.add(h.warp, "movementEasing", Object.keys(a));
  5790. var A = n.addFolder("Misc");
  5791. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5792. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5793. }),
  5794. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5795. i.cameras[s.PANORAMA].fov = h.insideFOV
  5796. }),
  5797. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5798. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5799. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5800. var y = n.addFolder("Navigation");
  5801. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5802. h.navigation.panoScores || e.panos.forEach(function(e) {
  5803. e.floor.remove(e.text3d),
  5804. e.text3d = null
  5805. })
  5806. }),
  5807. y.add(h.navigation, "mouseDirection"),
  5808. y.add(h.navigation, "filterStrictness", 0, 1),
  5809. y.add(h.navigation, "angleFactor", -60, 0),
  5810. y.add(h.navigation, "directionFactor", 1, 20),
  5811. y.add(h.navigation, "distanceFactor", -5, 5),
  5812. y.add(h.navigation, "optionalityFactor", .1, 10);
  5813. var C = n.addFolder("tags")
  5814. , I = C.addFolder("Tag Creation");
  5815. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5816. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5817. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5818. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5819. var E = C.addFolder("Visibility");
  5820. E.add(h.tags.visibility, "anyDistance"),
  5821. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5822. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5823. E.add(h.tags.visibility, "hideViaFloor"),
  5824. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5825. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5826. var b = C.addFolder("Disc Parameters");
  5827. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5828. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5829. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5830. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5831. }),
  5832. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5833. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5834. }),
  5835. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5836. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5837. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5838. var w = C.addFolder("Navigate");
  5839. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5840. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5841. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5842. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5843. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5844. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5845. var _ = n.addFolder("Debug");
  5846. _.add(h, "wireframe").onFinishChange(function() {
  5847. e.chunks.forEach(function(t) {
  5848. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5849. t.wireframeTwin.material.depthWrite = !1,
  5850. t.wireframeTwin.material.depthTest = !1,
  5851. t.wireframeTwin.material.opacity = .5,
  5852. t.wireframeTwin.material.transparent = !0),
  5853. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5854. })
  5855. }),
  5856. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5857. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5858. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5859. e.skybox.wireframe = null)
  5860. }),
  5861. _.add(h, "showSweeps").onFinishChange(function() {
  5862. e.setSweepVisibility(h.showSweeps)
  5863. }),
  5864. _.add(h, "showMesh").onFinishChange(function() {
  5865. e.chunks.forEach(function(e) {
  5866. e.visible = h.showMesh
  5867. })
  5868. }),
  5869. _.add(h, "showFloors").onFinishChange(function() {
  5870. e.floors.forEach(function(e) {
  5871. e.collider.children.forEach(function(e) {
  5872. e.material.visible = h.showFloors
  5873. })
  5874. })
  5875. }),
  5876. _.add(h, "showSkyboxes").onFinishChange(function() {
  5877. e.panos.forEach(function(e) {
  5878. e.skyboxMesh.visible = h.showSkyboxes
  5879. })
  5880. }),
  5881. _.add(h, "showNeighbors").onChange(function() {}),
  5882. _.add(e, "alpha", 0, 1)
  5883. }
  5884. var r = e("../lib/dat.gui")
  5885. , o = e("three")
  5886. , a = e("../util/easing")
  5887. , s = e("../enum/Viewmode")
  5888. , l = e("../enum/Colors")
  5889. , c = e("../enum/WarpStyle")
  5890. , h = e("../settings");
  5891. e("../tag/tag");
  5892. r.GUI.prototype.removeFolder = function(e) {
  5893. var t = this.__folders[e];
  5894. t && (t.close(),
  5895. this.__ul.removeChild(t.domElement.parentNode),
  5896. delete this.__folders[e],
  5897. this.onResize())
  5898. }
  5899. ,
  5900. t.exports.toggle = n
  5901. }
  5902. , {
  5903. "../enum/Colors": 19,
  5904. "../enum/Viewmode": 51,
  5905. "../enum/WarpStyle": 52,
  5906. "../lib/dat.gui": 93,
  5907. "../tag/tag": 123,
  5908. "../settings": 166,
  5909. "../util/easing": 186,
  5910. three: 217
  5911. }],
  5912. 64: [function(e, t, i) {///js/gui/error.js
  5913. (function(i) {
  5914. "use strict";
  5915. function n(e, t, i, n) {
  5916. $(".gui-error .error-problem-text").text(e),
  5917. $(".gui-error .error-solution-text").text(t),
  5918. $(".gui-error .error-explanation").text(i),
  5919. $(".gui-error .error-actions").html(n),
  5920. $(window).resize(),
  5921. $(".gui-error").fadeIn(),
  5922. $("#bottom-logo").fadeIn()
  5923. }
  5924. function r(e) {
  5925. 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("");
  5926. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  5927. s.isMobile() || $("[rel=tiletip]").tooltip({
  5928. placement: "bottom",
  5929. delay: {
  5930. show: 50,
  5931. hide: 0
  5932. },
  5933. trigger: "hover",
  5934. viewport: {
  5935. selector: "body",
  5936. padding: 10
  5937. }
  5938. })
  5939. }
  5940. function o() {
  5941. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  5942. , t = [h.ERROR_GENERIC_ACTIONS_1, e, '<a class="link" target="_blank" href=', p, ">" + h.ERROR_GENERIC_ACTIONS_4 + "</a>."].join("");
  5943. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  5944. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5945. e.preventDefault(),
  5946. e.stopPropagation(),
  5947. r(" ")
  5948. })
  5949. }
  5950. function a(e) {
  5951. if ($("head title").text(c.pageTitle),
  5952. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5953. $("#gui-loading").fadeOut(250),
  5954. $("#quick-blackout").hide(),
  5955. l.track("showcase_error", {
  5956. error_key: e
  5957. }),
  5958. h.locale || h.init(),
  5959. "webgl-unsupported" === e)
  5960. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5961. else if ("webgl-ios" === e)
  5962. n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, "", h.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  5963. else if ("webgl-safari" === e)
  5964. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  5965. else if ("webgl-generic" === e)
  5966. o();
  5967. else if ("missing-urls" === e)
  5968. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  5969. else if ("loading-failed" === e)
  5970. n(h.ERROR_LOADING_FAILED_PROBLEM, "", "", h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + ">" + h.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  5971. else {
  5972. if ("loading-failed-maintenance" !== e)
  5973. return void d.error("Unhandled error: " + e);
  5974. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  5975. }
  5976. }
  5977. var s = e("./../util/browser")
  5978. , l = e("./../analytics")
  5979. , c = e("./../settings")
  5980. , h = e("../localization/localize")
  5981. , u = e("./../util/logger")
  5982. , d = new u(i)
  5983. , p = '"https://support.port.com/hc/articles/208220058"';
  5984. t.exports.error = a
  5985. }
  5986. ).call(this, "/js/gui/error.js")
  5987. }
  5988. , {
  5989. "../localization/localize": 108,
  5990. "./../analytics": 4,
  5991. "./../settings": 166,
  5992. "./../util/browser": 182,
  5993. "./../util/logger": 189
  5994. }],
  5995. 65: [function(e, t, i) {//"./gui"
  5996. (function(i) {
  5997. "use strict";
  5998. function n() {
  5999. Ue = [],
  6000. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6001. Ue.push(".hideTarget", ".pinTop.right")
  6002. }
  6003. function r() {
  6004. for (var e in je)
  6005. if (je.hasOwnProperty(e)) {
  6006. var t = je[e];
  6007. if (!t.visible)
  6008. for (var i = 0; i < t.elements.length; i++)
  6009. $(t.elements[i]).hide()
  6010. }
  6011. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6012. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6013. n()
  6014. }
  6015. function o(e, t) {
  6016. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6017. $("#gui-zoomin").toggle(i),
  6018. $("#gui-zoomout").toggle(i)
  6019. }
  6020. function a() {
  6021. c(),
  6022. $(".pinBottom").toggleClass("open"),
  6023. $("#drawer").toggleClass("open"),
  6024. $(".footer").toggleClass("open"),
  6025. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6026. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6027. ie.resetDrawer()),
  6028. setTimeout(function() {
  6029. $("#pullTab").toggleClass("opened")
  6030. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6031. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6032. }
  6033. function s(e) {
  6034. var t;
  6035. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6036. t = e.position().top + e.outerHeight(),
  6037. e.attr("style", "display: none"));
  6038. var i = $("#player").outerHeight()
  6039. , n = i - 130;
  6040. return n < t + 25
  6041. }
  6042. function l(e) {
  6043. "touchstart" === e.type && e.preventDefault(),
  6044. e.stopPropagation()
  6045. }
  6046. function c() {
  6047. W && (W.reload(),
  6048. W.init())
  6049. }
  6050. function h(e) {
  6051. ne.show(e),
  6052. r()
  6053. }
  6054. function u(e) {
  6055. ne.progress(e)
  6056. }
  6057. function d(e, t, i) {
  6058. var n = t.player;
  6059. $("#gui-thumb").fadeOut(2500),
  6060. ne.hide(function() {
  6061. Ge = !1
  6062. }),
  6063. me.init(e, i),
  6064. de.finishSetup(Object.keys(e.tags).length),
  6065. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6066. var s = function() {
  6067. i.dismissExaminedTag(),
  6068. i.disableHovering()
  6069. };
  6070. Ae.on(ye.OPENED, s),
  6071. Ce.on(Me.OPENED, s),
  6072. he.on(ue.OPENED, s),
  6073. fe.on(ge.OPENED, s);
  6074. var l = i.enableHovering.bind(i);
  6075. if (Ae.on(ye.CLOSED, l),
  6076. Ce.on(Me.CLOSED, l),
  6077. he.on(ue.CLOSED, l),
  6078. fe.on(ge.CLOSED, l),
  6079. Q.labels.enabled && Object.keys(e.labels).length,
  6080. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6081. C(e.currentFloor, n.mode)),
  6082. r(),
  6083. o(t, t.player),
  6084. $("#gui").fadeIn(1500),
  6085. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6086. a(),
  6087. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6088. }, 2e3),
  6089. !K.isMobile())
  6090. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6091. $(c[h]).addClass("hasHover");
  6092. O(e),
  6093. de.setupToggling()
  6094. }
  6095. function p(e) {
  6096. e || (e = 0),
  6097. We = !1,
  6098. window.setTimeout(function() {
  6099. We || (ze = !0,
  6100. $("#gui-spinner").stop(!0, !0).show())
  6101. }
  6102. .bind(this), e)
  6103. }
  6104. function f() {
  6105. $("#gui-spinner").stop(!0, !0),
  6106. $("#gui-spinner").fadeOut(1e3),
  6107. We = !0,
  6108. ze = !1
  6109. }
  6110. function g(e, t) {
  6111. var i = e.mode
  6112. , n = t || e.currentPano;
  6113. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6114. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6115. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6116. Q.show360Views.enabled && !n.isAligned() ? ($("#gui-modes-inside").removeClass("hidden"),
  6117. $(".gui-floor").addClass("hidden"),
  6118. $("#gui-modes-outside").addClass("desktop-only")) : ($("#gui-modes-inside").addClass("hidden"),
  6119. $(".gui-floor").removeClass("hidden"),
  6120. $("#gui-modes-outside").removeClass("desktop-only")),
  6121. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6122. Be = i,
  6123. $("#gui-modes-outside").addClass("hidden"),
  6124. $("#gui-modes-inside").removeClass("hidden"),
  6125. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6126. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6127. }
  6128. function m(e, t) {
  6129. var i = t.player;
  6130. $("#gui-modes-inside").find("a").on("click", function(e) {
  6131. l(e),
  6132. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6133. J.track("showcase_gui", {
  6134. gui_action: "click_inside_mode_button"
  6135. }),
  6136. t.changeMode(_e.PANORAMA)
  6137. }),
  6138. $("#gui-modes-outside").find("a").on("click", function(e) {
  6139. l(e),
  6140. J.track("showcase_gui", {
  6141. gui_action: "click_outside_mode_button"
  6142. }),
  6143. t.changeMode(Be)
  6144. }),
  6145. $("#gui-modes-floorplan").on("click", function(e) {
  6146. l(e),
  6147. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6148. gui_action: "click_floorplan_mode_button"
  6149. }),
  6150. t.changeMode(_e.FLOORPLAN))
  6151. }),
  6152. $("#gui-modes-dollhouse").on("click", function(e) {
  6153. l(e),
  6154. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6155. gui_action: "click_dollhouse_mode_button"
  6156. }),
  6157. t.changeMode(_e.DOLLHOUSE))
  6158. })
  6159. }
  6160. function v(e, t) {
  6161. function i() {
  6162. document.getElementById("vr").classList.remove("hidden"),
  6163. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6164. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6165. $(".improper-embed").toggleClass("hidden", !1),
  6166. r())
  6167. }, function(e) {
  6168. r()
  6169. }) : r()
  6170. }
  6171. function n(i) {
  6172. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6173. Ie.init(e.data, t, i, q),
  6174. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6175. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6176. }
  6177. function r() {
  6178. De.info("WebVR support not found, VR button activates native app VR modal"),
  6179. Ae.init(e.data, q),
  6180. Ae.on(ye.OPENED, function() {
  6181. var e = document.getElementById("vr-modal");
  6182. return function() {
  6183. Ze("vr"),
  6184. le.open(e)
  6185. }
  6186. }()),
  6187. Ae.on(ye.CLOSED, le.reset)
  6188. }
  6189. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0))
  6190. switch (Q.vr.option) {
  6191. case Pe.CONTEXTUAL:
  6192. i();
  6193. break;
  6194. case Pe.ANDROID:
  6195. K.detectAndroid() && i();
  6196. break;
  6197. case Pe.NONE:
  6198. }
  6199. }
  6200. function A(e, t) {
  6201. $("#play").find("a").on("mousedown touchstart", function(e) {
  6202. l(e),
  6203. Ze("tour"),
  6204. ve.play(),
  6205. J.trackAlways("showcase_gui", {
  6206. gui_action: "play_highlights"
  6207. })
  6208. }),
  6209. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6210. l(e),
  6211. ve.pause(),
  6212. J.trackAlways("showcase_gui", {
  6213. gui_action: "pause_highlights"
  6214. })
  6215. }),
  6216. $("#gui-zoomin").find("a").on("click", function(e) {
  6217. l(e),
  6218. t.player.zoomInIncrementally()
  6219. }),
  6220. $("#gui-zoomout").find("a").on("click", function(e) {
  6221. l(e),
  6222. t.player.zoomOutIncrementally()
  6223. })
  6224. }
  6225. function y(e, t) {
  6226. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6227. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6228. $(".gui-floor").find(".container").prepend(r)
  6229. }
  6230. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6231. i.on("click", function(e) {
  6232. l(e),
  6233. Ze("floor"),
  6234. i.toggleClass("open")
  6235. }),
  6236. $(".floorChoice").on("click", function(e) {
  6237. l(e);
  6238. var n = $(this).data("index");
  6239. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6240. t.player.gotoFloor(n),
  6241. J.track("showcase_gui", {
  6242. gui_action: "click_floor_select_button",
  6243. interaction_source: "gui"
  6244. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6245. Ze("move"),
  6246. t.allFloors(),
  6247. J.track("showcase_gui", {
  6248. gui_action: "click_toggle_all_floors_button",
  6249. interaction_source: "gui"
  6250. })),
  6251. i.removeClass("open")
  6252. })
  6253. }
  6254. function C(e, t) {
  6255. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? $(".allFloorBtn").show() : $(".allFloorBtn").hide(),
  6256. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6257. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6258. $(".floorChoice").removeClass("active"),
  6259. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6260. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6261. $(".floorChoice").removeClass("active"),
  6262. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6263. }
  6264. function I(e) {
  6265. return e.describe().inTransition
  6266. }
  6267. function E(e) {
  6268. $("<img/>").attr("src", e).on("load", function() {
  6269. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6270. $(this).remove()
  6271. })
  6272. }
  6273. function b(e, t, i) {
  6274. Fe = e.heroLocations.length;
  6275. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6276. , r = 100 / Fe + "%"
  6277. , o = $("#thumb-container")
  6278. , a = $("#progressBar");
  6279. $("#status").find(".totalSteps").text(Fe);
  6280. for (var s = 0; s < Fe; s++) {
  6281. var c = e.heroLocations[s]
  6282. , h = $(n);
  6283. if (h.attr("data-index", s),
  6284. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6285. c.name) {
  6286. var u = $('<div class="overlay"></div>').text(c.name);
  6287. h.prepend(u)
  6288. }
  6289. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6290. var d = e.panos.get(c.panoId)
  6291. , p = d && !d.isAligned()
  6292. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6293. h.prepend(f)
  6294. }
  6295. o.append(h),
  6296. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6297. }
  6298. j = 144 * Fe,
  6299. Y = 111 * Fe,
  6300. $(".thumbImg").on("mouseover", function() {
  6301. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6302. }),
  6303. $(".thumbImg").on("mouseout", function() {
  6304. t.clearPath()
  6305. }),
  6306. $(".thumbImg").on("click", function(e) {
  6307. l(e);
  6308. var i = $(this);
  6309. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6310. J.trackAlways("showcase_gui", {
  6311. gui_action: "click_highlight"
  6312. }),
  6313. t.goToHighlight(i.data("index"))
  6314. }),
  6315. $(".previous").find("a").on("click", function(e) {
  6316. l(e),
  6317. J.trackAlways("showcase_gui", {
  6318. gui_action: "prev_highlight"
  6319. }),
  6320. t.prevHighlight()
  6321. }),
  6322. $(".next").find("a").on("click", function(e) {
  6323. l(e),
  6324. J.trackAlways("showcase_gui", {
  6325. gui_action: "next_highlight"
  6326. }),
  6327. t.nextHighlight()
  6328. }),
  6329. $("#drawer").on("mouseleave", function(e) {
  6330. l(e);
  6331. var t;
  6332. try {
  6333. t = new MouseEvent("mouseup",{
  6334. clientX: e.clientX,
  6335. clientY: e.clientY,
  6336. screenX: e.screenX,
  6337. screenY: e.screenY
  6338. })
  6339. } catch (i) {
  6340. t = document.createEvent("MouseEvents"),
  6341. t.initMouseEvent("mouseup", e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  6342. }
  6343. document.dispatchEvent(t)
  6344. }),
  6345. W = new Sly($("#scrollFrame"),{
  6346. horizontal: !0,
  6347. itemNav: "centered",
  6348. smart: !0,
  6349. scrollTrap: !0,
  6350. scrollBy: 1,
  6351. mouseDragging: !0,
  6352. touchDragging: !0,
  6353. speed: 300,
  6354. dragHandle: !0,
  6355. dynamicHandle: !0,
  6356. clickBar: !0,
  6357. scrollBar: $("#scroller"),
  6358. activateOn: null
  6359. }).init(),
  6360. W.on("active", function(e, t) {
  6361. Ve = t,
  6362. Ze("tour"),
  6363. $(".step").removeClass("active"),
  6364. $("#status").find(".curIdx").text(t + 1);
  6365. for (var i = 0; i <= t; i++)
  6366. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6367. }),
  6368. w()
  6369. }
  6370. function w() {
  6371. var e = $('#player').width() - 20
  6372. , t = $("#scroller")
  6373. , i = $("#drawer")
  6374. , n = $(".pinBottom");
  6375. if ($('#player').width() < 488 || $('#player').height() < 488)
  6376. t.addClass("hidden"),
  6377. i.addClass("noScroll"),
  6378. n.addClass("noScroll");
  6379. else {
  6380. var r = j > e
  6381. , o = !i.hasClass("noScroll")
  6382. , a = r !== o;
  6383. a && (t.toggleClass("hidden"),
  6384. i.toggleClass("noScroll"),
  6385. n.toggleClass("noScroll"))
  6386. }
  6387. }
  6388. function _(e) {
  6389. je.tourControls.visible = e.tour_buttons && K.valueFromHash("gt", 1),
  6390. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6391. je.highlight.visible = e.highlight_reel && 1 !== Q.specialEdition && Q.showHighlights
  6392. }
  6393. function T(e) {
  6394. function t(t, i) {
  6395. return !!e.player_options[t] && e[i || t]
  6396. }
  6397. $(".model-title").text(e.name);
  6398. var i = Q.pageTitle;
  6399. 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6400. document.title = i,
  6401. K.isMobile() ? $("#gui-fullscreen").toggleClass("hidden") : ($("[rel=tooltip]").tooltip({
  6402. delay: {
  6403. show: 50,
  6404. hide: 0
  6405. },
  6406. trigger: "hover",
  6407. html: !1,
  6408. viewport: {
  6409. selector: "body",
  6410. padding: 10
  6411. }
  6412. }),
  6413. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6414. t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
  6415. de.populate({
  6416. name: t("model_name", "name"),
  6417. coBrand: t("presented_by"),
  6418. description: t("model_summary", "summary"),
  6419. contactName: t("contact_name"),
  6420. address: t("address"),
  6421. phone: t("contact_phone"),
  6422. formattedPhone: e.formatted_contact_phone,
  6423. email: t("contact_email"),
  6424. url: t("external_url"),
  6425. socialSharing: e.enable_social_sharing && e.is_public
  6426. })
  6427. }
  6428. function x(e, t, i, n, r, o) {
  6429. function a() {
  6430. o.setLoadingStartTime(),
  6431. H(),
  6432. r ? (re.showMessage(t, i, je.coBrand.visible),
  6433. l()) : h(l)
  6434. }
  6435. var s = $.Deferred()
  6436. , l = s.resolve.bind(s);
  6437. return Ge = !0,
  6438. O(e),
  6439. e.data.player_options && _(e.data.player_options),
  6440. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6441. Re.localizeGUI(),
  6442. T(e.data),
  6443. r || $(".quick").addClass("hidden"),
  6444. e.data.image && !r && E(e.data.image),
  6445. n ? (J.impression(),
  6446. a()) : (o.setWaitingStartTime(),
  6447. oe.show(r, a)),
  6448. s
  6449. }
  6450. function S(e, t, i, n, r, a, s) {
  6451. q = s,
  6452. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6453. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6454. ae.init(),
  6455. re.init(e, a),
  6456. Oe.init(e, t, n),
  6457. $(".icon").on("mouseover", function() {
  6458. t.player && t.player.reticule.hide()
  6459. }),
  6460. m(e, t),
  6461. A(e, t),
  6462. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(e.data.name),
  6463. Ce.on(Me.OPENED, function() {
  6464. var e = document.getElementById("share-modal");
  6465. return function() {
  6466. Ze("share"),
  6467. le.open(e)
  6468. }
  6469. }()),
  6470. Ce.on(Me.CLOSED, le.reset)),
  6471. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6472. je.tourControls.visible = !1),
  6473. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6474. z(),
  6475. g(i),
  6476. v(e, r),
  6477. e.on("floor.changed", C),
  6478. e.on("waiting", R.bind(this, e)),
  6479. e.on("waiting-done", P.bind(this, e)),
  6480. i.on(xe.ModeChanged, function(e, n) {
  6481. g(i),
  6482. o(t, i),
  6483. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6484. he.updateMode(n)
  6485. }),
  6486. n.on(Se.Move, Ze.bind(this, "move")),
  6487. i.on(xe.Ready, function() {
  6488. ie.init(n, i, i.tagManager, t),
  6489. i.on(xe.ModeChanged, function(e, t) {
  6490. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6491. })
  6492. }),
  6493. i.on(xe.PanoChosen, function(e, t) {
  6494. g(i, t),
  6495. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6496. }),
  6497. le.on(ce.CLOSE, function(e) {
  6498. switch (e) {
  6499. case "vr-modal":
  6500. Ae.dismiss();
  6501. break;
  6502. case "share-modal":
  6503. Ce.hide();
  6504. break;
  6505. case "terms-modal":
  6506. fe.hide()
  6507. }
  6508. });
  6509. var l = $("#play").eq(0)
  6510. , c = $("#pause").eq(0)
  6511. , h = $(".pinBottom").toArray()
  6512. , u = $("#drawer").eq(0)
  6513. , d = $("#playHead").eq(0)
  6514. , p = $("#progressBar").eq(0)
  6515. , f = $("#thumb-container").eq(0)
  6516. , y = f.children()
  6517. , I = p.children();
  6518. t.on("update.controls", function() {
  6519. var n = t.describe();
  6520. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6521. c.show()),
  6522. n.tourInProgress && (h.forEach(function(e) {
  6523. e.classList.add("playing")
  6524. }),
  6525. u.addClass("playing"),
  6526. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6527. c.hide()),
  6528. n.tourInProgress || (ve.stopTour(),
  6529. h.forEach(function(e) {
  6530. e.classList.remove("playing")
  6531. }),
  6532. u.removeClass("playing"),
  6533. d.removeClass("playing")));
  6534. var r, a, s;
  6535. if (null !== n.currentItem) {
  6536. var p, f;
  6537. $("#status").find(".curIdx").text(n.currentItem + 1),
  6538. n.onTheBus ? (p = "active",
  6539. f = "recent") : (f = "active",
  6540. p = "recent");
  6541. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6542. for (r = 0; r < e.heroLocations.length; r += 1)
  6543. s = y.eq(r),
  6544. a = I.eq(r),
  6545. s.removeClass(f),
  6546. a.removeClass(f),
  6547. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6548. a.addClass(p),
  6549. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6550. a.addClass(p)) : (s.removeClass(p),
  6551. a.removeClass(p))
  6552. } else
  6553. for (r = 0; r < e.heroLocations.length; r += 1)
  6554. s = y.eq(r),
  6555. a = I.eq(r),
  6556. s.removeClass("active recent"),
  6557. a.removeClass("active recent");
  6558. o(t, i)
  6559. }),
  6560. document.addEventListener("keydown", function(n) {
  6561. switch (J.updateInteraction(Se.InteractionKey),
  6562. n.which) {
  6563. case we.ZERO:
  6564. Q.debug && e.toggleAlpha();
  6565. break;
  6566. case we.NINE:
  6567. Q.debug && se.toggle();
  6568. break;
  6569. case we.ONE:
  6570. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6571. break;
  6572. case we.TWO:
  6573. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6574. break;
  6575. case we.THREE:
  6576. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6577. break;
  6578. case we.FOUR:
  6579. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6580. break;
  6581. case we.SPACE:
  6582. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6583. break;
  6584. case we.RETURN:
  6585. Q.debug && e.toggleExplodeUp();
  6586. break;
  6587. case we.P:
  6588. k();
  6589. break;
  6590. case we.U:
  6591. B();
  6592. break;
  6593. case we.X:
  6594. Q.debug && e.toggleExplode();
  6595. break;
  6596. case we.PLUSEQUALS:
  6597. t.player.activatePersistentZooming(!0),
  6598. ie.hideUi();
  6599. break;
  6600. case we.DASHUNDERSCORE:
  6601. t.player.activatePersistentZooming(!1),
  6602. ie.hideUi();
  6603. break;
  6604. case we.SEVEN:
  6605. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6606. break;
  6607. case we.EIGHT:
  6608. t.player.decreaseZoomSpeed();
  6609. break;
  6610. case we.NINE:
  6611. t.player.increaseZoomSpeed()
  6612. }
  6613. return i && i.reticule.hide(),
  6614. !0
  6615. }
  6616. .bind(this)),
  6617. document.addEventListener("keyup", function(e) {
  6618. switch (e.which) {
  6619. case we.PLUSEQUALS:
  6620. t.player.deactivatePersistentZooming();
  6621. break;
  6622. case we.DASHUNDERSCORE:
  6623. t.player.deactivatePersistentZooming()
  6624. }
  6625. }
  6626. .bind(this)),
  6627. F(e),
  6628. L(e, t.player),
  6629. M(i),
  6630. te.setAutoPlay(e.heroCount()),
  6631. he.init(i, a.mode),
  6632. he.on(ue.OPENED, Ze.bind(this, "help")),
  6633. fe.init(),
  6634. fe.on(ge.OPENED, function() {
  6635. var e = document.getElementById("terms-modal");
  6636. return function() {
  6637. Ze("terms"),
  6638. le.open(e)
  6639. }
  6640. }()),
  6641. fe.on(ge.CLOSED, le.reset),
  6642. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6643. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6644. Q.profiling.enabled && se.show(),
  6645. ve.init(t)
  6646. }
  6647. function M(e) {
  6648. var t = function(e, t) {
  6649. $(e).find("a").each(function(e, i) {
  6650. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6651. i.style.pointerEvents = t ? "auto" : "none"
  6652. })
  6653. }
  6654. , i = function() {
  6655. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6656. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6657. };
  6658. e.on(Ne.ZoomMax, function() {
  6659. t("#gui-zoomin", !1),
  6660. t("#gui-zoomout", !0)
  6661. }),
  6662. e.on(Ne.ZoomMin, function() {
  6663. t("#gui-zoomin", !0),
  6664. t("#gui-zoomout", !1)
  6665. }),
  6666. e.on(Ne.ZoomIn, function() {
  6667. t("#gui-zoomout", !0)
  6668. }),
  6669. e.on(Ne.ZoomOut, function() {
  6670. t("#gui-zoomin", !0)
  6671. }),
  6672. i()
  6673. }
  6674. function R(e) {
  6675. O(e)
  6676. }
  6677. function P(e) {
  6678. O(e)
  6679. }
  6680. function O(e) {
  6681. var t = e.waitQueue.length;
  6682. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6683. }
  6684. function L(e, t) {
  6685. He = {
  6686. gui: null,
  6687. visible: !1,
  6688. model: e,
  6689. player: t
  6690. }
  6691. }
  6692. function D(e, t) {
  6693. function i() {
  6694. var i = t.toJSON();
  6695. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6696. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6697. }
  6698. var n = {}
  6699. , r = new Le.GUI({
  6700. autoPlace: !0,
  6701. width: "60%"
  6702. });
  6703. i(),
  6704. t.on(xe.ViewChanged, i),
  6705. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6706. r.domElement.id = "datLinks";
  6707. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6708. return o.forEach(function(e) {
  6709. if (!K.detectSafari()) {
  6710. var t = document.createElement("button");
  6711. t.classList.add("btn-deep-link"),
  6712. t.innerText = Re.MENU_COPY,
  6713. e.nextSibling.appendChild(t);
  6714. var i = function() {
  6715. alert(Re.LINK_ALERT_COPY),
  6716. t.hide()
  6717. };
  6718. t.addEventListener("click", function(e) {
  6719. try {
  6720. var t = e.target.parentNode.childNodes[0];
  6721. t.select();
  6722. var n = document.execCommand("copy");
  6723. t.blur(),
  6724. n || i()
  6725. } catch (e) {
  6726. i()
  6727. }
  6728. })
  6729. }
  6730. }),
  6731. $(r.__closeButton).hide(),
  6732. r
  6733. }
  6734. function N(e) {
  6735. He.gui || (He.gui = D(He.model, He.player)),
  6736. He.visible = e,
  6737. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6738. }
  6739. function B() {
  6740. N(!He.visible)
  6741. }
  6742. function F(e) {
  6743. ke = {
  6744. gui: null,
  6745. visible: !1,
  6746. model: e
  6747. }
  6748. }
  6749. function V(e) {
  6750. var t = new Le.GUI;
  6751. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6752. e.setSweepVisibility(Q.showSweeps)
  6753. }),
  6754. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6755. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6756. Q.transition.flySpeed = 0,
  6757. t.__controllers.forEach(function(e) {
  6758. e.updateDisplay()
  6759. })
  6760. }),
  6761. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6762. $(t.__closeButton).hide(),
  6763. t
  6764. }
  6765. function U(e) {
  6766. ke.gui || (ke.gui = V(ke.model)),
  6767. ke.visible = e,
  6768. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6769. }
  6770. function k() {
  6771. U(!ke.visible)
  6772. }
  6773. function H() {
  6774. function e(e) {
  6775. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target) || e.preventDefault()
  6776. }
  6777. $("body").css("touch-action", "none"),
  6778. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6779. e.preventDefault()
  6780. });
  6781. var t = document.getElementById("terms-text")
  6782. , i = document.getElementById("more-help-wrapper")
  6783. , n = (document.getElementById("navigation-help-wrapper"),
  6784. document.getElementById("help-dialog"),
  6785. document.getElementById("tag-billboards"));
  6786. Q.useWheel && (document.body.addEventListener("mousewheel", e),
  6787. document.body.addEventListener("DOMMouseScroll", e)),
  6788. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6789. e.stopPropagation()
  6790. })
  6791. }
  6792. function G(e, t) {
  6793. for (var i = []; e; )
  6794. i.push(e),
  6795. e = e.parentNode;
  6796. for (; t && i.indexOf(t) === -1; )
  6797. t = t.parentNode;
  6798. return t
  6799. }
  6800. function z() {
  6801. var e, t = function(t) {
  6802. e = 0 === t.button || 1 === t.which ? t.target : null
  6803. }, i = function(t) {
  6804. e !== t.target && (e = G(e, t.target));
  6805. var i = document.getElementById("gui-parent");
  6806. if (G(i, e) !== i && (e = null),
  6807. e) {
  6808. var n;
  6809. try {
  6810. n = new MouseEvent("click",t)
  6811. } catch (e) {
  6812. n = document.createEvent("MouseEvents"),
  6813. n.initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6814. }
  6815. n.syntheticClick = !0,
  6816. e.dispatchEvent(n),
  6817. e = null
  6818. }
  6819. };
  6820. document.body.addEventListener("mousedown", t, !0),
  6821. document.body.addEventListener("mouseup", i, !0),
  6822. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6823. e.syntheticClick || (e.stopPropagation(),
  6824. "A" === e.target.nodeName && e.preventDefault())
  6825. }, !0)
  6826. }
  6827. var W, j, Y, X, Z, q, K = (e("three"),
  6828. e("../util/ajax"),
  6829. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6830. e("../util/camera"),
  6831. e("../util/logger")), te = (e("../objects/Snapshot"),
  6832. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  6833. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6834. e("../enum/PathDisplayMode"),
  6835. e("../enum/DirectorEvents"),
  6836. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6837. e("../enum/WarpStyle"),
  6838. e("../enum/AlignmentType"),
  6839. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6840. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6841. coBrand: {
  6842. visible: !0,
  6843. elements: [".co-brand", "#loaderCoBrand"]
  6844. },
  6845. help: {
  6846. visible: !0,
  6847. elements: [".nav-help", "#nav-help"]
  6848. },
  6849. tourControls: {
  6850. visible: !0,
  6851. elements: [".next", ".previous", "#play"]
  6852. },
  6853. highlight: {
  6854. visible: !0,
  6855. elements: ["#drawer", "#pullTab"]
  6856. },
  6857. share: {
  6858. visible: !0,
  6859. elements: [".socialButton", "#share"]
  6860. },
  6861. fullScreen: {
  6862. visible: !0,
  6863. elements: ["#gui-fullscreen"]
  6864. },
  6865. floors: {
  6866. visible: !0,
  6867. elements: [".gui-floor"]
  6868. }
  6869. }, Ye = function() {
  6870. var e = document.getElementById("drawer");
  6871. return function() {
  6872. window.innerHeight < 400 && e.classList.contains("open") && a()
  6873. }
  6874. }(), Xe = function() {
  6875. var e = document.getElementById("meta-info");
  6876. return function() {
  6877. window.innerHeight < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  6878. }
  6879. }(), Ze = function(e) {
  6880. function t() {
  6881. u.classList.contains("expand") && de.toggleMeta(!0)
  6882. }
  6883. function i() {
  6884. fe.hide()
  6885. }
  6886. function n() {
  6887. he.close()
  6888. }
  6889. function r() {
  6890. Ae.dismiss()
  6891. }
  6892. function o() {
  6893. p.hasClass("open") && a(!0)
  6894. }
  6895. function l() {
  6896. Ce.hide()
  6897. }
  6898. function c() {
  6899. f.hasClass("open") && f.removeClass("open")
  6900. }
  6901. function h() {
  6902. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  6903. }
  6904. var u = document.getElementById("meta-info")
  6905. , d = document.getElementById("interaction-modal")
  6906. , p = $("#drawer").eq(0)
  6907. , f = $(".gui-floor").eq(0)
  6908. , g = $(".vr-popup").eq(0);
  6909. return function(e) {
  6910. switch (e) {
  6911. case "info":
  6912. i(),
  6913. n(),
  6914. Ye(),
  6915. l(),
  6916. c(),
  6917. r(),
  6918. h();
  6919. break;
  6920. case "terms":
  6921. t(),
  6922. n(),
  6923. o(),
  6924. l(),
  6925. c(),
  6926. r(),
  6927. h();
  6928. break;
  6929. case "help":
  6930. t(),
  6931. i(),
  6932. l(),
  6933. c(),
  6934. r(),
  6935. h();
  6936. break;
  6937. case "vr":
  6938. t(),
  6939. i(),
  6940. l(),
  6941. c(),
  6942. n(),
  6943. h(),
  6944. s(g) && o();
  6945. break;
  6946. case "highlights":
  6947. Xe(),
  6948. i(),
  6949. l(),
  6950. c();
  6951. break;
  6952. case "share":
  6953. t(),
  6954. i(),
  6955. n(),
  6956. c(),
  6957. r(),
  6958. h();
  6959. break;
  6960. case "floor":
  6961. i(),
  6962. l(),
  6963. r();
  6964. break;
  6965. case "view":
  6966. c(),
  6967. l(),
  6968. i(),
  6969. r();
  6970. break;
  6971. case "tour":
  6972. i(),
  6973. l(),
  6974. c(),
  6975. r();
  6976. break;
  6977. case "move":
  6978. i(),
  6979. l(),
  6980. c(),
  6981. r();
  6982. break;
  6983. case "resize":
  6984. t(),
  6985. Ye(),
  6986. c();
  6987. break;
  6988. case "tag":
  6989. i(),
  6990. n(),
  6991. l(),
  6992. c(),
  6993. r()
  6994. }
  6995. }
  6996. }();
  6997. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6998. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  6999. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7000. setTimeout(function() {
  7001. $(".icon:visible").hide().show(0)
  7002. }, 100)
  7003. }),
  7004. $("#gui-fullscreen").find("a").on("click", function(e) {
  7005. l(e),
  7006. K.requestFullscreen($("body")[0]),
  7007. J.track("showcase_gui", {
  7008. gui_action: "click_enter_fullscreen",
  7009. interaction_source: "gui"
  7010. }),
  7011. W.reload()
  7012. }),
  7013. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7014. l(e),
  7015. K.exitFullscreen(),
  7016. J.track("showcase_gui", {
  7017. gui_action: "click_exit_fullscreen",
  7018. interaction_source: "gui"
  7019. })
  7020. }),
  7021. $(window).on("resize", function(e) {
  7022. var t = e.target.innerHeight
  7023. , i = e.target.innerWidth;
  7024. t === X && i === Z || (je.highlight.visible && w(),
  7025. Ze("resize"),
  7026. $(".pinTop.right").removeClass("hideUnderMeta"),
  7027. c(),
  7028. X = t,
  7029. Z = i)
  7030. }).resize(),
  7031. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7032. $("#pullTab").on("click", function(e) {
  7033. l(e),
  7034. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7035. gui_action: "hide_highlight_reel"
  7036. }),
  7037. $(this).addClass("open")) : (J.trackAlways("showcase_gui", {
  7038. gui_action: "show_highlight_reel"
  7039. }),
  7040. $(this).removeClass("open")),
  7041. a()
  7042. }),
  7043. $("#more-menu-button").on("click", function(e) {
  7044. l(e);
  7045. var t = $("#more-menu");
  7046. t.toggleClass("open")
  7047. }),
  7048. t.exports.init = S,
  7049. t.exports.startLoading = x,
  7050. t.exports.endLoading = d,
  7051. t.exports.onProgress = u
  7052. }
  7053. ).call(this, "/js/gui/gui.js")
  7054. }
  7055. , {
  7056. "../analytics": 4,
  7057. "../controls/serializer": 14,
  7058. "../enum/AlignmentType": 17,
  7059. "../enum/BlackoutStyle": 18,
  7060. "../enum/ControlEvents": 21,
  7061. "../enum/DirectorEvents": 23,
  7062. "../enum/Keys": 30,
  7063. "../enum/PathDiscardMode": 38,
  7064. "../enum/PathDisplayMode": 39,
  7065. "../enum/PlayerEvents": 40,
  7066. "../enum/VROption": 47,
  7067. "../enum/Vectors": 50,
  7068. "../enum/Viewmode": 51,
  7069. "../enum/WarpStyle": 52,
  7070. "../enum/ZoomEvents": 53,
  7071. "../lib/dat.gui": 93,
  7072. "../localization/localize": 108,
  7073. "../tag/Media/MediaEvent": 131,
  7074. "../objects/Snapshot": 153,
  7075. "../settings": 166,
  7076. "../util/ajax": 181,
  7077. "../util/browser": 182,
  7078. "../util/camera": 183,
  7079. "../util/logger": 189,
  7080. "../util/showcase": 193,
  7081. "../util/transitions": 195,
  7082. "./closer/ModalCloserEvent": 61,
  7083. "./closer/modalCloser": 62,
  7084. "./help/HelpEvent": 66,
  7085. "./help/help": 67,
  7086. "./helpManager": 68,
  7087. "./immersiveMode": 69,
  7088. "./konami": 70,
  7089. "./landingScreen": 71,
  7090. "./loadingScreen": 72,
  7091. "./memoryUsage": 73,
  7092. "./playButton": 74,
  7093. "./populateModal": 75,
  7094. "./sharing/ShareEvents": 76,
  7095. "./sharing/modal": 77,
  7096. "./terms/TermsEvent": 78,
  7097. "./terms/terms": 79,
  7098. "./title/TitleEvents": 80,
  7099. "./title/tagToggle": 81,
  7100. "./title/titleBar": 82,
  7101. "./tourInteraction": 84,
  7102. "./vr/vrEvent": 85,
  7103. "./vr/vrModal": 87,
  7104. "./webvr/WebVrEvent": 88,
  7105. "./webvr/webVRgui": 89,
  7106. three: 217
  7107. }],
  7108. 66: [function(e, t, i) {//"./help/HelpEvent"
  7109. "use strict";
  7110. t.exports = Object.freeze({
  7111. OPENED: "help.opened",
  7112. CLOSED: "help.closed"
  7113. })
  7114. }
  7115. , {}],
  7116. 67: [function(e, t, i) {//"./help/help"
  7117. "use strict";
  7118. function n() {
  7119. g.on("click", function(e) {
  7120. if (S && S !== l.TRANSITIONING) {
  7121. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7122. t && !M ? R.close() : r()
  7123. }
  7124. }),
  7125. w.on("click", function(e) {
  7126. R.close()
  7127. }),
  7128. E.on("click", function(e) {
  7129. S && S !== l.TRANSITIONING && (s(),
  7130. o())
  7131. }),
  7132. b.on("click", function(e) {
  7133. s(),
  7134. a()
  7135. })
  7136. }
  7137. function r() {
  7138. S && S !== l.TRANSITIONING && (M = !0,
  7139. setTimeout(function() {
  7140. M = !1
  7141. }, d.help.modalStayDuration),
  7142. R.emit(h.OPENED),
  7143. m.addClass("open " + S),
  7144. g.addClass("open"),
  7145. s(),
  7146. o(),
  7147. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7148. y.classList.add("fadeIn"))
  7149. }
  7150. function o() {
  7151. E.addClass("underline-tab"),
  7152. u.fill(_, c.NAVIGATION, S),
  7153. m.addClass(S)
  7154. }
  7155. function a() {
  7156. b.addClass("underline-tab"),
  7157. u.fill(T, c.MORE_HELP),
  7158. m.addClass("more-help")
  7159. }
  7160. function s(e, t) {
  7161. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7162. I.forEach(function(e) {
  7163. e.classList.remove("underline-tab")
  7164. })
  7165. }
  7166. var l = e("../../enum/Viewmode")
  7167. , c = e("../../enum/HelpModalType")
  7168. , h = e("./HelpEvent")
  7169. , u = (e("../helpManager"),
  7170. e("./../populateModal"))
  7171. , d = e("../../settings")
  7172. , p = e("../../util/common")
  7173. , f = e("events").EventEmitter
  7174. , g = $(".footer-help").eq(0)
  7175. , m = $("#help-dialog").eq(0)
  7176. , v = document.querySelector("#quick-logo")
  7177. , A = document.querySelector("#loaderCoBrand")
  7178. , y = document.querySelector("#help-dialog")
  7179. , C = document.querySelector(".footer")
  7180. , I = $(".help-tabs").children().toArray()
  7181. , E = $(".navigation-tab").eq(0)
  7182. , b = $(".more-help-tab").eq(0)
  7183. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7184. m.find(".close").eq(0))
  7185. , _ = m.find(".interactions").toArray()
  7186. , T = m.find(".ui-instructions").toArray()
  7187. , x = l.PANORAMA
  7188. , S = l.PANORAMA
  7189. , M = !1
  7190. , R = {
  7191. init: function(e, t) {
  7192. S = t,
  7193. x = t,
  7194. [y, A, v, C].forEach(function(e) {
  7195. e.classList.add(u.deviceType)
  7196. }),
  7197. n()
  7198. },
  7199. close: function() {
  7200. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7201. g.removeClass("open"),
  7202. m.removeClass("open"),
  7203. y.classList.contains("fadeIn"))) {
  7204. y.classList.remove("fadeIn");
  7205. var e = S === l.TRANSITIONING ? x : S;
  7206. u.clear(_, c.NAVIGATION, e)
  7207. }
  7208. },
  7209. updateMode: function(e) {
  7210. x = S,
  7211. S = e
  7212. }
  7213. };
  7214. p.extendObject(R, f.prototype),
  7215. t.exports = R
  7216. }
  7217. , {
  7218. "../../enum/HelpModalType": 28,
  7219. "../../enum/Viewmode": 51,
  7220. "../../settings": 166,
  7221. "../../util/common": 185,
  7222. "../helpManager": 68,
  7223. "./../populateModal": 75,
  7224. "./HelpEvent": 66,
  7225. events: 202
  7226. }],
  7227. 68: [function(e, t, i) {///js/gui/helpManager.js
  7228. (function(i) {
  7229. "use strict";
  7230. var n = e("../util/browser")
  7231. , r = e("./../util/logger")
  7232. , o = e("./../settings")
  7233. , a = new r(i)
  7234. , s = function() {
  7235. var e;
  7236. try {
  7237. return e = window.localStorage.getItem("visitCount") || "0",
  7238. e = (parseFloat(e) + 1).toString(),
  7239. window.localStorage.setItem("visitCount", e),
  7240. a.debug("visitCount = " + e),
  7241. e
  7242. } catch (t) {
  7243. e = "1",
  7244. a.debug("couldn't set local storage")
  7245. }
  7246. }()
  7247. , l = !1;
  7248. t.exports = {
  7249. isHelpDisabled: function() {
  7250. return "0" === n.valueFromHash("help", null) || l
  7251. },
  7252. isLargeHelpEnabled: function() {
  7253. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7254. },
  7255. isSmallHelpEnabled: function() {
  7256. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7257. },
  7258. isHelpEnabled: function() {
  7259. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7260. },
  7261. setAutoPlay: function(e) {
  7262. l = o.warp.auto >= 0 && e > 1
  7263. }
  7264. }
  7265. }
  7266. ).call(this, "/js/gui/helpManager.js")
  7267. }
  7268. , {
  7269. "../util/browser": 182,
  7270. "./../settings": 166,
  7271. "./../util/logger": 189
  7272. }],
  7273. 69: [function(e, t, i) {//"./immersiveMode"
  7274. "use strict";
  7275. function n(e, t, i, n) {
  7276. F = n,
  7277. r(e, t, i, F),
  7278. o(),
  7279. N = t.mode
  7280. }
  7281. function r(e, t, i, n) {
  7282. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7283. e.controls[t].on(v.Move, a),
  7284. e.controls[t].on(v.LongTap, c)
  7285. }),
  7286. M.on("mousewheel DOMMouseScroll", a),
  7287. i.on(m.TagActivated, a),
  7288. i.on(m.TagNavigation, a),
  7289. t.on(A.FlyingEnded, s),
  7290. t.on(A.ModeChanging, function(e, t) {
  7291. B = t !== C.PANORAMA && e !== C.PANORAMA
  7292. }),
  7293. t.on(A.ModeChanged, function(e, i) {
  7294. N = t.mode,
  7295. i !== C.TRANSITIONING ? l() : a("modeChange")
  7296. }),
  7297. n.on(y.TourStart, function() {
  7298. L = !0,
  7299. a()
  7300. }),
  7301. n.on(y.TourEnd, function() {
  7302. L = !1,
  7303. l()
  7304. }),
  7305. n.on(y.ActionInterrupted, function() {
  7306. L = !1
  7307. }),
  7308. R.addEventListener("touchend", function() {
  7309. $("#pullTab").hasClass("opened") && !L && l()
  7310. }, !0)
  7311. }
  7312. function o() {
  7313. p.isMobile() ? (b.forEach(function(e) {
  7314. e.classList.add("mobile")
  7315. }),
  7316. w.click(l)) : (b.forEach(function(e) {
  7317. e.addEventListener("mouseleave", function() {
  7318. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7319. }, !0)
  7320. }),
  7321. M.mouseleave(function() {
  7322. b[0].classList.contains("detectHover") && l()
  7323. }))
  7324. }
  7325. function a(e) {
  7326. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7327. P = !0,
  7328. g.close(),
  7329. h(e),
  7330. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) || S.addClass("fadeOut"),
  7331. _.hasClass("playing") || (b.forEach(function(e) {
  7332. e.classList.add("detectHover")
  7333. }),
  7334. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7335. }
  7336. function s() {
  7337. _.hasClass("playing") || (clearTimeout(O),
  7338. O = setTimeout(l, f.immersive.timeToShowAgain))
  7339. }
  7340. function l() {
  7341. clearTimeout(O),
  7342. P = !1,
  7343. I.forEach(function(e) {
  7344. e.classList.remove("fadeOut"),
  7345. e.classList.remove("drawerOpen")
  7346. }),
  7347. L || E.forEach(function(e) {
  7348. e.classList.remove("duringTour")
  7349. }),
  7350. b.forEach(function(e) {
  7351. e.classList.remove("detectHover")
  7352. })
  7353. }
  7354. function c() {
  7355. P ? l() : a(),
  7356. D = !0,
  7357. setTimeout(function() {
  7358. D = !1
  7359. }, f.immersive.uiStayDuration)
  7360. }
  7361. function h(e) {
  7362. !d(e) && L ? E.forEach(function(e) {
  7363. e.classList.remove("drawerOpen"),
  7364. e.classList.add("duringTour")
  7365. }) : _.hasClass("open") ? E.forEach(function(e) {
  7366. e.classList.remove("duringTour"),
  7367. e.classList.add("drawerOpen")
  7368. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7369. e.classList.add("fadeOut")
  7370. })
  7371. }
  7372. function u() {
  7373. T.hasClass("duringTour") || (L = !1,
  7374. a("gui"),
  7375. l())
  7376. }
  7377. function d(e) {
  7378. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7379. }
  7380. var p = e("../util/browser")
  7381. , f = e("../settings")
  7382. , g = e("./help/help")
  7383. , m = e("../enum/tagEvents")
  7384. , v = e("../enum/ControlEvents")
  7385. , A = e("../enum/PlayerEvents")
  7386. , y = e("../enum/DirectorEvents")
  7387. , A = e("../enum/PlayerEvents")
  7388. , C = e("../enum/Viewmode")
  7389. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7390. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7391. , b = $("#hover-bottom, #hover-top").toArray()
  7392. , w = ($("#pullTab").eq(0),
  7393. $("#playHead").eq(0),
  7394. $(".pinBottom-container").eq(0))
  7395. , _ = $("#drawer").eq(0)
  7396. , T = $("#drawer-container").eq(0)
  7397. , x = $("#meta-info").eq(0)
  7398. , S = $(".pinTop.left").eq(0)
  7399. , M = $("#player").eq(0)
  7400. , R = document.getElementById("pullTab")
  7401. , P = !1
  7402. , O = null
  7403. , L = !1
  7404. , D = !1
  7405. , N = null
  7406. , B = !1
  7407. , F = null;
  7408. t.exports.init = n,
  7409. t.exports.hideUi = a,
  7410. t.exports.resetDrawer = u
  7411. }
  7412. , {
  7413. "../enum/ControlEvents": 21,
  7414. "../enum/DirectorEvents": 23,
  7415. "../enum/tagEvents": 32,
  7416. "../enum/PlayerEvents": 40,
  7417. "../enum/Viewmode": 51,
  7418. "../settings": 166,
  7419. "../util/browser": 182,
  7420. "./help/help": 67
  7421. }],
  7422. 70: [function(e, t, i) {///js/gui/konami.js
  7423. (function(i) {
  7424. "use strict";
  7425. function n(e, t, i) {
  7426. l.debug("konami has the modelInstance");
  7427. var n = [];
  7428. $(window).on("keydown", function(e) {
  7429. n.push(e.which),
  7430. n.length > o.secretPanelWord.length && n.shift(),
  7431. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7432. o.debug = !0)
  7433. }),
  7434. $(window).on("keydown", function n(r) {
  7435. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7436. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7437. })
  7438. }
  7439. var r = e("./../util/logger")
  7440. , o = e("./../settings")
  7441. , a = e("./debug")
  7442. , s = e("./../util/common")
  7443. , l = (e("./gui"),
  7444. new r(i));
  7445. o.console && $("body").append('<div id="debug-console"></div>'),
  7446. t.exports.init = n
  7447. }
  7448. ).call(this, "/js/gui/konami.js")
  7449. }
  7450. , {
  7451. "./../settings": 166,
  7452. "./../util/common": 185,
  7453. "./../util/logger": 189,
  7454. "./debug": 63,
  7455. "./gui": 65
  7456. }],
  7457. 71: [function(e, t, i) {//"./landingScreen"
  7458. "use strict";
  7459. function n(e, t) {
  7460. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7461. }
  7462. function r(e) {
  7463. var t = $.Deferred();
  7464. e || t.resolve();
  7465. var i = c.startupFlyinDelay;
  7466. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7467. setTimeout(t.resolve.bind(t), i),
  7468. t
  7469. }
  7470. function o(e, t, i) {
  7471. var n = 0;
  7472. c.quickstart.enabled && (a(i),
  7473. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7474. var r = function() {
  7475. e.once(g.Move, l),
  7476. t.once(f.TourStart, l)
  7477. };
  7478. s(n, r)
  7479. }
  7480. function a(e) {
  7481. return e && (y.addClass("quick-brand"),
  7482. v.before(y),
  7483. A = $(".quick-brand").toArray()),
  7484. m.addClass("fadeOut"),
  7485. setTimeout(function() {
  7486. A.forEach(function(e) {
  7487. e.classList.add("fadeIn")
  7488. })
  7489. }, c.quickstart.showTextDelay),
  7490. setTimeout(function() {
  7491. A.forEach(function(e) {
  7492. e.classList.add("fadeOut")
  7493. })
  7494. }, c.quickstart.fadeOutDelay),
  7495. !0
  7496. }
  7497. function s(e, t) {
  7498. setTimeout(function() {
  7499. if (h.isHelpEnabled()) {
  7500. if (t(),
  7501. u.init(),
  7502. C.addClass("fadeIn landing " + u.deviceType),
  7503. h.isSmallHelpEnabled())
  7504. return void C.addClass("small");
  7505. u.fill(I, d.LANDING[E]),
  7506. C.addClass(E)
  7507. }
  7508. }, e)
  7509. }
  7510. function l() {
  7511. u.clear(I, d.LANDING[E]),
  7512. C.removeClass("fadeIn")
  7513. }
  7514. var c = e("../settings")
  7515. , h = (e("./help/help"),
  7516. e("./helpManager"))
  7517. , u = e("./populateModal")
  7518. , d = e("../enum/HelpModalType")
  7519. , p = e("../enum/Viewmode")
  7520. , f = e("../enum/DirectorEvents")
  7521. , g = e("../enum/PlayerEvents")
  7522. , m = $("#quick-blackout").eq(0)
  7523. , v = $("#quick-logo").eq(0)
  7524. , A = $(".quick-brand").toArray()
  7525. , y = $("#loaderCoBrand").eq(0)
  7526. , C = $("#interaction-modal").eq(0)
  7527. , I = C.find(".interaction").toArray()
  7528. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7529. "");
  7530. t.exports.delayLanding = r,
  7531. t.exports.showMessage = o,
  7532. t.exports.init = n,
  7533. t.exports.dismissModal = l
  7534. }
  7535. , {
  7536. "../enum/DirectorEvents": 23,
  7537. "../enum/HelpModalType": 28,
  7538. "../enum/PlayerEvents": 40,
  7539. "../enum/Viewmode": 51,
  7540. "../settings": 166,
  7541. "./help/help": 67,
  7542. "./helpManager": 68,
  7543. "./populateModal": 75
  7544. }],
  7545. 72: [function(e, t, i) {//"./loadingScreen"
  7546. "use strict";
  7547. var n = e("./circleLoader").circleLoader;
  7548. t.exports = {
  7549. element: $("#gui-loading"),
  7550. hide: function(e) {
  7551. n.done(),
  7552. this.element.fadeOut(2500, e)
  7553. },
  7554. show: function(e) {
  7555. this.element.fadeIn(500, function() {
  7556. this.element.css("display", "table"),
  7557. e && e()
  7558. }
  7559. .bind(this))
  7560. },
  7561. progress: function(e) {
  7562. n.set(e)
  7563. }
  7564. }
  7565. }
  7566. , {
  7567. "./circleLoader": 60
  7568. }],
  7569. 73: [function(e, t, i) {//./memoryUsage
  7570. "use strict";
  7571. var n = e("../settings")
  7572. , r = $("#memory-info")
  7573. , o = r.find("#memory-gpu")
  7574. , a = !1;
  7575. t.exports = {
  7576. show: function() {
  7577. n.profiling.enabled && (r.show(),
  7578. a = !0)
  7579. },
  7580. hide: function() {
  7581. r.hide(),
  7582. a = !1
  7583. },
  7584. toggle: function() {
  7585. a ? this.hide() : this.show()
  7586. },
  7587. update: function(e) {
  7588. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7589. }
  7590. }
  7591. }
  7592. , {
  7593. "../settings": 166
  7594. }],
  7595. 74: [function(e, t, i) {//./playButton
  7596. "use strict";
  7597. var n = e("../util/browser")
  7598. , r = e("../analytics");
  7599. e("../settings");
  7600. t.exports = {
  7601. show: function(e, t) {
  7602. $("#gui-message").fadeIn(250, function() {
  7603. $(this).css("display", "table");
  7604. var e = $("#gui-message").fracs().visible >= .5;
  7605. r.impression({
  7606. visible: e,
  7607. immediate: !0
  7608. })
  7609. }),
  7610. e && $("#quick-blackout").addClass("fadeOut"),
  7611. $("#button-play").on("click", function(i) {
  7612. return n.inIframe() && n.isMobile() ? n.valueFromHash("nt", !1) ? window.open(self.location.href, "_blank") : void (top.location.href = self.location.href) : e ? (i.stopPropagation(),
  7613. $("#quick-blackout").removeClass("fadeOut"),
  7614. $("#gui-message").hide(),
  7615. void t()) : void $("#gui-message").fadeOut(500, function() {
  7616. t()
  7617. })
  7618. })
  7619. }
  7620. }
  7621. }
  7622. , {
  7623. "../analytics": 4,
  7624. "../settings": 166,
  7625. "../util/browser": 182
  7626. }],
  7627. 75: [function(e, t, i) {//"./populateModal"
  7628. "use strict";
  7629. function n(e, t, i, n) {
  7630. function r(e) {
  7631. return e.classList.contains(a)
  7632. }
  7633. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7634. for (var a in o) {
  7635. var s = e.find(r);
  7636. for (var l in o[a]) {
  7637. var c = o[a][l];
  7638. if ("top-info" === l || "bottom-info" === l) {
  7639. var h = n ? c : "";
  7640. s.querySelector("." + l).textContent = h
  7641. } else {
  7642. var u = n ? c : ""
  7643. , d = s.querySelector("." + l);
  7644. d.src = u,
  7645. n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7646. }
  7647. }
  7648. }
  7649. var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7650. p.forEach(function(e) {
  7651. n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7652. })
  7653. }
  7654. var r = e("../util/browser")
  7655. , o = e("../localization/localize")
  7656. , a = e("../enum/HelpModalType")
  7657. , s = (e("../enum/HelpModalSize"),
  7658. e("../enum/Viewmode"));
  7659. t.exports = {
  7660. init: function() {
  7661. if (!this.hasInitialized) {
  7662. this.hasInitialized = !0,
  7663. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7664. this.assets = {},
  7665. this.assets[a.LANDING[s.PANORAMA]] = {
  7666. desktop: {
  7667. left: {
  7668. "top-info": o.ROTATE,
  7669. "big-image": "images/nav_help_mouse_drag_left.png",
  7670. keyboard: "images/nav_help_keyboard_left_right.png"
  7671. },
  7672. middle: {
  7673. "top-info": o.MOVE,
  7674. "big-image": "images/nav_help_mouse_click.png",
  7675. keyboard: "images/nav_help_keyboard_up_down.png"
  7676. },
  7677. right: {
  7678. "top-info": o.ZOOM,
  7679. "big-image": "images/nav_help_mouse_zoom.png",
  7680. keyboard: "images/nav_help_zoom_keys.png"
  7681. }
  7682. },
  7683. mobile: {
  7684. left: {
  7685. "top-info": o.ROTATE,
  7686. "big-image": "images/nav_help_gesture_drag.png"
  7687. },
  7688. middle: {
  7689. "top-info": o.MOVE,
  7690. "big-image": "images/nav_help_gesture_tap.png"
  7691. },
  7692. right: {
  7693. "top-info": o.ZOOM,
  7694. "big-image": "images/nav_help_gesture_pinch.png"
  7695. }
  7696. }
  7697. },
  7698. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7699. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7700. desktop: {
  7701. left: {
  7702. "top-info": o.ROTATE,
  7703. "big-image": "images/nav_help_mouse_drag_left.png",
  7704. keyboard: "images/nav_help_keyboard_left_right.png"
  7705. },
  7706. middle: {
  7707. "top-info": o.MOVE,
  7708. "big-image": "images/nav_help_mouse_position_right.png"
  7709. }
  7710. },
  7711. mobile: {
  7712. left: {
  7713. "top-info": o.ROTATE,
  7714. "big-image": "images/nav_help_gesture_drag.png"
  7715. },
  7716. middle: {
  7717. "top-info": o.MOVE,
  7718. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7719. }
  7720. }
  7721. },
  7722. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7723. desktop: {
  7724. left: {
  7725. "top-info": o.MOVE,
  7726. "big-image": "images/nav_help_mouse_position_left.png"
  7727. },
  7728. middle: {
  7729. "top-info": o.ROTATE,
  7730. "big-image": "images/nav_help_mouse_drag_right.png",
  7731. keyboard: "images/nav_help_keyboard_left_right.png"
  7732. }
  7733. },
  7734. mobile: {
  7735. left: {
  7736. "top-info": o.MOVE,
  7737. "big-image": "images/nav_help_gesture_position.png"
  7738. },
  7739. middle: {
  7740. "top-info": o.ROTATE,
  7741. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7742. }
  7743. }
  7744. };
  7745. var e = {
  7746. "top-info": o.INSIDE,
  7747. "big-image": "images/nav_help_click_inside.png",
  7748. keyboard: "images/nav_help_inside_key.png"
  7749. };
  7750. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7751. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7752. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7753. var t = {
  7754. "top-info": o.INSIDE,
  7755. "big-image": "images/nav_help_tap_inside.png"
  7756. };
  7757. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7758. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7759. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7760. this.assets[a.NAVIGATION] = {},
  7761. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7762. desktop: {
  7763. left: {
  7764. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7765. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7766. "big-image": "images/nav_help_mouse_drag_left.png",
  7767. keyboard: "images/nav_help_keyboard_left_right.png"
  7768. },
  7769. middle: {
  7770. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7771. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7772. "big-image": "images/nav_help_mouse_click.png",
  7773. keyboard: "images/nav_help_keyboard_up_down.png"
  7774. },
  7775. right: {
  7776. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7777. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7778. "big-image": "images/nav_help_mouse_zoom.png",
  7779. keyboard: "images/nav_help_zoom_keys.png"
  7780. }
  7781. },
  7782. mobile: {
  7783. left: {
  7784. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7785. "big-image": "images/nav_help_gesture_drag.png"
  7786. },
  7787. middle: {
  7788. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7789. "big-image": "images/nav_help_gesture_tap.png"
  7790. },
  7791. right: {
  7792. "top-info": o.HELP_MOBILE_3,
  7793. "big-image": "images/nav_help_gesture_pinch.png"
  7794. }
  7795. }
  7796. },
  7797. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7798. desktop: {
  7799. left: {
  7800. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7801. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7802. "big-image": "images/nav_help_mouse_drag_left.png",
  7803. keyboard: "images/nav_help_keyboard_all.png"
  7804. },
  7805. middle: {
  7806. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7807. "big-image": "images/nav_help_mouse_position_right.png"
  7808. },
  7809. right: {
  7810. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7811. "big-image": "images/nav_help_mouse_zoom.png"
  7812. }
  7813. },
  7814. mobile: {
  7815. left: {
  7816. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7817. "big-image": "images/nav_help_gesture_drag.png"
  7818. },
  7819. middle: {
  7820. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7821. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7822. },
  7823. right: {
  7824. "top-info": o.HELP_MOBILE_3,
  7825. "big-image": "images/nav_help_gesture_pinch.png"
  7826. }
  7827. }
  7828. },
  7829. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7830. desktop: {
  7831. left: {
  7832. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7833. "big-image": "images/nav_help_mouse_position_left.png"
  7834. },
  7835. middle: {
  7836. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7837. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7838. "big-image": "images/nav_help_mouse_drag_right.png",
  7839. keyboard: "images/nav_help_keyboard_left_right.png"
  7840. },
  7841. right: {
  7842. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7843. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7844. "big-image": "images/nav_help_mouse_zoom.png",
  7845. keyboard: "images/nav_help_keyboard_up_down.png"
  7846. }
  7847. },
  7848. mobile: {
  7849. left: {
  7850. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7851. "big-image": "images/nav_help_gesture_position.png"
  7852. },
  7853. middle: {
  7854. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7855. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7856. },
  7857. right: {
  7858. "top-info": o.HELP_MOBILE_3,
  7859. "big-image": "images/nav_help_gesture_pinch.png"
  7860. }
  7861. }
  7862. },
  7863. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7864. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7865. "top-info": o.HELP_DESKTOP_360_2A,
  7866. "bottom-info": o.HELP_DESKTOP_360_2B,
  7867. "big-image": "images/nav_help_click_inside.png",
  7868. keyboard: "images/nav_help_inside_key.png"
  7869. },
  7870. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7871. "top-info": o.HELP_MOBILE_360_2,
  7872. "big-image": "images/nav_help_tap_inside.png"
  7873. },
  7874. this.assets[a.MORE_HELP] = {
  7875. desktop: {
  7876. "more-help-hlr": {
  7877. "top-info": o.HELP_MORE_HLR_A,
  7878. "big-image": "images/nav_help_expand.svg",
  7879. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7880. },
  7881. "more-help-dollhouse": {
  7882. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7883. "big-image": "images/nav_help_dollhouse.svg",
  7884. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7885. },
  7886. "more-help-floors": {
  7887. "top-info": o.HELP_MORE_FLOORS_A,
  7888. "big-image": "images/nav_help_floor picker.svg",
  7889. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7890. },
  7891. "more-help-tag": {
  7892. "top-info": o.HELP_MORE_TAG_A,
  7893. "big-image": "images/nav_help_tag.svg",
  7894. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7895. },
  7896. "more-help-zoom": {
  7897. "top-info": o.HELP_MORE_ZOOM_A,
  7898. "big-image": "images/nav_help_zoom.svg",
  7899. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7900. },
  7901. "more-help-tour": {
  7902. "top-info": o.HELP_MORE_TOUR_A,
  7903. "big-image": "images/nav_help_play.png",
  7904. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7905. },
  7906. "more-help-inside": {
  7907. "top-info": o.HELP_MORE_INSIDE_A,
  7908. "big-image": "images/nav_help_inside.svg",
  7909. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7910. },
  7911. "more-help-vr": {
  7912. "top-info": o.HELP_MORE_VR_A,
  7913. "big-image": "images/nav_help_vr.svg",
  7914. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7915. },
  7916. "more-help-360": {
  7917. "top-info": o.HELP_MORE_360_A,
  7918. "big-image": "images/nav_help_360.svg",
  7919. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7920. },
  7921. "more-help-fullscreen": {
  7922. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7923. "big-image": "images/nav_help_fullscreen.svg",
  7924. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7925. }
  7926. },
  7927. mobile: {
  7928. "more-help-hlr": {
  7929. "top-info": o.HELP_MORE_HLR_A,
  7930. "big-image": "images/nav_help_expand.svg",
  7931. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7932. },
  7933. "more-help-dollhouse": {
  7934. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7935. "big-image": "images/nav_help_dollhouse.svg",
  7936. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7937. },
  7938. "more-help-floors": {
  7939. "top-info": o.HELP_MORE_FLOORS_A,
  7940. "big-image": "images/nav_help_floor picker.svg",
  7941. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7942. },
  7943. "more-help-tag": {
  7944. "top-info": o.HELP_MORE_TAG_A,
  7945. "big-image": "images/nav_help_tag.svg",
  7946. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7947. },
  7948. "more-help-tour": {
  7949. "top-info": o.HELP_MORE_TOUR_A,
  7950. "big-image": "images/nav_help_play.png",
  7951. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7952. },
  7953. "more-help-inside": {
  7954. "top-info": o.HELP_MORE_INSIDE_A,
  7955. "big-image": "images/nav_help_inside.svg",
  7956. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7957. },
  7958. "more-help-vr": {
  7959. "top-info": o.HELP_MORE_VR_A,
  7960. "big-image": "images/webvr.svg",
  7961. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7962. },
  7963. "more-help-360": {
  7964. "top-info": o.HELP_MORE_360_A,
  7965. "big-image": "images/nav_help_360.svg",
  7966. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7967. }
  7968. }
  7969. },
  7970. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7971. desktop: {
  7972. left: {
  7973. "top-info": o.ROTATE,
  7974. "big-image": "images/nav_help_mouse_drag_left.png",
  7975. keyboard: "images/nav_help_keyboard_left_right.png"
  7976. },
  7977. middle: {
  7978. "top-info": o.MOVE,
  7979. "big-image": "images/nav_help_mouse_click.png",
  7980. keyboard: "images/nav_help_keyboard_up_down.png"
  7981. },
  7982. right: {
  7983. "top-info": o.PLAY,
  7984. "big-image": "images/Desktop-help-play-button.svg",
  7985. keyboard: "images/Desktop-help-spacebar-2.svg"
  7986. }
  7987. },
  7988. mobile: {
  7989. left: {
  7990. "top-info": o.ROTATE,
  7991. "big-image": "images/nav_help_gesture_drag.png"
  7992. },
  7993. middle: {
  7994. "top-info": o.MOVE,
  7995. "big-image": "images/nav_help_gesture_tap.png"
  7996. },
  7997. right: {
  7998. "top-info": o.PLAY,
  7999. "big-image": "images/mobile-help-play-button.svg"
  8000. }
  8001. }
  8002. },
  8003. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8004. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8005. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8006. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8007. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8008. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8009. }
  8010. },
  8011. fill: function(e, t, i) {
  8012. n.call(this, e, t, i, !0)
  8013. },
  8014. clear: function(e, t, i) {
  8015. n.call(this, e, t, i, !1)
  8016. }
  8017. }
  8018. }
  8019. , {
  8020. "../enum/HelpModalSize": 27,
  8021. "../enum/HelpModalType": 28,
  8022. "../enum/Viewmode": 51,
  8023. "../localization/localize": 108,
  8024. "../util/browser": 182
  8025. }],
  8026. 76: [function(e, t, i) {//"./gui/sharing/ShareEvents"
  8027. "use strict";
  8028. t.exports = Object.freeze({
  8029. OPENED: "share.open",
  8030. CLOSED: "share.closed",
  8031. LINK_CLICKED: "share.linked"
  8032. })
  8033. }
  8034. , {}],
  8035. 77: [function(e, t, i) {//"./gui/sharing/modal"
  8036. "use strict";
  8037. function n(e) { //?
  8038. function t(t, i) {
  8039. var n = window.screenY + (window.innerHeight - i) / 2
  8040. , r = window.screenX + (window.innerWidth - t) / 2
  8041. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8042. I.emit(l.LINK_CLICKED, {
  8043. channel: e
  8044. }),
  8045. window.open(C[e], "shareWindow", o)
  8046. }
  8047. switch (e) {
  8048. case y.FACEBOOK:
  8049. t(580, 420);
  8050. break;
  8051. case y.TWITTER:
  8052. t(550, 440);
  8053. break;
  8054. case y.MAIL:
  8055. I.emit(l.LINK_CLICKED, {
  8056. channel: "email"
  8057. }),
  8058. window.open(C[e], "_blank");
  8059. break;
  8060. case y.LINKEDIN:
  8061. }
  8062. }
  8063. function r(e) {
  8064. I.emit(l.LINK_CLICKED, {
  8065. channel: "copylink"
  8066. });
  8067. var t = document.createRange();
  8068. t.selectNodeContents(v);
  8069. var i = window.getSelection();
  8070. i.removeAllRanges(),
  8071. i.addRange(t),
  8072. document.execCommand("copy"),
  8073. A.classList.remove("hidden"),
  8074. v.classList.add("highlighted")
  8075. }
  8076. function o(e) {
  8077. e && (e.stopPropagation(),
  8078. e.target === v) || (window.getSelection().removeAllRanges(),
  8079. v.classList.remove("highlighted"),
  8080. A.classList.add("hidden"))
  8081. }
  8082. var a = e("../../util/browser")
  8083. , s = e("../../localization/localize")
  8084. , l = e("./ShareEvents")
  8085. , c = e("../../util/common")
  8086. , h = e("events").EventEmitter
  8087. , u = document.getElementById("sharing")
  8088. , d = document.getElementById("share-modal")
  8089. , p = document.getElementById("share-close")
  8090. , f = document.getElementById("facebook-share")
  8091. , g = document.getElementById("twitter-share")
  8092. , m = document.getElementById("mail-share")
  8093. , v = document.getElementById("share-url-text")
  8094. , A = document.getElementById("copy-success")
  8095. , y = Object.freeze({
  8096. FACEBOOK: "facebook",
  8097. TWITTER: "twitter",
  8098. MAIL: "mail",
  8099. LINKEDIN: "linkedin"
  8100. })
  8101. , C = {};
  8102. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8103. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8104. C[y.MAIL] = "mailto:?subject=";
  8105. var I = {
  8106. init: function(e) {
  8107. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8108. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8109. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8110. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8111. u.addEventListener("click", this.toggle.bind(this)),
  8112. p.addEventListener("click", this.hide.bind(this)),
  8113. v.addEventListener("click", r),
  8114. d.addEventListener("click", o),
  8115. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8116. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8117. m.addEventListener("click", n.bind(this, y.MAIL)),
  8118. v.textContent = window.location.href + "&utm_source=4",
  8119. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8120. u.classList.remove("hidden")
  8121. },
  8122. show: function() {
  8123. this.emit(l.OPENED),
  8124. d.classList.add("fadeIn")
  8125. },
  8126. hide: function() {
  8127. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8128. document.selection && document.selection.empty(),
  8129. window.getSelection().removeAllRanges(),
  8130. o(),
  8131. d.classList.remove("fadeIn"))
  8132. },
  8133. toggle: function() {
  8134. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8135. }
  8136. };
  8137. c.extendObject(I, h.prototype),
  8138. t.exports = I
  8139. }
  8140. , {
  8141. "../../localization/localize": 108,
  8142. "../../util/browser": 182,
  8143. "../../util/common": 185,
  8144. "./ShareEvents": 76,
  8145. events: 202
  8146. }],
  8147. 78: [function(e, t, i) {//"./terms/TermsEvent"
  8148. "use strict";
  8149. t.exports = Object.freeze({
  8150. OPENED: "terms.opened",
  8151. CLOSED: "terms.closed"
  8152. })
  8153. }
  8154. , {}],
  8155. 79: [function(e, t, i) {///"./terms/terms"
  8156. "use strict";
  8157. var n = e("./TermsEvent")
  8158. , r = e("../../localization/localize")
  8159. , o = e("../../analytics")
  8160. , a = e("../../util/ajax")
  8161. , s = e("../../util/common")
  8162. , l = e("events").EventEmitter
  8163. , c = document.getElementById("terms-modal")
  8164. , h = {
  8165. init: function() {
  8166. $(".footer-terms").on("click", function(e) {
  8167. e.preventDefault(),
  8168. this.show()
  8169. }
  8170. .bind(this)),
  8171. $("#terms-modal .close").on("click", this.hide.bind(this))
  8172. },
  8173. show: function() {
  8174. this.emit(n.OPENED),
  8175. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8176. var t = $("#terms-text").html(e);
  8177. o.track("showcase_gui", {
  8178. gui_action: "click_terms_button",
  8179. interaction_source: "gui"
  8180. }),
  8181. t.find("a").attr("target", "_blank")
  8182. }).fail(function() {
  8183. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8184. }),
  8185. c.classList.add("fadeIn")
  8186. },
  8187. hide: function(e) {
  8188. e && e.preventDefault(),
  8189. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8190. c.classList.remove("fadeIn")
  8191. }
  8192. };
  8193. s.extendObject(h, l.prototype),
  8194. t.exports = h
  8195. }
  8196. , {
  8197. "../../analytics": 4,
  8198. "../../localization/localize": 108,
  8199. "../../util/ajax": 181,
  8200. "../../util/common": 185,
  8201. "./TermsEvent": 78,
  8202. events: 202
  8203. }],
  8204. 80: [function(e, t, i) {//"./title/TitleEvents"
  8205. "use strict";
  8206. t.exports = Object.freeze({
  8207. OPEN_INFO: "title.open.info",
  8208. CLOSE_INFO: "title.close.info",
  8209. SHOW_INFO: "title.show.info",
  8210. HIDE_INFO: "title.hide.info",
  8211. LINK_CLICKED: "title.link.click",
  8212. CONTACT_LINK_CLICKED: "title.contact.click",
  8213. ORIGIN_LINK_CLICKED: "title.origin.click"
  8214. })
  8215. }
  8216. , {}],
  8217. 81: [function(e, t, i) {//"./title/tagToggle"
  8218. "use strict";
  8219. function n(e, t) {
  8220. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8221. }
  8222. function r(e, t) {
  8223. function i(i) {
  8224. e.shouldShowtags = "show" === this.value,
  8225. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8226. }
  8227. document.getElementById("tag-toggles").classList.remove("hidden"),
  8228. document.getElementById("radio-tag-show").checked = !0;
  8229. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8230. n[r].addEventListener("change", i)
  8231. }
  8232. var o = e("../../settings");
  8233. t.exports.init = n
  8234. }
  8235. , {
  8236. "../../settings": 166
  8237. }],
  8238. 82: [function(e, t, i) {//"./gui/title/titleBar"
  8239. (function(i) {
  8240. "use strict";
  8241. function n(e, t) {
  8242. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8243. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8244. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8245. document.getElementById("gui-name").classList.add("noCoBrand"),
  8246. document.getElementById("cobrandTitle").classList.add("hidden")),
  8247. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8248. !1)
  8249. }
  8250. function r(e) {
  8251. return e ? (L = !0,
  8252. void (_.innerText = e)) : void _.classList.add("hidden")
  8253. }
  8254. function o(e, t, i, n) {
  8255. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8256. return void T.classList.add("hidden");
  8257. L = !0;
  8258. var r = []
  8259. , o = c(r, "<br>");
  8260. if (e && o('<span id="contactName">' + e + "</span>"),
  8261. t) {
  8262. var a = n || t
  8263. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8264. o(s)
  8265. }
  8266. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8267. r[0] = "",
  8268. x.innerHTML = r.join("")
  8269. }
  8270. function a(e) {
  8271. if ("string" == typeof e)
  8272. try {
  8273. e = JSON.parse(e)
  8274. } catch (e) {
  8275. return y.warn("Unable to parse address data"),
  8276. void S.parentElement.classList.add("hidden")
  8277. }
  8278. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8279. return void S.parentElement.classList.add("hidden");
  8280. L = !0;
  8281. var t = []
  8282. , i = c(t, " ");
  8283. e.address_1 && i(e.address_1),
  8284. e.address_2 && i(e.address_2),
  8285. e.city && i(e.city, ", "),
  8286. e.state && i(e.state, ", "),
  8287. e.zip && i(e.zip, e.state ? " " : ", "),
  8288. t[0] = "",
  8289. S.innerText = t.join("")
  8290. }
  8291. function s(e) {
  8292. var t = document.createElement("a");
  8293. return t.id = "url",
  8294. t.target = "_blank",
  8295. t.href = e,
  8296. t.innerText = e,
  8297. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8298. t
  8299. }
  8300. function l(e) {
  8301. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8302. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8303. P.appendChild(s(e)),
  8304. O.forEach(function(e) {
  8305. e.classList.add("share-link")
  8306. }),
  8307. !0)
  8308. }
  8309. function c(e, t) {
  8310. var i = e
  8311. , n = t;
  8312. return function(e, t) {
  8313. i.push(t || n, e)
  8314. }
  8315. }
  8316. function h() {
  8317. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8318. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8319. var e = [].slice.call(_.querySelectorAll("a"));
  8320. e.forEach(function(e) {
  8321. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8322. });
  8323. var t = [].slice.call(T.querySelectorAll("a"));
  8324. t.forEach(function(e) {
  8325. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8326. contact_type: e.getAttribute("id")
  8327. }))
  8328. })
  8329. }
  8330. var u = e("../../util/browser")
  8331. , d = e("../../util/common")
  8332. , p = e("../../util/logger")
  8333. , f = e("../../localization/localize")
  8334. , g = e("./titleBarSettings")
  8335. , m = e("../../settings")
  8336. , v = e("./TitleEvents")
  8337. , A = e("events").EventEmitter
  8338. , y = new p(i)
  8339. , C = document.querySelector(".pinTop.left")
  8340. , I = document.getElementsByClassName("title-container")[0]
  8341. , E = document.getElementById("title-toggle").querySelector("i")
  8342. , b = document.getElementById("meta-info-wrapper")
  8343. , w = document.getElementById("meta-info")
  8344. , _ = document.getElementById("meta-description")
  8345. , T = document.getElementsByClassName("contact-info")[0]
  8346. , x = document.getElementById("contact-data")
  8347. , S = document.getElementById("addressTxt")
  8348. , M = document.getElementById("tag-toggles")
  8349. , R = document.getElementById("share-origin")
  8350. , P = document.getElementById("share-link-wrapper")
  8351. , O = [w, b, I]
  8352. , L = !1
  8353. , D = !1
  8354. , N = {
  8355. populate: function(e) {
  8356. if (n(e.name, e.coBrand)) {
  8357. if (r(e.description),
  8358. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8359. a(e.address),
  8360. L) {
  8361. var t = document.createElement("br");
  8362. M.insertBefore(t, M.firstElementChild)
  8363. }
  8364. e.socialSharing && m.share.enabled && (D = l(e.url))
  8365. }
  8366. },
  8367. finishSetup: function(e) {
  8368. L = L || !!e,
  8369. h(),
  8370. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8371. },
  8372. toggleMeta: function(e, t) {
  8373. t && t.preventDefault();
  8374. var i = w.classList.contains("expand");
  8375. e && !i || (i ? (O.forEach(function(e) {
  8376. e.classList.remove("expand")
  8377. }),
  8378. this.emit(v.CLOSE_INFO)) : (O.forEach(function(e) {
  8379. e.classList.add("expand")
  8380. }),
  8381. this.emit(v.OPEN_INFO)))
  8382. },
  8383. setupToggling: function() {
  8384. b.style.height = w.offsetHeight + "px",
  8385. w.addEventListener("transitionend", function() {
  8386. b.style.height = w.offsetHeight + "px"
  8387. })
  8388. },
  8389. toggleTitle: function(e) {
  8390. e && e.preventDefault(),
  8391. C.classList.contains("closed") ? (C.classList.add("open"),
  8392. E.classList.remove("icon-dpad-right"),
  8393. E.classList.add("icon-dpad-left"),
  8394. this.emit(v.SHOW_INFO),
  8395. setTimeout(function() {
  8396. C.classList.remove("closed"),
  8397. C.classList.remove("open")
  8398. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8399. E.classList.remove("icon-dpad-left"),
  8400. E.classList.add("icon-dpad-right"),
  8401. this.emit(v.HIDE_INFO))
  8402. }
  8403. };
  8404. d.extendObject(N, A.prototype),
  8405. t.exports = N
  8406. }
  8407. ).call(this, "/js/gui/title/titleBar.js")
  8408. }
  8409. , {
  8410. "../../localization/localize": 108,
  8411. "../../settings": 166,
  8412. "../../util/browser": 182,
  8413. "../../util/common": 185,
  8414. "../../util/logger": 189,
  8415. "./TitleEvents": 80,
  8416. "./titleBarSettings": 83,
  8417. events: 202
  8418. }],
  8419. 83: [function(e, t, i) {//"./titleBarSettings"
  8420. "use strict";
  8421. t.exports = Object.freeze({
  8422. minTooltipCharacters: 19,
  8423. removeAnimationClasses: 500
  8424. })
  8425. }
  8426. , {}],
  8427. 84: [function(e, t, i) {//"./tourInteraction"
  8428. "use strict";
  8429. function n(e) {
  8430. C = e,
  8431. P.forEach(function(e) {
  8432. b.addEventListener(e, u.bind(this, !1), !0),
  8433. w.addEventListener(e, u.bind(this, !0), !0),
  8434. E.addEventListener(e, o, !0),
  8435. S.forEach(function(t) {
  8436. t.addEventListener(e, a, !0)
  8437. }),
  8438. $("#drawer img").on(e, a)
  8439. }),
  8440. document.addEventListener("keydown", u.bind(this, !1), !0),
  8441. C.on(v.TourStart, function() {
  8442. E.classList.add("playing")
  8443. })
  8444. }
  8445. function r() {
  8446. C.playTour(),
  8447. I && clearTimeout(I),
  8448. d(),
  8449. _.removeClass("fadeIn")
  8450. }
  8451. function o() {
  8452. E.classList.contains("playing") && (C.stopTour(),
  8453. _.addClass("fadeIn"),
  8454. setTimeout(function() {
  8455. _.removeClass("fadeIn")
  8456. }, p.tourInteraction.showPauseButton),
  8457. O || (clearTimeout(I),
  8458. I = setTimeout(h, p.tourInteraction.showModal)),
  8459. setTimeout(function() {
  8460. E.classList.remove("playing")
  8461. }, p.tourInteraction.allowNextClick))
  8462. }
  8463. function a() {
  8464. C.tourInProgress && (C.stopTour(),
  8465. C.endTourProgress(),
  8466. E.classList.remove("playing"))
  8467. }
  8468. function s() {
  8469. T.is(":visible") ? r() : o()
  8470. }
  8471. function l() {
  8472. x.hasClass("playing") && (clearTimeout(I),
  8473. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8474. }
  8475. function c() {
  8476. E.classList.remove("playing"),
  8477. h()
  8478. }
  8479. function h() {
  8480. if (!p.tourInteraction.disabled) {
  8481. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8482. M.addClass("fadeIn tour " + m.deviceType);
  8483. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8484. if (!p.tourInteraction.smallModal) {
  8485. var t;
  8486. t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
  8487. m.fill(R, A.TOUR_INTERACTION[t]),
  8488. M.addClass(t)
  8489. }
  8490. M.addClass(e)
  8491. }
  8492. }
  8493. function u(e, t) {
  8494. if (t) {
  8495. var i = "keydown" === t.type
  8496. , n = t.which === f.SPACE || C.tourIsPlaying;
  8497. i && n || e || (O = !0),
  8498. C.atEndOfTour() && d(),
  8499. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8500. d(),
  8501. t.which !== f.SPACE && a()),
  8502. i && n && s()
  8503. }
  8504. }
  8505. function d() {
  8506. M.removeClass("fadeIn")
  8507. }
  8508. var p = (e("../util/browser"),
  8509. e("../settings"))
  8510. , f = e("../enum/Keys")
  8511. , g = e("../enum/Viewmode")
  8512. , m = (e("./helpManager"),
  8513. e("./populateModal"))
  8514. , v = e("../enum/DirectorEvents")
  8515. , A = e("../enum/HelpModalType")
  8516. , y = e("../enum/HelpModalSize")
  8517. , C = null
  8518. , I = null
  8519. , E = document.getElementById("pause-overlay")
  8520. , b = document.getElementById("player")
  8521. , w = document.getElementById("gui")
  8522. , _ = $("#pause-icon").eq(0)
  8523. , T = $("#play").eq(0)
  8524. , x = $("#playHead").eq(0)
  8525. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8526. , M = $("#interaction-modal").eq(0)
  8527. , R = $("#interaction-modal .interaction").toArray()
  8528. , P = ["touchstart", "mousedown", "pointerdown"]
  8529. , O = !1;
  8530. t.exports.init = n,
  8531. t.exports.play = r,
  8532. t.exports.pause = o,
  8533. t.exports.pauseWithoutCTA = a,
  8534. t.exports.togglePlay = s,
  8535. t.exports.stopTour = l,
  8536. t.exports.dismissModal = d
  8537. }
  8538. , {
  8539. "../enum/DirectorEvents": 23,
  8540. "../enum/HelpModalSize": 27,
  8541. "../enum/HelpModalType": 28,
  8542. "../enum/Keys": 30,
  8543. "../enum/Viewmode": 51,
  8544. "../settings": 166,
  8545. "../util/browser": 182,
  8546. "./helpManager": 68,
  8547. "./populateModal": 75
  8548. }],
  8549. 85: [function(e, t, i) {//"./gui/vr/vrEvent"
  8550. "use strict";
  8551. t.exports = Object.freeze({
  8552. OPENED: "vr.modal.opened",
  8553. LAUNCH: "vr.modal.launch",
  8554. CLOSED: "vr.modal.closed",
  8555. NEXT: "vr.modal.next",
  8556. PREV: "vr.modal.prev",
  8557. STORE: "vr.modal.store",
  8558. falseICECHOSEN: "vr.modal.device"
  8559. })
  8560. }
  8561. , {}],
  8562. 86: [function(e, t, i) {//"./../vr/vrLink"
  8563. "use strict";
  8564. function n(e, t, i) {
  8565. function n(e, t, n, r) {
  8566. function o() {
  8567. return p + "&m=" + t + "&display=" + e
  8568. }
  8569. function s() {
  8570. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8571. , t = "&utm_source=" + u
  8572. , n = "&utm_showcase_session_id=" + i;
  8573. return e + t + n
  8574. }
  8575. function l() {
  8576. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8577. }
  8578. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8579. }
  8580. function r(e, t, i, r) {
  8581. var o = "https://api.branch.io/v1/url"
  8582. , a = n(e, t, i, r)
  8583. , s = {
  8584. responseType: "json",
  8585. data: {
  8586. branch_key: h.appConfig.branch_key,
  8587. data: {
  8588. m: t,
  8589. full_url: a,
  8590. $desktop_url: m,
  8591. $og_app_id: "331853976762864119",
  8592. $og_title: i,
  8593. $og_description: r,
  8594. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8595. $canonical_url: window.location.href
  8596. }
  8597. }
  8598. };
  8599. c.post(o, s).done(function(t) {
  8600. f[e] = t.url
  8601. }).fail(function(t) {
  8602. f[e] = t
  8603. }
  8604. .bind(this, a))
  8605. }
  8606. function o(e, t, i) {
  8607. for (var r in s) {
  8608. var o = s[r]
  8609. , a = n(o, e, t, i);
  8610. f[o] = a
  8611. }
  8612. }
  8613. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8614. , d = g + "/vr/dlist/?ret=" + u
  8615. , p = g + "/vr/show/?ret=" + u
  8616. , m = "https://support.port.com/hc/en-us/articles/224728887-What-do-I-need-for-Virtual-Reality";
  8617. switch (e) {
  8618. case l.IOS:
  8619. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8620. break;
  8621. default:
  8622. o(t.sid, t.name, t.summary)
  8623. }
  8624. }
  8625. function r(e) {
  8626. var t = f[e];
  8627. window.open(t, "_blank")
  8628. }
  8629. function o(e) {
  8630. var t = u[e];
  8631. window.open(t, "_blank")
  8632. }
  8633. var a = e("../../util/browser")
  8634. , s = e("../../enum/VRApps")
  8635. , l = e("../../enum/VRPlatforms")
  8636. , c = e("../../util/ajax")
  8637. , h = e("../../settings")
  8638. , u = {};
  8639. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8640. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8641. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8642. for (var d in s) {
  8643. var p = s[d];
  8644. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8645. }
  8646. var f = {}
  8647. , g = function() {
  8648. var e = window.location.host;
  8649. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8650. "https://" + e
  8651. }();
  8652. t.exports.init = n,
  8653. t.exports.launch = r,
  8654. t.exports.launchStore = o
  8655. }
  8656. , {
  8657. "../../enum/VRApps": 46,
  8658. "../../enum/VRPlatforms": 49,
  8659. "../../settings": 166,
  8660. "../../util/ajax": 181,
  8661. "../../util/browser": 182
  8662. }],
  8663. 87: [function(e, t, i) {//"./vr/vrModal"
  8664. "use strict";
  8665. function n(e) {
  8666. var t;
  8667. switch (e) {
  8668. case m.IOS:
  8669. return t = p.iosVersion(),
  8670. t.major > 9 || 9 === t.major && t.minor >= 1;
  8671. case m.Android:
  8672. return t = p.androidVersion(),
  8673. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8674. }
  8675. return !1
  8676. }
  8677. function r(e, t) {
  8678. function i(e) {
  8679. K.emit(A.STORE, {
  8680. type: e
  8681. }),
  8682. f.launchStore(e)
  8683. }
  8684. function r(e) {
  8685. switch (e !== _.pageCount && (a(e),
  8686. N.text(e + 1 + " / " + _.pageCount)),
  8687. e) {
  8688. case _.Title:
  8689. O.css("display", "none"),
  8690. L.text(u[e]),
  8691. o(s);
  8692. break;
  8693. case _.Cardboard:
  8694. O.css("display", "block"),
  8695. L.text(u[e]),
  8696. M.filter(".cardboard").off(),
  8697. M.filter(".gearvr").off(),
  8698. c(e, s),
  8699. h(H, X, Z);
  8700. break;
  8701. case _.Gear:
  8702. L.text(u[e]),
  8703. c(e, s),
  8704. T.addClass("lastPage"),
  8705. h(G, X, Z);
  8706. break;
  8707. case _.pageCount:
  8708. T.removeClass("fadeIn"),
  8709. K.emit(A.CLOSED)
  8710. }
  8711. B.filter("[src='']").hide()
  8712. }
  8713. var s = function() {
  8714. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8715. w = ".show-supported",
  8716. m.Android) : (T.addClass("unsupported"),
  8717. w = ".show-unsupported",
  8718. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8719. w = ".show-ios",
  8720. _ = v.ios,
  8721. m.IOS) : (T.addClass("desktop"),
  8722. w = ".show-desktop",
  8723. m.Desktop)
  8724. }();
  8725. f.init(s, e, t),
  8726. s !== m.Desktop && T.addClass("mobile");
  8727. var l = function(e) {
  8728. K.emit(A.LAUNCH, {
  8729. vr_platform: s,
  8730. vr_app: e
  8731. }),
  8732. f.launch(e)
  8733. };
  8734. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8735. q.gear = l.bind(this, g.GearVR),
  8736. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8737. d(),
  8738. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8739. $(w).show();
  8740. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8741. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8742. s === m.IOS && (u.splice(1, 1),
  8743. y.splice(1, 1)),
  8744. $("#vr").on("click", function(e) {
  8745. e.preventDefault(),
  8746. T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8747. r(b),
  8748. T.addClass("fadeIn"),
  8749. K.emit(A.OPENED))
  8750. });
  8751. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8752. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8753. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8754. $("span.modelLink").text(I),
  8755. O.on("click", function(e) {
  8756. K.emit(A.PREV),
  8757. b--,
  8758. r(b)
  8759. }),
  8760. L.on("click", function(e) {
  8761. L.text();
  8762. K.emit(A.NEXT, {
  8763. nextAction: y[b]
  8764. }),
  8765. b++,
  8766. r(b)
  8767. }),
  8768. T.find(".close").on("click", K.dismiss)
  8769. }
  8770. function o(e) {
  8771. switch (e) {
  8772. case m.Android:
  8773. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8774. M.filter(".gearvr").off().on("click", q.gear),
  8775. s(H, G, "logo-button", "same-line");
  8776. break;
  8777. case m.UnsupportedAndroid:
  8778. s("", z, "", "");
  8779. break;
  8780. case m.IOS:
  8781. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8782. s(H, "", "logo-button", "");
  8783. break;
  8784. case m.Desktop:
  8785. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8786. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8787. s(H, G, "logo-button", "same-line"),
  8788. Q.cardboard()
  8789. }
  8790. }
  8791. function a(e) {
  8792. $(".p1, .p2, .p3").hide(),
  8793. x.insertAfter(S),
  8794. T.removeClass("front-page"),
  8795. T.removeClass("details-page"),
  8796. T.removeClass("lastPage"),
  8797. M.removeClass("logo-button"),
  8798. M.removeClass("same-line"),
  8799. S.removeClass("headsetOptions"),
  8800. R.attr("src", ""),
  8801. R.filter(".second").removeClass("gear"),
  8802. R.css("display", "inline-block"),
  8803. R.off(),
  8804. P.filter(".second").css("display", ""),
  8805. D.css("display", "none"),
  8806. $(".p" + (e + 1) + w).show(),
  8807. R.filter(".third").insertBefore(P.filter(".third"))
  8808. }
  8809. function s(e, t, i, n) {
  8810. T.addClass("front-page"),
  8811. R.filter(".first").attr("src", e),
  8812. R.filter(".second").attr("src", t),
  8813. M.filter(".first").addClass(i),
  8814. M.filter(".second").addClass(i),
  8815. M.addClass(n),
  8816. ".show-desktop" === w && S.insertAfter(x)
  8817. }
  8818. function l(e, t, i) {
  8819. S.addClass("headsetOptions"),
  8820. M.off(),
  8821. R.filter(".second").attr("src", t),
  8822. D.css("display", "block"),
  8823. P.filter(".second").css("display", "none"),
  8824. D.on("click", function() {
  8825. a(_.Title),
  8826. o(m.Desktop)
  8827. }),
  8828. e && (K.emit(A.falseICECHOSEN, {
  8829. name: g.GearVR
  8830. }),
  8831. R.filter(".first").attr("src", e),
  8832. R.filter(".second").addClass("gear"),
  8833. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8834. Q.gearvr()),
  8835. i && (K.emit(A.falseICECHOSEN, {
  8836. name: g.Cardboard
  8837. }),
  8838. R.filter(".third").attr("src", i),
  8839. R.filter(".third").show(),
  8840. R.filter(".third").insertAfter(R.filter(".second")),
  8841. R.filter(".third").addClass("link"),
  8842. R.filter(".second").addClass("link"),
  8843. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8844. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  8845. Q.cardboard())
  8846. }
  8847. function c(e, t) {
  8848. switch (t) {
  8849. case m.IOS:
  8850. X = Y,
  8851. Z = j;
  8852. break;
  8853. case m.Desktop:
  8854. e === _.Cardboard ? (X = F,
  8855. Z = U,
  8856. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8857. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  8858. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8859. Z = "");
  8860. break;
  8861. default:
  8862. e === _.Cardboard ? (X = z,
  8863. Z = j) : (X = k,
  8864. Z = W)
  8865. }
  8866. }
  8867. function h(e, t, i) {
  8868. T.find(".inner").addClass("details-page"),
  8869. T.addClass("details-page"),
  8870. R.filter(".first").attr("src", e),
  8871. R.filter(".second").attr("src", t),
  8872. R.filter(".third").attr("src", i)
  8873. }
  8874. function u() {
  8875. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  8876. K.emit(A.CLOSED))
  8877. }
  8878. function d() {
  8879. var e = p.aspectRatio() > 1 && p.isMobile();
  8880. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  8881. T.toggleClass("tiny", window.innerHeight <= y.narrowLandscapeHeight),
  8882. T.toggleClass("tinier", window.innerHeight <= y.reallyNarrowLandscapeHeight)
  8883. }
  8884. var p = e("../../util/browser")
  8885. , f = e("./vrLink")
  8886. , g = e("../../enum/VRApps")
  8887. , m = e("../../enum/VRPlatforms")
  8888. , v = e("../../enum/VRPages")
  8889. , A = e("./vrEvent")
  8890. , y = (e("../../settings"),
  8891. e("../../constants"))
  8892. , C = e("../../localization/localize")
  8893. , I = e("../../util/common")
  8894. , E = e("events").EventEmitter
  8895. , b = 0
  8896. , w = null
  8897. , _ = v.standard
  8898. , T = $(".vr-popup")
  8899. , x = T.find(".vr-popup-body")
  8900. , S = T.find(".vr-images")
  8901. , M = T.find(".img-container")
  8902. , R = T.find(".vr-sm-image")
  8903. , P = M.find(".vr-img-caption")
  8904. , O = $(".vr-buttons").find(".prev-button")
  8905. , L = $(".vr-buttons").find(".next-button")
  8906. , D = S.find(".front-close")
  8907. , N = $(".vr-page")
  8908. , B = T.find("img")
  8909. , F = "images/apple-store.png"
  8910. , V = "images/badge-oculus.png"
  8911. , U = "images/badge-cardboard.png"
  8912. , k = "images/logo-samsung.png"
  8913. , H = "images/headset-cardboard.png"
  8914. , G = "images/headset-gearvr.png"
  8915. , z = "images/ico-android-robot.png"
  8916. , W = "images/ico-gearvr.png"
  8917. , j = "images/ico-vr.png"
  8918. , Y = "images/apple-logo-white.svg"
  8919. , X = null
  8920. , Z = null
  8921. , q = {}
  8922. , K = {
  8923. init: r,
  8924. dismiss: u,
  8925. isDeviceSupported: n
  8926. };
  8927. I.extendObject(K, E.prototype),
  8928. $(window).resize(d);
  8929. var Q = function() {
  8930. var e = P.filter(".first").find(".cardboard")
  8931. , t = P.filter(".first").find(".gearvr");
  8932. return {
  8933. cardboard: function() {
  8934. t.addClass("hidden"),
  8935. e.removeClass("hidden")
  8936. },
  8937. gearvr: function() {
  8938. e.addClass("hidden"),
  8939. t.removeClass("hidden")
  8940. }
  8941. }
  8942. }();
  8943. t.exports = K
  8944. }
  8945. , {
  8946. "../../constants": 8,
  8947. "../../enum/VRApps": 46,
  8948. "../../enum/VRPages": 48,
  8949. "../../enum/VRPlatforms": 49,
  8950. "../../localization/localize": 108,
  8951. "../../settings": 166,
  8952. "../../util/browser": 182,
  8953. "../../util/common": 185,
  8954. "./vrEvent": 85,
  8955. "./vrLink": 86,
  8956. events: 202
  8957. }],
  8958. 88: [function(e, t, i) {//"./webvr/WebVrEvent"
  8959. "use strict";
  8960. t.exports = Object.freeze({
  8961. OPENED: "webvr.modal.opened",
  8962. SHOW_TERMS: "webvr.footer.show.terms"
  8963. })
  8964. }
  8965. , {}],
  8966. 89: [function(e, t, i) {///js/gui/webvr/webVRgui.js
  8967. (function(i) {
  8968. "use strict";
  8969. function n(e, t, i, n) {
  8970. function r(e) {
  8971. e.preventDefault(),
  8972. a(e.currentTarget.id)
  8973. }
  8974. function a(e) {
  8975. ne[e](),
  8976. Object.keys(ne).map(function(t, i) {
  8977. $("#" + t).toggleClass("tabs-underlined", t === e)
  8978. })
  8979. }
  8980. y = i,
  8981. v = t,
  8982. w.init(E.Android, e, n),
  8983. m();
  8984. var l = new RegExp("daydream","i")
  8985. , c = l.test(y.displayName);
  8986. c ? (a("tabdaydream"),
  8987. B.filter(".device-headset-side").attr("src", H),
  8988. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  8989. B.filter(".device-headset-side").attr("src", Y),
  8990. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  8991. $("#vr").on("click", function(e) {
  8992. e.preventDefault(),
  8993. g("click_webvr_button"),
  8994. L.is(":hidden") && (ie.emit(_.OPENED),
  8995. o())
  8996. }),
  8997. $(".webvr-popup .close").on("click", function(e) {
  8998. e.preventDefault(),
  8999. D.hasClass("hidden") ? (g("webvr_help_close"),
  9000. p()) : s()
  9001. }),
  9002. $("#tabcardboard").on("click", r),
  9003. $("#tabdaydream").on("click", r),
  9004. $("#tabnative").on("click", r),
  9005. $(".webvr-popup .open-with-app").on("click", function(e) {
  9006. e.preventDefault(),
  9007. g("webvr_learn_more"),
  9008. a("tabnative"),
  9009. p()
  9010. }),
  9011. $(".webvr-popup .help").on("click", function(e) {
  9012. e.preventDefault(),
  9013. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9014. p()
  9015. }),
  9016. $(".webvr-popup .terms").on("click", function(e) {
  9017. e.preventDefault(),
  9018. g("webvr_click_terms"),
  9019. s(),
  9020. ie.emit(_.SHOW_TERMS)
  9021. }),
  9022. F.on("click", function(e) {
  9023. e.preventDefault(),
  9024. g(ee),
  9025. window.open(J, "_blank")
  9026. }),
  9027. V.on("click", function(e) {
  9028. e.preventDefault(),
  9029. g("webvr_phone_link"),
  9030. window.open(te, "_blank")
  9031. }),
  9032. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9033. e.preventDefault(),
  9034. g("webvr_cardboard_link"),
  9035. w.launch(b.CardboardAndroid)
  9036. }),
  9037. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9038. e.preventDefault(),
  9039. g("webvr_oculus_link"),
  9040. w.launch(b.GearVR)
  9041. })
  9042. }
  9043. function r() {
  9044. function e() {
  9045. y.isPresenting || (f(),
  9046. window.removeEventListener("vrdisplaypresentchange", e))
  9047. }
  9048. R.info("Headset mounted"),
  9049. v.suspend();
  9050. var t = document.createElement("canvas");
  9051. for (t.getContext("webgl"),
  9052. t.className = "webvr-canvas",
  9053. document.bgColor = "#000",
  9054. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9055. document.body.removeChild(document.body.firstChild);
  9056. document.body.appendChild(t),
  9057. g("webvr_enter_app"),
  9058. y.requestPresent([{
  9059. source: t,
  9060. predistorted: !0
  9061. }]).catch(function(t) {
  9062. R.error("Failed to present: " + t),
  9063. g("webvr_exit_calibrate"),
  9064. e()
  9065. }),
  9066. A.then(function() {
  9067. window.dispatchEvent(new Event("vrapp-start"))
  9068. }),
  9069. window.addEventListener("vrdisplaypresentchange", e)
  9070. }
  9071. function o() {
  9072. O.fadeOut(I.guiAnimationSpeed),
  9073. L.fadeIn(I.guiAnimationSpeed),
  9074. a()
  9075. }
  9076. function a() {
  9077. if (!A) {
  9078. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9079. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9080. A = new Promise(function(e, i) {
  9081. var n = document.createElement("script");
  9082. n.type = "text/javascript",
  9083. n.src = t,
  9084. n.onload = e,
  9085. document.head.appendChild(n)
  9086. }
  9087. )
  9088. }
  9089. D.find(".enter-button").on("click", r)
  9090. }
  9091. function s() {
  9092. g("webvr_modal_close"),
  9093. D.find(".enter-button").off("click", r),
  9094. L.fadeOut(I.guiAnimationSpeed, function() {
  9095. D.toggleClass("hidden", !1),
  9096. N.toggleClass("hidden", !0),
  9097. C.exitFullscreen()
  9098. }),
  9099. O.fadeIn(I.guiAnimationSpeed)
  9100. }
  9101. function l() {
  9102. k.toggleClass("hidden", !1),
  9103. U.toggleClass("hidden", !0)
  9104. }
  9105. function c() {
  9106. k.toggleClass("hidden", !0),
  9107. U.toggleClass("hidden", !1)
  9108. }
  9109. function h() {
  9110. B.filter(".device-headset").attr("src", G),
  9111. B.filter(".device-phone").attr("src", z),
  9112. J = Z,
  9113. ee = K,
  9114. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9115. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9116. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9117. c()
  9118. }
  9119. function u() {
  9120. B.filter(".badge-cardboard").attr("src", j),
  9121. B.filter(".badge-oculus").attr("src", X),
  9122. l()
  9123. }
  9124. function d() {
  9125. B.filter(".device-headset").attr("src", Y),
  9126. B.filter(".device-phone").attr("src", W),
  9127. J = q,
  9128. ee = Q,
  9129. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9130. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9131. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9132. c()
  9133. }
  9134. function p() {
  9135. D.toggleClass("hidden"),
  9136. N.toggleClass("hidden")
  9137. }
  9138. function f() {
  9139. R.info("exiting webVR"),
  9140. g("webvr_exit_app"),
  9141. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9142. }
  9143. function g(e) {
  9144. var t = C.isLandscape() ? "landscape" : "portrait";
  9145. T.trackAlways("showcase_gui", {
  9146. gui_action: e,
  9147. orientation: t
  9148. })
  9149. }
  9150. function m() {
  9151. var e = C.isLandscape();
  9152. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9153. }
  9154. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9155. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9156. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9157. init: n
  9158. }, ne = {
  9159. tabcardboard: d,
  9160. tabdaydream: h,
  9161. tabnative: u
  9162. };
  9163. S.extendObject(ie, P.prototype),
  9164. $(window).resize(m),
  9165. t.exports = ie
  9166. }
  9167. ).call(this, "/js/gui/webvr/webVRgui.js")
  9168. }
  9169. , {
  9170. "../../analytics": 4,
  9171. "../../constants": 8,
  9172. "../../enum/VRApps": 46,
  9173. "../../enum/VRPlatforms": 49,
  9174. "../../localization/localize": 108,
  9175. "../../settings": 166,
  9176. "../../util/browser": 182,
  9177. "../../util/common": 185,
  9178. "../../util/logger": 189,
  9179. "./../gui": 65,
  9180. "./../vr/vrLink": 86,
  9181. "./WebVrEvent": 88,
  9182. events: 202
  9183. }],
  9184. 90: [function(e, t, i) {//"../label/Label"
  9185. "use strict";
  9186. function n(e, t, i, n, o) {
  9187. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9188. this.roomId = o || "",
  9189. this.labelId = e,
  9190. this.position = (new r.Vector3).copy(t),
  9191. this.text = i
  9192. }
  9193. var r = e("three")
  9194. , o = e("../util/browser");
  9195. n.prototype.build = function() {
  9196. var e = window.document.createElement("div");
  9197. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9198. var t = window.document.createElement("div");
  9199. t.setAttribute("class", "gui-floorplan-label-text");
  9200. var i = window.document.createTextNode(this.text);
  9201. t.appendChild(i),
  9202. e.appendChild(t),
  9203. window.document.body.appendChild(e),
  9204. this.labelGui = e,
  9205. this.textBlock = t,
  9206. $(this.labelGui).hide();
  9207. var n = window.getComputedStyle(this.labelGui);
  9208. this.initialTransform = n.transform || n.webkitTransform
  9209. }
  9210. ,
  9211. t.exports = n
  9212. }
  9213. , {
  9214. "../util/browser": 182,
  9215. three: 217
  9216. }],
  9217. 91: [function(e, t, i) {//"./label/LabelDisplayController"
  9218. "use strict";
  9219. function n() {
  9220. this.player = null,
  9221. this.modelManager = null,
  9222. this.container = null
  9223. }
  9224. var r = e("three")
  9225. , o = (e("../util/common"),
  9226. e("../enum/PlayerEvents"))
  9227. , a = (e("../enum/DirectorEvents"),
  9228. e("../enum/ModelManagerEvents"))
  9229. , s = e("../settings")
  9230. , l = e("../enum/Viewmode")
  9231. , c = (e("../enum/WarpStyle"),
  9232. e("../util/transitions"),
  9233. e("../util/lerp"),
  9234. e("../util/browser"));
  9235. n.prototype.init = function(e, t, i) {
  9236. this.player = e,
  9237. this.modelManager = t,
  9238. this.container = i,
  9239. this.updateModel(),
  9240. this.bindEvents()
  9241. }
  9242. ,
  9243. n.prototype.bindEvents = function() {
  9244. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9245. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9246. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9247. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9248. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9249. }
  9250. ,
  9251. n.prototype.updateModel = function() {
  9252. this.model = this.modelManager.getActiveModel()
  9253. }
  9254. ,
  9255. n.prototype.handlePlayerViewChanged = function() {
  9256. this.updateLabelVisibility(),
  9257. this.updateLabelDisplay()
  9258. }
  9259. ,
  9260. n.prototype.getLabelsForFloor = function(e, t) {
  9261. return t = t || [],
  9262. t.length = 0,
  9263. this.model.labels.forEach(function(i) {
  9264. this.labelVisibleForFloor(i, e) && t.push(i)
  9265. }
  9266. .bind(this)),
  9267. t
  9268. }
  9269. ,
  9270. n.prototype.getLabelsForCurrentFloor = function(e) {
  9271. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9272. }
  9273. ,
  9274. n.prototype.labelVisibleForFloor = function(e, t) {
  9275. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9276. if (!this.model.showingLabels || !e.labelGui || !i)
  9277. return !1;
  9278. var n = e.floorId === this.model.floors.size() - 1;
  9279. return this.model.allFloorsVisible ? n : e.floorId === t
  9280. }
  9281. ,
  9282. n.prototype.updateLabelVisibility = function(e) {
  9283. this.model.labels.forEach(function(e) {
  9284. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9285. }
  9286. .bind(this))
  9287. }
  9288. ,
  9289. n.prototype.showAllLabels = function(e, t) {
  9290. this.model.labels.forEach(function(i) {
  9291. this.showLabel(i, e, t)
  9292. }
  9293. .bind(this))
  9294. }
  9295. ,
  9296. n.prototype.hideAllLabels = function(e, t) {
  9297. this.model.labels.forEach(function(i) {
  9298. this.hideLabel(i, e, t)
  9299. }
  9300. .bind(this))
  9301. }
  9302. ,
  9303. n.prototype.showLabel = function(e, t, i) {
  9304. this.model.showingLabels && (e.visible || (e.visible = !0,
  9305. e.labelGui.style.display = "block",
  9306. e.labelGui.style.opacity = 0,
  9307. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9308. }
  9309. ,
  9310. n.prototype.hideLabel = function(e, t, i) {
  9311. e.visible && (e.visible = !1,
  9312. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9313. }
  9314. ,
  9315. n.prototype.supportedMode = function() {
  9316. return this.player.mode === l.FLOORPLAN
  9317. }
  9318. ,
  9319. n.prototype.updateLabelDisplay = function() {
  9320. var e = (new r.Vector3,
  9321. new r.Vector3,
  9322. []);
  9323. return function() {
  9324. var t = this.player.getLabelScaleFactor()
  9325. , i = .6
  9326. , n = 1.2
  9327. , r = (1 - t) * n + i
  9328. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9329. this.getLabelsForCurrentFloor(e);
  9330. for (var a = 0; a < e.length; a++) {
  9331. var l = e[a];
  9332. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9333. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  9334. }
  9335. }
  9336. }(),
  9337. n.prototype.updateProjectedGuiElement = function() {
  9338. var e = new r.Vector3;
  9339. new r.Vector3;
  9340. return function(t, i, n, r, o) {
  9341. i.style.fontSize = 100 * o + "%";
  9342. var a = $('#player').width()
  9343. , s = $('#player').height()
  9344. , l = .5 * a
  9345. , c = .5 * s;
  9346. e.copy(n),
  9347. e.project(this.player.camera);
  9348. var h = e.x * l + l
  9349. , u = -(e.y * c) + c;
  9350. h -= t.offsetWidth / 2,
  9351. u -= t.offsetHeight / 2,
  9352. t.style.left = h + "px",
  9353. t.style.top = u + "px"
  9354. }
  9355. }(),
  9356. n.prototype.handleStartInside = function(e) {
  9357. this.updateLabelVisibility()
  9358. }
  9359. ,
  9360. n.prototype.handleStartOutside = function() {
  9361. this.updateLabelVisibility()
  9362. }
  9363. ,
  9364. t.exports = n
  9365. }
  9366. , {
  9367. "../enum/DirectorEvents": 23,
  9368. "../enum/ModelManagerEvents": 33,
  9369. "../enum/PlayerEvents": 40,
  9370. "../enum/Viewmode": 51,
  9371. "../enum/WarpStyle": 52,
  9372. "../settings": 166,
  9373. "../util/browser": 182,
  9374. "../util/common": 185,
  9375. "../util/lerp": 188,
  9376. "../util/transitions": 195,
  9377. three: 217
  9378. }],
  9379. 92: [function(e, t, i) {//"./lib/array-polyfill"
  9380. "use strict";
  9381. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9382. if (null == this)
  9383. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9384. if ("function" != typeof e)
  9385. throw new TypeError("predicate must be a function");
  9386. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9387. if (t = i[o],
  9388. e.call(r, t, o, i))
  9389. return o;
  9390. return -1
  9391. }
  9392. ),
  9393. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9394. value: function(e) {
  9395. if (null == this)
  9396. throw new TypeError('"this" is null or not defined');
  9397. var t = Object(this)
  9398. , i = t.length >>> 0;
  9399. if ("function" != typeof e)
  9400. throw new TypeError("predicate must be a function");
  9401. for (var n = arguments[1], r = 0; r < i; ) {
  9402. var o = t[r];
  9403. if (e.call(n, o, r, t))
  9404. return o;
  9405. r++
  9406. }
  9407. }
  9408. })
  9409. }
  9410. , {}],
  9411. 93: [function(e, t, i) {//"../lib/dat.gui"
  9412. "use strict";
  9413. var n = n || {};
  9414. t.exports = n,
  9415. n.gui = n.gui || {},
  9416. n.utils = n.utils || {},
  9417. n.controllers = n.controllers || {},
  9418. n.dom = n.dom || {},
  9419. n.color = n.color || {},
  9420. n.utils.css = function() {
  9421. return {
  9422. load: function(e, t) {
  9423. t = t || document;
  9424. var i = t.createElement("link");
  9425. i.type = "text/css",
  9426. i.rel = "stylesheet",
  9427. i.href = e,
  9428. t.getElementsByTagName("head")[0].appendChild(i)
  9429. },
  9430. inject: function(e, t) {
  9431. t = t || document;
  9432. var i = document.createElement("style");
  9433. i.type = "text/css",
  9434. i.innerHTML = e,
  9435. t.getElementsByTagName("head")[0].appendChild(i)
  9436. }
  9437. }
  9438. }(),
  9439. n.utils.common = function() {
  9440. var e = Array.prototype.forEach
  9441. , t = Array.prototype.slice;
  9442. return {
  9443. BREAK: {},
  9444. extend: function(e) {
  9445. return this.each(t.call(arguments, 1), function(t) {
  9446. for (var i in t)
  9447. this.isUndefined(t[i]) || (e[i] = t[i])
  9448. }, this),
  9449. e
  9450. },
  9451. defaults: function(e) {
  9452. return this.each(t.call(arguments, 1), function(t) {
  9453. for (var i in t)
  9454. this.isUndefined(e[i]) && (e[i] = t[i])
  9455. }, this),
  9456. e
  9457. },
  9458. compose: function() {
  9459. var e = t.call(arguments);
  9460. return function() {
  9461. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9462. i = [e[n].apply(this, i)];
  9463. return i[0]
  9464. }
  9465. },
  9466. each: function(t, i, n) {
  9467. if (t)
  9468. if (e && t.forEach && t.forEach === e)
  9469. t.forEach(i, n);
  9470. else if (t.length === t.length + 0) {
  9471. for (var r = 0, o = t.length; r < o; r++)
  9472. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9473. return
  9474. } else
  9475. for (var r in t)
  9476. if (i.call(n, t[r], r) === this.BREAK)
  9477. return
  9478. },
  9479. defer: function(e) {
  9480. setTimeout(e, 0)
  9481. },
  9482. toArray: function(e) {
  9483. return e.toArray ? e.toArray() : t.call(e)
  9484. },
  9485. isUndefined: function(e) {
  9486. return void 0 === e
  9487. },
  9488. isNull: function(e) {
  9489. return null === e
  9490. },
  9491. isNaN: function(e) {
  9492. return e !== e
  9493. },
  9494. isArray: Array.isArray || function(e) {
  9495. return e.constructor === Array
  9496. }
  9497. ,
  9498. isObject: function(e) {
  9499. return e === Object(e)
  9500. },
  9501. isNumber: function(e) {
  9502. return e === e + 0
  9503. },
  9504. isString: function(e) {
  9505. return e === e + ""
  9506. },
  9507. isBoolean: function(e) {
  9508. return e === !1 || e === !0
  9509. },
  9510. isFunction: function(e) {
  9511. return "[object Function]" === Object.prototype.toString.call(e)
  9512. }
  9513. }
  9514. }(),
  9515. n.controllers.Controller = function(e) {
  9516. var t = function(e, t) {
  9517. this.initialValue = e[t],
  9518. this.domElement = document.createElement("div"),
  9519. this.object = e,
  9520. this.property = t,
  9521. this.__onChange = void 0,
  9522. this.__onFinishChange = void 0
  9523. };
  9524. return e.extend(t.prototype, {
  9525. onChange: function(e) {
  9526. return this.__onChange = e,
  9527. this
  9528. },
  9529. onFinishChange: function(e) {
  9530. return this.__onFinishChange = e,
  9531. this
  9532. },
  9533. setValue: function(e) {
  9534. return this.object[this.property] = e,
  9535. this.__onChange && this.__onChange.call(this, e),
  9536. this.updateDisplay(),
  9537. this
  9538. },
  9539. getValue: function() {
  9540. return this.object[this.property]
  9541. },
  9542. updateDisplay: function() {
  9543. return this
  9544. },
  9545. isModified: function() {
  9546. return this.initialValue !== this.getValue()
  9547. }
  9548. }),
  9549. t
  9550. }(n.utils.common),
  9551. n.dom.dom = function(e) {
  9552. function t(t) {
  9553. if ("0" === t || e.isUndefined(t))
  9554. return 0;
  9555. var i = t.match(r);
  9556. return e.isNull(i) ? 0 : parseFloat(i[1])
  9557. }
  9558. var i = {
  9559. HTMLEvents: ["change"],
  9560. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9561. KeyboardEvents: ["keydown"]
  9562. }
  9563. , n = {};
  9564. e.each(i, function(t, i) {
  9565. e.each(t, function(e) {
  9566. n[e] = i
  9567. })
  9568. });
  9569. var r = /(\d+(\.\d+)?)px/
  9570. , o = {
  9571. makeSelectable: function(e, t) {
  9572. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9573. return !1
  9574. }
  9575. : function() {}
  9576. ,
  9577. e.style.MozUserSelect = t ? "auto" : "none",
  9578. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9579. e.unselectable = t ? "on" : "off")
  9580. },
  9581. makeFullscreen: function(t, i, n) {
  9582. e.isUndefined(i) && (i = !0),
  9583. e.isUndefined(n) && (n = !0),
  9584. t.style.position = "absolute",
  9585. i && (t.style.left = 0,
  9586. t.style.right = 0),
  9587. n && (t.style.top = 0,
  9588. t.style.bottom = 0)
  9589. },
  9590. fakeEvent: function(t, i, r, o) {
  9591. r = r || {};
  9592. var a = n[i];
  9593. if (!a)
  9594. throw new Error("Event type " + i + " not supported.");
  9595. var s = document.createEvent(a);
  9596. switch (a) {
  9597. case "MouseEvents":
  9598. var l = r.x || r.clientX || 0
  9599. , c = r.y || r.clientY || 0;
  9600. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9601. break;
  9602. case "KeyboardEvents":
  9603. var h = s.initKeyboardEvent || s.initKeyEvent;
  9604. e.defaults(r, {
  9605. cancelable: !0,
  9606. ctrlKey: !1,
  9607. altKey: !1,
  9608. shiftKey: !1,
  9609. metaKey: !1,
  9610. keyCode: void 0,
  9611. charCode: void 0
  9612. }),
  9613. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9614. break;
  9615. default:
  9616. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9617. }
  9618. e.defaults(s, o),
  9619. t.dispatchEvent(s)
  9620. },
  9621. bind: function(e, t, i, n) {
  9622. return n = n || !1,
  9623. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9624. o
  9625. },
  9626. unbind: function(e, t, i, n) {
  9627. return n = n || !1,
  9628. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9629. o
  9630. },
  9631. addClass: function(e, t) {
  9632. if (void 0 === e.className)
  9633. e.className = t;
  9634. else if (e.className !== t) {
  9635. var i = e.className.split(/ +/);
  9636. i.indexOf(t) == -1 && (i.push(t),
  9637. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9638. }
  9639. return o
  9640. },
  9641. removeClass: function(e, t) {
  9642. if (t)
  9643. if (void 0 === e.className)
  9644. ;
  9645. else if (e.className === t)
  9646. e.removeAttribute("class");
  9647. else {
  9648. var i = e.className.split(/ +/)
  9649. , n = i.indexOf(t);
  9650. n != -1 && (i.splice(n, 1),
  9651. e.className = i.join(" "))
  9652. }
  9653. else
  9654. e.className = void 0;
  9655. return o
  9656. },
  9657. hasClass: function(e, t) {
  9658. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9659. },
  9660. getWidth: function(e) {
  9661. var i = getComputedStyle(e);
  9662. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9663. },
  9664. getHeight: function(e) {
  9665. var i = getComputedStyle(e);
  9666. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9667. },
  9668. getOffset: function(e) {
  9669. var t = {
  9670. left: 0,
  9671. top: 0
  9672. };
  9673. if (e.offsetParent)
  9674. do
  9675. t.left += e.offsetLeft,
  9676. t.top += e.offsetTop;
  9677. while (e = e.offsetParent);return t
  9678. },
  9679. isActive: function(e) {
  9680. return e === document.activeElement && (e.type || e.href)
  9681. }
  9682. };
  9683. return o
  9684. }(n.utils.common),
  9685. n.controllers.OptionController = function(e, t, i) {
  9686. var n = function(e, r, o) {
  9687. n.superclass.call(this, e, r);
  9688. var a = this;
  9689. if (this.__select = document.createElement("select"),
  9690. i.isArray(o)) {
  9691. var s = {};
  9692. i.each(o, function(e) {
  9693. s[e] = e
  9694. }),
  9695. o = s
  9696. }
  9697. i.each(o, function(e, t) {
  9698. var i = document.createElement("option");
  9699. i.innerHTML = t,
  9700. i.setAttribute("value", e),
  9701. a.__select.appendChild(i)
  9702. }),
  9703. this.updateDisplay(),
  9704. t.bind(this.__select, "change", function() {
  9705. var e = this.options[this.selectedIndex].value;
  9706. a.setValue(e)
  9707. }),
  9708. this.domElement.appendChild(this.__select)
  9709. };
  9710. return n.superclass = e,
  9711. i.extend(n.prototype, e.prototype, {
  9712. setValue: function(e) {
  9713. var t = n.superclass.prototype.setValue.call(this, e);
  9714. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9715. t
  9716. },
  9717. updateDisplay: function() {
  9718. return this.__select.value = this.getValue(),
  9719. n.superclass.prototype.updateDisplay.call(this)
  9720. }
  9721. }),
  9722. n
  9723. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9724. n.controllers.NumberController = function(e, t) {
  9725. function i(e) {
  9726. return e = e.toString(),
  9727. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9728. }
  9729. var n = function(e, r, o) {
  9730. n.superclass.call(this, e, r),
  9731. o = o || {},
  9732. this.__min = o.min,
  9733. this.__max = o.max,
  9734. this.__step = o.step,
  9735. t.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9736. this.__precision = i(this.__impliedStep)
  9737. };
  9738. return n.superclass = e,
  9739. t.extend(n.prototype, e.prototype, {
  9740. setValue: function(e) {
  9741. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9742. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9743. n.superclass.prototype.setValue.call(this, e)
  9744. },
  9745. min: function(e) {
  9746. return this.__min = e,
  9747. this
  9748. },
  9749. max: function(e) {
  9750. return this.__max = e,
  9751. this
  9752. },
  9753. step: function(e) {
  9754. return this.__step = e,
  9755. this.__impliedStep = e,
  9756. this.__precision = i(e),
  9757. this
  9758. }
  9759. }),
  9760. n
  9761. }(n.controllers.Controller, n.utils.common),
  9762. n.controllers.NumberControllerBox = function(e, t, i) {
  9763. function n(e, t) {
  9764. var i = Math.pow(10, t);
  9765. return Math.round(e * i) / i
  9766. }
  9767. var r = function(e, n, o) {
  9768. function a() {
  9769. var e = parseFloat(d.__input.value);
  9770. i.isNaN(e) || d.setValue(e)
  9771. }
  9772. function s() {
  9773. a(),
  9774. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9775. }
  9776. function l(e) {
  9777. t.bind(window, "mousemove", c),
  9778. t.bind(window, "mouseup", h),
  9779. u = e.clientY
  9780. }
  9781. function c(e) {
  9782. var t = u - e.clientY;
  9783. d.setValue(d.getValue() + t * d.__impliedStep),
  9784. u = e.clientY
  9785. }
  9786. function h() {
  9787. t.unbind(window, "mousemove", c),
  9788. t.unbind(window, "mouseup", h)
  9789. }
  9790. this.__truncationSuspended = !1,
  9791. r.superclass.call(this, e, n, o);
  9792. var u, d = this;
  9793. this.__input = document.createElement("input"),
  9794. this.__input.setAttribute("type", "text"),
  9795. t.bind(this.__input, "change", a),
  9796. t.bind(this.__input, "blur", s),
  9797. t.bind(this.__input, "mousedown", l),
  9798. t.bind(this.__input, "keydown", function(e) {
  9799. 13 === e.keyCode && (d.__truncationSuspended = !0,
  9800. this.blur(),
  9801. d.__truncationSuspended = !1)
  9802. }),
  9803. this.updateDisplay(),
  9804. this.domElement.appendChild(this.__input)
  9805. };
  9806. return r.superclass = e,
  9807. i.extend(r.prototype, e.prototype, {
  9808. updateDisplay: function() {
  9809. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  9810. r.superclass.prototype.updateDisplay.call(this)
  9811. }
  9812. }),
  9813. r
  9814. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  9815. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  9816. function o(e, t, i, n, r) {
  9817. return n + (r - n) * ((e - t) / (i - t))
  9818. }
  9819. var a = function(e, i, n, r, s) {
  9820. function l(e) {
  9821. t.bind(window, "mousemove", c),
  9822. t.bind(window, "mouseup", h),
  9823. c(e)
  9824. }
  9825. function c(e) {
  9826. e.preventDefault();
  9827. var i = t.getOffset(u.__background)
  9828. , n = t.getWidth(u.__background);
  9829. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  9830. !1
  9831. }
  9832. function h() {
  9833. t.unbind(window, "mousemove", c),
  9834. t.unbind(window, "mouseup", h),
  9835. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  9836. }
  9837. a.superclass.call(this, e, i, {
  9838. min: n,
  9839. max: r,
  9840. step: s
  9841. });
  9842. var u = this;
  9843. this.__background = document.createElement("div"),
  9844. this.__foreground = document.createElement("div"),
  9845. t.bind(this.__background, "mousedown", l),
  9846. t.addClass(this.__background, "slider"),
  9847. t.addClass(this.__foreground, "slider-fg"),
  9848. this.updateDisplay(),
  9849. this.__background.appendChild(this.__foreground),
  9850. this.domElement.appendChild(this.__background)
  9851. };
  9852. return a.superclass = e,
  9853. a.useDefaultStyles = function() {
  9854. i.inject(r)
  9855. }
  9856. ,
  9857. n.extend(a.prototype, e.prototype, {
  9858. updateDisplay: function() {
  9859. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9860. return this.__foreground.style.width = 100 * e + "%",
  9861. a.superclass.prototype.updateDisplay.call(this)
  9862. }
  9863. }),
  9864. a
  9865. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"),
  9866. n.controllers.FunctionController = function(e, t, i) {
  9867. var n = function(e, i, r) {
  9868. n.superclass.call(this, e, i);
  9869. var o = this;
  9870. this.__button = document.createElement("div"),
  9871. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  9872. t.bind(this.__button, "click", function(e) {
  9873. return e.preventDefault(),
  9874. o.fire(),
  9875. !1
  9876. }),
  9877. t.addClass(this.__button, "button"),
  9878. this.domElement.appendChild(this.__button)
  9879. };
  9880. return n.superclass = e,
  9881. i.extend(n.prototype, e.prototype, {
  9882. fire: function() {
  9883. this.__onChange && this.__onChange.call(this),
  9884. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9885. this.getValue().call(this.object)
  9886. }
  9887. }),
  9888. n
  9889. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9890. n.controllers.BooleanController = function(e, t, i) {
  9891. var n = function(e, i) {
  9892. function r() {
  9893. o.setValue(!o.__prev)
  9894. }
  9895. n.superclass.call(this, e, i);
  9896. var o = this;
  9897. this.__prev = this.getValue(),
  9898. this.__checkbox = document.createElement("input"),
  9899. this.__checkbox.setAttribute("type", "checkbox"),
  9900. t.bind(this.__checkbox, "change", r, !1),
  9901. this.domElement.appendChild(this.__checkbox),
  9902. this.updateDisplay()
  9903. };
  9904. return n.superclass = e,
  9905. i.extend(n.prototype, e.prototype, {
  9906. setValue: function(e) {
  9907. var t = n.superclass.prototype.setValue.call(this, e);
  9908. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9909. this.__prev = this.getValue(),
  9910. t
  9911. },
  9912. updateDisplay: function() {
  9913. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  9914. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9915. n.superclass.prototype.updateDisplay.call(this)
  9916. }
  9917. }),
  9918. n
  9919. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9920. n.color.toString = function(e) {
  9921. return function(t) {
  9922. if (1 == t.a || e.isUndefined(t.a)) {
  9923. for (var i = t.hex.toString(16); i.length < 6; )
  9924. i = "0" + i;
  9925. return "#" + i
  9926. }
  9927. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  9928. }
  9929. }(n.utils.common),
  9930. n.color.interpret = function(e, t) {
  9931. var i, n, r = function() {
  9932. n = !1;
  9933. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  9934. return t.each(o, function(r) {
  9935. if (r.litmus(e))
  9936. return t.each(r.conversions, function(r, o) {
  9937. if (i = r.read(e),
  9938. n === !1 && i !== !1)
  9939. return n = i,
  9940. i.conversionName = o,
  9941. i.conversion = r,
  9942. t.BREAK
  9943. }),
  9944. t.BREAK
  9945. }),
  9946. n
  9947. }, o = [{
  9948. litmus: t.isString,
  9949. conversions: {
  9950. THREE_CHAR_HEX: {
  9951. read: function(e) {
  9952. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9953. return null !== t && {
  9954. space: "HEX",
  9955. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9956. }
  9957. },
  9958. write: e
  9959. },
  9960. SIX_CHAR_HEX: {
  9961. read: function(e) {
  9962. var t = e.match(/^#([A-F0-9]{6})$/i);
  9963. return null !== t && {
  9964. space: "HEX",
  9965. hex: parseInt("0x" + t[1].toString())
  9966. }
  9967. },
  9968. write: e
  9969. },
  9970. CSS_RGB: {
  9971. read: function(e) {
  9972. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9973. return null !== t && {
  9974. space: "RGB",
  9975. r: parseFloat(t[1]),
  9976. g: parseFloat(t[2]),
  9977. b: parseFloat(t[3])
  9978. }
  9979. },
  9980. write: e
  9981. },
  9982. CSS_RGBA: {
  9983. read: function(e) {
  9984. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9985. return null !== t && {
  9986. space: "RGB",
  9987. r: parseFloat(t[1]),
  9988. g: parseFloat(t[2]),
  9989. b: parseFloat(t[3]),
  9990. a: parseFloat(t[4])
  9991. }
  9992. },
  9993. write: e
  9994. }
  9995. }
  9996. }, {
  9997. litmus: t.isNumber,
  9998. conversions: {
  9999. HEX: {
  10000. read: function(e) {
  10001. return {
  10002. space: "HEX",
  10003. hex: e,
  10004. conversionName: "HEX"
  10005. }
  10006. },
  10007. write: function(e) {
  10008. return e.hex
  10009. }
  10010. }
  10011. }
  10012. }, {
  10013. litmus: t.isArray,
  10014. conversions: {
  10015. RGB_ARRAY: {
  10016. read: function(e) {
  10017. return 3 == e.length && {
  10018. space: "RGB",
  10019. r: e[0],
  10020. g: e[1],
  10021. b: e[2]
  10022. }
  10023. },
  10024. write: function(e) {
  10025. return [e.r, e.g, e.b]
  10026. }
  10027. },
  10028. RGBA_ARRAY: {
  10029. read: function(e) {
  10030. return 4 == e.length && {
  10031. space: "RGB",
  10032. r: e[0],
  10033. g: e[1],
  10034. b: e[2],
  10035. a: e[3]
  10036. }
  10037. },
  10038. write: function(e) {
  10039. return [e.r, e.g, e.b, e.a]
  10040. }
  10041. }
  10042. }
  10043. }, {
  10044. litmus: t.isObject,
  10045. conversions: {
  10046. RGBA_OBJ: {
  10047. read: function(e) {
  10048. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10049. space: "RGB",
  10050. r: e.r,
  10051. g: e.g,
  10052. b: e.b,
  10053. a: e.a
  10054. }
  10055. },
  10056. write: function(e) {
  10057. return {
  10058. r: e.r,
  10059. g: e.g,
  10060. b: e.b,
  10061. a: e.a
  10062. }
  10063. }
  10064. },
  10065. RGB_OBJ: {
  10066. read: function(e) {
  10067. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10068. space: "RGB",
  10069. r: e.r,
  10070. g: e.g,
  10071. b: e.b
  10072. }
  10073. },
  10074. write: function(e) {
  10075. return {
  10076. r: e.r,
  10077. g: e.g,
  10078. b: e.b
  10079. }
  10080. }
  10081. },
  10082. HSVA_OBJ: {
  10083. read: function(e) {
  10084. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10085. space: "HSV",
  10086. h: e.h,
  10087. s: e.s,
  10088. v: e.v,
  10089. a: e.a
  10090. }
  10091. },
  10092. write: function(e) {
  10093. return {
  10094. h: e.h,
  10095. s: e.s,
  10096. v: e.v,
  10097. a: e.a
  10098. }
  10099. }
  10100. },
  10101. HSV_OBJ: {
  10102. read: function(e) {
  10103. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10104. space: "HSV",
  10105. h: e.h,
  10106. s: e.s,
  10107. v: e.v
  10108. }
  10109. },
  10110. write: function(e) {
  10111. return {
  10112. h: e.h,
  10113. s: e.s,
  10114. v: e.v
  10115. }
  10116. }
  10117. }
  10118. }
  10119. }];
  10120. return r
  10121. }(n.color.toString, n.utils.common),
  10122. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10123. function g(e, t, i, o) {
  10124. if (void 0 === t[i])
  10125. throw new Error("Object " + t + ' has no property "' + i + '"');
  10126. var a;
  10127. if (o.color)
  10128. a = new h(t,i);
  10129. else {
  10130. var s = [t, i].concat(o.factoryArgs);
  10131. a = n.apply(e, s)
  10132. }
  10133. o.before instanceof r && (o.before = o.before.__li),
  10134. A(e, a),
  10135. p.addClass(a.domElement, "c");
  10136. var l = document.createElement("span");
  10137. p.addClass(l, "property-name"),
  10138. l.innerHTML = a.property;
  10139. var c = document.createElement("div");
  10140. c.appendChild(l),
  10141. c.appendChild(a.domElement);
  10142. var u = m(e, c, o.before);
  10143. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10144. p.addClass(u, typeof a.getValue()),
  10145. v(e, u, a),
  10146. e.__controllers.push(a),
  10147. a
  10148. }
  10149. function m(e, t, i) {
  10150. var n = document.createElement("li");
  10151. return t && n.appendChild(t),
  10152. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10153. e.onResize(),
  10154. n
  10155. }
  10156. function v(e, t, i) {
  10157. if (i.__li = t,
  10158. i.__gui = e,
  10159. f.extend(i, {
  10160. options: function(t) {
  10161. return arguments.length > 1 ? (i.remove(),
  10162. g(e, i.object, i.property, {
  10163. before: i.__li.nextElementSibling,
  10164. factoryArgs: [f.toArray(arguments)]
  10165. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10166. g(e, i.object, i.property, {
  10167. before: i.__li.nextElementSibling,
  10168. factoryArgs: [t]
  10169. })) : void 0
  10170. },
  10171. name: function(e) {
  10172. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10173. i
  10174. },
  10175. listen: function() {
  10176. return i.__gui.listen(i),
  10177. i
  10178. },
  10179. remove: function() {
  10180. return i.__gui.remove(i),
  10181. i
  10182. }
  10183. }),
  10184. i instanceof l) {
  10185. var n = new s(i.object,i.property,{
  10186. min: i.__min,
  10187. max: i.__max,
  10188. step: i.__step
  10189. });
  10190. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10191. var t = i[e]
  10192. , r = n[e];
  10193. i[e] = n[e] = function() {
  10194. var e = Array.prototype.slice.call(arguments);
  10195. return t.apply(i, e),
  10196. r.apply(n, e)
  10197. }
  10198. }),
  10199. p.addClass(t, "has-slider"),
  10200. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10201. } else if (i instanceof s) {
  10202. var r = function(t) {
  10203. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10204. g(e, i.object, i.property, {
  10205. before: i.__li.nextElementSibling,
  10206. factoryArgs: [i.__min, i.__max, i.__step]
  10207. })) : t
  10208. };
  10209. i.min = f.compose(r, i.min),
  10210. i.max = f.compose(r, i.max)
  10211. } else
  10212. i instanceof o ? (p.bind(t, "click", function() {
  10213. p.fakeEvent(i.__checkbox, "click")
  10214. }),
  10215. p.bind(i.__checkbox, "click", function(e) {
  10216. e.stopPropagation()
  10217. })) : i instanceof a ? (p.bind(t, "click", function() {
  10218. p.fakeEvent(i.__button, "click")
  10219. }),
  10220. p.bind(t, "mouseover", function() {
  10221. p.addClass(i.__button, "hover")
  10222. }),
  10223. p.bind(t, "mouseout", function() {
  10224. p.removeClass(i.__button, "hover")
  10225. })) : i instanceof h && (p.addClass(t, "color"),
  10226. i.updateDisplay = f.compose(function(e) {
  10227. return t.style.borderLeftColor = i.__color.toString(),
  10228. e
  10229. }, i.updateDisplay),
  10230. i.updateDisplay());
  10231. i.setValue = f.compose(function(t) {
  10232. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10233. t
  10234. }, i.setValue)
  10235. }
  10236. function A(e, t) {
  10237. var i = e.getRoot()
  10238. , n = i.__rememberedObjects.indexOf(t.object);
  10239. if (n != -1) {
  10240. var r = i.__rememberedObjectIndecesToControllers[n];
  10241. if (void 0 === r && (r = {},
  10242. i.__rememberedObjectIndecesToControllers[n] = r),
  10243. r[t.property] = t,
  10244. i.load && i.load.remembered) {
  10245. var o, a = i.load.remembered;
  10246. if (a[e.preset])
  10247. o = a[e.preset];
  10248. else {
  10249. if (!a[L])
  10250. return;
  10251. o = a[L]
  10252. }
  10253. if (o[n] && void 0 !== o[n][t.property]) {
  10254. var s = o[n][t.property];
  10255. t.initialValue = s,
  10256. t.setValue(s)
  10257. }
  10258. }
  10259. }
  10260. }
  10261. function y(e, t) {
  10262. return document.location.href + "." + t
  10263. }
  10264. function C(e) {
  10265. var t = e.__save_row = document.createElement("li");
  10266. p.addClass(e.domElement, "has-save"),
  10267. e.__ul.insertBefore(t, e.__ul.firstChild),
  10268. p.addClass(t, "save-row");
  10269. var i = document.createElement("span");
  10270. i.innerHTML = "&nbsp;",
  10271. p.addClass(i, "button gears");
  10272. var n = document.createElement("span");
  10273. n.innerHTML = "Save",
  10274. p.addClass(n, "button"),
  10275. p.addClass(n, "save");
  10276. var r = document.createElement("span");
  10277. r.innerHTML = "New",
  10278. p.addClass(r, "button"),
  10279. p.addClass(r, "save-as");
  10280. var o = document.createElement("span");
  10281. o.innerHTML = "Revert",
  10282. p.addClass(o, "button"),
  10283. p.addClass(o, "revert");
  10284. var a = e.__preset_select = document.createElement("select");
  10285. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10286. w(e, i, i == e.preset)
  10287. }) : w(e, L, !1),
  10288. p.bind(a, "change", function() {
  10289. for (var t = 0; t < e.__preset_select.length; t++)
  10290. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10291. e.preset = this.value
  10292. }),
  10293. t.appendChild(a),
  10294. t.appendChild(i),
  10295. t.appendChild(n),
  10296. t.appendChild(r),
  10297. t.appendChild(o),
  10298. D) {
  10299. var s = document.getElementById("dg-save-locally")
  10300. , l = document.getElementById("dg-local-explain");
  10301. s.style.display = "block";
  10302. var c = document.getElementById("dg-local-storage");
  10303. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10304. var h = function() {
  10305. l.style.display = e.useLocalStorage ? "block" : "none"
  10306. };
  10307. h(),
  10308. p.bind(c, "change", function() {
  10309. e.useLocalStorage = !e.useLocalStorage,
  10310. h()
  10311. })
  10312. }
  10313. var u = document.getElementById("dg-new-constructor");
  10314. p.bind(u, "keydown", function(e) {
  10315. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10316. }),
  10317. p.bind(i, "click", function() {
  10318. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10319. S.show(),
  10320. u.focus(),
  10321. u.select()
  10322. }),
  10323. p.bind(n, "click", function() {
  10324. e.save()
  10325. }),
  10326. p.bind(r, "click", function() {
  10327. var t = prompt("Enter a new preset name.");
  10328. t && e.saveAs(t)
  10329. }),
  10330. p.bind(o, "click", function() {
  10331. e.revert()
  10332. })
  10333. }
  10334. function I(e) {
  10335. function t(t) {
  10336. return t.preventDefault(),
  10337. r = t.clientX,
  10338. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10339. p.bind(window, "mousemove", i),
  10340. p.bind(window, "mouseup", n),
  10341. !1
  10342. }
  10343. function i(t) {
  10344. return t.preventDefault(),
  10345. e.width += r - t.clientX,
  10346. e.onResize(),
  10347. r = t.clientX,
  10348. !1
  10349. }
  10350. function n() {
  10351. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10352. p.unbind(window, "mousemove", i),
  10353. p.unbind(window, "mouseup", n)
  10354. }
  10355. e.__resize_handle = document.createElement("div"),
  10356. f.extend(e.__resize_handle.style, {
  10357. width: "6px",
  10358. marginLeft: "-3px",
  10359. height: "200px",
  10360. cursor: "ew-resize",
  10361. position: "absolute"
  10362. });
  10363. var r;
  10364. p.bind(e.__resize_handle, "mousedown", t),
  10365. p.bind(e.__closeButton, "mousedown", t),
  10366. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10367. }
  10368. function E(e, t) {
  10369. e.domElement.style.width = t + "px",
  10370. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10371. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10372. }
  10373. function b(e, t) {
  10374. var i = {};
  10375. return f.each(e.__rememberedObjects, function(n, r) {
  10376. var o = {}
  10377. , a = e.__rememberedObjectIndecesToControllers[r];
  10378. f.each(a, function(e, i) {
  10379. o[i] = t ? e.initialValue : e.getValue()
  10380. }),
  10381. i[r] = o
  10382. }),
  10383. i
  10384. }
  10385. function w(e, t, i) {
  10386. var n = document.createElement("option");
  10387. n.innerHTML = t,
  10388. n.value = t,
  10389. e.__preset_select.appendChild(n),
  10390. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10391. }
  10392. function _(e) {
  10393. for (var t = 0; t < e.__preset_select.length; t++)
  10394. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10395. }
  10396. function T(e, t) {
  10397. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10398. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10399. }
  10400. function x(e) {
  10401. 0 != e.length && u(function() {
  10402. x(e)
  10403. }),
  10404. f.each(e, function(e) {
  10405. e.updateDisplay()
  10406. })
  10407. }
  10408. e.inject(i);
  10409. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10410. try {
  10411. return "localStorage"in window && null !== window.localStorage
  10412. } catch (e) {
  10413. return !1
  10414. }
  10415. }(), N = !0, B = !1, F = [], V = function(e) {
  10416. function t() {
  10417. var e = i.getRoot();
  10418. e.width += 1,
  10419. f.defer(function() {
  10420. e.width -= 1
  10421. })
  10422. }
  10423. var i = this;
  10424. this.domElement = document.createElement("div"),
  10425. this.__ul = document.createElement("ul"),
  10426. this.domElement.appendChild(this.__ul),
  10427. p.addClass(this.domElement, R),
  10428. this.__folders = {},
  10429. this.__controllers = [],
  10430. this.__rememberedObjects = [],
  10431. this.__rememberedObjectIndecesToControllers = [],
  10432. this.__listening = [],
  10433. e = e || {},
  10434. e = f.defaults(e, {
  10435. autoPlace: !0,
  10436. width: V.DEFAULT_WIDTH
  10437. }),
  10438. e = f.defaults(e, {
  10439. resizable: e.autoPlace,
  10440. hideable: e.autoPlace
  10441. }),
  10442. f.isUndefined(e.load) ? e.load = {
  10443. preset: L
  10444. } : e.preset && (e.load.preset = e.preset),
  10445. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10446. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10447. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10448. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10449. if (Object.defineProperties(this, {
  10450. parent: {
  10451. get: function() {
  10452. return e.parent
  10453. }
  10454. },
  10455. scrollable: {
  10456. get: function() {
  10457. return e.scrollable
  10458. }
  10459. },
  10460. autoPlace: {
  10461. get: function() {
  10462. return e.autoPlace
  10463. }
  10464. },
  10465. preset: {
  10466. get: function() {
  10467. return i.parent ? i.getRoot().preset : e.load.preset
  10468. },
  10469. set: function(t) {
  10470. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10471. _(this),
  10472. i.revert()
  10473. }
  10474. },
  10475. width: {
  10476. get: function() {
  10477. return e.width
  10478. },
  10479. set: function(t) {
  10480. e.width = t,
  10481. E(i, t)
  10482. }
  10483. },
  10484. name: {
  10485. get: function() {
  10486. return e.name
  10487. },
  10488. set: function(t) {
  10489. e.name = t,
  10490. a && (a.innerHTML = e.name)
  10491. }
  10492. },
  10493. closed: {
  10494. get: function() {
  10495. return e.closed
  10496. },
  10497. set: function(t) {
  10498. e.closed = t,
  10499. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10500. this.onResize(),
  10501. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10502. }
  10503. },
  10504. load: {
  10505. get: function() {
  10506. return e.load
  10507. }
  10508. },
  10509. useLocalStorage: {
  10510. get: function() {
  10511. return r
  10512. },
  10513. set: function(e) {
  10514. D && (r = e,
  10515. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10516. localStorage.setItem(y(i, "isLocal"), e))
  10517. }
  10518. }
  10519. }),
  10520. f.isUndefined(e.parent)) {
  10521. if (e.closed = !1,
  10522. p.addClass(this.domElement, V.CLASS_MAIN),
  10523. p.makeSelectable(this.domElement, !1),
  10524. D && r) {
  10525. i.useLocalStorage = !0;
  10526. var o = localStorage.getItem(y(this, "gui"));
  10527. o && (e.load = JSON.parse(o))
  10528. }
  10529. this.__closeButton = document.createElement("div"),
  10530. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10531. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10532. this.domElement.appendChild(this.__closeButton),
  10533. p.bind(this.__closeButton, "click", function() {
  10534. i.closed = !i.closed
  10535. })
  10536. } else {
  10537. void 0 === e.closed && (e.closed = !0);
  10538. var a = document.createTextNode(e.name);
  10539. p.addClass(a, "controller-name");
  10540. var s = m(i, a)
  10541. , l = function(e) {
  10542. return e.preventDefault(),
  10543. i.closed = !i.closed,
  10544. !1
  10545. };
  10546. p.addClass(this.__ul, V.CLASS_CLOSED),
  10547. p.addClass(s, "title"),
  10548. p.bind(s, "click", l),
  10549. e.closed || (this.closed = !1)
  10550. }
  10551. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10552. p.addClass(M, R),
  10553. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10554. document.body.appendChild(M),
  10555. N = !1),
  10556. M.appendChild(this.domElement),
  10557. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10558. this.parent || E(i, e.width)),
  10559. p.bind(window, "resize", function() {
  10560. i.onResize()
  10561. }),
  10562. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10563. i.onResize()
  10564. }),
  10565. p.bind(this.__ul, "transitionend", function() {
  10566. i.onResize()
  10567. }),
  10568. p.bind(this.__ul, "oTransitionEnd", function() {
  10569. i.onResize()
  10570. }),
  10571. this.onResize(),
  10572. e.resizable && I(this),
  10573. n = function() {
  10574. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10575. }
  10576. ,
  10577. this.saveToLocalStorageIfPossible = n;
  10578. i.getRoot();
  10579. e.parent || t()
  10580. };
  10581. return V.toggleHide = function() {
  10582. B = !B,
  10583. f.each(F, function(e) {
  10584. e.domElement.style.zIndex = B ? -999 : 999,
  10585. e.domElement.style.opacity = B ? 0 : 1
  10586. })
  10587. }
  10588. ,
  10589. V.CLASS_AUTO_PLACE = "a",
  10590. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10591. V.CLASS_MAIN = "main",
  10592. V.CLASS_CONTROLLER_ROW = "cr",
  10593. V.CLASS_TOO_TALL = "taller-than-window",
  10594. V.CLASS_CLOSED = "closed",
  10595. V.CLASS_CLOSE_BUTTON = "close-button",
  10596. V.CLASS_DRAG = "drag",
  10597. V.DEFAULT_WIDTH = 245,
  10598. V.TEXT_CLOSED = "Close Controls",
  10599. V.TEXT_OPEN = "Open Controls",
  10600. p.bind(window, "keydown", function(e) {
  10601. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10602. }, !1),
  10603. f.extend(V.prototype, {
  10604. add: function(e, t) {
  10605. return g(this, e, t, {
  10606. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10607. })
  10608. },
  10609. addColor: function(e, t) {
  10610. return g(this, e, t, {
  10611. color: !0
  10612. })
  10613. },
  10614. remove: function(e) {
  10615. this.__ul.removeChild(e.__li),
  10616. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10617. var t = this;
  10618. f.defer(function() {
  10619. t.onResize()
  10620. })
  10621. },
  10622. destroy: function() {
  10623. this.autoPlace && M.removeChild(this.domElement)
  10624. },
  10625. addFolder: function(e) {
  10626. if (void 0 !== this.__folders[e])
  10627. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10628. var t = {
  10629. name: e,
  10630. parent: this
  10631. };
  10632. t.autoPlace = this.autoPlace,
  10633. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10634. t.load = this.load.folders[e]);
  10635. var i = new V(t);
  10636. this.__folders[e] = i;
  10637. var n = m(this, i.domElement);
  10638. return p.addClass(n, "folder"),
  10639. i
  10640. },
  10641. open: function() {
  10642. this.closed = !1
  10643. },
  10644. close: function() {
  10645. this.closed = !0
  10646. },
  10647. onResize: function() {
  10648. var e = this.getRoot();
  10649. if (e.scrollable) {
  10650. var t = p.getOffset(e.__ul).top
  10651. , i = 0;
  10652. f.each(e.__ul.childNodes, function(t) {
  10653. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10654. }),
  10655. window.innerHeight - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10656. e.__ul.style.height = window.innerHeight - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10657. e.__ul.style.height = "auto")
  10658. }
  10659. e.__resize_handle && f.defer(function() {
  10660. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10661. }),
  10662. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10663. },
  10664. remember: function() {
  10665. if (f.isUndefined(S) && (S = new d,
  10666. S.domElement.innerHTML = t),
  10667. this.parent)
  10668. throw new Error("You can only call remember on a top level GUI.");
  10669. var e = this;
  10670. f.each(Array.prototype.slice.call(arguments), function(t) {
  10671. 0 == e.__rememberedObjects.length && C(e),
  10672. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10673. }),
  10674. this.autoPlace && E(this, this.width)
  10675. },
  10676. getRoot: function() {
  10677. for (var e = this; e.parent; )
  10678. e = e.parent;
  10679. return e
  10680. },
  10681. getSaveObject: function() {
  10682. var e = this.load;
  10683. return e.closed = this.closed,
  10684. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10685. e.remembered || (e.remembered = {}),
  10686. e.remembered[this.preset] = b(this)),
  10687. e.folders = {},
  10688. f.each(this.__folders, function(t, i) {
  10689. e.folders[i] = t.getSaveObject()
  10690. }),
  10691. e
  10692. },
  10693. save: function() {
  10694. this.load.remembered || (this.load.remembered = {}),
  10695. this.load.remembered[this.preset] = b(this),
  10696. T(this, !1),
  10697. this.saveToLocalStorageIfPossible()
  10698. },
  10699. saveAs: function(e) {
  10700. this.load.remembered || (this.load.remembered = {},
  10701. this.load.remembered[L] = b(this, !0)),
  10702. this.load.remembered[e] = b(this),
  10703. this.preset = e,
  10704. w(this, e, !0),
  10705. this.saveToLocalStorageIfPossible()
  10706. },
  10707. revert: function(e) {
  10708. f.each(this.__controllers, function(t) {
  10709. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10710. }, this),
  10711. f.each(this.__folders, function(e) {
  10712. e.revert(e)
  10713. }),
  10714. e || T(this.getRoot(), !1)
  10715. },
  10716. listen: function(e) {
  10717. var t = 0 == this.__listening.length;
  10718. this.__listening.push(e),
  10719. t && x(this.__listening)
  10720. }
  10721. }),
  10722. V
  10723. }(n.utils.css, '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>', ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", n.controllers.factory = function(e, t, i, n, r, o, a) {
  10724. return function(s, l) {
  10725. var c = s[l];
  10726. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  10727. min: arguments[2],
  10728. max: arguments[3]
  10729. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10730. }
  10731. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10732. var n = function(e, i) {
  10733. function r() {
  10734. a.setValue(a.__input.value)
  10735. }
  10736. function o() {
  10737. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10738. }
  10739. n.superclass.call(this, e, i);
  10740. var a = this;
  10741. this.__input = document.createElement("input"),
  10742. this.__input.setAttribute("type", "text"),
  10743. t.bind(this.__input, "keyup", r),
  10744. t.bind(this.__input, "change", r),
  10745. t.bind(this.__input, "blur", o),
  10746. t.bind(this.__input, "keydown", function(e) {
  10747. 13 === e.keyCode && this.blur()
  10748. }),
  10749. this.updateDisplay(),
  10750. this.domElement.appendChild(this.__input)
  10751. };
  10752. return n.superclass = e,
  10753. i.extend(n.prototype, e.prototype, {
  10754. updateDisplay: function() {
  10755. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10756. n.superclass.prototype.updateDisplay.call(this)
  10757. }
  10758. }),
  10759. n
  10760. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  10761. function o(e, t, i, n) {
  10762. e.style.background = "",
  10763. r.each(l, function(r) {
  10764. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10765. })
  10766. }
  10767. function a(e) {
  10768. e.style.background = "",
  10769. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10770. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10771. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10772. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10773. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10774. }
  10775. var s = function(e, l) {
  10776. function c(e) {
  10777. p(e),
  10778. t.bind(window, "mousemove", p),
  10779. t.bind(window, "mouseup", h)
  10780. }
  10781. function h() {
  10782. t.unbind(window, "mousemove", p),
  10783. t.unbind(window, "mouseup", h)
  10784. }
  10785. function u() {
  10786. var e = n(this.value);
  10787. e !== !1 ? (g.__color.__state = e,
  10788. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  10789. }
  10790. function d() {
  10791. t.unbind(window, "mousemove", f),
  10792. t.unbind(window, "mouseup", d)
  10793. }
  10794. function p(e) {
  10795. e.preventDefault();
  10796. var i = t.getWidth(g.__saturation_field)
  10797. , n = t.getOffset(g.__saturation_field)
  10798. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  10799. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10800. return o > 1 ? o = 1 : o < 0 && (o = 0),
  10801. r > 1 ? r = 1 : r < 0 && (r = 0),
  10802. g.__color.v = o,
  10803. g.__color.s = r,
  10804. g.setValue(g.__color.toOriginal()),
  10805. !1
  10806. }
  10807. function f(e) {
  10808. e.preventDefault();
  10809. var i = t.getHeight(g.__hue_field)
  10810. , n = t.getOffset(g.__hue_field)
  10811. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10812. return r > 1 ? r = 1 : r < 0 && (r = 0),
  10813. g.__color.h = 360 * r,
  10814. g.setValue(g.__color.toOriginal()),
  10815. !1
  10816. }
  10817. s.superclass.call(this, e, l),
  10818. this.__color = new i(this.getValue()),
  10819. this.__temp = new i(0);
  10820. var g = this;
  10821. this.domElement = document.createElement("div"),
  10822. t.makeSelectable(this.domElement, !1),
  10823. this.__selector = document.createElement("div"),
  10824. this.__selector.className = "selector",
  10825. this.__saturation_field = document.createElement("div"),
  10826. this.__saturation_field.className = "saturation-field",
  10827. this.__field_knob = document.createElement("div"),
  10828. this.__field_knob.className = "field-knob",
  10829. this.__field_knob_border = "2px solid ",
  10830. this.__hue_knob = document.createElement("div"),
  10831. this.__hue_knob.className = "hue-knob",
  10832. this.__hue_field = document.createElement("div"),
  10833. this.__hue_field.className = "hue-field",
  10834. this.__input = document.createElement("input"),
  10835. this.__input.type = "text",
  10836. this.__input_textShadow = "0 1px 1px ",
  10837. t.bind(this.__input, "keydown", function(e) {
  10838. 13 === e.keyCode && u.call(this)
  10839. }),
  10840. t.bind(this.__input, "blur", u),
  10841. t.bind(this.__selector, "mousedown", function(e) {
  10842. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10843. t.removeClass(g.__selector, "drag")
  10844. })
  10845. });
  10846. var m = document.createElement("div");
  10847. r.extend(this.__selector.style, {
  10848. width: "122px",
  10849. height: "102px",
  10850. padding: "3px",
  10851. backgroundColor: "#222",
  10852. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10853. }),
  10854. r.extend(this.__field_knob.style, {
  10855. position: "absolute",
  10856. width: "12px",
  10857. height: "12px",
  10858. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10859. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10860. borderRadius: "12px",
  10861. zIndex: 1
  10862. }),
  10863. r.extend(this.__hue_knob.style, {
  10864. position: "absolute",
  10865. width: "15px",
  10866. height: "2px",
  10867. borderRight: "4px solid #fff",
  10868. zIndex: 1
  10869. }),
  10870. r.extend(this.__saturation_field.style, {
  10871. width: "100px",
  10872. height: "100px",
  10873. border: "1px solid #555",
  10874. marginRight: "3px",
  10875. display: "inline-block",
  10876. cursor: "pointer"
  10877. }),
  10878. r.extend(m.style, {
  10879. width: "100%",
  10880. height: "100%",
  10881. background: "none"
  10882. }),
  10883. o(m, "top", "rgba(0,0,0,0)", "#000"),
  10884. r.extend(this.__hue_field.style, {
  10885. width: "15px",
  10886. height: "100px",
  10887. display: "inline-block",
  10888. border: "1px solid #555",
  10889. cursor: "ns-resize"
  10890. }),
  10891. a(this.__hue_field),
  10892. r.extend(this.__input.style, {
  10893. outline: "none",
  10894. textAlign: "center",
  10895. color: "#fff",
  10896. border: 0,
  10897. fontWeight: "bold",
  10898. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10899. }),
  10900. t.bind(this.__saturation_field, "mousedown", c),
  10901. t.bind(this.__field_knob, "mousedown", c),
  10902. t.bind(this.__hue_field, "mousedown", function(e) {
  10903. f(e),
  10904. t.bind(window, "mousemove", f),
  10905. t.bind(window, "mouseup", d)
  10906. }),
  10907. this.__saturation_field.appendChild(m),
  10908. this.__selector.appendChild(this.__field_knob),
  10909. this.__selector.appendChild(this.__saturation_field),
  10910. this.__selector.appendChild(this.__hue_field),
  10911. this.__hue_field.appendChild(this.__hue_knob),
  10912. this.domElement.appendChild(this.__input),
  10913. this.domElement.appendChild(this.__selector),
  10914. this.updateDisplay()
  10915. };
  10916. s.superclass = e,
  10917. r.extend(s.prototype, e.prototype, {
  10918. updateDisplay: function() {
  10919. var e = n(this.getValue());
  10920. if (e !== !1) {
  10921. var t = !1;
  10922. r.each(i.COMPONENTS, function(i) {
  10923. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  10924. return t = !0,
  10925. {}
  10926. }, this),
  10927. t && r.extend(this.__color.__state, e)
  10928. }
  10929. r.extend(this.__temp.__state, this.__color.__state),
  10930. this.__temp.a = 1;
  10931. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  10932. , s = 255 - a;
  10933. r.extend(this.__field_knob.style, {
  10934. marginLeft: 100 * this.__color.s - 7 + "px",
  10935. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10936. backgroundColor: this.__temp.toString(),
  10937. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  10938. }),
  10939. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10940. this.__temp.s = 1,
  10941. this.__temp.v = 1,
  10942. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10943. r.extend(this.__input.style, {
  10944. backgroundColor: this.__input.value = this.__color.toString(),
  10945. color: "rgb(" + a + "," + a + "," + a + ")",
  10946. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  10947. })
  10948. }
  10949. });
  10950. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10951. return s
  10952. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  10953. function r(e, t, i) {
  10954. Object.defineProperty(e, t, {
  10955. get: function() {
  10956. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  10957. this.__state[t])
  10958. },
  10959. set: function(e) {
  10960. "RGB" !== this.__state.space && (a(this, t, i),
  10961. this.__state.space = "RGB"),
  10962. this.__state[t] = e
  10963. }
  10964. })
  10965. }
  10966. function o(e, t) {
  10967. Object.defineProperty(e, t, {
  10968. get: function() {
  10969. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  10970. this.__state[t])
  10971. },
  10972. set: function(e) {
  10973. "HSV" !== this.__state.space && (s(this),
  10974. this.__state.space = "HSV"),
  10975. this.__state[t] = e
  10976. }
  10977. })
  10978. }
  10979. function a(e, i, r) {
  10980. if ("HEX" === e.__state.space)
  10981. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  10982. else {
  10983. if ("HSV" !== e.__state.space)
  10984. throw "Corrupted color state";
  10985. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  10986. }
  10987. }
  10988. function s(e) {
  10989. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  10990. n.extend(e.__state, {
  10991. s: i.s,
  10992. v: i.v
  10993. }),
  10994. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  10995. }
  10996. var l = function() {
  10997. if (this.__state = e.apply(this, arguments),
  10998. this.__state === !1)
  10999. throw "Failed to interpret color arguments";
  11000. this.__state.a = this.__state.a || 1
  11001. };
  11002. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11003. n.extend(l.prototype, {
  11004. toString: function() {
  11005. return i(this)
  11006. },
  11007. toOriginal: function() {
  11008. return this.__state.conversion.write(this)
  11009. }
  11010. }),
  11011. r(l.prototype, "r", 2),
  11012. r(l.prototype, "g", 1),
  11013. r(l.prototype, "b", 0),
  11014. o(l.prototype, "h"),
  11015. o(l.prototype, "s"),
  11016. o(l.prototype, "v"),
  11017. Object.defineProperty(l.prototype, "a", {
  11018. get: function() {
  11019. return this.__state.a
  11020. },
  11021. set: function(e) {
  11022. this.__state.a = e
  11023. }
  11024. }),
  11025. Object.defineProperty(l.prototype, "hex", {
  11026. get: function() {
  11027. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11028. this.__state.hex
  11029. },
  11030. set: function(e) {
  11031. this.__state.space = "HEX",
  11032. this.__state.hex = e
  11033. }
  11034. }),
  11035. l
  11036. }(n.color.interpret, n.color.math = function() {
  11037. var e;
  11038. return {
  11039. hsv_to_rgb: function(e, t, i) {
  11040. var n = Math.floor(e / 60) % 6
  11041. , r = e / 60 - Math.floor(e / 60)
  11042. , o = i * (1 - t)
  11043. , a = i * (1 - r * t)
  11044. , s = i * (1 - (1 - r) * t)
  11045. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11046. return {
  11047. r: 255 * l[0],
  11048. g: 255 * l[1],
  11049. b: 255 * l[2]
  11050. }
  11051. },
  11052. rgb_to_hsv: function(e, t, i) {
  11053. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11054. return 0 == a ? {
  11055. h: NaN,
  11056. s: 0,
  11057. v: 0
  11058. } : (r = s / a,
  11059. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11060. n /= 6,
  11061. n < 0 && (n += 1),
  11062. {
  11063. h: 360 * n,
  11064. s: r,
  11065. v: a / 255
  11066. })
  11067. },
  11068. rgb_to_hex: function(e, t, i) {
  11069. var n = this.hex_with_component(0, 2, e);
  11070. return n = this.hex_with_component(n, 1, t),
  11071. n = this.hex_with_component(n, 0, i)
  11072. },
  11073. component_from_hex: function(e, t) {
  11074. return e >> 8 * t & 255
  11075. },
  11076. hex_with_component: function(t, i, n) {
  11077. return n << (e = 8 * i) | t & ~(255 << e)
  11078. }
  11079. }
  11080. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11081. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11082. window.setTimeout(e, 1e3 / 60)
  11083. }
  11084. }(), n.dom.CenteredDiv = function(e, t) {
  11085. var i = function() {
  11086. this.backgroundElement = document.createElement("div"),
  11087. t.extend(this.backgroundElement.style, {
  11088. backgroundColor: "rgba(0,0,0,0.8)",
  11089. top: 0,
  11090. left: 0,
  11091. display: "none",
  11092. zIndex: "1000",
  11093. opacity: 0,
  11094. WebkitTransition: "opacity 0.2s linear"
  11095. }),
  11096. e.makeFullscreen(this.backgroundElement),
  11097. this.backgroundElement.style.position = "fixed",
  11098. this.domElement = document.createElement("div"),
  11099. t.extend(this.domElement.style, {
  11100. position: "fixed",
  11101. display: "none",
  11102. zIndex: "1001",
  11103. opacity: 0,
  11104. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11105. }),
  11106. document.body.appendChild(this.backgroundElement),
  11107. document.body.appendChild(this.domElement);
  11108. var i = this;
  11109. e.bind(this.backgroundElement, "click", function() {
  11110. i.hide()
  11111. })
  11112. };
  11113. return i.prototype.show = function() {
  11114. var e = this;
  11115. this.backgroundElement.style.display = "block",
  11116. this.domElement.style.display = "block",
  11117. this.domElement.style.opacity = 0,
  11118. this.domElement.style.webkitTransform = "scale(1.1)",
  11119. this.layout(),
  11120. t.defer(function() {
  11121. e.backgroundElement.style.opacity = 1,
  11122. e.domElement.style.opacity = 1,
  11123. e.domElement.style.webkitTransform = "scale(1)"
  11124. })
  11125. }
  11126. ,
  11127. i.prototype.hide = function() {
  11128. var t = this
  11129. , i = function() {
  11130. t.domElement.style.display = "none",
  11131. t.backgroundElement.style.display = "none",
  11132. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11133. e.unbind(t.domElement, "transitionend", i),
  11134. e.unbind(t.domElement, "oTransitionEnd", i)
  11135. };
  11136. e.bind(this.domElement, "webkitTransitionEnd", i),
  11137. e.bind(this.domElement, "transitionend", i),
  11138. e.bind(this.domElement, "oTransitionEnd", i),
  11139. this.backgroundElement.style.opacity = 0,
  11140. this.domElement.style.opacity = 0,
  11141. this.domElement.style.webkitTransform = "scale(1.1)"
  11142. }
  11143. ,
  11144. i.prototype.layout = function() {
  11145. this.domElement.style.left = $('#player').width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11146. this.domElement.style.top = $('#player').height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11147. }
  11148. ,
  11149. i
  11150. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11151. }
  11152. , {}],
  11153. 94: [function(e, t, i) {//"../lib/jpeg_encoder"
  11154. (function(e) {
  11155. "use strict";
  11156. function i(t) {
  11157. function i(e) {
  11158. 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++) {
  11159. var n = _((t[i] * e + 50) / 100);
  11160. n < 1 ? n = 1 : n > 255 && (n = 255),
  11161. T[G[i]] = n
  11162. }
  11163. 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++) {
  11164. var a = _((r[o] * e + 50) / 100);
  11165. a < 1 ? a = 1 : a > 255 && (a = 255),
  11166. x[G[o]] = a
  11167. }
  11168. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11169. for (var h = 0; h < 8; h++)
  11170. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11171. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11172. l++
  11173. }
  11174. function n(e, t) {
  11175. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11176. for (var a = 1; a <= e[o]; a++)
  11177. r[t[n]] = [],
  11178. r[t[n]][0] = i,
  11179. r[t[n]][1] = o,
  11180. n++,
  11181. i++;
  11182. i *= 2
  11183. }
  11184. return r
  11185. }
  11186. function r() {
  11187. C = n(z, W),
  11188. I = n(X, Z),
  11189. E = n(j, Y),
  11190. b = n(q, K)
  11191. }
  11192. function o() {
  11193. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11194. for (var n = e; n < t; n++)
  11195. P[32767 + n] = i,
  11196. R[32767 + n] = [],
  11197. R[32767 + n][1] = i,
  11198. R[32767 + n][0] = n;
  11199. for (var r = -(t - 1); r <= -e; r++)
  11200. P[32767 + r] = i,
  11201. R[32767 + r] = [],
  11202. R[32767 + r][1] = i,
  11203. R[32767 + r][0] = t - 1 + r;
  11204. e <<= 1,
  11205. t <<= 1
  11206. }
  11207. }
  11208. function a() {
  11209. for (var e = 0; e < 256; e++)
  11210. H[e] = 19595 * e,
  11211. H[e + 256 >> 0] = 38470 * e,
  11212. H[e + 512 >> 0] = 7471 * e + 32768,
  11213. H[e + 768 >> 0] = -11059 * e,
  11214. H[e + 1024 >> 0] = -21709 * e,
  11215. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11216. H[e + 1536 >> 0] = -27439 * e,
  11217. H[e + 1792 >> 0] = -5329 * e
  11218. }
  11219. function s(e) {
  11220. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11221. t & 1 << i && (N |= 1 << B),
  11222. i--,
  11223. B--,
  11224. B < 0 && (255 == N ? (l(255),
  11225. l(0)) : l(N),
  11226. B = 7,
  11227. N = 0)
  11228. }
  11229. function l(e) {
  11230. D.push(e)
  11231. }
  11232. function c(e) {
  11233. l(e >> 8 & 255),
  11234. l(255 & e)
  11235. }
  11236. function h(e, t) {
  11237. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11238. for (h = 0; h < d; ++h) {
  11239. i = e[u],
  11240. n = e[u + 1],
  11241. r = e[u + 2],
  11242. o = e[u + 3],
  11243. a = e[u + 4],
  11244. s = e[u + 5],
  11245. l = e[u + 6],
  11246. c = e[u + 7];
  11247. var f = i + c
  11248. , g = i - c
  11249. , m = n + l
  11250. , v = n - l
  11251. , A = r + s
  11252. , y = r - s
  11253. , C = o + a
  11254. , I = o - a
  11255. , E = f + C
  11256. , b = f - C
  11257. , w = m + A
  11258. , _ = m - A;
  11259. e[u] = E + w,
  11260. e[u + 4] = E - w;
  11261. var T = .707106781 * (_ + b);
  11262. e[u + 2] = b + T,
  11263. e[u + 6] = b - T,
  11264. E = I + y,
  11265. w = y + v,
  11266. _ = v + g;
  11267. var x = .382683433 * (E - _)
  11268. , S = .5411961 * E + x
  11269. , M = 1.306562965 * _ + x
  11270. , R = .707106781 * w
  11271. , P = g + R
  11272. , L = g - R;
  11273. e[u + 5] = L + S,
  11274. e[u + 3] = L - S,
  11275. e[u + 1] = P + M,
  11276. e[u + 7] = P - M,
  11277. u += 8
  11278. }
  11279. for (u = 0,
  11280. h = 0; h < d; ++h) {
  11281. i = e[u],
  11282. n = e[u + 8],
  11283. r = e[u + 16],
  11284. o = e[u + 24],
  11285. a = e[u + 32],
  11286. s = e[u + 40],
  11287. l = e[u + 48],
  11288. c = e[u + 56];
  11289. var D = i + c
  11290. , N = i - c
  11291. , B = n + l
  11292. , F = n - l
  11293. , V = r + s
  11294. , U = r - s
  11295. , k = o + a
  11296. , H = o - a
  11297. , G = D + k
  11298. , z = D - k
  11299. , W = B + V
  11300. , j = B - V;
  11301. e[u] = G + W,
  11302. e[u + 32] = G - W;
  11303. var Y = .707106781 * (j + z);
  11304. e[u + 16] = z + Y,
  11305. e[u + 48] = z - Y,
  11306. G = H + U,
  11307. W = U + F,
  11308. j = F + N;
  11309. var X = .382683433 * (G - j)
  11310. , Z = .5411961 * G + X
  11311. , q = 1.306562965 * j + X
  11312. , K = .707106781 * W
  11313. , Q = N + K
  11314. , J = N - K;
  11315. e[u + 40] = J + Z,
  11316. e[u + 24] = J - Z,
  11317. e[u + 8] = Q + q,
  11318. e[u + 56] = Q - q,
  11319. u++
  11320. }
  11321. var $;
  11322. for (h = 0; h < p; ++h)
  11323. $ = e[h] * t[h],
  11324. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11325. return O
  11326. }
  11327. function u() {
  11328. c(65504),
  11329. c(16),
  11330. l(74),
  11331. l(70),
  11332. l(73),
  11333. l(70),
  11334. l(0),
  11335. l(1),
  11336. l(1),
  11337. l(0),
  11338. c(1),
  11339. c(1),
  11340. l(0),
  11341. l(0)
  11342. }
  11343. function d(e, t) {
  11344. c(65472),
  11345. c(17),
  11346. l(8),
  11347. c(t),
  11348. c(e),
  11349. l(3),
  11350. l(1),
  11351. l(17),
  11352. l(0),
  11353. l(2),
  11354. l(17),
  11355. l(1),
  11356. l(3),
  11357. l(17),
  11358. l(1)
  11359. }
  11360. function p() {
  11361. c(65499),
  11362. c(132),
  11363. l(0);
  11364. for (var e = 0; e < 64; e++)
  11365. l(T[e]);
  11366. l(1);
  11367. for (var t = 0; t < 64; t++)
  11368. l(x[t])
  11369. }
  11370. function f() {
  11371. c(65476),
  11372. c(418),
  11373. l(0);
  11374. for (var e = 0; e < 16; e++)
  11375. l(z[e + 1]);
  11376. for (var t = 0; t <= 11; t++)
  11377. l(W[t]);
  11378. l(16);
  11379. for (var i = 0; i < 16; i++)
  11380. l(j[i + 1]);
  11381. for (var n = 0; n <= 161; n++)
  11382. l(Y[n]);
  11383. l(1);
  11384. for (var r = 0; r < 16; r++)
  11385. l(X[r + 1]);
  11386. for (var o = 0; o <= 11; o++)
  11387. l(Z[o]);
  11388. l(17);
  11389. for (var a = 0; a < 16; a++)
  11390. l(q[a + 1]);
  11391. for (var s = 0; s <= 161; s++)
  11392. l(K[s])
  11393. }
  11394. function g() {
  11395. c(65498),
  11396. c(12),
  11397. l(3),
  11398. l(1),
  11399. l(0),
  11400. l(2),
  11401. l(17),
  11402. l(3),
  11403. l(17),
  11404. l(0),
  11405. l(63),
  11406. l(0)
  11407. }
  11408. function m(e, t, i, n, r) {
  11409. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11410. L[G[f]] = p[f];
  11411. var g = L[0] - i;
  11412. i = L[0],
  11413. 0 == g ? s(n[0]) : (o = 32767 + g,
  11414. s(n[P[o]]),
  11415. s(R[o]));
  11416. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11417. ;
  11418. if (0 == m)
  11419. return s(a),
  11420. i;
  11421. for (var v, A = 1; A <= m; ) {
  11422. for (var y = A; 0 == L[A] && A <= m; ++A)
  11423. ;
  11424. var C = A - y;
  11425. if (C >= c) {
  11426. v = C >> 4;
  11427. for (var I = 1; I <= v; ++I)
  11428. s(l);
  11429. C &= 15
  11430. }
  11431. o = 32767 + L[A],
  11432. s(r[(C << 4) + P[o]]),
  11433. s(R[o]),
  11434. A++
  11435. }
  11436. return m != u && s(a),
  11437. i
  11438. }
  11439. function v() {
  11440. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11441. k[t] = e(t)
  11442. }
  11443. function A(e) {
  11444. if (e <= 0 && (e = 1),
  11445. e > 100 && (e = 100),
  11446. w != e) {
  11447. var t = 0;
  11448. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11449. i(t),
  11450. w = e
  11451. }
  11452. }
  11453. function y() {
  11454. var e = (new Date).getTime();
  11455. t || (t = 50),
  11456. v(),
  11457. r(),
  11458. o(),
  11459. a(),
  11460. A(t);
  11461. (new Date).getTime() - e
  11462. }
  11463. var C, I, E, b, w, _ = (Math.round,
  11464. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11465. this.encode = function(t, i) {
  11466. var n = ((new Date).getTime(),
  11467. i.quality);
  11468. n && A(n),
  11469. D = new Array,
  11470. N = 0,
  11471. B = 7,
  11472. c(65496),
  11473. u(),
  11474. p(),
  11475. d(t.width, t.height),
  11476. f(),
  11477. g();
  11478. var r = 0
  11479. , o = 0
  11480. , a = 0;
  11481. N = 0,
  11482. B = 7,
  11483. this.encode.displayName = "_encode_";
  11484. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; k && z > 0 || !k && z < L; ) {
  11485. for (l = 0; l < G; ) {
  11486. for (w = G * z + l,
  11487. _ = w,
  11488. T = -1,
  11489. x = 0,
  11490. R = 0; R < 64; R++)
  11491. x = (k ? 63 - R : R) >> 3,
  11492. T = 4 * (7 & R),
  11493. _ = w + x * G + T,
  11494. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11495. l + T >= G && (_ -= l + T - G + 4),
  11496. h = P[_++],
  11497. v = P[_++],
  11498. y = P[_++],
  11499. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11500. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11501. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11502. r = m(F, S, r, C, E),
  11503. o = m(V, M, o, I, b),
  11504. a = m(U, M, a, I, b),
  11505. l += 32
  11506. }
  11507. z += W
  11508. }
  11509. if (B >= 0) {
  11510. var j = [];
  11511. j[1] = B + 1,
  11512. j[0] = (1 << B + 1) - 1,
  11513. s(j)
  11514. }
  11515. return c(65497),
  11516. new e(D)
  11517. }
  11518. ,
  11519. y()
  11520. }
  11521. function n(e, t) {
  11522. t = t || {},
  11523. t.quality = t.quality || 50;
  11524. var n = t.quality
  11525. , r = new i(n)
  11526. , o = r.encode(e, t);
  11527. return {
  11528. data: o,
  11529. width: e.width,
  11530. height: e.height
  11531. }
  11532. }
  11533. t.exports.encode = n
  11534. }
  11535. ).call(this, e("buffer").Buffer)
  11536. }
  11537. , {
  11538. buffer: 198
  11539. }],
  11540. 95: [function(e, t, i) {//"./lib/performance-polyfill"
  11541. "use strict";
  11542. !function() {
  11543. if ("performance"in window == !1 && (window.performance = {}),
  11544. Date.now = Date.now || function() {
  11545. return (new Date).getTime()
  11546. }
  11547. ,
  11548. "now"in window.performance == !1) {
  11549. var e = Date.now();
  11550. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11551. window.performance.now = function() {
  11552. return Date.now() - e
  11553. }
  11554. }
  11555. }()
  11556. }
  11557. , {}],
  11558. 96: [function(e, t, i) {//"./lib/postprocessing/EffectComposer.js"
  11559. "use strict";
  11560. var n = e("three");
  11561. n.EffectComposer = function(e, t) {
  11562. if (this.renderer = e,
  11563. void 0 === t) {
  11564. var i = {
  11565. minFilter: n.LinearFilter,
  11566. magFilter: n.LinearFilter,
  11567. format: n.RGBAFormat,
  11568. stencilBuffer: !1
  11569. }
  11570. , r = e.getSize();
  11571. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11572. }
  11573. this.renderTarget1 = t,
  11574. this.renderTarget2 = t.clone(),
  11575. this.writeBuffer = this.renderTarget1,
  11576. this.readBuffer = this.renderTarget2,
  11577. this.passes = [],
  11578. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11579. this.copyPass = new n.ShaderPass(n.CopyShader)
  11580. }
  11581. ,
  11582. n.EffectComposer.prototype = {
  11583. swapBuffers: function() {
  11584. var e = this.readBuffer;
  11585. this.readBuffer = this.writeBuffer,
  11586. this.writeBuffer = e
  11587. },
  11588. addPass: function(e) {
  11589. this.passes.push(e)
  11590. },
  11591. insertPass: function(e, t) {
  11592. this.passes.splice(t, 0, e)
  11593. },
  11594. render: function(e) {
  11595. this.writeBuffer = this.renderTarget1,
  11596. this.readBuffer = this.renderTarget2;
  11597. var t, i, r = !1, o = this.passes.length;
  11598. for (i = 0; i < o; i++)
  11599. if (t = this.passes[i],
  11600. t.enabled) {
  11601. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11602. t.needsSwap) {
  11603. if (r) {
  11604. var a = this.renderer.context;
  11605. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11606. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11607. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11608. }
  11609. this.swapBuffers()
  11610. }
  11611. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11612. }
  11613. },
  11614. reset: function(e) {
  11615. if (void 0 === e) {
  11616. var t = this.renderer.getSize();
  11617. e = this.renderTarget1.clone(),
  11618. e.setSize(t.width, t.height)
  11619. }
  11620. this.renderTarget1.dispose(),
  11621. this.renderTarget2.dispose(),
  11622. this.renderTarget1 = e,
  11623. this.renderTarget2 = e.clone(),
  11624. this.writeBuffer = this.renderTarget1,
  11625. this.readBuffer = this.renderTarget2
  11626. },
  11627. setSize: function(e, t) {
  11628. this.renderTarget1.setSize(e, t),
  11629. this.renderTarget2.setSize(e, t)
  11630. }
  11631. }
  11632. }
  11633. , {
  11634. three: 217
  11635. }],
  11636. 97: [function(e, t, i) {//"./lib/postprocessing/MaskPass.js"
  11637. "use strict";
  11638. var n = e("three");
  11639. n.MaskPass = function(e, t) {
  11640. this.scene = e,
  11641. this.camera = t,
  11642. this.enabled = !0,
  11643. this.clear = !0,
  11644. this.needsSwap = !1,
  11645. this.inverse = !1
  11646. }
  11647. ,
  11648. n.MaskPass.prototype = {
  11649. render: function(e, t, i, n) {
  11650. var r = e.context;
  11651. r.colorMask(!1, !1, !1, !1),
  11652. r.depthMask(!1);
  11653. var o, a;
  11654. this.inverse ? (o = 0,
  11655. a = 1) : (o = 1,
  11656. a = 0),
  11657. r.enable(r.STENCIL_TEST),
  11658. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11659. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11660. r.clearStencil(a),
  11661. e.render(this.scene, this.camera, i, this.clear),
  11662. e.render(this.scene, this.camera, t, this.clear),
  11663. r.colorMask(!0, !0, !0, !0),
  11664. r.depthMask(!0),
  11665. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11666. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11667. }
  11668. },
  11669. n.ClearMaskPass = function() {
  11670. this.enabled = !0
  11671. }
  11672. ,
  11673. n.ClearMaskPass.prototype = {
  11674. render: function(e, t, i, n) {
  11675. var r = e.context;
  11676. r.disable(r.STENCIL_TEST)
  11677. }
  11678. }
  11679. }
  11680. , {
  11681. three: 217
  11682. }],
  11683. 98: [function(e, t, i) {//"./lib/postprocessing/RenderPass.js"
  11684. "use strict";
  11685. var n = e("three");
  11686. n.RenderPass = function(e, t, i, r, o) {
  11687. this.scene = e,
  11688. this.camera = t,
  11689. this.overrideMaterial = i,
  11690. this.clearColor = r,
  11691. this.clearAlpha = void 0 !== o ? o : 1,
  11692. this.oldClearColor = new n.Color,
  11693. this.oldClearAlpha = 1,
  11694. this.enabled = !0,
  11695. this.clear = !0,
  11696. this.needsSwap = !1
  11697. }
  11698. ,
  11699. n.RenderPass.prototype = {
  11700. render: function(e, t, i, n) {
  11701. this.scene.overrideMaterial = this.overrideMaterial,
  11702. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11703. this.oldClearAlpha = e.getClearAlpha(),
  11704. e.setClearColor(this.clearColor, this.clearAlpha)),
  11705. e.render(this.scene, this.camera, i, this.clear),
  11706. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11707. this.scene.overrideMaterial = null
  11708. }
  11709. }
  11710. }
  11711. , {
  11712. three: 217
  11713. }],
  11714. 99: [function(e, t, i) {//"./lib/postprocessing/ShaderPass.js"
  11715. "use strict";
  11716. var n = e("three");
  11717. n.ShaderPass = function(e, t) {
  11718. this.textureID = void 0 !== t ? t : "tDiffuse",
  11719. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11720. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11721. this.material = new n.ShaderMaterial({
  11722. defines: e.defines || {},
  11723. uniforms: this.uniforms,
  11724. vertexShader: e.vertexShader,
  11725. fragmentShader: e.fragmentShader
  11726. })),
  11727. this.renderToScreen = !1,
  11728. this.enabled = !0,
  11729. this.needsSwap = !0,
  11730. this.clear = !1,
  11731. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11732. this.scene = new n.Scene,
  11733. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11734. this.scene.add(this.quad)
  11735. }
  11736. ,
  11737. n.ShaderPass.prototype = {
  11738. render: function(e, t, i, n) {
  11739. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11740. this.quad.material = this.material,
  11741. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11742. }
  11743. }
  11744. }
  11745. , {
  11746. three: 217
  11747. }],
  11748. 100: [function(e, t, i) {//"./lib/shaders/CopyShader.js"
  11749. "use strict";
  11750. var n = e("three");
  11751. n.CopyShader = {
  11752. uniforms: {
  11753. tDiffuse: {
  11754. type: "t",
  11755. value: null
  11756. },
  11757. opacity: {
  11758. type: "f",
  11759. value: 1
  11760. }
  11761. },
  11762. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11763. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11764. }
  11765. }
  11766. , {
  11767. three: 217
  11768. }],
  11769. 101: [function(e, t, i) {//"./lib/shaders/HorizontalBlurShader.js"
  11770. "use strict";
  11771. var n = e("three");
  11772. n.HorizontalBlurShader = {
  11773. uniforms: {
  11774. tDiffuse: {
  11775. type: "t",
  11776. value: null
  11777. },
  11778. h: {
  11779. type: "f",
  11780. value: 1 / 512
  11781. }
  11782. },
  11783. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11784. 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")
  11785. }
  11786. }
  11787. , {
  11788. three: 217
  11789. }],
  11790. 102: [function(e, t, i) {//"./lib/shaders/VerticalBlurShader.js"
  11791. "use strict";
  11792. var n = e("three");
  11793. n.VerticalBlurShader = {
  11794. uniforms: {
  11795. tDiffuse: {
  11796. type: "t",
  11797. value: null
  11798. },
  11799. v: {
  11800. type: "f",
  11801. value: 1 / 512
  11802. }
  11803. },
  11804. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11805. 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")
  11806. }
  11807. }
  11808. , {
  11809. three: 217
  11810. }],
  11811. 103: [function(e, t, i) {//"./lib/three75-shim"
  11812. "use strict";
  11813. var n = e("three");
  11814. !function() {
  11815. if ("performance"in window == 0 && (window.performance = {}),
  11816. "now"in window.performance == 0) {
  11817. var e = Date.now();
  11818. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11819. window.performance.now = function() {
  11820. return Date.now() - e
  11821. }
  11822. }
  11823. }(),
  11824. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11825. var t, i = this.extensions, r = this.context;
  11826. if (e === n.RepeatWrapping)
  11827. return r.REPEAT;
  11828. if (e === n.ClampToEdgeWrapping)
  11829. return r.CLAMP_TO_EDGE;
  11830. if (e === n.MirroredRepeatWrapping)
  11831. return r.MIRRORED_REPEAT;
  11832. if (e === n.NearestFilter)
  11833. return r.NEAREST;
  11834. if (e === n.NearestMipMapNearestFilter)
  11835. return r.NEAREST_MIPMAP_NEAREST;
  11836. if (e === n.NearestMipMapLinearFilter)
  11837. return r.NEAREST_MIPMAP_LINEAR;
  11838. if (e === n.LinearFilter)
  11839. return r.LINEAR;
  11840. if (e === n.LinearMipMapNearestFilter)
  11841. return r.LINEAR_MIPMAP_NEAREST;
  11842. if (e === n.LinearMipMapLinearFilter)
  11843. return r.LINEAR_MIPMAP_LINEAR;
  11844. if (e === n.UnsignedByteType)
  11845. return r.UNSIGNED_BYTE;
  11846. if (e === n.UnsignedShort4444Type)
  11847. return r.UNSIGNED_SHORT_4_4_4_4;
  11848. if (e === n.UnsignedShort5551Type)
  11849. return r.UNSIGNED_SHORT_5_5_5_1;
  11850. if (e === n.UnsignedShort565Type)
  11851. return r.UNSIGNED_SHORT_5_6_5;
  11852. if (e === n.ByteType)
  11853. return r.BYTE;
  11854. if (e === n.ShortType)
  11855. return r.SHORT;
  11856. if (e === n.UnsignedShortType)
  11857. return r.UNSIGNED_SHORT;
  11858. if (e === n.IntType)
  11859. return r.INT;
  11860. if (e === n.UnsignedIntType)
  11861. return r.UNSIGNED_INT;
  11862. if (e === n.FloatType)
  11863. return r.FLOAT;
  11864. if (t = i.get("OES_texture_half_float"),
  11865. null !== t && e === n.HalfFloatType)
  11866. return t.HALF_FLOAT_OES;
  11867. if (e === n.AlphaFormat)
  11868. return r.ALPHA;
  11869. if (e === n.RGBFormat)
  11870. return r.RGB;
  11871. if (e === n.RGBAFormat)
  11872. return r.RGBA;
  11873. if (e === n.LuminanceFormat)
  11874. return r.LUMINANCE;
  11875. if (e === n.LuminanceAlphaFormat)
  11876. return r.LUMINANCE_ALPHA;
  11877. if (e === n.AddEquation)
  11878. return r.FUNC_ADD;
  11879. if (e === n.SubtractEquation)
  11880. return r.FUNC_SUBTRACT;
  11881. if (e === n.ReverseSubtractEquation)
  11882. return r.FUNC_REVERSE_SUBTRACT;
  11883. if (e === n.ZeroFactor)
  11884. return r.ZERO;
  11885. if (e === n.OneFactor)
  11886. return r.ONE;
  11887. if (e === n.SrcColorFactor)
  11888. return r.SRC_COLOR;
  11889. if (e === n.OneMinusSrcColorFactor)
  11890. return r.ONE_MINUS_SRC_COLOR;
  11891. if (e === n.SrcAlphaFactor)
  11892. return r.SRC_ALPHA;
  11893. if (e === n.OneMinusSrcAlphaFactor)
  11894. return r.ONE_MINUS_SRC_ALPHA;
  11895. if (e === n.DstAlphaFactor)
  11896. return r.DST_ALPHA;
  11897. if (e === n.OneMinusDstAlphaFactor)
  11898. return r.ONE_MINUS_DST_ALPHA;
  11899. if (e === n.DstColorFactor)
  11900. return r.DST_COLOR;
  11901. if (e === n.OneMinusDstColorFactor)
  11902. return r.ONE_MINUS_DST_COLOR;
  11903. if (e === n.SrcAlphaSaturateFactor)
  11904. return r.SRC_ALPHA_SATURATE;
  11905. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  11906. null !== t) {
  11907. if (e === n.RGB_S3TC_DXT1_Format)
  11908. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11909. if (e === n.RGBA_S3TC_DXT1_Format)
  11910. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11911. if (e === n.RGBA_S3TC_DXT3_Format)
  11912. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11913. if (e === n.RGBA_S3TC_DXT5_Format)
  11914. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11915. }
  11916. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  11917. null !== t) {
  11918. if (e === n.RGB_PVRTC_4BPPV1_Format)
  11919. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11920. if (e === n.RGB_PVRTC_2BPPV1_Format)
  11921. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11922. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  11923. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11924. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  11925. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11926. }
  11927. if (t = i.get("WEBGL_compressed_texture_etc1"),
  11928. null !== t && e === n.RGB_ETC1_Format)
  11929. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11930. if (t = i.get("EXT_blend_minmax"),
  11931. null !== t) {
  11932. if (e === n.MinEquation)
  11933. return t.MIN_EXT;
  11934. if (e === n.MaxEquation)
  11935. return t.MAX_EXT
  11936. }
  11937. return 0
  11938. }
  11939. ,
  11940. n.WebGLState = function(e, t, i) {
  11941. var r = this
  11942. , o = new n.Vector4
  11943. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  11944. , s = new Uint8Array(a)
  11945. , l = new Uint8Array(a)
  11946. , c = new Uint8Array(a)
  11947. , h = {}
  11948. , u = null
  11949. , d = null
  11950. , p = null
  11951. , f = null
  11952. , g = null
  11953. , m = null
  11954. , v = null
  11955. , A = null
  11956. , y = !1
  11957. , C = null
  11958. , I = null
  11959. , E = null
  11960. , b = null
  11961. , w = null
  11962. , _ = null
  11963. , T = null
  11964. , x = null
  11965. , S = null
  11966. , M = null
  11967. , R = null
  11968. , P = null
  11969. , O = null
  11970. , L = null
  11971. , D = null
  11972. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  11973. , B = void 0
  11974. , F = {}
  11975. , V = new n.Vector4
  11976. , U = null
  11977. , k = null
  11978. , H = new n.Vector4
  11979. , G = new n.Vector4;
  11980. this.init = function() {
  11981. this.clearColor(0, 0, 0, 1),
  11982. this.clearDepth(1),
  11983. this.clearStencil(0),
  11984. this.enable(e.DEPTH_TEST),
  11985. e.depthFunc(e.LEQUAL),
  11986. e.frontFace(e.CCW),
  11987. e.cullFace(e.BACK),
  11988. this.enable(e.CULL_FACE),
  11989. this.enable(e.BLEND),
  11990. e.blendEquation(e.FUNC_ADD),
  11991. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  11992. }
  11993. ,
  11994. this.initAttributes = function() {
  11995. for (var e = 0, t = s.length; e < t; e++)
  11996. s[e] = 0
  11997. }
  11998. ,
  11999. this.enableAttribute = function(i) {
  12000. if (s[i] = 1,
  12001. 0 === l[i] && (e.enableVertexAttribArray(i),
  12002. l[i] = 1),
  12003. 0 !== c[i]) {
  12004. var n = t.get("ANGLE_instanced_arrays");
  12005. n.vertexAttribDivisorANGLE(i, 0),
  12006. c[i] = 0
  12007. }
  12008. }
  12009. ,
  12010. this.enableAttributeAndDivisor = function(t, i, n) {
  12011. s[t] = 1,
  12012. 0 === l[t] && (e.enableVertexAttribArray(t),
  12013. l[t] = 1),
  12014. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12015. c[t] = i)
  12016. }
  12017. ,
  12018. this.disableUnusedAttributes = function() {
  12019. for (var t = 0, i = l.length; t < i; t++)
  12020. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12021. l[t] = 0)
  12022. }
  12023. ,
  12024. this.enable = function(t) {
  12025. h[t] !== !0 && (e.enable(t),
  12026. h[t] = !0)
  12027. }
  12028. ,
  12029. this.disable = function(t) {
  12030. h[t] !== !1 && (e.disable(t),
  12031. h[t] = !1)
  12032. }
  12033. ,
  12034. this.getCompressedTextureFormats = function() {
  12035. if (null === u && (u = [],
  12036. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12037. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12038. u.push(i[n]);
  12039. return u
  12040. }
  12041. ,
  12042. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12043. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12044. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12045. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12046. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12047. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12048. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12049. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12050. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12051. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12052. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12053. d = t,
  12054. y = h),
  12055. t === n.CustomBlending ? (s = s || r,
  12056. l = l || o,
  12057. c = c || a,
  12058. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12059. p = r,
  12060. m = s),
  12061. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12062. f = o,
  12063. g = a,
  12064. v = l,
  12065. A = c)) : (p = null,
  12066. f = null,
  12067. g = null,
  12068. m = null,
  12069. v = null,
  12070. A = null)
  12071. }
  12072. ,
  12073. this.setDepthFunc = function(t) {
  12074. if (C !== t) {
  12075. if (t)
  12076. switch (t) {
  12077. case n.NeverDepth:
  12078. e.depthFunc(e.NEVER);
  12079. break;
  12080. case n.AlwaysDepth:
  12081. e.depthFunc(e.ALWAYS);
  12082. break;
  12083. case n.LessDepth:
  12084. e.depthFunc(e.LESS);
  12085. break;
  12086. case n.LessEqualDepth:
  12087. e.depthFunc(e.LEQUAL);
  12088. break;
  12089. case n.EqualDepth:
  12090. e.depthFunc(e.EQUAL);
  12091. break;
  12092. case n.GreaterEqualDepth:
  12093. e.depthFunc(e.GEQUAL);
  12094. break;
  12095. case n.GreaterDepth:
  12096. e.depthFunc(e.GREATER);
  12097. break;
  12098. case n.NotEqualDepth:
  12099. e.depthFunc(e.NOTEQUAL);
  12100. break;
  12101. default:
  12102. e.depthFunc(e.LEQUAL)
  12103. }
  12104. else
  12105. e.depthFunc(e.LEQUAL);
  12106. C = t
  12107. }
  12108. }
  12109. ,
  12110. this.setDepthTest = function(t) {
  12111. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12112. }
  12113. ,
  12114. this.setDepthWrite = function(t) {
  12115. I !== t && (e.depthMask(t),
  12116. I = t)
  12117. }
  12118. ,
  12119. this.setColorWrite = function(t) {
  12120. E !== t && (e.colorMask(t, t, t, t),
  12121. E = t)
  12122. }
  12123. ,
  12124. this.setStencilFunc = function(t, i, n) {
  12125. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12126. w = t,
  12127. _ = i,
  12128. T = n)
  12129. }
  12130. ,
  12131. this.setStencilOp = function(t, i, n) {
  12132. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12133. x = t,
  12134. S = i,
  12135. M = n)
  12136. }
  12137. ,
  12138. this.setStencilTest = function(t) {
  12139. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12140. }
  12141. ,
  12142. this.setStencilWrite = function(t) {
  12143. b !== t && (e.stencilMask(t),
  12144. b = t)
  12145. }
  12146. ,
  12147. this.setFlipSided = function(t) {
  12148. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12149. R = t)
  12150. }
  12151. ,
  12152. this.setLineWidth = function(t) {
  12153. t !== P && (e.lineWidth(t),
  12154. P = t)
  12155. }
  12156. ,
  12157. this.setPolygonOffset = function(t, i, n) {
  12158. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12159. !t || O === i && L === n || (e.polygonOffset(i, n),
  12160. O = i,
  12161. L = n)
  12162. }
  12163. ,
  12164. this.getScissorTest = function() {
  12165. return D
  12166. }
  12167. ,
  12168. this.setScissorTest = function(t) {
  12169. D = t,
  12170. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12171. }
  12172. ,
  12173. this.activeTexture = function(t) {
  12174. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12175. B !== t && (e.activeTexture(t),
  12176. B = t)
  12177. }
  12178. ,
  12179. this.bindTexture = function(t, i) {
  12180. void 0 === B && r.activeTexture();
  12181. var n = F[B];
  12182. void 0 === n && (n = {
  12183. type: void 0,
  12184. texture: void 0
  12185. },
  12186. F[B] = n),
  12187. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12188. n.type = t,
  12189. n.texture = i)
  12190. }
  12191. ,
  12192. this.compressedTexImage2D = function() {
  12193. try {
  12194. e.compressedTexImage2D.apply(e, arguments)
  12195. } catch (e) {
  12196. console.error(e)
  12197. }
  12198. }
  12199. ,
  12200. this.texImage2D = function() {
  12201. try {
  12202. e.texImage2D.apply(e, arguments)
  12203. } catch (e) {
  12204. console.error(e)
  12205. }
  12206. }
  12207. ,
  12208. this.clearColor = function(t, i, n, r) {
  12209. o.set(t, i, n, r),
  12210. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12211. V.copy(o))
  12212. }
  12213. ,
  12214. this.clearDepth = function(t) {
  12215. U !== t && (e.clearDepth(t),
  12216. U = t)
  12217. }
  12218. ,
  12219. this.clearStencil = function(t) {
  12220. k !== t && (e.clearStencil(t),
  12221. k = t)
  12222. }
  12223. ,
  12224. this.scissor = function(t) {
  12225. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12226. H.copy(t))
  12227. }
  12228. ,
  12229. this.viewport = function(t) {
  12230. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12231. G.copy(t))
  12232. }
  12233. ,
  12234. this.reset = function() {
  12235. for (var t = 0; t < l.length; t++)
  12236. 1 === l[t] && (e.disableVertexAttribArray(t),
  12237. l[t] = 0);
  12238. h = {},
  12239. u = null,
  12240. B = void 0,
  12241. F = {},
  12242. d = null,
  12243. E = null,
  12244. I = null,
  12245. b = null,
  12246. R = null
  12247. }
  12248. }
  12249. }
  12250. , {
  12251. three: 217
  12252. }],
  12253. 104: [function(e, t, i) {///js/loaders/DamLoader.js
  12254. (function(i, n) {
  12255. "use strict";
  12256. function r(e) {
  12257. this.urls = e;
  12258. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12259. this.builder = a.loadProto(t),
  12260. this.decoder = this.builder.build("binary_mesh")
  12261. }
  12262. var o = e("three")
  12263. , a = e("protobufjs")
  12264. , s = e("../util/logger")
  12265. , l = (e("../util/common"),
  12266. e("../util/ajax"))
  12267. , c = e("../objects/Chunk")
  12268. , h = new s(n);
  12269. r.prototype = {
  12270. constructor: r,
  12271. load: function(e, t, i, n) {
  12272. return h.time("download"),
  12273. l.get(e, {
  12274. responseType: "arraybuffer"
  12275. }).done(function(r) {
  12276. h.timeEnd("download"),
  12277. this.parse(r, e, t, i, n)
  12278. }
  12279. .bind(this)).fail(n)
  12280. },
  12281. parse: function(e, t, i, n, r) {
  12282. var o = this.readProtobuf(e);
  12283. if (!o)
  12284. return r();
  12285. try {
  12286. h.time("convert to webgl"),
  12287. this.convertProtobufToSceneObject(o, t, i, n, r),
  12288. h.timeEnd("convert to webgl")
  12289. } catch (e) {
  12290. return h.error("failed parsing .dam"),
  12291. h.error(e.message),
  12292. r()
  12293. }
  12294. },
  12295. readProtobuf: function(e) {
  12296. var t;
  12297. try {
  12298. h.time("parse proto"),
  12299. t = this.decoder.decode(e),
  12300. h.timeEnd("parse proto")
  12301. } catch (e) {
  12302. return h.error("failed parsing proto for .dam"),
  12303. h.error(e.message),
  12304. null
  12305. }
  12306. return t
  12307. },
  12308. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12309. function a(e) {
  12310. var i = new o.BufferGeometry;
  12311. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12312. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12313. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12314. i.applyMatrix(s),
  12315. i.computeBoundingBox(),
  12316. new c({
  12317. geometry: i,
  12318. textureName: e.material_name,
  12319. name: e.chunk_name,
  12320. meshUrl: t
  12321. })
  12322. }
  12323. if (0 === e.chunk.length)
  12324. return h.warn("No chunks in damfile..."),
  12325. i([]);
  12326. var s = new o.Matrix4;
  12327. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12328. var l = e.chunk.map(a);
  12329. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12330. r())
  12331. }
  12332. },
  12333. t.exports = r
  12334. }
  12335. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12336. }
  12337. , {
  12338. "../objects/Chunk": 144,
  12339. "../util/ajax": 181,
  12340. "../util/common": 185,
  12341. "../util/logger": 189,
  12342. buffer: 198,
  12343. protobufjs: 214,
  12344. three: 217
  12345. }],
  12346. 105: [function(e, t, i) {///js/loaders/ModelLoader.js
  12347. (function(i) {
  12348. "use strict";
  12349. var n = (e("three"),
  12350. e("../settings"),
  12351. e("../util/browser"),
  12352. e("./DamLoader"))
  12353. , r = e("../util/logger")
  12354. , o = (e("../ab"),
  12355. new r(i));
  12356. t.exports = {
  12357. getLoaders: function() {
  12358. return [["_50k", ".dam", n], ["", ".dam", n]]
  12359. },
  12360. load: function(e, t, i, n, r, a) {
  12361. var s = this.getLoaders();
  12362. a = a || 0;
  12363. var l = s[a];
  12364. if (!l)
  12365. return void (r && r("No suitable model file found..."));
  12366. var c = l[0]
  12367. , h = l[1]
  12368. , u = new l[2](t)
  12369. , d = t.get(e + c + h);
  12370. d ? (o.debug("Trying " + c + h),
  12371. u.load(d, i, n, function() {
  12372. this.load(e, t, i, n, r, ++a)
  12373. }
  12374. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12375. this.load(e, t, i, n, r, ++a))
  12376. }
  12377. }
  12378. }
  12379. ).call(this, "/js/loaders/ModelLoader.js")
  12380. }
  12381. , {
  12382. "../ab": 3,
  12383. "../settings": 166,
  12384. "../util/browser": 182,
  12385. "../util/logger": 189,
  12386. "./DamLoader": 104,
  12387. three: 217
  12388. }],
  12389. 106: [function(e, t, i) {///js/loaders/ModelTextureLoader.js
  12390. (function(i) {
  12391. "use strict";
  12392. var n = e("../util/common")
  12393. , r = e("../util/texture")
  12394. , o = e("../util/browser")
  12395. , a = e("../util/logger")
  12396. , s = e("../settings")
  12397. , l = new a(i);
  12398. t.exports = {
  12399. load: function(e, t) {
  12400. function i(e, i) {
  12401. e || (t.push(i),
  12402. p++,
  12403. d.notify(p, a),
  12404. p === a && d.resolve())
  12405. }
  12406. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12407. return $.when();
  12408. var a = n.countUnique(e.chunks.map(function(e) {
  12409. return e.textureName
  12410. }))
  12411. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12412. , h = "_50k" === c ? "high" : "low";
  12413. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12414. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12415. h = "low"));
  12416. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12417. , d = $.Deferred()
  12418. , p = 0;
  12419. return e.chunks.forEach(function(t) {
  12420. if (!t.material.map && t.textureName) {
  12421. var n = e.urls.get(u + t.textureName);
  12422. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12423. }
  12424. }),
  12425. d.promise()
  12426. }
  12427. }
  12428. }
  12429. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12430. }
  12431. , {
  12432. "../settings": 166,
  12433. "../util/browser": 182,
  12434. "../util/common": 185,
  12435. "../util/logger": 189,
  12436. "../util/texture": 194
  12437. }],
  12438. 107: [function(e, t, i) {///js/loaders/SweepDataLoader.js
  12439. (function(i, n) {
  12440. "use strict";
  12441. function r(e) {
  12442. this.model = e,
  12443. this.modelDataPath = this.model.urls.get("vision.modeldata"),
  12444. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12445. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12446. , n = o.loadProto(t);
  12447. this.decoder = n.build("VisionModeldata")
  12448. }
  12449. var o = e("protobufjs")
  12450. , a = e("../util/ajax")
  12451. , s = (e("../util/common"),
  12452. e("../util/math"))
  12453. , l = e("../util/logger")
  12454. , c = new l(n);
  12455. r.prototype.load = function() {
  12456. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12457. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12458. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12459. $.when([]))
  12460. }
  12461. ,
  12462. r.prototype.loadVisionModelData = function() {
  12463. return a.get(this.modelDataPath, {
  12464. responseType: "arraybuffer"
  12465. }).then(function(e) {
  12466. var t;
  12467. try {
  12468. t = this.decoder.decode(e)
  12469. } catch (e) {
  12470. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12471. this.loadSweepLocationsCSV()
  12472. }
  12473. var i = t.sweepLocations.map(function(e) {
  12474. return {
  12475. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12476. position: {
  12477. x: e.pose.translation.x,
  12478. y: e.pose.translation.y,
  12479. z: e.pose.translation.z
  12480. },
  12481. quaternion: {
  12482. x: e.pose.rotation.x,
  12483. y: e.pose.rotation.y,
  12484. z: e.pose.rotation.z,
  12485. w: e.pose.rotation.w
  12486. },
  12487. puck: {
  12488. x: e.puck.x,
  12489. y: e.puck.y,
  12490. z: e.puck.z
  12491. },
  12492. floor: e.group,
  12493. neighbours: e.visibles,
  12494. alignmentType: e.alignment_type
  12495. }
  12496. }).map(function(e) {
  12497. return e.position = s.convertVisionVector(e.position),
  12498. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12499. e.puck = s.convertVisionVector(e.puck),
  12500. e
  12501. });
  12502. return i.forEach(function(e) {
  12503. e.neighbours = e.neighbours.map(function(e) {
  12504. return i[e].uuid
  12505. })
  12506. }),
  12507. i
  12508. }
  12509. .bind(this), function() {
  12510. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12511. this.loadSweepLocationsCSV()
  12512. }
  12513. .bind(this))
  12514. }
  12515. ,
  12516. r.prototype.loadSweepLocationsCSV = function() {
  12517. return a.get(this.sweepLocationsPath).then(function(e) {
  12518. var t = e.split("\n").map(function(e) {
  12519. return e.split(", ")
  12520. }).filter(function(e) {
  12521. return e.length > 1
  12522. }).map(function(e) {
  12523. return {
  12524. uuid: e[0],
  12525. position: {
  12526. x: parseFloat(e[1]),
  12527. y: parseFloat(e[2]),
  12528. z: parseFloat(e[3])
  12529. },
  12530. quaternion: {
  12531. x: parseFloat(e[4]),
  12532. y: parseFloat(e[5]),
  12533. z: parseFloat(e[6]),
  12534. w: parseFloat(e[7])
  12535. }
  12536. }
  12537. }).map(function(e) {
  12538. return e.position = s.convertVisionVector(e.position),
  12539. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12540. e
  12541. });
  12542. return t
  12543. }).fail(function() {
  12544. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12545. })
  12546. }
  12547. ,
  12548. t.exports = r
  12549. }
  12550. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12551. }
  12552. , {
  12553. "../util/ajax": 181,
  12554. "../util/common": 185,
  12555. "../util/logger": 189,
  12556. "../util/math": 190,
  12557. buffer: 198,
  12558. protobufjs: 214
  12559. }],
  12560. 108: [function(e, t, i) {////js/localization/localize.js
  12561. (function(i) {
  12562. "use strict";
  12563. function n() {
  12564. this.locale = null
  12565. }
  12566. var r = e("../settings")
  12567. , o = e("../util/common")
  12568. , a = e("../util/logger")
  12569. , s = e("../enum/Locale")
  12570. , l = new a(i);
  12571. n.prototype.init = function() {
  12572. var t;
  12573. switch (r.languageTag) {
  12574. case null:
  12575. case "en":
  12576. case s.EN_US:
  12577. this.locale = s.EN_US,
  12578. t = e("./strings-en-US");
  12579. break;
  12580. case "es":
  12581. case s.ES_MX:
  12582. this.locale = s.ES_MX,
  12583. t = e("./strings-es-MX");
  12584. break;
  12585. case "fr":
  12586. case s.FR_FR:
  12587. this.locale = s.FR_FR,
  12588. t = e("./strings-fr-FR");
  12589. break;
  12590. case "de":
  12591. case s.DE_DE:
  12592. this.locale = s.DE_DE,
  12593. t = e("./strings-de-DE");
  12594. break;
  12595. case "ru":
  12596. case s.RU_RU:
  12597. this.locale = s.RU_RU,
  12598. t = e("./strings-ru-RU");
  12599. break;
  12600. case "cn":
  12601. case s.CN_CN:
  12602. this.locale = s.CN_CN,
  12603. t = e("./strings-cn-CN");
  12604. break;
  12605. case "jp":
  12606. case s.JP_JP:
  12607. this.locale = s.JP_JP,
  12608. t = e("./strings-jp-JP");
  12609. break;
  12610. default:
  12611. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12612. this.locale = s.EN_US,
  12613. t = e("./strings-en-US")
  12614. }
  12615. l.info("Using locale '" + this.locale + "'"),
  12616. o.extendObject(this, t)
  12617. }
  12618. ,
  12619. n.prototype.localizeGUI = function() {
  12620. var e = document.querySelector("#gui-parent");
  12621. this.localizeTree(e),
  12622. this.localizeLoadingText()
  12623. }
  12624. ,
  12625. n.prototype.localizeLoadingText = function() {
  12626. var e = document.querySelector("#loader-cont")
  12627. , t = e.getAttribute("title");
  12628. e.removeAttribute("title"),
  12629. e.setAttribute("data-status", t),
  12630. e.classList.add(this.locale),
  12631. document.querySelector("#help-dialog").classList.add(this.locale),
  12632. document.querySelector("#interaction-modal").classList.add(this.locale),
  12633. document.querySelector("#gui").classList.add(this.locale)
  12634. }
  12635. ,
  12636. n.prototype.localizeTree = function(e) {
  12637. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12638. if (e.nodeType === Node.TEXT_NODE)
  12639. t = e.data.match(n),
  12640. t && (i = t[1],
  12641. e.data = this.localizeText(i) || i);
  12642. else if (e.nodeType === Node.ELEMENT_NODE) {
  12643. var r = e.getAttribute("title");
  12644. r && (t = r.match(n),
  12645. t && (i = t[1],
  12646. e.setAttribute("title", this.localizeText(i) || i)))
  12647. }
  12648. for (e = e.firstChild; e; )
  12649. this.localizeTree(e),
  12650. e = e.nextSibling
  12651. }
  12652. ,
  12653. n.prototype.localizeText = function(t) {
  12654. var i = this[t];
  12655. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12656. i = e("./strings-en-US")[t]),
  12657. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12658. i
  12659. }
  12660. ,
  12661. t.exports = new n
  12662. }
  12663. ).call(this, "/js/localization/localize.js")
  12664. }
  12665. , {
  12666. "../enum/Locale": 31,
  12667. "../settings": 166,
  12668. "../util/common": 185,
  12669. "../util/logger": 189,
  12670. "./strings-cn-CN": 109,
  12671. "./strings-de-DE": 110,
  12672. "./strings-en-US": 111,
  12673. "./strings-es-MX": 112,
  12674. "./strings-fr-FR": 113,
  12675. "./strings-jp-JP": 114,
  12676. "./strings-ru-RU": 115
  12677. }],
  12678. 109: [function(e, t, i) {//"./strings-cn-CN"
  12679. "use strict";
  12680. t.exports = {
  12681. PAGE_TITLE: "port 3D Showcase",
  12682. LOADING: "正在加载",
  12683. PRESENTED_BY_CAPS: "呈现者:",
  12684. POWERED_BY: "技术支持:",
  12685. POWERED_BY_CAPS: "技术支持:",
  12686. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12687. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12688. PRESENTED_BY: "呈现者:",
  12689. MORE: "更多 ",
  12690. LESS: "更少 ",
  12691. TAG_CONTENT: "tag™ 内容",
  12692. SHOW: "显示",
  12693. HIDE: "隐藏",
  12694. DOLLHOUSE: "场景屋",
  12695. FLOOR_PLAN: "楼层平面图",
  12696. OPEN_HIGHLIGHTS: "打开精彩片段",
  12697. CLOSE_HIGHLIGHTS: "关闭",
  12698. PREVIOUS: "上一个",
  12699. PLAY: "播放",
  12700. PAUSE: "暂停",
  12701. NEXT: "下一个",
  12702. EXPLORE_3D_SPACE: "探索 3D 空间",
  12703. VIEW_DOLLHOUSE: "观看场景屋",
  12704. SOCIAL_SHARING: "分享这个空间",
  12705. VIEW_IN_VR: "以 VR 观看",
  12706. VIEW_FULLSCREEN: "全屏观看",
  12707. EXIT_FULLSCREEN: " 退出全屏",
  12708. ZOOM_IN: "放大",
  12709. ZOOM_OUT: "缩小",
  12710. FLOOR_NAME: "楼层",
  12711. FLOOR_ALL: "全部",
  12712. TERMS: "条款",
  12713. PORT_TERMS: "port 条款",
  12714. TERMS_OF_USE: "使用条款",
  12715. CLOSE_TERMS: "关闭",
  12716. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12717. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12718. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12719. WEBVR_ENTER_WEBVR: "进入 VR",
  12720. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12721. WEBVR_LEARN_MORE: "了解更多",
  12722. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12723. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12724. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12725. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12726. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12727. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12728. VR_LEARN_MORE_CAPS: "了解更多",
  12729. VR_PREVIOUS_CAPS: "上一个’,",
  12730. VR_NEXT_CAPS: "下一个",
  12731. VR_GOT_IT_CAPS: "明白了",
  12732. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12733. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12734. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12735. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12736. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12737. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12738. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12739. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12740. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12741. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12742. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12743. VR_APP: "port VR 应用程序",
  12744. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12745. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12746. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12747. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12748. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12749. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12750. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12751. VR_ANDROID_DVICES: "Android 设备",
  12752. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12753. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12754. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12755. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12756. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12757. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12758. VR_DOWNLOAD_HERE: "在此下载",
  12759. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12760. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12761. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12762. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12763. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12764. SHARE_TO: "分享到",
  12765. SHARE_LINK: "直接链接",
  12766. SHARE_EXPLORE: "探索",
  12767. SHARE_AT: "在",
  12768. SHARE_WITH: "使用",
  12769. SHARE_3D: "以 3D",
  12770. SHARE_COPIED: "已复制!",
  12771. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12772. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12773. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12774. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12775. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12776. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12777. ERROR_GENERIC_ACTIONS_3: " 或",
  12778. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12779. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12780. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12781. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12782. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12783. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12784. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12785. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12786. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12787. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12788. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12789. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12790. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12791. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12792. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12793. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12794. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12795. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12796. LINK_TO_LOCATION: "地点链接",
  12797. MENU_COPY: "复制",
  12798. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12799. ROTATE: "旋转",
  12800. MOVE: "移动",
  12801. INSIDE: "内部",
  12802. ZOOM: "缩放",
  12803. HELP: "小帮手",
  12804. HELP_NAVIGATION_TAB: "导航",
  12805. HELP_MORE_HELP_TAB: "更多帮助",
  12806. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12807. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12808. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12809. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12810. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12811. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12812. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12813. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12814. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12815. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12816. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12817. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12818. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12819. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12820. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12821. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12822. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12823. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12824. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12825. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12826. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12827. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12828. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12829. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12830. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12831. HELP_MORE_HLR_A: "精彩片段集锦",
  12832. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12833. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12834. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12835. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12836. HELP_MORE_FLOORS_A: "楼层选择器",
  12837. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12838. HELP_MORE_TAG_A: "tag™ 贴文",
  12839. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12840. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12841. HELP_MORE_ZOOM_A: "缩放控件",
  12842. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12843. HELP_MORE_TOUR_A: "导览控件",
  12844. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12845. HELP_MORE_INSIDE_A: "内部视图",
  12846. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12847. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12848. HELP_MORE_VR_A: "VR 模式",
  12849. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12850. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12851. HELP_MORE_360_A: "360° 视图",
  12852. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12853. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12854. HELP_MORE_FULLSCREEN_A: "全屏",
  12855. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12856. CLOSE: "关闭"
  12857. }
  12858. }
  12859. , {}],
  12860. 110: [function(e, t, i) {//"./strings-de-DE"
  12861. "use strict";
  12862. t.exports = {
  12863. PAGE_TITLE: "port 3D Showcase",
  12864. LOADING: "Lädt",
  12865. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12866. POWERED_BY: "Angetrieben von",
  12867. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12868. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12869. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12870. PRESENTED_BY: "Präsentiert von ",
  12871. MORE: "Mehr ",
  12872. LESS: "Weniger ",
  12873. TAG_CONTENT: "tag™ Inhalt",
  12874. SHOW: "Anzeigen",
  12875. HIDE: "Verbergen",
  12876. DOLLHOUSE: "Puppenhaus",
  12877. FLOOR_PLAN: "Grundriss",
  12878. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12879. CLOSE_HIGHLIGHTS: "Schließen",
  12880. PREVIOUS: "Vorheriges",
  12881. PLAY: "Abspielen",
  12882. PAUSE: "Pausieren",
  12883. NEXT: "Nächstes",
  12884. EXPLORE_3D_SPACE: "Innenraum betreten",
  12885. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12886. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12887. VIEW_IN_VR: "In VR ansehen",
  12888. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12889. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12890. ZOOM_IN: "Vergrößern",
  12891. ZOOM_OUT: "Verkleinern",
  12892. FLOOR_NAME: "Etage ",
  12893. FLOOR_ALL: "Alle",
  12894. TERMS: "Bedingungen",
  12895. PORT_TERMS: "port Bedingungen",
  12896. TERMS_OF_USE: "Nutzungsbedingungen",
  12897. TERMS_TEXT_FILE: "terms-de-DE.html",
  12898. CLOSE_TERMS: "Schließen",
  12899. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12900. HELP: "Hilfe",
  12901. HELP_NAVIGATION_TAB: "Navigation",
  12902. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12903. CLOSE: "Schließen",
  12904. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12905. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12906. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12907. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12908. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12909. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12910. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12911. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12912. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12913. 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.",
  12914. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12915. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12916. 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.",
  12917. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12918. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12919. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12920. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12921. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12922. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12923. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12924. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12925. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12926. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12927. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12928. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12929. HELP_MORE_HLR_A: "Liste das Highlight",
  12930. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12931. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12932. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12933. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12934. HELP_MORE_FLOORS_A: "Etage auswählen",
  12935. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12936. HELP_MORE_TAG_A: "tag™ Posts",
  12937. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12938. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12939. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12940. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12941. HELP_MORE_TOUR_A: "Tour Steuerung",
  12942. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12943. HELP_MORE_INSIDE_A: "Innenansicht",
  12944. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12945. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12946. HELP_MORE_VR_A: "VR Modus",
  12947. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12948. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12949. HELP_MORE_360_A: "360° Views Ansicht ",
  12950. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12951. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12952. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12953. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12954. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12955. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12956. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12957. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12958. WEBVR_LEARN_MORE: "Mehr Infos",
  12959. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12960. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12961. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12962. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12963. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12964. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12965. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12966. VR_APP: "port VR App",
  12967. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12968. 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",
  12969. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12970. VR_APP_FOR_ANDROID: "port VR app für Android",
  12971. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12972. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12973. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12974. VR_PREVIOUS_CAPS: "ZURÜCK",
  12975. VR_NEXT_CAPS: "WEITER",
  12976. VR_GOT_IT_CAPS: "VERSTANDEN",
  12977. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12978. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12979. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12980. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12981. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12982. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12983. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12984. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12985. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12986. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12987. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12988. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12989. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12990. VR_ANDROID_DVICES: "Android Geräte",
  12991. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12992. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12993. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12994. VR_DOWNLOAD_HERE: "Hier runterladen",
  12995. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12996. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12997. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12998. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12999. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13000. SHARE_TO: "Teilen auf",
  13001. SHARE_LINK: "Direkter Link",
  13002. SHARE_EXPLORE: "Umsehen",
  13003. SHARE_AT: "auf",
  13004. SHARE_WITH: "mit",
  13005. SHARE_3D: "in 3D",
  13006. SHARE_COPIED: "Kopiert!",
  13007. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13008. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13009. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13010. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13011. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13012. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13013. ERROR_GENERIC_ACTIONS_3: " oder ",
  13014. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13015. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13016. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13017. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13018. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13019. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13020. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13021. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13022. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13023. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13024. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13025. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13026. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13027. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13028. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13029. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13030. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13031. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13032. LINK_TO_LOCATION: "Link zu",
  13033. MENU_COPY: "Kopieren",
  13034. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13035. ROTATE: "Drehen",
  13036. INSIDE: "Drinnen",
  13037. MOVE: "Bewegen",
  13038. ZOOM: "Vergrößern"
  13039. }
  13040. }
  13041. , {}],
  13042. 111: [function(e, t, i) {//"./strings-en-US"
  13043. "use strict";
  13044. t.exports = {
  13045. PAGE_TITLE: "port 3D Showcase",
  13046. LOADING: "Loading",
  13047. PRESENTED_BY_CAPS: "PRESENTED BY",
  13048. POWERED_BY: "powered by ",
  13049. POWERED_BY_CAPS: "POWERED BY",
  13050. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13051. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13052. PRESENTED_BY: "Presented by ",
  13053. MORE: "More ",
  13054. LESS: "Less ",
  13055. TAG_CONTENT: "tag™ Content",
  13056. SHOW: "Show",
  13057. HIDE: "Hide",
  13058. DOLLHOUSE: "Dollhouse",
  13059. FLOOR_PLAN: "Floor plan",
  13060. OPEN_HIGHLIGHTS: "Open Highlights",
  13061. CLOSE_HIGHLIGHTS: "Close",
  13062. PREVIOUS: "Previous",
  13063. PLAY: "Play",
  13064. PAUSE: "Pause",
  13065. NEXT: "Next",
  13066. EXPLORE_3D_SPACE: "Explore 3D Space",
  13067. VIEW_DOLLHOUSE: "View dollhouse",
  13068. SOCIAL_SHARING: "Share this Space",
  13069. VIEW_IN_VR: "View in VR",
  13070. VIEW_FULLSCREEN: "View Fullscreen",
  13071. EXIT_FULLSCREEN: "Exit Fullscreen",
  13072. ZOOM_IN: "Zoom in",
  13073. ZOOM_OUT: "Zoom out",
  13074. FLOOR_NAME: "Floor ",
  13075. FLOOR_ALL: "All",
  13076. TERMS: "Terms",
  13077. PORT_TERMS: "4dage terms",
  13078. TERMS_OF_USE: "Terms of Use",
  13079. TERMS_TEXT_FILE: "terms-en-US.html",
  13080. CLOSE_TERMS: "Close",
  13081. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13082. HELP: "Help",
  13083. HELP_NAVIGATION_TAB: "Navigation",
  13084. HELP_MORE_HELP_TAB: "More Help",
  13085. CLOSE: "Close",
  13086. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13087. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13088. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13089. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13090. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13091. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13092. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13093. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13094. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13095. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13096. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13097. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13098. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13099. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13100. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13101. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13102. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13103. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13104. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13105. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13106. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13107. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13108. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13109. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13110. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13111. HELP_MORE_HLR_A: "Highlight Reel",
  13112. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13113. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13114. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13115. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13116. HELP_MORE_FLOORS_A: "Floor Selector",
  13117. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13118. HELP_MORE_TAG_A: "tag™ Posts",
  13119. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13120. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13121. HELP_MORE_ZOOM_A: "Zoom Controls",
  13122. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13123. HELP_MORE_TOUR_A: "Tour Controls",
  13124. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13125. HELP_MORE_INSIDE_A: "Inside View",
  13126. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13127. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13128. HELP_MORE_VR_A: "VR Mode",
  13129. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13130. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13131. HELP_MORE_360_A: "360° Views",
  13132. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13133. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13134. HELP_MORE_FULLSCREEN_A: "Full screen",
  13135. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13136. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13137. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13138. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13139. WEBVR_ENTER_WEBVR: "ENTER VR",
  13140. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13141. WEBVR_LEARN_MORE: "Learn more",
  13142. WEBVR_VIEW_SPACE: "View Space in VR",
  13143. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13144. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13145. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13146. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13147. VR_PREVIOUS_CAPS: "PREVIOUS",
  13148. VR_NEXT_CAPS: "NEXT",
  13149. VR_GOT_IT_CAPS: "GOT IT",
  13150. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13151. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13152. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13153. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13154. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13155. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13156. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13157. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13158. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13159. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13160. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13161. VR_APP: "port VR App",
  13162. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13163. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13164. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13165. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13166. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13167. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13168. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13169. VR_ANDROID_DVICES: "Android Devices",
  13170. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13171. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13172. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13173. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13174. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13175. VR_APP_OPEN: "Open with the port VR app instead",
  13176. VR_DOWNLOAD_HERE: "Download here",
  13177. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13178. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13179. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13180. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13181. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13182. SHARE_TO: "Share to",
  13183. SHARE_LINK: "Direct Link",
  13184. SHARE_EXPLORE: "Explore ",
  13185. SHARE_AT: "at",
  13186. SHARE_WITH: "with",
  13187. SHARE_3D: " in 3D",
  13188. SHARE_COPIED: "Copied!",
  13189. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13190. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13191. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13192. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13193. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13194. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13195. ERROR_GENERIC_ACTIONS_3: " or ",
  13196. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13197. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13198. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13199. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13200. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13201. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13202. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13203. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13204. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13205. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13206. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13207. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13208. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13209. ERROR_LOADING_FAILED_PROBLEM: "Oops, model not available.",
  13210. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13211. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13212. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13213. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13214. LINK_TO_LOCATION: "Link to location",
  13215. MENU_COPY: "Copy",
  13216. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13217. ROTATE: "Rotate",
  13218. INSIDE: "Inside",
  13219. MOVE: "Move",
  13220. ZOOM: "Zoom"
  13221. }
  13222. }
  13223. , {}],
  13224. 112: [function(e, t, i) {//"./strings-es-MX"
  13225. "use strict";
  13226. t.exports = {
  13227. PAGE_TITLE: "port 3D Showcase",
  13228. LOADING: "Cargando",
  13229. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13230. POWERED_BY: "potenciando por ",
  13231. POWERED_BY_CAPS: "POTENCIADO POR ",
  13232. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13233. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13234. PRESENTED_BY: "Presentado por ",
  13235. MORE: "Más ",
  13236. LESS: "Menos ",
  13237. TAG_CONTENT: "Contenido de tag™",
  13238. SHOW: "Mostrar",
  13239. HIDE: "Ocultar",
  13240. DOLLHOUSE: "Dollhouse",
  13241. FLOOR_PLAN: "Planos",
  13242. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13243. CLOSE_HIGHLIGHTS: "Cerrar",
  13244. PREVIOUS: "Anterior",
  13245. PLAY: "Play",
  13246. PAUSE: "Pausa",
  13247. NEXT: "Siguiente",
  13248. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13249. VIEW_DOLLHOUSE: "Ver dollhouse",
  13250. SOCIAL_SHARING: "Compartir este espacio",
  13251. VIEW_IN_VR: "Ver en realidad virtual",
  13252. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13253. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13254. ZOOM_IN: "Acercar",
  13255. ZOOM_OUT: "Alejar",
  13256. FLOOR_NAME: "Piso ",
  13257. FLOOR_ALL: "Todas",
  13258. TERMS: "Condiciones",
  13259. PORT_TERMS: "port términos de uso",
  13260. TERMS_OF_USE: "Términos de uso",
  13261. TERMS_TEXT_FILE: "terms-es-MX.html",
  13262. CLOSE_TERMS: "Cerrar",
  13263. 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.",
  13264. HELP: "Ayuda",
  13265. HELP_NAVIGATION_TAB: "Navegación",
  13266. HELP_MORE_HELP_TAB: "Más Ayuda",
  13267. CLOSE: "Cerrar",
  13268. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13269. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13270. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13271. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13272. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13273. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13274. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13275. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13276. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13277. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13278. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13279. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13280. 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.",
  13281. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13282. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13283. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13284. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13285. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13286. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13287. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13288. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13289. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13290. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13291. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13292. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13293. HELP_MORE_HLR_A: "Galería destacada",
  13294. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13295. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13296. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13297. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13298. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13299. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13300. HELP_MORE_TAG_A: "tag™ Posts",
  13301. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13302. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13303. HELP_MORE_ZOOM_A: "Controles de zoom",
  13304. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13305. HELP_MORE_TOUR_A: "Controles de recorrido",
  13306. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13307. HELP_MORE_INSIDE_A: "Vista interior",
  13308. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13309. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13310. HELP_MORE_VR_A: "Modo de realidad virtual",
  13311. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13312. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13313. HELP_MORE_360_A: "360° Views",
  13314. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13315. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13316. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13317. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13318. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13319. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13320. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13321. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13322. WEBVR_LEARN_MORE: "Más información",
  13323. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13324. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13325. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13326. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13327. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13328. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13329. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13330. VR_APP: "port VR App",
  13331. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13332. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13333. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13334. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13335. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13336. VR_PREVIOUS_CAPS: "ANTERIOR",
  13337. VR_NEXT_CAPS: "SIGUIENTE",
  13338. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13339. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13340. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13341. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13342. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13343. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13344. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13345. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13346. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13347. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13348. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13349. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13350. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13351. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13352. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13353. VR_ANDROID_DVICES: "Dispositivos Android",
  13354. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13355. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13356. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13357. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13358. VR_DOWNLOAD_HERE: "Descargar aquí",
  13359. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13360. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13361. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13362. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13363. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13364. SHARE_TO: "Compartir en",
  13365. SHARE_LINK: "Enlace directo",
  13366. SHARE_EXPLORE: "Explorar ",
  13367. SHARE_AT: "en",
  13368. SHARE_WITH: "con",
  13369. SHARE_3D: " en 3D",
  13370. SHARE_COPIED: "¡Copiado!",
  13371. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13372. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13373. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13374. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13375. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13376. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13377. ERROR_GENERIC_ACTIONS_3: " o ",
  13378. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13379. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13380. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13381. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13382. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13383. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13384. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13385. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13386. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13387. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13388. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13389. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13390. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13391. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13392. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13393. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13394. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13395. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13396. LINK_TO_LOCATION: "Enlace a la ubicación",
  13397. MENU_COPY: "Copiar",
  13398. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13399. ROTATE: "Girar",
  13400. INSIDE: "Interior",
  13401. MOVE: "Moverse",
  13402. ZOOM: "Acercar o alejar"
  13403. }
  13404. }
  13405. , {}],
  13406. 113: [function(e, t, i) {//"./strings-fr-FR"
  13407. "use strict";
  13408. t.exports = {
  13409. PAGE_TITLE: "port 3D Showcase",
  13410. LOADING: "Chargement",
  13411. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13412. POWERED_BY: "alimenté par ",
  13413. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13414. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13415. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13416. PRESENTED_BY: "Présenté par ",
  13417. MORE: "Plus ",
  13418. LESS: "Moins ",
  13419. TAG_CONTENT: "Contenu tag™",
  13420. SHOW: "Montrer",
  13421. HIDE: "Cacher",
  13422. DOLLHOUSE: "Dollhouse",
  13423. FLOOR_PLAN: "Plan de sol",
  13424. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13425. CLOSE_HIGHLIGHTS: "Fermer",
  13426. PREVIOUS: "Précédent",
  13427. PLAY: "Lecture",
  13428. PAUSE: "Pause",
  13429. NEXT: "Suivant",
  13430. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13431. VIEW_DOLLHOUSE: "Voir dollhouse",
  13432. SOCIAL_SHARING: "Partager cet espace",
  13433. VIEW_IN_VR: "Voir en VR",
  13434. VIEW_FULLSCREEN: "Plein écran",
  13435. EXIT_FULLSCREEN: "Fermer plein écran",
  13436. ZOOM_IN: "Zoom avant",
  13437. ZOOM_OUT: "Zoom arrière",
  13438. FLOOR_NAME: "Étage ",
  13439. FLOOR_ALL: "Tous",
  13440. TERMS: "Mentions légales",
  13441. PORT_TERMS: "port mentions légales",
  13442. TERMS_OF_USE: "Conditions d'utilisation",
  13443. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13444. CLOSE_TERMS: "Fermer",
  13445. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13446. HELP: "Aide",
  13447. HELP_NAVIGATION_TAB: "Navigation",
  13448. HELP_MORE_HELP_TAB: "Aide",
  13449. CLOSE: "Fermer",
  13450. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13451. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13452. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13453. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13454. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13455. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13456. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13457. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13458. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13459. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13460. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13461. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13462. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13463. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13464. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13465. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13466. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13467. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13468. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13469. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13470. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13471. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13472. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13473. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13474. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13475. HELP_MORE_HLR_A: "Carrousel",
  13476. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13477. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13478. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13479. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13480. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13481. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13482. HELP_MORE_TAG_A: "tag™ Posts",
  13483. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13484. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13485. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13486. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13487. HELP_MORE_TOUR_A: "Commandes de la visite",
  13488. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13489. HELP_MORE_INSIDE_A: "Vue intérieure",
  13490. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13491. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13492. HELP_MORE_VR_A: "Mode RV",
  13493. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13494. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13495. HELP_MORE_360_A: "Vues 360°",
  13496. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13497. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13498. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13499. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13500. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13501. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13502. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13503. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13504. WEBVR_LEARN_MORE: "En savoir plus",
  13505. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13506. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13507. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13508. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13509. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13510. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13511. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13512. VR_NEXT_CAPS: "SUIVANT",
  13513. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13514. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13515. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13516. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13517. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13518. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13519. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13520. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13521. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13522. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13523. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13524. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13525. VR_APP: "port VR App",
  13526. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13527. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13528. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13529. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13530. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13531. 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",
  13532. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13533. VR_ANDROID_DVICES: "Appareils Android",
  13534. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13535. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13536. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13537. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13538. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13539. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13540. VR_DOWNLOAD_HERE: "Télécharger ici",
  13541. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13542. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13543. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13544. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13545. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13546. SHARE_TO: "Partager sur",
  13547. SHARE_LINK: "Lien direct",
  13548. SHARE_EXPLORE: "Explorer ",
  13549. SHARE_AT: "à",
  13550. SHARE_WITH: "avec",
  13551. SHARE_3D: " en 3D",
  13552. SHARE_COPIED: "Copié!",
  13553. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13554. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13555. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13556. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13557. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13558. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13559. ERROR_GENERIC_ACTIONS_3: " ou ",
  13560. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13561. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13562. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13563. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13564. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13565. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13566. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13567. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13568. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13569. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13570. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13571. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13572. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13573. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13574. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13575. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13576. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13577. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13578. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13579. MENU_COPY: "Copie",
  13580. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13581. ROTATE: "Faire pivoter",
  13582. INSIDE: "Intérieure",
  13583. MOVE: "Se déplacer",
  13584. ZOOM: "Zoom"
  13585. }
  13586. }
  13587. , {}],
  13588. 114: [function(e, t, i) {//"./strings-jp-JP"
  13589. "use strict";
  13590. t.exports = {
  13591. PAGE_TITLE: "port 3D Showcase",
  13592. LOADING: "読み込み中",
  13593. PRESENTED_BY_CAPS: "PRESENTED BY",
  13594. POWERED_BY: "powered by",
  13595. POWERED_BY_CAPS: "POWERED BY",
  13596. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13597. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13598. PRESENTED_BY: "Presented by ",
  13599. MORE: "全て表示 ",
  13600. LESS: "閉じる ",
  13601. TAG_CONTENT: "tag™コンテンツ ",
  13602. SHOW: "表示",
  13603. HIDE: "非表示",
  13604. DOLLHOUSE: "ドールハウス",
  13605. FLOOR_PLAN: "フロアプラン",
  13606. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13607. CLOSE_HIGHLIGHTS: "閉じる",
  13608. PREVIOUS: "前へ",
  13609. PLAY: "再生",
  13610. PAUSE: "一時停止",
  13611. NEXT: "次へ",
  13612. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13613. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13614. SOCIAL_SHARING: "このSpaceを共有する",
  13615. VIEW_IN_VR: "VRで表示",
  13616. VIEW_FULLSCREEN: "フルスクリーン表示",
  13617. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13618. ZOOM_IN: "ズームイン",
  13619. ZOOM_OUT: "ズームアウト",
  13620. FLOOR_NAME: "フロア ",
  13621. FLOOR_ALL: "すべて",
  13622. TERMS: "規約",
  13623. PORT_TERMS: "port規約",
  13624. TERMS_OF_USE: "利用規約",
  13625. CLOSE_TERMS: "閉じる",
  13626. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13627. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13628. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13629. WEBVR_ENTER_WEBVR: "VRに入る",
  13630. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13631. WEBVR_LEARN_MORE: "もっと詳しく",
  13632. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13633. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13634. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13635. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13636. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13637. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13638. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13639. VR_PREVIOUS_CAPS: "前へ",
  13640. VR_NEXT_CAPS: "次へ",
  13641. VR_GOT_IT_CAPS: "了解",
  13642. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13643. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13644. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13645. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13646. VR_WHAT_YOU_NEED: "必要なもの",
  13647. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13648. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13649. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13650. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13651. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13652. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13653. VR_APP: "port VRアプリ",
  13654. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13655. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13656. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13657. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13658. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13659. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13660. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13661. VR_ANDROID_DVICES: "Androidデバイス",
  13662. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13663. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13664. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13665. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13666. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13667. VR_APP_OPEN: "port VRアプリで開く",
  13668. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13669. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13670. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13671. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13672. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13673. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13674. SHARE_TO: "共有先",
  13675. SHARE_LINK: "ダイレクトリンク",
  13676. SHARE_EXPLORE: "探索",
  13677. SHARE_AT: "場所",
  13678. SHARE_WITH: "使用アプリ",
  13679. SHARE_3D: "3Dで",
  13680. SHARE_COPIED: "コピーされました!",
  13681. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13682. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13683. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13684. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13685. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13686. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13687. ERROR_GENERIC_ACTIONS_3: "または",
  13688. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13689. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13690. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13691. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13692. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13693. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13694. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13695. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13696. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13697. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13698. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13699. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13700. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13701. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13702. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13703. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13704. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13705. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13706. LINK_TO_LOCATION: "ロケーションへのリンク",
  13707. MENU_COPY: "コピー",
  13708. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13709. ROTATE: "回転",
  13710. MOVE: "移動",
  13711. INSIDE: "内側",
  13712. ZOOM: "ズーム",
  13713. HELP: "ヘルプ",
  13714. HELP_NAVIGATION_TAB: "ナビゲーション",
  13715. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13716. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13717. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13718. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13719. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13720. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13721. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13722. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13723. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13724. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13725. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13726. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13727. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13728. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13729. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13730. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13731. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13732. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13733. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13734. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13735. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13736. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13737. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13738. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13739. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13740. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13741. HELP_MORE_HLR_A: "ハイライト",
  13742. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13743. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13744. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13745. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13746. HELP_MORE_FLOORS_A: "フロアセレクター",
  13747. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13748. HELP_MORE_TAG_A: "tag™ Posts",
  13749. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13750. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13751. HELP_MORE_ZOOM_A: "ズームコントロール",
  13752. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13753. HELP_MORE_TOUR_A: "ツアーコントロール",
  13754. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13755. HELP_MORE_INSIDE_A: "内側ビュー",
  13756. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13757. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13758. HELP_MORE_VR_A: "VRモード",
  13759. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13760. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13761. HELP_MORE_360_A: "360° Views",
  13762. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13763. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13764. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13765. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13766. CLOSE: "閉じる"
  13767. }
  13768. }
  13769. , {}],
  13770. 115: [function(e, t, i) {//"./strings-ru-RU"
  13771. "use strict";
  13772. t.exports = {
  13773. PAGE_TITLE: "port 3D Showcase",
  13774. LOADING: "Загрузка",
  13775. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13776. POWERED_BY: "разработано на платформе ",
  13777. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13778. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13779. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13780. PRESENTED_BY: "Представлено ",
  13781. MORE: "Больше ",
  13782. LESS: "Меньше ",
  13783. TAG_CONTENT: "tag™ Контент",
  13784. SHOW: "Показать",
  13785. HIDE: "Скрыть",
  13786. DOLLHOUSE: "Dollhouse",
  13787. FLOOR_PLAN: "Планировка",
  13788. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13789. CLOSE_HIGHLIGHTS: "Закрыть",
  13790. PREVIOUS: "Предыдущий",
  13791. PLAY: "Воспроизвести",
  13792. PAUSE: "Пауза",
  13793. NEXT: "Следующий",
  13794. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13795. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13796. SOCIAL_SHARING: "Поделиться этой моделью",
  13797. VIEW_IN_VR: "Посмотреть в VR",
  13798. VIEW_FULLSCREEN: "Полный экран",
  13799. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13800. ZOOM_IN: "Увеличить",
  13801. ZOOM_OUT: "Уменьшить",
  13802. FLOOR_NAME: "Этаж ",
  13803. FLOOR_ALL: "Все",
  13804. TERMS: "Условия",
  13805. PORT_TERMS: "Правила пользования",
  13806. TERMS_OF_USE: "Условия использования",
  13807. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13808. CLOSE_TERMS: "Закрыть",
  13809. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13810. HELP: "Помощь",
  13811. HELP_NAVIGATION_TAB: "Навигация",
  13812. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13813. CLOSE: "Закрыть",
  13814. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13815. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13816. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13817. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13818. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13819. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13820. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13821. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13822. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13823. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13824. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13825. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13826. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13827. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13828. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13829. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13830. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13831. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13832. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13833. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13834. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13835. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13836. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13837. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13838. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13839. HELP_MORE_HLR_A: "Фотоколлаж",
  13840. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13841. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13842. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13843. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13844. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13845. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13846. HELP_MORE_TAG_A: "tag™ Posts",
  13847. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13848. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13849. HELP_MORE_ZOOM_A: "Масштаб",
  13850. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13851. HELP_MORE_TOUR_A: "Управление Туром",
  13852. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13853. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13854. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13855. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13856. HELP_MORE_VR_A: "Режим VR",
  13857. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13858. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13859. HELP_MORE_360_A: "360° Views",
  13860. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13861. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13862. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13863. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13864. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13865. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13866. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13867. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13868. WEBVR_LEARN_MORE: "Узнать больше",
  13869. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13870. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13871. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13872. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13873. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13874. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13875. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13876. VR_APP: "port VR App",
  13877. VR_APP_OPEN: "Или открыть через приложение port VR",
  13878. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13879. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13880. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13881. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13882. VR_VIEW_SPACE: "Запустить модель в VR",
  13883. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13884. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13885. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13886. VR_GOT_IT_CAPS: "ЯСНО",
  13887. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13888. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13889. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13890. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13891. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13892. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13893. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13894. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13895. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13896. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13897. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13898. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13899. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13900. VR_ANDROID_DVICES: "Android устройства",
  13901. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13902. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13903. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13904. VR_DOWNLOAD_HERE: "Скачать здесь",
  13905. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13906. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13907. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13908. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13909. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13910. SHARE_TO: "Поделиться",
  13911. SHARE_LINK: "Прямая ссылка",
  13912. SHARE_EXPLORE: "просмотреть",
  13913. SHARE_AT: "на",
  13914. SHARE_WITH: "с",
  13915. SHARE_3D: "в 3D",
  13916. SHARE_COPIED: "Скопировано!",
  13917. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13918. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13919. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13920. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13921. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13922. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13923. ERROR_GENERIC_ACTIONS_3: " или ",
  13924. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13925. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13926. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13927. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13928. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13929. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13930. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13931. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13932. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13933. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13934. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13935. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13936. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13937. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13938. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13939. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13940. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13941. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13942. LINK_TO_LOCATION: "Ссылка на местоположение",
  13943. MENU_COPY: "Копировать",
  13944. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13945. ROTATE: "Вращать",
  13946. MOVE: "Передвигаться",
  13947. INSIDE: "Вид изнутри",
  13948. ZOOM: "Масштаб"
  13949. }
  13950. }
  13951. , {}],
  13952. "dom":[function(t, e){//改
  13953. e.exports = {
  13954. addClass:function(elem,className){if(elem.className===undefined){elem.className=className;}else if(elem.className!==className){var classes=elem.className.split(/ +/);if(classes.indexOf(className)==-1){classes.push(className);elem.className=classes.join(' ').replace(/^\s+/,'').replace(/\s+$/,'');}}}
  13955. ,removeClass:function(elem,className){if(className){if(elem.className===undefined){}else if(elem.className===className){elem.removeAttribute('class');}else{var classes=elem.className.split(/ +/);var index=classes.indexOf(className);if(index!=-1){classes.splice(index,1);elem.className=classes.join(' ');}}}else{elem.className=undefined;}}
  13956. ,hasClass:function(elem,className){return new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)').test(elem.className)||false;}
  13957. ,bind:function(elem,event,func,bool){bool=bool||false;if(elem.addEventListener)elem.addEventListener(event,func,bool);else if(elem.attachEvent)elem.attachEvent('on'+event,func);}
  13958. ,unbind:function(elem,event,func,bool){bool=bool||false;if(elem.removeEventListener)elem.removeEventListener(event,func,bool);else if(elem.detachEvent)elem.detachEvent('on'+event,func);}
  13959. ,id:function(id,elem){elem=elem||document;var result=elem.getElementById&&elem.getElementById(id);return result||document.getElementById(id);}
  13960. ,Tag:function(name,elem){elem=elem||document;return elem.getElementsByTagName(name);}
  13961. ,cla:function(name,elem){elem=elem||document;return elem.getElementsByClassName(name);}
  13962. ,ifVoid:function(v,b){if(v==void 0){return b;}else{return v;}}
  13963. ,clamp:function(value,min,max){if(min===void 0){min=0;}if(max===void 0){max=1;}return Math.min(max,Math.max(min,value));}
  13964. ,getIndex:function(elem,index){index=index||'index';return elem.getAttributeNode(index)&&elem.getAttributeNode(index).nodeValue;}
  13965. ,setIndex:function(elem,name){elem.setAttribute('index',name);}
  13966. ,findParent:function(child,parent){ var a = child; do{ if(a == parent)return true; a = a.parentElement; }while(a); return false; }
  13967. };
  13968. }, {}
  13969. ],
  13970. 116: [function(e, t, i) {///js/main.js
  13971. (function(t) {
  13972. "use strict";
  13973. // xzw 开头的全部我写的
  13974. var dom = e("dom");
  13975. window.Data || (window.Data = {})
  13976. Data.imgRoot = "images/images" + number + "/"; //+'/hot/';
  13977. Data.imgRoot2 = "http://4dkk.4dage.com/FDKKIMG/";
  13978. var ifTest = window.location.href.substring(window.location.href.indexOf("?")+1).indexOf('test')>-1;
  13979. //Data.spotImgRoot = prefix + "images/images" + number + "/"; //+'/hot/'; //到底是要读7牛的还是本地的呢 伤脑筋哦
  13980. Data.spotImgRoot = "images/images" + number + "/"; //+'/hot/';
  13981. function i() {
  13982. var e = Y.getModelIDFromQueryString(); //读取后缀
  13983. if (!e)
  13984. return b(null, "loading-failed");
  13985. var t = Y.parseSidUrl(e)
  13986. , i = l()
  13987. , a = c()
  13988. , s = o()
  13989. , u = V.quickstart.enabled
  13990. , g = null
  13991. , m = null
  13992. , v = null
  13993. , w = null
  13994. , T = null
  13995. , x = null
  13996. , S = null
  13997. , M = null
  13998. , R = null
  13999. , P = null
  14000. , O = null
  14001. , L = null
  14002. , N = new ue;
  14003. r(s);
  14004. /* h({ //MP开头写法
  14005. urlBase: t.urlBase
  14006. }).then...... */
  14007. $.ajax("data/"+window.number+"/someData.json",{dataType: "json"}).done( function(e){ //改
  14008. e.files.templates[0] = e.files.templates[0].replace("{{number}}",window.number);
  14009. window.MP_PREFETCHED_MODELDATA = e;
  14010. h({
  14011. urlBase: t.urlBase
  14012. })//xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14013. }).then(function(i) {
  14014. return re.init(),
  14015. d(t, e) //getModel and load
  14016. }).then(function(e) {
  14017. return P = e,
  14018. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14019. startSource: i,
  14020. autoplay: V.autoplay,
  14021. quickstart: u
  14022. }),
  14023. P.urls.init() //加载file,但是不需要了
  14024. }).then(function() {
  14025. return P.loadPanos()
  14026. }).then(function() {
  14027. m = X.getStartCameraOptions(P, P.panos), //设置初始视角
  14028. S = A(P),
  14029. O = y(u, m.mode), //一个复杂的object
  14030. v = O.controls,
  14031. w = O.player,
  14032. T = O.director,
  14033. x = O.tagManager,
  14034. M = O.tileDownloader,
  14035. R = O.qualityManager,
  14036. L = O.panoRenderer,
  14037. C(P, S, O, s), //init All
  14038. P.supportsTiles && M.start(),
  14039. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14040. u = !1);
  14041. var e = null;
  14042. if (u) {
  14043. de.warn("Quickstart engaged. Hold on to your knickers.");
  14044. var t = v.controls[D.PANORAMA];
  14045. g = new ie(R,S.scene,S.camera,t,s),
  14046. _(S, s, P),
  14047. e = g.load(m).then(function() {
  14048. S.addComponent(g),
  14049. S.once(le.AfterRender, function() {
  14050. de.warn("First render after quickstart load finished.")
  14051. })
  14052. })
  14053. }
  14054. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14055. }).then(function() {
  14056. return f(P, U.onProgress, i, !u, a)
  14057. }).then(function() {
  14058. if (m.quickstart = u,
  14059. I(P, S, O, s),
  14060. S.started || _(S, s, P),
  14061. H.modelLoaded(P, w, v, V.autoplay),
  14062. E(w, P, m, V.autoplay).done(function() {
  14063. T.autoTour()
  14064. }),
  14065. !P.supportsTiles) {
  14066. var e = new Z(P,w);
  14067. e.start()
  14068. }
  14069. u && (S.removeComponent(g),
  14070. g.destroy(),
  14071. m.pano.enter()),
  14072. U.init(P, T, w, v, S, m, H.getSessionId()),
  14073. U.endLoading(P, T, x),
  14074. S.once(le.AfterRender, function() {
  14075. N.setAppReadyTime();
  14076. var e = N.calcFullLoadingTime();
  14077. de.warn("Total load time: " + e / 1e3),
  14078. H.loadComplete(e),
  14079. de.warn("First render after model load finished.")
  14080. }),
  14081. S.on(le.MemoryUsageUpdated, n)
  14082. }).fail(b.bind(this, e))
  14083. }
  14084. /*
  14085. 1 getAllInfo 三次出错 结束 显示数据塞车(有刷新按钮) 8秒后跳转404
  14086. 2 getAllInfo时 获取得到status 0 显示wait.html -1 直接跳转404
  14087. 3 getAllInfo正常 但之后获取modelData.js三次失败 显示数据在路上(有刷新按钮)不跳转
  14088. 4 最后获取模型文件时,三次出错即显示 数据塞车(有刷新按钮) 8秒后跳转404
  14089. */
  14090. function loadAllInfo(fuc){
  14091. window.loadInfoTime = window.loadInfoTime ? window.loadInfoTime+1 : 1;
  14092. console.log("第"+window.loadInfoTime+"次加载信息");
  14093. checkPassword().then( GetThumbImg ).then(fuc).fail(function(){
  14094. if(window.loadInfoTime < 3) loadAllInfo(fuc);
  14095. else {
  14096. y.error("getInfo-failed");
  14097. setTimeout(function(){
  14098. window.location.href = "404.html";
  14099. },8000)
  14100. }
  14101. });
  14102. }
  14103. function checkPassword(){
  14104. var t = $.Deferred();
  14105. var url = "scene/getInfo"
  14106. $.ajax({
  14107. url: url,
  14108. type: 'POST',
  14109. dataType: "json",
  14110. data : {num: window.number},
  14111. success: function (data) {
  14112. if(data && data!=0){
  14113. Data = $.extend(Data,data);
  14114. if(parseInt(Data.status) == 0){
  14115. window.location.href = "404.html?m=wait"+"&n="+window.number;//模型正在计算
  14116. return;
  14117. }else if(parseInt(Data.status) == -1) {
  14118. window.location.href = "404.html?m=404";//无
  14119. return;
  14120. }//1 or undefine都继续执行
  14121. Data.floorLogo = (data.floorLogo=="1" || data.floorLogo == 1) ? 1 : 0;
  14122. Data.thumbImg = (data.thumbImg=="1" || data.thumbImg == 1) ? 1 : 0;
  14123. Data.entry = data.entry;
  14124. Data.version = data.version || 0;
  14125. Data.currentPanoId = data.currentPanoId;
  14126. Data.sceneIndex = data.sceneIndex;
  14127. $("head title").text(data.sceneName || '四维看看');
  14128. $('.mS-pwBox').find('h3').text(data.sceneName || '四维看看');
  14129. $(".model-title").text(data.sceneName || '四维看看');
  14130. $(".model-title2").text(data.sceneName || '四维看看');
  14131. if(data.sceneDec)
  14132. {
  14133. $('.introduce-detail span')[0].innerHTML = data.sceneDec;
  14134. }
  14135. if(data.thumbImg == 1){
  14136. var url = "url(http://scene3d.4dage.com/images/images"+window.number+"/thumbBigImg.jpg)";
  14137. $("#gui-loading .bg").css("backgroundImage",url);
  14138. }
  14139. Data.sceneType = data.sceneType;
  14140. var imgSrc = "images/type/"+ data.sceneType +".svg"
  14141. $(".introduce-button-fImg,.mS-title img").attr("src",imgSrc);
  14142. if(data.public == 1){//需要密码
  14143. need();
  14144. }else{
  14145. t.resolve();
  14146. }
  14147. }else{
  14148. console.log('部分信息无法获取'); t.reject(); //t.reject();
  14149. }
  14150. },
  14151. error: function (msg) {
  14152. console.log('部分信息无法获取'); t.reject(); //t.reject();
  14153. }
  14154. });
  14155. var need = function(){//需要密码
  14156. $('.mS-pwBox').removeClass('hide');
  14157. var input = $('.mS-pwBox .mS-input');
  14158. var wrong = $('.mS-pwBox .mS-error');
  14159. var change = function(){
  14160. if(window.hasStartload) return;
  14161. var text = input[0].value;
  14162. if(Data.sceneKey == text){//密码正确
  14163. window.hasStartload = true; //防止因为点击button同时change触发两次
  14164. t.resolve();
  14165. }
  14166. }
  14167. $('.mS-confirm').on('click',function(){
  14168. var text = input[0].value;
  14169. if(Data.sceneKey == text){
  14170. $('.mS-pwBox').addClass('hide');
  14171. $('#player canvas').removeClass('hide');
  14172. }
  14173. else{
  14174. wrong.removeClass("hide");
  14175. }
  14176. })
  14177. $('.mS-pwBox').click(change);
  14178. dom.bind(input[0],"change",change);
  14179. dom.bind(input[0],"focus",function(){
  14180. wrong.addClass("hide");
  14181. });
  14182. }
  14183. //need()
  14184. return t.promise();
  14185. }
  14186. function GetThumbImg(){
  14187. var t = $.Deferred();
  14188. var img = new Image;
  14189. $("#gui-loading .bg").css({"display": "none"});
  14190. img.src = Data.thumbImg ? Data.imgRoot +CONSTANT.LOADPIC +"?"+"m="+Data.version : "http://scene3d.4dage.com/loading/pc.jpg";
  14191. img.onload = function(){
  14192. $("#gui-loading .bg").css({"background-image": "url("+img.src+")"});
  14193. $("#gui-loading .bg").fadeIn(120);
  14194. var s = window.location.search;
  14195. s = s.substring(3,s.length)
  14196. $(".introduce-ecodeBox").addClass("active");
  14197. var ecodeSrc = "http://www.4dkankan.com/sceneQRcode/"+s+".png";
  14198. $(".introduce-ecode img").attr("src",ecodeSrc);
  14199. //t.resolve();
  14200. }
  14201. return t.resolve().promise();
  14202. //return $.when(this);
  14203. }
  14204. function infoGuiBind(){
  14205. $(".introduce-button").click(function(e){
  14206. if( $(".introduce-detailBox").hasClass("hide")){
  14207. $(".introduce-detailBox").removeClass("hide");
  14208. setTimeout(function(){
  14209. $(".introduce-top").addClass("open");
  14210. },50)
  14211. }else{
  14212. close();
  14213. }
  14214. })
  14215. var close = function(e){
  14216. if(e && ( dom.findParent(e.target,$(".introduce-button")[0]) || dom.findParent(e.target, $(".introduce-detailBox")[0] ))) return;
  14217. if( !$(".introduce-detailBox").hasClass("hide")){
  14218. $(".introduce-top").removeClass("open");
  14219. setTimeout(function(){
  14220. $(".introduce-detailBox").addClass("hide");
  14221. },350)
  14222. }
  14223. }
  14224. document.addEventListener("click",close);
  14225. $("#player").on("touchstart",close);
  14226. }
  14227. function n(e) {
  14228. ce.update(e)
  14229. }
  14230. function r(e) {
  14231. de.info("Version", "2.25.6-0-gd87e5b1"),
  14232. q.defaultMaxListeners = 1e3,
  14233. a(e),
  14234. s()
  14235. }
  14236. function o() {
  14237. return document.getElementById("player")
  14238. }
  14239. function a(e) {
  14240. e.addEventListener("dragenter", T, !1),
  14241. e.addEventListener("dragover", T, !1)
  14242. }
  14243. function s() {
  14244. F.valueFromHash("title", !0) || $(document).ready(function() {
  14245. var e = $(".model-title");
  14246. e.hide()
  14247. })
  14248. }
  14249. function l() {
  14250. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14251. }
  14252. function c() {
  14253. return {
  14254. panoElementsToLoad: 6,
  14255. modelElementsToLoad: 0,
  14256. totalElementsLoaded: 0,
  14257. totalElementsToLoad: 0,
  14258. totalPercentageLoaded: 0,
  14259. progressCallback: null
  14260. }
  14261. }
  14262. function h(e) {
  14263. return K.loadFeatureFlags(e).done(function(e) {
  14264. K.updateDependentSettings(e, V)
  14265. })
  14266. }
  14267. function u(e) {
  14268. return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14269. responseType: "json",
  14270. prefetchFrom: "config"
  14271. }).then(function(e) {
  14272. return e ? void j.extendObject(V.appConfig, e) : {}
  14273. }, function(e) {
  14274. return de.warn("Failed loading runtime config, using defaults."),
  14275. $.when({})
  14276. })
  14277. }
  14278. function d(e, t) {
  14279. var i = B.getModel({
  14280. url: t,
  14281. floors: F.valueFromHash("f", !0),
  14282. autoload: !1
  14283. })
  14284. , n = u({
  14285. urlBase: e.urlBase
  14286. });
  14287. return $.when(i, n).then(null, function(e) {
  14288. return this
  14289. })
  14290. }
  14291. function p(e, t, i, n, r) {
  14292. de.info("Model data loaded"),
  14293. de.debug("UUID: " + e.data.job.uuid),
  14294. J.init(K.getFlags()),
  14295. i && H.initKeen({
  14296. token: i,
  14297. appId: n
  14298. }),
  14299. H.initSegment({
  14300. model: e.sid,
  14301. version: "2.25.6-0-gd87e5b1",
  14302. startSource: r.startSource,
  14303. token: t,
  14304. autoplay: r.autoplay,
  14305. quickstart: r.quickstart
  14306. })
  14307. }
  14308. function f(e, t, i, n, r) {
  14309. return r.progressCallback = t,
  14310. H.sessionStart(),
  14311. e.load(n).progress(g.bind(this, r))
  14312. }
  14313. function g(e, t) {
  14314. e.modelElementsToLoad = t[1],
  14315. v(e),
  14316. m(e)
  14317. }
  14318. function m(e) {
  14319. e.totalElementsLoaded++,
  14320. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14321. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14322. }
  14323. function v(e) {
  14324. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14325. }
  14326. function A(e) {
  14327. var t = new x.PerspectiveCamera;
  14328. t.layers.enable(he.PANOMARKERS),
  14329. t.layers.enable(he.RETICULE),
  14330. t.layers.enable(he.TAG);
  14331. var i = new x.Scene
  14332. , n = new x.AmbientLight(16777215);
  14333. i.add(n),
  14334. i.skybox = new W,
  14335. i.add(i.skybox),
  14336. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14337. side: x.DoubleSide
  14338. })),
  14339. i.plane.position.y = 0,
  14340. i.plane.rotateX(-Math.PI / 2),
  14341. i.plane.material.visible = !1,
  14342. i.add(i.plane),
  14343. i.updateMatrixWorld(),
  14344. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14345. if (e.metadata && e.metadata.camera_position) {
  14346. var t = e.metadata.camera_position
  14347. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14348. n.position = t.clone(),
  14349. i.add(n);
  14350. var r = e.metadata.camera_quaternion
  14351. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14352. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14353. }
  14354. }),
  14355. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14356. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14357. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14358. var r = new te(i,t,z);
  14359. return r
  14360. }
  14361. function y(e, t) {
  14362. var i = e ? 1 : 1e3
  14363. , n = J.tilegen || J.imgopt ? 6 : 2;
  14364. n = F.valueFromHash("tileconc", n);
  14365. var r = new ne
  14366. , o = new ae({
  14367. concurrentDownloads: n
  14368. })
  14369. , a = new se
  14370. , s = new P
  14371. , l = new M
  14372. , c = new S(t)
  14373. , h = new R
  14374. , u = new O(i)
  14375. , d = new L
  14376. , p = new oe;
  14377. return {
  14378. qualityManager: r,
  14379. panoRenderer: a,
  14380. tileDownloader: o,
  14381. player: c,
  14382. director: l,
  14383. modelManager: s,
  14384. tagManager: p,
  14385. displayController: u,
  14386. labelDisplayController: d,
  14387. controls: h
  14388. }
  14389. }
  14390. function C(e, t, i, n) {
  14391. var r = i.controls
  14392. , o = i.qualityManager
  14393. , a = i.panoRenderer
  14394. , s = i.tileDownloader
  14395. , l = i.modelManager;
  14396. r.init(n, l),
  14397. ee.init(i.director, r, i.player, l, t),
  14398. o.init(l),
  14399. s.init(o),
  14400. a.init(t, s, o),
  14401. l.init(s, a, o),
  14402. l.addModel(e),
  14403. t.addComponent(G)
  14404. }
  14405. function I(e, t, i, n) {
  14406. var r = i.qualityManager
  14407. , o = i.panoRenderer
  14408. , a = i.tileDownloader
  14409. , s = i.modelManager
  14410. , l = i.player
  14411. , c = i.director
  14412. , h = i.tagManager
  14413. , u = i.displayController
  14414. , d = i.labelDisplayController
  14415. , p = i.controls;
  14416. t.scene.add(e),
  14417. t.qualityManager = r;
  14418. var f = {
  14419. camera: t.camera,
  14420. director: c,
  14421. modelManager: s,
  14422. tileDownloader: a,
  14423. panoRenderer: o,
  14424. qualityManager: r,
  14425. tagManager: h,
  14426. container: n,
  14427. controls: p
  14428. };
  14429. l.init(f),
  14430. l.setScene(t.scene),
  14431. h.init(s, l),
  14432. c.init(l, s),
  14433. u.init(c, l, s, h, n),
  14434. d.init(l, s, n),
  14435. z.bindEvents(l),
  14436. t.addComponent(h),
  14437. t.addComponent(l),
  14438. t.addComponent(o)
  14439. }
  14440. function E(e, t, i, n) {
  14441. return de.info("Starting player in " + i.mode),
  14442. H.report(t.sid, "started-playing", n, i.quickstart),
  14443. e.start(i)
  14444. }
  14445. function b(e, t) {
  14446. de.error(t),
  14447. k.error(t),
  14448. H.report(e, "error-" + t)
  14449. }
  14450. function w(e) {
  14451. var t = F.details();
  14452. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14453. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14454. H.report(e, "error-webgl-generic"))
  14455. }
  14456. function _(e, t, i) {
  14457. try {
  14458. e.start(t)
  14459. } catch (e) {
  14460. throw de.warn(e.message),
  14461. w(i.sid),
  14462. e
  14463. }
  14464. }
  14465. function T(e) {
  14466. e.stopPropagation(),
  14467. e.preventDefault()
  14468. }
  14469. e("./lib/three75-shim"),
  14470. e("./lib/array-polyfill"),
  14471. e("./lib/performance-polyfill"),
  14472. e("./lib/shaders/CopyShader.js"),
  14473. e("./lib/shaders/HorizontalBlurShader.js"),
  14474. e("./lib/shaders/VerticalBlurShader.js"),
  14475. e("./lib/postprocessing/EffectComposer.js"),
  14476. e("./lib/postprocessing/RenderPass.js"),
  14477. e("./lib/postprocessing/MaskPass.js"),
  14478. e("./lib/postprocessing/ShaderPass.js"),
  14479. window.Promise || (window.Promise = e("promise-polyfill"));
  14480. var x = e("three")
  14481. , S = (e("./util/sentry"),
  14482. e("./player"))
  14483. , M = e("./director")
  14484. , R = e("./controls/CameraControls")
  14485. , P = e("./model/ModelManager")
  14486. , O = e("./DisplayController")
  14487. , L = e("./label/LabelDisplayController")
  14488. , D = e("./enum/Viewmode")
  14489. , N = e("./util/logger")
  14490. , B = e("./showcase")
  14491. , F = e("./util/browser")
  14492. , V = e("./settings")
  14493. , U = e("./gui/gui")
  14494. , k = e("./gui/error")
  14495. , H = e("./analytics")
  14496. , G = e("./util/transitions")
  14497. , z = e("./effects")
  14498. , W = e("./objects/Skybox")
  14499. , j = e("./util/common")
  14500. , Y = (e("./util/PanoramaCollection"),
  14501. e("./util/math"),
  14502. e("./util/showcase"))
  14503. , X = e("./util/camera")
  14504. , Z = (e("./objects/Panorama"),
  14505. e("./cameras/PanoramaCamera"),
  14506. e("./preloaders"))
  14507. , q = e("events").EventEmitter
  14508. , K = e("./featureflags")
  14509. , Q = (e("./util/lerp"),
  14510. e("./util/ajax"))
  14511. , J = e("./ab")
  14512. , ee = e("./sdk/automation.js")
  14513. , te = e("./scene/SceneRenderer")
  14514. , ie = e("./scene/QuickstartManager")
  14515. , ne = e("./tile/QualityManager.js")
  14516. , re = e("./localization/localize")
  14517. , oe = e("./tag/tagManager")
  14518. , ae = e("./tile/TileDownloader")
  14519. , se = e("./tile/PanoRenderer")
  14520. , le = (e("./enum/PanoSizeClass"),
  14521. e("./enum/PanoramaEvents"),
  14522. e("./enum/SceneRendererEvents"))
  14523. , ce = e("./gui/memoryUsage")
  14524. , he = e("./enum/RenderLayers")
  14525. , ue = e("./TimingData")
  14526. , de = new N(t);
  14527. N.level = V.logLevel,
  14528. N.consoleEnabled = V.console,
  14529. i()
  14530. }
  14531. ).call(this, "/js/main.js")
  14532. }
  14533. , {
  14534. "./DisplayController": 1,
  14535. "./TimingData": 2,
  14536. "./ab": 3,
  14537. "./analytics": 4,
  14538. "./cameras/PanoramaCamera": 7,
  14539. "./controls/CameraControls": 9,
  14540. "./director": 15,
  14541. "./effects": 16,
  14542. "./enum/PanoSizeClass": 36,
  14543. "./enum/PanoramaEvents": 37,
  14544. "./enum/RenderLayers": 41,
  14545. "./enum/SceneRendererEvents": 43,
  14546. "./enum/Viewmode": 51,
  14547. "./featureflags": 59,
  14548. "./gui/error": 64,
  14549. "./gui/gui": 65,
  14550. "./gui/memoryUsage": 73,
  14551. "./label/LabelDisplayController": 91,
  14552. "./lib/array-polyfill": 92,
  14553. "./lib/performance-polyfill": 95,
  14554. "./lib/postprocessing/EffectComposer.js": 96,
  14555. "./lib/postprocessing/MaskPass.js": 97,
  14556. "./lib/postprocessing/RenderPass.js": 98,
  14557. "./lib/postprocessing/ShaderPass.js": 99,
  14558. "./lib/shaders/CopyShader.js": 100,
  14559. "./lib/shaders/HorizontalBlurShader.js": 101,
  14560. "./lib/shaders/VerticalBlurShader.js": 102,
  14561. "./lib/three75-shim": 103,
  14562. "./localization/localize": 108,
  14563. "./tag/tagManager": 124,
  14564. "./model/ModelManager": 140,
  14565. "./objects/Panorama": 148,
  14566. "./objects/Skybox": 152,
  14567. "./player": 155,
  14568. "./preloaders": 156,
  14569. "./scene/QuickstartManager": 157,
  14570. "./scene/SceneRenderer": 158,
  14571. "./sdk/automation.js": 164,
  14572. "./settings": 166,
  14573. "./showcase": 168,
  14574. "./tile/PanoRenderer": 169,
  14575. "./tile/QualityManager.js": 170,
  14576. "./tile/TileDownloader": 171,
  14577. "./util/PanoramaCollection": 178,
  14578. "./util/ajax": 181,
  14579. "./util/browser": 182,
  14580. "./util/camera": 183,
  14581. "./util/common": 185,
  14582. "./util/lerp": 188,
  14583. "./util/logger": 189,
  14584. "./util/math": 190,
  14585. "./util/sentry": 192,
  14586. "./util/showcase": 193,
  14587. "./util/transitions": 195,
  14588. events: 202,
  14589. "promise-polyfill": 213,
  14590. three: 217,
  14591. "Editor" : "Editor",
  14592. "dom" : "dom"
  14593. }],
  14594. 117: [function(e, t, i) {//"../materials/CubemapMaterial"
  14595. "use strict";
  14596. function n(e) {
  14597. e = e || {},
  14598. r.RawShaderMaterial.call(this, a.extendObject({
  14599. fragmentShader: o.cube.fragmentShader,
  14600. vertexShader: o.cube.vertexShader,
  14601. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14602. name: "CubemapMaterial"
  14603. }, e))
  14604. }
  14605. var r = e("three")
  14606. , o = e("../shaders")
  14607. , a = e("../util/common");
  14608. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14609. n.prototype.constructor = n,
  14610. t.exports = n
  14611. }
  14612. , {
  14613. "../shaders": 167,
  14614. "../util/common": 185,
  14615. three: 217
  14616. }],
  14617. 118: [function(e, t, i) {//"../materials/ModelTextureMaterial"
  14618. "use strict";
  14619. function n(e) {
  14620. e = e || {},
  14621. r.RawShaderMaterial.call(this, a.extendObject({
  14622. fragmentShader: o.model.fragmentShader,
  14623. vertexShader: o.model.vertexShader,
  14624. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14625. name: "ModelTextureMaterial"
  14626. }, e))
  14627. }
  14628. var r = e("three")
  14629. , o = e("../shaders")
  14630. , a = e("../util/common");
  14631. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14632. n.prototype.constructor = n,
  14633. n.prototype.setProjectedPanos = function(e, t, i) {
  14634. i && (this.uniforms.progress.value = 0),
  14635. e.ensureSkyboxReadyForRender(),
  14636. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14637. this.uniforms.pano0Position.value.copy(e.position),
  14638. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14639. t.ensureSkyboxReadyForRender(),
  14640. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14641. this.uniforms.pano1Position.value.copy(t.position),
  14642. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14643. }
  14644. ,
  14645. t.exports = n
  14646. }
  14647. , {
  14648. "../shaders": 167,
  14649. "../util/common": 185,
  14650. three: 217
  14651. }],
  14652. 119: [function(e, t, i) {///js/tag/Billboard/Billboard.js
  14653. (function(i) {
  14654. "use strict";
  14655. function n(e, t, i, n) {
  14656. this.div = null,
  14657. this.body = null,
  14658. this.label = e,
  14659. this.description = t,
  14660. this.parsedDescription = [],
  14661. this.media = i || {
  14662. type: null
  14663. },
  14664. this.loadingSpinner = null,
  14665. this.parser = new r({
  14666. supportLinks: !u.valueFromHash("mls"),
  14667. keepLinkLabels: !0
  14668. }),
  14669. this.state = I.CLOSED,
  14670. this.orientation = "",
  14671. this.initialTransform = "",
  14672. this.hovering = !1,
  14673. this.openTransition = null,
  14674. this.closeTransition = null,
  14675. this.openPromise = null,
  14676. this.closePromise = null,
  14677. this.animationTransition = null,
  14678. this.animationScale = 0
  14679. }
  14680. var r = e("../Parser/DescriptionParser")
  14681. , o = e("../Media/Link")
  14682. , a = e("../Media/Image")
  14683. , s = e("../Media/EmbedlyPlayer")
  14684. , l = e("../Media/EmbedlyEmbed")
  14685. , c = e("../../util/transitions")
  14686. , h = e("../../util/lerp")
  14687. , u = e("../../util/browser")
  14688. , d = e("./BillboardEvent")
  14689. , p = e("../Media/MediaEvent")
  14690. , f = e("../Parser/DescriptionChunkType")
  14691. , g = e("events").EventEmitter
  14692. , m = e("./billboardSettings")
  14693. , v = e("./overlaySettings")
  14694. , A = e("../../util/logger")
  14695. , y = new A(i)
  14696. , C = document.getElementById("tag-billboards");
  14697. C.addEventListener("touchend", function(e) {
  14698. C.style.pointerEvents = "none"
  14699. }),
  14700. C.addEventListener("touchcancel", function(e) {
  14701. C.style.pointerEvents = "none"
  14702. });
  14703. var I = {
  14704. CLOSED: "closed",
  14705. OPENING: "opening",
  14706. OPEN: "open",
  14707. CLOSING: "closing",
  14708. ACTIVE: "active"
  14709. };
  14710. n.prototype = Object.create(g.prototype),
  14711. n.prototype.build = function(e) {
  14712. this.parsedDescription = this.parser.parse(this.description);
  14713. var t = document.createElement("div");
  14714. t.className = "tag-container has-hotzone",
  14715. this.div = t,
  14716. this.body = document.createElement("div"),
  14717. this.body.className = "tag-body";
  14718. var i = document.createElement("div");
  14719. i.classList.add("tag-content");
  14720. var n = document.createElement("div");
  14721. n.classList.add("tag-text-content");
  14722. var r = document.createElement("div");
  14723. r.className = "tag-label",
  14724. r.textContent = this.label,
  14725. n.appendChild(r);
  14726. var o = document.createElement("div");
  14727. o.className = "tag-desc",
  14728. n.appendChild(o),
  14729. i.appendChild(n),
  14730. this.body.appendChild(i),
  14731. this.appendDescriptionElements(this.parsedDescription, o),
  14732. this.appendMedia(),
  14733. t.appendChild(this.body),
  14734. C.appendChild(t),
  14735. this.bindEvents(t, this.body)
  14736. }
  14737. ,
  14738. n.prototype.bindEvents = function(e, t) {
  14739. var i = function(e) {
  14740. return function(t) {
  14741. if (!this.div.classList.contains("overlay")) {
  14742. var i, n = document.getElementById("player");
  14743. try {
  14744. i = new MouseEvent(e,t)
  14745. } catch (n) {
  14746. i = document.createEvent("MouseEvents"),
  14747. i.initMouseEvent(e, t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  14748. }
  14749. n.dispatchEvent(i)
  14750. }
  14751. }
  14752. };
  14753. t.addEventListener("mousedown", function(e) {
  14754. e.stopPropagation()
  14755. }),
  14756. t.addEventListener("mouseup", function(e) {
  14757. e.stopPropagation()
  14758. }),
  14759. e.addEventListener("touchstart", function(e) {
  14760. C.style.pointerEvents = "auto"
  14761. }),
  14762. e.addEventListener("mousedown", i("mousedown").bind(this)),
  14763. e.addEventListener("mouseup", i("mouseup").bind(this)),
  14764. t.addEventListener("mouseover", function(t) {
  14765. this.state === I.OPEN && e.classList.remove("has-hotzone")
  14766. }
  14767. .bind(this)),
  14768. e.addEventListener("mouseenter", function(e) {
  14769. this.state !== I.CLOSING && (this.hovering = !0,
  14770. this.emit(d.ENTER))
  14771. }
  14772. .bind(this)),
  14773. e.addEventListener("mouseleave", function(e) {
  14774. this.hovering = !1,
  14775. this.emit(d.LEAVE)
  14776. }
  14777. .bind(this)),
  14778. e.addEventListener("gesturestart", function(e) {
  14779. e.preventDefault()
  14780. });
  14781. var n = e.querySelector(".tag-text-content")
  14782. , r = 0;
  14783. n.addEventListener("touchstart", function(e) {
  14784. r = e.changedTouches[0].clientY
  14785. }),
  14786. n.addEventListener("touchmove", function(t) {
  14787. function i(e) {
  14788. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14789. }
  14790. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  14791. }),
  14792. e.addEventListener("touchmove", function(e) {
  14793. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14794. })
  14795. }
  14796. ,
  14797. n.prototype.appendDescriptionElements = function(e, t) {
  14798. e.length > 0 && this.div.classList.add("has-text"),
  14799. e.forEach(function(e, i) {
  14800. switch (e.type) {
  14801. case f.TEXT:
  14802. t.appendChild(this.createTextElement(e.text));
  14803. break;
  14804. case f.LINK:
  14805. t.appendChild(this.createLinkElement(e.link))
  14806. }
  14807. }
  14808. .bind(this))
  14809. }
  14810. ,
  14811. n.prototype.appendLoadingSpinner = function() {
  14812. this.loadingSpinner = document.createElement("div"),
  14813. this.loadingSpinner.classList.add("loading-spinner");
  14814. var e = document.createElement("div");
  14815. e.classList.add("gui-spinner-icon"),
  14816. this.loadingSpinner.appendChild(e),
  14817. this.body.appendChild(this.loadingSpinner)
  14818. }
  14819. ,
  14820. n.prototype.onMediaLoadFinished = function() {
  14821. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14822. this.applyOrientation(this.orientation),
  14823. this.loadingSpinner = null)
  14824. }
  14825. ,
  14826. n.prototype.appendMedia = function() {
  14827. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  14828. this.appendLoadingSpinner();
  14829. var e = document.createElement("div");
  14830. e.classList.add("tag-media-content");
  14831. var t = document.createElement("i");
  14832. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14833. t.classList.add(e)
  14834. }),
  14835. this.body.appendChild(t),
  14836. this.body.appendChild(e),
  14837. this.media.type) {
  14838. case f.IMAGE:
  14839. e.appendChild(this.createImageElement(this.media, this.body));
  14840. break;
  14841. case f.VIDEO:
  14842. e.appendChild(this.createVideoElement(this.media, this.body));
  14843. break;
  14844. case f.RICH:
  14845. e.appendChild(this.createEmbedElement(this.media, this.body))
  14846. }
  14847. }
  14848. }
  14849. ,
  14850. n.prototype.createTextElement = function(e) {
  14851. var t = document.createElement("span");
  14852. return t.textContent = e,
  14853. t
  14854. }
  14855. ;
  14856. n.prototype.createLinkElement = function(e) {
  14857. var t = new o(e);
  14858. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  14859. t.createDomElement()
  14860. }
  14861. ,
  14862. n.prototype.createImageElement = function(e, t) {
  14863. function i() {
  14864. function e() {
  14865. m || (r.classList.remove("view-image"),
  14866. c.classList.add("overlay"),
  14867. i(),
  14868. window.addEventListener("resize", b),
  14869. c.addEventListener("click", a),
  14870. g.addEventListener("click", l),
  14871. f.addEventListener("click", s),
  14872. m = !0,
  14873. o.emit(p.IMAGE_OPENED))
  14874. }
  14875. function i() {
  14876. t.classList.add("show-info"),
  14877. h.classList.remove("collapsible"),
  14878. h.style.height = "";
  14879. var e = parseFloat(getComputedStyle(I).lineHeight)
  14880. , i = y + e
  14881. , r = c.clientWidth - 2 * v.boundaryWidth - C
  14882. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  14883. , s = a
  14884. , l = s * n.aspect;
  14885. l > r && (l = r,
  14886. s = l / n.aspect),
  14887. s > a && (s = a,
  14888. l = s * n.aspect),
  14889. l += C,
  14890. s += C + i,
  14891. t.style.width = l + "px",
  14892. t.style.height = s + "px",
  14893. u.style.paddingTop = e + C + "px",
  14894. o.description.length > 0 && (h.classList.add("collapsible"),
  14895. h.style.height = h.clientHeight + 12 + "px",
  14896. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  14897. }
  14898. function a(e) {
  14899. e.target === c && s()
  14900. }
  14901. function s() {
  14902. m && (m = !1,
  14903. r.classList.add("view-image"),
  14904. c.classList.remove("overlay"),
  14905. h.style.height = "",
  14906. u.style.paddingTop = "",
  14907. t.style.width = "",
  14908. t.style.height = "",
  14909. window.removeEventListener("resize", b),
  14910. c.removeEventListener("click", a),
  14911. g.removeEventListener("click", l),
  14912. f.removeEventListener("click", s),
  14913. o.emit(p.IMAGE_CLOSED),
  14914. o.close(!0))
  14915. }
  14916. function l(e) {
  14917. t.classList.toggle("show-info")
  14918. }
  14919. var c = o.div
  14920. , h = c.getElementsByClassName("tag-content")[0]
  14921. , u = c.getElementsByClassName("tag-media-content")[0]
  14922. , f = t.getElementsByClassName("close")[0]
  14923. , g = h.getElementsByClassName("tag-label")[0];
  14924. c.classList.add("has-image"),
  14925. r.classList.add("view-image"),
  14926. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  14927. o.applyOrientation(o.orientation);
  14928. var m = !1
  14929. , A = getComputedStyle(h)
  14930. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  14931. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  14932. , I = h.querySelector(".tag-label")
  14933. , E = h.querySelector(".tag-desc")
  14934. , b = function() {
  14935. var e, t, n = 0;
  14936. return function() {
  14937. clearInterval(e),
  14938. clearTimeout(t),
  14939. e = setInterval(function() {
  14940. var e = c.clientHeight;
  14941. n !== e && (i(),
  14942. n = e)
  14943. }, 100),
  14944. t = setTimeout(clearInterval.bind(this, e), 1e3)
  14945. }
  14946. }();
  14947. n.on(p.IMAGE_OPENING, e),
  14948. o.on(d.ACTIVATE, e),
  14949. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  14950. o.on(d.CLOSING, s)
  14951. }
  14952. var n = new a
  14953. , r = n.createDomElement();
  14954. this.once(d.OPENED, function() {
  14955. n.load(e.src).then(i).catch(function(t) {
  14956. y.warn("Failed to load image:", e.src),
  14957. y.warn("with error:", t)
  14958. }).then(this.onMediaLoadFinished.bind(this))
  14959. });
  14960. var o = this;
  14961. return r
  14962. }
  14963. ,
  14964. n.prototype.createVideoElement = function(e, t) {
  14965. var i = new s({
  14966. autoPlay: !0,
  14967. autoResume: !0,
  14968. startMuted: !1,
  14969. loop: !1
  14970. })
  14971. , n = i.createDomElement();
  14972. return this.once(d.OPENED, function() {
  14973. i.load(e.src).then(function() {
  14974. this.div.classList.add("has-video"),
  14975. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  14976. i.play()),
  14977. this.on(d.OPENING, i.show.bind(i)),
  14978. this.on(d.OPENED, i.play.bind(i)),
  14979. this.on(d.CLOSING, i.pause.bind(i)),
  14980. this.on(d.CLOSED, i.hide.bind(i))
  14981. }
  14982. .bind(this)).catch(function(t) {
  14983. y.warn("Failed to embed video:", e.src),
  14984. y.warn("with error:", t)
  14985. }).then(this.onMediaLoadFinished.bind(this))
  14986. }
  14987. .bind(this)),
  14988. n
  14989. }
  14990. ,
  14991. n.prototype.createEmbedElement = function(e, t) {
  14992. var i = new l
  14993. , n = i.createDomElement();
  14994. return this.once(d.OPENED, function() {
  14995. i.load(e.src).then(function() {
  14996. this.div.classList.add("has-embed"),
  14997. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  14998. this.applyOrientation(this.orientation),
  14999. this.on(d.OPENING, i.show.bind(i)),
  15000. this.on(d.CLOSED, i.hide.bind(i))
  15001. }
  15002. .bind(this)).catch(function(t) {
  15003. y.warn("Failed to embed:", e.src),
  15004. y.warn("with error:", t)
  15005. }).then(this.onMediaLoadFinished.bind(this))
  15006. }
  15007. .bind(this)),
  15008. n
  15009. }
  15010. ,
  15011. n.prototype.open = function(e) {
  15012. return this.openPromise = $.Deferred(),
  15013. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15014. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15015. this.state !== I.OPEN && (this.emit(d.OPENING),
  15016. e && this.emit(d.ACTIVATING),
  15017. this.state = I.OPENING,
  15018. this.animateOpen(function() {
  15019. e && this.setActiveState(),
  15020. this.openPromise.resolve()
  15021. }
  15022. .bind(this)))
  15023. }
  15024. .bind(this), m.animation.openDelay),
  15025. c.cancel(this.closeTransition),
  15026. this.closePromise && this.closePromise.reject(),
  15027. this.closeTransition = void 0,
  15028. this.openPromise.promise())
  15029. }
  15030. ,
  15031. n.prototype.close = function(e) {
  15032. return this.closePromise = $.Deferred(),
  15033. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15034. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15035. this.state = I.CLOSING,
  15036. this.animateClose())
  15037. }
  15038. .bind(this), m.animation.closeDelay)),
  15039. c.cancel(this.openTransition),
  15040. this.openPromise && this.openPromise.reject(),
  15041. this.openTransition = void 0,
  15042. this.closePromise.resolve(),
  15043. this.closePromise.promise())
  15044. }
  15045. ,
  15046. n.prototype.setActiveState = function() {
  15047. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15048. this.emit(d.ACTIVATE),
  15049. this.div.classList.remove("has-hotzone"))
  15050. }
  15051. ,
  15052. n.prototype.animateOpen = function(e) {
  15053. if (this.state === I.OPENING) {
  15054. if (c.cancel(this.animationTransition),
  15055. u.detectSamsungNative())
  15056. return this.boardOrientation = null,
  15057. this.div.style.visibility = "visible",
  15058. this.emit(d.OPENED),
  15059. this.state = I.OPEN,
  15060. void (e && e());
  15061. this.div.style.webkitTransform = "scale(0)",
  15062. this.div.style.transform = "scale(0)",
  15063. this.div.style.visibility = "visible",
  15064. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15065. this.emit(d.OPENED),
  15066. this.state = I.OPEN,
  15067. e && e()
  15068. }
  15069. .bind(this))
  15070. }
  15071. }
  15072. ,
  15073. n.prototype.animateClose = function(e) {
  15074. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15075. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15076. this.emit(d.CLOSED),
  15077. this.state = I.CLOSED,
  15078. this.div.style.visibility = "hidden",
  15079. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15080. e && e()
  15081. }
  15082. .bind(this)))
  15083. }
  15084. ,
  15085. n.prototype.needsUpdate = function() {
  15086. return this.state !== I.CLOSED
  15087. }
  15088. ,
  15089. n.prototype.update = function(e, t) {
  15090. if (this.needsUpdate()) {
  15091. var i = (this.updateOrientation(e),
  15092. this.calcScale(t))
  15093. , n = {
  15094. x: (e.x + 1) * $('#player').width() / 2,
  15095. y: (e.y + 1) * $('#player').height() / 2
  15096. };
  15097. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15098. this.div.style.webkitTransform = this.div.screenTransform,
  15099. this.div.style.transform = this.div.screenTransform
  15100. }
  15101. }
  15102. ,
  15103. n.prototype.getDimensions = function() {
  15104. return this.div.getBoundingClientRect()
  15105. }
  15106. ,
  15107. n.prototype.ifOutOfScreen = function() {//xzw add
  15108. var t = this.getDimensions();
  15109. var pad = 8;
  15110. return t.left<0-pad || t.right> $("#player").width()+pad || t.top<0-pad || t.bottom>$("#player").height()+pad;
  15111. }
  15112. ,
  15113. n.prototype.calcScale = function(e) {
  15114. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15115. }
  15116. ,
  15117. n.prototype.updateOrientation = function(e) {
  15118. if (this.state !== I.ACTIVE) {
  15119. var t = 1 / 3
  15120. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15121. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15122. , r = "";
  15123. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15124. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15125. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15126. 1 === i && (r = $('#player').width()>$('#player').height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15127. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15128. }
  15129. }
  15130. ,
  15131. n.prototype.applyOrientation = function(e) {
  15132. this.div.style.transform = this.div.style.webkitTransform = "",
  15133. this.div.classList.remove("tag-container-" + this.orientation),
  15134. this.div.classList.add("tag-container-" + e);
  15135. var t = window.getComputedStyle(this.div);
  15136. this.initialTransform = t.transform || t.webkitTransform,
  15137. "none" === this.initialTransform && (this.initialTransform = "");
  15138. var i = t.transform.slice(7, -1).split(",")
  15139. , n = -i[4]
  15140. , r = -i[5];
  15141. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15142. this.div.style.transformOrigin = n + "px " + r + "px",
  15143. this.orientation = e
  15144. }
  15145. ,
  15146. t.exports = n
  15147. }
  15148. ).call(this, "/js/tag/Billboard/Billboard.js")
  15149. }
  15150. , {
  15151. "../../util/browser": 182,
  15152. "../../util/lerp": 188,
  15153. "../../util/logger": 189,
  15154. "../../util/transitions": 195,
  15155. "../Media/EmbedlyEmbed": 125,
  15156. "../Media/EmbedlyPlayer": 126,
  15157. "../Media/Image": 128,
  15158. "../Media/Link": 129,
  15159. "../Media/MediaEvent": 131,
  15160. "../Parser/DescriptionChunkType": 133,
  15161. "../Parser/DescriptionParser": 134,
  15162. "./BillboardEvent": 120,
  15163. "./billboardSettings": 121,
  15164. "./overlaySettings": 122,
  15165. events: 202
  15166. }],
  15167. 120: [function(e, t, i) {//"./tag/Billboard/BillboardEvent"
  15168. "use strict";
  15169. t.exports = Object.freeze({
  15170. ENTER: "billboard.enter",
  15171. LEAVE: "billboard.leave",
  15172. OPENING: "billboard.opening",
  15173. OPENED: "billboard.open",
  15174. CLOSING: "billboard.closing",
  15175. CLOSED: "billboard.closed",
  15176. ACTIVATING: "billboard.activating",
  15177. ACTIVATE: "billboard.activate"
  15178. })
  15179. }
  15180. , {}],
  15181. 121: [function(e, t, i) {//"./billboardSettings"
  15182. "use strict";
  15183. t.exports = Object.freeze({
  15184. animation: Object.freeze({
  15185. hoverOnClosing: !1,
  15186. openDelay: 100,
  15187. closeDelay: 50,
  15188. openDuration: 200,
  15189. closeDuration: 100
  15190. }),
  15191. boardToDiscRatio: 1.2
  15192. })
  15193. }
  15194. , {}],
  15195. 122: [function(e, t, i) {//"./overlaySettings
  15196. "use strict";
  15197. t.exports = Object.freeze({
  15198. boundaryWidth: 30,
  15199. boundaryHeight: 0
  15200. })
  15201. }
  15202. , {}],
  15203. 123: [function(e, t, i) {//js/tag/tag.js
  15204. (function(i) {
  15205. "use strict";
  15206. function n(e, t, i) {
  15207. var n = i.version || "0";
  15208. "0" !== n && I.info("tag defined using version " + n),
  15209. this.model = e,
  15210. this.sid = t,
  15211. this.color = (new r.Color).set(i.color || l.tagDefault),
  15212. this.hoverColor = l._darken(this.color, .2),
  15213. this.floor = null,
  15214. this.floorIndex = i.floor,
  15215. this.mode = s.PANORAMA,
  15216. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15217. this.obj3d = null,
  15218. this.disc = null,
  15219. this.materials = {
  15220. disc: null,
  15221. pole: null
  15222. },
  15223. this.position = (new r.Vector3).copy(i.position),
  15224. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15225. this.discWorldPosition = null,
  15226. this.discScale = .05,
  15227. this.poleEnabled = i.stem.enabled,
  15228. this.billboard = new o(i.label,i.description,i.media,this),
  15229. this.visibleTransition = null,
  15230. this.hoveringDisc = !1
  15231. }
  15232. var r = e("three")
  15233. , o = e("./Billboard/Billboard")
  15234. , a = e("../settings")
  15235. , s = e("../enum/Viewmode")
  15236. , l = e("../enum/Colors")
  15237. , c = e("../enum/RenderLayers")
  15238. , h = e("../enum/RenderOrder")
  15239. , u = (e("../util/common"),
  15240. e("../util/math"))
  15241. , d = e("../util/texture")
  15242. , p = e("../objects/Panorama")
  15243. , f = e("../shaders")
  15244. , g = e("../util/transitions")
  15245. , m = e("../util/lerp")
  15246. , v = e("../util/easing")
  15247. , A = e("./Billboard/BillboardEvent")
  15248. , y = e("events").EventEmitter
  15249. , C = e("../util/logger")
  15250. , I = new C(i)
  15251. , E = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg==")
  15252. , b = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC")
  15253. , w = new r.PlaneBufferGeometry(1,1);
  15254. n.prototype = Object.create(y.prototype),
  15255. n.raycaster = new r.Raycaster,
  15256. n.prototype.bindEvents = function() {
  15257. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15258. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15259. }
  15260. ,
  15261. n.prototype.build = function() {
  15262. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15263. this.floor && (this.billboard.build(this.model.sid),
  15264. this.obj3d = this.buildObject3D(),
  15265. this.floor.add(this.obj3d)),
  15266. this
  15267. }
  15268. ,
  15269. n.prototype.buildObject3D = function() {
  15270. var e = new r.Object3D;
  15271. e.position.copy(this.position);
  15272. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15273. t.bg.value = b,
  15274. t.mask.value = E,
  15275. t.color.value.copy(this.color),
  15276. this.materials.disc = new r.RawShaderMaterial({
  15277. transparent: !0,
  15278. vertexShader: f.tagDisc.vertexShader,
  15279. fragmentShader: f.tagDisc.fragmentShader,
  15280. uniforms: t
  15281. }),
  15282. this.disc = new r.Mesh(w,this.materials.disc),
  15283. this.disc.layers.set(c.TAG),
  15284. this.disc.position.copy(this.discPosition),
  15285. this.disc.renderOrder = h.tagDisc,
  15286. this.disc.tag = this;
  15287. var i = this.buildPole();
  15288. return i.layers.set(c.TAG),
  15289. i.renderOrder = h.tagStem,
  15290. e.add(i),
  15291. e.layers.set(c.TAG),
  15292. e.add(this.disc)
  15293. }
  15294. ,
  15295. n.prototype.buildPole = function() {
  15296. var e = new r.BufferGeometry
  15297. , t = new Float32Array(6);
  15298. return t[0] = t[1] = t[2] = 0,
  15299. t[3] = this.discPosition.x,
  15300. t[4] = this.discPosition.y,
  15301. t[5] = this.discPosition.z,
  15302. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15303. this.materials.pole = new r.LineBasicMaterial({
  15304. linewidth: a.tags.pole.width,
  15305. color: a.tags.pole.color,
  15306. opacity: 0,
  15307. visible: this.poleEnabled,
  15308. transparent: !0,
  15309. depthWrite: !1
  15310. }),
  15311. new r.Line(e,this.materials.pole)
  15312. }
  15313. ,
  15314. n.prototype.setFreeState = function(e) {
  15315. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15316. this.materials.disc.uniforms.color.value = this.color
  15317. }
  15318. .bind(this))
  15319. }
  15320. ,
  15321. n.prototype.setHoverState = function(e) {
  15322. this.billboard.open(e),
  15323. this.materials.disc.uniforms.color.value = this.hoverColor
  15324. }
  15325. ,
  15326. n.prototype.hide = function(e, t) {
  15327. var i = $.Deferred();
  15328. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15329. return i.resolve().promise();
  15330. e = e || 0,
  15331. t = t || 0,
  15332. g.cancel(this.visibleTransition);
  15333. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15334. , r = t + e
  15335. , o = t / r;
  15336. return this.visibleTransition = g.start(function(e) {
  15337. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15338. , i = m.property(e.materials.pole, "opacity", 0);
  15339. return function(n) {
  15340. t(n),
  15341. e.materials.pole && i(n)
  15342. }
  15343. }(this), r * n, function() {
  15344. i.resolve()
  15345. }, o, v[a.warp.blendEasing]),
  15346. i.promise()
  15347. }
  15348. ,
  15349. n.prototype.show = function(e, t) {
  15350. var i = $.Deferred();
  15351. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15352. return i.resolve().promise();
  15353. e = e || 0,
  15354. t = t || 0,
  15355. g.cancel(this.visibleTransition);
  15356. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15357. , r = t + e
  15358. , o = t / r;
  15359. return this.visibleTransition = g.start(function(e) {
  15360. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15361. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15362. return function(n) {
  15363. t(n),
  15364. e.materials.pole && i(n)
  15365. }
  15366. }(this), r * n, function() {
  15367. i.resolve()
  15368. }, o, v[a.warp.blendEasing]),
  15369. i.promise()
  15370. }
  15371. ,
  15372. n.prototype.closestPanoTowardTag = function(e, t) {
  15373. var i = []
  15374. , o = []
  15375. , l = this.disc.getWorldPosition();
  15376. if (e === s.PANORAMA) {
  15377. var c = .5
  15378. , h = t.position.clone().sub(l).normalize();
  15379. i.push(p.filters.isPanoAligned()),
  15380. i.push(p.filters.inPanoDirection(l, h, c)),
  15381. i.push(p.filters.isNeighbourPanoTo(t)),
  15382. o.push(p.scoreFunctions.direction(l, h))
  15383. }
  15384. var u = new r.Vector3
  15385. , d = function(e) {
  15386. u.copy(l).sub(e.position);
  15387. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15388. , i = a.tags.navigate.tiltTolerance;
  15389. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15390. }
  15391. , f = function(e) {
  15392. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15393. };
  15394. i.push(f, d),
  15395. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15396. var g = this.model.panos.sortByScore(i, o);
  15397. if (a.tags.navigate.lineOfSight) {
  15398. for (var m = 0; m < g.length; m++) {
  15399. var v = g[m].pano
  15400. , A = v.position.distanceTo(l);
  15401. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15402. return null;
  15403. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15404. var y = n.raycaster.intersectObjects(this.model.colliders);
  15405. if (0 === y.length || y[0].distance > A)
  15406. return v
  15407. }
  15408. return null
  15409. }
  15410. return g.length > 0 && g[0].pano
  15411. }
  15412. ,
  15413. n.prototype.examine = function(e) {
  15414. var t = e.mode
  15415. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15416. , n = this.disc.getWorldPosition();
  15417. this.billboard.setActiveState();
  15418. var o = function() {
  15419. var t = this.billboard.getDimensions()
  15420. , n = new r.Vector3;
  15421. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15422. n.unproject(e.camera),
  15423. e.flyToPano({
  15424. pano: i,
  15425. lookAtPoint: n
  15426. })
  15427. }
  15428. .bind(this);
  15429. if (t === s.PANORAMA)
  15430. if (i !== e.currentPano) {
  15431. var l = {
  15432. pano: i,
  15433. lookAtPoint: n,
  15434. duration: null,
  15435. maxDistanceOverride: null,
  15436. skipWarpingCheck: !1
  15437. };
  15438. e.flyToPano(l, o)
  15439. } else
  15440. setTimeout(function() {
  15441. this.billboard.open().then(function() {
  15442. o()
  15443. })
  15444. }
  15445. .bind(this), 0);
  15446. else {
  15447. var c = {
  15448. pano: i
  15449. };
  15450. if (n) {
  15451. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15452. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15453. }
  15454. c.callback = o,
  15455. c.duration = 1500,
  15456. c.mode = s.PANORAMA,
  15457. e.flyToNewMode(c)
  15458. }
  15459. }
  15460. ,
  15461. n.prototype.update = function(e, t) {
  15462. var i = new r.Vector3;
  15463. return function(e, t) {
  15464. this.discWorldPosition = this.disc.getWorldPosition(),
  15465. this.updateDisc(e, t),
  15466. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15467. i.z < 1 && (i.y *= -1,
  15468. this.billboard.update(i, this.getDiscRadius(i, t))))
  15469. }
  15470. }(),
  15471. n.prototype.updateDisc = function(e, t) {
  15472. var i = new r.Vector3
  15473. , o = new r.Vector3
  15474. , l = new r.Vector3
  15475. , c = new r.Vector3
  15476. , h = new r.Vector3;
  15477. return function(e, t) {
  15478. var u = a.tags.visibility
  15479. , d = a.tags.disc.scale
  15480. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15481. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15482. this.obj3d.visible) {
  15483. this.disc.quaternion.copy(t.quaternion);
  15484. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15485. i.copy(this.discWorldPosition).project(t),
  15486. o.set($('#player').width()/2 , $('#player').height()/2, 1).multiply(i),
  15487. l.set(f / 2, 0, 0).add(o),
  15488. c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
  15489. h.copy(c).unproject(t);
  15490. var g = h.distanceTo(this.discWorldPosition)
  15491. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15492. this.discScale = g * m,
  15493. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15494. }
  15495. }
  15496. }(),
  15497. n.prototype.getDiscRadius = function(e, t) {
  15498. var i = new r.Vector3;
  15499. return function(e, t) {
  15500. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15501. Math.abs(e.x - i.x) * $('#player').width()
  15502. }
  15503. }(),
  15504. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15505. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15506. }
  15507. ,
  15508. n.prototype.offScreen = function(e, t) {
  15509. var i = e.getWorldPosition().project(t);
  15510. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15511. }
  15512. ,
  15513. n.viewportScale = function() {
  15514. return n.viewportWidth === $('#player').width() && n.viewportHeight === $('#player').height() || (n.viewportWidth = $('#player').width(),
  15515. n.viewportHeight = $('#player').height(),
  15516. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15517. n.currentViewportScale
  15518. }
  15519. ,
  15520. t.exports = n
  15521. }
  15522. ).call(this, "/js/tag/tag.js")
  15523. }
  15524. , {
  15525. "../enum/Colors": 19,
  15526. "../enum/RenderLayers": 41,
  15527. "../enum/RenderOrder": 42,
  15528. "../enum/Viewmode": 51,
  15529. "../objects/Panorama": 148,
  15530. "../settings": 166,
  15531. "../shaders": 167,
  15532. "../util/common": 185,
  15533. "../util/easing": 186,
  15534. "../util/lerp": 188,
  15535. "../util/logger": 189,
  15536. "../util/math": 190,
  15537. "../util/texture": 194,
  15538. "../util/transitions": 195,
  15539. "./Billboard/Billboard": 119,
  15540. "./Billboard/BillboardEvent": 120,
  15541. events: 202,
  15542. three: 217
  15543. }],
  15544. 124: [function(e, t, i) {///js/tag/tagManager.js
  15545. (function(i) {
  15546. "use strict";
  15547. function n() {
  15548. this.tagState = y.IDLE,
  15549. this.intersectTag = null,
  15550. this.hoveredTag = null,
  15551. this.activeTag = null,
  15552. this.tagDiscs = [],
  15553. this.raycaster = new r.Raycaster,
  15554. this.modelManager = null,
  15555. this.player = null,
  15556. this.totaltags = 0,
  15557. this.navigatingViaTag = !1,
  15558. this.enabled = !1
  15559. }
  15560. var r = e("three")
  15561. , o = e("../util/logger")
  15562. , a = e("../util/common")
  15563. , s = e("../controls/serializer")
  15564. , l = e("../objects/Snapshot")
  15565. , c = e("../settings")
  15566. , h = e("./Billboard/BillboardEvent")
  15567. , u = e("./Media/MediaEvent")
  15568. , d = e("./Media/LinkType")
  15569. , p = e("../enum/Viewmode")
  15570. , f = e("../enum/WarpStyle")
  15571. , g = e("../enum/BlackoutStyle")
  15572. , m = e("../enum/ModelManagerEvents")
  15573. , v = e("../enum/tagEvents")
  15574. , A = e("../enum/PlayerEvents")
  15575. , y = (e("../util/lerp"),
  15576. e("../enum/TagStates"))
  15577. , C = e("events").EventEmitter
  15578. , I = new o(i);
  15579. a.extend(n, C),
  15580. n.prototype.init = function(e, t) {
  15581. this.modelManager = e,
  15582. this.player = t,
  15583. this.updateModel(),
  15584. this.bindEvents()
  15585. }
  15586. ,
  15587. n.prototype.update = function(e) {
  15588. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15589. }
  15590. ,
  15591. n.prototype.updateTags = function(e, t, i, n) {
  15592. for (var r in this.model.tags)
  15593. this.model.tags[r].update(e, t, i, n)
  15594. }
  15595. ,
  15596. n.prototype.updateVisible = function(mode, pano){ //xzw加 更新热点显示
  15597. if(!this.player || this.player.model) return;
  15598. var tags = this.player.model.tags;
  15599. pano = pano || this.player.currentPano;
  15600. for (var r in tags){
  15601. var visible;
  15602. if(mode!="panorama"){
  15603. visible = true;
  15604. tags[r].disc.material.depthTest = true; //要被遮挡?
  15605. }else{
  15606. tags[r].disc.material.depthTest = false;
  15607. visible = tags[r].state != "rebuildHide" && (pano.neighbourPanos[tags[r].posGets.list[0]] || pano.neighbourPanos[tags[r].posGets.list[1]])
  15608. }
  15609. tags[r].disc.visible = visible;
  15610. }
  15611. }
  15612. ,
  15613. n.prototype.updateModel = function() {
  15614. this.model = this.modelManager.getActiveModel(),
  15615. this.gettagsFromModel(),
  15616. this.totaltags = Object.keys(this.model.tags).length
  15617. }
  15618. ,
  15619. n.prototype.gettagsFromModel = function() {
  15620. this.tagDiscs = [];
  15621. for (var e in this.model.tags) {
  15622. var t = this.model.tags[e].disc;
  15623. t && this.tagDiscs.push(t)
  15624. }
  15625. }
  15626. ,
  15627. n.prototype.bindEvents = function() {
  15628. function e() {
  15629. Object.keys(this.model.tags).forEach(function(e) {
  15630. var t = this.model.tags[e];
  15631. t.bindEvents(),
  15632. t.billboard.on(u.LINK_CLICK, function(e) {
  15633. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15634. }
  15635. .bind(this)),
  15636. t.billboard.on(u.IMAGE_OPENED, function() {
  15637. this.tagState = y.EXAMINE,
  15638. this.emit(u.IMAGE_OPENED)
  15639. }
  15640. .bind(this)),
  15641. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15642. }
  15643. .bind(this))
  15644. }
  15645. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15646. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15647. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15648. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15649. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15650. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15651. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15652. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15653. e.call(this)
  15654. }
  15655. ,
  15656. n.prototype.navigateViaLink = function(e) {
  15657. var t = s.deserialize(e);
  15658. if (t)
  15659. if (t.mode === p.PANORAMA) {
  15660. try {
  15661. this.player.model.panos.get(t.panoId)
  15662. } catch (e) {
  15663. return void I.warn("Unable to find panorama location", t.panoId)
  15664. }
  15665. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15666. } else {
  15667. var i = {
  15668. cameraMode: t.mode,
  15669. position: t.position,
  15670. quaternion: t.quaternion,
  15671. scanId: t.panoId,
  15672. orthoZoom: t.zoom,
  15673. floorVisibility: t.floorVisibility,
  15674. thumbUrl: null,
  15675. name: null
  15676. };
  15677. this.player.flyToNewMode({
  15678. mode: t.mode,
  15679. duration: c.warp.outsideTime,
  15680. warpDest: new l(i),
  15681. force: !0
  15682. })
  15683. }
  15684. }
  15685. ,
  15686. n.prototype.handleWarpStart = function(e, t, i, n) {
  15687. this.dismissExaminedTag(),
  15688. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15689. e && (i = g.END),
  15690. this.hideShowTagsForBlackoutStyle(i, n))
  15691. }
  15692. ,
  15693. n.prototype.handleWarpInterruption = function(e, t, i) {
  15694. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15695. this.hideShowTagsForBlackoutStyle(t, i)
  15696. }
  15697. ,
  15698. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15699. var i = 0
  15700. , n = 0
  15701. , r = t / 2;
  15702. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15703. e) {
  15704. case g.END:
  15705. this.hideAlltags(r);
  15706. break;
  15707. case g.BEGINNING:
  15708. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15709. break;
  15710. case g.NONE:
  15711. break;
  15712. case g.MIDDLE:
  15713. i = r,
  15714. n = r,
  15715. this.hideAlltags(n),
  15716. setTimeout(function() {
  15717. this.showAlltags(i)
  15718. }
  15719. .bind(this), n);
  15720. break;
  15721. case g.FADEIN:
  15722. setTimeout(function() {
  15723. this.showAlltags(r)
  15724. }
  15725. .bind(this), r)
  15726. }
  15727. }
  15728. ,
  15729. n.prototype.onPlayerModeChanging = function(e, t) {
  15730. t !== p.PANORAMA && this.dismissExaminedTag(),
  15731. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  15732. var i = t !== p.OUTDOOR;
  15733. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15734. }
  15735. ,
  15736. n.prototype.onPanoChange = function(e, t) {
  15737. var i = this.navigatingViaTag;
  15738. if (this.navigatingViaTag = !1,
  15739. !i) {
  15740. this.dismissExaminedTag();
  15741. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  15742. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  15743. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15744. }
  15745. }
  15746. ,
  15747. n.prototype.onPlayerReady = function(e, t, i) {
  15748. this.startAlltags(e, t ? i : null)
  15749. }
  15750. ,
  15751. n.prototype.onPlayerFlyingEnded = function(e, t) {
  15752. this.updateClosestTags(e)
  15753. }
  15754. ,
  15755. n.prototype.dismissExaminedTag = function() {
  15756. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  15757. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15758. this.hoveredTag = null)
  15759. }
  15760. ,
  15761. n.prototype.startAlltags = function(e, t) {
  15762. this.model.shouldShowtags = c.tags.enabled,
  15763. this.enabled = !0,
  15764. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  15765. t && setTimeout(function() {
  15766. this.activateTag(this.model.getTagBySid(t))
  15767. }
  15768. .bind(this), c.tags.startup.fadeInDuration / 2))
  15769. }
  15770. ,
  15771. n.prototype.showAlltags = function(e, t, i) {
  15772. function n() {
  15773. o++,
  15774. o === this.totaltags && (this.model.tagsShown = !0,
  15775. r.resolve())
  15776. }
  15777. var r = $.Deferred();
  15778. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15779. return r.resolve().promise();
  15780. var o = 0;
  15781. for (var a in this.model.tags) {
  15782. var s = this.model.tags[a];
  15783. s.show(e, t).done(n.bind(this))
  15784. }
  15785. return r.promise()
  15786. }
  15787. ,
  15788. n.prototype.hideAlltags = function(e, t) {
  15789. function i() {
  15790. r++,
  15791. r === this.totaltags && (this.model.tagsShown = !1,
  15792. n.resolve())
  15793. }
  15794. var n = $.Deferred()
  15795. , r = 0;
  15796. for (var o in this.model.tags) {
  15797. var a = this.model.tags[o];
  15798. a.hide(e, t).done(i.bind(this)),
  15799. a === this.activeTag && this.dismissActiveTag()
  15800. }
  15801. return n.promise()
  15802. }
  15803. ,
  15804. n.prototype.enableHovering = function() {
  15805. this.enabled = !0
  15806. }
  15807. ,
  15808. n.prototype.disableHovering = function() {
  15809. this.enabled = !1
  15810. }
  15811. ,
  15812. n.prototype.activateTag = function(e, t) {
  15813. t = t || y.EXAMINE,
  15814. this.activeTag = e,
  15815. this.activeTag.hoveringDisc = !0,
  15816. this.activeTag.setHoverState(t === y.EXAMINE),
  15817. this.tagState = t,
  15818. this.emit(v.TagActivated, e)
  15819. }
  15820. ,
  15821. n.prototype.dismissActiveTag = function() {
  15822. this.activeTag.hoveringDisc = !1,
  15823. this.activeTag.setFreeState(!0);
  15824. var e = this.activeTag;
  15825. this.activeTag = null,
  15826. this.tagState = y.IDLE,
  15827. this.emit(v.TagDismissed, e)
  15828. }
  15829. ,
  15830. n.prototype.clickedOnTag = function(e) {
  15831. var t = function() {
  15832. this.navigatingViaTag = !0,
  15833. this.activeTag.examine(this.player),
  15834. this.emit(v.TagNavigation, this.activeTag)
  15835. }
  15836. .bind(this);
  15837. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  15838. this.activeTag = this.intersectTag,
  15839. t(),
  15840. !0) : (this.dismissActiveTag(),
  15841. !1)
  15842. }
  15843. ,
  15844. n.prototype.intersecttag = function() {
  15845. var e = new r.Vector3
  15846. , t = new r.Vector3
  15847. , i = new r.Vector3;
  15848. return function(n, r, o) {
  15849. if (!this.enabled)
  15850. return null;
  15851. var a = null
  15852. , s = this.tagDiscs.filter(function(e) {
  15853. return e.parent.visible
  15854. });
  15855. if (s.length > 0) {
  15856. var l = this.model.floors.reduce(function(e, t) {
  15857. return t.hidden ? e : e.concat(t.collider.children)
  15858. }, s);
  15859. e.set(n.x, n.y, -1).unproject(o),
  15860. t.set(n.x, n.y, 1).unproject(o),
  15861. i.copy(t).sub(e).normalize(),
  15862. this.raycaster.set(e, i);
  15863. var c = this.raycaster.intersectObjects(l);
  15864. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  15865. }
  15866. return this.intersectTag = a,
  15867. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  15868. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  15869. this.hoveredTag = a
  15870. }
  15871. .bind(this)),
  15872. a.billboard.on(h.LEAVE, function() {
  15873. this.hoveredTag = null
  15874. }
  15875. .bind(this))),
  15876. this.activateTag(a, y.BROWSE))),
  15877. a
  15878. }
  15879. }(),
  15880. n.prototype.rankedtagInDirection = function() {
  15881. var e = []
  15882. , t = []
  15883. , i = new r.Vector3
  15884. , n = new r.Vector3
  15885. , o = new r.Vector3;
  15886. return function(r, a, s, l) {
  15887. var c = 0;
  15888. t.length = 0;
  15889. for (var h = 0; h < this.closesttags.length; h++) {
  15890. var u = this.closesttags[h];
  15891. n.copy(u.position),
  15892. n.add(u.discPosition),
  15893. i.copy(a),
  15894. i.sub(n).negate(),
  15895. i.normalize();
  15896. var d = i.dot(l);
  15897. if (d >= 0) {
  15898. o.copy(n),
  15899. o.project(s);
  15900. var p = this.intersecttag(o, !1, s);
  15901. if (p) {
  15902. if (c >= e.length)
  15903. for (var f = 0; f < 64; f++)
  15904. e.push({
  15905. tag: u,
  15906. dot: d
  15907. });
  15908. var g = e[c];
  15909. g.tag = u,
  15910. g.dot = d,
  15911. g.position = math.projectPositionToCanvas(n, s),
  15912. t.push(g),
  15913. c++
  15914. }
  15915. }
  15916. }
  15917. return t.sort(function(e, t) {
  15918. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15919. }),
  15920. r < t.length ? t[r].tag : null
  15921. }
  15922. }(),
  15923. n.prototype.updateClosestTags = function() {
  15924. var e = new r.Vector3
  15925. , t = 30;
  15926. return function(i) {
  15927. this.closesttags || (this.closesttags = []),
  15928. this.closesttags.length = 0;
  15929. var n = this.model.tags;
  15930. if (n)
  15931. for (var r in n)
  15932. if (n.hasOwnProperty(r)) {
  15933. var o = n[r]
  15934. , a = o.position;
  15935. e.copy(i),
  15936. e.sub(a).negate();
  15937. var s = e.lengthSq();
  15938. s < t && this.closesttags.push(o)
  15939. }
  15940. }
  15941. }(),
  15942. t.exports = n
  15943. }
  15944. ).call(this, "/js/tag/tagManager.js")
  15945. }
  15946. , {
  15947. "../controls/serializer": 14,
  15948. "../enum/BlackoutStyle": 18,
  15949. "../enum/tagEvents": 32,
  15950. "../enum/ModelManagerEvents": 33,
  15951. "../enum/PlayerEvents": 40,
  15952. "../enum/TagStates": 44,
  15953. "../enum/Viewmode": 51,
  15954. "../enum/WarpStyle": 52,
  15955. "../objects/Snapshot": 153,
  15956. "../settings": 166,
  15957. "../util/common": 185,
  15958. "../util/lerp": 188,
  15959. "../util/logger": 189,
  15960. "./Billboard/BillboardEvent": 120,
  15961. "./Media/LinkType": 130,
  15962. "./Media/MediaEvent": 131,
  15963. events: 202,
  15964. three: 217
  15965. }],
  15966. 125: [function(e, t, i) {///js/tag/Media/EmbedlyEmbed.js
  15967. (function(i) {
  15968. "use strict";
  15969. function n() {
  15970. this.embedWrapper = null,
  15971. this.embedElement = null
  15972. }
  15973. var r = e("../../util/ajax")
  15974. , o = e("./mediaSettings")
  15975. , a = e("../../settings")
  15976. , s = e("../../util/logger")
  15977. , l = new s(i);
  15978. n.prototype.createDomElement = function() {
  15979. return this.embedWrapper = document.createElement("div"),
  15980. this.embedWrapper.classList.add("tag-embed"),
  15981. this.embedWrapper.classList.add("hidden"),
  15982. this.embedWrapper
  15983. }
  15984. ,
  15985. n.prototype.load = function(e) {
  15986. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  15987. return new Promise(function(e, i) {
  15988. r.get(t).then(function(t) {
  15989. if (t = JSON.parse(t),
  15990. t.html && t.html.indexOf("<script") === -1) {
  15991. this.embedWrapper.innerHTML = t.html;
  15992. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  15993. if (this.embedWrapper.style.width = n + "px",
  15994. t.height) {
  15995. var r = t.height / t.width;
  15996. this.embedWrapper.style.height = n * r + "px"
  15997. }
  15998. this.embedElement = this.embedWrapper.firstChild;
  15999. var a = [];
  16000. try {
  16001. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16002. } catch (e) {
  16003. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16004. }
  16005. a.forEach(function(e) {
  16006. e.setAttribute("target", "_blank")
  16007. }),
  16008. this.embedElement.classList.add("hidden"),
  16009. this.embedWrapper.classList.remove("hidden"),
  16010. e()
  16011. } else
  16012. i("Not a valid embed")
  16013. }
  16014. .bind(this), function(e) {
  16015. i(e.response)
  16016. })
  16017. }
  16018. .bind(this))
  16019. }
  16020. ,
  16021. n.prototype.show = function() {
  16022. this.embedElement && this.embedElement.classList.remove("hidden")
  16023. }
  16024. ,
  16025. n.prototype.hide = function() {
  16026. this.embedElement && this.embedElement.classList.add("hidden")
  16027. }
  16028. ,
  16029. t.exports = n
  16030. }
  16031. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16032. }
  16033. , {
  16034. "../../settings": 166,
  16035. "../../util/ajax": 181,
  16036. "../../util/logger": 189,
  16037. "./mediaSettings": 132
  16038. }],
  16039. 126: [function(e, t, i) {///js/tag/Media/EmbedlyPlayer.js
  16040. (function(i) {
  16041. "use strict";
  16042. function n(e) {
  16043. o.call(this),
  16044. this.options = e,
  16045. this.playerControls = null,
  16046. this.state = s.NOT_READY
  16047. }
  16048. var r = e("../../util/browser")
  16049. , o = e("./EmbedlyEmbed")
  16050. , a = e("../../util/logger")
  16051. , s = (new a(i),
  16052. Object.freeze({
  16053. NOT_READY: "player.not.ready",
  16054. CUED: "player.cued",
  16055. PLAYING: "player.playing",
  16056. PAUSED: "player.paused"
  16057. }));
  16058. n.prototype = Object.create(o.prototype),
  16059. n.prototype.createDomElement = function() {
  16060. return this.embedWrapper = document.createElement("div"),
  16061. this.embedWrapper.classList.add("tag-video"),
  16062. this.embedWrapper.classList.add("hidden"),
  16063. this.embedWrapper
  16064. }
  16065. ,
  16066. n.prototype.load = function(e) {
  16067. var t = function() {
  16068. function e(e) {
  16069. this.playerState = s.CUED,
  16070. this.options.startMuted && this.playerControls.mute()
  16071. }
  16072. function t(e) {
  16073. this.playerState = e
  16074. }
  16075. function i(e) {
  16076. this.playerControls.setCurrentTime(0),
  16077. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16078. }
  16079. this.playerControls = new playerjs.Player(this.embedElement),
  16080. this.playerControls.on("ready", e.bind(this)),
  16081. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16082. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16083. this.playerControls.on("ended", i.bind(this))
  16084. }
  16085. .bind(this);
  16086. return o.prototype.load.call(this, e).then(t.bind(this))
  16087. }
  16088. ,
  16089. n.prototype.play = function() {
  16090. var e = r.isMobile();
  16091. return function() {
  16092. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16093. }
  16094. }(),
  16095. n.prototype.pause = function() {
  16096. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16097. }
  16098. ,
  16099. t.exports = n
  16100. }
  16101. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16102. }
  16103. , {
  16104. "../../util/browser": 182,
  16105. "../../util/logger": 189,
  16106. "./EmbedlyEmbed": 125
  16107. }],
  16108. 127: [function(e, t, i) {///js/tag/Media/EmbedlyQueue.js
  16109. (function(i) {
  16110. "use strict";
  16111. function n(e) {
  16112. function t() {
  16113. return a.debug("requesting file from embedly:", e.href),
  16114. r.get(e.href, {
  16115. responseType: e.responseType
  16116. }).then(function(t) {
  16117. return a.debug("requesting file finished:", e.href),
  16118. t
  16119. })
  16120. }
  16121. function i() {}
  16122. return s = new Promise(function(e, n) {
  16123. s.catch(i).then(function() {
  16124. t().then(e, n)
  16125. })
  16126. }
  16127. )
  16128. }
  16129. var r = e("../../util/ajax")
  16130. , o = (e("./mediaSettings"),
  16131. e("../../util/logger"))
  16132. , a = new o(i)
  16133. , s = Promise.resolve();
  16134. t.exports.enqueue = n
  16135. }
  16136. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16137. }
  16138. , {
  16139. "../../util/ajax": 181,
  16140. "../../util/logger": 189,
  16141. "./mediaSettings": 132
  16142. }],
  16143. 128: [function(e, t, i) {///js/tag/Media/Image.js
  16144. (function(i) {
  16145. "use strict";
  16146. function n() {
  16147. this.imageWrapper = null,
  16148. this.width = 0,
  16149. this.height = 0,
  16150. this.aspect = 1
  16151. }
  16152. var r = e("./MediaEvent")
  16153. , o = e("./EmbedlyQueue")
  16154. , a = e("events").EventEmitter
  16155. , s = e("../../util/logger")
  16156. , l = e("../../settings");
  16157. new s(i);
  16158. n.prototype = Object.create(a.prototype),
  16159. n.prototype.createDomElement = function() {
  16160. return this.imageWrapper = document.createElement("div"),
  16161. this.imageWrapper.classList.add("tag-image"),
  16162. this.imageWrapper.classList.add("hidden"),
  16163. this.imageWrapper.addEventListener("click", function(e) {
  16164. e.stopPropagation(),
  16165. this.emit(r.IMAGE_OPENING),
  16166. this.imageWrapper.style.pointerEvents = "none"
  16167. }
  16168. .bind(this)),
  16169. this.imageWrapper
  16170. }
  16171. ,
  16172. n.prototype.onClosed = function() {
  16173. this.imageWrapper.style.pointerEvents = "auto"
  16174. }
  16175. ,
  16176. n.prototype.load = function(e) {
  16177. var t = Math.max(window.screen.height, window.screen.width)
  16178. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16179. return new Promise(function(e, t) {
  16180. function n(t) {
  16181. var i = t.target;
  16182. this.width = i.naturalWidth,
  16183. this.height = i.naturalHeight,
  16184. this.aspect = this.width / this.height;
  16185. var n = t.target.src;
  16186. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16187. this.imageWrapper.style.width = this.width + "px",
  16188. this.imageWrapper.style.height = this.height + "px",
  16189. this.imageWrapper.classList.remove("hidden"),
  16190. e()
  16191. }
  16192. o.enqueue({
  16193. href: i,
  16194. responseType: "arraybuffer"
  16195. }).then(function(e) {
  16196. var t = new Uint8Array(e)
  16197. , i = new Blob([t])
  16198. , r = new window.Image;
  16199. r.addEventListener("load", n.bind(this));
  16200. var o = URL.createObjectURL(i);
  16201. r.src = o
  16202. }
  16203. .bind(this), t)
  16204. }
  16205. .bind(this))
  16206. }
  16207. ,
  16208. t.exports = n
  16209. }
  16210. ).call(this, "/js/tag/Media/Image.js")
  16211. }
  16212. , {
  16213. "../../settings": 166,
  16214. "../../util/logger": 189,
  16215. "./EmbedlyQueue": 127,
  16216. "./MediaEvent": 131,
  16217. events: 202
  16218. }],
  16219. 129: [function(e, t, i) {//"../Media/Link"
  16220. "use strict";
  16221. function n(e) {
  16222. this.label = e.label,
  16223. this.href = e.url,
  16224. this.type = this.updateLinkForType(),
  16225. this.domElement = null,
  16226. this.id = c++
  16227. }
  16228. var r = e("./LinkType")
  16229. , o = e("./MediaEvent")
  16230. , a = e("../../util/browser")
  16231. , s = e("../../analytics")
  16232. , l = e("events").EventEmitter
  16233. , c = 0;
  16234. n.prototype = Object.create(l.prototype),
  16235. n.prototype.updateLinkForType = function() {
  16236. function e(e) {
  16237. var t = new RegExp("[#&?]start=([^#&?]*)")
  16238. , i = t.exec(e);
  16239. return i[1]
  16240. }
  16241. function t(e) {
  16242. return e + "&play=1"
  16243. }
  16244. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16245. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  16246. r.NAVIGATION) : (this.href = t(this.href),
  16247. r.MODEL) : r.EXT_LINK
  16248. }
  16249. ;
  16250. var h = {};
  16251. n.prototype.createDomElement = function() {
  16252. function e(e) {
  16253. switch (e.stopPropagation(),
  16254. h[this.id] = !0,
  16255. s.trackAlways("click_tag_link", {
  16256. link_type: this.type,
  16257. link_count: c,
  16258. links_clicked: Object.keys(h).length
  16259. }),
  16260. this.type) {
  16261. case r.MODEL:
  16262. window.location.replace(this.href);
  16263. break;
  16264. case r.EXT_LINK:
  16265. window.open(this.href, "_blank")
  16266. }
  16267. this.emit(o.LINK_CLICK, {
  16268. type: this.type,
  16269. url: this.href
  16270. })
  16271. }
  16272. if (this.domElement = document.createElement("a"),
  16273. this.domElement.classList.add("tag-link"),
  16274. this.domElement.textContent = this.label,
  16275. this.type === r.EXT_LINK) {
  16276. this.domElement.textContent += " ";
  16277. var t = document.createElement("i");
  16278. t.classList.add("icon-ext-link"),
  16279. t.title = "Link to external web site",
  16280. this.domElement.appendChild(t)
  16281. }
  16282. return this.domElement.addEventListener("click", e.bind(this)),
  16283. this.domElement
  16284. }
  16285. ,
  16286. t.exports = n
  16287. }
  16288. , {
  16289. "../../analytics": 4,
  16290. "../../util/browser": 182,
  16291. "./LinkType": 130,
  16292. "./MediaEvent": 131,
  16293. events: 202
  16294. }],
  16295. 130: [function(e, t, i) {//"./Media/LinkType"
  16296. "use strict";
  16297. t.exports = {
  16298. NAVIGATION: "navigation",
  16299. MODEL: "model",
  16300. EXT_LINK: "ext-link"
  16301. }
  16302. }
  16303. , {}],
  16304. 131: [function(e, t, i) {//"./MediaEvent"
  16305. "use strict";
  16306. t.exports = Object.freeze({
  16307. LINK_CLICK: "mtmedia.link",
  16308. IMAGE_LOADED: "mtmedia.image.loaded",
  16309. IMAGE_OPENING: "mtmedia.image.opening",
  16310. IMAGE_OPENED: "mtmedia.image.opened",
  16311. IMAGE_CLOSING: "mtmedia.image.closing",
  16312. IMAGE_CLOSED: "mtmedia.image.closed",
  16313. VIDEO_START: "mtmedia.video.start",
  16314. VIDEO_PAUSE: "mtmedia.video.pause",
  16315. VIDEO_ENDED: "mtmedia.video.end"
  16316. })
  16317. }
  16318. , {}],
  16319. 132: [function(e, t, i) {//"./mediaSettings"
  16320. "use strict";
  16321. t.exports = Object.freeze({
  16322. maxEmbedWidth: 350,
  16323. defaultAspectRatio: .75
  16324. })
  16325. }
  16326. , {}],
  16327. 133: [function(e, t, i) {//"./DescriptionChunkType" or "../Parser/DescriptionChunkType"
  16328. "use strict";
  16329. t.exports = Object.freeze({
  16330. TEXT: "text",
  16331. LINK: "link",
  16332. IMAGE: "photo",
  16333. VIDEO: "video",
  16334. RICH: "rich"
  16335. })
  16336. }
  16337. , {}],
  16338. 134: [function(e, t, i) {//"../Parser/DescriptionParser"
  16339. "use strict";
  16340. function n(e) {
  16341. this.capabilities = {
  16342. links: {
  16343. enable: e.supportLinks,
  16344. keepLabels: e.keepLinkLabels
  16345. }
  16346. }
  16347. }
  16348. var r = e("./DescriptionChunkType");
  16349. n.prototype.parse = function(e, t) {
  16350. var i = []
  16351. , n = e.split("[").map(function(e, t) {
  16352. return 0 === t ? e : "[" + e
  16353. });
  16354. return n.forEach(function(e) {
  16355. var n = this.findMarkdown(e);
  16356. if (n) {
  16357. if (n.url.indexOf("javascript:") !== -1)
  16358. return;
  16359. this.addLinkChunk(i, n, t),
  16360. this.addTextChunk(i, e.slice(n.markdown.length))
  16361. } else
  16362. this.addTextChunk(i, e)
  16363. }
  16364. .bind(this)),
  16365. i
  16366. }
  16367. ,
  16368. n.prototype.findMarkdown = function(e) {
  16369. var t = /\[([^\]]*)\]\((.*)\)/
  16370. , i = e.match(t);
  16371. if (i) {
  16372. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16373. 0 !== r); )
  16374. o++;
  16375. var a = n.length - o;
  16376. return {
  16377. markdown: i[0].substring(0, i[0].length - a),
  16378. label: i[1],
  16379. url: i[2].substring(0, o)
  16380. }
  16381. }
  16382. }
  16383. ,
  16384. n.prototype.addTextChunk = function(e, t) {
  16385. 0 !== t.length && e.push({
  16386. type: r.TEXT,
  16387. text: t
  16388. })
  16389. }
  16390. ,
  16391. n.prototype.addLinkChunk = function(e, t) {
  16392. if (!this.capabilities.links.enable)
  16393. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16394. var i = {
  16395. label: t.label,
  16396. url: t.url
  16397. };
  16398. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16399. e.push({
  16400. type: r.LINK,
  16401. link: i
  16402. })
  16403. }
  16404. ,
  16405. t.exports = n
  16406. }
  16407. , {
  16408. "./DescriptionChunkType": 133
  16409. }],
  16410. 135: [function(e, t, i) {//js/model/Chunks.js
  16411. (function(i) {
  16412. "use strict";
  16413. var n = e("../util/logger")
  16414. , r = new n(i)
  16415. , o = {
  16416. parseIdsFromChunkName: function(e, t) {
  16417. t.floorId = o.parseFloor(e),
  16418. t.roomId = o.parseRoom(e)
  16419. },
  16420. parseFloor: function(e) {
  16421. var t = e.match(/_group([0-9]+)/);
  16422. if (!t)
  16423. return 0;
  16424. try {
  16425. return parseInt(t[1], 10)
  16426. } catch (e) {
  16427. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16428. 0
  16429. }
  16430. },
  16431. parseRoom: function(e) {
  16432. var t = e.match(/_sub([0-9]+)/);
  16433. if (!t)
  16434. return -1;
  16435. try {
  16436. return parseInt(t[1], 10)
  16437. } catch (e) {
  16438. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16439. 0
  16440. }
  16441. }
  16442. };
  16443. t.exports = o
  16444. }
  16445. ).call(this, "/js/model/Chunks.js")
  16446. }
  16447. , {
  16448. "../util/logger": 189
  16449. }],
  16450. 136: [function(e, t, i) {///js/model/FloorCollection.js
  16451. (function(i) {
  16452. "use strict";
  16453. function n(e) {
  16454. s.call(this),
  16455. this.model = e,
  16456. this.exploded = !1
  16457. }
  16458. var r = e("../objects/Floor")
  16459. , o = (e("../settings"),
  16460. e("../util/logger"))
  16461. , a = e("../util/transitions")
  16462. , s = e("../util/IndexedCollection")
  16463. , l = e("../util/common")
  16464. , c = e("../util/easing");
  16465. new o(i);
  16466. l.inherit(n, s),
  16467. n.prototype.add = function(e) {
  16468. s.prototype.add.call(this, e),
  16469. this.model.add(e)
  16470. }
  16471. ,
  16472. n.prototype.getIndex = function(e) {
  16473. return e.floorIndex
  16474. }
  16475. ,
  16476. n.prototype.build = function() {
  16477. this.list.forEach(function(e) {
  16478. e.build()
  16479. })
  16480. }
  16481. ,
  16482. n.prototype.size = function() {
  16483. return this.length
  16484. }
  16485. ,
  16486. n.prototype.sort = function() {
  16487. s.prototype.sort.call(this, function(e, t) {
  16488. return e.floorIndex - t.floorIndex
  16489. })
  16490. }
  16491. ,
  16492. n.prototype.nextFloor = function(e, t) {
  16493. return this.index[e.floorIndex + t] || null
  16494. }
  16495. ,
  16496. n.prototype.getFloorAtPoint = function(e) {
  16497. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16498. var r = this.list[n]
  16499. , o = r.distanceToPoint(e);
  16500. (!t || i > o) && (i = o,
  16501. t = r)
  16502. }
  16503. return t
  16504. }
  16505. ,
  16506. n.prototype.getOrMakeFloor = function(e) {
  16507. var t = this.index[e];
  16508. return t || (t = new r(this.model,e),
  16509. this.add(t)),
  16510. t
  16511. }
  16512. ,
  16513. n.prototype.hide = function() {
  16514. this.list.forEach(function(e) {
  16515. e.hide()
  16516. })
  16517. }
  16518. ,
  16519. n.prototype.show = function() {
  16520. this.list.forEach(function(e) {
  16521. e.show()
  16522. })
  16523. }
  16524. ,
  16525. n.prototype.names = function() {
  16526. return this.list.reduce(function(e, t) {
  16527. return e.concat(t.name)
  16528. }, [])
  16529. }
  16530. ,
  16531. n.prototype.toggleExplodeHorizontal = function() {
  16532. function e(e, t) {
  16533. r.copy(e.position),
  16534. e.position.x = i[e.floorIndex] * t,
  16535. e.position.y = 1 * e.floorIndex * t,
  16536. r.sub(e.position).multiplyScalar(-1),
  16537. e.panos.forEach(function(e) {
  16538. e.translate(r)
  16539. })
  16540. }
  16541. var t, i = [], n = 0;
  16542. this.list.forEach(function(e, r, o) {
  16543. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16544. n += t,
  16545. i[r] = n
  16546. }),
  16547. i = i.map(function(e) {
  16548. return e - n / 2
  16549. });
  16550. var r = this.list[0].position.clone();
  16551. this.exploded ? this.list.forEach(function(t) {
  16552. a.start(function(i) {
  16553. e(t, 1 - i)
  16554. }, 1500, null, 0, c.easeOutExpo)
  16555. }) : this.list.forEach(function(t) {
  16556. a.start(function(i) {
  16557. e(t, i)
  16558. }, 1500, null, 0, c.easeOutExpo)
  16559. }),
  16560. this.exploded = !this.exploded
  16561. }
  16562. ,
  16563. n.prototype.toggleExplodeVertical = function() {
  16564. function e(e, i) {
  16565. var n = n.copy(e.position);
  16566. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16567. n.sub(e.position).multiplyScalar(-1),
  16568. e.panos.forEach(function(e) {
  16569. e.translate(n)
  16570. })
  16571. }
  16572. var t = this.model.size;
  16573. this.list[0].position.clone();
  16574. this.exploded ? this.list.forEach(function(t) {
  16575. a.start(function(i) {
  16576. e(t, 1 - i)
  16577. }, 1500, null, 0, c.easeOutExpo)
  16578. }) : this.list.forEach(function(t) {
  16579. a.start(function(i) {
  16580. e(t, i)
  16581. }, 1500, null, 0, c.easeOutExpo)
  16582. }),
  16583. this.exploded = !this.exploded
  16584. }
  16585. ,
  16586. t.exports = n
  16587. }
  16588. ).call(this, "/js/model/FloorCollection.js")
  16589. }
  16590. , {
  16591. "../objects/Floor": 146,
  16592. "../settings": 166,
  16593. "../util/IndexedCollection": 175,
  16594. "../util/common": 185,
  16595. "../util/easing": 186,
  16596. "../util/logger": 189,
  16597. "../util/transitions": 195
  16598. }],
  16599. 137: [function(e, t, i) {///js/model/ImageCollection.js
  16600. (function(i) {
  16601. "use strict";
  16602. function n() {
  16603. c.call(this)
  16604. }
  16605. var r = e("../settings")
  16606. , o = e("../util/logger")
  16607. , a = e("../enum/Viewmode")
  16608. , s = e("../objects/Snapshot")
  16609. , l = (e("../util/math"),
  16610. e("../util/common"))
  16611. , c = e("../util/IndexedCollection")
  16612. , h = new o(i);
  16613. l.inherit(n, c),
  16614. n.prototype.getImage = function(e) {
  16615. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16616. }
  16617. ,
  16618. n.prototype.filterByModesAndReel = function(e, t) {
  16619. for (var i = [], n = 0; n < t.length; n += 1) {
  16620. var r = t[n]
  16621. , o = this.index[r.sid];
  16622. o && i.push(o)
  16623. }
  16624. var s = e[a.DOLLHOUSE]
  16625. , l = e[a.FLOORPLAN];
  16626. i = i.filter(function(e) {
  16627. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16628. return !0;
  16629. var t;
  16630. try {
  16631. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16632. } catch (e) {
  16633. return h.debug(e.message),
  16634. !1
  16635. }
  16636. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16637. }),
  16638. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16639. this.list = i,
  16640. this.reIndex()
  16641. }
  16642. ,
  16643. n.prototype.getHeroLocations = function(e) {
  16644. if (0 === this.list.length)
  16645. return [];
  16646. for (var t = [], i = 0; i < this.list.length; ++i) {
  16647. var o = this.list[i]
  16648. , l = o.thumbnail_signed_src
  16649. , c = o.name;
  16650. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  16651. if (!r.show360Views.enabled && o.metadata.scan_id) {
  16652. var h = e.get(o.metadata.scan_id);
  16653. if (h && !h.isAligned())
  16654. continue
  16655. }
  16656. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  16657. if (u === a.MESH)
  16658. continue;
  16659. var d = {
  16660. cameraMode: u,
  16661. position: o.metadata.camera_position,
  16662. quaternion: o.metadata.camera_quaternion,
  16663. panoId: o.metadata.scan_id,
  16664. orthoZoom: o.metadata.ortho_zoom,
  16665. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  16666. thumbUrl: l,
  16667. name: n.filterImageName(c)
  16668. }
  16669. , p = new s(d);
  16670. t.push(p)
  16671. }
  16672. }
  16673. return t
  16674. }
  16675. ,
  16676. n.prototype.getIndex = function(e) {
  16677. return e.sid
  16678. }
  16679. ,
  16680. n.filterImageName = function(e) {
  16681. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16682. }
  16683. ,
  16684. t.exports = n
  16685. }
  16686. ).call(this, "/js/model/ImageCollection.js")
  16687. }
  16688. , {
  16689. "../enum/Viewmode": 51,
  16690. "../objects/Snapshot": 153,
  16691. "../settings": 166,
  16692. "../util/IndexedCollection": 175,
  16693. "../util/common": 185,
  16694. "../util/logger": 189,
  16695. "../util/math": 190
  16696. }],
  16697. 138: [function(e, t, i) {///js/model/LabelCollection.js
  16698. (function(i) {
  16699. "use strict";
  16700. function n() {
  16701. u.call(this)
  16702. }
  16703. var r = e("../label/Label")
  16704. , o = e("../settings")
  16705. , a = e("../util/logger")
  16706. , s = e("../util/math")
  16707. , l = e("../util/ajax")
  16708. , c = e("./RoomCollection")
  16709. , h = e("../util/common")
  16710. , u = e("../util/IndexedCollection");
  16711. new a(i);
  16712. h.inherit(n, u),
  16713. n.prototype.getIndex = function(e) {
  16714. return e.labelId
  16715. }
  16716. ,
  16717. n.prototype.associateWithRooms = function(e) {
  16718. this.forEach(function(t) {
  16719. e.forEach(function(e) {
  16720. e.roomId === t.roomId && (t.room = e)
  16721. })
  16722. })
  16723. }
  16724. ,
  16725. n.prototype.createFromLabelData = function(e) {
  16726. e.forEach(function(e) {
  16727. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16728. t = c.generateRoomId(e.floorId, t);
  16729. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16730. i.position = s.convertWorkshopVector(i.position),
  16731. this.add(i),
  16732. i.build()
  16733. }
  16734. .bind(this))
  16735. }
  16736. ,
  16737. n.prototype.load = function(e, t) {
  16738. return l.get(e, {
  16739. responseType: "json",
  16740. auth: t ? o.authorizationHeader : null
  16741. }).done(function(e) {
  16742. var t = [];
  16743. for (var i in e) {
  16744. var n = e[i];
  16745. t.push(n)
  16746. }
  16747. this.createFromLabelData(t)
  16748. }
  16749. .bind(this))
  16750. }
  16751. ,
  16752. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16753. var t = -1;
  16754. if (e) {
  16755. var i = e.split("_");
  16756. t = parseInt(i[0])
  16757. }
  16758. return t
  16759. }
  16760. ,
  16761. t.exports = n
  16762. }
  16763. ).call(this, "/js/model/LabelCollection.js")
  16764. }
  16765. , {
  16766. "../label/Label": 90,
  16767. "../settings": 166,
  16768. "../util/IndexedCollection": 175,
  16769. "../util/ajax": 181,
  16770. "../util/common": 185,
  16771. "../util/logger": 189,
  16772. "../util/math": 190,
  16773. "./RoomCollection": 141
  16774. }],
  16775. 139: [function(e, t, i) {///js/model/Model.js
  16776. (function(i) {
  16777. "use strict";
  16778. function n(e, t) {
  16779. o.Object3D.call(this),
  16780. this.sid = t.sid,
  16781. this.data = t,
  16782. this.options = e,
  16783. this.urls = new s(e.urlFiles),
  16784. this.isPublic = void 0 !== t.is_public && t.is_public,
  16785. this.images = new _(this),
  16786. this.images.extend(t.images),
  16787. this.heroImage = this.images.getImage(t.icon),
  16788. this.heroLocations = [],
  16789. this.outdoorPanoLocations = [],
  16790. this.floors = new d(this),
  16791. this.floorsEnabled = void 0 === e.floors || e.floors,
  16792. this.changingFloor = !1,
  16793. this.chunks = [],
  16794. this.panos = new A,
  16795. this.colliders = [],
  16796. this.loadPanosPromise = null,
  16797. this.loadMeshTexturesPromise = null,
  16798. this.auxDataPromise = null,
  16799. this.meshTexturesLoaded = !1,
  16800. this.meshTextures = [],
  16801. this.tags = {},
  16802. this.tagsShown = !1,
  16803. this.shouldShowtags = !1,
  16804. this.has360Views = !1,
  16805. this.showingLabels = f.labels.enabled && t.player_options.labels,
  16806. this.supportedModes = {},
  16807. this.supportedModes[c.PANORAMA] = !0,
  16808. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  16809. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  16810. this.supportedModes[c.TRANSITIONING] = !0,
  16811. this.supportsTiles = this.configureTiling(),
  16812. this.supportsVR = t.is_vr,
  16813. this.mode = c.DOLLHOUSE,
  16814. this.size = null,
  16815. this.center = null,
  16816. this.boundingBox = new o.Box3,
  16817. this.currentFloor = null,
  16818. this.allFloorsVisible = !0,
  16819. this.projectedPano0 = null,
  16820. this.projectedPano1 = null,
  16821. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  16822. this.addFloor(new u(this,t,e.trim()))
  16823. }
  16824. .bind(this)),
  16825. this.waitQueue = [],
  16826. this.on("load", function(e) {
  16827. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16828. return !e.isLoadedCallback()
  16829. }),
  16830. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16831. }
  16832. .bind(this)),
  16833. this.setupCustomProperties()
  16834. }
  16835. function r() {
  16836. try {
  16837. var e = document.createElement("canvas")
  16838. , t = e.getContext("webgl");
  16839. t || (t = e.getContext("experimental-webgl"));
  16840. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  16841. return i
  16842. } catch (e) {
  16843. return 0
  16844. }
  16845. }
  16846. var o = e("three")
  16847. , a = e("../util/ajax")
  16848. , s = e("../util/ModelUrls")
  16849. , l = e("../objects/BoundingTextureSkybox")
  16850. , c = e("../enum/Viewmode")
  16851. , h = e("../enum/RenderOrder")
  16852. , u = (e("../enum/AlignmentType"),
  16853. e("../objects/Floor"))
  16854. , d = e("./FloorCollection")
  16855. , p = e("../objects/Chunk")
  16856. , f = (e("../objects/Room"),
  16857. e("../objects/Snapshot"),
  16858. e("../label/Label"),
  16859. e("../util/math"),
  16860. e("../settings")),
  16861. ss = e("../shaders") //xzw
  16862. , g = e("../util/logger")
  16863. , m = e("../tag/tag")
  16864. , v = (e("../tag/tagManager"),
  16865. e("../objects/Panorama"))
  16866. , A = e("../util/PanoramaCollection")
  16867. , y = e("../loaders/ModelLoader")
  16868. , C = e("../loaders/ModelTextureLoader")
  16869. , I = e("../loaders/SweepDataLoader")
  16870. , E = e("../util/transitions")
  16871. , b = e("../util/common")
  16872. , le = e("../util/lerp") //xzw
  16873. , es = e("../util/easing") //xzw
  16874. , te = e("../util/texture") //xzw
  16875. , w = e("./../util/browser")
  16876. , _ = e("./ImageCollection")
  16877. , T = e("./RoomCollection")
  16878. , x = e("./LabelCollection")
  16879. , S = e("./Chunks")
  16880. , M = e("./../util/showcase")
  16881. , R = e("../exception/BasicException")
  16882. , P = (e("../constants"),
  16883. e("events").EventEmitter)
  16884. , O = new g(i);
  16885. n.prototype = Object.create(o.Object3D.prototype),
  16886. b.extend(n, P),
  16887. n.prototype.setupCustomProperties = function() {
  16888. var e = f.modelAlpha;
  16889. Object.defineProperty(this, "alpha", {
  16890. get: function() {
  16891. return e
  16892. },
  16893. set: function(t) {
  16894. e = t,
  16895. this.chunks.forEach(function(t) {
  16896. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  16897. })
  16898. }
  16899. })
  16900. }
  16901. ,
  16902. n.prototype.configureTiling = function() {
  16903. var e = r();
  16904. if (e < 2048)
  16905. return !1;
  16906. O.warn("Max cube texture size: " + e);
  16907. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  16908. var i = f.tiling.tilingFlagNames[t];
  16909. if ("1" === w.valueFromHash(i, null))
  16910. return !0;
  16911. if ("0" === w.valueFromHash(i, null))
  16912. return !1
  16913. }
  16914. return !!M.modelDataPromisesTiles(this.data)
  16915. }
  16916. ,
  16917. n.prototype.toggleAlpha = function() {
  16918. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16919. }
  16920. ,
  16921. n.prototype.load = function(e) {
  16922. var t = function() {
  16923. return $.when(this.loadPanos(), this.loadMesh())
  16924. }
  16925. , i = this.urls.init().then(t.bind(this));
  16926. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  16927. this.auxDataPromise = $.when(this.loadHighlightReel(), this.loadtags(), this.loadLabels()),
  16928. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  16929. }
  16930. ,
  16931. n.prototype.loadMesh = function() {
  16932. function e(e) {
  16933. O.error(e),
  16934. n.reject("loading-failed")
  16935. }
  16936. function t(e, t) {
  16937. n.notify(e, t)
  16938. }
  16939. function i(e, t) {
  16940. if (0 === e.length) {
  16941. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16942. r.supportedModes[c.DOLLHOUSE] = !1,
  16943. r.supportedModes[c.FLOORPLAN] = !1;
  16944. var i = new p({
  16945. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16946. });
  16947. i.material.visible = !1,
  16948. i.rotateX(-Math.PI / 2),
  16949. i.geometry.computeBoundingBox(),
  16950. e = [i]
  16951. }
  16952. e.forEach(function(e) {
  16953. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  16954. r.addChunk(t, e)
  16955. }),
  16956. r.floors.sort(),
  16957. n.resolve(r)
  16958. }
  16959. var n = $.Deferred()
  16960. , r = this;
  16961. return y.load(r.data.job.uuid, r.urls, i, t, e),
  16962. n.promise()
  16963. }
  16964. ,
  16965. n.prototype.loadMeshTextures = function() {
  16966. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  16967. this.meshTexturesLoaded = !0
  16968. }
  16969. .bind(this)),
  16970. this.loadTexturesPromise)
  16971. }
  16972. ,
  16973. n.prototype.loadtags = function() {//xzw改
  16974. var e = $.Deferred();
  16975. if (!f.tags.enabled)
  16976. return e.resolve();
  16977. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  16978. t = "data/" + this.sid + "/tags.json"
  16979. return a.get(t, {
  16980. responseType: "json",
  16981. auth: this.isPublic ? null : f.authorizationHeader
  16982. }).done(function(t) {
  16983. var i = 0
  16984. , n = 0;
  16985. for (var r in t) {
  16986. var o = t[r];
  16987. o.enabled && (n++,
  16988. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  16989. i++))
  16990. }
  16991. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  16992. e.resolve()
  16993. }
  16994. .bind(this)).fail(function() {
  16995. O.warn("Getting tags failed, not displaying tags."),
  16996. e.resolve()
  16997. }),
  16998. e
  16999. }
  17000. ,
  17001. n.prototype.loadPanos = function() {
  17002. if (this.loadPanosPromise)
  17003. return this.loadPanosPromise;
  17004. var e = new I(this);
  17005. return this.loadPanosPromise = e.load().then(function(e) {
  17006. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17007. return this.data.sweeps[e.uuid].enabled
  17008. }
  17009. .bind(this))),
  17010. this.panos.extend(e.map(function(e) {
  17011. return new v(this,e.uuid,e,this.supportsTiles)
  17012. }
  17013. .bind(this))),
  17014. this.panos.forEach(function(e) {
  17015. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17016. var i = this.panos.get(t);
  17017. i && this.panos.setNeighbour(e, i, !0)
  17018. }
  17019. .bind(this)),
  17020. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17021. }
  17022. .bind(this)),
  17023. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17024. this.supportedModes[c.PANORAMA] = !1),
  17025. $.when(this)
  17026. }
  17027. .bind(this)),
  17028. this.loadPanosPromise
  17029. }
  17030. ,
  17031. n.prototype.loadHighlightReel = function() {
  17032. var e = $.Deferred()
  17033. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17034. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17035. return a.get(t, {
  17036. responseType: "json",
  17037. auth: this.isPublic ? null : f.authorizationHeader
  17038. }).done(function(t) {
  17039. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17040. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17041. e.resolve()
  17042. }
  17043. .bind(this)).fail(function() {
  17044. O.warn("Getting highlight reel failed, no highlights available"),
  17045. e.resolve()
  17046. }),
  17047. e
  17048. }
  17049. ,
  17050. n.prototype.waitForLoad = function(e, t) {
  17051. t() || (this.waitQueue.push({
  17052. object: e,
  17053. isLoadedCallback: t
  17054. }),
  17055. 1 === this.waitQueue.length && this.emit("waiting"))
  17056. }
  17057. ,
  17058. n.prototype.hide = function() {
  17059. this.floors.hide()
  17060. }
  17061. ,
  17062. n.prototype.show = function() {
  17063. this.floors.show()
  17064. }
  17065. ,
  17066. n.prototype.floorNames = function() {
  17067. return this.floors.names()
  17068. }
  17069. ,
  17070. n.prototype.warpDestFloors = function(e, t) {
  17071. if (!e || this.floors.length !== e.length)
  17072. return void this.toggleAllFloors(!0);
  17073. var i = e.findIndex(function(e) {
  17074. return e
  17075. }
  17076. .bind(this));
  17077. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17078. }
  17079. ,
  17080. n.prototype.setFloor = function(e, t, i) {
  17081. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17082. this.allFloorsVisible = !1,
  17083. this._setFloor(e, t, i)
  17084. }
  17085. ,
  17086. n.prototype.toggleAllFloors = function(e) {
  17087. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17088. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17089. this._setFloor(this.currentFloor)
  17090. }
  17091. ,
  17092. n.prototype._setFloor = function(e, t, i) {
  17093. t = t || this.mode,
  17094. this.emit("floor.changed", e, t, this.currentFloor),
  17095. this.currentFloor = e;
  17096. var n;
  17097. if (t === c.PANORAMA) {
  17098. if (this.show(),
  17099. this.shouldShowtags && this.tagsShown)
  17100. for (n in this.tags)
  17101. this.tags[n].show(f.showFloorDuration)
  17102. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17103. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17104. }
  17105. .bind(this)),
  17106. this.shouldShowtags && this.tagsShown))
  17107. for (n in this.tags) {
  17108. var r = this.tags[n];
  17109. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17110. }
  17111. var o = this
  17112. , a = e;
  17113. E.start(function() {}, f.showFloorDelay, function() {
  17114. o.floors.forEach(function(e) {
  17115. e.chunks.forEach(function(t) {
  17116. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17117. })
  17118. })
  17119. }
  17120. .bind(this))
  17121. }
  17122. ,
  17123. n.prototype.toggleExplode = function() {
  17124. this.floors.toggleExplodeHorizontal()
  17125. }
  17126. ,
  17127. n.prototype.toggleExplodeUp = function() {
  17128. this.floors.toggleExplodeVertical()
  17129. }
  17130. ,
  17131. n.prototype.nextFloor = function(e) {
  17132. return this.floors.nextFloor(this.currentFloor, e)
  17133. }
  17134. ,
  17135. n.prototype.addFloor = function(e) {
  17136. this.floors.add(e)
  17137. }
  17138. ,
  17139. n.prototype.getFloorAtPoint = function(e) {
  17140. return this.floors.getFloorAtPoint(e)
  17141. }
  17142. ,
  17143. n.prototype.getTagBySid = function(e) {
  17144. return this.tags[e]
  17145. }
  17146. ,
  17147. n.prototype.addChunk = function(e, t) {
  17148. this.floors.getOrMakeFloor(e).addChunk(t),
  17149. this.chunks.push(t)
  17150. }
  17151. ,
  17152. n.prototype.setMode = function(e) {
  17153. if (!this.supportedModes[e])
  17154. throw new R("Mode not supported for this model: " + e);
  17155. this.mode = e,
  17156. this.chunks.forEach(function(t) {
  17157. t.setMode(e)
  17158. })
  17159. }
  17160. ,
  17161. n.prototype.build = function() {
  17162. this.heroLocations = this.images.getHeroLocations(this.panos);
  17163. var e = function() {
  17164. 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()
  17165. }
  17166. .bind(this)();
  17167. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17168. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17169. }
  17170. .bind(this)) || e,
  17171. null === this.heroImage && O.warn("No hero image defined."),
  17172. this.currentFloor = this.floors.last(),
  17173. this.floors.build(),
  17174. this.colliders = this.floors.reduce(function(e, t) {
  17175. return e.concat(t.collider.children)
  17176. }, []),
  17177. this.panos.forEach(function(e) {
  17178. e.build1(),
  17179. e.on("enter", function() {
  17180. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17181. }
  17182. .bind(this))
  17183. }
  17184. .bind(this)),
  17185. this.panos.forEach(function(e) {
  17186. e.build2()
  17187. }),
  17188. this.floors.forEach(function(e) {
  17189. this.boundingBox.union(e.boundingBox)
  17190. }
  17191. .bind(this)),
  17192. this.size = this.boundingBox.size(),
  17193. this.center = this.boundingBox.center(),
  17194. this.floors.forEach(function(e) {
  17195. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17196. }
  17197. .bind(this)),
  17198. this.panos.populate_path_graph(),
  17199. this.skybox = new l(this.boundingBox),
  17200. this.skybox.matrixWorldNeedsUpdate = !0,
  17201. this.add(this.skybox);
  17202. for (var t in this.tags)
  17203. this.tags[t].build();
  17204. O.debug("Done building model"),
  17205. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17206. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17207. this.buildRooms(),
  17208. this.labels.associateWithRooms(this.rooms)
  17209. this.createFloorLogo(); //xzw
  17210. return $.when(this); //it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately. 必须有参数,没有的话无法触发done()
  17211. }
  17212. ,
  17213. n.prototype.createFloorLogo = function(){//xzw 创建地标
  17214. var url = Data.floorLogo ? Data.imgRoot+"floorLogoImg.png"+"?m="+Data.version : Data.imgRoot2 +"floorLogo.png"; //暂定
  17215. var map = te.load(url);//可以追加done
  17216. $("#showInformationLogo").css('background-image', "url('"+url+"')");
  17217. this.floorLogos = [];
  17218. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17219. var e = o.UniformsUtils.clone(ss.floorLogo.uniforms);
  17220. e.map.value = map;
  17221. var material = new o.ShaderMaterial({
  17222. fragmentShader: ss.floorLogo.fragmentShader,
  17223. vertexShader: ss.floorLogo.vertexShader,
  17224. uniforms: e,
  17225. side: o.DoubleSide,
  17226. transparent: !0,
  17227. depthWrite: !1,
  17228. depthTest:false//改 在chunk\skybox外也可看到
  17229. });
  17230. var logo = new o.Mesh(new o.PlaneGeometry(2.5,2.5,1,1),material);
  17231. var s = (Data.floorLogoSize || 100)/100;
  17232. logo.scale.set(s,s,s);
  17233. logo.position.set(0,-1.49,0);
  17234. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17235. this.add(logo);
  17236. this.floorLogos.push(logo);
  17237. }
  17238. this.floorLogos[1].visible = false;
  17239. },
  17240. n.prototype.changeFloorLogo = function(o){
  17241. if(!this.floorLogos) return;
  17242. for(var i=0; i<2; i++){
  17243. if(o.url){
  17244. this.floorLogos[i].material.uniforms.map.value = te.load(o.url+"?m="+Data.version);
  17245. }else if(o.image){
  17246. var t = new o.Texture(o.image);
  17247. t.needsUpdate = !0;
  17248. this.floorLogos[i].material.uniforms.map.value = t;
  17249. this.floorLogos[i].material.needsUpdate=!0;
  17250. }
  17251. }
  17252. },
  17253. n.prototype.floorLogoFade = function(i, time, delay){//改
  17254. if(!this.floorLogos) return;
  17255. E.start(le.uniform(this.floorLogos[i], "opacity", 0), time || 250, null,delay,es["easeInQuad"])
  17256. },
  17257. n.prototype.floorLogoShow = function(i, time, delay){//改
  17258. if(!this.floorLogos) return;
  17259. E.start(le.uniform(this.floorLogos[i], "opacity", 1), time || 250, null,delay,es["easeInQuad"])
  17260. },
  17261. n.prototype.updateFloorlogo = function(Q) { //xzw add 更新地标的旋转
  17262. var quaternion;
  17263. for(var i=0;i<2;i++){
  17264. if(!quaternion){
  17265. var a = new o.Vector3(0,0,-1);
  17266. a.applyQuaternion(Q);
  17267. a.setY(0);
  17268. var _ = (new o.Matrix4).lookAt(a,new o.Vector3, new o.Vector3(0,1,0));
  17269. quaternion = (new o.Quaternion).setFromRotationMatrix(_)
  17270. }
  17271. if(this.floorLogos[i].visible){
  17272. this.floorLogos[i].quaternion.copy(quaternion);
  17273. /* k.model.floorLogos[i].rotateOnAxis(new o.Vector3(1,0,0),Math.PI/2) //origin
  17274. k.model.floorLogos[i].rotateOnAxis(new o.Vector3(0,1,0),Math.PI) */
  17275. /*var a = new o.Quaternion;
  17276. a.setFromAxisAngle(new o.Vector3(1,0,0), Math.PI/2);
  17277. var b = new o.Quaternion;
  17278. b.setFromAxisAngle(new o.Vector3(0,1,0), Math.PI);
  17279. a.multiply(b); */
  17280. //var a = new o.Quaternion( 4.329780281177466e-17 , 0.7071067811865476, 0.7071067811865476 , 4.329780281177467e-17)
  17281. var a = new o.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  17282. this.floorLogos[i].quaternion.multiply(a);
  17283. }
  17284. }
  17285. }
  17286. n.prototype.loadLabels = function() {
  17287. this.labels = new x(this);
  17288. var e = $.Deferred();
  17289. if (!this.showingLabels)
  17290. return e.resolve();
  17291. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17292. var t = "data/" + this.sid + "/labels.json";
  17293. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17294. O.warn("Getting labels failed, not displaying labels."),
  17295. e.resolve()
  17296. }),
  17297. e
  17298. }
  17299. ,
  17300. n.prototype.buildRooms = function() {
  17301. this.rooms = new T(this),
  17302. this.rooms.createFromChunks(this.chunks),
  17303. this.rooms.calcRoomBoundaries()
  17304. }
  17305. ,
  17306. n.prototype.updateProjectedPanos = function() {
  17307. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17308. }
  17309. ,
  17310. n.prototype.setProjectedPanos = function(e, t, i) {
  17311. void 0 !== i && null !== i || (i = !0),
  17312. i = !!i,
  17313. this.projectedPano0 = e,
  17314. this.projectedPano1 = t,
  17315. this.skybox.material.setProjectedPanos(e, t, i),
  17316. this.chunks.forEach(function(n) {
  17317. n.materialInside.setProjectedPanos(e, t, i)
  17318. })
  17319. }
  17320. ,
  17321. n.prototype.setSide = function(e) {
  17322. this.floors.forEach(function(t) {
  17323. t.collider.material.side = e
  17324. })
  17325. }
  17326. ,
  17327. n.prototype.heroCount = function() {
  17328. return this.heroLocations ? this.heroLocations.length : 0
  17329. }
  17330. ,
  17331. n.prototype.getHeroDescriptorByIndex = function(e) {
  17332. if (e < 0)
  17333. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17334. null;
  17335. var t = this.heroCount();
  17336. if (t < 1)
  17337. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17338. null;
  17339. var i = this.heroLocations[e];
  17340. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17341. null) : i
  17342. }
  17343. ,
  17344. n.prototype.findPanoramicHero = function() {
  17345. for (var e in this.heroLocations)
  17346. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17347. return this.heroLocations[e];
  17348. return null
  17349. }
  17350. ,
  17351. n.prototype.listImagePanos = function() {
  17352. var e = []
  17353. , t = this;
  17354. return this.images.forEach(function(i) {
  17355. if (i.metadata && i.metadata.scan_id) {
  17356. var n = t.panos.get(i.metadata.scan_id);
  17357. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17358. }
  17359. }),
  17360. e
  17361. }
  17362. ,
  17363. n.prototype.fadePanoMarkers = function(e, t) {
  17364. this.panos.fadeMarkerOpacity(e, t)
  17365. }
  17366. ,
  17367. n.prototype.setSweepVisibility = function(e) {
  17368. this.panos.forEach(function(t) {
  17369. t.marker && (t.marker.visible = e)
  17370. })
  17371. }
  17372. ,
  17373. n.prototype.outsideAllowed = function() {
  17374. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17375. }
  17376. ,
  17377. t.exports = n
  17378. }
  17379. ).call(this, "/js/model/Model.js")
  17380. }
  17381. , {
  17382. "../constants": 8,
  17383. "../enum/AlignmentType": 17,
  17384. "../enum/RenderOrder": 42,
  17385. "../enum/Viewmode": 51,
  17386. "../exception/BasicException": 55,
  17387. "../label/Label": 90,
  17388. "../loaders/ModelLoader": 105,
  17389. "../loaders/ModelTextureLoader": 106,
  17390. "../loaders/SweepDataLoader": 107,
  17391. "../tag/tag": 123,
  17392. "../tag/tagManager": 124,
  17393. "../objects/BoundingTextureSkybox": 143,
  17394. "../objects/Chunk": 144,
  17395. "../objects/Floor": 146,
  17396. "../objects/Panorama": 148,
  17397. "../objects/Room": 150,
  17398. "../objects/Snapshot": 153,
  17399. "../settings": 166,
  17400. "../shaders": 167,
  17401. "../util/ModelUrls": 177,
  17402. "../util/PanoramaCollection": 178,
  17403. "../util/ajax": 181,
  17404. "../util/common": 185,
  17405. "../util/easing": 186,
  17406. "../util/lerp": 188,
  17407. "../util/logger": 189,
  17408. "../util/math": 190,
  17409. "../util/texture": 194,
  17410. "../util/transitions": 195,
  17411. "./../util/browser": 182,
  17412. "./../util/showcase": 193,
  17413. "./Chunks": 135,
  17414. "./FloorCollection": 136,
  17415. "./ImageCollection": 137,
  17416. "./LabelCollection": 138,
  17417. "./RoomCollection": 141,
  17418. events: 202,
  17419. three: 217
  17420. }],
  17421. 140: [function(e, t, i) {//"../model/ModelManager"
  17422. "use strict";
  17423. function n() {
  17424. this.modelMap = {},
  17425. this.activeModel = null,
  17426. this.modelCount = 0,
  17427. this.tileDownloader = null,
  17428. this.panoRenderer = null
  17429. }
  17430. var r = (e("three"),
  17431. e("../util/common"))
  17432. , o = e("../exception/BasicException")
  17433. , a = e("../enum/ModelManagerEvents")
  17434. , s = e("../enum/PanoRendererEvents")
  17435. , l = e("events").EventEmitter;
  17436. n.prototype.init = function(e, t, i) {
  17437. this.tileDownloader = e,
  17438. this.panoRenderer = t,
  17439. this.qualityManager = i,
  17440. this.bindEvents()
  17441. }
  17442. ,
  17443. n.prototype.bindEvents = function() {
  17444. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17445. }
  17446. ,
  17447. n.prototype.onTileRendered = function(e, t, i, n) {}
  17448. ,
  17449. n.prototype.addModel = function(e) {
  17450. this.modelMap[e.sid] = e,
  17451. 0 === this.modelCount && this.activateModel(e.sid),
  17452. this.modelCount++,
  17453. this.emit(a.ModelAdded)
  17454. }
  17455. ,
  17456. n.prototype.getModel = function(e) {
  17457. return this.modelMap[e]
  17458. }
  17459. ,
  17460. n.prototype.activateModel = function(e) {
  17461. var t = this.modelMap[e];
  17462. if (!t)
  17463. throw new o("Tried to activate invalid model!");
  17464. var i = this.activeModel;
  17465. this.activeModel = t,
  17466. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17467. this.tileDownloader.setUrls(t.urls),
  17468. t.panos.forEach(function(e) {
  17469. e.attachToPanoRenderer(this.panoRenderer),
  17470. e.tileDownloader = this.tileDownloader,
  17471. e.qualityManager = this.qualityManager
  17472. }
  17473. .bind(this)),
  17474. this.emit(a.ActiveModelChanged, {
  17475. oldModel: i,
  17476. model: t
  17477. })
  17478. }
  17479. ,
  17480. n.prototype.getActiveModel = function() {
  17481. return this.activeModel
  17482. }
  17483. ,
  17484. r.extend(n, l),
  17485. t.exports = n
  17486. }
  17487. , {
  17488. "../enum/ModelManagerEvents": 33,
  17489. "../enum/PanoRendererEvents": 35,
  17490. "../exception/BasicException": 55,
  17491. "../util/common": 185,
  17492. events: 202,
  17493. three: 217
  17494. }],
  17495. 141: [function(e, t, i) {///js/model/RoomCollection.js
  17496. (function(i) {
  17497. "use strict";
  17498. function n() {
  17499. s.call(this)
  17500. }
  17501. var r = e("../objects/Room")
  17502. , o = (e("../settings"),
  17503. e("../util/logger"))
  17504. , a = (e("../util/transitions"),
  17505. e("../util/easing"),
  17506. e("../util/common"))
  17507. , s = e("../util/IndexedCollection")
  17508. , l = e("./Chunks");
  17509. new o(i);
  17510. a.inherit(n, s),
  17511. n.prototype.getIndex = function(e) {
  17512. return e.roomId
  17513. }
  17514. ,
  17515. n.prototype.calcRoomBoundaries = function() {
  17516. this.forEach(function(e) {
  17517. e.calcBoundaries()
  17518. })
  17519. }
  17520. ,
  17521. n.prototype.createFromChunks = function(e) {
  17522. var t = {
  17523. floorId: -1,
  17524. roomId: -1
  17525. }
  17526. , i = {};
  17527. e.forEach(function(e) {
  17528. l.parseIdsFromChunkName(e.name, t);
  17529. var o = i[t.roomId];
  17530. if (!o) {
  17531. var a = n.generateRoomId(t.floorId, t.roomId);
  17532. o = new r(t.floorId,a),
  17533. this.add(o),
  17534. i[t.roomId] = o
  17535. }
  17536. o.addChunk(e)
  17537. }
  17538. .bind(this)),
  17539. this.calcRoomBoundaries()
  17540. }
  17541. ,
  17542. n.generateRoomId = function(e, t) {
  17543. return e + "_" + t
  17544. }
  17545. ,
  17546. t.exports = n
  17547. }
  17548. ).call(this, "/js/model/RoomCollection.js")
  17549. }
  17550. , {
  17551. "../objects/Room": 150,
  17552. "../settings": 166,
  17553. "../util/IndexedCollection": 175,
  17554. "../util/common": 185,
  17555. "../util/easing": 186,
  17556. "../util/logger": 189,
  17557. "../util/transitions": 195,
  17558. "./Chunks": 135
  17559. }],
  17560. 142: [function(e, t, i) {//"./BoundingMesh"
  17561. "use strict";
  17562. function n(e, t, i) {
  17563. e = e.clone();
  17564. var n = e.size()
  17565. , o = new r.BoxGeometry(n.x,n.y,n.z);
  17566. o.boundingBox = e,
  17567. r.Mesh.call(this, o, t),
  17568. this.position.copy(e.center()),
  17569. this.frustumCulled = !1,
  17570. i && this.add(new r.WireframeHelper(this))
  17571. }
  17572. var r = e("three");
  17573. n.prototype = Object.create(r.Mesh.prototype),
  17574. n.prototype.constructor = n,
  17575. t.exports = n
  17576. }
  17577. , {
  17578. three: 217
  17579. }],
  17580. 143: [function(e, t, i) {///js/objects/BoundingTextureSkybox.js
  17581. (function(i) {
  17582. "use strict";
  17583. function n(e) {
  17584. h.time("Computing a nice bounding cubemap");
  17585. var t = new a({
  17586. side: r.BackSide,
  17587. transparent: !0
  17588. });
  17589. t.uniforms.modelAlpha.value = 0,
  17590. t.uniforms.opacity.value = 1 - s.modelAlpha,
  17591. this.renderOrder = l.boundingSkybox,
  17592. o.call(this, e, t),
  17593. h.timeEnd("Computing a nice bounding cubemap")
  17594. }
  17595. var r = e("three")
  17596. , o = (e("../enum/Viewmode"),
  17597. e("../shaders"),
  17598. e("./BoundingMesh"))
  17599. , a = e("../materials/ModelTextureMaterial")
  17600. , s = e("../settings")
  17601. , l = e("../enum/RenderOrder")
  17602. , c = e("../util/logger")
  17603. , h = new c(i);
  17604. n.prototype = Object.create(o.prototype),
  17605. n.prototype.constructor = n,
  17606. t.exports = n
  17607. }
  17608. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17609. }
  17610. , {
  17611. "../enum/RenderOrder": 42,
  17612. "../enum/Viewmode": 51,
  17613. "../materials/ModelTextureMaterial": 118,
  17614. "../settings": 166,
  17615. "../shaders": 167,
  17616. "../util/logger": 189,
  17617. "./BoundingMesh": 142,
  17618. three: 217
  17619. }],
  17620. 144: [function(e, t, i) {//"./objects/Chunk"
  17621. "use strict";
  17622. function n(e) {
  17623. this.materialInside = new s({
  17624. side: r.DoubleSide
  17625. });
  17626. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17627. this.materialOutside = new r.RawShaderMaterial({
  17628. fragmentShader: o.modelOutside.fragmentShader,
  17629. vertexShader: o.modelOutside.vertexShader,
  17630. uniforms: t,
  17631. side: r.FrontSide,
  17632. name: "chunkOut"
  17633. }),
  17634. r.Mesh.call(this, e.geometry, this.materialInside),
  17635. this.name = e.name || "",
  17636. this.textureName = e.textureName,
  17637. this.meshUrl = e.meshUrl
  17638. }
  17639. var r = e("three")
  17640. , o = e("../shaders")
  17641. , a = e("../enum/Viewmode")
  17642. , s = e("../materials/ModelTextureMaterial");
  17643. n.prototype = Object.create(r.Mesh.prototype),
  17644. n.prototype.setTextureMap = function(e) {
  17645. this.materialInside.uniforms.map.value = e,
  17646. this.materialOutside.uniforms.map.value = e
  17647. }
  17648. ,
  17649. n.prototype.setMode = function(e) {
  17650. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17651. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17652. t.transparent = this.material.transparent,
  17653. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  17654. this.material = t
  17655. }
  17656. ,
  17657. t.exports = n
  17658. }
  17659. , {
  17660. "../enum/Viewmode": 51,
  17661. "../materials/ModelTextureMaterial": 118,
  17662. "../shaders": 167,
  17663. three: 217
  17664. }],
  17665. 145: [function(e, t, i) {//"./ChunkedCollider"
  17666. "use strict";
  17667. function n(e) {
  17668. this.chunksize = e || 10,
  17669. this.chunks = {},
  17670. this.boundingBoxes = {},
  17671. this.children = [],
  17672. this.offset = new r.Vector3(0,.5,0),
  17673. this.material = new r.MeshBasicMaterial({
  17674. color: 16777215 * Math.random(),
  17675. side: r.DoubleSide
  17676. })
  17677. }
  17678. var r = e("three");
  17679. e("../enum/Viewmode");
  17680. n.prototype.add = function(e) {
  17681. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  17682. m ? (t = m.position.array,
  17683. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17684. n = e.faces);
  17685. var v = new r.Vector3;
  17686. if (i)
  17687. for (o = 0,
  17688. a = i.length; o < a; o += 3) {
  17689. var A = 3 * i[o]
  17690. , y = 3 * i[o + 1]
  17691. , C = 3 * i[o + 2];
  17692. s = (t[A] + t[y] + t[C]) / 3,
  17693. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  17694. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  17695. h = Math.floor(s / this.chunksize),
  17696. u = Math.floor(l / this.chunksize),
  17697. d = Math.floor(c / this.chunksize),
  17698. p = h + "." + u + "." + d,
  17699. p in this.chunks ? (g = this.chunks[p],
  17700. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17701. f = this.boundingBoxes[p] = new r.Box3),
  17702. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  17703. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  17704. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  17705. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  17706. }
  17707. else
  17708. for (o = 0,
  17709. a = t.length; o < a; o += 9)
  17710. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  17711. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  17712. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  17713. h = Math.floor(s / this.chunksize),
  17714. u = Math.floor(l / this.chunksize),
  17715. d = Math.floor(c / this.chunksize),
  17716. p = h + "." + u + "." + d,
  17717. p in this.chunks ? (g = this.chunks[p],
  17718. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17719. f = this.boundingBoxes[p] = new r.Box3),
  17720. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  17721. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  17722. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  17723. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  17724. }
  17725. ,
  17726. n.prototype.build = function() {
  17727. var e = new r.Object3D;
  17728. e.material = this.material;
  17729. for (var t in this.chunks) {
  17730. var i = this.chunks[t]
  17731. , n = new r.BufferGeometry;
  17732. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  17733. n.boundingBox = this.boundingBoxes[t];
  17734. var o = new r.Mesh(n,this.material);
  17735. o.material.visible = !1,
  17736. e.add(o),
  17737. this.chunks[t] = []
  17738. }
  17739. return e
  17740. }
  17741. ,
  17742. t.exports = n
  17743. }
  17744. , {
  17745. "../enum/Viewmode": 51,
  17746. three: 217
  17747. }],
  17748. 146: [function(e, t, i) {//"./objects/Floor"
  17749. "use strict";
  17750. function n(e, t, i) {
  17751. r.Object3D.call(this),
  17752. this.model = e,
  17753. this.floorIndex = t,
  17754. this.name = i || d.FLOOR_NAME + (t + 1),
  17755. this.panos = [],
  17756. this.chunks = [],
  17757. this.colliderBuilder = new l(3),
  17758. this.collider = null,
  17759. this.center = null,
  17760. this.boundingBox = new r.Box3,
  17761. this.size = null,
  17762. this.hidden = !1,
  17763. this.conservativeBoundingBox = new r.Box3,
  17764. this.debugColor = 16777215 * Math.random(),
  17765. this.transition = null
  17766. }
  17767. var r = e("three")
  17768. , o = e("../settings")
  17769. , a = e("../util/common")
  17770. , s = e("../util/lerp")
  17771. , l = e("./ChunkedCollider")
  17772. , c = e("../util/transitions")
  17773. , h = e("../util/easing")
  17774. , u = (e("../objects/Panorama"),
  17775. e("../enum/RenderOrder"))
  17776. , d = e("../localization/localize");
  17777. n.prototype = Object.create(r.Object3D.prototype),
  17778. n.prototype.enter = function(e) {
  17779. this.model.setFloor(this, e)
  17780. }
  17781. ,
  17782. n.prototype.hide = function(e) {
  17783. if (!this.hidden || this.transition) {
  17784. this.chunks.forEach(function(e) {
  17785. e.material.transparent = !0
  17786. }),
  17787. c.cancel(this.transition);
  17788. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  17789. , i = e ? 0 : o.hideFloorDelay / t;
  17790. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  17791. this.hidden = !0
  17792. }
  17793. .bind(this), i, h.easeInOutQuad)
  17794. }
  17795. }
  17796. ,
  17797. n.prototype.show = function(e) {
  17798. if (this.hidden || this.transition) {
  17799. this.hidden = !1,
  17800. c.cancel(this.transition);
  17801. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  17802. , i = e ? 0 : o.showFloorDelay / t;
  17803. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  17804. this.hidden || this.chunks.forEach(function(e) {
  17805. e.material.transparent = !1
  17806. })
  17807. }
  17808. .bind(this), i, h.easeInOutQuad)
  17809. }
  17810. }
  17811. ,
  17812. n.prototype.toggle = function(e, t) {
  17813. e = void 0 === e ? this.hidden : e,
  17814. e ? this.show(t) : this.hide(t)
  17815. }
  17816. ,
  17817. n.prototype.containsPoint = function(e) {
  17818. return this.collider.children.some(function(t) {
  17819. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  17820. t.geometry.boundingBox.containsPoint(e)
  17821. })
  17822. }
  17823. ,
  17824. n.prototype.distanceToPoint = function(e) {
  17825. var t = null
  17826. , i = 1 / 0;
  17827. return this.collider.children.forEach(function(n) {
  17828. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  17829. var r = n.geometry.boundingBox.distanceToPoint(e);
  17830. (!t || i > r) && (i = r,
  17831. t = n)
  17832. }),
  17833. i
  17834. }
  17835. ,
  17836. n.prototype.addChunk = function(e) {
  17837. e.renderOrder = u.ghostFloor,
  17838. this.add(e),
  17839. this.chunks.push(e),
  17840. this.boundingBox.union(e.geometry.boundingBox),
  17841. this.size = this.boundingBox.size(),
  17842. this.colliderBuilder.add(e.geometry)
  17843. }
  17844. ,
  17845. n.prototype.addPano = function(e) {
  17846. this.panos.push(e),
  17847. this.add(e.skyboxMesh),
  17848. e.marker && this.add(e.marker);
  17849. var t = new r.Vector3(1,1,1)
  17850. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  17851. this.boundingBox.union(i)
  17852. }
  17853. ,
  17854. n.prototype.build = function() {
  17855. this.collider = this.colliderBuilder.build(!0),
  17856. this.add(this.collider),
  17857. this.center = this.boundingBox.center(),
  17858. this.conservativeBoundingBox.copy(this.boundingBox),
  17859. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  17860. return e.geometry.boundingBox.min.y
  17861. }), 5),
  17862. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  17863. return e.geometry.boundingBox.max.y
  17864. }), 5),
  17865. this.colliderBuilder = null
  17866. }
  17867. ,
  17868. n.prototype.toShortString = function() {
  17869. return a.nth(this.floorIndex + 1)
  17870. }
  17871. ,
  17872. n.prototype.toString = function() {
  17873. return this.name
  17874. }
  17875. ,
  17876. t.exports = n
  17877. }
  17878. , {
  17879. "../enum/RenderOrder": 42,
  17880. "../localization/localize": 108,
  17881. "../objects/Panorama": 148,
  17882. "../settings": 166,
  17883. "../util/common": 185,
  17884. "../util/easing": 186,
  17885. "../util/lerp": 188,
  17886. "../util/transitions": 195,
  17887. "./ChunkedCollider": 145,
  17888. three: 217
  17889. }],
  17890. 147: [function(e, t, i) {//"./objects/NSpider"
  17891. "use strict";
  17892. function n(e) {
  17893. this.player = e,
  17894. this.obj3d = null,
  17895. this.UP = new r.Vector3(0,1,0)
  17896. }
  17897. var r = e("three")
  17898. , o = e("../settings");
  17899. n.prototype.prefs = {
  17900. linewidth: 3,
  17901. height: .07,
  17902. opacity: .45,
  17903. endScale: .05
  17904. },
  17905. n.prototype.discard = function() {
  17906. if (this.obj3d) {
  17907. var e = this.obj3d.parent;
  17908. e && e.remove(this.obj3d)
  17909. }
  17910. this.obj3d = null
  17911. }
  17912. ,
  17913. n.prototype.draw = function() {
  17914. if (this.discard(),
  17915. o.showNeighbors) {
  17916. var e = this.player.currentPano.floor;
  17917. this.obj3d = new r.Object3D;
  17918. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17919. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17920. i.y += this.prefs.height;
  17921. var n = .1525
  17922. , a = .127
  17923. , s = .0127
  17924. , l = .1
  17925. , c = .19
  17926. , h = .2032
  17927. , u = .2286
  17928. , d = .255
  17929. , p = new r.Matrix4;
  17930. for (var f in t)
  17931. if (t[f]) {
  17932. var g = this.player.model.panos.get(f)
  17933. , m = (g.position.clone().sub(this.player.model.position),
  17934. g.position.clone().sub(g.floorPosition))
  17935. , v = g.floorPosition.clone().sub(this.player.model.position);
  17936. v.y += this.prefs.height;
  17937. var A = new r.Geometry;
  17938. A.vertices.push(new r.Vector3(0,-s,0), new r.Vector3(-s,0,0), new r.Vector3(0,s,0), new r.Vector3(s,0,0), new r.Vector3(0,-s,0)),
  17939. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  17940. p.identity().setPosition(m),
  17941. A.applyMatrix(p),
  17942. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  17943. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  17944. p.lookAt(v, i, this.UP).setPosition(v),
  17945. A.applyMatrix(p),
  17946. A.vertices.push(v, i);
  17947. var y = new r.Line(A,new r.LineBasicMaterial({
  17948. color: g.debugColor.getHex(),
  17949. transparent: !0,
  17950. opacity: this.prefs.opacity,
  17951. depthWrite: !1,
  17952. name: "sLine" + f,
  17953. linewidth: this.prefs.linewidth
  17954. }));
  17955. this.obj3d.add(y)
  17956. }
  17957. e.add(this.obj3d)
  17958. }
  17959. }
  17960. ,
  17961. n.prototype.update = function() {
  17962. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17963. }
  17964. ,
  17965. t.exports = n
  17966. }
  17967. , {
  17968. "../settings": 166,
  17969. three: 217
  17970. }],
  17971. 148: [function(e, t, i) {///js/objects/Panorama.js
  17972. (function(i) {
  17973. "use strict";
  17974. function n(e, t, i, n) {
  17975. this.model = e,
  17976. this.id = t,
  17977. this.alignmentType = i.alignmentType || l.ALIGNED,
  17978. this.neighbourUUIDs = i.neighbours || null,
  17979. this.neighbourPanos = null,
  17980. this.floor = null,
  17981. this.floorIndex = i.floor,
  17982. this.failedLoadingAt = 0,
  17983. this.maxLoadRetries = 4,
  17984. this.origin = i.position.clone(),
  17985. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  17986. this.quaternion = i.quaternion.clone(),
  17987. this.skyboxMesh = new r.Mesh(E),
  17988. this.skyboxMesh.position.copy(this.position),
  17989. this.skyboxMesh.quaternion.copy(this.quaternion),
  17990. this.skyboxMesh.name = "skybox",
  17991. this.skyboxMesh.visible = !1,
  17992. this.skyboxMesh.updateMatrix(),
  17993. this.skyboxMesh.updateMatrixWorld(),
  17994. this.marker = null,
  17995. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  17996. map: w,
  17997. side: r.DoubleSide,
  17998. opacity: 0,
  17999. transparent: !0,
  18000. depthWrite: !1
  18001. })),
  18002. this.marker.renderOrder = s.panoMarker,
  18003. this.marker.name = "marker",
  18004. this.marker.pano = this,
  18005. this.marker.layers.set(v.PANOMARKERS),
  18006. this.marker.updateMatrixWorld(),
  18007. a.colorMarkerOnLoad && this.on("load", function() {
  18008. this.marker.material.color.set(65280)
  18009. })),
  18010. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18011. this.floorPosition = i.puck ? i.puck.clone() : null,
  18012. this.tiled = n,
  18013. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18014. this.solidSkybox.flipY = !1,
  18015. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18016. this.solidSkybox.magFilter = r.LinearFilter,
  18017. this.solidSkybox.generateMipmaps = !1)),
  18018. this.zoomed = !1,
  18019. this.panoRenderer = null,
  18020. this.qualityManager = null,
  18021. this.tileDownloader = null,
  18022. this.tiledPanoRenderTarget = null,
  18023. this.minimumTiledPanoLoaded = !1,
  18024. this.highestPartialTileRenderOpCompleted = 0,
  18025. this.highestFullTileRenderOpCompleted = 0,
  18026. this.shouldRedrawOnBaseLoaded = !1,
  18027. this.lockUntilRenderingComplete = !1,
  18028. a.colorMarkerOnLoad && this.on("load", function() {
  18029. this.marker.material.color.set(65280)
  18030. })
  18031. }
  18032. var r = e("three")
  18033. , o = e("../util/logger")
  18034. , a = e("../settings")
  18035. , s = (e("../enum/Viewmode"),
  18036. e("../enum/RenderOrder"))
  18037. , l = e("../enum/AlignmentType")
  18038. , c = (e("../util/common"),
  18039. e("../util/transitions"))
  18040. , h = e("../util/lerp")
  18041. , u = e("../util/ajax")
  18042. , d = e("../util/texture")
  18043. , p = e("../util/panorama")
  18044. , f = (e("../enum/TileDownloaderEvents"),
  18045. e("../enum/PanoramaEvents"))
  18046. , g = e("../enum/PanoRendererEvents")
  18047. , m = e("../enum/PanoSizeClass")
  18048. , v = e("../enum/RenderLayers")
  18049. , A = (e("../scene/SceneRenderer"),
  18050. e("../enum/GLCubeFaces"),
  18051. e("../exception/BasicException"))
  18052. , y = e("../tile/TileUtils")
  18053. , C = e("events").EventEmitter
  18054. , I = new o(i)
  18055. , E = new r.SphereBufferGeometry(.1)
  18056. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18057. , w = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAIIRJREFUeAHtnQvsXVWVxnnKG8qjFCiPtjA8Qh3COyTgpIOgECQDwmAI+ByMCiNqJDpRY4ya0cGoICiB+MQhIA8JElAeaRxISAuFMJRAkUIpFCjlUYZnodD5fWXfet/3nHvPY6991krW/9z/uefss/a31vruPnvvs89667k4Ao6AI+AIOAKOgCPgCDgCjkCDEFi/QXVNsqpr1qzZkIpti+4QtluylW4RtPX5ffyvYzfqUv5db3WXvsP/b6Gvoa+Gbeuz/n8JfV7b9ddfX8e6GEXACcCI40j07TB1OrorOg3dHlXST0E3QOuQd7noSlRk8AK6HH0KXQYxvMjWJXIEnAAidBDJvhNm7YnujirhlfiboZbkDYxdhooQlqKLIYVn2bpEhIATQM3OINnVJJ+BKuFbqmZ7iqLbh8VtugRS0O2HS00IOAHUADxJP5XL7o/ORvdBdX/eRFE/wyJ0IfogZLCiiSDUWWcngArQJ+GFsxL9AFSJr3t4l14E1IfwIHo/ughCWNN7iO8pEgEngCLRbCsrJP0/sOsQ9CB0q7av/eNoBF7hkHvRe9C/ORmMBmycI5wAxkFtyDkk/h58fQSqpN9myKH+VXYEXuZQkcFdEMET2U/zI0ch4AQwCqEM35P06qE/HD0S3S3DKX7I+Ag8yal3ovMgA400uEyAgBPABOCR+HtxupL+YLSpHXkTIDjRqepAXIDeCRE8OlFJDT7ZCSCn88O9vRL+GHRGztP98HIQWEKxt6ILvK8gH8BOABnxIvE34VD92h+NahaeS3wIaDbi7ahaBaviMy8+i5wARvgk3N/r134OuvmIw/3rOBB4HTPmord6P8FwhzgBDMAn/OJ/kK+V/Nam4Q6oVeN2q5NQtwa3eYugv++dALpwIfHVmadf+2PRVKfkdtU6+X81BfkWdC5EoM5Dl4CAE0AAgsQXFhq/PwndOuz2TVoIaD7B9ajmE/gsQ4BwAgAEkl/DeaehevrOJX0E9HTiVZBA44cPG00AJL6esf8oqum6Ls1DQNOMr4UIGrt2QSMJgMTXAhrq3DsB9Qk8gNBgUZ/AjahGDLTASaOkcQRA8quZfybqzf1GhfrIyuq24HJIQNvGSGMIgMTfGK9+BNUvv1oALo5ANwJqAWjY8E8QwdvdX6b4fyMIgOSfifM+g2ohDhdHYBQCWpjkl5DA46MOtP598gRA8mvqrjr6NrTuLLe/UgTe4WrqINTU4mQlWQIg8TVt95OoVuFxcQTGRUCrE/0GItD04uQkSQIg+WfhqbNQDfO5OAKTIqBhwktTvCVIjgBIfnXyaTafN/knDXs/vx0B3RL8ERJQJ2EykgwBkPhb4JVPoe9PxjtekRgReACjfg0R6E1J5iUJAvAmv/k4tFYB3RJcBgk8Zs3wbnvNEwDJr0d2T0a9yd/tXf+/TAR0S3AdJHBbmRcpu2zTBEDynwpAIgAXR6AuBLTWwNV1XXzS65okABJfv/afQLUSr4sjUDcC8zDgtxCBWgWmxBwBkPx6eOdzqN6w4+IIxIKA3mh0CSRgasERUwRA8qun/9/RmbF43e1wBNoQ0NThn0ECZkYIzBAAya9JPeeienW2iyMQKwJ6BfoFkICJNQZMEADJvwugfhHdNlavu12OQBsCL/H5Qkjg6bZ9UX6MngBI/j1B7mxUzX8XR8AKAroNuBgSWByzwVETAMmvjj51+PmqPTFHkds2CAF1CKpjUB2EUUq0C2OEX35P/ijDxo3KiMDaEasQyxlPqfawKAkAwHTPr2a///JXGw9+teIRUAyfTUzvXHzRk5cYHQEAlHr71eHn9/yT+9dLiAMBxfK5IbbjsChYERUBANBaoLDNe/ujChM3pgAEFNMigah+2KLpBAQYNZW+gs4sAGwvohcBLXL5Zpvq7bn6X7Ipqrcfa9tSLaLqUjwCmiz0YzoGo5gxGAUBkPya2382un/xeDeixDXUUhNPlqPPtm1X8FlLWa0i4LTibWbBJ2odihS0tNpUVBOwprVtdasWRfxghzXRqICGCGt/diAKBxJsnwYQf7AnWxgr2Zehi1CNMSvhnyOYKl3GGp+phbAjKmLQXI190OloFDGFHbHLPHz2q7qNrN1ZBNKpgOCP9A6PBP2yP4wq6RcROHrbbXSCL/U2ZRGBdF9ULQaXwQjU/ihxrQRAwCjxRQAunQioabgQXYAq4Vd2fm3jP/w7BUtFBgejs1Hd6rl0InA1/q1tUZHaCIDgmAUOX0U9KP4eEEv4qGfL58f6K/93U/N9Cq2DwzhLt3oz8p2d9NEi+x/h71qWF6uFAAgGDYV8E1VHUtNFnXfzUb2zXvfzyQv+V7/BEagIwWPgvQ7c7+H/16p2fl0EcA4VbfrqvY+Awc3oQzheHXuNE4hA8bcfehy6d+MA6KzwA8TBRZ27yv+vcgLA6cdSLb2qq6mie/ubcLZ68F0CAsSFRhKOR9VX0FTRq8huqbLylRIATm7qfb9+4e9Db8bBS6t0sLVrESO7Y7NaBAeilcZnBFhV3h9QGcA4VhNKvoU26Z5PiX83ql/8Z9i6ZESAeNmZQ9UiOBStLE4zmlfmYeoT+i7xoglcpUtlwOLQL1CbJr2o80nqewWOrKV3t/TIqegCxI1ajaeju1V0yRgucz9x8/MqDKmEAHBik8b738BxN6BzcWIjO/eKDlziR3E6Bz0R3azo8iMtr5L5AaUTAM6bCcDnoU0Y759PPa8h8V+ONKhMm0UsbUMFTkE1fJi6qD/gfGLp8TIrWioB4DDNF/82OrXMSkRQtsbv1dzXVF2XkhEgrjS7ULcFmk+Qsuhhru8QV6U951E2AZxMBT6Usoeo2x3olThpdeL1jKp64cflNIw6KirDijfmL8TWdcUX+16JpREADtJwzn+gG5RlfM3lvsn1f49z1MvvUhMCxJlGCc5AN63JhLIv+y4X+E/irJTh41KSE6eo3DPRUsovG/EM5auH//ue/BmQKvmQ4IPvcxn5JEVZm0shpwqvX1kJegyWqgWQovwPlfoBgfdcipWzWKfgix9gu3yToiiXlFOFS+EEAFNpos8JhVtaf4GrMOEygu2/Ub/fr98fHRbIJ/KNfITKV6nJCSG3Cq1X4QSAdZrnr/X9UpJXqcxPCLB7UqpUinUJPvoJdZPPUhLlVOHP0BRKADDUXhh5SEqoUxdNzSx9PDYxzGqtDiSgsfPzUfkuJTkk5FhhdSqMADBMIwoalklJnqYyPySgGvGcfkqOCz77IXWSD1OS00KuFVKnwggAa45AU+r4e5T66Jff5HJchUSH8UKC79QSkC9TEeWYcq0QKYQAYCTdn5xUiEVxFPK/mPFTAqiSJ7LiqHKaVgQf/pTayaepyEkh5yauTyEEgBX/jG49sTVxFKBA+QWBU9r0yziq2Rwrgi9/QY1TIQHl2pwiPDgxAcBEm2BIKWOURVQwZxlqKl5KwLyb8zw/PHIEgk8vxcxUbgeODbk3EfITEwBX16O+W05kRRwnq7NIb2vxX/44/FG4FcG3F1NwCh2Dyjnl3kQyEQHAQHo2O4Vffw0XXUCA+D3/ROEU/8nBxxdgaQpDhMeEHBwb+IkIgKsq+a0v0KAJI0p+7+0fO4xsnRh8LRKwPllo4h/gsQkg3H8U0hFRY/hoyuhFBISP89fohDouHXx+Ede2Pm14ziR9AWMTAMAdiW5eh/MKvObvCIRSV1wp0FYvqmAEgu9/V3CxVRenHFQujiVjEQCMo1l/R491xXhO+isB4HP74/FHLZaEGPhrLRcv7qJHh5zMXeJYBMBV9LLH7XNfLZ4T9Oz4H+Ixxy2pGQHFguX1BJSLysncMi4BWO7510o+GutfnRstPyFJBEIsaI6AYsOqjJWTuQmApoae+JthFSXs1jJezxm2300vAYEQE78voeiqipwRcjPX9XITAKVbXoTxDhzta/jlCpHmHBxi4w7DNc6dm7kIAIbRuONBRgHSUN+VRm13s6tDQDFidVj4oJCjmdHKRQCUejiqJ/8sitbt9/t+i56r0OYQI1dUeMkiL6XcVI5mlrwEMPZ4Y2aLyjlwPo5dVE7RXmpqCIRYmW+0XrlyNDMB0LTYA0B2MwjKG9h8jUG73eR6EVDMKHasyW4hVzPZnZkAKK2wVUgyWVbcQTfA6P6uvuLwbERJIWZuMFrZzLmaiQBgFM38s9j5p8kdc4060c2uHwHFjsUJQuoMVM6OlEwEQCl7o3ozqyVZg7Hq+NPWxRHIjUCIHXUIWosh5apydqRkJYCxphmOvHq5B9yNAx8r9xJeeuoIhBiyOHckU86OJACjzX8x9k2pB6fXrzIEFEvWWgGZbgNGEgAV17vYt6oM6mIudB/M/UwxRXkpTUcgxNJ9xnBQzip3h0oWAjhgaAlxfnlznGa5VYYRsBhTI3M3CwHsb8xpC2HspcZsdnMjRyDE1MLIzew2b2TuDiUA7v+nUuK07lIj/9/v/SN3kGHzrMXWtJDDAyEfSgCcNZJBBpZczxeLYOrF9Vzar5o6AiG2HjFWz6E5PIoAZhur7J+N2evm2kPAWl/A0BweSAA0HTbCNyN7ESPyn9Z5fygie9yUNBFQjFl6p8A+IZf7emMgAXD0DFSPF1oRPfFnbazWCrZuZ0AgxJilJwWVwzMGOXAYAew56KRI998VqV1uVnoIWIu1gbmcCgEsgZmtruKSXnokXqMQa0sMVTN5AphnyBluahoIWIq5fARAp8FO+GhLI356Bzst3ZMZgdXNHIGAYk6xZ0G2DDndY+ugW4CBjNFTQv07NPPP+kse60fRLciFQIg5SzMD++b0IALYPRca9R68oN7L+9UbjICl2Oub04MIYFdDTvXFPg05KzFTLcVe35weRADTjTjqWZpiK43Y6mYmhkCIPSujT31zuocA6CzYDj/pBSAWxBIDW8DTbcyPgJUY3CzkdkcNewiAb/syRcdZ8fxjBfx4EHNLikbAUgz25HY/Auh7r1A0agWUp2m/lsAvoMpeRIQIKAatTEHvye1+BGDl+f9lPvwXYTo0zKQQg8uMVLsnt/sRwPZGKvOwETvdzPQRsBKLPbndjwB2MOIvX/LbiKMaYKaVWOzJ7Q4CoJdwQ5w1xYjDrAy/GIHTzZwAASuxOCXk+LqqdhAAe7dFu/etOziiD+p0eS4ie9yUZiOgWLTQEajcVo6vk+5k72kirDsyrg8v0vnydlwmuTVNRSDEopVVgjpyvJsAOtghYocuj9g2N62ZCFiJyY4c7yYAK48AW7nnamYqNLPWVmKyI8etEoAVtm1mKjSz1lZicigBbGHEd1bY1gicbmYBCFiJyY4ct9oCWFGAw7wIR6BIBKzEZBItgNeL9JyX5QgUgICVmEyiBfBmAQ7zIhyBIhFYVWRhJZY1lAA2LvHCRRX9FuOuFiZdFFVfL8cAAsTku5j5lgFTO172090HoNeBxS7+6x+7h5prn4XY7MjxbgLQswCxi5WmVuw4un3FI2AhNjtyvJsAOtiheHwKKdECyxZSUS/EHAIWYrMjxy0SgAWWNRe5bnAhCFiITfMEYIFlC4kmL8QcAhZicygBmEPcDXYEHIHxEei+BVg9flGVnblpZVfyCzkC+RCwEJsdOW6RADbJ5xM/2hGoDAELsWmeACywbGUR5xeKCgELsekEEFXIuDEpIWCeACy879wCyCkFtdclOwIWYrMjx7v7ACzMZd6YlU277c7uIj/SESgBgRCTJp6laa9+dyK91v5lxJ8tdLZEDJ+bVgICVmKyI8etEsDmJTjQi3QEJkHASky+2l7JbgLo+LL9wMg+T43MHjfHEbASk0m0AHbyeHMEIkPASkwOJQArLYCet5xGFgxuTvMQsBKTHTlu9RbACts2Lw2aW2MrMTmUAF4y4j8rbGsETjezAASsxGRHjne3AJ4vAIgqitiOcVcLY65VYOHXqBmBEIvb1WxG1st35Hg3AYgdtLhh7LI+Bu4Yu5FuX2MQUCwqJmMX5fbgFgArm2qa4MrYaxHss3LPZQRON3MCBKzE4sqQ4+uq2t0C0BcdTYR1R8b3YVZ8JrlFDUVgTyP17sntfgTwgpHK7GvETjczfQT2MVLFntzuRwBW3nI6nc6XLY0A72YmikCIwelGqvdst539COCp7oMi/V+dLlaYN1II3awCEFAMWugAVFWXdde3HwH0HNR9UkT/OwFE5IyGmmIpBntyu4cA6CV8EUe+YcSZ3g9gxFEJm2klBt8Iud3hih4CCN/2MEXHWfH8M417sCnxmOOWNAmBEHtWZgD2zelBBGClH0DxZqkJ1qT8aEJdLcVe35weRABLDXnvYEO2uqlpIWAp9vrm9CACWGzIT7N9ONCQtxIxNcTcbEPV6ZvTfQmAzgKNF3Y8NhhxRfW648Mits9NSxMBxVzHq7YjruarIad7TOxLAOGovozRU0IcOw6Pwwy3okEIWIq5gbmcCgHMoElm5YGMBuVImlUNsTbDUO2SJwD54ghDDnFTbSNgLdbGIoAl+MjCi0JaoXQYzGxlSmbLZt8aQyDEmKU+J+XwkkEwD7wFoNNALxFcNOjECPdrRZb9IrTLTUoLAcWYldV/hPyikMt9vTCQAMLRC/ueFe/O4+I1zS1LBAFrMTY0h0cRwIPGnLY3TTQrizMYg9bNDbG1tzEkhubwUAKg6bCCyi43VuHjjdnr5tpBwFpsLQ85PBDhoQQQzhrKIANLru8LzQzcvb7L+5VTRCDElKWZf3LDyNzNQgD3G3Sotfs0gxA3zmSLMTUyd7MQgEYCXjHm7gNh7J2N2ezmRopAiKUDIzVvkFnK2ZGjeCMJgHuINRR076CrRLpf8wGs3a9FCqWbFWLJ2hyTe0PuDnXgSAIIZ98ztJQ4vzwU5p4Vp2lulRUEQgwdasXeNjsz5WxWAvgbBb/cVriFj2Ls03GgNea2gG0jbAyxczqVtRZDylXl7EjJRABGbwNU+d3QOSNR8AMcgf4IKHYUQ9YkU/NflcpEAKH2d1lDIdh7Iky+jVHb3eyaEAgxc2JNl5/0splzNTMB0Ap4AquenNSyGs7fjGueUsN1/ZK2EVDMKHasyZMhVzPZnZkAQml3Zio1voP0pKClBRzjQ7BBFoVYsfTEX7t3cuVoXgKYx5UsPSLcDow6BDdq3+GfHYFuBEKMqOPPoig3laOZJRcB0LTQC0MWZC49rgO1YtDH4jLJrYkQAcWI1dWlFoQczQxrLgIIpeZqYmS2pJoDj4LhLY7pVoNOw68SYuMowzDkzs3cBADDPApASwyDdAaO3tGw/W56CQiEmDijhKKrKnJJyM1c18tNAKH0W3NdJa6DN8Wcz+Jw7w+Iyy+1WRNi4bMYoNiwKmPl5LgEoH6AF6wihd2a3HGaYfvd9GIRUCxYnPDTQkG5OFbf3FgEQFNDDwjd3rq60e0HYP5DjNruZheEQIiBDxRUXF3F3B5yMvf1xyKAcBV1OLye+4pxnfBxAmBmXCa5NVUhEHz/8aquV9J1lIO5O/9atoxNADDOKgqZ2yrI6HYT7D6HQLA67GMU9vrNDj4/B0sUA5ZlbsjFseowNgGEq6njQXMDLMuWGH8uATHFciXc9uwIBF+fyxnyvWVR7o3V+deq9EQEAPNMbEDLkJq3WuddJLB5zXb45UtGIPhYyW9pbf9BqNwacnDQ9yP3T0QAofTb2L468krxH7ALJp5NgGwcv6lu4TgIBN+ezbnytXVRzin3JpKJCSDcf9wykRXxnLwXpmiOwMS4xFMlt0QIBJ9qrF8+TkFumeTevwVAUYGuzsD/axVqfPuP2P95bwkY92Kb+cGXn2eXfJuCaMWfQjrgCyEAmEhPIf0xBWRDHRQoXyJwvE/AuFODD79ENVJJfnnk+pBzE3unEAIIVtzFdunEFsVTgJqK5xFAPjoQj09yWRJ8dx4npdLsV/2VY8q1QqQwAoCRNDvwqkKsiqcQdRZ9jUDyeQLx+CSTJcFnX+PgFDr82ut8Vci19n1jfy6MAGQBhulJwUzLEY9tcfUnarhILQGfMVg99mNdMfhKv/wpDPW1Y3BPyLH2fRN9LpQAgiXXslWfQEqiCSNfJrD82YHIvRp89GXMtD7Jpxtp5ZRyq1ApnABgqBex8MZCrYyjME0ZPYsA86XF4vBHhxX4ZSP5Rj5CrU/v7ahb+OfGkFv9vht7X+EEECzR9MSlY1sV94n/hHlfJ9h8UZFI/BR88XXMkW9SFOXSRFN+B4FSCgHAVO9ywctRbVMUPTv+DQLPlxer2bvBB9/ADMvP8w9DcW0uhZwadtxY360/1lkZT8I5J3PohzIebvWwOzD8Shy02moFLNpNbG2E3R9Dj7Jofw6b/0JsXZfj+FyHlk0Amlf/bXRqLqvsHfwsJl+Bo0a+jtle1eKzmOTfB6t0v5/68OwK6vgd4urtsrxQKgHIaJyl4TMNyWyo/xOX+dTvGhxm7UWqJtxCLOkVb6egh5kweDIj3+H084mlxycrZvjZpROALo/jPsjm1OGmJPOtHpG+AdVCDWuSqVWNFSF+FKdz0BPRzWo0pcpL/4H4ub3sC1ZCAKoETvwCmwPKrlBE5es9iroteCwim8yZQtzMwmg191Pt5Ovnk/uJm5/3+6LofVUSgB6s+Raa2uysYT5RC+Bu9CYc+sywA/27TgRI/J3ZczyqkZbK4rTTilr+0zya7xIvWuuvdKkU2MDmX6VWTegPaHeeiOA+9GYcm+r8iPb6jv2ZGNmdk49DD0Qrjc+xjS7uRN33/4gYqazVWDnAOPgYKqmOnKbKQiquFsHipgLQr97ExZ7s1y/+7H7fN2SfOpBLmfAzCL/KCUCG4Oxz2Lx/kFEN2a8hwz+jD+H0RnYWEgeKv/3QD6Ma2muyPEAcXFQ1AHURwBZU9Jtok/oDBvlW93zz0bsIAM0nSF5IfI3fH4FqOM9jYL31FAPfw/+vsa1UaiEA1ZAgUO9uE/sDhjl4CV/OQ+cTDK8OO9Dad/hbT+cp4Q9HZ6Au7yFQ+X1/O/C1EYCMICiOZvOv7Qb557UIKCjUV6D3vS2CDFau3WvsD/7Vakpq2h+M6t6+aZ2/VHmkVDLeP8iKWglARhEkmiCkiUIugxHQrYH6DNZqrK2D8CuvhG9p6lN1B3ss2ze34cursx1azlG1E4CqReB8mo2ahi6jEVCH4TL0YVTDRSKH5wik0uaLU36P4DM957EjqiTX7dy+6HQ0ipjCjthlHj77Vd1GRuEsgklNw7PR/esGxOj1RQrqSFqOihBa2xV8fh1dRbC9yzaz4JMNOHgTVBO4pqJK9GltW3XeRRE/2GFNHsTgi/GJbvVqlWgcSMC9DyS+gs6sFZF0L64lpd5EV3VtVeNNUSV7+1b+cCkegccp8sckv/xRu0RDAEICElBP8Xmofm1cHIHUEFDr7L9I/tdiqZiaedEIwGjo6wL0pWiMckMcgWIQUExfEFPyq1pREYAMAiDdy16IRsOSssvFEZgAAcXyhSG2Jyim+FOjIwBVEaCeZnMxGsV9kmxycQTGREAxrA4/xXR0EiUBCCUA08Myl6BOAgLExSICit1LQixHaX9UnYD9EKJjUE+JaYhwi37f+z5HIFIE1OzXL79+yKKV6AlAyEECu7D5Irqt/ndxBCJHQB1+uuePstnfjp0JApDBkIAmnpyL+hChAHGJFQEN9am3X53Z0YsZAhCSYZ6A1hKYGT2ybmATEdAkn5+R/GZGsEwRgCIKEtAMtc+hPm1YgLjEgsCDGKIOP1Od1uYIQN6GBPTswCdQf4BIgLjUjYDWcPgtyV/73P68QJgkgFYlIYJT+eyPErcA8W0dCNT+SO8klTZNAKo4JCACOBn1xSYEiEtVCOjX/jp+9W+r6oJlXMc8AQgUSEBzBf4N1UiBiyNQNgLq4b+M5K9s+e6yKpQEAQgcSEAThT6FNn21YcHhUh4CD1D0r0l+Mz39w6BIhgBalYQIjuXzv6B+S9ACxbdFIKAm//Uk/i1FFBZLGckRgICFBGaxOQv1WwIB4jIpAsk0+buBSJIAVElIQEtZfRI9AHVxBMZF4H5O/A2//FpaLTlJlgBanoIIfJSgBYZv8yCQRC//qAonTwACABKYyeYz6FT97+IIjEBgBd//kl99Te1NWhpBAPIgJKBlrD+CHoNGuw4CtrnUh4BWTtbLOf9E8le6zHpdVW4MAbQAhgh25/OZqLYujkALgaV8uJzE17Yx0jgCkGchAbUA1BI4AdXDRS7NRUAP79yI3kryqwXQKGkkAbQ8DBFomPCj6CGtfb5tFAL3UNtrSXwTz+6X4ZlGE0ALUIhgLz6fhvptQQuUtLdq5l9F4j+adjVH184JIGAECQgLvbP+JHTrsNs3aSHwMtW5Hr2L5F+TVtXGq40TQBduEIH6BOagmlKsNxW52EdAL5zRFN65JL6pBTvKht4JYADCEIHeladJROos3GzAYb47bgTewDwN6+mZfb0T0aULASeALkC6/4UIlPwiAbUKNL3YJX4ENG13LqqefZGAywAEnAAGANO9O7QIjmT/0ej23d/7/1Eg8AJW3I7e6b/42fzhBJANp3VHQQTC7GBUrYIZqEv9CCzBBDX1F5D43rmXwx9OADnA6j4UMtDw4VHoQahPKOoGqNz/1Zl3L3oHSd/44bxxoXYCGBe5tvNCP4FWKNYtwm5tX/nH4hF4kiLvROf5/f3k4DoBTI5hRwmQwR7s0HwCtQq26fjS/xkXAY3f69de4/dPjFuIn9eLgBNALyaF7Al9BXtTmPoLRAZbFVJwcwp5haoq6Regj/i9fTmOdwIoB9eOUgMZ7MNOrU6kNxpN6zjA/2khsJwPesOOVuFZ5EnfgqW8rRNAedgOLBlC0MIkIoLZqIihqR2I6shbhC5EHyThtRCHS4UIOAFUCHa/S0EGG7F/Brpnm6Y6BVlTche36RKSfjX/u9SEgBNATcAPuyykoFegixD0dOKu6HTU2nRkzcBbhj6F6um7xSS7Xp3tEhECTgAROWOYKZCC1i4QEYgQ1Ieg2Yg7oFNQLXBSh2gBjZXo86hm4ekeXgm/jGR/ka1L5Ag4AUTuoFHmQQwbcsy2qMhAW90+SLdo2+qz+hl0u6HjtW0pH9dTM7yl74TPuj/X22+karq3tvr8Eqqkf4lE1/EujoAj4Ag4Ao6AI+AIOAKOgCPgCDgC8SPw/zAG7eO6u+9JAAAAAElFTkSuQmCC");
  18058. n.prototype = Object.create(C.prototype),
  18059. n.prototype.enter = function() {
  18060. var e = null;
  18061. return function() {
  18062. this.setZoomed(!1),
  18063. this.emit("enter", {
  18064. oldPano: e,
  18065. newPano: this
  18066. }),
  18067. e = this
  18068. }
  18069. }(),
  18070. n.prototype.exit = function() {
  18071. this.tiled ? (this.clearWaitDeferreds(),
  18072. this.minimumTiledPanoLoaded = !1,
  18073. this.tiledPanoRenderTarget = null,
  18074. this.setZoomed(!1),
  18075. this.panoRenderer.deactivateTiledPano(this),
  18076. this.highestPartialTileRenderOpCompleted = 0,
  18077. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18078. this.solidSkybox.loaded = !1,
  18079. this.solidSkybox.version = 0),
  18080. this.emit("exit")
  18081. }
  18082. ,
  18083. n.prototype.hoverOn = function(e) {
  18084. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18085. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18086. }
  18087. ,
  18088. n.prototype.hoverOff = function(e) {
  18089. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18090. }
  18091. ,
  18092. n.prototype.build1 = function() {
  18093. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18094. this.floor.addPano(this),
  18095. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18096. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18097. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18098. }
  18099. ,
  18100. n.prototype.build2 = function() {
  18101. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18102. this.height = this.position.distanceTo(this.floorPosition),
  18103. this.placeMarker()
  18104. }
  18105. ,
  18106. n.prototype.interpolateFloorPosition = function() {
  18107. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18108. return !!e.floorPosition
  18109. }).sort(function(e, t) {
  18110. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18111. }
  18112. .bind(this))
  18113. , t = this.position.clone();
  18114. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18115. t
  18116. }
  18117. ,
  18118. n.prototype.raycastFloorPosition = function() {
  18119. I.warn("Performance warning: Raycasting to find floor position");
  18120. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18121. , t = e.intersectObjects(this.model.colliders);
  18122. return t.length ? t[0].point : null
  18123. }
  18124. ,
  18125. n.prototype.raycastToFindFloor = function() {
  18126. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  18127. return function() {
  18128. I.warn("Performance warning: Raycasting to find floor index");
  18129. for (var t = 0; t < e.length; t++) {
  18130. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18131. , n = i.intersectObjects(this.model.colliders);
  18132. if (n.length)
  18133. return n[0].object.parent.parent
  18134. }
  18135. return null
  18136. }
  18137. }(),
  18138. n.prototype.placeMarker = function() {
  18139. this.marker && (this.marker.position.copy(this.floorPosition),
  18140. this.marker.position.y += .05,
  18141. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18142. }
  18143. ,
  18144. n.prototype.translate = function(e) {
  18145. this.position.add(e),
  18146. this.floorPosition.add(e)
  18147. }
  18148. ,
  18149. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18150. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18151. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18152. }
  18153. ,
  18154. n.prototype.attachToPanoRenderer = function(e) {
  18155. this.panoRenderer = e,
  18156. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18157. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18158. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18159. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18160. }
  18161. ;
  18162. var _ = {};
  18163. n.prototype.getWaitDeferred = function(e) {
  18164. var t = _[this.id];
  18165. t || (t = {},
  18166. _[this.id] = t);
  18167. var i = t[e];
  18168. return i || (i = {
  18169. deferred: $.Deferred(),
  18170. active: !1
  18171. },
  18172. t[e] = i),
  18173. i
  18174. }
  18175. ,
  18176. n.prototype.resetWaitDeferred = function(e) {
  18177. var t = this.getWaitDeferred(e);
  18178. t.active = !1,
  18179. t.deferred = $.Deferred()
  18180. }
  18181. ,
  18182. n.prototype.clearWaitDeferreds = function() {
  18183. var e = _[this.id];
  18184. e || (e = {},
  18185. _[this.id] = e);
  18186. for (var t in e)
  18187. if (e.hasOwnProperty(t)) {
  18188. var i = e[t];
  18189. i.active = !1,
  18190. i.deferred = $.Deferred()
  18191. }
  18192. }
  18193. ,
  18194. n.prototype.loadTiledPano = function() {
  18195. var e = (new r.Vector3,
  18196. [])
  18197. , t = [];
  18198. return function(i, n, r, o, a, s) {
  18199. null !== o && void 0 !== o || (o = !0),
  18200. null !== a && void 0 !== a || (a = !0);
  18201. var l = this.getWaitDeferred(i)
  18202. , c = l.deferred
  18203. , h = null
  18204. , u = null;
  18205. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18206. u = r.vFov)),
  18207. !this.isLoaded(i)) {
  18208. if (!l.active) {
  18209. if (l.active = !0,
  18210. r) {
  18211. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18212. e[this.id + ":" + i] = {
  18213. tileCount: 0,
  18214. targetTileCount: d
  18215. },
  18216. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18217. }
  18218. t[this.id] || (t[this.id] = !0,
  18219. this.on(f.LoadComplete, function(e, t) {
  18220. var i = this.getWaitDeferred(e).deferred;
  18221. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18222. this.resetWaitDeferred(e))
  18223. }
  18224. .bind(this)),
  18225. this.on(f.LoadFailed, function(e) {
  18226. var t = this.getWaitDeferred(e).deferred;
  18227. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18228. this.resetWaitDeferred(e))
  18229. }
  18230. .bind(this)),
  18231. this.on(f.TileLoaded, function(t, i, n) {
  18232. var r = this.getWaitDeferred(t).deferred;
  18233. if (r && "pending" === r.state()) {
  18234. r.notify(t, i, n);
  18235. var o = e[this.id + ":" + t];
  18236. o && (o.tileCount++,
  18237. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18238. r.resolve(t, n),
  18239. this.resetWaitDeferred(t)))
  18240. }
  18241. }
  18242. .bind(this)))
  18243. }
  18244. this.tileDownloader.clearForceQueue(),
  18245. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18246. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18247. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18248. }
  18249. return c.promise()
  18250. }
  18251. }(),
  18252. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18253. if (e === this.id) {
  18254. var n = this.qualityManager.getPanoSize(m.BASE);
  18255. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18256. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18257. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18258. }
  18259. }
  18260. ,
  18261. n.prototype.onTileRendered = function(e, t, i, n) {
  18262. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18263. }
  18264. ,
  18265. n.prototype.onPanoRendered = function(e, t, i, n) {
  18266. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18267. this.updateSkyboxForZoomLevel(),
  18268. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18269. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18270. this.emit("load", t),
  18271. this.model.emit("load", this),
  18272. this.emit(f.LoadComplete, t, i))
  18273. }
  18274. ,
  18275. n.prototype.setZoomed = function(e) {
  18276. this.zoomed = e,
  18277. this.updateSkyboxForZoomLevel()
  18278. }
  18279. ,
  18280. n.prototype.ensureSkyboxReadyForRender = function() {
  18281. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18282. this.solidSkybox.loaded = !0)
  18283. }
  18284. ,
  18285. n.prototype.updateSkyboxForZoomLevel = function() {
  18286. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18287. }
  18288. ,
  18289. n.prototype.getSkyboxTexture = function() {
  18290. // return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18291. if(this.tiled){
  18292. if(this.minimumTiledPanoLoaded){
  18293. if(this.zoomed) return this.panoRenderer.zoomRenderTarget.texture;
  18294. else return this.tiledPanoRenderTarget.texture;
  18295. }else{
  18296. return null;
  18297. }
  18298. }else return this.solidSkybox;
  18299. }
  18300. ,
  18301. n.prototype.onTileRenderFail = function(e, t, i) {
  18302. e === this.id && this.emit(f.LoadFailed, t)
  18303. }
  18304. ,
  18305. n.prototype.isLoaded = function(e) {
  18306. if (this.tiled) {
  18307. if (e && "string" == typeof e)
  18308. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18309. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18310. }
  18311. if (e && "number" == typeof e)
  18312. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18313. return !!this.solidSkybox.high || e in this.solidSkybox
  18314. }
  18315. ,
  18316. n.prototype.loadCube = function(e) {
  18317. if (this.isLoaded(e))
  18318. return I.info("Skipping load of pano, already loaded"),
  18319. $.when();
  18320. this.emit("loading", e),
  18321. this.model.emit("loading", this);
  18322. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18323. , i = t.filter(function(e) {
  18324. return !e
  18325. });
  18326. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18327. e = "high",
  18328. t = p.getCubemapUrls(this.model.urls, this.id, e));
  18329. var n = 0
  18330. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  18331. return u.getImage(t[i])
  18332. }
  18333. .bind(this));
  18334. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  18335. return this.solidSkybox[e] = [t, i, n, r, o, a],
  18336. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  18337. this.solidSkybox.low = null),
  18338. this.solidSkybox.needsUpdate = !0,
  18339. this.emit("load", e),
  18340. this.model.emit("load", this),
  18341. this
  18342. }
  18343. .bind(this), function() {
  18344. I.error("Downloading cubemap for pano", this.id, "failed"),
  18345. this.failedLoadingAt = Date.now()
  18346. }
  18347. .bind(this), function() {
  18348. return $.when(++n, 6)
  18349. })
  18350. }
  18351. ,
  18352. n.raycastsSkipped = 0,
  18353. n.raycastsDone = 0,
  18354. n.prototype.findNeighourPanos = function() {
  18355. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18356. this.model.panos.forEach(function(e) {
  18357. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18358. var t = this.position.distanceTo(e.position);
  18359. if (t > a.panoramaNeighbourMaxDistance)
  18360. return this.model.panos.setNeighbour(this, e, !1),
  18361. void n.raycastsSkipped++;
  18362. var i = e.position.clone().sub(this.position).normalize()
  18363. , o = new r.Raycaster(this.position,i.clone(),0,t)
  18364. , s = o.intersectObjects(this.model.colliders);
  18365. n.raycastsDone++,
  18366. this.model.panos.setNeighbour(this, e, 0 === s.length),
  18367. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  18368. }
  18369. }
  18370. .bind(this)),
  18371. this.model.panos.neighbourMap[this.id]
  18372. }
  18373. ,
  18374. n.prototype.worldPosition = function() {
  18375. return this.position
  18376. }
  18377. ,
  18378. n.prototype.addTextSprite = function(e, t) {
  18379. this.removeTextSprite();
  18380. var i = document.createElement("canvas")
  18381. , n = i.getContext("2d");
  18382. i.width = 256,
  18383. i.height = 256;
  18384. var o = "Arial"
  18385. , a = 60;
  18386. n.font = "bold " + a + "px " + o,
  18387. n.fillStyle = "white";
  18388. var s = n.measureText(e).width;
  18389. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  18390. var l = new r.Texture(i);
  18391. l.needsUpdate = !0;
  18392. var c = new r.SpriteMaterial({
  18393. map: l,
  18394. color: t || 16428055
  18395. });
  18396. this.text3d = new r.Sprite(c),
  18397. this.text3d.position.copy(this.skyboxMesh.position),
  18398. this.floor.add(this.text3d)
  18399. }
  18400. ,
  18401. n.prototype.removeTextSprite = function() {
  18402. this.text3d && (this.floor.remove(this.text3d),
  18403. this.text3d = null)
  18404. }
  18405. ,
  18406. n.prototype.isAligned = function() {
  18407. return this.alignmentType === l.ALIGNED
  18408. }
  18409. ,
  18410. n.filters = {
  18411. inDirection: function(e, t, i) {
  18412. return function(n) {
  18413. var r = n.position.clone().sub(e).normalize();
  18414. return r.dot(t) > i
  18415. }
  18416. },
  18417. inFloorDirection: function(e, t, i) {
  18418. return function(n) {
  18419. var r = n.floorPosition.clone().sub(e).normalize();
  18420. return r.dot(t) > i
  18421. }
  18422. },
  18423. inPanoDirection: function(e, t, i) {
  18424. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  18425. function(n) {
  18426. var r = n.floorPosition.clone().sub(e).normalize()
  18427. , o = n.position.clone().sub(e).normalize();
  18428. return r.dot(t) > i || o.dot(t) > i
  18429. }
  18430. },
  18431. atFloor: function(e) {
  18432. return function(t) {
  18433. return !e || t.floor === e
  18434. }
  18435. },
  18436. not: function(e) {
  18437. return function(t) {
  18438. return t !== e
  18439. }
  18440. },
  18441. notIn: function(e) {
  18442. return function(t) {
  18443. return e.indexOf(t) === -1
  18444. }
  18445. },
  18446. isLoaded: function() {
  18447. return function(e) {
  18448. return e.isLoaded()
  18449. }
  18450. },
  18451. isNotLoaded: function() {
  18452. return function(e) {
  18453. return !e.isLoaded()
  18454. }
  18455. },
  18456. isCloseEnoughTo: function(e, t) {
  18457. return function(i) {
  18458. return e.distanceTo(i.floorPosition) < t
  18459. }
  18460. },
  18461. hasMinimumHeightDifferenceTo: function(e, t) {
  18462. return function(i) {
  18463. return Math.abs(i.position.y - e.y) > t
  18464. }
  18465. },
  18466. isNotBehindNormal: function(e, t) {
  18467. var i = new r.Vector3;
  18468. return t = t.clone(),
  18469. function(n) {
  18470. var r = i.copy(n.position).sub(e).normalize();
  18471. return r.dot(t) > 0
  18472. }
  18473. },
  18474. isNeighbourPanoTo: function(e) {
  18475. return function(t) {
  18476. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  18477. }
  18478. },
  18479. isNeighbourOfNeighbourTo: function(e) {
  18480. return function(t) {
  18481. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  18482. var n = e.model.panos.get(i);
  18483. return !!n && n.neighbourPanos[t.id]
  18484. })
  18485. }
  18486. },
  18487. isNotRecentlyFailed: function(e) {
  18488. return function(t) {
  18489. return Date.now() - t.failedLoadingAt > e
  18490. }
  18491. },
  18492. isOnVisibleFloor: function() {
  18493. return function(e) {
  18494. return !e.floor.hidden
  18495. }
  18496. },
  18497. isPanoAligned: function() {
  18498. return function(e) {
  18499. return e.isAligned()
  18500. }
  18501. }
  18502. },
  18503. n.sortFunctions = {
  18504. distanceToPoint: function(e) {
  18505. return function(t, i) {
  18506. return t.position.distanceTo(e) - i.position.distanceTo(e)
  18507. }
  18508. },
  18509. floorDistanceToPoint: function(e) {
  18510. return function(t, i) {
  18511. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  18512. }
  18513. },
  18514. choose: function(e) {
  18515. return function(t, i) {
  18516. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  18517. }
  18518. }
  18519. },
  18520. n.scoreFunctions = {
  18521. distance: function(e, t) {
  18522. return t = t || a.navigation.distanceFactor,
  18523. function(i) {
  18524. return e ? e.position.distanceTo(i.position) * t : 0
  18525. }
  18526. },
  18527. distanceSquared: function(e, t) {
  18528. return t = t || a.navigation.distanceFactor,
  18529. function(i) {
  18530. return e ? e.position.distanceToSquared(i.position) * t : 0
  18531. }
  18532. },
  18533. direction: function(e, t) {
  18534. return function(i) {
  18535. var n = i.position.clone().sub(e).normalize();
  18536. return n.dot(t) * a.navigation.directionFactor
  18537. }
  18538. },
  18539. angle: function(e, t) {
  18540. return function(i) {
  18541. var n = i.position.clone().sub(e).normalize();
  18542. return n.angleTo(t) * a.navigation.angleFactor
  18543. }
  18544. },
  18545. inFieldOfView: function(e, t) {
  18546. return function(i) {
  18547. var n = i.position.clone().sub(e).normalize();
  18548. return n.dot(t) > .75 ? 10 : -1
  18549. }
  18550. },
  18551. optionality: function(e) {
  18552. return function(t) {
  18553. var i = t.neighbourUUIDs.filter(function(t) {
  18554. return !(t in e.neighbourUUIDs) && t !== e.id
  18555. });
  18556. return i.length * a.navigation.optionalityFactor
  18557. }
  18558. },
  18559. penalizeHeightDifferenceUnder: function(e, t) {
  18560. return function(i) {
  18561. return e.y - i.position.y < t ? -20 : 0
  18562. }
  18563. }
  18564. },
  18565. t.exports = n
  18566. }
  18567. ).call(this, "/js/objects/Panorama.js")
  18568. }
  18569. , {
  18570. "../enum/AlignmentType": 17,
  18571. "../enum/GLCubeFaces": 25,
  18572. "../enum/PanoRendererEvents": 35,
  18573. "../enum/PanoSizeClass": 36,
  18574. "../enum/PanoramaEvents": 37,
  18575. "../enum/RenderLayers": 41,
  18576. "../enum/RenderOrder": 42,
  18577. "../enum/TileDownloaderEvents": 45,
  18578. "../enum/Viewmode": 51,
  18579. "../exception/BasicException": 55,
  18580. "../scene/SceneRenderer": 158,
  18581. "../settings": 166,
  18582. "../tile/TileUtils": 174,
  18583. "../util/ajax": 181,
  18584. "../util/common": 185,
  18585. "../util/lerp": 188,
  18586. "../util/logger": 189,
  18587. "../util/panorama": 191,
  18588. "../util/texture": 194,
  18589. "../util/transitions": 195,
  18590. events: 202,
  18591. three: 217
  18592. }],
  18593. 149: [function(e, t, i) {//"./objects/Reticule"
  18594. "use strict";
  18595. function n(e) {
  18596. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18597. t.map.value = d,
  18598. t.opacity.value = 0,
  18599. t.color.value.set(o.reticuleColor),
  18600. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18601. side: r.DoubleSide,
  18602. depthWrite: !1,
  18603. depthTest: !1,
  18604. transparent: !0,
  18605. vertexShader: c.waypoint.vertexShader,
  18606. fragmentShader: c.waypoint.fragmentShader,
  18607. uniforms: t,
  18608. name: "waypoint",
  18609. opacity: 0
  18610. })),
  18611. this.layers.set(h.RETICULE),
  18612. this.renderOrder = u.reticule,
  18613. this.player = e,
  18614. this.direction = new r.Vector3,
  18615. this.hidden = !0,
  18616. this.mouseLastMoveTime = Date.now()
  18617. }
  18618. var r = e("three")
  18619. , o = e("../settings")
  18620. , a = e("../util/transitions")
  18621. , s = e("../util/texture")
  18622. , l = e("../util/lerp")
  18623. , c = e("../shaders")
  18624. , h = e("../enum/RenderLayers")
  18625. , u = e("../enum/RenderOrder")
  18626. , d = s.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAQABJREFUeAHtfQl8HMWVd1V3z4wky7KNjDFgwI4xR7htGccHhwMxkswRQmKSkCWBhGw2ybebQE6yuzj7fSEkBMLuJtlkIUDIQhYnhGDQYQdiDttgPDZgIBzGsQwGbGNZsmxZmumjvv9rSUYzmuo5NNPdI1X/MJqu89Wr939d9epVFWPqURxQHFAcUBxQHFAcUBxQHFAcUBwYRRzgo6itI7Kps+LxyGRx8lG20KcxTUzhjE9Ep+IfrxVc1KLRE7lghwjGK/E7yjiLIT7KBIu5731cSSI8IRhLIjyBoCRnokdwtge/d3PB2wUT+Md24+9u5vDtOre37uAvvbWhrs7sK0L9vxw5oBRAmfTa+fGeo6M8cioAeKom+HEA9zQAcyqAOwVN0AJphmA26n0btLSBlq0OF69D8WxKCnPTo3WVbwZCk6o0Lw4oBZAXu3xJzBfFE8dHBJ8vuDYTX2KAnp/CORvnS+1FqkQIthe0vwjaN3HhbDS5WLOyLvYaisdAQj1h4YBSAAH3REPz5piYNHW2zhgAz+bjSzoPX3Uauo+8R7B2jBbWYkqyBkOHNXxX2/qWxhk05VBPQBxQCiAAxjfEe6czoTVwzusxZF4IwFcFQEbwVQp2AFOaVUKIVsadlpa6ii3BEzW6KFAKwI/+XrZMXzzt0oUO5xdrXNQzxmf4UW351SE2O4K3akIsb9r64Cq2ZAnZGNRTQg4oBVAq5i5dqtUv/t7ZGueX4wt/GRh9aKmqGonlwlDwHqwFDzhC3N/a9IMn2dKlzkhsZ9BtUgqgyD1Q/2xytq5rV8II9nEY7iYXufjMxQksz3GxFfaDNgyp3wF42jVatuNit2Nr7Rhi79Z0Z7/tOElm2olk0komYvsTT29/OkkFzp0yNxpLVMeiUSPKInpM17Qo8lVjijIR+WpR7kQHy4oQFvzjR6DcqQibBsU2MTNBxQ0FL3eAl3+wbeee1jOj64tb+uguTSmAIvT/uas6xlfVjLkC4LgGw/vTilDkkCIA6gQT4hXG+YtciE2C81ctx25L7t/bNnbsofR1nGgZMB7a1gTQMIY7rJoZDH95tRBONQyMFQCRDgOcgbT4xw0Ai36jSGbBOI9/zEI6C+E20vVyru0XmtiP2G6hsf1I0810o8OwWDvS7t637z0tWj1uqqHpUAjiBNB0Kmg8BQWeCMEiP4MSPOIFKLnbD3R13/v4wgmdJahgVBWpFMAwurs+bi7QAHow8RP4GpKjTVEeANBiXDyPIfAaJpx1tmCbdmvR1w/R2KG6ZR7JdDFFF/zw/q/yRHypK4pScZ6FYGTRC8W0W2PabptbO6A2tttG5O09DntvopM8TufsVMa1OeDNfCb46VA0rsLJs5rMyQXrQd2/d6AMWusiqzMnUqHZOKAUQDYOpcfDoNcw9ZKPc137Br74denRhbwD8L34uj6JvE+hQ9bsYMa6ccmeCTEjcizXaajNp+DLejjiigegQgjNMQ+ACQXG3wXN24UttiYs84290cqOycyag7j5KOYsjDvOhkIoiuLCiCAubOcnLW0P/UEZDnPspP5kSgHkyK9zV+2qrqwZ/wXOtK+BacfkmM0jmdgM4LcIWL13cf0J+O4ewR37OF3n04XjTMdXvWgjCg8ifIvCaKGHa9oW2xZbhKa/Dp/idyYJ+xyOVREoggYohGGvjEC5bBPMua2nq/OOxxdOwpRFPdk4oBRAFg658/ux1dcBkF9F0vFZkntGAwTr8FW8X3BneY/e015hV5+MJa+T3DnzCAO8JyMQSQoB/3sFS6Mv9+r7X6q0K2Fs1C4GLy4Hr+dky58lvhPl/+zAvv23KDuBN6eUApDwZ/7q98bWVIzH154D/MNxwxUb8GW6n/Vay1ikIsF0uw4Gs5kQ9CMlVY/OYCGwp4BvZLYeZ2ZvjFUYSyCcl2NkMKtQhmCEtRfTg1u6ejtvW7Pg0H2FljOS8ykFkNa7i1bsGBOprcXXnn8TxquCXHIheDvwjbvLTtp3CmF2adHKOpjf6xTo05gte4UysAWPO8meOOeRGj2qX43+uAqKuLBlVbggoz9uNtvbf7bygsndsmpHY7hSAAO9DsedhsXXf07j2o0A/mEDwXn8hUFatMIyf7txhL7SfMeaiS16Z2E4OzWPMlTSNA5gKN+GNc6nIkcYG6137EXwb7gGihTelAXsgBRspyOc61uabrxbORb1MVopAPCBlvOwGeffIVgz0+Qvl1eab/7ScsxfYKnLMCKRBfjaYJgfzNJcLgSXYxo4H2GlhMct01yNJVLL0CJfhnL9EtqSv11GiI3wMf4ntXwIjpajMBSLZnePPYvcjKHlknzLxLy+DWv0twkrcpfg1klaRDsPc/uj8i1Hpc+fA7AVvOWYzmNcGC9zw7wKvga0MjM135IwVVsG18hvjuazC0alAjh31SpjzNgF10H/3QAVmNdyG772z2Hn2k3bjWjTUZa1AIrgwzAU5v8VyldaVfohHICBrxMC/Je3DGP1FCu5GDssv4NRwRlDEnoFwKEII7bvd+9bjRWDheQNOaqeUacALognZ+qM35G/oIiXsGa/NMm7Ho2xmkVwkV2ghvnhwApND+DyvDrBulZGRc358C1YiuncyflQR4rdZuILK+qiG/PJV+5pR40CmLv2rcoJkcnfB/CvxVcfU/7cHgjGaxjqf7/djjYdEoURSrBzkDOaW26VymcOJB3OntiT1FfW6hgRcO0G9PfxOdOAPRDo71s7zB03PD3vKIwMRv4zKhRAYzw5B0bjezHXn55rl2J+uIdz57vdFZH7KnqTH9GFvhCKo0QbXHKlSqXLiQM42NTm9qreiuifx/SanxZC+yH6/pCc8iIR+n4LY84VzXXRdbnmKdd0I14BNMbNazHXvwkCEMmlkzCnx9SS3ZkYo387esA6DQy6GHP8vOwEudSj0pSeA/ia08nGy3uqjU1V++yboMCvRn/mJPNQAjjtWHynuS5ya+kpDa6GnJgRHHmF13zB2r2HGLGqu9DfF+deinjBttg/6Jq9U+iRTyurfu6cC3NKWjXgtnmf7eiH6Qb7L8hEHlu2xXIrceCqFfPG0RHpI+4ZkQqgfp05F5tq/he6/uhcegzavgtDvn9tt/bdVRsddwlGAPNz/VLkUr5KEzwH3JEdZ2vak3sfqjXGXoUp4b9hVFiTE2WCvelw5/KWWdFnckpfRolGmgLgi+PmdTiKmuZ8OW2dBfh/Z7PEdZxFp2ucfQzD/TFl1H+K1Dw5gPldtyPYHwVLbtFZ7BbIyadyKQJyYuGY8+821UVuQXrok5HxjBgFcN66rtqYXvkbWH0X59Q1QrwKi/FXbNvYbGjWFcg3Lad8KtGI4ADsA1stx7hX160ZWNn5OZYNT8ilYcjXlLB7PvvYnBo6FansH7irl/+z+FlzXkyvei4X8PcZ+cQtnb2dZwqHTzI0+3oF/vKXgXxbQH1OfU8yQLIA0/8trmxkKYhkjGSNZC5L0rKILvsRQL+V/0e5DPkxjNsDu8BnuWP9VXD9GnRmzktDZdGbisiCOICv+h4u7NuFZnwQg/vfQJayygVNCTAT+Ha5rxKU8wiAN24wbwWIaR6Xdb6Pud9ay0mejs5O4mDLbyjwF4SVEZnJlQXIBMmGKyOQlWwNJZkj2SMZRNqy/ZCWJeHujbjs9LvA9iuydVTfsE7cLGqMH7BO80pN007JlkfFj14OOI7zIhsfuYd3Wd8Drr8JgGTHiGD37mDPX1WONyVnb1zIZKH/wI4HYLS5ICtpOAgCJ+peybn1msZ02keOI7PVoziQhQNCdDgMUwJhHI+Tje+BCsh+MIwQK3DgyGXlduBIWSmAc+NdE8ewyiYA+cwsXYjpmVjtWOantEiEztyjtf2c/f+zlq0SjHwOcFx9LsRDjmm+rBmR30GGcM5DlkeIZ3vtnsZyWiEoGxsA7d2vYpU4DMIb/DTkx3NTgu27UDOMSzGC+5gCfxbBVdFDOeB+MPjHSIZIlkimsq4SQDaxFL2GZHVogeEMKYsRwKL1iZMjmt4KFh7pxUZYZuG/bX8OBr91GotgyC/UkN+LYSouNw4IjimBeTucxLCpTL8bBsBs+0reNh27fuXs2Eu5VRBcqtArgIb15nxN4w+DRZ5ghnbuhpb+GHfELqZrOL8/aycFx3VVc9lxAPJlMtu5Q2h8Eqz/f4R8ZfMY7XAccVHL7MiaMDc21AqgYb3VAPdcGPyynNqDyzFx8WUj03gMV3XBq6+AAyPD3EuKtlBwACNMBye/3ssckcAFqs2Qy4mehOG0IbgdX9Yy22jxTBdgZGgVgPvl5/zP2cAPzbzNcSysCBjTdY1dEiAvVdWjhAO2wx7C7WdbNM1YAQAd49lsVwmIj4R1JBBKIyDN+d1hf9Yvv3jJ7NHhkmmcocDvKYYqsogc6JM14wxX9oTwnudDhkmWL3g2cVIRSShaUaFTAGRB7Tf4ec75aZnPShrnRMbYjeiQhUXjiCpIcSAHDpDMkeyRDJIsZskywdD1FWFcHQiVAqAdfVFmrAQzPa39WOlbnphgXGjEzCu5w2ZnYb6KVhwoCQdI9kgGSRZJJrNUciTJNsl4lnS+RodGAZCHX4Ve2QwLq+chjjDE3LNDGFfGOq2v4FCHE33l1gioDDYT8pPoxVJpJ5ZJd9A/+t0XBo8J9eTJAe1EkkWSSZJNr8wk2yTjJOte6fyMC4URsM+3/7SH4eSTxb1XLCdG457565D2MD8ZFfa6yEKN47GxR11zQY1bh3eawnkvxqIHEhHW65gdiciuCb0tjTzh1ZaGZhEzJ3VUaJEJsZjJcJtpsirCtUNxi+9huPkId/M5k3Eceq1aaUnjIvi9gxm3TOYWlECWY+jgNryDvXBRGPYOhEEB4BQf67ew9l+RxtLUV8yzaKjV9+Xn3pbX1Jwj7g1f7B4AfTPAuIVpYodtmztr/la16/dLOG68Kv3ziWVC7/rAgUm6HjmMOaQUNJy27MyAo8woPzxVbEuMN34e67AewQfK23UYG4ia6oy/Q28FOuoKXAG4W3oZ/7qn2MLSSsYWI+ZcCX6NxmF/EpeSvIFV6NeciPVq6+kV2yBggQrOkP4CgfXP9x6jmcYJTNOOB3nHIs0ovD+Bv2IltHuMqPUE+sjzchIo8p82z4pcO4SXPgYEqgDoMA/aU+3VXkj5NlpuMSrtxTBY1HmlHUlxEI53MZSMm6b12vg3Y3/z6+teLB7SKKHz6MQHIhEDNh1clsr44cUqO+zl4DbjuNWjN0Uq7bUAmOdoFbaX64I8VCQwBUCOPgD/43SwgrRDycNPWBhKuev8C6XpRkqEEPsw117PuflM88zKbSOlWdSOxo09xwgR+RCOWj8T/V49ktqWqS1wFloFZ6HndG5gA5vcYxC2GwtK4NygHIUCUQB9B3jSGX5Mepsuvvzdju0sxPVOh45kJx+008TXcZPNrGdatzz0MluyxJd5fCah9SVs2TK9fvolJ+nM+BBGOadCALNtrPGFrFJU4noMwhCr6doqtFNq+YcSeCthHzgjiG3EQSgAjqH/w/gKLJYxHQwxIRwXAhwHdM7JUDLiHrLYY5/DyvYeY93T8ziMeqPvmbtWVNZWWnPgL7+IVhZGIgdw2eBvAbIqKPlH8MGTKjuMApowFbgIPIDY+/f4rgBg9MMxS/zHsiai9cC+/RlYl/8KY9Lfj7jlJiwXMYe1NrU9uG7Ef+1lnZwejlHB4qmXzsEWrnoYzkbU8i4tz8J4+yus1nyQcf1/ADgp5iD434JR8OZ09pTyXUpMKSqlG3s0nT/pNe+HJvwhLmn9NefG10GcVGOWgr5SlukIsZ3boqV5TmQDZMBXLV/KdhW3bMEb15mzhM6xC5RPKW7ZwZWGzjaFsH6KS6k/j5Hvd2WUkD3AscXZrXMiT8vSFDvcNwXg3tUXHfMc9J/8tBRa68fpKzE27rsj5TAPKLQ2hxtNrbP4pmJ33kgur36DOFUT1mIAZuqIaCcOFUmwvT+MsbHePgK4hsxKdp/h112EvikADP2XY+hPc5zMDyz+jpU8Q4vGLoWzquf6aeYCQhYKi76tsQdaZ/qnzUPGgaKQU78R9zw67DJMDcYWpcAgC+H8JSeZeFAzovQhlJ4lgKnAw5gK5HGpbeGN8kUBZFvvp3m/cNhiLBHhvg5+aeHNCT4nrqPGnI89pTP9Tw/X8QPBU1T+FFwUF1U2sz8KG8FZmDyFZv9KIZwVtngQS704nZ49AvBJ8Qco+OIfICWgkMZlytMYT86Bq+hTnhZQJn4shP3fOGDhOpgAy/j0XrFNcOPe5pl8WyZeqLDhcaBxoziGCwsu42XsCo7ThnGADS6z0b+IEfG3ZByhlTC4V5/VXBddJ0tTjPCSKoC5a9+qnBA9/EWAH77imR8Md9bi0o4Gba91PYZ53mcAZC4iBKHiAC4a/VPLTONJZeArdXcI3rDROhsXen4UvK4qdW0lKZ/uHRhn3IjLR1qgBKR3DEIJbOlIvnvK0/OOKtkycUmHUxMik7/vBX587dst2/wk64KPf7mCn/PXE8JY2jIz8oQCf0ngklYoF8Rr4jlk5vW0yPJ4JVmHzJPsA+R7ZEQTdghDsvhihJdsBHBBPDnTYNqzmOVkHNLTvB8NuBhznSSWfC4rRmP8LMOd69ustblOXw5BpLaox28OwGTUGLcvhoTVl6NtAEvDD2CVgzZMwUAusQdgTdxizpkr6qIbS8HekowAzl21ytAZv0MGfmoIgH8L3dKL89IwlCu3R3ThNtn/aJ5tPKTAH2DfQfFSH1BfQKK6AqSkoKpJ9t2bqoEFaQH4gBKWCFPSNMOIKIkCGDN2wXXQbGdI6RLi1a7ezn8Tun5NuRn9BOevJcS+/9c0K/aKtH0qwlcOUF9Qn1Df+FrxcCuDwZswQFjAF/FVWXGEJcKULH444UWfAtDBhzEWeRVff+nhEDhb/Tzh8EnldJgnTVlgvW1urYvRyUVqyD8cqStVXjqTIJ64CKtJjdIhdanqHka5tHOQa2IX7rR4TFoMjhdPMPOER+sq35SmKSCi6COAKIMvswf4YfS4z7aNzdgIc04B9AaTBfMwzXHubJ1doeb7wfRAbrVCMVMfUV9hZFk2uyoJC4QJYON30oYCUy62pAkKiyjqCKA+bi7A7r2nZKSggV02S5ygs+hnMayZJksXqnDBEo6m/7JlJjYnqadsONCwUXxQc+wv4WMUKweiYRPbarPkb3QWexXW/xoZzdhdeFZrXSTbMeSy7EPCizcCWLpUg7n/34fUkBLg/Atn0enlAn50yn5bN29V4E/pxLJ4oT6jvqM+LAeCCROEDTj//KsXvS7GgDWvNPnEFW0E0LA+eTX8G38tqxwd8Xy71XVObaRmKZwfpIcjyPL7HQ569yQs47bHPsR3+l23qq94HDjvGXFYzLC+BoAdUrxSS1MSnOK6282upbVGzROg93RZLY7jfL5ldvROWXw+4UVRAHTOeaR24hYMtzLu5XYNaJaYr0X4sTCfeZ+Wmg/1pUorxNvd+v7/ePyMCZ2lqkKV6x8Hzn2uY/wYu/ofYbw90r9aC6sJ/iWrHVO8oRl8DcCZGZ+C7TTbd09fecHk7sJqeT9XUYYSkdrar8rA71Yl2J26Zu+EYWb++1WH9BfArzHjJwr8Ie2fAsiivqQ+xVLb2wVk9zcLMNKPFfkXHh9aF3NFoCyzhsmj4Pmr3xs7vmLCViiAjEc6katjYox+XKzH+Qfs9jsqj6J9T0rD/gP6/h8p8PvOel8qpJFAlV397bBPB+DP8FaiUvuvWLf9OgyCmacucKPv7O2YtmbBofuGw7xhjwDGV4z/ugz8RBjnznejB6zTygD8+2nOr8A/HHEKd17qW+rjsBsGCSsuZoAdKUfxwa2pGP81aXyOEcNSAOeu6hgvGL9WVhcY/Vp3ReQ+DDN8OdxARkfWcFrq063/VAa/rJwq+wTUx9TXmI4mwtwY2MouJuwQhmR0wph+HWFQFp9L+LAUQNXYarj8snGyihzhLK3oTX4EhEq9AmV5fQuHwwit87eeUdnmW52qokA5QH1NfR5mZyFMUyoJO4QhGbMIe4RBWXwu4QUrgHNX7aoGkV+VVoLrvDrsaDOcnRdK0wQcQasTXDh3q3X+gDsigOqpz6nvSQYCqD6nKgk7hCEYL1+SZSAMEhZl8dnCC1YAlTXjv4DC5cMPh99wSNReBPtAaD2x0PNNj8yOPpuNSSp+ZHKA+p5kILStA3ZcDAFLHjSO78eiRxJ5VGEKAOe4c6ZJDRCYtzyX0Loew6kt58irDjYGltbXWmbqjwRLhao9aA6QDJAsBE2HrH7CEGGJMCVL42IRmJTFe4UXpAAapl7ycRj2jpEWzJ2borzmAsSH9HZY0ZV09v5a7eqT9uDoicAGIlcWwnueQDTGajCSdm6SdQphkTApi/cKL0gBcF37hqxQDKnathvRJpzrH0qnH/ckH+bc+WjdIXtlbVDho4sDfbLg3NknG+Fru9DEAsIUYUtGnRcmZXkoPG8FQDv+YNWvkxYqnNumJCwc38wrpGmCjMAxXuowjyA7IJx1uzIB2QgjdYSloyzckg1syegjTBI2ZfGy8LwVAM7v+6KsMIR3CityF85oC6flH4dIumf4eTRARY1eDvSf7xjKg0bx9f+wiy1gTNZDWbCZMVteCoCcDuCgIJ1rwFDxS8Gtk6CN5KsDGcnwI1AcwMZ+nFOoTvPxg9tlWQdkw5URJkJ3oQthirBFGJPxlrCZr2NQXgqgsnrMZ7CsJ3PqcSzH/IUW0c6TERhkuGOzPz1ax9W8P8hOKIO6SUbojocwkkrYIoyBNicjfcBmVc2YKzLGSQLzUgA4xZTW/jM/QrTCrcYIo88/joprazmTLu1Qj+JAdg7QBS8kM9lT+pvCxRYwBscgqa0CI4Vr8qEqZwVQ/2xyNrb2nCYr3GH8diMSydsIISuvWOGuZVfT7gPtmEapR3EgFw5AViAzYVwVIIwR1uSt4Kf1YVWeYnBMzgpA49pnB2cc/BtbfncYR+grucOgJEL24KJOdVdfyPqkDMhxZQayEzZSCWOENcKcjDZd166UxaWH56YA6AwyjiuapY+4y3nXmhU6t19c0U239ErJVhGKAx4ccGUHMuSRxP8ouAe7WGPiLlnlUA4fZzmeGwgnouzP4ri5ENbzv8hSWglrhh7VP4GNCVNlaYIIt7m4u3Vm5Okg6lZ1jgwO1G805+qCfy5MrcFKQJudtH9vxIzNUrqE+HBTXWSVNL4/IqcRAPb8L5EXJDYIYXaFDfzEJAV+ea+pmNw4QDJEspRban9SEdYIc9jIuEFWozdm38+VXQHQJgOP4T8sa/dr0Uq5Z+D7dfn6y+FGeHd5+coJVdlwORBGWSLMEfakbSPM5rBBKKsCWDzt0oWYJxwqrajXwtZAESoFgFtXt7fO4pukNKsIxYE8OODKUsgOFHUxB+zJmkGYJezK4gfCsyoAh3PpcV4YGq1jkYoE7ANHDhQYhr/cFi1hoEPRMHI4IGzRHKrWEOaAPReDEsK8sDuQJasC0LioH0g85K8Q9zPdDtXXH04SO5vnRKRzoyFtUAGKAzlwwJUpyFYOSf1LQtgjDEoeT+z25/FUAA3x3ulwoJkhKR+Of85yeCfNlMUHEu7Qji7l9BMI70d0pZApV7bC00jCHmFQThGf0YdheQpPBcCE1iDPKjb36D3tYRr+44C/9qa2B9fJaVYxigOFc4Bki2Ss8BKKnBPTABeDTHgsB3phOMt5AFhukA7/4WzQUmFXn1zkJg2rOFyzvJItWVI210IPq7Eqs/8cgGy5MuZ/zdIaCYOERVkCLwxTHukIoKF5cwwbC6RWRGyWaNWEOElWsd/hWBIx23sM9fX3m/GjrD6SMZK1sDSbMEhYlNFDGCYsy+KlCkBMmjob6/9VmTJC4/Tu4voTGP6fmCk+iDA0dNPT83hPEHWrOkcPB0jGSNZC02JgkLBImMxIEzDsYjljpMcIAEeMzpfkQbB4ciJnR2B4USlP42+Mzaxn/K1R1TZaORAmWSMMEhYJk7L+8MKyfATAvRQAe4o79nGyCn0Px4aN1i0Pvex7varCUckBV9ZCtEmoH4vSnYvY1iz9mMsUAA5H4vNkvQsvozW6zrFEGI4HDg/rlfEvHH0xKqiAMdCVuZA0lrBImJSR049lJBn6ZFQAi+KJ4zH/rx2aHAMNwawdDIYQxwmNAuDcVMP/TJ2lwkrGgTDJHGHRxSSwmbHBwLKL6QyRGRVARHDpkAE+Ns8fbrAJYZn/CybebZ5ZuS1D21SQ4kDJOEAyR7JXsgryKJiwSJgkbMqyyTCdUQEIrsm9+wRbYyetY2UV+R/O4/7XqWpUHCAOhEf2XEwCm7J+kWE6owLgTJwqKwiXE6zjuviANN7nCJvpr/pcpapOccDlgGlaoblT0MUksCnrGhmmMyoAHCZwiqwgYbMXGNePlMX7HJ6s2cK2+lynqk5xwOXA+Ddjf8OPZCjYAUzagkn9E2SYHqIAzo/3HM05G5epUfCASrw59o03YAk8PFO832HwgHrj90u4cv31m/GqPpcDJHskg6FgBzC5fcwbmwmjmeghTBO20+OGKIAoj3gM/8UrRyQ+CL8DZqQXFMi744RmCBZI+1WlwXMgJDJImCRs4uP8iowpmbA9RAHAsilXAHCB1GxziqwCv8OdiKXm/34zXdWXwoEwyaBumZiay92UM2F7iALQBJd6+MGQ8CLXRCjm/2hMT+vpFWr5L0Uc1YvfHCAZJFn0u96M9eliCmE0YxwCM2F7iALAfudpsgIE56/iiORQzP/RnM3YjIQpj3oUBwLkgCuDkMUQPIRNwqiMlEzYHqIAcMyPVAFYjt2GIcZEWQW+htvOFl/rU5UpDkg5EA5ZxJVhtX0YzUwoXIKnpsekKIBZ8XgE1kL5EH9Px1Z8cjO6CKcXXPL3iNhR8jpUBYoDuXBAC4cswhA4kQGjUpI5m0IYHxyfogAmi5OPQmRK2MHEgu2O1R6GEQavOBgW4A/bNncGWL2qWnHgIAfCIouETcIoA1YPEpf6Q+vH+MHQFLDbQpcO/zF/IM0SiuE/NiQ5NX+r2nWwFeqH4kCAHCBZJJkMkITBVU/sx+rgsIO/0zGeogA0XdAIIOOD+UObZYRk+M/EbuUAlLGbVGAAHHAdgkJyWChhlLAqY0M6xlMUALyapPN7jCveYbY1QVawn+G4DEEN//1kuKorBw5o4bBJAaMuViUUp2M8RQG4RgRZRsZwHDIfI4n2N1gPCbP9bbWqLcwc4OEwBBJGYaiXHl2ejvE0BSAfAeAokN3cYdVh6AOchKpGAGHoCEXDQQ6ERSb7MCpkRkCc85OK8RQFAJBLjXzwd2jHDoBQjABsx1AGwIOip36EgQOhkUlg1MWqlCmpGE9RADg8UGoDcGytnTs8FCMAi/eGw/VSymQVMdo4EBaZJIwSVmX8T8d4igKAY61UAcDwtlsIJxQKQEtYmc9Al7VahSsOlJgDYZFJwihhVdZcYPyQwXEpCgCHBkidfDTd2Q/tIY0fXGipf+t6tVIApWayKj8vDoRFJgmjhFUZ8cB45eC4FAWACOkVQsxyEpoIxzkAb46V3IIyuGXqt+KAjxwIi0y6GAVWPZqegvFUBcBZVJbRtu0kTIi4ZCTYBxrOefkkHo5jmIJlhao9RBwgmSTZDJwkYNTFqoyQNIynKACsEUoVQDJpEeiCPwnIEQr8ss5V4cFyIByyafRjNSMv0jGeogCwiSBleDC4hERsP4YVPHgFwNXwf3C/qN8h4kAoZJMbfViV8CUN46kKwGME8PT2p5PY8BC4AsB2ZWUAlPStCg6WA2GQTcIoYdWDEymj/HQF4JFPRSkOKA6MNA6kKwCp5pg7ZW4UGi7z3WM+cgUaLhRLkT42WVVVJhwIg2wSRgmrHixLwXiqAuCZzxSnwmKJatgHROAKAHYKpQA8eldFBciBUMimsPqwKuFDGsZTFAB2EaVoh8FFRKMGaZXgFQDnUkPlYHrVb8UB3zkQDtm0+rGasfnpGE9RAPi6yh0IInoM65yBKwAsY/CGZqGUQMbuVYFBcYBkkmQzqPoH6nUxCqwOvA/5m4bxVAXgMQLQNS2KOU4oruEyJ3WoacCQnlUBQXIgLDJJGCWsevAiZZSfogBwqYB0lx12GFVjI0EoluC0yAS5hvNouYpSHCgVB8Iik4RRwqqsnekYT1EAGD7skWbkfCLnmnSTgSxfKcJjpjIEloKvqszCORAWmSSM4nRg6bke6RhPUQDQHtJ9xNhhVCs0EQoFkGDJqsK7SuVUHCg+B8Iik4RRwqpHC1O2CqcoANgwUiIHF4KTRifCBNg9OCyo3xGuHRpU3apexYFMHAiNTAKjLlYzEYkwxKV85FMUAE4TTYkcXAZdOyQ0FooRgMP5YYNpU78VB4LmQFhkkjBKWJXxIx3jaQpAeqMIrW+gUBGKEQCzncmyBqpwxYFAOCB4SGRSdPdhNTMX4AeQMspPUwAeRwkxfgTTjY7MxfocqoWF2T63W1UXYg6E5KMEjOLk3yNkjMIIQK4AmMO3SzNyMdWw5EZCWb5ShGMeU/uJZSLww0lK0TZVZvlxgGSRZDIMlBNGcTXYVCktaRhPGQHo3N4qy4gGTkNcivaQpS11ODY8aF0fODCp1PWo8hUHcuEAySLJZC5pfUizux+rGatKx3gK0Tv4S28hV+ZjjTibuG/fe7j/QITCGUjXI8oQmLGLVaDfHAiLLBI2CaMw2GX2A4CXYD/GD7IoRQFsqKszsR9AOg2IVo+bmm5EOFiS3z8cZQfwm+WqPgkHQiKLhE3CqIRKCn7bxfigBCkKgMIxf2gbFJ/y09D0qZrHUmFK4pK/aNNLXoWqQHEgJw6EQxY1pu0mjMpIzoTtIQoA8wcPO4A4webiXVkF/oY7MxiuOvW3TlWb4kAaB1wZhCyG4LG5tYMLcYKMlEzYHqIAHC5elxUgOD+V2fKVAlm+UoRjqaOy/vneY0pRtipTcSBXDpAMkizmmr6k6YBNF6OSSrAE+Fp61BAFgMZsSk908F2IU2wj8vbB94B/aKYh1XYBk6aqHyUcCJMMutgERqWs5/zF9LghCiApTLkC4PzEd2J/3Q1jQ+AHg7gN0bTj0xuk3hUHfOVASGSQMLnHYe8xYFTW/kzYHqIAHq2rfBOHCuzNVAgm3LEp3cfOQCWhsAPgGuRjlUNQpp5SYX5wwHUAggz6UVfWOoDJiU7yOMJoprSEacJ2etwQBUAJcGjAkKHCQEads1NhfJMuFQ6k8+lvtGs6Iwcl9SgO+M6BzqMTH0ClXqfv+EcTMOliU1KjDNMZFQBuEPWYBmhzhC2kKwWS+ksWrDNb2QFKxl1VsBcHIhEjNFNQF5NcmyOjV4bpjAqAC2ejrCAMD+brUeMNabzvEaLO9ypVhYoDLgfCI3sJy3yDsCnrGBmmMyoAk4s1soLgKXT6uxbrgNuh9PxAad4SRGDV4vDGjT1qObAEvFVFyjlAMkeyJ0/hXwxhcW+0soOwKatVhumMCmBlXew1uARnPBwEmx6MycyawzVti6wyv8OFiHzI7zpVfaObA2GSOcKii0lgM2OvAMsupjNEZlQASAf/JrE2Q3o3CEsO821bhEYBYIfSbLZsmdoeLOswFV5cDkDWXJkrbqkFl0ZYJEzKCujHMpIMfWQKAGeHMfk0gLGzhKZLPQaHVlPiEM7H1k+/5KQS16KKVxxwOeDKGmQuLOzox+JZMnq8sCxVALgBxEMB8LPhDfROWOwA1HCdGWoaIJMAFV5UDoRJ1giDhEUs3p8ta6QXlqUKgO9qWw87wIFMhcIOUDFJ2OdgovBKpvggwuDnfOrctSIcPtlBMEDV6QsHSMZI1nypLJdKgEHCImEyY3Jg2MVyxkgmP8WkpXFGAg1dJckHZ0BRj5NQX5bF+x0OD6hIbaUlXQf1mx5V38jkAMkYyVpYWkcYJCzK6CEME5Zl8dIRAGXA8KJVlhEap6FX3/+SLD6IcEewRcoYGATnR0mdMP65Mhai5hIGCYsykrwwTHk8FQDjTousYMw5ZlTalbXQEm/L0/gbg/3OtYunXqpGAf6yfdTURrJFMhaaBgN7LgaBRSlNnhjOogBa6iqw1Cc2ywrnQrsY+4/lXoOyjKUM1xiGQ+qgkFKyeHSWDZlyZSs8rSfsEQblFInNfRiWp/AeASCfI7h0GgBDwOW4jDguLz6AGNwa1LjOnBVAzarKEcwBV6bCdiMVYY8wKHk8sdufJ6sCgMPDckn5qJvPYWZvLEzTAKIVp7RL50SytqhwxQEvDoROpmjqDey5GJQQ7oXdgSxZFUDT1gdXwYXovYEMQ/5WGEtswUM1CtA4n1K/IURLNUOYpgLKiQMkSyRTYaLZxRywJ6OJMEvYlcUPhGdVAGzJEhv+AA8MZEj/iyWRy51kT6gUANGoCWtxOq3qXXGgEA6EUZYIc4Q9aXsIs4TdLE92BYACHCHul5fDZ3EeqcFyQ5s8jf8xGBpNrd9ozvW/ZlXjSOIAyRDJUpjaRFgjzGElTmrr8sbs+63JSQG0Nv3gSRwptOP9bKm/9Kh+NdYiV6eGBv+mO+yyi+KiKnhKFAXlyAGSHZKhsNGOq7ueIszJ6CKsEmZl8YPDc1IAbOlSOByxPwzOmPqbX6UdbmzArqPe1PCA37Bhw2b2RwOmQlVfphxwZSdEm36IjYSxyBEGlt75VTK2ulgFZmXxg8NzUwDIYdvOPYMzDv6NCidb79iLQFTobAFYuz2rcaM4ZjC96rfiQDYOuDID2cmWzv94HiesEeZkdXthNT1Pzgqg9czoeuifF9ILGHjHlWHXWKYZumkAtkJqXFhXKOeggZ5Sf7NzAC42kBmSnexp/U1BGCOsyWsVL/RhVZ5icExeDcTGgtsHZ075zXk9DhGwwDq6YThkDz+mYaMl3S4ZMmIVOQFzoE9WeOhGjS62gDE44Hht/pFjNANf81IAB7q678WSYE+GcihIM7TIlx3TeUwSH2iwJthHz4+LcYESoSoPPQdIRkhWwkgoYYswBtoy4xbYdDGaB/GZC5IU8PjCCZ1wMPi9JJo8A7/EhfEyRgqdsjTBhfOqmOZ8AV6LWD5Vj+JABg5ANlwZYTx0K0eEKcIWYSwD5W4QYZMwKovPFJ6XAqACHK9pAGPjuWFeBYT9JVNlgYcJcVxj3PbYPBE4hYqAADngygZkJEASpFUTpghbSDBeligLNjNmy1sBtNZFVkMbya39XPvaW4axOnRLggPN11n94g2JEwde1V/FAeKAKxOQjTByg7BEmGLAlow+wiRhUxYvC89bAVBBwnZ+IisQmmrqFCu5mDs8b2JkZRYzvM+yq119fnyPsgcUk7FlXFafLGhXh9HqT2wlLLmYArZkbPbCpCwPhRekAFraHvoD5hvbpAUL7TsJ1rUS8UlpmkAjeE1UG/d5ZQ8ItBPCUTnm/a4sMA7X2lA+SRdLwJSMOsIiYVIW7xVekAKgTQaCObfJCoah4oyYU3Oew9kTsjRBh3Mhjq+PJy4Kmg5Vf7AcIBkgWQiWCnnthKGoqDmfMCVL5WIxh40/mfIXpgBQUk9X5x34I7c4auL7e5L6SiwbSg8kzESQn2GaZjReuD55pp91qrrCwwHqe5KB8FCURgmwQxiCV9LStJjBr539WBwclvPvghXA4wsn7ceupJ9Ja+L85Fo9udjm9ippmoAjYK/AEW/a5xo2ig8GTIqq3mcOUJ9T35MM+Fx1ztURdghDWF8/WZaJMEhYlMVnCy9YAVDBB/btvwU7j/ZKK+HaDb0V0T+DSJnzkDSrbxGc6Zpjf6n+uZ6pvtWpKgqUA9TX1OeAfmivkyPMEHZg+b9BxizCHmFQFp9L+LAUQJ9jkJASgHnL8WN6zU/D9UZ6rFguRJY8DWcxzTb+z3nPiMNKXpeqIFAOUB9TXwP8sUAJyVI5YYawQxiSJcXS3y35Ov6klzUsBUCFdfV23oZ5fnt6wQPvQmg/TFYZL4Rzj8AAlRgHcl4dM6yvnftch9TR4v3U6lc5coD6lvqY+jrM9BNWXMwAO1I6gTkXe9IEuUUMWwGsWXDoPngG3CyrDtsWD4l12z/itnkflivwX3gfCMYhY+zqf1SHiIS3jwqljPqU+pb6uNAy/MhHGCGsuJgBduR1ipv7sCdPkUvMsBUAVWK2t/8M0N4prZCzq21HPwzDrjXSNGGJ4PxIh1nfUCOBsHTI8OmgvqQ+xTDvyOGXVuISgJF+rFwtq4lO/HExJ0uQR3hRFMDKCyZ3O8K5XlYvWVp1g/1Xe3LvQ5i3dMvShSYcglJlV39b2QRC0yMFE0J9SH1ZDuAnbBBGCCteqxNCON8jzBXMlEEZi6IAqLyWphvvhmcdjiqSPfy0WmPsVbhb7Y+yFGEKp6Ei5ovfUqsDYeqV/GihvqM+DPuwf6BVhA3CCL6Xpw2EDfkLjLlYGxJRWEBR10Dr4+YCnfOnZKRg6NJls8QJOot+Fp0yTZYuVOFwxnA0/ZctM/lfQ0WXIsaTA7TO37/UF2pr/0AjsOy31WbJ3+gs9irsZlK3ZFuIswrZ9DNQT/rfoo0AqGB3p6Bgy9IrGXinhqGBt1iOcS+UQU6HFg7kDewvLRE69leVx2BgPZB3xa6HH/os7Et9Aw0jLBAmCBte4Ee6ZcUEP9VfVAXgNihhfgsGQanjDxr4KV23ZmC488QAA0L/Fw4jjqZdXb++92K1gSjEvYWNPdRH1FcAf2idfNI5SFggTBA20uMOvgNTSWZ+8+B7kX4UdQowQNPiuElGl5sG3of8FeLVzt7OM8dVjL++XOZnA23AGu1rSWfvrx+tO0TuATmQWP31jQO0pZd29YV5Y08mZmDov2dvb+eN4yvGPwvMnJApjRsmxHea6iI/ksYXGFH8EQAI6d63Gi7C4jkpTWgoGnwDF/bt0NRZry+SlhNABAlYjI/9Z3WoSADMl1RJfUF9Um7gJ9knDBAWvMBPWCJMSZo/rOCSjACIogviyZkG06DVMg/F+p2CLkbjkrh4MXS3r2TjKlw1Haiu1uY6fTk6L9QOTtnaUrbxGPK7x3jhJJ+wHubhxVtc3/UARsBRpFkOIGbGomC2xZwzV9RFPVbYvGrxjstcqXeenGMb15s/5hqXzltg1NhjOcnTdW5comnaKTkXHKaEnL+OZYI7Hq3jakrgY7/Q6b39h7yG8gy/bKxwHOdFW1gPGVr0ecz9pR5/whE3N8+OfCtbeYXGl2QKMEBMh7njBoB8y8B7+l9quKFH/peNj9wD41pHenxZvOMQyRi3ljY8a55DXpxlQXNZEyk48Zp4DpkpS/C7sg6ZJ9n3BD+wQxgqZXeVXGAb48k5WGx4Cg2NyBoCD6gfC2H/Nw5nuA4rCGVjvU1vD0akbUzT7mueybelx6n34XPAva7LcbBDTkwdfmkBlYB5v+NYWO7Tv8gZl37Z8eE0beEsWDE7+mwpKS25AiDiG+PmtZjrSI0YZA9wHHahrgkYBPnHStngUpft2gYc3N7K9D89XMcPlLq+0VA+beRxL+rEXX3lONdP7SPxR9vhuqaxRwA+Kf4AiGubZ0d/mpq3+G9SAopdVeMGE4YOfpG0XGxvdKzk6ZphXIpDEKQnoEjzhy1CiH22xh5onRl5OmyklRM99RvNue4V3SG7pbcgHgrnJceyHtSM6POAfq28DLG8aVbkEnl88WJ8UwAXrN17iBEd8xwafrSUfCFWJ9i+C2Ns3HdxWNcEaboyisAqR5vDjabWWXxTGZEdOKn1G8SpmrAWY+Q4NXBiikGA4B0JtveHMTb2EawaLZAWKdibVrL7jBXzxu2RpilihG8KgGiuX2fO1XT+JOwBhqwNAMxNWPm4g3Pj6yBOajeQ5Q9rOJZ8tnNbtDTPiWzAyE8tG2bsKCzrrTNnCZ03YGl4SsYkZRiIzja5o98quHUNFJr8eG/BLMcWZ7fO8W/U6KsCoL6DlyDty5YeIEL2ANw88hnmYPONpv09lEVJVyp8lychdsKDoLWp7cF1dLy67/WHscJly/TFUy+dg57GDdN8RB3LBmOewxznV0zDwbNc/x8ATo45Ib4Jb7+f+NlFcmJKRwWcN8yHoQkXy6ogCyi0wIVQBgewu/DvZOnKORzXPbVrnK1s7zHWPT2PS/dOlHMbs9E+d62orK205sAXfhGOZ/aYE2crKbzx2L33W4CsCvavRzxXwoRoaq6LkI3M19FhEAqAnbeuqzamVz0Hhhwl6zpwoduxnYUwCB6qa8wXg4iMllKGo50mhGOTzaxnWrc89PKIHxXga18//ZKTdGZ8CEr+VAjgiJnmpcuJ7bCHsL71nqZrq9DOMenxA+/44L2VsA+c8dicmvaBML/+BqIAqHGLnzXnCY0/4WUPgC7cDW8pGEyMM6AEFvrFlMDqwcqBw/l6zs1nmmdWbguMjhJU3Lix5xghIh/ShJiNYf7YElQRqiIB/lWMWc/ByxWXerKJMuIAfos74pymMyNrZWlKGR6YAqBGNa5Pfp1r2q1eDcQXcpvZo8+LjLEbucNme6UdSXH4Or6L6WLcZvqrNVvY1t8v4WVlL/jEMqF3TWfTdGZjh5uowyjn8JHUP15tERpbb3brzZFKey0AdoxnWp/W+2U0BKoAiCj4B9wK4fi6jEA3XIiXrKRxjhFzroQwjcarvZPwMnwDxqTXnIj1auvpFdvwFYVuDNFDe/Gf7z1GM40TYLw9HuQdC+qiIaLQJ1KcV6wE3Hyj1hPoI09/Fij5nzbPilzrE2EZqwlcAYAqvjhu/RbDpCsyUjgQSD4CE4wLY53WV5DFU6sOZBmpfyE4MBpqmxlztsC6vMO2zZ01f6va5dcowf26f+DAJF2PHIbVmsmgZTpomQFFXjlSeZ5bu8S2xHjj57EOy3utnwoT7N6mOoMM3IEq8jAoADYrHo9MZqc9DI15gTejxfIdwrhyMrOuQ9oRtVzk3e7sse5yExO74UexE5ed7cBce6ftGLss3tujJaxeXa/ufXMs6335JO55ZftJL4vo0ftYhW3vr3BiRoXGtKoIDLGwTRwGL/bJWL0B3/nEEbc8m53F3inA7x3MuGUyt+4Bfy72TCzEih3shYs21NWZnul8iAyFAqB2LlqxY0yktvYvAPaZXu2GoN8DCf9HMHrUjwS8+CSL69urIJIYcfUCxL2UDjytwHeoAryPQSBCIxOyNoQvXGzDh+nnh3H7P8E872VrIZ7Fmf4fLtax3sPlRag6+9x418QqVrkaX5njvRsmlmOodWWs07lqlNoEvNmjYn3kAH8lMV67C1PTrF9+jM5eS9g984NY7pMxJFQKgIg8P95zdIy7SyLet7jAJgDD4CVazL4MroJ1sgaqcMWBUnEAx1rHnYT+AAx+D2H0JPfv7yPg7YQw5z1aV/lmqegppNzQKQBqxKL1iZMjmv4kfnpvCMLqQLLXuECP2WePCj+BQnpY5SkJB2id307oT0YrrBUAv6e1HwR0mI599srZsZdKQswwCg2lAqD2NKw352NDCO5HZ56WZZhQt+GABRgPjekj2WNwGH2sshaZA66HH7O24ACbFQCQ94oUjvPGRrCPtMyOhPJezNAqAOqzhvUWdoWxB7IpAddj0HEamcZjGuNXKAt1kSVeFedygFZaHCbuZY5I4ESPZsil1MOvLwOBn13WMttoCSsLMX0O70OMI+0JCr3PC0RH9PtbV+EKj19hVBD48kp4uaooK4QDrkxhVx++mFUka1nBD5nt+/KHF/zEh1ArACKQhk40f8LPt+ld9qBjxsAR5RFmiw8KYf0U53N6Kw1ZQSpccSCdA5AlV6awpZdkjGQtPUna+9sks2Ed9g+mNfQKgIgl4wlZUGkZZTDx6b8x9I/07bnWP7/b6rwRxpnQGV3SaVbvIecAZIhO8sH1Fp93ZcvjcFtqibvUB1kNo8EvE6dDbQNIJ5j8BMawyiYA29NZyM2HZULHMj/FtcjJ3IBnVhmfNpzOB/XuAwdweq+wxHLhmC9pRuR3OSzzEfqf7bV7GsO0zp+NU2UxAhhoxON1NbvJiwqMXjEQJv2LdVkcvvgc7vLjdAwz8qgpgZRZKiKFA5AVkhmSHZKhHMG/gmSznMBPbS4rBUAEkwsl+VHji34vvXs+MA5yjTXRGezOOONGh/EXPdOryFHPAZIRkhX33H7ITg7GPnz52b0kk2Fx782nE8tqCpDWMI6txLfAKOO9lbg/E3bQrbVs85O6FjlR0/hH1ZQgjZuj/dW9sEP8yXbMV9wbexiflwtL+rf0Xoe0WCgov6fsRgCDWCxoLzWMLtdhfdYaFJ7xJxTFvIgWxTFkuIzRtn6CM/l8OXY5IzEqMFQccGUBMkGy4cpIDuAnmSPZ69/PX5bgp04o5xHAQSEir0F03u+wCiA9Y3AgMXoK/SZu6ert/LexsQmL4Wh0jnIcGuDO6PrrOvYI9sS+REdTTcX4f4UMXQdAZMUE8r2FY7w+GdQxXsXspayNLWZlpSyr76DRyt+gExfnVI8QrzqcfcW2jc2GZsF7kE/LKZ9KNCI4gI/AVssx7tV1a4Ym2M9h6MPRZdkf5GvCjr7PlpuxT9ayEaMA+htIdoFvwAkIRhz55SODmQFtfp/NEt/gLDodo4GPYaqQzcljcHb1u8w4gDl7N9xz/yhYcovOYhj2s0/n0gQa8uM+l+sx5Kdz+8t2yJ/e1pGmANz20Q1Eus7/F4M5+TVkgziBzu3CkVb/0m7tu7s2Ou4SdO98MGZE8mZQs0fVT5r6oUfXtCf3PlRrjP0cFsD+L8BfkxMTcF2XbYtP+nljT050FSHRiBVyuotQj1XdjS86XbaQ04Ph3fOOzb6sa/ZOoUc+zYXIalPIqWCVKFAOYD3/LW6b99mOfpims19gund6rgRhxPCwnTjwOb/u6suVrmKlG7EKYIBBdDU5PuY3QdtHBsK8/rpfCsHuTIzRvx09YJ0GBl0MJeK5JdmrPBUXHAeg0HtwBNryZJXxQqzb/hFGAFejP3OSeYwKsaFMfAe39dwaXAtKX3NOzCg9GaWtoTGenIMh371QAji9NrcHArAHPoTf7a6I3FfRm/yILvSFEJ1YbrlVqkA5IFjC5vaq3oron8f0mp8WQvsh+v6QXGlC32/BlPCK5rroulzzlGu6cvYDyJnn1JEdyXdPEY64GTNBO5eMfQKj/aqqx4rjesfYbkv/Z6wa/Bl5PU/VzaVslaZkHEhSH1FfUZ+5fce0X+UMfsgGyQjJymgAP/XCqBgBDBa3C+LJmTrjuH6cnzE4POtvHD+GM/BvSGhdj8VYzSKhiQW40LIiaz6VoOQcgCNPL3f46gTrWhlzas7DXQnfx7JetmO6UujCdOE5m4kvrKiLbkyJGOEvo2IEMLgPqYMP7Ft9JtyBvoPRQM/gOM/fJFA6eyDKxq4S3ObbdeN6YYsHYSTq9MynIkvGAeI99YHbF+gT6hvqo7zATzIAWSCZGG3gp44ZdSOAwdLYuKbnGBaL/BhDxCWDw3P5DWNhG25+vU1YkbsEt07SItp5atUgF84NPw1Z9R3TeYwL42VumFfhBumvQZCn5lsy5vrLksz8ZthO6s23HcNJP6oVwADj6uPmAp2xf8eXY+ZAWB5/OzF8/KXlmL+AA5JhRCIL3EtMlcEwDxbmkBSGPbp00zJN3LYrLEOLfBnTuC8h5/gccqcmEWIjDEH/1FoXWZ0aMfrelAIY6POlS7WGxdd/TuMaThJiuP4q7wfnRYpWbCe93ThCX+m8a83CF2YBhHRq3iWpDAc5AOXahhHaau1wY4P1jr1IY+IaKOp6JMh7+or+2CGE872WphvvZkuX4lh/9SgFkCYD/VeUfRWzo29CEdSmRef0SoKGNeS77KR9pxBmlxatrNO5qIPgel92klPpoyCREG/bgsedZE+c80iNHtWvRn9cBUWAi0gLeARrR3/cjAM7flaOe2QjXhcAAAVhSURBVPYLaHHOWZQCkLBq/ur3xo6vGP91+I9eC8EbJ0mWQ7DYAHvB/azXWsYiFQmm23WwFcxUyiCNdQA95vYbma3HmdkbYxXGEgjn5QD+rLSUOb9CEe/lTNza2dv50zULDt2Xc8ZRlFApgCydfe6qjvFVY6uvw1Aeo4IC5puDysdwdh2mCfcL7izv0XvaK+zqk3GL70lQBiei/FHlbQhekPX9Fdw6/HKvvv+lSruylgvtYvDicvACjlvDesgu87MD+/bf8vjCCWqVxoOVSgF4MGdw1LmrdlVX1oz/AmeuxfmYwXGF/Rab8YVqEYK37uL6ExM5O4I79nHYxDRdOM70kaYQCPBc07ZgU80Woemv7xbsnUnCPodzUY8RVgO+9DMK4+P7uTDS2oa7O27r6eq84/GFk/a/H6N+yTigFICMM7LwZcv0hqmXfJzrGrYQ8zpZsnzCoQhwTbd4EnmeQoeswT3z6w432AQ7aR3LdfEBHEd9JL6WhyPOyKfcoNICiNg6y98FzduxTr9VjxpvvGuxjsnMmoO4+aDrLAD+bAC/KI5U8AeIC9v5SUvbQ39gS5bk5OkZFG/CVq9SAMPoEVo+xP2FX+SCfRwGw6IN4aEQaO/583BUWgNfg3XCZi+8OfaNN45IfHCiZptTuCaO1AU/HCsOtejAiRgtFAVI+bICX/VeAHo3LPPtNhfvCoe/7eiR7e/E/rr76H3HQnmx07BGPwe8mY8l0tMB+OIpMDjwYKPPH3D7zn+r5bx8e+799EoBvM+Lgn+RnaCyesxncNjoF/BlO63ggjwyAmgJmjOj/E0wbL0Ig9mrlmO3sT0dW2O1hyGaTbQMrFrYFm5U5mPgi1ANuOEvr8bSVzXAUoGTbwyAES4PBERuQNG4gAQwcaaioHMVLdorAX96C0qtF4di74fL836EdmMNHkNq0c10o8OwyKrOdifad2KLzYRphqZPhWHzBBhMT0GaU12bBivVxinxguOIO3r2d/+Pmt+jF4b5KAUwTAamZ69/Njlb17UrAa6PA1iFLVulF5rtXbDd8Iffir0JbRgOvwNtQMteuzG/bndsrR1f6t2a7gDITsK27WQyaSUTsf2Jp7c/7W5smjtlbjSWqI5Fo0ZU1/UoM7QY8lVjZIE7F51a2CmwHMphpmAYcfAjUBcAz6dBmUzMRlox4sHLHeDlH2zbuaf1zOj6YpSpyujjgFIApZIEOBYtvvB75+CruARAuQyMPrRUVY3EcqHE3sNo5AGMdpY1PfKDJ5TjTml6WSmA0vA1tVQYDhdPu3Qhlrwu1mD1xtd02Bbv1ApGypvY7GBVBEujy5u2PrhKGfRK369KAZSex0NqaIj3TmdCa8AQux5D6oUYIVQNSTQaAgQ7gCnLKkxRWhl3WlrqKraMhmaHqY1KAQTcGw3Nm2Ni0tTZsMzNh6FuPubW86AQCnJBDrgp2auHSy7sB2thYFyDtbo1fFfb+pbGGYnsGVWKUnFAKYBScbbwcvmieOL4iOBQCNpMzIFPJes6jGDDcEcunJhCc8JwR264L4L2TVw4G00u1qysi9H17rRioZ6QcEApgJB0RDYyzo/3HB3lESgDcaom+HH4kk7DaGEqRgtTkDfvnXHZ6ssxHjsg2XbQ0gZatjpcvI4pzaakMDeN5j32OfIuFMmUAghFNxROxKx4PDJZnHyULfRpmi6OoiU7dCqW7GjpTkzEtAI+9uwQfInJUSkGhRFFfBTApQNOo/01JxGewKc5iXBaGkzg602ONnuQF0uKHJ67oh3x/UuL/C2d21t38Jfe2lBXh9Nz1aM4oDigOKA4oDigOKA4oDigOKA4oDigOFAGHPj/BmkrpMF8AC4AAAAASUVORK5CYII=");
  18627. n.prototype = Object.create(r.Mesh.prototype),
  18628. n.prototype.move = function(e, t, i) {
  18629. this.hidden = i,
  18630. this.mouseLastMoveTime = Date.now()
  18631. }
  18632. ,
  18633. n.prototype.hide = function() {
  18634. this.hidden || (this.hidden = !0,
  18635. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18636. }
  18637. ,
  18638. n.prototype.show = function() {
  18639. this.hidden = !1,
  18640. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18641. }
  18642. ,
  18643. n.prototype.update = function() {
  18644. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18645. }
  18646. ,
  18647. n.prototype.updatePosition = function(e, t) {
  18648. if (!this.hidden) {
  18649. if (!t)
  18650. return this.hide();
  18651. var i = t.point
  18652. , n = e.distanceTo(i)
  18653. , r = 1 + .01 * n;
  18654. n < 1 && (r -= 1 - n),
  18655. this.show(),
  18656. this.scale.set(r, r, r),
  18657. this.direction = this.direction.multiplyScalar(.8),
  18658. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18659. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18660. this.lookAt(this.position.clone().add(this.direction))
  18661. }
  18662. }
  18663. ,
  18664. n.prototype.writeAstag = function() {
  18665. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18666. , t = new Date;
  18667. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  18668. var i = {
  18669. enabled: !0,
  18670. version: "0",
  18671. created: t.toISOString(),
  18672. created_by: "APITest",
  18673. position: this.position.clone(),
  18674. stem: {
  18675. enabled: o.tags.pole.enabled,
  18676. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18677. },
  18678. label: "tag " + this.tagCount,
  18679. description: "Description " + e,
  18680. floor: function(e) {
  18681. if (e.currentFloor) {
  18682. var t = e.floors.indexOf(e.currentFloor);
  18683. return t > -1 ? t : void 0
  18684. }
  18685. }(this.player.model),
  18686. type: "info",
  18687. metadata: {
  18688. preferred_camera: {
  18689. mode: this.player.mode
  18690. }
  18691. }
  18692. };
  18693. console.log("--------------------------"),
  18694. console.log(JSON.stringify(i));
  18695. var n = this.player.model.addtag(e, i).build();
  18696. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18697. n.visible || n.show(o.tags.startup.fadeInDuration))
  18698. }
  18699. ,
  18700. t.exports = n
  18701. }
  18702. , {
  18703. "../enum/RenderLayers": 41,
  18704. "../enum/RenderOrder": 42,
  18705. "../settings": 166,
  18706. "../shaders": 167,
  18707. "../util/lerp": 188,
  18708. "../util/texture": 194,
  18709. "../util/transitions": 195,
  18710. three: 217
  18711. }],
  18712. 150: [function(e, t, i) {//"../objects/Room"
  18713. "use strict";
  18714. function n(e, t) {
  18715. this.chunks = [],
  18716. this.floorId = e,
  18717. this.roomId = t,
  18718. this.position = new r.Vector3
  18719. }
  18720. var r = e("three");
  18721. n.prototype.addChunk = function(e) {
  18722. this.chunks.push(e)
  18723. }
  18724. ,
  18725. n.prototype.calcBoundaries = function() {
  18726. for (var e = new r.Vector3, t = new r.Vector3(0,0,0), i = new r.Vector3(0,0,0), n = new r.Vector3(0,0,0), o = 0, a = 0; a < this.chunks.length; a++) {
  18727. var s = this.chunks[a]
  18728. , l = s.geometry.attributes.position;
  18729. if (l)
  18730. for (var c = 0; c < l.array.length; c += 3)
  18731. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  18732. t.add(e),
  18733. 0 === c ? (i.copy(e),
  18734. n.copy(e)) : (i.max(e),
  18735. n.min(e)),
  18736. o++
  18737. }
  18738. o > 0 ? (t.multiplyScalar(1 / o),
  18739. this.average = t) : this.average = null,
  18740. this.boundsMax = i,
  18741. this.boundsMin = n,
  18742. this.center = new r.Vector3,
  18743. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18744. }
  18745. ,
  18746. t.exports = n
  18747. }
  18748. , {
  18749. three: 217
  18750. }],
  18751. 151: [function(e, t, i) {///js/objects/ShowPath.js
  18752. (function(i) {
  18753. "use strict";
  18754. function n(e, t, i) {
  18755. this.obj3d = null,
  18756. this.nodes = [],
  18757. this.colorHull = [],
  18758. this.shortPaths = {},
  18759. this.floorHull = null,
  18760. this.cameraHull = null,
  18761. this.floorPathDistance = 0,
  18762. this.floorCurvePoints = null,
  18763. this.floorCurveColors = null,
  18764. this.camCurvePoints = null,
  18765. this.warpDestHeroLoc = null,
  18766. this.warpDestPano = null,
  18767. this.warpPathPoints = null,
  18768. this.warpPathLengths = [0],
  18769. this.warpLength = 0,
  18770. this.closeWarpDistance = 4,
  18771. this.UP = A.UP.clone(),
  18772. this.longestStep = 0,
  18773. this.upcomingTransType = null,
  18774. this.burnsDir = 1,
  18775. this.prevNextDist = 0,
  18776. this.nextI = 0,
  18777. this.activeTransType = null,
  18778. this.lastTransType = null,
  18779. this.bunnyObj = null,
  18780. this.director = e,
  18781. this.player = t,
  18782. this.playerControls = i,
  18783. this.modelManager = t.modelManager,
  18784. this.updateModel(),
  18785. this.updateDefaultsFromModelData(),
  18786. this.bindEvents(),
  18787. this.warping = !1,
  18788. this.waitingToWarp = !1,
  18789. this.warpInterrupted = !1,
  18790. this.warpInterruptionBlackoutStyle = null,
  18791. this.warpInterruptionTravelTime = null
  18792. }
  18793. var r = e("three")
  18794. , o = e("../util/logger")
  18795. , a = e("../enum/Viewmode")
  18796. , s = e("../enum/RenderOrder")
  18797. , l = e("../enum/WarpStyle")
  18798. , c = e("../settings")
  18799. , h = e("../util/math")
  18800. , u = e("../util/lerp")
  18801. , d = e("../util/easing")
  18802. , p = e("../util/transitions")
  18803. , f = e("../objects/Snapshot")
  18804. , g = e("../effects")
  18805. , m = e("../shaders")
  18806. , v = (e("../gui/gui"),
  18807. e("../util/texture"))
  18808. , A = e("../enum/Vectors")
  18809. , y = (e("../model/ModelManager"),
  18810. new o(i))
  18811. , C = e("../enum/PlayerEvents")
  18812. , I = e("../enum/BlackoutStyle")
  18813. , E = e("../enum/ModelManagerEvents")
  18814. , b = e("../constants")
  18815. , w = {
  18816. path: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  18817. pathEnd: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM3pJREFUeAHtfQmUHMWZZkTW0Ye6uRECg5FYCz3WHGK6G0kNFmqBpD4WG3Mb3sh4bOPd98aewWAMyxsj7NGADdhee97bHWwPtvy4ZJDxQF8IqYUspBbdPSCOZSX5WcJgEBIgoFt9VFZl7PdnVbWqW1XdWVfmn1WRT62sjIyM+OL7j4yIjEMKffiagUVb36qqDc88PaACc4SwTpaGPB4FOkEoOqvjJf0W4lglZCXOYSFFBcLCQokK+xr/4YggfEzRWYkxupZCjeJ8EGHvCyE/EFJ9gOv3lUVn492YjO0ZjOx/c1vjaSMI14dPGYAu6IM7A0t6eoJVVY1nqoA4VxrG2VLJM2DcMHg5W0oxy0v8Sol9wLIXWPYoqf6sLOs1GROvjIxs3bWpqSnqJTad9/QMaAcwPUeuxljSs6eysvbUeghmgRTyXBjXuULKs3BNb2zfHKg5jAml3oBjeEUJhT+xfXTw7f5NTXOoZqEPJgxoB+CxIFo2D54oqqsuhKFfaEiBs6wDpLDHsIqVfQTlHLCUeAHlfEEMj7zQubj2QLEy0+lOz4B2ANNzVNAYdf39oVnivItQdW5B9b0Fb/ezC5qB3xJT6jVw0QkuOveJHVsG6utNvxXBz3i1A3BBesu2HDolVBG6DMYOo5eXIMsaF7L1YxZDSqkNaDp0mmPm0+svmvGOHwvhJ8zaARRJWpf0Dp1UEQpfhQ67a5WUF4FozXUWXKPPAH2Kagv+e3zMjDyxYWHNe1k8rqM6ZEArpUOinERbsfXj4wKhqqvxpr8Wb/qL8Yzh5DkdZ1oGLNQMnkfN4PGYOfK77sajP5z2CR3BEQPaATiiaepIzX3mEkPKryPWFWjL0vd2fRSJAfQX0FeEdfAIv+hqCG0qUjZlk6x2ADmKevkLgzMD4cobDUN8DbX7uTkmox/LiwG127LEL2OR0V8/e2Ht/rySKtOHtQPIUvArtkfOCwSNWzBi7jq87UNZPq6jF4EB1ApM9LA8FotaD3QvCO8oQhYlm6R2AA5F2zxgrggIcSve9pc6fERH84QB9VxMiPu76kLdnmTvs0y1A5hKYGvXBlrmXH4DOvRuxd85U0XV93gxgE7DV/F3f+eepx4W11wDn6CPdAxoB5COlVWrjNa2O64V0lgFwz8zXRQd5g8G4AR2CWWt6mi/53GxapXlD9TuodQOYCLXsrUvip58dTc+5X124i195WsGlHpdKXlXR0NwHcqBYQb6IAa0A0joQWufuQxs/Ahv/PlaNUqXAdQIXob539bREFpfuqV0XrKydwDLekfnhkKBBzDz7jLntOmYfmcAMxSfNs3YLesXVu72e1nywV+2DqCl94OjRPCof8IAnm+BwFKdfZePbpTDsxEMKPqZiH7yg86Fx39SDgWeXMaydACtL0a+IgLGvSj8zMmE6OvyYwAdAvtFzLq944LwQ+VW+rJyACu2jn4mEA48iHZ+U7kJWpd3egbQP9ATi8Ru6m6s/NP0sUsjRlk4AHtJrZqLvo3q/ip09FWVhuh0KYrCgBIjaBasGhna8uNyWNKs5B1AS1/kfLzxf4W/84uiMDrRkmQAtYGX8PfVzobwSyVZwEShSnq6astA5B+lNLZr4y9lFS5O2UhnSHdIh4qTA49US7IG0PbHj45VVTMeghC/wINmjcLPDKAm8Ac5cugr7Z875qCfy5EOe8k5gNb+yAIM4X0cBTs9XYF1mGYgFwbwpeBNDCm+tqM+vD2X57k+U1JNgNZ+89tYhOeP2vi5qpt/ccV1yvhjXMf8W47JyEuiBmAvxVVR/Ws9mm+yePV1MRigUYSxseEbS2FpMt87gObt5qJAQD6Gz3ufLoawdZqagbQMKPGXWExd17UgtC3tfZ8E+rkJIFsHzO8YAblZG79PtK2UYOKFQ7pHOohi+fZF6kvgtH1W9VGnPowq/xWlpFO6LP5kAE2CdcOfvH2DH7c9850DuLT/w6PDsvY/YPyL/akuGnUpMgAnsDmiBj//XP1xH/upfL5yACv6D50ckOEuGD82zdSHZoAXA3ACr8RUpLm7fsa7vJBlRuMbBxCftx98FoBnZy6OvqMZ8JYBjBfYa5rR5X5ZZ8AXDqB1e6ReBI0OgD3RW/Hq3DUD0zMAJ3BARK3WjgXh/uljexuD/VeAtj7zUhk0erTxe6soOnfnDJCuks6S7jp/ypuYrB1Ac9/YdcKQ7aBG76brjX7oXHNnoIZ019bh3NMo+pNsHUBbf+SbhhF4BAzo5bqKrgY6gyIxECYdJl0uUvp5J8uyDwCDK+5CT/+qvEtXZgmg7XkIO+juwizInVjUYpch1PvKEkNKGoPKUIOBmMDZGrRMa9A0zMF9b741SBTNOv202pAVqjVCRq20jNpYQOAsa6WyaqUhaiwhT8BiKmdiVtw8LJd+JpRmRplRm3dx8YVgVUdd6O68EypwAuwcgO0tpfGzApez1JJ7B4b+Kgx+pxRqZ8ySO6Vl7uxcWP22GwVt6R0+VRmheQFDzVNCzoMSkWOgnZNOcSN/3+ahrG+114d/zgk/KwdA7SWqMgEUK1xeC8zuVVaiB9NRN5oxayPXT0z2p9qAsRTTsfEnmiBE/dUmRXkgR2VZseu7GioeSwn29CcbQ7N7TOMdfrrNL8RHqG4/D33ZiL+ejvqK16Al0B9fHbK1f+xs+PIm/C1Fs+RioD/GVyUoDtiIsFRbe0PoueIkn12qLBwAfeenzyaAXr69/QrtcymesCy1pqt99eaS28cO+y02t9252DDkSqnEVagh1GanqiUVe0hFrSYO4wQ8dwCJEX4vAEj5VReViCmp1gvLWnPQ3P/UtsbTRkpKzTMUZtHWt6qODc28XBgGnIGkLdmw83p5HajOHcCIwQu9bs556gDiY/srtgLE7DIT/w6lxBphjT3ScUHNvvIq+8TStr44NEsYFddLKVaiqXDexLulfQUnsDemxhq9nDvgmQNIzOrbXEYTeyz03K8TUt3bXhceKG3Vzq10bQOROqHk7fiiQNO82Y5Rya106Z+iCUSYRbjYq1mEnjiAxHz+7nKY0os3fRRV3EdlJHZP+6KKN9KrgQ5NZaBt29hZKhy4A92eX0LNIJh6rxR/wwlsxnoCK7xYT8ALByDb+s0n4eW/WIrCTClTBL9/bUbNe59dULUnJVz/dMjA8u0jc0LB0O2IfiP+SvrrEJzAOgwUugrlRMvAvcN1B9DSZ96GnuAfuldEl3NSYhhV/QdHTPP+jY3Vf3U595LMbunW4U9VhUK34qVxE2pT1SVZSBQKTuA2OIH73Cyfqw6AFvCkddRKtlqnxO9GIpGbteEXR4VtRxAO/wRO4Ori5OBtqtRctGJqsZsLjbrmAGjp7mB4xksQXgmu3qt2W0r8fWd96FlvVag8cm/pN5cbUvwrvhrMLbkSY7XhaOTQ+W4tOe5WT6sMYN3+kjP++E6y37Pe23uONn73TJG4Js4x4el7qDeX1tgJvCBtW3GJTldqAPDYt2A22f0ulcmVbDBUtz0ai35Td/C5QnfGTKijMBgI/hxDjdsyRvLhDTi3W+HoHig29KI7AOyuulAqg9r9oWIXxpX0lXgPbbVvdDQE/+BKfjoTRwy09kW/AB37N9QyT3L0APNI0DFTSWtxZ124t5hQi+oA7F16q2teQianF7MQbqWNt34PRu9dX+6j99ziO9t8EqMKH0FtoCnbZznGx/fAN+Xw0PnF3JW4qH0A9hbdpWH8lrLU3R3PrL5UGz9HU4ljItmQjEhWCLH4InWGjF6cZEPOYucWC3kU52jti9wsDePHxUndvVRRFduHCTs3dNaFMDVXH35hoGXAXIqJRg+jWTDLL5gz4bSEdTOaAj/NdD+f8KI4gBX9kb8JCKPX/+1+tWHUHLthw8Ka9/IhWT/rDQOX9A6dVBmqeBifCy/xBkFhcrX7A5S1oLMh/FJhUjycSsGbAEt6eoIBIX/pZ+NH2wuDstRd7U+vXq6N/7Cy+O0XyY5kSLK0Zeq3AiTwki2hX+NXZFuFLkLBawB+H+pL3tZSsZWclm0qtNDLMT17uTkZWOPnFxMWi/luZ0PoR4WUX0EdwIqto58JhoOv4FNMVSFBupjWEDqQruhoCK13MU+dlUsMtPaZy6Qh1yE7f648hUFP0Uj03O7Gyj8VirKCNgEC4cCDfjV+VBEP2Ms0aeMvlG6xS4ccO8mYZM0OnBNAeLHaNuYkrsM4BXMALX2Rv/Pr91coxF4RjV7EYY02h3LT0XJkwJYxZG3LPMc0vHyMbKz1xchXCoWhIE2Alt4PjpKho3cjsZmFAuZWOhjc82pMRFZ4uSyTW2XV+RxmwF6OToS7YVC0n4GvDjiv/cr8eG7nwuM/yRd4YWoAwaP+yZfGL9TW4cGhxdr481Uj/z1PMifZ43PPVr+ht20NNlcI3HnXAGhV33AoSOvW+2rFFnrzkwJsajr2o0IQqdPwJwNLeg4eU11bg7kqvqsJRCJm9Ox8VxXOuwYQCgVoxpK/jJ9WY0W1Xxu/P422kKhJB0gXfNgnEE7YXl505FUDSHxW8dUiGBD0gXiHX+WuvJjTD5cUA63bR88UweAWGISv9qfAZ+vl+Xy2zqcGgEV9RUEHJbigUUNYdKm1Y4E2fhe49lUWtk5ANwB6yFfA4zaY84s8ZweA+ddXoN003y9k2eOpaZDPgnC/XzBrnO4yQLpBA8FIV9zNOffcyAbJFnNNITcHgH3epLSnXOaar6vPodoPucZW5lNVchWwzswzBkhHSFdIZzwDkWXGti3CJrN8zI6eU9WhtW/sSxLbeOeSoRfP0NpxWF7pB17krfP0JwPYu+J7WIb8br+gV9h2vKOh4tFs8WbvNdauxWQ/Y1W2GXkXX23ofGb1au/y1zn7kYH2Z1b/MyoBG3yDnWySbDPLI+saAIb8rjQM4zdZ5uNJdLTl9o1FR+eX45Te+PftGfPAwTxDyHnosD0TQjgB51qE1aLtWINKbi3CaKONYYQPYmzEEGbLDSJ8EGHv47wLGxruRNjO4cFDO8vtsymtJ1ARrHwZ5ffFoiKWZX0ZawasgewcH1k7AFSNXkXV6GzHOXgX0YLyLiuTlXxkc+/YOUZQNsGwlyohF0KwBR+WjUbxfilULxzFRiuqeroWVrwK8fqmrZyLKtLKQnCgNDs0+9pyLhnm8QwNbuuoD52bTRJZOYDmAXMF6v9d2WTgVVz0+t2NDp1VXuVf7Hzt+RdG7ZVYdq0FeTXhDX5CsfOcnD4s/4BUYpOyrE5lDT5ZiLHpk/PgcI3xLqswjfguDlimwxATqrmrLtQ9Xbzk/ay8GhoYtyYf5HyGJ+zpaF/9fc4Yc8KGNl5zX7S1bSD6qBE8ep8MGP8Ow7/aC+Mn/Hh7nEj5Ew7CQ7gIXy5t0Zz4cOkh0iXSKZeyyyubbG3UcQ1gxfbIecGg8XJe6Nx4mNbtt0bnl9Lqvcu2HDolVBH+R1TvV8Lg+K97b++doNaYY5Gfrr9oxjtuiL3YedCS49KofNkP/Eej1vzuBeEdTjhxXAMIBI1bnCTodRx0cH2jVIy/edvI7Nb+6P8OVVX8GVXQ7/hB+Wz5w0kRXsJN+KkcXutFvvmTTpFu5ZuOG89nY6uOagCJ3tC3uK+nhmraM+gEucwNkouZhz0uPRC8E3lcD84LvhBkMbGnSxuGE0X4IyIWXe33Ydit/eYzqImx3oYMfJv4+nWak69fjmoA4UDFl7kbP/qiR7BX37fSKaBfwur636mGgt0jAsHXwPfKUjB+4p7KQeWhclH5qJx+kclknLQfJOna5HBO1+A6RDbrBJMjB2AY4mtOEvMyDhZ2+Bc/b9TZ0h+9fJaY+QbeLreTAL3kslh5U7mofFROKm+x8ilmuqRj+Lx8TzHzKETaTm12WgfQ3GcugQ+fWwhQxUtD7Vb7995XvPSLl/LyF4dPw9iKdux3/3u08T9dvJwYpYxyUnmp3FR+RsicQdm/F7Ng1W5nkb2KJefGbXfq/Kd1AJj18/Wpk/D+rqXE33e2zh3zHkl2CFoHov8taITRsyxpGmr5HSg3lZ948FPhSddI57hjdmK7U3YCrtj68XGBihnvIFIF28Iq8bv2+uA1bPGlAVbX3x+aJc67R0n5bXA7pQzSPF5yQRhQhO0X1Y/3iR13DNTX+2Yqblt/dC2kdzVXgaAzcDQWOfSp7sajP8yEccoaQCBcdQ1z4x8eiURuzlQ4juGX9o98+iRx3ma89W/Rxh+XkM0D+CBeiB+OckuHydY9hXkUTA/0uVSSDU8Fb0oHgJfTlA9PlbAr95R6cGNj9V9dyasAmWA99/kVIvQiOsIWFiC5kkuCeCF+iCc/FM7WPeggb6xT23BGB2CPfJLyYsaFi4yY5v2M8U2Ahg6vJmEYz/tmMM8E9C5e0EhH8OSkA8tFVBmzSuhgJGMEj2/AqV5MtpwJRkYHIALhK/FQ5vuZUnQpHO3Gh/zy9seSTVeivd+JKtlRLtHj62yIJ8OQXcQb94KQDpIuMsZpJGw5LcSMBi6VvDbtEwwCaWRZNGr+kAGUaSG09UW+Kg2xlnVfyrSlcD8C8UW8EX/u555djqSLidGO2T3oUuypbDmtA6DJJ3hjXeQSvuyzkeJRPwz6sd9ghkFtxLQ8Z1/wsnvCQHPgQe41AVsXoZNcpUO2TDadDl9axQxVhC5j3ENtyUiM/UiseJtfPAzS03KcThg6LC0DcALiYZvPtLd5BCZ00uKBZiIKsmWy6Ymh8av0yiklLTLB81BqXfuiijd4goujol5srMrzlK72F0ZKxCPxyfnrgK2T0M3ClLgIqWSw6SMcAA1SQc/hJUWAUJAko8zHYbe+MHI6Vunp0h1+BRH3eCLEJ/HKepyAVPeOA2b2g2yabHsyrCMcAEaoUdu/ZnJEHtdqR3d9+D95YDkShU1wRfAx/anvSG4KEoJPhGERfDydIhck/TwTaa8LD2BQo6OFOPLMKpfHaxK2PeHZIxwAejPZVv+Bbc0E9MwuaHgvDWZhBquk4BC/xDPXQnHW0XS2fYQDQFWLpwNQIiassUe4Cp4mtNDYfq74SgkX8cx2AhHpKOkqwyOdbU9wAC2bB7HII88lvzFbZD3Xpb7sKa1K/IbxlxOG6pg7JJtn8M1xKrG9dBh0NffSFfFJ2LZt4ylZTHAAorrqwpR7vH5aFtvqf8gI/R941+N4EVbaaIhv4p1lKRnr6mQbn+gAhOLpALBTzUFz/1Mchd08EP1i2c7n91ogWE/A5t9rHJPyt3U1vrvSpDscLifa+AQHgFVaWDoAJcUT2xpPY7cOG61tF1DipxzEWq4YiH9uawySrpLOcpTJZBsfdwBLevZUYsBQHUfQlqVYVv9niROxg2yZLOPFUTEIE/i35cAMH1edJRuP23qcsHEHUFl7aj2Cwsx4JDgfdbWv3swNFy3djdFputefgWBIDvZS6gywJCEkdPaj5DWjczhh6zakcQeAntUFjECOQ8Fa/8+LVav4jbHGuv3oiDpiZNU4cP3DNQZsOcT3UXAtz2kzgs7aujttRPcjpNp6igOQ57oPxUmOaqOTWG7GSex0c72beeq8pmXgen47EPHTXWJRisO2Pu4AMISRpQOIYivqaUXvcgQjFPou3jq+37HHZdqKmh3Jg+RS1EyyTJyj7saLcNjWbQewpKcniE9ZZ2VZvqJHx0orB55tqHi96BllkYE9r1qKr2TxiI7qFgOQS6Z5725BSM2HdJd0ODWMxW/Yum3zAGM7gKqqxjPRLuC39LcSPcAIDvkc9i69HLniQ5FnSEiHST6eATgyY2xYZevwkXc8DCGeyOYJgu0AVECwrP4LZfGq/q9dG8BklJUeyk5nPQ0Dtnwgp2miuXebmw4nSp60edsBYJ712e4x4jwnM8bLATTPuWKFnurrXH6exMSUYVtOnmR+ZKbcdDiJMGnztgMwhPwvyRuMzu+sX1i5mxEeETDE33LCo7GkZ4CTnBI6/E56pN6FYqHQMyj3eBNAqdneQcmQs1KvZrjjSXBL7wdHoT33BU8y15lmxwDkZMsru6eKF5uZLscLqubQ2XYA+DI4G79ZHej528kJkDRqr0T1v4oTJo0lAwOQky2vDLfdDuamy/Hyy9l0NhZtfasK31Az7hxCkbw4pFDMHIDBc6EUL4TjgzzRxmUjL266TOIjmyfbN2rDM0/nKM+YJTk5ADSZxBKOPGlM6RlIyAtfvLw/mOnyOCFk+0ZABey2wHgokx/SMtk4gObesXOgSScyoUbDcMAAyYvk5iBq0aNw0uXUwpLtow/AOjk1kMNvtJkOdS6sfpsDFsJgBGUTFywah3MGuMiNdJl02jlyt2JaJxvSkMe7lZ3TfKRi1v6XcqlT7DoeHwYwKIiP3JTaxYeZOBKyfdQAxAncgGF+N5vqP3EDPHqpb25K4gAPL7nJ/+cAsttRTjCE4lcDEIy85ZKeg8egPTnTbcno/PJngORG8ss/pfxTwKQAVoPa7BLB9lEDUOxqAFKqD/KnvDApVNfOmFeYlHQqXjDARX54077vRfmnzlOdgDUCBbs+AHzCGZwauHt3sZuKdgDu0V3wnLjIj5NOJ0km2zcAjN969pbBxgFgnoR2AEmN8eGZjfwY6XSKGI+lPgB26wBgFyA2DgDDf+150ymk6Z9+YoCJ/FjpdEJ+6CStpK8A/BxAjE8TAPyw6yPxk/0xwMpCfoqXTifFUoEaEr+lwI2ANZRE6PlZilrPMWgAuTPARH6sdDrJJmyfOgHZ7QVgmRabJgA6kbQDSCqMD89c5MdJp5NiJNtHHwC/JoBpmGwcAOZNaQeQ1BhfnnnIj5dOJwQJ26c+AHY1gH1vvsXGAWDapHYAvjT8OGgu8uOk0yniRA1AH1MzoPQiIFMTxPyult+UAiIHEJkyhgc3Z51+Gqe37rAHFOgsC8cAC/kx0+kkuxH6CjCWvOJyDlkhNg4A0zj5fJHgIiA/4WAyqpSTTo+LD7ZvQMHZ1QCMkMHGAWCuBJv+iHHB6R+OGcAGnSwcOC+djtNHtk9fAdjVAKTFxwGgE0k7AMfmxi8iF/lx0ulxKcH2WfYBxAKMet6VdgDjCuPHH0zkx0qnD8sxgoFAavTwNY9f0uLx7TbBBsNpnDzk5BMULOTHTKdt0ZHtUw3gIDdBSmXx6QNQgt1STtzkxRoPE/mx0unDAjtInYAfHL7m8UsaooYHEiyZymx/Ai68+AUHF/lx0umk7GD776MGIFlUkZKg6GwJyWIGF2FBJxKr9QkJkz6cM8BFfpx0+jB78gOMA+Cz/FYSmCElmzn4w4OHtANICsaHZy7y46TT42KE7VMfALsaAL7dslmFZ1PTsR+hqrR/nDT9wzcMkNxIfhwAc9LpFD7eN5TFrwaAejebGgCRhd7S3hTS9E+fMMBKbsx0mkRIto8agPEuN3linvKMlt7hU7nggvfeyAWLxuGcAS5yI10mnXaO3K2YxrtGTMb2uJVdNvkoI8SmGWBFVU822HVcHgxwkRsnXU6VDNm+MRjZ/2ZqIJffAYNPP0DXwopX0Z48wIUbjWN6BkheJLfpYxY/BiddTi0t2b6xrfG0ESybtC/1BoffWLGUTQ0AfGBRV7GJAy8agzMGEvKCH/D+YKbLNiFk82T79BUAh9prnxj9hzYTJweADhOrkxE9Gso0DHCSFzddjlMXt/mEA5B7puHT/dtSnuN+pplzVNbgk5g5OZI5hr7DhgHIyZYXF0DMdDlOS9zmbQeA+u2fuXCVguOUZb2jc1OuPf3ZufD4T/A98A+egtCZO2MAcrLl5Sx2UWMldPiUomaSQ+JJm487AMt6LYc0iv5IKGAsLXomWWQQs8Rvs4iuo3rEACc5cdPhpEjQRLJt3nYAMiZeSd5gdZa8HEDXnnXdaAa8x4ojDWYiA5CPLaeJod5dMdPhJBFJm7cdwMjI1l3oLmW3MhCq3E0AjD4UJsc118QwuGQNEzQaRhoGbPlATmlueREkEzrsRd4Z8yRbJ5unCLYD2NTUFBVKvZHxCY9uwPJPXN439lmPsk+brTkW+SlLZ5kWbXkFklxIPlxK3do/djbpMBc84zhg67bNI8B2APEbkmUzICjl0nHgDH6sv2jGO2gGPMQAioYwmQHIxZbP5HDPriXVYBkeh2193AEooVg6ALQAWDkAkqZlmj/EQIooQ8mWLSSSB8mFFwH8dJf4SbX1FAcgtvMiL45GSnmxWLVqHCcHjF2LqvYCxyMcsGgM4ww8kpDLeICnP6Cztu56CiJ95mgqjdv6uGGNDr7dj+js9ggApmOa2+5cnL4oHobGoqvx1jE9RKCzTjBgywHy4ERIQmeP4YQpgSWSsHX7ctwBbGqag9WB1QBDwMIw5EpuuDoWVKIXVT3ADVd54lEPxOXBp/QcdTbOjhqI23r8atwB0KWlxAvxYF7/Y2LHVYu2vlXFC5XAgIADP0CD6i/ccJUVHvBvy4FRoUlXSWcZQRqHMtnGJzgAdLixdAD4llp7bGjm5eOlYPJjoP6UYUuIf2ACpyxhEP8kB06Ft3WV7bbyE218ogMYHuHpAEi6hsGuGUCwOuuDT2EMRQf91ofLDIB3m3+Xs502O6a6auOeZOMTHEDn4toDUGaW8wKkkstaXxyaNS35HkQwLfO/oyPqQw+yLtssiW/inRsBpKOkq9xw2Xhg27aNp4Cb4AAoHMTynPcuRUAYFdenYGfz89kLqt9CM+XL+LyCf/ooNgM2z+Db5r3YmWWbPuko6SrDI51tH+EAsJECTwcAQoGNZTOAZN1RF3xGKvVjhnIvOUjEM/HNsWCcdTSdbR/hAPaJHVtA7BBHcuECzmsbiNTxxCawrtqOOzAZRS8hXkQBEb/EcxGzyDnpuG7K83JOoLgPDiVse0IuRziAgfp6EyRvmBCL04WSt3OCk4qFuIuI6LVoCLyXGq5/F4gB8Er8Es8FSrGwyTDWTbLpdLwd4QBsRpRi2wxAO+CKtm1jZxVWcoVL7bn6qr9gsYVmtLc+KVyqOiXik3glfjmyYeskdJMjNhtTBptO6wDMMfNpxh1ahgoHWFYBk8LvuCD8MnaluRwc8ltjIQnSR2fikfgkXrnCTuhkWnvyGjPZMtl0OhxpAdOUSnS0UF8Az0OJLy3fPjKHJ7g4qvb6UA+2Ob4BVxiroo88GLCIR5vPPBIp5qO2LkIni5lHPmmTLWeaJp3WAVBmWDTw8XwyLeaz6M0MhoIhtn0BybJ3NASfFJZ1E661E0iSkt0Zxm/dZPOY3XOuxiZdJJ10NdMsMpvKljM6gDEz8gTy4Ky4Ny7dOvypLHjwJGp7Q/hXyhLX6OZAdvQTX8Qb8Zfdk+7GTujgje7mmlVuVsKW0z6U0QFsWFjzHnoOn0/7FI/AcFUodCsPKFOjoDcYqmEtumNwap6Sd4kn4ov7m5/wJnQwnMTO7Uw2TLacCVdGB2A/oPg2A2x8Ut7kh1oAYY33CVgX60+EtuQy/0efUC3rYs5t/iR4W/egg8lrludpbHhKBxAzR34Hb4x1ApgeUlRXhcM/YYruCFjUiz0mzAvglfVgoSPYoWHoqpf44dzbnwrb1j3oYGoYp99ku2TDU2Ga0gF0Nx5NE1zWTZWA5/ekuLql31zuOQ6HAOg79ntix2Jo+wP0ecbhYyUdzeYBfBAvXL/zTxaArXPQvcnhzK7XJWw4I6wpHQA9ZSn1i4xPM7lhSPGvLR27K5jAmRYGjchCFZf6Lz4PL13WswgT5f888ZFupNq0ZHoQgXSNdM6DrLPK0ontTusAuhpCm/Ci2p1Vzq5HlnPFzNm3uZ5tnhnShJaoFZmP2kB5rieAclP5uU7sySheW9egc6wPtTtuu1ODnNYB0OOWJX45dTLe3zWEvIP74KB0LNGUVrz92rCVzRVoEPwlXZySC0M5qbxUbpZTeqcgnHSMdG2KKCxuObVZRw4gFhn9NapqJouSZQIhRVUwEPx5ptvcw7vqgr/fJ/afhdoA7TnAm+scybTLhfJROam8OSbj6WO2jkHXPAUxTebEM9nsNNHs29i5yNnROhBdg8h/6yy2d7EweORyfD/29TberdtHzxSB4J1g8XrOI8ycShkKSZuoPCKwdDe31XudloHitfRHL0fbn73jQqfqb9GscrR2hmMHsGJ75Lxg0GA7GWNckPiOrKzR+R0X1OwbD/Ppj+ZtI7ONUOi7WGHmKxCUbzo5k3RDEcfQrHmIduxhtWlHEmAWZ3upL6PyZcjipCwe8yRqNGrN714Q3uEkc0dNAEoonqB6zkminsYhARkVj3DbTSgXTshoOuqD/8McGTtDWeo+3wwisp2wuo9wE36/G7+tS6RTPjB+dNg/59T4SScd1wAocvOAuSIgZBf95n7AYO7uaAit4o4zK3xr1waa51yxImCgKabEFyA9Pm1RJUaA5w8xS/y2a8+6bsFni+6sKE4XubXPXCUNeVe6e9zCYkI1d9WFup3iysoBUKKt/eYr2PPsHKcZeBgPHaFqWWddaKOHGIqWdUvvB0dJo/ZKaRgtSoolEKTr21Cjin8AG2BswkIdncoafLJz4fEltwhKy4C5FL3+6yFIx7Xlogl9moQxkvLVjvrQudNEm3A7awfQ0hdZaRjGbyakwvQCnU/7xqKj86eaDMEUerawZHPv2DlGUDbBOS9VQi6EYGdmm8h08WHw+7EwRy8UbaMVVT1dCytexTMILs3jkt6hkyqClS+jI3aWH0oIR7yyoyH822ywZu0ABKqhrWd88f9C0c7MJiPv4qoN7U+vXo52HOepzQWnZ0nPwWOqa2fMgxOchzfYPFTPSV4n4FyLsFq0/mqh2LUw3yqEjSBsELY8iLBBhOG3eB/nXahF7UTYzuHBQzs3NR37UcGBck0Qu/u2XXbns+DpEq4QU3HBKe/q+PPv/2u2Ta/sHQBybe0b+5I0Ao+kAmD9W6m7MOjk+6wxanCsGGjrN7+H9SfvZgVqCjDKil3f0VDx6BRR0t7KqV3T0X7P4xiw8nraFBkGKilXNfeNXccQmobEkAHSFdIZhtDSQ4It2jaZ/u6UoTnVACjF1r4oOqAErRrkiwNVXBNOqw1fBqhDRx+agbQMoMd/Gd787Wj2hNJGYBiIwW9X5bp4Ss4OADxIfBH4T/QFzGfISSZIQypqNXUsCPdniqDDy5eB1u2Rehk0esBAjV9YQNv/ZfT8/w3w5tQZm1MTIEGOQpZ+m4FXI4JGhz3U1i8S1jhdYcDWCegGMvON8dvExG0wJ+On5/NxAIKq0/ACT9tAfPIfqjwnimCwe0X/oZN9AlnDLDIDti5AJ2zdKHJehUyebC/fJm1eDoAKY5qxW3CKFLJgxU4Lgp4dEOFu+lRW7Lx0+rwZIB0gXSCd4I30CHSRhO0dcSObgLwdwPqFlbux8sjPssmUQ1z0XZxTfVRNu3YCHKThDQZ7rAR0gHTBGwS550o2R7aXewrxJ/N2AHYy0U9+gEbI/nzBuP28FLKxurZms24OuM289/mRzEn2pAPeo8kOgW1rsLnsnkofuyAOwB4DHrNuT58F71Dy/gFZsVV3DPKWUyHRkaxJ5n5889s8wNYKNe8CTZ/CHfgsuBGkNhUuRfdSglc9IKJWq/5E6B7nXuREn/roSxAU3/XJU4UoLz779eCz39JCpEVpFKQGkAQTi8RuwqfBkeS1n86kEPQN2B4I4ifgGqtjBki2JGO/Gj/Zlm1jjks8fcSCOoDuxso/oXNi1fTZso1RQ6PA9LBhtvLJGZgtU8gWCfjrO39Kicm2yMZSgvL+WVAHQGhGhrb8GNWUl/JG5lECNATUwEQnezIIZoR5BENnWygGaFYfJvaQTP00vHdy8cmmyLYmh+d7jdpQ4Q+sGXC+lMZ2PxMeZ0VtGDXHbiiD9QQKrwQMUqT5/JWhiof9MqU3E2U0j0Upa0FnQ7jgL9aivOEIqJKW34YJp+FfXkILQtCqMGlu6iDGDJDMSHZ+N36imGypGMZPaRfFAVDCnXXhn6La4uvluakcqMXMoiWhaF24UlholMpU0geq/CQrkhnJzu9lJRsiWypWOYrSBEiCbfvjR8eq6pqXkMnpyTA/nyGMHmGNXV8KS477WQ6ZsNPS3bQitF8/RU8uFz5NvymHh85v/9wxByffK9R1UR0AgWztjyxAReOP/u8PSFBOS14r8Q2/bz5SKAXikg7Wp/gCdOzfsLwZ+3X7nXBmr18hrM911Ie3O4mfa5yiOwAChgFC34ZXfiBXkByfQ22gPRqLfvPZBVV7OOIrF0y0Vx9t1wX9aiulMkO/bsGAn4L3+k/myBUHQJm2Dpj/gXHXl00G4OtrDMzAlMx/Ufv33tfZOnfM12XxGXjaolvOnP0d6NT/xFufz/4IBeDRnuZbF/p8AZKaNomidQJOzjk2NnwjRjL9ZXK4r6+heHjz/MA4afarLf3mcl+XxUfgiWvinLgvNeMnG7FtxSV5uFYDoPI0bzcXGQG5GW21oEvlczcbJX43EoncvLGx+q/uZlweuS3dOvypqnD4JzD6q0uxxGj3R62YWty1ILTNrfK56gCoUGgKULXtR24V0PV8lBjG4qMPjpjm/doRFIZ92/BDoVvxTfYmGH91YVLllwqq/rd11IXucxOZ6w4AhZNwAk/ACVzhZkE9yCuCzzgPRaPmD3VHYW7sUwdfKBiiaeY34i+cWyr+eArGvw7GfxXQQm3cO7xwAGJJz57K6qNOxTJMcrF7RfUmJ6rW4a31qIzE7mlfVPGGNyj8lWvbtrGzVDhwB0zhSyXbXEwRCYx/8/Anb6/Y1DRnNCXYlZ+eOAAq2aX9Hx4dlrW0IktWmxm6wkpxMsEuW2qdkOre9rrwQHGy8HeqbQOROox7vR1VfaodutZB7SVrMP5XImpw8XP1x33sBQ7PHAAVlpZlsldmEWK2F4X3Lk+1AzWDNRhV+Ei5jypMjN67Hm/6lWgdnuedTNzPGXX9vTE11thdP+Nd93OP5+ipAyAIy3pH54ZCwRcAxJcrtOQlOCViSqr1wrLWHDT3P7Wt8TRfLqaSLQeLtr5VdWxo5uXCMFZKJbETjwhkm4bf48P4D5hm9MJCLOyZDxeeOwAC78cdWfIhPe2z2JFXSfGEZak1Xe2rN5fcbsaYpNPcdudiw5AwenEVjL42LQ/lEchmhyoWDoBk3tZnXioMe8WWku7tdajfH2Eo6PPoEN4YVWrjsw0Vr+M5V3uHHeKcKppc3jf22aCUS1G1X4pBOxcjst6HgfbQsFRbe0PouanIc+seGwdABaZlm+yVW6AxbhHgh3yougjz7xHK2mjGrI1eVxszcWY35wLGUiHpTzRBiOXXrMtEDsIhR2VhG++uhorHpojm6i12htbWH/kmFMh3G424KjUh3sEXhVehUDulUDtjltwpLXNn58Lqt93A0dI7fKoyQvMChpqnhJwHJZqHnvtzkPcpbuTv2zyU9a32+vDPOeFn5wCIHAwUugufB1dxIsoPWOAQDkmldsIo8ad2G0K9j36FQWEZ6F9QgyomBo2ANWSZ1qBpmIP73nxrkMo16/TTakNWqNYIGbVWzKiRAVGLzrlaYVg4i1pLyBMgj7lwNvOUtA1+hh/4YIVRqbva60PfZ4UJYFg6ACKJagJKGv8LANli5CZMjYcfA1Ttl8r6B25v/iRTrI2L+gQCRuA3AKs7BpMS02c/MRCJWbEvc2rzTyaPtQMgsImvA7/HT9+u5z6ZdH1dFgwMobf/i1x6+zMxzt4BEHC/b+eUiXwdXpoMoNrvm23mfOEASE0SIwafBeDZpak2ulSlwACMfy9G+C3n+ql2Mse+mXBBhNK4aZo8MbkQ+lozwIEB0k3SUb8YP3HmGwdAYGnSBM2cAtGb6VofmgEuDJBOkm56ObEnFy585QCogDRtkuZOg/B1uRRYP6MZKDQDpIukk15N6c2nPL7pA0hTSNnSh+XFpFxdDotGpCm/DvKYAVrsBXM27uxssJfxQvPff4efHYDNNi00GgjIxzBc6NP+o18j9i0DtHpvTF3n5gKexeDKd02AySSQAKKRQ+ejGvb05Hv6WjNQDAZI10jn/G78xI3vawApApZYL/7bGLN+D5oEoZRw/VMzUBAGUOU3Yfx3dMZ37PFllX8yEaXkAOyy2XsRSuNxFOz0yYXV15qBXBmAtb+JybzXFnuvvlzx5fqc75sAkwtOAqIdVdE54/utySeXTV97wwDpEulUqRk/sVlyNYBUFWnti9yMtQV+qJsEqazo304ZoCo/3vrf7WjAbkQlepS0AyCZtfRFzsenwl/h7/wSlaEuVhEYwFv/Jfx9tbMh/FIRkmeTZMk1ASYzSwIcHtxyARbb/C7WZCqLVXcnc6Cvs2AAOkK6QjpT6sZPrJR8DSBV9Cu2jn4mEA48iNpAU2q4/q0ZIAbwxu+JRWI3dTdW/qlcGCkrB5AUKpoFfycN4x4UfmYyTJ/LlwH08O8XMev2jgvCD5UbCyXfBEgnUFTt/l2ZH8+1lLof9yPp4uiwsmAgQjpAulCOxk8SLssaQKpqx9cZCDyAAUSXpYbr36XNAI3mM83YLX6aulsMiZS9A0iS2tpn0hZVP0L/wPxkmD6XHgNo57+MzuDbOhpC60uvdNmXSDuAiZzJ1r7oFVKqu7HO/Wcn3tJXvmZAqdeVknd1NARpGjma/fogBsqyD2AK0SsoyJPtz6w+V2EHF7wtdk0RV9/yAQMkQ5IlyZRkC8ja+FPkpmsAKWQc8XPt2kDLnMtvMKT8DmoEZx9xXwfwZUCp19DBd1/nnqceFtdcE+ML1Ftk2gE45L95wFyBPaxvRb/ppQ4f0dE8YUA9B2u/v6su1O1J9j7LVDuALAW2YnvkvEDQuAUVyev0HIMsyStSdHvMvhSPxaLWA90LwjuKlE1JJqsdQI5ivaR36KRwoOLLhiG+hlrB3ByT0Y/lxYDabVnil5HY2G82LKx5L6+kyvRh7QAKIPjmPnMJ+gm+js+IV4LQigIkqZPIwAB68MZQ+3oS7ftfdDWENmWIpoMdMqAdgEOinERbsfXj4wLhqmtQI7gG4wkuxjP6K4sT4qaPA3tXz6MDf20sMrK2u/HoD6d/RMdwwoB2AE5YyiFO64tDs0QgfCW22b4WW2pfBKI111nwiDc9dtVVW/Df4yIWebLjgpp9WTyuozpkQCulQ6LyibZsy6FTQhWhy/ApsQU1g0uQlt7oND2hQ3jTb8C0vE5zzHx6/UUz3kkfTYcWigHtAArFpMN0Prv29fDsM868ED3XcAaipezHF+B7PbjoBBed+8SOLQP19aZDKnW0AjCgHUABSMwniZbNgyeK6qoLUeO90JACZ1mH9ML5pMn4Wcy8VAOWEi+gnC+I4ZEXOhfXHmCMt+ShaQfATMRLevZUVtaeWg/BLMAMxXNhMOeilnAWrn31dSHeW6/egKG/gpl3+BPbRwff7t/UNGeUGeVlDUc7AB+If0lPT7CqqvFMFRDnYiGTs9GxeAYcwxwY12xUnWd5WQRU39E5p/YCyx502P1ZWdZrMiZeGRnZumtTU1PUS2w67+kZ0A5geo5Yx1i09a2q2vDM0wMqAIdgnSwNeTwAn4A+dJzVCRAwXR+rhKzEuQLfIsIIC+NbOtUokk2NCMLH8JaOIJwWSBmTQtGb+iDCPoBxvy+kwlm8ryw6G+/GZGzPYGT/m9saT9PrLIIYvx7/H1IyCcsl4M1WAAAAAElFTkSuQmCC"),
  18818. pathStart: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  18819. };
  18820. n.prototype.setScene = function(e) {
  18821. this.createCpm(e),
  18822. this.createBunnyObj(e)
  18823. }
  18824. ,
  18825. n.prototype.updateModel = function() {
  18826. this.model = this.modelManager.getActiveModel()
  18827. }
  18828. ,
  18829. n.prototype.bindEvents = function() {
  18830. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  18831. }
  18832. ,
  18833. n.prototype.updateDefaultsFromModelData = function() {
  18834. this.model.data
  18835. }
  18836. ,
  18837. n.prototype.pointPathDistance = function(e) {
  18838. for (var t = 0, i = 1; i < e.length; i += 1)
  18839. t += e[i - 1].distanceTo(e[i]);
  18840. return t
  18841. }
  18842. ,
  18843. n.prototype.pointPathLengths = function(e) {
  18844. for (var t = [0], i = 1; i < e.length; i += 1)
  18845. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18846. return t
  18847. }
  18848. ,
  18849. n.prototype.interpAlongPath = function(e, t, i) {
  18850. var n, o = new r.Vector3, a = t[t.length - 1];
  18851. if (i < 1) {
  18852. n = i * a;
  18853. for (var s = 1; s < t.length; s += 1)
  18854. if (t[s] > n) {
  18855. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  18856. return o.copy(e[s]),
  18857. o.sub(e[s - 1]),
  18858. o.multiplyScalar(l),
  18859. o.add(e[s - 1]),
  18860. o
  18861. }
  18862. } else
  18863. o.copy(e[e.length - 1]);
  18864. return o
  18865. }
  18866. ,
  18867. n.prototype.pathHeight = function() {
  18868. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  18869. }
  18870. ,
  18871. n.prototype.createBunnyObj = function(e) {
  18872. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  18873. this.bunnyObj.visible = c.warp.showBunny),
  18874. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18875. e.add(this.bunnyObj)
  18876. }
  18877. ,
  18878. n.prototype.createCpm = function(e) {
  18879. if (!this.currentPanoMarker) {
  18880. var t = this.makeWaypointObj(w.pathEnd, "Current");
  18881. t.material.uniforms.opacity.value = 0,
  18882. this.currentPanoMarker = {
  18883. mesh: t,
  18884. placed: !1
  18885. }
  18886. }
  18887. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18888. this.placeCpm(),
  18889. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18890. }
  18891. ,
  18892. n.prototype.placeCpm = function() {
  18893. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18894. var e = this.player.currentPano.floor;
  18895. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18896. e.add(this.currentPanoMarker.mesh)),
  18897. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18898. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18899. this.currentPanoMarker.placed = !0
  18900. } else
  18901. this.popOutCpm()
  18902. }
  18903. ,
  18904. n.prototype.fadeInCpm = function(e) {
  18905. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18906. }
  18907. ,
  18908. n.prototype.fadeOutCpm = function(e) {
  18909. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18910. }
  18911. ,
  18912. n.prototype.popInCpm = function() {
  18913. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18914. }
  18915. ,
  18916. n.prototype.popOutCpm = function() {
  18917. this.fadeOutCpm(2)
  18918. }
  18919. ,
  18920. n.prototype.brushPrefs = {
  18921. linewidth: 7,
  18922. strokeWidth: 15,
  18923. cvSegments: 48,
  18924. paveStep: .1,
  18925. paveWidth: .2,
  18926. lookBlendDist: 3,
  18927. maxTurn: r.Math.degToRad(2)
  18928. },
  18929. n.prototype.panoPathDistance = function(e) {
  18930. var t = this.model.panos;
  18931. if (!e || e.length < 2)
  18932. return 0;
  18933. for (var i = [], n = 0; n < e.length; n += 1)
  18934. i.push(t.get(e[n]).floorPosition);
  18935. return this.pointPathDistance(i)
  18936. }
  18937. ,
  18938. n.prototype.loadTileTexture = function(e) {
  18939. var t = v.load(e, function(t) {
  18940. t.wrapS = r.RepeatWrapping,
  18941. t.wrapT = r.RepeatWrapping,
  18942. t.needsUpdate = !0,
  18943. y.debug('path texture "' + e + '" is ready')
  18944. }, function() {
  18945. y.error('path texture "' + e + '" failed')
  18946. });
  18947. return t.mapping = r.UVMapping,
  18948. t
  18949. }
  18950. ,
  18951. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18952. var a = {
  18953. cameraMode: n,
  18954. position: e,
  18955. quaternion: t,
  18956. panoId: i,
  18957. orthoZoom: o,
  18958. floorVisibility: r,
  18959. thumbUrl: null,
  18960. name: null
  18961. };
  18962. return new f(a)
  18963. }
  18964. ,
  18965. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18966. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18967. }
  18968. ,
  18969. n.prototype.setWarpDestination = function(e) {
  18970. this.warpDestHeroLoc = e
  18971. }
  18972. ,
  18973. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  18974. var t = this.getHeroDescriptorByHeroIndex(e);
  18975. return null !== t && (this.setWarpDestination(t),
  18976. !0)
  18977. }
  18978. ,
  18979. n.prototype.setWarpDestinationByPano = function(e, t) {
  18980. var i = this.model.panos.get(e.id);
  18981. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  18982. }
  18983. ,
  18984. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  18985. var i = this.model.panos.get(e);
  18986. if (i) {
  18987. t = t || new r.Quaternion;
  18988. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18989. return this.setWarpDestination(n),
  18990. !0
  18991. }
  18992. return !1
  18993. }
  18994. ,
  18995. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18996. var t = this.model.heroCount();
  18997. if (null !== this.warpDestHeroLoc && t < 2)
  18998. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18999. this.model.getHeroDescriptorByIndex(0);
  19000. var i = this.model.getHeroDescriptorByIndex(e);
  19001. if (i) {
  19002. var n = i.isPano() ? i.panoId : i.cameraMode;
  19003. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19004. }
  19005. return i
  19006. }
  19007. ,
  19008. n.prototype.getHeroDescriptorByPano = function(e) {
  19009. var t = this.model.panos.get(e.id);
  19010. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19011. }
  19012. ,
  19013. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19014. var t = this.getHeroIndexFromPanoId(e);
  19015. return this.getHeroDescriptorByHeroIndex(t)
  19016. }
  19017. ,
  19018. n.prototype.getHeroIndexFromPanoId = function(e) {
  19019. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19020. var i = this.model.heroLocations[t]
  19021. , n = this.getHeroId(i);
  19022. if (n && n === e)
  19023. return t
  19024. }
  19025. return -1
  19026. }
  19027. ,
  19028. n.prototype.getHeroPano = function(e) {
  19029. if (null === e)
  19030. return y.warn("getHeroPano(): no destination"),
  19031. null;
  19032. var t = this.getHeroId(e)
  19033. , i = this.model.panos.get(t);
  19034. return void 0 === i && (i = null,
  19035. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19036. i
  19037. }
  19038. ,
  19039. n.prototype.getHeroId = function(e) {
  19040. return e.panoId
  19041. }
  19042. ,
  19043. n.prototype.setWarpDestPano = function() {
  19044. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19045. this.warpDestPano
  19046. }
  19047. ,
  19048. n.prototype.brushToWarpPano = function(e, t) {
  19049. if (this.discardPathObject(),
  19050. !this.setWarpDestPano())
  19051. return !1;
  19052. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19053. !this.warpDestPano)
  19054. return y.info("No brush"),
  19055. !1;
  19056. if (!this.player.currentPano)
  19057. return y.debug("No current pano, visibility undefined"),
  19058. !1;
  19059. if (!this.warpDestPano)
  19060. return y.info("No wPano, visibility undefined"),
  19061. !1;
  19062. if (!this.warpDestPano.isAligned())
  19063. return y.debug("Cannot brush to unaligned pano"),
  19064. !1;
  19065. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19066. , n = !0;
  19067. if (this.player.currentPano.id === this.warpDestPano.id)
  19068. y.debug("Already at destination pano");
  19069. else {
  19070. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19071. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19072. this.obj3d = new r.Object3D,
  19073. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19074. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19075. e = t) : (this.setPathHulls(this.nodes),
  19076. this.setFloorCurves(),
  19077. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19078. this.player.currentPano.floor.add(this.obj3d);
  19079. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19080. , s = e === l.STD;
  19081. if (!n && (i || s)) {
  19082. if (o) {
  19083. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19084. this.obj3d.add(h)
  19085. }
  19086. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19087. this.obj3d.add(u)
  19088. }
  19089. this.appearSlow()
  19090. }
  19091. return this.upcomingTransType = e,
  19092. !n
  19093. }
  19094. ,
  19095. n.prototype.findShortestPath = function(e, t) {
  19096. if (!e || !t)
  19097. return null;
  19098. var i = c.warp.walkExtraPanosDistance
  19099. , n = e.id + ":" + t.id + ":" + i;
  19100. if (this.shortPaths.hasOwnProperty(n))
  19101. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19102. var r = t.id + ":" + e.id + ":" + i;
  19103. if (this.shortPaths.hasOwnProperty(r))
  19104. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19105. var o = this.model.panos.aStarSearch(e, t);
  19106. return this.model.panos.includeNodesNearPath(o, i),
  19107. this.shortPaths[n] = o ? o.slice() : null,
  19108. o
  19109. }
  19110. ,
  19111. n.prototype.makePathHulls = function(e) {
  19112. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19113. t = u.get(e[0]),
  19114. r = t.floor.floorIndex;
  19115. for (var d = 0; d < e.length; d += 1)
  19116. t = u.get(e[d]),
  19117. i = t.floorPosition.clone().sub(this.model.position),
  19118. i.y += this.pathHeight(),
  19119. s.push(i),
  19120. l.push(t.position.clone()),
  19121. n = t.floor.floorIndex,
  19122. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19123. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19124. o > a && (a = o));
  19125. return a > this.longestStep && (this.longestStep = a,
  19126. y.debug("path contains " + a + " meter segment")),
  19127. {
  19128. floor: s,
  19129. camera: l,
  19130. color: h
  19131. }
  19132. }
  19133. ,
  19134. n.prototype.makeFloorCurves = function(e, t, i) {
  19135. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19136. , o = this.pointPathDistance(e) - 2 * n
  19137. , s = e.slice(0)
  19138. , l = s[1].clone().sub(s[0]);
  19139. l.y = 0,
  19140. l.normalize().multiplyScalar(n),
  19141. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19142. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19143. l.y = 0,
  19144. l.normalize().multiplyScalar(n),
  19145. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19146. var h = new r.CatmullRomCurve3(s)
  19147. , u = Math.floor(o / i);
  19148. u = 4 * Math.floor(u / 4),
  19149. u = Math.max(4, u);
  19150. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19151. f = 0,
  19152. d = g[A].distanceTo(e[0]);
  19153. for (var y = 1; y < e.length; y += 1)
  19154. v.copy(g[A]).sub(e[y]),
  19155. v.y *= 4,
  19156. p = v.length(),
  19157. p < d && (f = y);
  19158. m.push(t[f])
  19159. }
  19160. return {
  19161. distance: o,
  19162. points: g,
  19163. colors: m
  19164. }
  19165. }
  19166. ,
  19167. n.prototype.makeCameraCurvePoints = function(e, t) {
  19168. var i = this.pointPathDistance(e)
  19169. , n = new r.CatmullRomCurve3(e);
  19170. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19171. }
  19172. ,
  19173. n.prototype.makeCameraCurveTangents = function(e, t) {
  19174. var i = this.pointPathDistance(e)
  19175. , n = new r.CatmullRomCurve3(e)
  19176. , o = Math.max(2, Math.floor(i / t));
  19177. o || (o = 5);
  19178. for (var a = [], s = 0; s <= o; s++)
  19179. a.push(n.getTangentAt(s / o));
  19180. return a
  19181. }
  19182. ,
  19183. n.prototype.setPathHulls = function(e) {
  19184. var t = this.makePathHulls(e);
  19185. this.floorHull = t.floor,
  19186. this.cameraHull = t.camera,
  19187. this.colorHull = t.color
  19188. }
  19189. ,
  19190. n.prototype.setFloorCurves = function() {
  19191. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19192. this.floorPathDistance = e.distance,
  19193. this.floorCurvePoints = e.points,
  19194. this.floorCurveColors = e.colors
  19195. }
  19196. ,
  19197. n.prototype.setCameraCurvePoints = function() {
  19198. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19199. }
  19200. ,
  19201. n.prototype.chooseWarpPath = function(e) {
  19202. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19203. if (this.player.currentPano === this.warpDestPano || !e)
  19204. return this.warpPathPoints = null,
  19205. this.warpLength = 0,
  19206. !1;
  19207. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19208. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19209. t = this.warpDestPano.position.clone().sub(o.position),
  19210. i = t.clone().negate(),
  19211. t.multiplyScalar(.15).add(o.position),
  19212. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19213. t.y = o.position.y,
  19214. i.y = this.warpDestPano.position.y,
  19215. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19216. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19217. this.setCameraCurvePoints(),
  19218. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19219. this.warpLength = 0,
  19220. this.warpPathLengths = [0];
  19221. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  19222. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19223. var p = s.length();
  19224. s.y *= c.warp.climbEffort;
  19225. var f = s.length() / p;
  19226. if (d > 1) {
  19227. s.setY(0).normalize(),
  19228. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19229. var g = Math.min(1, s.dot(l))
  19230. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19231. f = Math.max(m, f)
  19232. }
  19233. this.warpLength += p * f,
  19234. this.warpPathLengths[d] = this.warpLength
  19235. }
  19236. return !0
  19237. }
  19238. ,
  19239. n.prototype.drawPathRibbon = function(e, t) {
  19240. this.bunnyObj.visible = c.warp.showBunny;
  19241. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  19242. h.copy(e[u]),
  19243. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19244. h.normalize(),
  19245. n.crossVectors(h, A.UP),
  19246. n.multiplyScalar(i);
  19247. var d = (new r.Vector3).copy(e[u]).add(o);
  19248. d.sub(n),
  19249. l.vertices.push(d),
  19250. d = (new r.Vector3).copy(e[u]).add(o),
  19251. d.add(n),
  19252. l.vertices.push(d)
  19253. }
  19254. var p, f = 0;
  19255. for (u = 0; u < e.length - 1; u += 1) {
  19256. var g = 2 * u
  19257. , v = f;
  19258. f += e[u + 1].distanceTo(e[u]);
  19259. var y = f
  19260. , C = t[u]
  19261. , I = t[u + 1];
  19262. p = new r.Face3(g,g + 1,g + 2),
  19263. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19264. l.faces.push(p),
  19265. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19266. p = new r.Face3(g + 2,g + 1,g + 3),
  19267. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19268. l.faces.push(p),
  19269. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19270. }
  19271. l.computeFaceNormals(),
  19272. l.computeVertexNormals();
  19273. var E, b;
  19274. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19275. b.map.value = w.path,
  19276. b.opacity.value = 0,
  19277. b.color.value.set(c.path.color),
  19278. E = new r.RawShaderMaterial({
  19279. side: r.DoubleSide,
  19280. depthWrite: !1,
  19281. transparent: !0,
  19282. vertexShader: m.ribbon.vertexShader,
  19283. fragmentShader: m.ribbon.fragmentShader,
  19284. uniforms: b,
  19285. name: "ribbonT",
  19286. opacity: 0
  19287. })) : E = new r.MeshBasicMaterial({
  19288. color: 16777215,
  19289. side: r.DoubleSide,
  19290. name: "ribbonOut",
  19291. vertexColors: r.VertexColors
  19292. });
  19293. var _ = new r.Mesh(l,E);
  19294. return _.name = "ribbon",
  19295. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19296. _
  19297. }
  19298. ,
  19299. n.prototype.drawPathPavement = function(e) {
  19300. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19301. s.copy(e[l]),
  19302. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19303. s.normalize(),
  19304. n.crossVectors(s, A.UP),
  19305. n.multiplyScalar(this.brushPrefs.paveWidth),
  19306. t = (new r.Vector3).copy(e[l]),
  19307. t.sub(n),
  19308. o.vertices.push(t),
  19309. o.vertices.push((new r.Vector3).copy(e[l])),
  19310. t = (new r.Vector3).copy(e[l]),
  19311. t.add(n),
  19312. o.vertices.push(t);
  19313. var h, u, d;
  19314. for (l = 0; l < e.length - 1; l += 1)
  19315. h = 3 * l + 1,
  19316. u = l * i,
  19317. d = u + i,
  19318. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19319. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19320. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19321. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19322. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19323. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19324. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  19325. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  19326. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  19327. color: c.path.color,
  19328. side: r.DoubleSide,
  19329. transparent: !0,
  19330. depthWrite: !1,
  19331. opacity: 0,
  19332. name: "paveT",
  19333. map: w.path
  19334. }) : new r.MeshBasicMaterial({
  19335. color: c.path.color,
  19336. side: r.DoubleSide,
  19337. transparent: !0,
  19338. depthWrite: !1,
  19339. opacity: 1,
  19340. name: "paveO",
  19341. map: w.path
  19342. });
  19343. return new r.Mesh(o,p)
  19344. }
  19345. ,
  19346. n.prototype.hintPrefs = {
  19347. rad: .18,
  19348. width: .0125,
  19349. depth: .0625,
  19350. setBack: -.04,
  19351. markRad: .25,
  19352. markInnerRad: .16
  19353. },
  19354. n.prototype.makeWaypointObj = function(e, t) {
  19355. var i = new r.Geometry
  19356. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19357. , o = this.pathHeight();
  19358. i.vertices.push(new r.Vector3(-n,o,n), new r.Vector3(-n,o,-n), new r.Vector3(n,o,-n), new r.Vector3(n,o,n)),
  19359. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  19360. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  19361. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  19362. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  19363. s.map.value = e,
  19364. s.opacity.value = 0,
  19365. s.color.value.set(c.path.color);
  19366. var l = {
  19367. side: r.DoubleSide,
  19368. depthWrite: !1,
  19369. transparent: !0,
  19370. vertexShader: m.waypoint.vertexShader,
  19371. fragmentShader: m.waypoint.fragmentShader,
  19372. uniforms: s,
  19373. name: "waypoint",
  19374. opacity: 0
  19375. };
  19376. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  19377. l.name = "wayPtOut");
  19378. var h = new r.RawShaderMaterial(l)
  19379. , u = new r.Mesh(i,h);
  19380. return u.name = t,
  19381. u
  19382. }
  19383. ,
  19384. n.prototype.makeStartMarker = function(e, t) {
  19385. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  19386. i.y = 0,
  19387. i.normalize();
  19388. var n = Math.acos(i.x)
  19389. , o = this.makeWaypointObj(w.pathStart, "Start");
  19390. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  19391. o.position.copy(e),
  19392. o
  19393. }
  19394. ,
  19395. n.prototype.makeEndMarker = function(e) {
  19396. var t = this.makeWaypointObj(w.pathEnd, "End")
  19397. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19398. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19399. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  19400. t.position.copy(e),
  19401. t
  19402. }
  19403. ,
  19404. n.prototype.pathClean = function(e) {
  19405. if (e) {
  19406. for (var t in e.children)
  19407. this.pathClean(e.children[t]);
  19408. e.geometry && e.geometry.dispose(),
  19409. e.material && e.material.dispose()
  19410. }
  19411. }
  19412. ,
  19413. n.prototype.discardPathObject = function() {
  19414. if (this.obj3d) {
  19415. var e = this.obj3d.parent;
  19416. e && e.remove(this.obj3d),
  19417. this.pathClean(this.obj3d)
  19418. }
  19419. this.obj3d = null,
  19420. this.popInCpm()
  19421. }
  19422. ,
  19423. n.prototype.discardSlow = function() {
  19424. if (this.obj3d) {
  19425. if (this.player.mode !== a.PANORAMA)
  19426. return void this.discardPathObject();
  19427. for (var e, t = this, i = 0, n = function() {
  19428. this.discardPathObject()
  19429. }
  19430. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  19431. e = t.obj3d.children[r],
  19432. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  19433. i += 1,
  19434. n = null);
  19435. 0 === i && this.discardPathObject(),
  19436. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  19437. }
  19438. }
  19439. ,
  19440. n.prototype.appearSlow = function() {
  19441. var e, t = this;
  19442. this.fadeOutCpm(c.path.fadeInTime);
  19443. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  19444. e = t.obj3d.children[n],
  19445. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  19446. }
  19447. ,
  19448. n.prototype.update = function() {
  19449. this.obj3d && this.obj3d.updateMatrixWorld()
  19450. }
  19451. ,
  19452. n.prototype.calcBurnsAmount = function(e) {
  19453. var t = r.Math.degToRad(c.warp.burnsAngle);
  19454. if (this.player.mode === a.PANORAMA) {
  19455. var i = this.burnsDir * t;
  19456. if (this.upcomingTransType === l.BLACK)
  19457. return i;
  19458. var n = e;
  19459. if (null === n)
  19460. return y.warn("Transition request for non-highlight"),
  19461. i;
  19462. var o = this.getHeroDescriptorByHeroIndex(n);
  19463. if (null === o)
  19464. return i;
  19465. if (!o.isPano())
  19466. return i;
  19467. var s = this.getHeroPano(o)
  19468. , h = this.playerControls.cameras[a.PANORAMA]
  19469. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  19470. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  19471. , p = function(e) {
  19472. var i = Math.acos(Math.min(1, e.dot(u)))
  19473. , n = (new r.Vector3).crossVectors(u, e);
  19474. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  19475. };
  19476. if (s === this.player.currentPano)
  19477. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  19478. var f = this.findShortestPath(this.player.currentPano, s);
  19479. if (void 0 === f || null === f || f.length < 1)
  19480. return y.debug("Empty path ahead..."),
  19481. i;
  19482. var g = this.makePathHulls(f)
  19483. , m = new r.CatmullRomCurve3(g.camera)
  19484. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  19485. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  19486. }
  19487. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  19488. }
  19489. ,
  19490. n.prototype.waitNextStep = function(e, t) {
  19491. var i = c.warp.tourStepDelay;
  19492. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  19493. var n = new r.Euler
  19494. , o = new r.Vector3;
  19495. y.debug("Starting wait: " + (void 0 !== t));
  19496. var s = this.calcBurnsAmount(e)
  19497. , h = function() {
  19498. this.endWarpState(),
  19499. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19500. t && t()
  19501. }
  19502. .bind(this)
  19503. , u = function(e, t) {
  19504. if (this.warpInterrupted)
  19505. return h(),
  19506. !0;
  19507. var r = t || 1e3 / 60;
  19508. if (c.warp.doBurns)
  19509. if (this.player.mode === a.PANORAMA) {
  19510. var l = this.playerControls.cameras[a.PANORAMA];
  19511. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  19512. var u = r * s / i;
  19513. n.y += u,
  19514. o.set(0, 0, -1),
  19515. o.applyEuler(n),
  19516. o.add(l.position),
  19517. l.controls.lookAt(o),
  19518. l.controls.lookVector.copy(o),
  19519. l.lookAt(o)
  19520. } else
  19521. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  19522. }
  19523. .bind(this);
  19524. this.startWarpState(),
  19525. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  19526. }
  19527. ,
  19528. n.prototype.warpToNonPano = function(e) {
  19529. if (this.discardPathObject(),
  19530. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  19531. var t = function() {
  19532. e && e()
  19533. }
  19534. .bind(this);
  19535. this.player.flyToNewMode({
  19536. mode: this.warpDestHeroLoc.cameraMode,
  19537. duration: c.warp.outsideTime,
  19538. warpDest: this.warpDestHeroLoc,
  19539. callback: t,
  19540. force: !0
  19541. })
  19542. } else
  19543. y.warn("no warp destination!!!"),
  19544. e && e()
  19545. }
  19546. ,
  19547. n.prototype._resetWarpShaderParams = function(e) {
  19548. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19549. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19550. }
  19551. ,
  19552. n.prototype._clearWarpShading = function() {
  19553. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19554. this._resetWarpShaderParams(e[t]),
  19555. e[t].visible = !0;
  19556. this._resetWarpShaderParams(this.model.skybox)
  19557. }
  19558. ,
  19559. n.prototype._warpStopFlying = function() {
  19560. this.activeTransType = null,
  19561. this.placeCpm()
  19562. }
  19563. ,
  19564. n.prototype._wrapupTravelOnlyBits = function() {
  19565. this._warpStopFlying(),
  19566. this.warpPathPoints && (this.player.currentPano.exit(),
  19567. this.warpDestPano.enter(),
  19568. this.player.currentPano = this.warpDestPano),
  19569. this.player.spider.draw(),
  19570. this.placeCpm()
  19571. }
  19572. ,
  19573. n.prototype._wrapupTravel = function(e) {
  19574. this._wrapupTravelOnlyBits(),
  19575. this.warpCameraAim(e)
  19576. }
  19577. ,
  19578. n.prototype._wrapupWarpShading = function(e) {
  19579. this._clearWarpShading(),
  19580. this._wrapupTravel(e)
  19581. }
  19582. ,
  19583. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  19584. t !== I.END && this._clearWarpShading(),
  19585. this._wrapupTravelOnlyBits(),
  19586. this.upcomingTransType = null,
  19587. e && e()
  19588. }
  19589. ,
  19590. n.prototype._warpCameraAim = function(e, t) {
  19591. var i = this.warpDestHeroLoc.quaternion
  19592. , n = this.playerControls.cameras[a.PANORAMA]
  19593. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  19594. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  19595. , l = s.dot(o)
  19596. , u = r.Math.radToDeg(Math.acos(l))
  19597. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  19598. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19599. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  19600. m.y = h.constrainedTurn(m.y),
  19601. this.burnsDir = Math.sign(m.y);
  19602. var v = new r.Euler(0,0,0,c.warp.eOrder)
  19603. , A = new r.Vector3
  19604. , C = function(e, t) {
  19605. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  19606. v.y = g.y + e * m.y,
  19607. v.z = g.z + e * m.z,
  19608. A.set(0, 0, -1),
  19609. A.applyEuler(v),
  19610. A.add(n.position),
  19611. n.controls.lookAt(A),
  19612. n.controls.lookVector.copy(A),
  19613. void n.lookAt(A))
  19614. }
  19615. .bind(this);
  19616. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.debug("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19617. void (t && t()))
  19618. }
  19619. ,
  19620. n.prototype._warpBendAim = function(e, t, i, n) {
  19621. var o = n || 0
  19622. , s = this.playerControls.cameras[a.PANORAMA]
  19623. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19624. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  19625. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  19626. f.y = h.constrainedTurn(f.y);
  19627. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  19628. f.x = g * Math.sign(f.x),
  19629. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  19630. this.burnsDir = Math.sign(f.y),
  19631. g *= Math.sign(f.y),
  19632. f.y = g;
  19633. var m = new r.Euler(0,0,0,c.warp.eOrder)
  19634. , v = new r.Vector3
  19635. , A = function(e, t) {
  19636. if (e < .5)
  19637. m.x = u.x + e * f.x,
  19638. m.y = u.y + e * f.y,
  19639. m.z = u.z + e * f.z;
  19640. else {
  19641. var i = (1 - e) * c.warp.softBendEnd;
  19642. m.x = l.x - i * f.x,
  19643. m.y = l.y - i * f.y,
  19644. m.z = l.z - i * f.z
  19645. }
  19646. v.set(0, 0, -1),
  19647. v.applyEuler(m),
  19648. v.add(s.position),
  19649. s.controls.lookAt(v),
  19650. s.controls.lookVector.copy(v),
  19651. s.lookAt(v)
  19652. }
  19653. .bind(this);
  19654. return p.start(A, t, i, o, d[c.warp.movementEasing])
  19655. }
  19656. ,
  19657. n.prototype._warpStepCameraAim = function(e, t, i) {
  19658. var n = this.playerControls.cameras[a.PANORAMA]
  19659. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19660. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19661. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  19662. l.y = h.constrainedTurn(l.y),
  19663. this.burnsDir = Math.sign(l.y);
  19664. var u = new r.Euler(0,0,0,c.warp.eOrder)
  19665. , f = new r.Vector3
  19666. , g = function(e, t) {
  19667. e < .5 ? u.copy(s) : u.copy(o),
  19668. f.set(0, 0, -1),
  19669. f.applyEuler(u),
  19670. f.add(n.position),
  19671. n.controls.lookAt(f),
  19672. n.controls.lookVector.copy(f),
  19673. n.lookAt(f)
  19674. }
  19675. .bind(this);
  19676. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  19677. }
  19678. ,
  19679. n.prototype.setBurnsDir = function() {
  19680. var e = this.playerControls.cameras[a.PANORAMA]
  19681. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19682. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  19683. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  19684. n.y = h.constrainedTurn(n.y),
  19685. this.burnsDir = Math.sign(n.y)
  19686. }
  19687. ,
  19688. n.prototype.stepWarpPath = function(e, t) {
  19689. var i = this.playerControls.cameras[a.PANORAMA];
  19690. if (!this.warpPathPoints)
  19691. return i.position.copy(this.warpDestPano.position),
  19692. !0;
  19693. var n = this.warpPathPoints[0]
  19694. , o = this.warpDestPano.position;
  19695. if (null !== this.nodes && this.cameraHull.length > 1) {
  19696. var s = new r.Vector3;
  19697. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  19698. i.position.copy(s)
  19699. } else
  19700. e < .5 ? i.position.copy(n) : i.position.copy(o)
  19701. }
  19702. ,
  19703. n.prototype.interruptAndFastForward = function(e, t) {
  19704. this.warping && (this.warpInterrupted = !0,
  19705. this.warpInterruptionBlackoutStyle = e,
  19706. this.warpInterruptionTravelTime = t,
  19707. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  19708. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  19709. }
  19710. ,
  19711. n.prototype.warpCameraAim = function(e) {
  19712. var t = c.warp.minWarpTime;
  19713. if (this.upcomingTransType === l.BLACK)
  19714. t = c.warp.teleportTime;
  19715. else {
  19716. var i = this.playerControls.cameras[a.PANORAMA]
  19717. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19718. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  19719. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  19720. s.y = h.constrainedTurn(s.y);
  19721. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  19722. t = Math.max(t, u)
  19723. }
  19724. var d = function() {
  19725. this._warpStopFlying(),
  19726. this.discardSlow();
  19727. e && e()
  19728. }
  19729. .bind(this);
  19730. this._warpCameraAim(t, d)
  19731. }
  19732. ,
  19733. n.prototype.warpCommonParameters = function(e, t, i, n) {
  19734. this.model.skybox.material.uniforms.blackout.value = n;
  19735. var r = u.uniform(this.model.skybox, "progress", 1)
  19736. , o = u.allUniforms(this.model.chunks, "progress", 1)
  19737. , a = !1
  19738. , s = function() {
  19739. if (this.warpInterrupted)
  19740. return a = !0,
  19741. !0
  19742. }
  19743. .bind(this)
  19744. , l = function(e, t) {
  19745. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  19746. !0) : void r(e, t)
  19747. }
  19748. .bind(this)
  19749. , h = function(e, t) {
  19750. return i && a ? (o(0),
  19751. !0) : void o(e, t)
  19752. }
  19753. .bind(this);
  19754. p.start(s, e, null, t, null, "safeHaltWatch"),
  19755. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  19756. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  19757. }
  19758. ,
  19759. n.prototype.warpTravel_STD = function(e) {
  19760. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  19761. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  19762. w += this.warpLength * c.warp.timePerMeter,
  19763. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  19764. var _ = !1
  19765. , T = this.warpDestHeroLoc.quaternion
  19766. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  19767. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19768. , M = S.dot(x)
  19769. , R = r.Math.radToDeg(Math.acos(M))
  19770. , P = function(e) {
  19771. var t = o
  19772. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  19773. return i
  19774. }
  19775. , O = function() {
  19776. return E.lookAt(C, t, A.UP),
  19777. s.setFromRotationMatrix(E, c.warp.eOrder),
  19778. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19779. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19780. h.constrainedTurn(b.y)
  19781. }
  19782. .bind(this)
  19783. , L = function(e, t) {
  19784. if (this.warpInterrupted)
  19785. return _ = !0,
  19786. !0
  19787. }
  19788. .bind(this)
  19789. , D = function(e, t) {
  19790. return _ || !this.warpPathPoints ? (g.blur(0),
  19791. !0) : void g.blur(e)
  19792. }
  19793. .bind(this)
  19794. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  19795. , B = function(e, t) {
  19796. return _ || !this.warpPathPoints ? (N(0),
  19797. !0) : void N(e, t)
  19798. }
  19799. .bind(this)
  19800. , F = function(e, t) {
  19801. if (!this.warpPathPoints)
  19802. return n.position.copy(this.warpDestPano.position),
  19803. !0;
  19804. if (_)
  19805. return !0;
  19806. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19807. n.position.copy(i),
  19808. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19809. }
  19810. .bind(this)
  19811. , V = function(e, n) {
  19812. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  19813. !0)
  19814. }
  19815. .bind(this)
  19816. , U = function(e, o) {
  19817. if (_)
  19818. return y.debug(">>>> Walkthrough interupted at t=" + e),
  19819. !0;
  19820. if (!this.warpPathPoints)
  19821. return !0;
  19822. var a = this.warpLength * e
  19823. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  19824. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19825. c.warp.matchCam && (l *= 1 - u),
  19826. E.lookAt(C, t, A.UP),
  19827. s.setFromRotationMatrix(E, c.warp.eOrder),
  19828. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19829. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19830. b.y = h.constrainedTurn(b.y),
  19831. s.x = m.x + l * b.x,
  19832. s.y = m.y + l * b.y,
  19833. s.z = m.z + l * b.z,
  19834. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  19835. b.y = h.constrainedTurn(b.y);
  19836. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  19837. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  19838. v.x = v.x + b.x * c.warp.turnFriction,
  19839. v.y = v.y + b.y * c.warp.turnFriction,
  19840. v.z = v.z + b.z * c.warp.turnFriction,
  19841. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  19842. var p = t.clone().sub(C).normalize();
  19843. if (R < c.warp.maxAimRotation && u > 0) {
  19844. var g = 1 - u;
  19845. p.x = p.x * g + u * S.x,
  19846. p.y = p.y * g + u * S.y,
  19847. p.z = p.z * g + u * S.z,
  19848. p.normalize()
  19849. }
  19850. this.bunnyObj.position.copy(n.position).add(p),
  19851. f.set(0, 0, -1).applyEuler(v).normalize(),
  19852. f.multiplyScalar(8),
  19853. f.add(n.position),
  19854. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  19855. n.controls.lookVector.copy(f),
  19856. n.lookAt(f))
  19857. }
  19858. .bind(this)
  19859. , k = function() {
  19860. _ ? (this.discardSlow(),
  19861. this.upcomingTransType = l.BLACK,
  19862. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  19863. }
  19864. .bind(this);
  19865. V(0);
  19866. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  19867. w += H;
  19868. var G = H / w;
  19869. this.warpCommonParameters(w, G, !0, I.NONE),
  19870. p.start(L, w, null, 0, null, "_haltWatcher"),
  19871. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  19872. p.start(D, w, null, G, P, "blurring")),
  19873. p.start(B, w, null, G, P, "modelAlpha"),
  19874. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  19875. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  19876. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  19877. }
  19878. ,
  19879. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19880. var r = e || 0;
  19881. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  19882. this.warpCommonParameters(t, r, !1, i),
  19883. this.model.chunks.forEach(function(e) {
  19884. e.material.uniforms.blackout.value = i
  19885. }),
  19886. this._warpBendAim(null, t, null, r);
  19887. var o = function() {
  19888. this.wrapupWarpShadingOnly(n, i)
  19889. //xzw 结束时地标变化
  19890. this.player.model.floorLogos[0].position.copy(this.player.model.floorLogos[1].position)
  19891. if(this.player.mode === a.PANORAMA){
  19892. this.player.model.floorLogos[0].material.uniforms.opacity.value = 1;
  19893. this.player.model.floorLogos[1].visible = false;
  19894. }else{
  19895. this.player.model.floorLogos[0].visible = false;
  19896. }
  19897. //-----end
  19898. }
  19899. .bind(this);
  19900. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  19901. }
  19902. ,
  19903. n.prototype.flightStepWalk = function(e, t, i) {
  19904. var n = .001
  19905. , o = 1
  19906. , a = 1.2
  19907. , s = new r.Vector3
  19908. , h = new r.Vector3
  19909. , u = function(e, t) {
  19910. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  19911. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  19912. h.copy(A.FORWARD),
  19913. this.player.getDirection(h),
  19914. s.copy(t).sub(e.position).normalize();
  19915. var l = s.dot(h)
  19916. , u = Math.acos(l)
  19917. , d = u / r;
  19918. return d > n && (r *= d / n,
  19919. u < o && (r *= a)),
  19920. r
  19921. };
  19922. return function(e, t, i) {
  19923. if (this.warpInterrupted)
  19924. i && i();
  19925. else if (this.activeTransType !== l.WALK)
  19926. this._clearWarpShading(),
  19927. this._warpStopFlying(),
  19928. this.player.spider.draw(),
  19929. this.placeCpm(),
  19930. i && i();
  19931. else if (this.player.currentPano !== e) {
  19932. var n = {
  19933. pano: e,
  19934. lookAtPoint: t,
  19935. duration: null,
  19936. maxDistanceOverride: c.warp.walkMaxDist,
  19937. skipWarpingCheck: !1,
  19938. constantMoveSpeed: !0
  19939. };
  19940. n.duration = u.call(this, e, t),
  19941. this.player.nonInterruptingFlyToPano(n, i)
  19942. } else
  19943. i && i()
  19944. }
  19945. }(),
  19946. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  19947. return this.flightStepWalk.bind(this, e, t, i)
  19948. }
  19949. ,
  19950. n.prototype.warpTravel_WALK = function() {
  19951. var e = [];
  19952. return function(t) {
  19953. var i = this.player.model.panos;
  19954. e.length = 0;
  19955. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  19956. var s = this.nodes[a]
  19957. , l = i.get(s);
  19958. a === this.nodes.length - 1;
  19959. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  19960. n && o || (e.push(s),
  19961. n = l)
  19962. }
  19963. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  19964. var h = e.length
  19965. , u = i.get(e[h - 1])
  19966. , d = new Array(h + 1);
  19967. d[d.length - 1] = function() {
  19968. t && t()
  19969. }
  19970. .bind(this);
  19971. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  19972. var g = e[p];
  19973. u = i.get(g);
  19974. var m = new r.Vector3;
  19975. this.getLookAtForWalkingTourNode(e, p, m),
  19976. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  19977. p--
  19978. }
  19979. d[0]()
  19980. }
  19981. }(),
  19982. n.prototype.getLookAtForWalkingTourNode = function() {
  19983. var e = new r.Vector3
  19984. , t = new r.Vector3
  19985. , i = new r.Vector3
  19986. , n = new r.Vector3
  19987. , o = new r.Vector3
  19988. , a = .65
  19989. , s = .75
  19990. , l = .2
  19991. , c = .4
  19992. , h = .2
  19993. , u = 3;
  19994. return function(r, d, p) {
  19995. var f = r.length;
  19996. if (d >= f)
  19997. return !1;
  19998. var g = 1
  19999. , m = 1;
  20000. t.set(0, 0, 0),
  20001. o.set(0, 0, 0);
  20002. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20003. if (v = this.player.model.panos.get(r[A]),
  20004. this.getOrientationForWalkingTourNode(r, A, i),
  20005. A === d && e.copy(i),
  20006. n.copy(i),
  20007. A > d) {
  20008. var y = n.dot(e) < a;
  20009. g *= y ? l : s,
  20010. m *= y ? h : c
  20011. }
  20012. i.multiplyScalar(g),
  20013. t.add(i),
  20014. o.lerp(v.position, m)
  20015. }
  20016. return t.normalize(),
  20017. p.copy(o),
  20018. p.add(t),
  20019. !0
  20020. }
  20021. }(),
  20022. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20023. var n = e.length;
  20024. if (t >= n)
  20025. return !1;
  20026. if (t === n - 1)
  20027. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20028. else {
  20029. var r = this.player.model.panos.get(e[t])
  20030. , o = this.player.model.panos.get(e[t + 1]);
  20031. i.copy(o.position).sub(r.position)
  20032. }
  20033. return i.normalize(),
  20034. !0
  20035. }
  20036. ,
  20037. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20038. if (this.activeTransType = this.upcomingTransType,
  20039. this.lastTransType = this.activeTransType,
  20040. this.upcomingTransType = null,
  20041. !e) {
  20042. var r = function() {
  20043. this._wrapupTravel(n)
  20044. }
  20045. .bind(this)
  20046. , o = {
  20047. pano: this.warpDestPano,
  20048. lookAtPoint: null,
  20049. duration: null,
  20050. maxDistanceOverride: null,
  20051. skipWarpingCheck: !1
  20052. };
  20053. return void this.player.flyToPano(o, r)
  20054. }
  20055. var floorlogoChange = function(){ //xzw add 地标开始变化 因为warpTravel_BLACK将不会是flytopano
  20056. this.player.model.floorLogoFade(0, 450, 0.7);
  20057. this.player.model.floorLogos[1].position.copy(this.warpDestPano.floorPosition.clone().sub(this.player.model.position));
  20058. }.bind(this);
  20059. this.activeTransType === l.BLACK ?( floorlogoChange(), this.warpTravel_BLACK(null, i, t, n) ): this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20060. this._clearWarpShading(),
  20061. this._warpStopFlying(),
  20062. this.player.spider.draw(),
  20063. this.placeCpm(),
  20064. n && n()
  20065. }
  20066. .bind(this)) : this.warpTravel_STD(n)
  20067. }
  20068. ,
  20069. n.prototype.startWarpState = function() {
  20070. this.warping = !0,
  20071. this.warpInterrupted = !1,
  20072. this.warpInterruptionBlackoutStyle = null,
  20073. this.warpInterruptionTravelTime = null
  20074. }
  20075. ,
  20076. n.prototype.endWarpState = function() {
  20077. this.warping = !1
  20078. }
  20079. ,
  20080. n.prototype.warpToPano = function(e, t, i, n) {
  20081. if (this.warping)
  20082. return void y.warn("Cannot warp when already warping");
  20083. if (this.upcomingTransType = e,
  20084. this.activeTransType = null,
  20085. !this.setWarpDestPano())
  20086. return this.upcomingTransType = null,
  20087. void this.warpToNonPano(n);
  20088. if (this.player.mode !== a.PANORAMA)
  20089. return this.upcomingTransType = null,
  20090. this.discardSlow(),
  20091. void this.player.flyToNewMode({
  20092. mode: a.PANORAMA,
  20093. pano: this.warpDestPano,
  20094. duration: c.warp.outsideTime,
  20095. warpDest: this.warpDestHeroLoc,
  20096. callback: n,
  20097. force: !0
  20098. });
  20099. if (!this.warpDestPano)
  20100. return y.warn("no warp destination, callback dropped"),
  20101. void (this.upcomingTransType = null);
  20102. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  20103. , o = this.chooseWarpPath(r);
  20104. if (o && this.upcomingTransType !== l.WALK) {
  20105. var s = function() {
  20106. this.waitingToWarp = !1,
  20107. this.warpToPano(e, t, i, n)
  20108. }
  20109. .bind(this);
  20110. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20111. return void (this.waitingToWarp = !0)
  20112. }
  20113. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20114. this.player.currentPano = this.warpDestPano,
  20115. this.placeCpm(),
  20116. this.fadeOutCpm(c.path.fadeOutTime),
  20117. this.player.spider.draw()),
  20118. y.debug("Warping to pano ", this.warpDestPano.position),
  20119. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20120. this.startWarpState();
  20121. var h = function() {
  20122. this.endWarpState(),
  20123. n && n()
  20124. }
  20125. .bind(this);
  20126. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h),
  20127. this.player.smoothZoomToDefault(c.zoom.restoreTime)
  20128. }
  20129. ,
  20130. t.exports = n
  20131. }
  20132. ).call(this, "/js/objects/ShowPath.js")
  20133. }
  20134. , {
  20135. "../constants": 8,
  20136. "../effects": 16,
  20137. "../enum/BlackoutStyle": 18,
  20138. "../enum/ModelManagerEvents": 33,
  20139. "../enum/PlayerEvents": 40,
  20140. "../enum/RenderOrder": 42,
  20141. "../enum/Vectors": 50,
  20142. "../enum/Viewmode": 51,
  20143. "../enum/WarpStyle": 52,
  20144. "../gui/gui": 65,
  20145. "../model/ModelManager": 140,
  20146. "../objects/Snapshot": 153,
  20147. "../settings": 166,
  20148. "../shaders": 167,
  20149. "../util/easing": 186,
  20150. "../util/lerp": 188,
  20151. "../util/logger": 189,
  20152. "../util/math": 190,
  20153. "../util/texture": 194,
  20154. "../util/transitions": 195,
  20155. three: 217
  20156. }],
  20157. 152: [function(e, t, i) {//"./objects/Skybox"
  20158. "use strict";
  20159. function n() {
  20160. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20161. , t = new r.RawShaderMaterial({
  20162. fragmentShader: o.skysphere.fragmentShader,
  20163. vertexShader: o.skysphere.vertexShader,
  20164. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20165. side: r.BackSide,
  20166. name: "skysphere"
  20167. });
  20168. t.uniforms.radius.value = e.parameters.radius,
  20169. r.Mesh.call(this, e, t)
  20170. }
  20171. var r = e("three")
  20172. , o = e("../shaders")
  20173. , a = e("../settings");
  20174. n.prototype = Object.create(r.Mesh.prototype),
  20175. n.prototype.constructor = n,
  20176. t.exports = n
  20177. }
  20178. , {
  20179. "../settings": 166,
  20180. "../shaders": 167,
  20181. three: 217
  20182. }],
  20183. 153: [function(e, t, i) {///js/objects/Snapshot.js
  20184. (function(i) {
  20185. "use strict";
  20186. function n(e) {
  20187. o.call(this, e),
  20188. this.panoId = e.panoId,
  20189. this.orthoZoom = e.orthoZoom,
  20190. this.floorVisibility = e.floorVisibility,
  20191. this.thumbUrl = e.thumbUrl,
  20192. this.name = e.name
  20193. }
  20194. var r = (e("three"),
  20195. e("../util/logger"))
  20196. , o = (e("../settings"),
  20197. e("../enum/Viewmode"),
  20198. e("../util/common"),
  20199. e("../util/transitions"),
  20200. e("../util/lerp"),
  20201. e("../util/ajax"),
  20202. e("../util/texture"),
  20203. e("./View"));
  20204. e("events").EventEmitter,
  20205. new r(i);
  20206. n.prototype = Object.create(o.prototype),
  20207. n.prototype.isPano = function() {
  20208. return this.panoId && "" !== this.panoId
  20209. }
  20210. ,
  20211. t.exports = n
  20212. }
  20213. ).call(this, "/js/objects/Snapshot.js")
  20214. }
  20215. , {
  20216. "../enum/Viewmode": 51,
  20217. "../settings": 166,
  20218. "../util/ajax": 181,
  20219. "../util/common": 185,
  20220. "../util/lerp": 188,
  20221. "../util/logger": 189,
  20222. "../util/texture": 194,
  20223. "../util/transitions": 195,
  20224. "./View": 154,
  20225. events: 202,
  20226. three: 217
  20227. }],
  20228. 154: [function(e, t, i) {///js/objects/View.js
  20229. (function(i) {
  20230. "use strict";
  20231. function n(e) {
  20232. e = e || {},
  20233. this.position = new r.Vector3,
  20234. this.quaternion = new r.Quaternion,
  20235. this.update(e)
  20236. }
  20237. var r = e("three")
  20238. , o = e("../util/logger")
  20239. , a = (e("../settings"),
  20240. e("../enum/Viewmode"),
  20241. e("../util/common"),
  20242. e("../util/transitions"),
  20243. e("../util/lerp"),
  20244. e("../util/ajax"),
  20245. e("../util/texture"),
  20246. e("events").EventEmitter);
  20247. new o(i);
  20248. n.prototype = Object.create(a.prototype),
  20249. n.prototype.isValid = function() {
  20250. return !!this.cameraMode
  20251. }
  20252. ,
  20253. n.prototype.update = function(e) {
  20254. return this.cameraMode = e.cameraMode || this.cameraMode,
  20255. this.pano = e.pano || this.pano,
  20256. e.position && this.position.copy(e.position),
  20257. e.quaternion && this.quaternion.copy(e.quaternion),
  20258. this
  20259. }
  20260. ,
  20261. t.exports = n
  20262. }
  20263. ).call(this, "/js/objects/View.js")
  20264. }
  20265. , {
  20266. "../enum/Viewmode": 51,
  20267. "../settings": 166,
  20268. "../util/ajax": 181,
  20269. "../util/common": 185,
  20270. "../util/lerp": 188,
  20271. "../util/logger": 189,
  20272. "../util/texture": 194,
  20273. "../util/transitions": 195,
  20274. events: 202,
  20275. three: 217
  20276. }],
  20277. 155: [function(e, t, i) {///js/player.js
  20278. (function(i) {
  20279. "use strict";
  20280. function n(e) {
  20281. this.currentPano = null,
  20282. this.nextPano = null,
  20283. this.camera = null,
  20284. this.paused = !1,
  20285. this.flying = !1,
  20286. this.sceneIntersectionPlane = null,
  20287. this.target = new r.Vector3,
  20288. this.mouse = new r.Vector3(1.1,1.1,.5),
  20289. this.mouseAtMouseDown = new r.Vector2,
  20290. this.mouseCouldBeClickToMove = !1,
  20291. this.mouseLastMoveTime = Date.now(),
  20292. this.mouseDown = !1,
  20293. this.mouseDownTimer = null,
  20294. this.couldBeLongTap = !1,
  20295. this.containsMouse = !0,
  20296. this.isTouchEvent = !1,
  20297. this.isPanoHover = !1,
  20298. this.reticule = new a(this),
  20299. this.panoMarkers = [],
  20300. this.spider = new h(this),
  20301. this.quaternion = new r.Quaternion,
  20302. this.position = new r.Vector3(15,10,15),
  20303. this.previousState = null,
  20304. this.lastInsideView = new c,
  20305. this.last360View = new c,
  20306. this.raycaster = new r.Raycaster,
  20307. this.intersect = null,
  20308. this.lastChangeTime = Date.now(),
  20309. this.history = new I,
  20310. this.cameraControls = null,
  20311. this.path = null,
  20312. this.model = null,
  20313. this.domElement = null,
  20314. this.cachedPanoCandidates = null,
  20315. this.basePanoSize = 0,
  20316. this.standardPanoSize = 0,
  20317. this.highPanoSize = 0,
  20318. this.ultraHighPanoSize = 0,
  20319. this.zoomLevel = 1,
  20320. this.zooming = 0,
  20321. this.zoomSpeed = .5,
  20322. this.scrollZoomSpeed = .06,
  20323. this.zoomSpeedAdjust = .05,
  20324. this.defaultZoomIncrement = .2,
  20325. this.baseFov = f.insideFOV,
  20326. this.zoomFov = this.baseFov,
  20327. this.zoomEnabled = !0,
  20328. this.preRenderingEnabled = !1,
  20329. this.setupCustomProperties(e),
  20330. this.zoomStats = new L
  20331. }
  20332. var r = e("three")
  20333. , o = e("./util/logger")
  20334. , a = e("./objects/Reticule")
  20335. , s = e("./objects/Panorama")
  20336. , l = e("./objects/ShowPath")
  20337. , c = e("./objects/View")
  20338. , h = (e("./objects/Snapshot"),
  20339. e("./objects/NSpider"))
  20340. , u = e("./enum/Viewmode")
  20341. , d = (e("./enum/TagStates"),
  20342. e("./enum/Vectors"))
  20343. , p = e("./enum/Keys")
  20344. , f = (e("./enum/AlignmentType"),
  20345. e("./settings"))
  20346. , g = e("./util/common")
  20347. , m = (e("./util/browser"),
  20348. e("./util/math"))
  20349. , v = e("./util/lerp")
  20350. , A = e("./util/easing")
  20351. , y = e("./util/transitions")
  20352. , C = e("events").EventEmitter
  20353. , I = (e("./shaders"),
  20354. e("./util/history"))
  20355. , E = (e("./util/camera"),
  20356. e("./model/ModelManager"),
  20357. e("./enum/PathDiscardMode"))
  20358. , b = e("./enum/PathDisplayMode")
  20359. , w = e("./enum/PlayerEvents")
  20360. , _ = e("./enum/ControlEvents")
  20361. , T = e("./enum/ModelManagerEvents")
  20362. , x = e("./enum/WarpStyle")
  20363. , S = e("./enum/BlackoutStyle")
  20364. , M = e("./exception/BasicException")
  20365. , R = e("./enum/PanoSizeClass")
  20366. , P = (e("./tile/TileDownloader"),
  20367. e("./tile/TilePrioritizer"))
  20368. , O = (e("./enum/PanoramaEvents"),
  20369. e("./enum/ZoomEvents"))
  20370. , L = e("./util/ZoomStats")
  20371. , D = e("./constants")
  20372. , N = e("./util/common")
  20373. , B = e("./util/cameraLight")
  20374. , F = new o(i)
  20375. , V = Object.freeze({
  20376. FlyToPano: y.getUniqueId(),
  20377. FlyToNewMode: y.getUniqueId(),
  20378. FlyToSameMode: y.getUniqueId(),
  20379. FlyToViewFloor: y.getUniqueId(),
  20380. LookTransition: y.getUniqueId(),
  20381. ZoomTransition: y.getUniqueId()
  20382. });
  20383. n.prototype = Object.create(C.prototype),
  20384. n.prototype.init = function(e) {
  20385. this.modelManager = e.modelManager,
  20386. this.tileDownloader = e.tileDownloader,
  20387. this.panoRenderer = e.panoRenderer,
  20388. this.qualityManager = e.qualityManager,
  20389. this.domElement = e.container,
  20390. this.camera = e.camera,
  20391. this.tagManager = e.tagManager,
  20392. this.cameraControls = e.controls,
  20393. this.path = new l(e.director,this,e.controls),
  20394. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  20395. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  20396. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  20397. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  20398. this.tileDownloader.processPriorityQueue = !1,
  20399. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20400. this.bindEvents(e.container),
  20401. this.updateModel()
  20402. }
  20403. ,
  20404. n.prototype.setupCustomProperties = function(e) {
  20405. var t = e || u.PANORAMA;
  20406. Object.defineProperty(this, "mode", {
  20407. get: function() {
  20408. return t
  20409. },
  20410. set: function(e) {
  20411. var i = t;
  20412. t = e,
  20413. this.onModeUpdated(i, t)
  20414. }
  20415. })
  20416. }
  20417. ,
  20418. n.prototype.isInMode = function() {
  20419. for (var e = 0; e < arguments.length; e++)
  20420. if (this.mode === arguments[e])
  20421. return !0;
  20422. return !1
  20423. }
  20424. ,
  20425. n.prototype.isOutsideMode = function(e) {
  20426. return e = e || this.mode,
  20427. e === u.DOLLHOUSE || e === u.FLOORPLAN
  20428. }
  20429. ,
  20430. n.prototype.is360View = function(e, t) {
  20431. return e === u.PANORAMA && t && !t.isAligned()
  20432. }
  20433. ,
  20434. n.prototype.setScene = function(e) {
  20435. this.sceneIntersectionPlane = e.plane,
  20436. this.path.setScene(e),
  20437. this.moveReticuleToScene(e)
  20438. }
  20439. ,
  20440. n.prototype.moveReticuleToScene = function(e) {
  20441. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20442. e.add(this.reticule)
  20443. }
  20444. ,
  20445. n.prototype.updateModel = function() {
  20446. function e(e, t, n) {
  20447. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  20448. }
  20449. function t(e, t) {
  20450. if (this.mode === u.DOLLHOUSE) {
  20451. var n = e ? this.model.center.y : n = t.center.y;
  20452. i.call(this, n)
  20453. }
  20454. }
  20455. function i(e) {
  20456. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  20457. , i = this.cameraControls.controls[u.DOLLHOUSE]
  20458. , n = t.position.y + (e - i.target.y)
  20459. , r = f.showFloorDuration + f.showFloorDelay;
  20460. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  20461. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  20462. }
  20463. this.model = this.modelManager.getActiveModel(),
  20464. this.model.on("floor.changed", e.bind(this)),
  20465. this.model.on("allfloors.toggled", t.bind(this)),
  20466. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  20467. }
  20468. ,
  20469. n.prototype.updateModelDependentData = function() {
  20470. this.cameraControls.setModelForControls(this.model),
  20471. this.getPanoMarkersFromModel(this.model)
  20472. }
  20473. ,
  20474. n.prototype.onModelChanged = function() {
  20475. this.updateModel(),
  20476. this.updateModelDependentData()
  20477. }
  20478. ,
  20479. n.prototype.getPanoMarkersFromModel = function(e) {
  20480. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20481. return t.marker ? e.concat(t.marker) : e
  20482. }, [])
  20483. }
  20484. ,
  20485. n.prototype.handleControlMove = function(e) {
  20486. this.emit(w.Move, e)
  20487. }
  20488. ,
  20489. n.prototype.handleControlInputStart = function(e) {
  20490. this.emit(w.InputStart, e)
  20491. }
  20492. ,
  20493. n.prototype.onModeUpdated = function(e, t) {
  20494. this.cameraControls.activateControls(t),
  20495. this.emit(w.ModeChanged, e, t)
  20496. }
  20497. ,
  20498. n.prototype.isWarping = function() {
  20499. return this.path.warping
  20500. }
  20501. ,
  20502. n.prototype.isWaitingToWarp = function() {
  20503. return this.path.waitingToWarp
  20504. }
  20505. ,
  20506. n.prototype.getLabelScaleFactor = function() {
  20507. if (this.isOutsideMode()) {
  20508. var e = 10
  20509. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  20510. return t
  20511. }
  20512. return .5
  20513. }
  20514. ,
  20515. n.prototype.bindEvents = function(e) {
  20516. e !== document && e.setAttribute("tabindex", -1),
  20517. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20518. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20519. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20520. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20521. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20522. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  20523. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20524. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20525. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20526. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20527. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20528. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20529. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20530. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20531. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20532. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  20533. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  20534. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  20535. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this))
  20536. }
  20537. ,
  20538. n.prototype.onMouseDown = function(e) {
  20539. e.currentTarget !== document && e.currentTarget.focus(),
  20540. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20541. this.updateIntersect())
  20542. }
  20543. ,
  20544. n.prototype.onMouseMove = function(e) {
  20545. this.isTouchEvent = !1,
  20546. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20547. }
  20548. ,
  20549. n.prototype.onMouseOver = function(e) {
  20550. this.containsMouse = !0,
  20551. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20552. }
  20553. ,
  20554. n.prototype.onMouseOut = function(e) {
  20555. this.containsMouse = !1
  20556. }
  20557. ,
  20558. n.prototype.onMouseUp = function(e) {
  20559. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20560. }
  20561. ,
  20562. n.prototype.onTouchStart = function(e) {
  20563. if (e.currentTarget !== document && e.currentTarget.focus(),
  20564. !this.mouseDown) {
  20565. this.couldBeLongTap = !0;
  20566. var t = g.average(e.changedTouches, "clientX")
  20567. , i = g.average(e.changedTouches, "clientY");
  20568. this.handleInputStart.call(this, t, i, !0),
  20569. this.mouseDownTimer = setTimeout(function() {
  20570. this.updateIntersect(),
  20571. this.handleInputEnd.call(this, t, i, !0)
  20572. }
  20573. .bind(this), f.input.longTapThreshold)
  20574. }
  20575. }
  20576. ,
  20577. n.prototype.onTouchMove = function(e) {
  20578. var t = g.average(e.changedTouches, "clientX")
  20579. , i = g.average(e.changedTouches, "clientY");
  20580. this.handleInputMove.call(this, t, i, !0)
  20581. }
  20582. ,
  20583. n.prototype.onTouchEnd = function(e) {
  20584. if (clearTimeout(this.mouseDownTimer),
  20585. this.mouseDown) {
  20586. this.couldBeLongTap = !1,
  20587. this.updateIntersect();
  20588. var t = g.average(e.changedTouches, "clientX")
  20589. , i = g.average(e.changedTouches, "clientY");
  20590. this.handleInputEnd.call(this, t, i, !0)
  20591. }
  20592. }
  20593. ,
  20594. n.prototype.onPointerDown = function(e) {
  20595. return e.currentTarget !== document && e.currentTarget.focus(),
  20596. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20597. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20598. void (this.mouseDownTimer = setTimeout(function() {
  20599. this.updateIntersect(),
  20600. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20601. }
  20602. .bind(this), f.input.longTapThreshold)))
  20603. }
  20604. ,
  20605. n.prototype.onPointerMove = function(e) {
  20606. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20607. }
  20608. ,
  20609. n.prototype.onPointerUp = function(e) {
  20610. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20611. this.couldBeLongTap = !1,
  20612. this.updateIntersect(),
  20613. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20614. }
  20615. ,
  20616. n.prototype.onPointerOut = function(e) {
  20617. this.mouseDown = !1
  20618. }
  20619. ,
  20620. n.prototype.onPointerCancel = function(e) {
  20621. this.mouseDown = !1
  20622. }
  20623. ,
  20624. n.prototype.onKeyDown = function(e) {
  20625. var t = function() {
  20626. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  20627. }
  20628. .bind(this)
  20629. , i = e.which;
  20630. switch (i) {
  20631. case p.F:
  20632. t(),
  20633. this.changeFloor(-1);
  20634. break;
  20635. case p.R:
  20636. t(),
  20637. this.changeFloor(1)
  20638. }
  20639. if (this.mode === u.PANORAMA)
  20640. switch (i) {
  20641. case p.UPARROW:
  20642. case p.W:
  20643. this.flyLocalDirection(d.FORWARD.clone());
  20644. break;
  20645. case p.DOWNARROW:
  20646. case p.S:
  20647. this.flyLocalDirection(d.BACK.clone());
  20648. break;
  20649. case p.A:
  20650. this.flyLocalDirection(d.LEFT.clone());
  20651. break;
  20652. case p.D:
  20653. this.flyLocalDirection(d.RIGHT.clone())
  20654. }
  20655. }
  20656. ,
  20657. n.prototype.handleScrollPinchZoom = function() {
  20658. return function(e) {
  20659. var t = e
  20660. , i = this.zoomLevel;
  20661. this.zoomBy(t),
  20662. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20663. }
  20664. }(),
  20665. n.prototype.handleControlPinch = function(e) {
  20666. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  20667. }
  20668. ,
  20669. n.prototype.handleControlScroll = function(e) {
  20670. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20671. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  20672. }
  20673. ,
  20674. n.prototype.handleInputStart = function(e, t, i) {
  20675. this.isTouchEvent = i,
  20676. m.convertScreenPositionToNDC(e, t, this.mouse),
  20677. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20678. this.mouseCouldBeClickToMove = !0,
  20679. this.mouseDown = !0
  20680. }
  20681. ,
  20682. n.prototype.handleInputMove = function(e, t, i) {
  20683. this.isTouchEvent = i,
  20684. m.convertScreenPositionToNDC(e, t, this.mouse),
  20685. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20686. this.couldBeLongTap = !1,
  20687. clearTimeout(this.mouseDownTimer)),
  20688. this.mouseLastMoveTime = Date.now(),
  20689. this.reticule.move(e, t, i)
  20690. }
  20691. ,
  20692. n.prototype.handleInputEnd = function(e, t, i) {
  20693. if (this.isTouchEvent = i,
  20694. this.mouseDown = !1,
  20695. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  20696. !i && this.couldBeLongTap)
  20697. return !0;
  20698. if (this.handleLongTap())
  20699. return !0;
  20700. if (this.mouseCouldBeClickToMove) {
  20701. if (this.flying)
  20702. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20703. !0;
  20704. if (this.checktagClick())
  20705. return !0;
  20706. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  20707. this.history.invalidate(),
  20708. this.intersect)
  20709. return this.flyToPanoClosestToMouse();
  20710. if (this.mode === u.PANORAMA) {
  20711. var n = this.closestPanoInDirection(this.getMouseDirection());
  20712. return n ? this.flyToPano({
  20713. pano: n
  20714. }) : this.bump(this.getMouseDirection())
  20715. }
  20716. }
  20717. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20718. }
  20719. ,
  20720. n.prototype.handleLongTap = function() {
  20721. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  20722. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  20723. !0
  20724. }
  20725. ,
  20726. n.prototype.checktagClick = function() {
  20727. if (this.tagManager.intersectTag) {
  20728. var e = this.isTouchEvent
  20729. , t = this.tagManager.clickedOnTag(e, this);
  20730. return e || t || y.cancelById(V.LookTransition),
  20731. !0
  20732. }
  20733. if (this.tagManager.activeTag)
  20734. return this.tagManager.dismissActiveTag(),
  20735. !1
  20736. }
  20737. ,
  20738. n.prototype.rankedtagInDirection = function(e, t) {
  20739. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20740. }
  20741. ,
  20742. n.prototype.start = function(e) {
  20743. var t = e.mode
  20744. , i = e.pano
  20745. , n = e.position
  20746. , r = e.quaternion
  20747. , o = e.tag
  20748. , a = e.quickstart
  20749. , s = $.Deferred();
  20750. this.updateModelDependentData(),
  20751. this.updateFromControls(),
  20752. this.findDefaultViews();
  20753. var l = this.is360View(t, i);
  20754. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20755. s.done(function(e) {
  20756. this.emit(w.Ready, l, e, o)
  20757. }
  20758. .bind(this)),
  20759. s.promise()
  20760. }
  20761. ,
  20762. n.prototype.startOutside = function(e, t) {
  20763. var i = e.mode
  20764. , n = e.pano
  20765. , r = e.position
  20766. , o = e.quaternion
  20767. , a = e.zoom
  20768. , s = e.floorVisibility
  20769. , l = e.tag;
  20770. this.emit(w.StartOutside, f[i].transitionTime),
  20771. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20772. y.cancelById(V.FlyToViewFloor),
  20773. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20774. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20775. }
  20776. ,
  20777. n.prototype.startInside = function(e, t, i, n, r) {
  20778. r = r || $.Deferred(),
  20779. this.currentPano = e;
  20780. var o = e && !e.isAligned();
  20781. if (t = o ? e.position : t || e.position,
  20782. i = i || e.quaternion,
  20783. e) {
  20784. var a = this.startInside.bind(this, e, t, i, n, r);
  20785. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20786. return
  20787. }
  20788. return this.mode = u.PANORAMA,
  20789. e.floor.enter(this.mode),
  20790. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  20791. this.switchCameraMode(this.mode, i),
  20792. this.emit(w.StartInside, o),
  20793. r.resolve(!0),
  20794. r
  20795. }
  20796. ,
  20797. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  20798. if (r = r || $.Deferred(),
  20799. this.dollhouseMode(),
  20800. !e)
  20801. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20802. r.resolve(!1),
  20803. r;
  20804. t = t || e.position;
  20805. var o = i || this.cameraControls.activeControl.camera.quaternion
  20806. , a = e.position;
  20807. return this.fitDollhouse(a, t, o),
  20808. setTimeout(function(t) {
  20809. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  20810. var n = {
  20811. mode: u.PANORAMA,
  20812. pano: e,
  20813. quaternion: i,
  20814. callback: function() {
  20815. this.emit(w.FlyinFinished),
  20816. r.resolve(!0)
  20817. }
  20818. .bind(this)
  20819. };
  20820. this.flyToNewMode(n)
  20821. }
  20822. .bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  20823. r
  20824. }
  20825. ,
  20826. n.prototype.checkAndWaitForPanoLoad = function() {
  20827. var e = {}
  20828. , t = {}
  20829. , i = 5e3
  20830. , n = function() {
  20831. for (var n in e)
  20832. if (e.hasOwnProperty(n) && e[n]) {
  20833. var r = performance.now() - t[n];
  20834. if (r < i)
  20835. return !0
  20836. }
  20837. return !1
  20838. };
  20839. return function(r, o, a, s, l, c, h, u, d, p) {
  20840. if (n())
  20841. return !0;
  20842. var f = function(t, i, n) {
  20843. N.delayOneFrame(function() {
  20844. e[t] = !1,
  20845. l && l(i, n)
  20846. }
  20847. .bind(this))
  20848. }
  20849. .bind(this, r.id)
  20850. , g = function(t, i) {
  20851. N.delayOneFrame(function() {
  20852. e[t] = !1,
  20853. c && c(i)
  20854. }
  20855. .bind(this))
  20856. }
  20857. .bind(this, r.id);
  20858. try {
  20859. return null !== u && void 0 !== u || (u = !0),
  20860. this.model.supportsTiles ? e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p) : e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u),
  20861. e[r.id] && (t[r.id] = performance.now()),
  20862. e[r.id]
  20863. } catch (n) {
  20864. throw e[r.id] = !1,
  20865. t[r.id] = performance.now() - i,
  20866. n
  20867. }
  20868. }
  20869. }(),
  20870. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20871. if (!e)
  20872. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20873. return r && this.model.waitForLoad(e, function() {
  20874. return e.isLoaded(i)
  20875. }),
  20876. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20877. !0)
  20878. }
  20879. ,
  20880. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  20881. var e = new r.Vector3;
  20882. return function(t, i, n, r, o, a, s, l) {
  20883. if (!t)
  20884. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20885. return e.copy(d.FORWARD),
  20886. this.getDirection(e),
  20887. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  20888. return t.isLoaded(i)
  20889. }),
  20890. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  20891. n && n(e, t)
  20892. }
  20893. .bind(this)).fail(function(e) {
  20894. r && r(e)
  20895. }
  20896. .bind(this)).progress(function(e, t, i) {
  20897. o && o(e, t, i)
  20898. }
  20899. .bind(this)),
  20900. !0)
  20901. }
  20902. }(),
  20903. n.prototype.switchCameraMode = function(e, t) {
  20904. var i = this.cameraControls.controls[e]
  20905. , n = i.camera;
  20906. switch (e) {
  20907. case u.PANORAMA:
  20908. n.position.copy(this.currentPano.position);
  20909. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20910. i.lookAt(o.add(n.position));
  20911. break;
  20912. case u.DOLLHOUSE:
  20913. var a = this.position.clone();
  20914. this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  20915. n.position.copy(a),
  20916. i.target.copy(this.target.clone().setY(this.model.center.y));
  20917. break;
  20918. case u.FLOORPLAN:
  20919. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  20920. i.target.copy(this.model.center).setY(0),
  20921. i.zoomToContain(this.model.size),
  20922. i.rotateToView(this.model.size, this.getDirection())
  20923. }
  20924. i.update(0)
  20925. }
  20926. ,
  20927. n.prototype.update = function() {
  20928. var e = (new r.Vector3,
  20929. {})
  20930. , t = [];
  20931. return function(i) {
  20932. this.updatePersistentZooming(i),
  20933. this.updateFromControls(i),
  20934. this.getCurrentNodePanos(t),
  20935. this.hasChanged(e) && (this.lastChangeTime = Date.now(),
  20936. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  20937. this.emit(w.ViewChanged)),
  20938. this.model.supportsTiles && (this.updateTileDownloader(t),
  20939. this.updatePanoRenderer(t)),
  20940. this.updatePreRendering(t),
  20941. this.reticule.update(),
  20942. this.path.update(),
  20943. this.spider.update(),
  20944. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20945. this.updateControlLocks(),
  20946. this.model.supportsTiles && this.updateZoomPano()
  20947. this.model.updateFloorlogo(this.camera && this.camera.quaternion); // xzw add
  20948. }
  20949. }(),
  20950. n.prototype.updatePersistentZooming = function(e) {
  20951. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  20952. }
  20953. ,
  20954. n.prototype.updateControlLocks = function() {
  20955. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20956. }
  20957. ,
  20958. n.prototype.updatePanoRenderer = function() {
  20959. var e = new r.Vector3;
  20960. return function(t) {
  20961. var i = this.nextPano || this.currentPano;
  20962. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  20963. this.getDirection(e),
  20964. this.panoRenderer.updateDirection(e))
  20965. }
  20966. }(),
  20967. n.prototype.cleanupInactivePanos = function() {
  20968. var e = []
  20969. , t = [];
  20970. return function() {
  20971. e.length = 0,
  20972. e.push(this.currentPano),
  20973. this.nextPano && e.push(this.nextPano),
  20974. t.length = 0;
  20975. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  20976. t.push(this.panoRenderer.activePanos[i]);
  20977. for (var n = 0; n < t.length; n++) {
  20978. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  20979. r.id === e[a].id && (o = !1);
  20980. o && r.exit()
  20981. }
  20982. }
  20983. }(),
  20984. n.prototype.updatePreRendering = function() {
  20985. var e = {};
  20986. return function(t) {
  20987. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20988. var i = this.nextPano || this.currentPano;
  20989. if (i && t && t.length > 1) {
  20990. var n = t.findIndex(function(e) {
  20991. if (e.id === i.id)
  20992. return !0
  20993. });
  20994. if (n >= 0 && n + 1 < t.length) {
  20995. var r = t[n + 1];
  20996. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  20997. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20998. window.setTimeout(function(t) {
  20999. e[t.id] = !1
  21000. }
  21001. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  21002. }
  21003. .bind(this, r), f.tiling.panoPreRenderDelay),
  21004. e[r.id] = !0)
  21005. }
  21006. }
  21007. }
  21008. }
  21009. }(),
  21010. n.prototype.enablePreRendering = function() {
  21011. this.preRenderingEnabled = !0
  21012. }
  21013. ,
  21014. n.prototype.disablePreRendering = function() {
  21015. this.preRenderingEnabled = !1,
  21016. this.cleanupInactivePanos()
  21017. }
  21018. ,
  21019. n.prototype.updateTileDownloader = function() {
  21020. var e = new r.Vector3;
  21021. return function(t) {
  21022. var i = this.nextPano || this.currentPano;
  21023. i && (e.copy(d.FORWARD),
  21024. this.getDirection(e),
  21025. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21026. this.tileDownloader.processPriorityQueue = !0)
  21027. }
  21028. }(),
  21029. n.prototype.updateFromControls = function(e) {
  21030. null !== e && void 0 !== e || (e = 0),
  21031. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21032. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21033. this.position.copy(this.cameraControls.activeControl.camera.position),
  21034. this.target.copy(this.cameraControls.activeControl.target),
  21035. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21036. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21037. this.camera.position.copy(this.position),
  21038. this.camera.quaternion.copy(this.quaternion),
  21039. this.camera.updateMatrix(),
  21040. this.camera.updateMatrixWorld()
  21041. }
  21042. ,
  21043. n.prototype.hasChanged = function(e) {
  21044. if (!this.previousState)
  21045. return this.previousState = {
  21046. allFloorsVisible: this.model.allFloorsVisible,
  21047. position: this.position.clone(),
  21048. quaternion: this.quaternion.clone(),
  21049. mouse: this.mouse.clone(),
  21050. labelScaleFactor: this.getLabelScaleFactor(),
  21051. currentFloor: this.model.currentFloor,
  21052. projectionMatrix: this.camera.projectionMatrix.clone(),
  21053. worldMatrix: this.camera.matrixWorld.clone(),
  21054. mode: this.mode,
  21055. modelPosition: this.model.position.clone(),
  21056. modelCenter: this.model.center.clone(),
  21057. zoomLevel: this.zoomLevel
  21058. },
  21059. !0;
  21060. 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;
  21061. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21062. e.moved = !this.position.equals(this.previousState.position),
  21063. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21064. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21065. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21066. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21067. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21068. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21069. e.modeChanged = this.mode !== this.previousState.mode,
  21070. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21071. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21072. e.nextPanoActive = null !== this.nextPano,
  21073. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21074. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21075. this.previousState.position.copy(this.position),
  21076. this.previousState.quaternion.copy(this.quaternion),
  21077. this.previousState.mouse.copy(this.mouse),
  21078. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21079. this.previousState.currentFloor = this.model.currentFloor,
  21080. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21081. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21082. this.previousState.mode = this.mode,
  21083. this.previousState.modelPosition.copy(this.model.position),
  21084. this.previousState.modelCenter.copy(this.model.center),
  21085. this.previousState.zoomLevel = this.zoomLevel,
  21086. !t
  21087. }
  21088. ,
  21089. n.prototype.updateIntersect = function() {
  21090. var e = this.flying || this.isWarping()
  21091. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21092. , i = y.getById(V.LookTransition)
  21093. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  21094. this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),
  21095. this.intersect && this.updateClosestPano(this.intersect),
  21096. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21097. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide())
  21098. }
  21099. ,
  21100. n.prototype.getMouseDirection = function(e) {
  21101. e = e || this.mouse;
  21102. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  21103. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  21104. return i.sub(t).normalize()
  21105. }
  21106. ,
  21107. n.prototype.getMouseIntersect = function(e, t) {
  21108. e = e || this.mouse.clone(),
  21109. t = t || this.model.floors.reduce(function(e, t) {
  21110. return t.hidden ? e : e.concat(t.collider.children)
  21111. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  21112. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  21113. this.raycaster.set(i, this.getMouseDirection(e));
  21114. var n = this.raycaster.intersectObjects(t);
  21115. if (0 === n.length)
  21116. return null;
  21117. var o = n[0];
  21118. if (o.face) {
  21119. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  21120. var a = this.position.clone().sub(o.point);
  21121. a.dot(o.normal) < 0 && o.normal.negate(),
  21122. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21123. o.horizontal = o.normal.y > .8
  21124. }
  21125. return o
  21126. }
  21127. ,
  21128. n.prototype.updateClosestPano = function(e) {
  21129. if(!e.normal)return;//xzw 有时候天花板没有normal
  21130. var t = [s.filters.isPanoAligned()];
  21131. if (this.mode === u.PANORAMA) {
  21132. if (!this.currentPano)
  21133. return;
  21134. t.push(s.filters.not(this.currentPano)),
  21135. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21136. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  21137. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  21138. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  21139. } else
  21140. t.push(s.filters.isOnVisibleFloor()),
  21141. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  21142. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  21143. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21144. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  21145. this.closestPano = i) : this.isPanoHover = !1
  21146. }
  21147. ,
  21148. n.prototype.dollhouseMode = function(e, t) {
  21149. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  21150. this.mode = u.DOLLHOUSE,
  21151. this.cameraControls.controls[u.DOLLHOUSE].reset();
  21152. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  21153. , n = new r.Vector3(15,10,15);
  21154. if (e && t) {
  21155. var o = d.FORWARD.clone().applyQuaternion(t)
  21156. , a = this.model.center.clone().sub(e)
  21157. , s = a.dot(o);
  21158. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  21159. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21160. }
  21161. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  21162. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  21163. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  21164. this.updateFromControls(),
  21165. this.model.alpha = 1,
  21166. this.model.skybox.material.uniforms.opacity.value = 0
  21167. }
  21168. ,
  21169. n.prototype.insideMode = function(e, t) {
  21170. var i = $.Deferred()
  21171. , n = t || null;
  21172. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  21173. var r = [s.filters.isPanoAligned()];
  21174. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  21175. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21176. this.flyToNewMode({
  21177. mode: u.PANORAMA,
  21178. pano: e,
  21179. callback: n
  21180. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21181. } else {
  21182. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21183. i.reject(o)
  21184. }
  21185. return i.promise()
  21186. }
  21187. ,
  21188. n.prototype.fitDollhouse = function(e, t, i) {
  21189. var n = d.FORWARD.clone().applyQuaternion(i);
  21190. this.cameraControls.activeControl.target.copy(n).add(e);
  21191. var o = d.RIGHT.clone().applyQuaternion(i)
  21192. , a = d.UP.clone()
  21193. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  21194. , l = this.model.boundingBox.max.clone()
  21195. , c = this.model.boundingBox.min.clone()
  21196. , h = [new r.Vector3(l.x,0,l.z).sub(e), new r.Vector3(l.x,0,c.z).sub(e), new r.Vector3(c.x,0,l.z).sub(e), new r.Vector3(c.x,0,c.z).sub(e)]
  21197. , u = 0
  21198. , p = 0
  21199. , g = 0;
  21200. h.forEach(function(e, t, i) {
  21201. var n = Math.abs(e.dot(o))
  21202. , r = e.dot(s);
  21203. n > u && (u = n,
  21204. p = r),
  21205. r > g && (g = r)
  21206. });
  21207. var m = Math.max(Math.abs(new r.Vector3(0,l.y,0).sub(e).dot(a)), Math.abs(new r.Vector3(0,c.y,0).sub(e).dot(a)))
  21208. , v = s.clone().multiplyScalar(p).add(t)
  21209. , A = s.clone().multiplyScalar(g).add(t);
  21210. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180)),
  21211. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180)),
  21212. p = Math.max(p, 10),
  21213. g = Math.max(g, 10);
  21214. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  21215. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  21216. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1,
  21217. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p)) : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  21218. }
  21219. ,
  21220. n.prototype.floorplanMode = function(e, t, i) {
  21221. this.mode = u.FLOORPLAN;
  21222. var n = this.cameraControls.controls[u.FLOORPLAN];
  21223. n.reset();
  21224. var r = e ? e : this.model.center;
  21225. if (n.target.copy(r).setY(0),
  21226. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  21227. i ? (n.currentScale = i / ($('#player').width()/$('#player').height()),
  21228. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21229. t) {
  21230. var o = d.LEFT.clone().applyQuaternion(t);
  21231. n.rotateLeft(-Math.atan2(o.x, o.z))
  21232. } else
  21233. n.rotateToView(this.model.size, this.getDirection());
  21234. n.update(0)
  21235. }
  21236. ,
  21237. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  21238. return e.skipWarpingCheck = !0,
  21239. this.flyToPano(e, t)
  21240. }
  21241. ,
  21242. n.prototype.flyToPano = function(e, t) {
  21243. var i = e.pano
  21244. , n = e.lookAtPoint
  21245. , o = e.duration
  21246. , a = e.aimDuration
  21247. , s = e.maxDistanceOverride
  21248. , l = e.skipWarpingCheck
  21249. , c = e.constantMoveSpeed
  21250. , h = null
  21251. , p = null
  21252. , force = e.force;
  21253. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  21254. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  21255. t && t(),
  21256. !1;
  21257. if (this.updateLastView(),
  21258. this.mode !== u.PANORAMA) {
  21259. var m;
  21260. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  21261. void this.flyToNewMode({
  21262. mode: u.PANORAMA,
  21263. pano: i,
  21264. duration: o,
  21265. quaternion: m,
  21266. callback: t
  21267. })
  21268. }
  21269. if (!i || (h = g.deepExtend(e),
  21270. p = function() {
  21271. N.delayOneFrame(function() {
  21272. this.flyToPano(h, t)
  21273. }
  21274. .bind(this))
  21275. }
  21276. .bind(this),
  21277. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  21278. var C = function(e) {
  21279. t && t(e)
  21280. }
  21281. .bind(this);
  21282. this.currentPano || (this.currentPano = i,
  21283. this.path.placeCpm(),
  21284. this.path.fadeOutCpm(f.path.fadeOutTime),
  21285. this.spider.draw());
  21286. var I = o;
  21287. if ("number" != typeof o) {
  21288. var E = s || f.transition.flytimeMaxDistanceThreshold;
  21289. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  21290. }
  21291. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  21292. 1 !== this.zoomLevel)
  21293. switch (f.zoom.transitionStyle) {
  21294. case 1:
  21295. this.smoothZoomToDefault(I / 2);
  21296. break;
  21297. case 2:
  21298. return h = g.deepExtend(e),
  21299. p = this.flyToPano.bind(this, h, t),
  21300. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  21301. }
  21302. if (n) {
  21303. y.cancelById(V.LookTransition),
  21304. I *= f.transition.aimSlowFactor;
  21305. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  21306. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  21307. , T = (new r.Quaternion).setFromRotationMatrix(_)
  21308. , S = b.clone()
  21309. , M = new r.Vector3;
  21310. if (i === this.currentPano) {
  21311. var R = d.FORWARD.clone().applyQuaternion(b)
  21312. , P = d.FORWARD.clone().applyQuaternion(T)
  21313. , O = R.angleTo(P);
  21314. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  21315. void y.start(function(e) {//旋转镜头对准billboard
  21316. if(!this.control || this.mode != u.PANORAMA){//提早结束 xzw
  21317. y.cancelById(V.LookTransition);
  21318. return;
  21319. }
  21320. S.copy(b),
  21321. v.quaternion(S, T)(e),
  21322. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21323. this.cameraControls.activeControl.lookAt(M)
  21324. }
  21325. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  21326. }
  21327. }
  21328. if (i === this.currentPano || this.flying)
  21329. return void C();
  21330. this.flying = !0;
  21331. var L = this.position.clone()
  21332. , D = this.currentPano;
  21333. F.debug("Flying to pano ", i.position),
  21334. this.emit(w.PanoChosen, this.currentPano, i),//触发 setProjectedPanos
  21335. this.emit(w.FlyingStarted, i.position, L, i, D),
  21336. n && y.start(function(e) {
  21337. S.copy(b),
  21338. v.quaternion(S, T)(e),
  21339. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21340. this.cameraControls.activeControl.lookAt(M)
  21341. }
  21342. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  21343. //xzw:
  21344. for(var j in this.model.panos.dict){// 过渡时为false的会滑动
  21345. this.model.panos.dict[j].marker.material.depthTest = true
  21346. }
  21347. //地标变化
  21348. this.model.floorLogoFade(0, I, 0.7);
  21349. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(i.model.position));
  21350. this.model.floorLogos[1].material.uniforms.opacity.value = 0;
  21351. this.model.floorLogos[1].visible = true;
  21352. /* this.modeTran.split("-")[1] == h.PANORAMA && */(this.model.floorLogoShow(1,250));
  21353. //如果有墙 就不显示模型
  21354. if(this.currentPano.noBlocks==void 0 || this.currentPano.noBlocks.indexOf(i.id)>-1|| isSpecialScene){
  21355. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano)
  21356. }else{
  21357. for(var j=0; j<this.model.chunks.length; j++){
  21358. this.model.chunks[j].visible = false; //这个会使floorlogo出现延迟
  21359. }
  21360. }
  21361. this.tagManager.updateVisible("panorama",i); //更新热点显示
  21362. //--end
  21363. var B = c ? null : A[f.transition.movementEasing];
  21364. this.nextPano = i,
  21365. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  21366. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  21367. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  21368. //xzw:
  21369. if(this.mode == u.PANORAMA){
  21370. //this.model.floorLogo.visible = true;
  21371. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  21372. this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  21373. this.model.floorLogos[1].visible = false;
  21374. }
  21375. for(var j=0; j<this.model.chunks.length; j++){
  21376. this.model.chunks[j].visible = true;
  21377. this.model.chunks[j].material.uniforms.progress && (this.model.chunks[j].material.uniforms.progress.value = 1);
  21378. }
  21379. //xzw----end
  21380. this.flying = !1,
  21381. this.currentPano !== i && this.currentPano.exit(),
  21382. i.enter(),
  21383. this.currentPano = i,
  21384. this.nextPano = null,
  21385. this.path.placeCpm(),
  21386. this.path.fadeOutCpm(f.path.fadeOutTime),
  21387. this.spider.draw(),
  21388. this.emit(w.FlyingEnded, i.position, L, i, D),
  21389. //this.updateMarkerDisplay();//xzw
  21390. C(e)
  21391. }
  21392. .bind(this), 0, B, "camFly", V.FlyToPano)
  21393. }
  21394. }
  21395. ,
  21396. n.prototype.fastForwardActivePanoFlight = function(e) {
  21397. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  21398. y.adjustSpeed(V.FlyToPano, e),
  21399. y.adjustSpeed(V.LookTransition, e)
  21400. }
  21401. ,
  21402. n.prototype.flyToPanoClosestToMouse = function() {
  21403. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  21404. this.intersect && this.updateClosestPano(this.intersect)),
  21405. this.closestPano)
  21406. return this.flyToPano({
  21407. pano: this.closestPano
  21408. });
  21409. var e = this.getMouseDirection();
  21410. this.flyDirection(e) || this.flyToPano({
  21411. pano: this.currentPano
  21412. })
  21413. }
  21414. ,
  21415. n.prototype.flyLocalDirection = function(e) {
  21416. var t = this.getDirection(e)
  21417. , i = 1 === e.z ? .4 : .75
  21418. , n = 1 === Math.abs(e.x);
  21419. return this.flyDirection(t, i, n)
  21420. }
  21421. ,
  21422. n.prototype.flyDirection = function(e, t, i) {
  21423. var n = $.Deferred();
  21424. this.history.invalidate();
  21425. var r = this.closestPanoInDirection(e, t, i);
  21426. return r ? this.flyToPano({
  21427. pano: r
  21428. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21429. n.resolve(!1)),
  21430. n.promise()
  21431. }
  21432. ,
  21433. n.prototype.closestPanoInDirection = function(e, t, i) {
  21434. return this.rankedPanoInDirection(0, e, t, i)
  21435. }
  21436. ,
  21437. n.prototype.rankedPanoInDirection = function() {
  21438. var e = {
  21439. pano: null,
  21440. candidates: []
  21441. };
  21442. return function(t, i, n, r) {
  21443. t || (t = 0),
  21444. n = void 0 !== n ? n : .75;
  21445. var o = r ? "angle" : "direction";
  21446. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  21447. this.cachedPanoCandidates = e.candidates,
  21448. e.pano
  21449. }
  21450. }(),
  21451. n.prototype.bump = function(e) {
  21452. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  21453. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  21454. if (s)
  21455. t = function() {
  21456. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  21457. }
  21458. .bind(this),
  21459. i = function() {
  21460. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  21461. }
  21462. .bind(this);
  21463. else {
  21464. var l = this.camera.position.clone()
  21465. , c = e.clone();
  21466. this.raycaster.set(l, c);
  21467. var h = this.model.floors.reduce(function(e, t) {
  21468. return e.concat(t.collider.children)
  21469. }, [])
  21470. , d = this.raycaster.intersectObjects(h)
  21471. , p = d.length > 0 ? d[0].distance / 25 : .04
  21472. , g = l.clone().add(c.multiplyScalar(p));
  21473. t = function() {
  21474. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  21475. }
  21476. .bind(this),
  21477. i = function() {
  21478. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  21479. }
  21480. .bind(this)
  21481. }
  21482. n = function() {
  21483. this.flying = !1
  21484. }
  21485. .bind(this),
  21486. this.flying = !0,
  21487. t()
  21488. }
  21489. }
  21490. ,
  21491. n.prototype.changeFloor = function(e) {
  21492. if (!this.is360View(this.mode, this.currentPano))
  21493. if (this.mode === u.PANORAMA) {
  21494. var t = this.history.reversePano(e);
  21495. t && t.isAligned() ? this.flyToPano({
  21496. pano: t
  21497. }) : this.changeFloorByScore(e)
  21498. } else
  21499. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21500. }
  21501. ,
  21502. n.prototype.changeFloorByScore = function() {
  21503. var e = {
  21504. pano: null,
  21505. candidates: []
  21506. };
  21507. return function(t) {
  21508. var i = this.model.nextFloor(t);
  21509. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  21510. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  21511. this.history.push(t, this.currentPano),
  21512. this.flyToPano({
  21513. pano: e.pano
  21514. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  21515. }
  21516. }(),
  21517. n.prototype.gotoFloor = function(e) {
  21518. var t = e - this.model.currentFloor.floorIndex;
  21519. this.changeFloor(t)
  21520. }
  21521. ,
  21522. n.prototype.getDirection = function(e) {
  21523. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  21524. e.applyQuaternion(this.camera.quaternion)
  21525. }
  21526. ,
  21527. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  21528. if (o = o || $.Deferred(),
  21529. this.mode === u.TRANSITIONING)
  21530. return F.warn("should not be transitioning here"),
  21531. n && n(!1),
  21532. o.reject().promise();
  21533. var a = i || !1
  21534. , s = i ? i.position : this.position
  21535. , l = this.position.clone()
  21536. , c = this.currentPano;
  21537. if (F.debug("New pose in mode " + this.mode),
  21538. !e || (retryCallback = function() {
  21539. N.delayOneFrame(function() {
  21540. this.flyToSameMode(e, t, i, n, o)
  21541. }
  21542. .bind(this))
  21543. }
  21544. .bind(this),
  21545. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21546. var h = function() {
  21547. this.emit(w.FlyingEnded, s, l, e, c),
  21548. n && n(!0)
  21549. }
  21550. .bind(this)
  21551. , d = f[this.mode]
  21552. , p = void 0 !== t ? t : d.transitionTime
  21553. , g = new r.Vector3
  21554. , C = new r.Vector3;
  21555. if (this.emit(w.FlyingStarted, s, l, e, c),
  21556. this.mode === u.PANORAMA)
  21557. F.warn("we should not be here for panorama views");
  21558. else if (this.mode === u.DOLLHOUSE)
  21559. if (a) {
  21560. var I = new r.Vector3(0,1,0);
  21561. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21562. this.model.warpDestFloors(i.floorVisibility),
  21563. C.copy(i.position);
  21564. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21565. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  21566. , _ = b.intersectObjects(this.model.colliders)
  21567. , T = 3;
  21568. _.length ? (g.copy(_[0].point),
  21569. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  21570. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21571. var x = (new r.Matrix4).lookAt(C, g, I)
  21572. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  21573. , M = g.distanceTo(C)
  21574. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  21575. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  21576. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  21577. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  21578. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  21579. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  21580. this.path.burnsDir = Math.sign(L.y);
  21581. var D = new r.Euler(0,0,0,f.warp.eOrder)
  21582. , B = new r.Vector3;
  21583. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21584. y.start(function(e, t) {
  21585. D.x = P.x + e * L.x,
  21586. D.y = P.y + e * L.y,
  21587. D.z = P.z + e * L.z;
  21588. var i = O + e * (M - O);
  21589. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  21590. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  21591. }
  21592. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21593. y.start(function(e, t) {
  21594. this.cameraControls.controls[u.DOLLHOUSE].update(),
  21595. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  21596. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  21597. }
  21598. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21599. } else
  21600. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21601. else if (this.path.placeCpm(),
  21602. this.path.fadeInCpm(f.path.fadeInTime),
  21603. i) {
  21604. this.model.warpDestFloors(i.floorVisibility);
  21605. var U = this.cameraControls.cameras[u.FLOORPLAN]
  21606. , k = this.cameraControls.controls[u.FLOORPLAN]
  21607. , H = k.target.clone()
  21608. , G = i.position.clone().sub(H)
  21609. , z = U.position.clone().sub(k.target)
  21610. , W = z.length()
  21611. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21612. , Y = Math.atan2(k.offset.x, k.offset.z)
  21613. , X = Math.atan2(j.x, j.z)
  21614. , Z = k.absoluteScale
  21615. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  21616. y.start(function(e, t) {
  21617. k.target.copy(G).multiplyScalar(e).add(H);
  21618. var i = Y + (X - Y) * e;
  21619. k.offset.x = W * Math.sin(i),
  21620. k.offset.z = W * Math.cos(i),
  21621. U.position.copy(k.target).add(k.offset),
  21622. k.absoluteScale = Z + e * (q - Z),
  21623. k.update(),
  21624. this.quaternion.copy(U.quaternion),
  21625. this.position.copy(U.position),
  21626. this.target.copy(k.target),
  21627. this.camera.projectionMatrix.copy(U.projectionMatrix)
  21628. }
  21629. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21630. } else
  21631. F.info("flyToSameMode() funny floorplan view? skipping");
  21632. return y.setTimeout(function(e) {
  21633. this.mode = e,
  21634. h(),
  21635. o.resolve(!0)
  21636. }
  21637. .bind(this, this.mode), p, V.FlyToSameMode),
  21638. this.mode = u.TRANSITIONING,
  21639. o.promise()
  21640. }
  21641. }
  21642. ,
  21643. n.prototype.flyToNewMode = function(e, t) {
  21644. e = e || {};
  21645. var i = e.mode
  21646. , n = e.pano
  21647. , o = e.duration
  21648. , a = e.warpDest
  21649. , s = e.callback
  21650. , l = e.force
  21651. , c = e.quaternion;
  21652. if (t = t || $.Deferred(),
  21653. this.isWarping())
  21654. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21655. s && s(!1),
  21656. t.reject("Cannot change mode during tour transition").promise();
  21657. if (this.mode === u.TRANSITIONING)
  21658. return s && s(!1),
  21659. t.reject("Cannot change mode during mode transition").promise();
  21660. if (i === this.mode)
  21661. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21662. t.promise()) : (s && s(!1),
  21663. t.reject("Already in " + i + " mode").promise());
  21664. var h = a || !1;
  21665. F.debug("Switching mode to " + i);
  21666. var d = function() {
  21667. N.delayOneFrame(function() {
  21668. this.flyToNewMode(e, t)
  21669. }
  21670. .bind(this))
  21671. }
  21672. .bind(this);
  21673. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  21674. return t.promise();
  21675. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21676. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21677. this.model.waitForLoad(this.model, function() {
  21678. return this.model.meshTexturesLoaded;
  21679. }
  21680. .bind(this)),
  21681. this.model.loadMeshTextures().done(d),
  21682. t.promise();
  21683. this.history.invalidate(),
  21684. this.updateLastView();
  21685. var p = this.mode
  21686. , C = this.cameraControls.cameras[i];
  21687. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  21688. this.modeTran = p + "-" + i; //xzw
  21689. var I = void 0 !== o ? o : e.transitionTime;
  21690. this.emit(w.ModeChanging, p, i, n),
  21691. n && (this.currentPano = n),
  21692. this.switchCameraMode(i, c),
  21693. y.cancelById(V.LookTransition);
  21694. var _ = (new r.Vector3).copy(this.position);
  21695. if (i === u.PANORAMA)
  21696. this.emit(w.PanoChosen, n, n),
  21697. setTimeout(function() {
  21698. n.floor.enter(i)
  21699. }
  21700. .bind(this), I / 2),
  21701. this.path.fadeOutCpm(f.path.fadeOutTime);
  21702. else if (i === u.DOLLHOUSE) {
  21703. if (h && (this.model.stayPut = !0),
  21704. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21705. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  21706. this.path.placeCpm(),
  21707. this.path.fadeInCpm(f.path.fadeInTime),
  21708. h) {
  21709. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  21710. _.set(15, 10, 15);
  21711. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  21712. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  21713. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  21714. P.length ? (T.copy(P[0].point),
  21715. _.copy(a.position),
  21716. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  21717. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  21718. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  21719. _.add(this.model.position),
  21720. C.position.copy(_),
  21721. this.cameraControls.controls[u.DOLLHOUSE].update()
  21722. }
  21723. } else if (this.path.placeCpm(),
  21724. this.path.fadeInCpm(f.path.fadeInTime),
  21725. a) {
  21726. this.model.warpDestFloors(a.floorVisibility);
  21727. var O = this.cameraControls.cameras[u.FLOORPLAN]
  21728. , L = this.cameraControls.controls[u.FLOORPLAN]
  21729. , D = O.position.clone().sub(L.target)
  21730. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  21731. , U = Math.atan2(B.x, B.z);
  21732. L.target.copy(a.position);
  21733. var k = D.length();
  21734. L.offset.x = k * Math.sin(U),
  21735. L.offset.y = 0,
  21736. L.offset.z = k * Math.cos(U),
  21737. O.position.copy(L.target).add(L.offset);
  21738. L.target.clone().sub(C.position);
  21739. C.quaternion.copy(a.quaternion),
  21740. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  21741. L.absoluteScale = L.currentScale,
  21742. L.update()
  21743. } else
  21744. this.model.currentFloor.enter(i);
  21745. var H = this.currentPano
  21746. , G = this.position.clone();
  21747. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  21748. this.flying = !0,
  21749. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  21750. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21751. C.controls.update()),
  21752. e.blackoutStyle = S.FADEIN,
  21753. I = f.show360Views.transitionTime,
  21754. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  21755. this.mode = i,
  21756. this.path && this.path.popOutCpm(),
  21757. e.blackoutStyle = S.END,
  21758. I = f.show360Views.transitionTime,
  21759. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  21760. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  21761. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  21762. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  21763. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  21764. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  21765. y.setTimeout(function() {
  21766. this.flying = !1,
  21767. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  21768. this.currentPano.enter(),
  21769. this.path.placeCpm(),
  21770. this.path.fadeOutCpm(f.path.fadeOutTime),
  21771. this.spider.draw()),
  21772. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  21773. this.mode = i,
  21774. this.emit(w.FlyingEnded, _, G, this.currentPano, H),
  21775. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  21776. t.resolve())
  21777. }
  21778. .bind(this), I, V.FlyToNewMode),
  21779. this.mode = u.TRANSITIONING,
  21780. t.promise()
  21781. }
  21782. ,
  21783. n.prototype.fade360View = function(e, t, i) {
  21784. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21785. $(this.domElement).fadeOut(.5 * e, function() {
  21786. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21787. this.model.alpha = i.modelAlpha,
  21788. this.position.copy(t.position),
  21789. this.quaternion.copy(t.quaternion),
  21790. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21791. $(this.domElement).fadeIn(.5 * e)
  21792. }
  21793. .bind(this))
  21794. }
  21795. ,
  21796. n.prototype.findDefaultViews = function() {
  21797. this.findDefaultView(this.lastInsideView, !0),
  21798. this.findDefaultView(this.last360View, !1)
  21799. }
  21800. ,
  21801. n.prototype.findDefaultView = function(e, t) {
  21802. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21803. if (e.cameraMode !== u.PANORAMA)
  21804. return !1;
  21805. var i = r.get(e.panoId);
  21806. return i && i.isAligned() === t
  21807. });
  21808. o >= 0 ? (i = r.get(n[o].panoId),
  21809. e.update({
  21810. cameraMode: u.PANORAMA,
  21811. pano: i,
  21812. position: n[o].position,
  21813. quaternion: n[o].quaternion
  21814. })) : (o = r.list.findIndex(function(e) {
  21815. return e.isAligned() === t
  21816. }),
  21817. o >= 0 ? (i = r.list[o],
  21818. e.update({
  21819. cameraMode: u.PANORAMA,
  21820. pano: i,
  21821. position: i.position
  21822. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  21823. }
  21824. ,
  21825. n.prototype.updateLastView = function() {
  21826. if (this.mode === u.PANORAMA) {
  21827. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  21828. e.update({
  21829. pano: this.currentPano,
  21830. position: this.position,
  21831. quaternion: this.quaternion
  21832. })
  21833. }
  21834. }
  21835. ,
  21836. n.prototype.goToLastView = function(e, t) {
  21837. var i = $.Deferred()
  21838. , n = i.resolve.bind(i)
  21839. , r = i.reject.bind(i)
  21840. , o = e ? this.lastInsideView : this.last360View;
  21841. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21842. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21843. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21844. mode: o.cameraMode,
  21845. pano: o.pano,
  21846. quaternion: o.quaternion,
  21847. callback: t
  21848. }).done(n).fail(r),
  21849. i.promise()
  21850. }
  21851. ,
  21852. n.prototype.fadeToView = function(e, t, i, n) {
  21853. var r = $.Deferred()
  21854. , o = r.resolve.bind(r)
  21855. , a = r.reject.bind(r);
  21856. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  21857. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  21858. a("Cannot go to illegal view"),
  21859. r.promise();
  21860. var s = (f[t.cameraMode],
  21861. function() {
  21862. $(this.domElement).fadeIn(.5 * i),
  21863. n && n(),
  21864. o()
  21865. }
  21866. .bind(this))
  21867. , l = e ? S.FADEIN : S.END;
  21868. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21869. $(this.domElement).fadeOut(.5 * i, function() {
  21870. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  21871. t.cameraMode === u.PANORAMA ? this.flyToPano({
  21872. pano: t.pano,
  21873. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21874. duration: 0
  21875. }, s) : this.flyToNewMode({
  21876. mode: t.cameraMode,
  21877. quaternion: t.quaternion,
  21878. duration: 0,
  21879. callback: s
  21880. })
  21881. }
  21882. .bind(this)),
  21883. r.promise()
  21884. }
  21885. ,
  21886. n.prototype.startWarp = function(e, t, i, n, r, o) {
  21887. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21888. this.flying)
  21889. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  21890. o && o(),
  21891. !1;
  21892. null !== e && void 0 !== e || (e = b.Show),
  21893. this.history.invalidate(),
  21894. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  21895. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21896. return this.emit(w.WarpStarted, a, i, n, r),
  21897. n = n || S.MIDDLE,
  21898. this.path.warpToPano(i, n, r, function() {
  21899. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  21900. this.emit(w.WarpEnded, i),
  21901. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21902. o && o()
  21903. }
  21904. .bind(this)),
  21905. e === b.Hide && this.path.discardPathObject(),
  21906. !0
  21907. }
  21908. ,
  21909. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21910. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21911. s && s(),
  21912. !1)
  21913. }
  21914. ,
  21915. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21916. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21917. a && a(),
  21918. !1)
  21919. }
  21920. ,
  21921. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  21922. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  21923. }
  21924. ,
  21925. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  21926. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  21927. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21928. t && t(),
  21929. !1)
  21930. }
  21931. ,
  21932. n.prototype.aimTourCamera = function(e, t, i, n) {
  21933. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  21934. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  21935. }
  21936. ,
  21937. n.prototype.showPathToHeroLocation = function(e) {
  21938. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  21939. }
  21940. ,
  21941. n.prototype.tourInterlude = function(e, t) {
  21942. this.history.invalidate(),
  21943. this.path.discardSlow(),
  21944. this.path.waitNextStep(e, function() {
  21945. t && t()
  21946. }
  21947. .bind(this))
  21948. }
  21949. ,
  21950. n.prototype.stopInterlude = function() {
  21951. this.interruptAndFastForward(null, 0)
  21952. }
  21953. ,
  21954. n.prototype.interruptAndFastForward = function(e, t) {
  21955. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  21956. this.flying && this.emit(w.FlyingInterrupted),
  21957. this.path.interruptAndFastForward(e, t)
  21958. }
  21959. ,
  21960. n.prototype.setSize = function(e, t) {
  21961. var i = e / t;
  21962. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  21963. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  21964. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  21965. for (var r in this.cameraControls.cameras) {
  21966. var o = this.cameraControls.cameras[r];
  21967. o.fov = this.baseFov * (1 / this.zoomLevel),
  21968. o.updateAspect(i)
  21969. }
  21970. }
  21971. ,
  21972. n.prototype.toJSON = function() {
  21973. var e = {};
  21974. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  21975. e.camera_mode = u.toInt(this.mode),
  21976. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  21977. return e.hidden ? 0 : 1
  21978. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  21979. e) : e
  21980. }
  21981. ,
  21982. n.prototype.getCurrentNodePanos = function(e) {
  21983. this.model.panos.map;
  21984. if (e.length = 0,
  21985. this.path.nodes)
  21986. for (var t = 0; t < this.path.nodes.length; t++) {
  21987. var i = this.path.nodes[t];
  21988. e.push(this.model.panos.get(i))
  21989. }
  21990. }
  21991. ,
  21992. n.prototype.zoomIncrementally = function(e) {
  21993. var t = this.zoomLevel;
  21994. this.zoomTo(this.zoomLevel + e),
  21995. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  21996. }
  21997. ,
  21998. n.prototype.zoomInIncrementally = function(e) {
  21999. e = e || this.defaultZoomIncrement,
  22000. this.zoomIncrementally(e)
  22001. }
  22002. ,
  22003. n.prototype.zoomOutIncrementally = function(e) {
  22004. e = e || -this.defaultZoomIncrement,
  22005. this.zoomIncrementally(e)
  22006. }
  22007. ,
  22008. n.prototype.zoomBy = function(e) {
  22009. this.zoomTo(this.zoomLevel * e)
  22010. }
  22011. ,
  22012. n.prototype.zoomIn = function() {
  22013. this.zoomBy(1 + this.zoomSpeed)
  22014. }
  22015. ,
  22016. n.prototype.zoomOut = function() {
  22017. this.zoomBy(1 - this.zoomSpeed)
  22018. }
  22019. ,
  22020. n.prototype.zoomTo = function(e, t) {
  22021. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  22022. if (e < f.zoom.min && (e = f.zoom.min),
  22023. e > f.zoom.max && (e = f.zoom.max),
  22024. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  22025. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  22026. e === f.zoom.min && this.emit(O.ZoomMin)),
  22027. this.cameraControls.activeControl) {
  22028. var i = this.cameraControls.activeControl.camera;
  22029. this.zoomLevel = e,
  22030. i.fov = this.baseFov * (1 / this.zoomLevel),
  22031. i.updateProjectionMatrix(),
  22032. this.zoomFov = i.fov
  22033. }
  22034. }
  22035. }
  22036. ,
  22037. n.prototype.increaseZoomSpeed = function() {
  22038. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22039. }
  22040. ,
  22041. n.prototype.decreaseZoomSpeed = function() {
  22042. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22043. }
  22044. ,
  22045. n.prototype.clampZoomSpeed = function(e) {
  22046. return e < 0 ? 0 : e
  22047. }
  22048. ,
  22049. n.prototype.activatePersistentZooming = function(e) {
  22050. this.zooming = e ? 1 : -1
  22051. }
  22052. ,
  22053. n.prototype.deactivatePersistentZooming = function() {
  22054. this.zooming = 0
  22055. }
  22056. ,
  22057. n.prototype.zoomDefault = function() {
  22058. this.zoomTo(1, !0)
  22059. }
  22060. ,
  22061. n.prototype.smoothZoomToDefault = function(e, t) {
  22062. var i, n = this.zoomLevel, r = function(e) {
  22063. e > 1 && (e = 1),
  22064. i = n * (1 - e) + e,
  22065. this.zoomTo(i, !0)
  22066. }
  22067. .bind(this), o = function() {
  22068. this.zoomDefault(),
  22069. t && window.setTimeout(t, 50)
  22070. }
  22071. .bind(this);
  22072. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  22073. }
  22074. ,
  22075. n.prototype.updateZoomPano = function() {
  22076. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  22077. var e = this.currentPano;
  22078. if (e) {
  22079. var t = this.zoomLevel > f.zoom.activationThreshold
  22080. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  22081. , n = !i && !this.isWarping()
  22082. , r = t && n;
  22083. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  22084. this.panoRenderer.setZoomingActive(r, e, !0);
  22085. var o = function(e, t) {
  22086. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22087. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22088. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22089. e.setZoomed(t)
  22090. }
  22091. .bind(this);
  22092. r && !e.zoomed ? (o(e, !0),
  22093. this.panoRenderer.enableUltraHighQualityMode(function() {
  22094. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  22095. r && o(e, !0)
  22096. }
  22097. .bind(this))) : !t && e.zoomed && o(e, !1)
  22098. }
  22099. }
  22100. }
  22101. ,
  22102. t.exports = n
  22103. }
  22104. ).call(this, "/js/player.js")
  22105. }
  22106. , {
  22107. "./constants": 8,
  22108. "./enum/AlignmentType": 17,
  22109. "./enum/BlackoutStyle": 18,
  22110. "./enum/ControlEvents": 21,
  22111. "./enum/Keys": 30,
  22112. "./enum/ModelManagerEvents": 33,
  22113. "./enum/PanoSizeClass": 36,
  22114. "./enum/PanoramaEvents": 37,
  22115. "./enum/PathDiscardMode": 38,
  22116. "./enum/PathDisplayMode": 39,
  22117. "./enum/PlayerEvents": 40,
  22118. "./enum/TagStates": 44,
  22119. "./enum/Vectors": 50,
  22120. "./enum/Viewmode": 51,
  22121. "./enum/WarpStyle": 52,
  22122. "./enum/ZoomEvents": 53,
  22123. "./exception/BasicException": 55,
  22124. "./model/ModelManager": 140,
  22125. "./objects/NSpider": 147,
  22126. "./objects/Panorama": 148,
  22127. "./objects/Reticule": 149,
  22128. "./objects/ShowPath": 151,
  22129. "./objects/Snapshot": 153,
  22130. "./objects/View": 154,
  22131. "./settings": 166,
  22132. "./shaders": 167,
  22133. "./tile/TileDownloader": 171,
  22134. "./tile/TilePrioritizer": 172,
  22135. "./util/ZoomStats": 179,
  22136. "./util/browser": 182,
  22137. "./util/camera": 183,
  22138. "./util/cameraLight": 184,
  22139. "./util/common": 185,
  22140. "./util/easing": 186,
  22141. "./util/history": 187,
  22142. "./util/lerp": 188,
  22143. "./util/logger": 189,
  22144. "./util/math": 190,
  22145. "./util/transitions": 195,
  22146. events: 202,
  22147. three: 217
  22148. }],
  22149. 156: [function(e, t, i) {//js/preloaders.js
  22150. (function(i) {
  22151. "use strict";
  22152. function n(e, t) {
  22153. this.model = e,
  22154. this.panos = e.panos,
  22155. this.player = t,
  22156. this.imagePanos = this.listImagePanos(),
  22157. this.retryMinimumTime = 1e4
  22158. }
  22159. var r = (e("three"),
  22160. e("./enum/Viewmode"))
  22161. , o = (e("./settings"),
  22162. e("./objects/Panorama"))
  22163. , a = e("./util/logger")
  22164. , s = new a(i);
  22165. n.prototype.start = function() {
  22166. this.loadNextPano(function(e) {
  22167. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  22168. setTimeout(function() {
  22169. this.start()
  22170. }
  22171. .bind(this), 1e3))
  22172. }
  22173. .bind(this))
  22174. }
  22175. ,
  22176. n.prototype.validLoadTarget = function(e) {
  22177. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22178. }
  22179. ,
  22180. n.prototype.listImagePanos = function() {
  22181. var e = []
  22182. , t = this;
  22183. return this.model.images.forEach(function(i) {
  22184. if (i.metadata && i.metadata.scan_id) {
  22185. var n = t.model.panos.get(i.metadata.scan_id);
  22186. n && !n.isLoaded("high") && e.push(n)
  22187. }
  22188. }),
  22189. e
  22190. }
  22191. ,
  22192. n.prototype.nextNotLoadedImage = function() {
  22193. for (; this.imagePanos.length > 0; ) {
  22194. var e = this.imagePanos[0];
  22195. if (!e.isLoaded("high"))
  22196. return e;
  22197. this.imagePanos.shift()
  22198. }
  22199. return null
  22200. }
  22201. ,
  22202. n.prototype.loadNextPano = function(e) {
  22203. var t, i, n = this.model.waitQueue.filter(function(e) {
  22204. return e.object instanceof o
  22205. });
  22206. n.length > 0 ? (t = n[0].object,
  22207. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22208. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22209. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22210. t = this.imagePanos[0],
  22211. s.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode === r.PANORAMA && (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())]),
  22212. t && s.debug("Normal pano selection: neighbor " + t.id)),
  22213. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22214. s.debug("Preloading " + i + "-res pano " + t.id),
  22215. t.loadCube(i).done(e).fail(function() {
  22216. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22217. e()
  22218. })) : e && e(null)
  22219. }
  22220. ,
  22221. t.exports = n
  22222. }
  22223. ).call(this, "/js/preloaders.js")
  22224. }
  22225. , {
  22226. "./enum/Viewmode": 51,
  22227. "./objects/Panorama": 148,
  22228. "./settings": 166,
  22229. "./util/logger": 189,
  22230. three: 217
  22231. }],
  22232. 157: [function(e, t, i) {//js/scene/QuickstartManager.js
  22233. (function(i) {
  22234. "use strict";
  22235. function n(e, t, i, n, r) {
  22236. this.qualityManager = e,
  22237. this.scene = t,
  22238. this.camera = i,
  22239. this.container = r,
  22240. this.controls = n,
  22241. this.controls.enabled = !0,
  22242. this.controls.locked = !0,
  22243. this.quickstartCamera = n.camera,
  22244. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $('#player').width() , $('#player').height()),
  22245. this.skybox = null
  22246. }
  22247. var r = e("three")
  22248. , o = e("../util/logger")
  22249. , a = e("../constants")
  22250. , s = (e("../util/transitions"),
  22251. e("../util/lerp"),
  22252. e("../util/easing"),
  22253. e("../enum/Vectors"))
  22254. , l = e("../enum/PanoSizeClass")
  22255. , c = (e("../materials/ModelTextureMaterial"),
  22256. e("../materials/CubemapMaterial"))
  22257. , h = (e("../cameras/PanoramaCamera"),
  22258. e("../controls/PanoramaControls"),
  22259. e("../tile/TileUtils"),
  22260. e("../util/camera"),
  22261. e("../util/cameraLight"))
  22262. , u = (e("../util/browser"),
  22263. e("../settings"),
  22264. e("../gui/helpManager"),
  22265. new o(i));
  22266. n.prototype.load = function(e) {
  22267. e.pano.shouldRedrawOnBaseLoaded = !0;
  22268. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22269. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22270. var a = this.qualityManager.getPanoSize(l.BASE)
  22271. , c = this.qualityManager.getPanoSize(l.STANDARD);
  22272. if (e.pano.tiled) {
  22273. u.warn("Loading startPano, TILED", e.pano.id);
  22274. var d = h.getHFOVForCamera(this.quickstartCamera, $('#player').width() , $('#player').height())
  22275. , p = this.quickstartCamera.fov;
  22276. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  22277. t = e.pano.loadTiledPano(c, r, {
  22278. hFov: d,
  22279. vFov: p
  22280. }, !1, !1, !0),
  22281. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22282. } else
  22283. u.warn("Loading startPano", e.pano.id),
  22284. t = e.pano.loadCube("high");
  22285. return $.when(t).then(function() {
  22286. n.init(e.pano, e.quaternion),
  22287. e.pano.tiled ? i.done(function() {
  22288. e.pano.lockUntilRenderingComplete = !1,
  22289. this.controls.locked = !1
  22290. }
  22291. .bind(this)) : this.controls.locked = !1
  22292. }
  22293. .bind(this))
  22294. }
  22295. ,
  22296. n.prototype.init = function(e, t) {
  22297. u.info("Quickstart done loading, adding scene objects"),
  22298. e.lockUntilRenderingComplete = !0,
  22299. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  22300. side: r.BackSide
  22301. })),
  22302. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22303. this.skybox.quaternion.copy(e.quaternion),
  22304. this.scene.add(this.skybox),
  22305. $(this.container).show()
  22306. }
  22307. ,
  22308. n.prototype.update = function(e) {
  22309. this.controls.update(e),
  22310. this.camera.copy(this.quickstartCamera)
  22311. }
  22312. ,
  22313. n.prototype.setSize = function(e, t) {
  22314. this.quickstartCamera.updateAspect(e / t)
  22315. }
  22316. ,
  22317. n.prototype.destroy = function() {
  22318. this.scene.remove(this.skybox)
  22319. }
  22320. ,
  22321. t.exports = n
  22322. }
  22323. ).call(this, "/js/scene/QuickstartManager.js")
  22324. }
  22325. , {
  22326. "../cameras/PanoramaCamera": 7,
  22327. "../constants": 8,
  22328. "../controls/PanoramaControls": 13,
  22329. "../enum/PanoSizeClass": 36,
  22330. "../enum/Vectors": 50,
  22331. "../gui/helpManager": 68,
  22332. "../materials/CubemapMaterial": 117,
  22333. "../materials/ModelTextureMaterial": 118,
  22334. "../settings": 166,
  22335. "../tile/TileUtils": 174,
  22336. "../util/browser": 182,
  22337. "../util/camera": 183,
  22338. "../util/cameraLight": 184,
  22339. "../util/easing": 186,
  22340. "../util/lerp": 188,
  22341. "../util/logger": 189,
  22342. "../util/transitions": 195,
  22343. three: 217
  22344. }],
  22345. 158: [function(e, t, i) {//"./scene/SceneRenderer"
  22346. "use strict";
  22347. function n(e, t, i) {
  22348. this.scene = e,
  22349. this.camera = t,
  22350. this.renderer = null,
  22351. this.effects = i,
  22352. this.animateCallback = null,
  22353. this.composer = null,
  22354. this.qualityManager = null,
  22355. e.renderWidth = 0,
  22356. e.renderHeight = 0,
  22357. this.updateClock = new r.Clock,
  22358. this.components = [],
  22359. this.updateListeners = [],
  22360. this.resizeListeners = [],
  22361. this.forceUpdateSize = !1,
  22362. this.started = !1,
  22363. this.textures = {},
  22364. this.suspendedObjects = []
  22365. }
  22366. var r = e("three")
  22367. , o = e("../shaders")
  22368. , a = e("../enum/SceneRendererEvents")
  22369. , s = e("../enum/GLTextureType")
  22370. , l = e("../enum/GLCubeFaces")
  22371. , c = e("../exception/BasicException")
  22372. , h = e("../exception/RendererCreationException")
  22373. , u = e("../settings")
  22374. , d = e("events").EventEmitter;
  22375. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22376. n.prototype = Object.create(d.prototype),
  22377. n.prototype.addComponent = function(e) {
  22378. this.components.push(e),
  22379. e.update && this.updateListeners.push(e),
  22380. e.setSize && (this.resizeListeners.push(e),
  22381. this.forceUpdateSize = !0)
  22382. }
  22383. ,
  22384. n.prototype.removeComponent = function(e) {
  22385. var t = function(t) {
  22386. return t !== e
  22387. };
  22388. this.components = this.components.filter(t),
  22389. this.updateListeners = this.updateListeners.filter(t),
  22390. this.resizeListeners = this.resizeListeners.filter(t)
  22391. }
  22392. ,
  22393. n.prototype.start = function(e) {
  22394. if (this.started)
  22395. throw new c("Can't start SceneRenderer, already started");
  22396. this.createContext(e),
  22397. this.initComposer(),
  22398. this.started = !0,
  22399. (p = p.bind(this))()
  22400. }
  22401. ,
  22402. n.prototype.createContext = function(e) {
  22403. try {
  22404. this.renderer = new r.WebGLRenderer,
  22405. this.renderer.autoClear = !0,
  22406. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22407. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  22408. this.emit(a.ContextCreated)
  22409. } catch (e) {
  22410. throw new h("Unable to create a WebGL rendering context")
  22411. }
  22412. u.profiling.enabled && this.overrideTextures(),
  22413. e.appendChild(this.renderer.domElement)
  22414. }
  22415. ,
  22416. n.prototype.overrideTextures = function() {
  22417. var e = this.renderer.context
  22418. , t = 0
  22419. , i = e.createTexture;
  22420. e.createTexture = function() {
  22421. var n = i.call(e);
  22422. return n.id = t++,
  22423. this.textures[n.id] = n,
  22424. n
  22425. }
  22426. .bind(this);
  22427. var n = e.texImage2D;
  22428. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  22429. var d, p = this.getTextureTypeFromTarget(e, t);
  22430. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  22431. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  22432. h = a,
  22433. u = l,
  22434. o = u.naturalWidth,
  22435. a = u.naturalHeight,
  22436. n.call(e, t, i, r, c, h, u));
  22437. var f = this.textures[d.id];
  22438. f.width = p === s.TextureCube ? 6 * o : o,
  22439. f.height = a
  22440. }
  22441. .bind(this);
  22442. var r = e.deleteTexture;
  22443. e.deleteTexture = function(t) {
  22444. delete this.textures[t.id],
  22445. r.call(e, t)
  22446. }
  22447. .bind(this)
  22448. }
  22449. ,
  22450. n.prototype.updateTextureMemory = function() {
  22451. var e = null;
  22452. return function() {
  22453. var t = 0;
  22454. for (var i in this.textures) {
  22455. var n = this.textures[i];
  22456. n.width && n.height && (t += n.width * n.height * 4)
  22457. }
  22458. t !== e && this.emit(a.MemoryUsageUpdated, t),
  22459. e = t
  22460. }
  22461. }(),
  22462. n.prototype.getTextureTypeFromTarget = function(e, t) {
  22463. switch (t) {
  22464. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22465. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22466. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22467. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22468. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22469. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22470. return s.TextureCube;
  22471. case e.TEXTURE_2D:
  22472. return s.Texture2D;
  22473. default:
  22474. return null
  22475. }
  22476. }
  22477. ,
  22478. n.prototype.initComposer = function() {
  22479. this.composer = new r.EffectComposer(this.renderer),
  22480. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  22481. this.composer.addPass(this.effects.hblurPass),
  22482. this.composer.addPass(this.effects.vblurPass)
  22483. }
  22484. ,
  22485. n.prototype.setSize = function(e, t, devicePixelRatio) {
  22486. this.renderWidth = e,
  22487. this.renderHeight = t,
  22488. this.effects.aspect = e / t,
  22489. /* this.renderer.setSize(e, t), -----MP */
  22490. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  22491. this.composer.setSize(e, t);
  22492. for (var i = 0; i < this.resizeListeners.length; i++)
  22493. this.resizeListeners[i].setSize(e, t)
  22494. }
  22495. ,
  22496. n.prototype.render = function() {
  22497. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22498. }
  22499. ,
  22500. /* n.prototype.updateScreenSize = function() { //MP
  22501. (window.innerWidth !== this.renderWidth || window.innerHeight !== this.renderHeight || this.forceUpdateSize) && (this.setSize(window.innerWidth, window.innerHeight),
  22502. this.forceUpdateSize = !1)
  22503. } */
  22504. n.prototype.updateScreenSize = function() {//xzw 改 缩放时不模糊
  22505. var w = $('#player').width();
  22506. var h = $('#player').height();
  22507. (w !== this.renderWidth || h !== this.renderHeight || this.forceUpdateSize) && (this.setSize(w,h,window.devicePixelRatio),
  22508. this.forceUpdateSize = !1)
  22509. }
  22510. ,
  22511. n.prototype.updateComponents = function() {
  22512. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22513. this.updateListeners[t].update(e)
  22514. }
  22515. ,
  22516. n.prototype.suspend = function() {
  22517. this.started = !1,
  22518. this.suspendedObjects = this.scene.children.map(function(e) {
  22519. return this.scene.remove(e),
  22520. e
  22521. }
  22522. .bind(this)),
  22523. this.render()
  22524. }
  22525. ,
  22526. n.prototype.resume = function() {
  22527. this.suspendedObjects.forEach(function(e) {
  22528. this.scene.add(e)
  22529. }
  22530. .bind(this)),
  22531. this.suspendedObjects = [],
  22532. this.started = !0,
  22533. p()
  22534. }
  22535. ;
  22536. var p = function() {
  22537. this.started && (window.requestAnimationFrame(p),
  22538. this.updateScreenSize(),
  22539. this.updateComponents(),
  22540. this.updateTextureMemory(),
  22541. this.render(),
  22542. this.emit(a.AfterRender))
  22543. };
  22544. n.prototype.getImageData = function() {
  22545. var e = document.createElement("canvas")
  22546. , t = e.getContext("2d");
  22547. return function(i, n, r) {
  22548. return e.width === n && e.height === r || (e.width = n,
  22549. e.height = r),
  22550. t.drawImage(i, 0, 0, n, r),
  22551. t.getImageData(0, 0, n, r)
  22552. }
  22553. }(),
  22554. n.prototype.initSizedTexture2D = function(e, t, i) {
  22555. var n = this.renderer
  22556. , o = n.context
  22557. , a = n.state
  22558. , s = new r.Texture(null);
  22559. s.flipY = !1,
  22560. i !== !0 && (i = !1),
  22561. s.generateMipmaps = i;
  22562. var l = n.paramThreeToGL(s.format)
  22563. , c = n.paramThreeToGL(s.type)
  22564. , h = n.properties.get(s)
  22565. , u = o.createTexture();
  22566. a.bindTexture(o.TEXTURE_2D, u),
  22567. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  22568. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  22569. s.wrapS = t,
  22570. s.wrapT = t;
  22571. var d = n.paramThreeToGL(t);
  22572. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  22573. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  22574. i ? (s.magFilter = r.LinearFilter,
  22575. s.minFilter = r.LinearMipMapLinearFilter,
  22576. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22577. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  22578. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  22579. s.minFilter = r.LinearFilter,
  22580. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22581. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  22582. a.bindTexture(o.TEXTURE_2D, null),
  22583. h.__webglTexture = u,
  22584. s
  22585. }
  22586. ,
  22587. n.prototype.initSizedCubeMap = function(e, t) {
  22588. var i = this.renderer
  22589. , n = i.context
  22590. , o = i.state
  22591. , a = new r.CubeTexture([null, null, null, null, null, null]);
  22592. a.flipY = !1,
  22593. a.generateMipmaps = t;
  22594. var s = i.paramThreeToGL(a.format)
  22595. , l = i.paramThreeToGL(a.type)
  22596. , c = i.properties.get(a)
  22597. , h = n.createTexture();
  22598. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  22599. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  22600. for (var u = 0; u < 6; u++)
  22601. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  22602. return t ? (a.magFilter = r.LinearFilter,
  22603. a.minFilter = r.LinearMipMapLinearFilter,
  22604. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22605. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  22606. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  22607. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  22608. a.minFilter = r.LinearFilter,
  22609. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22610. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  22611. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  22612. c.__image__webglTextureCube = h,
  22613. a
  22614. }
  22615. ,
  22616. n.prototype.deallocateCubeTexture = function(e) {
  22617. var t = this.renderer
  22618. , i = t.context
  22619. , n = t.properties.get(e);
  22620. i.deleteTexture(n.__image__webglTextureCube)
  22621. }
  22622. ,
  22623. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  22624. var a = this.renderer
  22625. , s = a.context
  22626. , l = a.state
  22627. , c = a.properties.get(t);
  22628. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  22629. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22630. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  22631. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  22632. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  22633. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  22634. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  22635. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  22636. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  22637. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  22638. l.bindTexture(s.TEXTURE_2D, null)
  22639. }
  22640. ,
  22641. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  22642. var s = this.renderer
  22643. , l = s.context
  22644. , c = s.state
  22645. , h = s.properties.get(t);
  22646. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  22647. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22648. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  22649. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  22650. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  22651. }
  22652. ,
  22653. n.prototype.rebuildMipMaps2D = function(e) {
  22654. var t = this.renderer
  22655. , i = t.context
  22656. , n = t.state;
  22657. t.properties.get(e);
  22658. i.generateMipmap(i.TEXTURE_2D),
  22659. n.bindTexture(i.TEXTURE_2D, null)
  22660. }
  22661. ,
  22662. n.prototype.rebuildMipMaps3D = function(e) {
  22663. var t = this.renderer
  22664. , i = t.context
  22665. , n = t.state
  22666. , r = t.properties.get(e);
  22667. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  22668. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  22669. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  22670. }
  22671. ,
  22672. n.prototype.renderToCubeMap = function() {
  22673. var e = !1
  22674. , t = null
  22675. , i = null
  22676. , n = null
  22677. , a = null
  22678. , s = null
  22679. , l = 1;
  22680. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  22681. var _ = this.renderer;
  22682. _.context;
  22683. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  22684. i.position.z = 150,
  22685. t = new r.Scene,
  22686. t.add(i),
  22687. n = new r.ShaderMaterial({
  22688. uniforms: {
  22689. tDiffuse: {
  22690. type: "t",
  22691. value: null
  22692. },
  22693. alpha: {
  22694. type: "f",
  22695. value: 1
  22696. }
  22697. },
  22698. vertexShader: o.basicTextured.vertexShader,
  22699. fragmentShader: o.basicTextured.fragmentShader,
  22700. depthWrite: !1,
  22701. depthTest: !1,
  22702. side: r.DoubleSide
  22703. }),
  22704. a = new r.PlaneBufferGeometry(l,l),
  22705. s = new r.Mesh(a,n),
  22706. s.position.z = 0,
  22707. t.add(s),
  22708. e = !0);
  22709. var T = a.getAttribute("uv");
  22710. T.setDynamic(!0),
  22711. T.needsUpdate = !0;
  22712. var x = T.array
  22713. , S = p / u
  22714. , M = f / d
  22715. , R = g / u
  22716. , P = m / d;
  22717. x[0] = S,
  22718. x[1] = M + P,
  22719. x[2] = S + R,
  22720. x[3] = M + P,
  22721. x[4] = S,
  22722. x[5] = M,
  22723. x[6] = S + R,
  22724. x[7] = M;
  22725. var O = a.getAttribute("position");
  22726. O.setDynamic(!0),
  22727. O.needsUpdate = !0;
  22728. var L = O.array
  22729. , D = v / h.width - l / 2
  22730. , N = A / h.height - l / 2
  22731. , B = y / h.width
  22732. , F = C / h.height;
  22733. L[0] = D,
  22734. L[1] = N + F,
  22735. L[3] = D + B,
  22736. L[4] = N + F,
  22737. L[6] = D,
  22738. L[7] = N,
  22739. L[9] = D + B,
  22740. L[10] = N;
  22741. this.renderer.properties.get(c);
  22742. n.uniforms.tDiffuse.value = c,
  22743. n.blending = E || r.NoBlending,
  22744. n.transparent = !!b,
  22745. void 0 !== w && null !== w || (w = 1),
  22746. n.uniforms.alpha.value = w,
  22747. n.needUpdate = !0,
  22748. h.activeCubeFace = I,
  22749. h.viewport.set(0, 0, h.width, h.height);
  22750. var V = this.renderer.autoClear;
  22751. this.renderer.autoClear = !1,
  22752. this.renderer.render(t, i, h, !1),
  22753. this.renderer.autoClear = V
  22754. }
  22755. }(),
  22756. n.prototype.copyCubeMap = function() {
  22757. var e = !1
  22758. , t = null
  22759. , i = null
  22760. , a = null
  22761. , s = null
  22762. , l = null
  22763. , c = new r.Euler;
  22764. new r.Vector3;
  22765. return function(h, u, d, p, f, g, m, v, A) {
  22766. this.renderer;
  22767. if (!e) {
  22768. var y = 2;
  22769. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  22770. i.position.set(0, 0, 0),
  22771. t = new r.Scene,
  22772. t.add(i),
  22773. a = new r.ShaderMaterial({
  22774. uniforms: {
  22775. tDiffuse: {
  22776. type: "t",
  22777. value: null
  22778. },
  22779. alpha: {
  22780. type: "f",
  22781. value: 1
  22782. }
  22783. },
  22784. vertexShader: o.copyCubeMap.vertexShader,
  22785. fragmentShader: o.copyCubeMap.fragmentShader,
  22786. depthWrite: !1,
  22787. depthTest: !1,
  22788. side: r.DoubleSide
  22789. }),
  22790. s = new r.BoxGeometry(y,y,y),
  22791. l = new r.Mesh(s,a),
  22792. t.add(l),
  22793. e = !0
  22794. }
  22795. for (var C = 0; C < 6; C++)
  22796. n.getCubeOrientationForCubeFace(C, c),
  22797. l.rotation.copy(c),
  22798. l.matrixWorldNeedsUpdate = !0,
  22799. l.updateMatrixWorld(),
  22800. a.uniforms.tDiffuse.value = h,
  22801. a.blending = m || r.NoBlending,
  22802. a.transparent = !!v,
  22803. void 0 !== A && null !== A || (A = 1),
  22804. a.uniforms.alpha.value = A,
  22805. a.needUpdate = !0,
  22806. u.activeCubeFace = C,
  22807. u.viewport.set(0, 0, f, g),
  22808. this.renderer.render(t, i, u, !1)
  22809. }
  22810. }(),
  22811. n.getLookAtForCubeFace = function(e, t) {
  22812. switch (e) {
  22813. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  22814. t.set(1, 0, 0);
  22815. break;
  22816. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  22817. t.set(-1, 0, 0);
  22818. break;
  22819. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  22820. t.set(0, 1, 0);
  22821. break;
  22822. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22823. t.set(0, -1, 0);
  22824. break;
  22825. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  22826. t.set(0, 0, 1);
  22827. break;
  22828. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22829. t.set(0, 0, -1)
  22830. }
  22831. }
  22832. ,
  22833. n.getCubeOrientationForCubeFace = function(e, t) {
  22834. switch (e) {
  22835. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  22836. t.set(0, -Math.PI / 2, 0);
  22837. break;
  22838. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  22839. t.set(0, Math.PI / 2, 0);
  22840. break;
  22841. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  22842. t.set(Math.PI / 2, Math.PI, 0);
  22843. break;
  22844. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22845. t.set(-Math.PI / 2, Math.PI, 0);
  22846. break;
  22847. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  22848. t.set(0, -Math.PI, 0);
  22849. break;
  22850. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22851. t.set(0, 0, 0)
  22852. }
  22853. }
  22854. ,
  22855. t.exports = n
  22856. }
  22857. , {
  22858. "../enum/GLCubeFaces": 25,
  22859. "../enum/GLTextureType": 26,
  22860. "../enum/SceneRendererEvents": 43,
  22861. "../exception/BasicException": 55,
  22862. "../exception/RendererCreationException": 57,
  22863. "../settings": 166,
  22864. "../shaders": 167,
  22865. events: 202,
  22866. three: 217
  22867. }],
  22868. 159: [function(e, t, i) {//"./ApiHost"
  22869. "use strict";
  22870. function n(e) {
  22871. this.messenger = new a(e),
  22872. this.clientKey = null
  22873. }
  22874. var r = e("../util/ajax")
  22875. , o = e("./PostMessageType")
  22876. , a = e("./postmessage")
  22877. , s = e("./VersionInfo")
  22878. , l = e("events").EventEmitter
  22879. , c = window.location.origin + "/api/v1/user/";
  22880. n.prototype = Object.create(l.prototype),
  22881. n.prototype.bindEvents = function() {
  22882. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  22883. }
  22884. ,
  22885. n.prototype.waitForConnection = function() {
  22886. var e = new Promise(function(e, t) {
  22887. this.messenger.on(o.CONNECT, function(i) {
  22888. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  22889. }
  22890. .bind(this))
  22891. }
  22892. .bind(this));
  22893. return e
  22894. }
  22895. ,
  22896. n.prototype.onConnectionReceived = function(e) {
  22897. return this.messenger.setTarget(e.source, e.origin),
  22898. this.verifyConnection(e).then(function(t, i) {
  22899. this.messenger.send({
  22900. type: o.ACCEPT,
  22901. toId: e.fromId,
  22902. warning: i
  22903. }),
  22904. this.clientKey = t,
  22905. this.messenger.removeAllListeners(o.CONNECT),
  22906. this.bindEvents()
  22907. }
  22908. .bind(this), function(t) {
  22909. this.messenger.send({
  22910. type: o.REJECT,
  22911. toId: e.fromId,
  22912. reason: t
  22913. }),
  22914. this.messenger.setTarget()
  22915. }
  22916. .bind(this))
  22917. }
  22918. ,
  22919. n.prototype.verifyConnection = function(e) {
  22920. return new Promise(function(t, i) {
  22921. var n;
  22922. if (s.isDeprecated(e.sdkVersion))
  22923. n = "This version of the SDK is being deprecated. Please see http://www.port.com for more info";
  22924. else if (!s.isSupported(e.sdkVersion))
  22925. return i("This version of the SDK isn't supported. Get the latest version here: http://www.port.com");
  22926. var o = {
  22927. cache: !1,
  22928. headers: {
  22929. "X-port-Application-Key": e.applicationKey,
  22930. "X-port-Referrer": e.origin
  22931. }
  22932. };
  22933. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  22934. }
  22935. )
  22936. }
  22937. ,
  22938. n.prototype.onMessageReceived = function(e) {
  22939. if (this.validateClientApplicationKey(e.applicationKey)) {
  22940. var t = this;
  22941. e.onDone = function(i) {
  22942. i.toId = e.fromId,
  22943. i.uid = e.uid,
  22944. i.type = o.RESPONSE,
  22945. t.messenger.send(i)
  22946. }
  22947. ,
  22948. this.emit(o.ACTION, e)
  22949. }
  22950. }
  22951. ,
  22952. n.prototype.validateClientApplicationKey = function(e) {
  22953. return this.clientKey === e
  22954. }
  22955. ,
  22956. n.prototype.sendEvent = function(e, t) {
  22957. this.messenger.send({
  22958. type: o.EVENT,
  22959. eventType: e,
  22960. eventData: t
  22961. })
  22962. }
  22963. ,
  22964. t.exports = n
  22965. }
  22966. , {
  22967. "../util/ajax": 181,
  22968. "./PostMessageType": 160,
  22969. "./VersionInfo": 163,
  22970. "./postmessage": 165,
  22971. events: 202
  22972. }],
  22973. 160: [function(e, t, i) {//"./PostMessageType"
  22974. "use strict";
  22975. t.exports = Object.freeze({
  22976. CONNECT: "postmessage.connect",
  22977. ACCEPT: "postmessage.accept",
  22978. REJECT: "postmessage.reject",
  22979. ACTION: "postmessage.action",
  22980. RESPONSE: "postmessage.response",
  22981. EVENT: "postmessage.event"
  22982. })
  22983. }
  22984. , {}],
  22985. 161: [function(e, t, i) {//"../sdk/SdkEvents"
  22986. "use strict";
  22987. t.exports = Object.freeze({
  22988. MOVE: "sdk.move",
  22989. ENTER_PANO: "sdk.enterpano",
  22990. MODEL_LOADED: "sdk.modelloaded"
  22991. })
  22992. }
  22993. , {}],
  22994. 162: [function(e, t, i) {//"./TransitionStyles"
  22995. "use strict";
  22996. t.exports = Object.freeze({
  22997. FLY: "transition.fly",
  22998. FADEOUT: "transition.fade",
  22999. INSTANT: "transition.instant"
  23000. })
  23001. }
  23002. , {}],
  23003. 163: [function(e, t, i) {//"./VersionInfo"
  23004. "use strict";
  23005. t.exports = {
  23006. current: "1.0",
  23007. supported: ["1.0"],
  23008. deprecated: [],
  23009. isSupported: function(e) {
  23010. return this.supported.indexOf(e) !== -1
  23011. },
  23012. isDeprecated: function(e) {
  23013. return this.deprecated.indexOf(e) !== -1
  23014. },
  23015. isValid: function(e) {
  23016. return this.isSupported(e) || this.isDeprecated(e)
  23017. }
  23018. }
  23019. }
  23020. , {}],
  23021. 164: [function(e, t, i) {///js/sdk/automation.js
  23022. (function(i) {
  23023. "use strict";
  23024. function n(e, t, i) {
  23025. e && (e = e.toLowerCase().trim());
  23026. var n = new I.UP.clone
  23027. , r = Math.PI / 3
  23028. , o = Math.PI / 2;
  23029. switch (e) {
  23030. case "left":
  23031. i.copy(t),
  23032. i.applyAxisAngle(n, o);
  23033. break;
  23034. case "right":
  23035. i.copy(t),
  23036. i.applyAxisAngle(n, -o);
  23037. break;
  23038. case "forwardleft":
  23039. i.copy(t),
  23040. i.applyAxisAngle(n, r);
  23041. break;
  23042. case "forwardright":
  23043. i.copy(t),
  23044. i.applyAxisAngle(n, -r);
  23045. break;
  23046. case "forward":
  23047. default:
  23048. i.copy(t)
  23049. }
  23050. return i
  23051. }
  23052. function r(e, t) {
  23053. if (e) {
  23054. var i = {
  23055. pano: e,
  23056. lookAtPoint: null,
  23057. duration: null,
  23058. maxDistanceOverride: null,
  23059. skipWarpingCheck: !1
  23060. };
  23061. this.player.flyToPano(i, function() {
  23062. t && t({
  23063. success: !0,
  23064. message: "Transition complete."
  23065. })
  23066. })
  23067. } else
  23068. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23069. t && t({
  23070. success: !1,
  23071. error: "Unable to find pano."
  23072. })
  23073. }
  23074. function o(e, t) {
  23075. var i = this.findRankedPano(e, t);
  23076. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23077. null)
  23078. }
  23079. function a(e, t) {
  23080. var i = this.findRankedtag(e, t);
  23081. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23082. null)
  23083. }
  23084. function s(e, t) {
  23085. t.copy(I.FORWARD),
  23086. e.getDirection(t)
  23087. }
  23088. function l(e) {
  23089. function t(e) {
  23090. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23091. return {
  23092. x: c.Math.radToDeg(t._x),
  23093. y: c.Math.radToDeg(t._y),
  23094. z: c.Math.radToDeg(t._z)
  23095. }
  23096. }
  23097. var i = function(e) {
  23098. return e.alignmentType !== m.ALIGNED ? null : {
  23099. x: e.position.x,
  23100. y: e.position.y,
  23101. z: e.position.z
  23102. }
  23103. };
  23104. return {
  23105. panos: e.panos.list.map(function(n) {
  23106. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23107. return {
  23108. uuid: n.id,
  23109. aligned: n.alignmentType === m.ALIGNED,
  23110. neighbourUUIDs: n.neighbourUUIDs.slice(),
  23111. position: i(n),
  23112. rotation: t(n),
  23113. thumbnail: r
  23114. }
  23115. })
  23116. }
  23117. }
  23118. var c = e("three")
  23119. , h = e("./ApiHost")
  23120. , u = e("../util/logger")
  23121. , d = e("../util/common")
  23122. , p = e("../util/math")
  23123. , f = e("../enum/ModelManagerEvents")
  23124. , g = e("./PostMessageType")
  23125. , m = e("../enum/AlignmentType")
  23126. , v = e("../enum/Direction")
  23127. , A = e("./TransitionStyles")
  23128. , y = e("../util/panorama")
  23129. , C = e("../enum/GLCubeFaces")
  23130. , I = e("../enum/Vectors")
  23131. , E = e("../enum/Viewmode")
  23132. , b = e("../enum/WarpStyle")
  23133. , w = (e("../enum/Keys"),
  23134. e("../enum/PlayerEvents"))
  23135. , _ = e("../sdk/SdkEvents")
  23136. , I = e("../enum/Vectors")
  23137. , T = e("../enum/ControlEvents")
  23138. , x = e("../enum/RenderLayers")
  23139. , S = (e("../constants"),
  23140. e("../settings"))
  23141. , M = e("../lib/jpeg_encoder")
  23142. , R = new u(i)
  23143. , P = function() {
  23144. var e = function e() {
  23145. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23146. e.player.getDirection(e.playerDirection),
  23147. e.projectVectors();
  23148. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  23149. if (e.angleTravelled += Math.abs(t),
  23150. e.angleTravelled >= Math.abs(e.angle)) {
  23151. if (e.active = !1,
  23152. e.onDone) {
  23153. var i = e.onDone;
  23154. i()
  23155. }
  23156. } else
  23157. e.lastFacingDirection.copy(e.playerDirection),
  23158. window.setTimeout(e, 4)
  23159. };
  23160. return e.active = !1,
  23161. e.angle = 0,
  23162. e.angleTravelled = 0,
  23163. e.playerDirection = new c.Vector3,
  23164. e.lastFacingDirection = new c.Vector3,
  23165. e.onDone = null,
  23166. e.player = null,
  23167. e.start = function(t, i, n, r) {
  23168. e.active = !0,
  23169. t && i && (i = 0),
  23170. e.angle = t || i,
  23171. e.xAngle = t,
  23172. e.yAngle = i,
  23173. e.angleTravelled = 0,
  23174. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23175. n.getDirection(e.playerDirection),
  23176. e.lastFacingDirection.copy(e.playerDirection),
  23177. e.projectVectors(),
  23178. e.onDone = r,
  23179. e.player = n,
  23180. e()
  23181. }
  23182. ,
  23183. e.projectVectors = function() {
  23184. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  23185. e.lastFacingDirection.projectOnPlane(I.UP))
  23186. }
  23187. ,
  23188. e
  23189. }()
  23190. , O = function() {
  23191. var e = new c.Vector3;
  23192. return function(t) {
  23193. t ? (e.copy(t.position),
  23194. e.add(t.discPosition),
  23195. p.projectPositionToCanvas(e, this.player.camera, e),
  23196. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  23197. }
  23198. }()
  23199. , L = function() {
  23200. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  23201. }
  23202. , D = function() {
  23203. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  23204. }
  23205. , N = function(e) {
  23206. var t = new c.Vector3;
  23207. return function(e) {
  23208. var i = this.player.getDirection();
  23209. t.copy(i);
  23210. var n = t.y;
  23211. t.y = 0,
  23212. t.normalize();
  23213. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  23214. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  23215. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23216. 0;
  23217. this.player.mode === E.DOLLHOUSE && (r = -r);
  23218. var o = L.call(this) - .1
  23219. , a = D.call(this) + .1
  23220. , s = r + e;
  23221. s > o ? s = o : s < a && (s = a);
  23222. var l = s - r;
  23223. return e > 0 && l < .01 && (l = 0),
  23224. e < 0 && l > -.01 && (l = 0),
  23225. l
  23226. }
  23227. }()
  23228. , B = function() {
  23229. var e = new c.Euler;
  23230. return function(t) {
  23231. return e.setFromQuaternion(t.quaternion, "YXZ"),
  23232. {
  23233. position: {
  23234. x: t.position.x,
  23235. y: t.position.y,
  23236. z: t.position.z
  23237. },
  23238. rotation: {
  23239. x: c.Math.radToDeg(e.x),
  23240. y: c.Math.radToDeg(e.y),
  23241. z: 0
  23242. },
  23243. pano: t.currentPano ? t.currentPano.id : null,
  23244. mode: t.mode
  23245. }
  23246. }
  23247. }()
  23248. , F = null;
  23249. t.exports = {
  23250. init: function(e, t, i, n, r) {
  23251. V.init(e, t, i, r),
  23252. F = new Promise(function(e, t) {
  23253. i.on(w.Ready, function() {
  23254. e()
  23255. })
  23256. }
  23257. .bind(this));
  23258. var o = new h(window)
  23259. , a = o.waitForConnection();
  23260. a.then(function(e) {
  23261. o.on(g.ACTION, V.onMessageReceive.bind(V))
  23262. });
  23263. var s = function() {
  23264. var e = Date.now();
  23265. return function() {
  23266. if (!(Date.now() - e < 100)) {
  23267. var t = B(i);
  23268. o.sendEvent(_.MOVE, {
  23269. state: t
  23270. }),
  23271. e = Date.now()
  23272. }
  23273. }
  23274. }();
  23275. i.on(w.Move, s),
  23276. i.on(w.ViewChanged, s),
  23277. n.on(f.ActiveModelChanged, function(e) {
  23278. function t(e) {
  23279. var t, i = e.newPano.id;
  23280. e.oldPano && (t = e.oldPano.id),
  23281. i !== t && o.sendEvent(_.ENTER_PANO, {
  23282. oldPano: t,
  23283. newPano: i
  23284. })
  23285. }
  23286. var i = e.model
  23287. , n = e.oldModel;
  23288. V.model = i,
  23289. a.then(function() {
  23290. o.sendEvent(_.MODEL_LOADED, {
  23291. metadata: l(i)
  23292. })
  23293. }),
  23294. n && n.panos.forEach(function(e) {
  23295. e.removeEventListener("enter", t)
  23296. }),
  23297. i.panos.forEach(function(e) {
  23298. e.on("enter", t)
  23299. })
  23300. })
  23301. }
  23302. };
  23303. var V = {
  23304. director: null,
  23305. player: null,
  23306. controls: null,
  23307. sceneRenderer: null,
  23308. model: null,
  23309. init: function(e, t, i, n) {
  23310. this.director = e,
  23311. this.player = i,
  23312. this.controls = t,
  23313. this.sceneRenderer = n
  23314. },
  23315. handleToObject: {},
  23316. objectToHandle: {},
  23317. handleCount: 0,
  23318. onMessageReceive: function(e) {
  23319. if (e) {
  23320. var t = e.targetFunction
  23321. , i = e.params
  23322. , n = e.onDone;
  23323. t && this[t] && this[t](i, n)
  23324. }
  23325. },
  23326. waitForInit: function(e, t) {
  23327. F.then(t.bind({
  23328. success: !0,
  23329. message: "Init complete."
  23330. }))
  23331. },
  23332. moveToPano: function(e, t) {
  23333. var i = new c.Euler(0,0,0,"YXZ")
  23334. , n = new c.Quaternion;
  23335. return function(e, t) {
  23336. var r = e.pano
  23337. , o = e.rotation
  23338. , a = e.transition;
  23339. if (!this.model)
  23340. return t({
  23341. success: !1,
  23342. error: "The model has not been loaded yet"
  23343. });
  23344. var s = this.model.panos.get(r);
  23345. if (!s)
  23346. return t({
  23347. success: !1,
  23348. error: r + " does not exist in this model"
  23349. });
  23350. if (!o)
  23351. return t({
  23352. sucess: !1,
  23353. erorr: o + " is not a valid rotation"
  23354. });
  23355. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  23356. console.log(o.z);
  23357. var l = {
  23358. success: !0,
  23359. message: r
  23360. };
  23361. if (a === A.FADEOUT)
  23362. n.setFromEuler(i),
  23363. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  23364. else {
  23365. var h, u;
  23366. a === A.INSTANT && (h = 0,
  23367. u = 0);
  23368. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  23369. this.player.flyToPano({
  23370. pano: s,
  23371. lookAtPoint: d,
  23372. duration: h,
  23373. aimDuration: u
  23374. }, t.bind(this, l))
  23375. }
  23376. }
  23377. }(),
  23378. moveInDirection: function(e, t) {
  23379. var i = e.direction;
  23380. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23381. void (t && t({
  23382. success: !1,
  23383. error: "Invalid direction."
  23384. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  23385. t(e ? {
  23386. success: !0,
  23387. message: "moved " + i
  23388. } : {
  23389. success: !1,
  23390. error: "Cannot move in direction: " + i
  23391. })
  23392. })
  23393. },
  23394. getPose: function(e, t) {
  23395. this.player.camera.position,
  23396. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  23397. return t({
  23398. success: !0,
  23399. message: B(this.player)
  23400. })
  23401. },
  23402. takeScreenShot: function() {
  23403. var e = new c.PerspectiveCamera
  23404. , t = new c.WebGLRenderTarget;
  23405. return function(i, n) {
  23406. if (!i.resolution)
  23407. return n({
  23408. success: !1,
  23409. error: "An invalid resolution was specified"
  23410. });
  23411. if (i.resolution.width === -1 || i.resolution.height === -1) {
  23412. var r = this.sceneRenderer.renderer.getSize();
  23413. i.resolution.width = r.width,
  23414. i.resolution.height = r.height
  23415. }
  23416. e.layers.set(x.DEFAULT),
  23417. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  23418. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  23419. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  23420. var o = i.resolution.width
  23421. , a = i.resolution.height
  23422. , s = o / a;
  23423. e.position.copy(this.sceneRenderer.camera.position),
  23424. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23425. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23426. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  23427. t.setSize(o, a),
  23428. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  23429. var l = new Uint8Array(o * a * 4);
  23430. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  23431. var c = M.encode({
  23432. data: l,
  23433. width: o,
  23434. height: a,
  23435. heading: 180,
  23436. pitch: 0
  23437. }, {
  23438. quality: 75,
  23439. flipY: !0
  23440. })
  23441. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  23442. n({
  23443. success: !0,
  23444. message: h
  23445. })
  23446. }
  23447. }(),
  23448. findRankedPano: function(e, t) {
  23449. var i = new c.Vector3
  23450. , r = new c.Vector3;
  23451. return function(e, t) {
  23452. s(this.player, r),
  23453. n(t, r, i);
  23454. var o = this.player.rankedPanoInDirection(e, i);
  23455. if (o) {
  23456. var a = this.objectToHandle[o.id];
  23457. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  23458. this.handleToObject[a] = o),
  23459. a
  23460. }
  23461. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23462. -1
  23463. }
  23464. }(),
  23465. findRankedtag: function(e, t) {
  23466. var i = new c.Vector3
  23467. , r = new c.Vector3;
  23468. return function(e, t) {
  23469. s(this.player, r),
  23470. n(t, r, i);
  23471. var o = this.player.rankedtagInDirection(e, i);
  23472. if (o) {
  23473. var a = this.objectToHandle[o.sid];
  23474. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  23475. this.handleToObject[a] = o),
  23476. a
  23477. }
  23478. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23479. -1
  23480. }
  23481. }(),
  23482. clickNearesttag: function(e) {
  23483. this.clickRankedtag(0, e)
  23484. },
  23485. clickRankedtag: function(e, t) {
  23486. var i = a.call(this, e, t);
  23487. i && O.call(this, i)
  23488. },
  23489. clickNearestPano: function(e, t) {
  23490. this.clickRankedPano(0, e, t)
  23491. },
  23492. clickRankedPano: function(e, t, i) {
  23493. var n = o.call(this, e, t);
  23494. n ? r.call(this, n, i) : i(null)
  23495. },
  23496. clickPano: function(e, t) {
  23497. var i = this.handleTable[e];
  23498. i ? r.call(this, i, t) : t(null)
  23499. },
  23500. rotateDirection: function() {
  23501. return function(e, t) {
  23502. var i = e.direction
  23503. , n = e.angle;
  23504. if (!P.active) {
  23505. var r = 0
  23506. , o = 0
  23507. , a = 0
  23508. , s = 0;
  23509. if (!n || isNaN(n))
  23510. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23511. void (t && t({
  23512. success: !1,
  23513. error: "Invalid rotation angle."
  23514. }));
  23515. if (this.player.mode === E.TRANSITIONING)
  23516. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23517. void (t && t({
  23518. success: !1,
  23519. error: "Cannot rotate while transitioning"
  23520. }));
  23521. if (i === v.RIGHT || i === v.LEFT)
  23522. i === v.RIGHT && (n = -n),
  23523. r = n > 0 ? -1 : 1,
  23524. a = n;
  23525. else {
  23526. if (i !== v.UP && i !== v.DOWN)
  23527. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23528. void (t && t({
  23529. success: !1,
  23530. error: "Invalid direction for rotation."
  23531. }));
  23532. if (this.player.mode === E.FLOORPLAN)
  23533. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23534. void (t && t({
  23535. success: !1,
  23536. error: "Cannot rotate " + i + " in floorplan mode"
  23537. }));
  23538. if (i === v.DOWN && (n = -n),
  23539. n = N.call(this, n),
  23540. 0 === n)
  23541. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23542. void (t && t({
  23543. success: !1,
  23544. error: "Already at maximum rotation in direction: " + i
  23545. }));
  23546. o = n > 0 ? 1 : -1,
  23547. s = n
  23548. }
  23549. var l = n;
  23550. n = c.Math.degToRad(n),
  23551. a = c.Math.degToRad(a),
  23552. s = c.Math.degToRad(s);
  23553. var h = this.controls.activeControl
  23554. , u = function() {
  23555. h.stopRotating(!0),
  23556. t && t({
  23557. success: !0,
  23558. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23559. })
  23560. };
  23561. h.startRotating(r, o),
  23562. P.start(a, s, this.player, u)
  23563. }
  23564. }
  23565. }(),
  23566. rotate: function() {
  23567. var e = new c.Vector3
  23568. , t = new c.Vector3;
  23569. return function(i, n) {
  23570. var r = i.xAngle
  23571. , o = i.yAngle;
  23572. if (!P.active) {
  23573. if (r = r || 0,
  23574. o = o || 0,
  23575. isNaN(r) || isNaN(o))
  23576. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  23577. void (n && n({
  23578. success: !1,
  23579. error: "Invalid rotation angle."
  23580. }));
  23581. if (this.player.mode === E.TRANSITIONING)
  23582. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23583. void (n && n({
  23584. success: !1,
  23585. error: "Cannot rotate while transitioning"
  23586. }));
  23587. Math.abs(r) < .01 && (r = 0),
  23588. Math.abs(o) < .01 && (o = 0);
  23589. var a = o;
  23590. o = N.call(this, o),
  23591. r = -r;
  23592. var s = a > 0 ? "UP" : "DOWN";
  23593. if (!r && a && !o)
  23594. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  23595. void (n && n({
  23596. success: !1,
  23597. error: "Already at maximum rotation in direction: " + s
  23598. }));
  23599. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  23600. var l = o;
  23601. o = c.Math.degToRad(o),
  23602. r = c.Math.degToRad(r),
  23603. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23604. this.player.getDirection(e),
  23605. t.copy(e).applyAxisAngle(I.UP, r),
  23606. t.applyAxisAngle(I.RIGHT, o);
  23607. var h = (e.angleTo(t),
  23608. r > 0 ? -1 : r < 0 ? 1 : 0)
  23609. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  23610. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  23611. var d = this.controls.activeControl
  23612. , p = function() {
  23613. d.stopRotating(!0),
  23614. n && n({
  23615. success: !0,
  23616. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  23617. })
  23618. };
  23619. d.startRotating(h, u),
  23620. P.start(r, o, this.player, p)
  23621. }
  23622. }
  23623. }(),
  23624. panCamera: function(e, t) {
  23625. function i(e) {
  23626. switch (r.removeAllListeners(T.AutoPanComplete),
  23627. r.removeAllListeners(T.AutoPanInterrupt),
  23628. r.removeAllListeners(T.AutoPanClamped),
  23629. e) {
  23630. case T.AutoPanInterrupt:
  23631. t({
  23632. success: !0,
  23633. message: "Camera panning interrupted."
  23634. });
  23635. break;
  23636. case T.AutoPanClamped:
  23637. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  23638. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  23639. return void t({
  23640. success: !1,
  23641. error: "Already at edge of current model bounds."
  23642. });
  23643. var i = "The view point is outside the bounds for the current model. ";
  23644. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  23645. console.warn(i)
  23646. }
  23647. case T.AutoPanComplete:
  23648. t({
  23649. success: !0,
  23650. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  23651. })
  23652. }
  23653. }
  23654. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  23655. return t({
  23656. success: !1,
  23657. error: "Camera panning is not available in the current mode: " + this.player.mode
  23658. });
  23659. var n = e.position
  23660. , r = this.player.control;
  23661. r.setAutoPanPosition(n.x, n.z),
  23662. r.autoPan = !0;
  23663. var o = function(e, t) {
  23664. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  23665. };
  23666. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  23667. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  23668. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  23669. },
  23670. click: function(e, t) {
  23671. var i = e.x
  23672. , n = e.y
  23673. , r = e.percentage;
  23674. r === !0 && (i = i / 100 * $('#player').width(),
  23675. n = n / 100 * $('#player').height()),
  23676. this.player.handleInputStart(i, n),
  23677. this.player.updateIntersect(),
  23678. this.player.handleInputEnd(i, n)
  23679. },
  23680. mouseOver: function(e, t) {
  23681. var i = e.x
  23682. , n = e.y
  23683. , r = e.percentage;
  23684. r === !0 && (i = i / 100 * $('#player').width(),
  23685. n = n / 100 * $('#player').height()),
  23686. this.player.handleInputMove(i, n),
  23687. this.player.updateIntersect()
  23688. },
  23689. moveToMode: function(e, t) {
  23690. function i(e) {
  23691. t(e ? {
  23692. success: !1,
  23693. error: "Failed to load new mode: " + e
  23694. } : {
  23695. success: !0,
  23696. message: "Moved to new mode: " + n
  23697. })
  23698. }
  23699. var n = e.mode;
  23700. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  23701. i()
  23702. }, function(e) {
  23703. i(e)
  23704. }) : t({
  23705. success: !1,
  23706. error: "Invalid mode selection"
  23707. })
  23708. }
  23709. }
  23710. }
  23711. ).call(this, "/js/sdk/automation.js")
  23712. }
  23713. , {
  23714. "../constants": 8,
  23715. "../enum/AlignmentType": 17,
  23716. "../enum/ControlEvents": 21,
  23717. "../enum/Direction": 22,
  23718. "../enum/GLCubeFaces": 25,
  23719. "../enum/Keys": 30,
  23720. "../enum/ModelManagerEvents": 33,
  23721. "../enum/PlayerEvents": 40,
  23722. "../enum/RenderLayers": 41,
  23723. "../enum/Vectors": 50,
  23724. "../enum/Viewmode": 51,
  23725. "../enum/WarpStyle": 52,
  23726. "../lib/jpeg_encoder": 94,
  23727. "../sdk/SdkEvents": 161,
  23728. "../settings": 166,
  23729. "../util/common": 185,
  23730. "../util/logger": 189,
  23731. "../util/math": 190,
  23732. "../util/panorama": 191,
  23733. "./ApiHost": 159,
  23734. "./PostMessageType": 160,
  23735. "./TransitionStyles": 162,
  23736. three: 217
  23737. }],
  23738. 165: [function(e, t, i) {//"./postmessage"
  23739. "use strict";
  23740. function n(e) {
  23741. this.sourceWindow = e,
  23742. this.targetWindow = null,
  23743. this.targetOrigin = null,
  23744. this.id = Math.floor(1e5 * Math.random()),
  23745. this.bindEvents()
  23746. }
  23747. var r = e("./PostMessageType")
  23748. , o = e("events").EventEmitter;
  23749. n.prototype = Object.create(o.prototype),
  23750. n.prototype.bindEvents = function() {
  23751. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  23752. }
  23753. ,
  23754. n.prototype.setTarget = function(e, t) {
  23755. this.targetWindow = e,
  23756. this.targetOrigin = t
  23757. }
  23758. ,
  23759. n.prototype.onPostmessageReceived = function(e) {
  23760. var t = e.origin || e.originalEvent.origin
  23761. , i = e.source;
  23762. switch (e.data.type) {
  23763. case r.CONNECT:
  23764. break;
  23765. case r.RESPONSE:
  23766. if (this.id !== e.data.toId)
  23767. return;
  23768. default:
  23769. if (!this.validateMessageOrigin(t))
  23770. return
  23771. }
  23772. var n = e.data;
  23773. n.source = i,
  23774. n.origin = t,
  23775. n.timestamp = Date.now(),
  23776. this.emit(e.data.type, n)
  23777. }
  23778. ,
  23779. n.prototype.validateMessageOrigin = function(e) {
  23780. return "*" === this.targetOrigin || e === this.targetOrigin
  23781. }
  23782. ,
  23783. n.prototype.send = function(e) {
  23784. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  23785. this.targetWindow.postMessage(e, this.targetOrigin))
  23786. }
  23787. ,
  23788. t.exports = n
  23789. }
  23790. , {
  23791. "./PostMessageType": 160,
  23792. events: 202
  23793. }],
  23794. 166: [function(e, t, i) {//"./settings"
  23795. "use strict";
  23796. var n = e("three")
  23797. , r = e("./util/browser")
  23798. , o = e("./enum/Viewmode")
  23799. , a = e("./enum/VROption")
  23800. , s = e("./enum/Colors")
  23801. , l = e("./enum/WarpStyle")
  23802. , c = e("./util/easing")
  23803. , h = e("./util/common")
  23804. , u = e("./util/showcase")
  23805. , d = e("./constants")
  23806. , p = {
  23807. debug: !,
  23808. version: "2.25.6-0-gd87e5b1",
  23809. languageTag: r.valueFromHash("lang", null),
  23810. pageTitle: "port 3D Showcase",
  23811. authorizationHeader: u.getAuthorizationHeader(),
  23812. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  23813. logLevel: r.valueFromHash("log", 2),
  23814. skyboxRadius: 2500,
  23815. modelBoundsPadding: 5,
  23816. showNeighbors: !1,
  23817. brand: r.valueFromHash("brand", !0),
  23818. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  23819. startHighlights: r.valueFromHash("hl", -1),
  23820. specialEdition: r.valueFromHash("bn", 0),
  23821. useWheel: r.valueFromHash("wh", !0),
  23822. crossOrigin: "anonymous",
  23823. fancierTransition: !1,
  23824. wireframe: !1,
  23825. skyboxWireframe: !1,
  23826. modelAlpha: 1,
  23827. highlightPanoSelection: !1,
  23828. showSweeps: !0,
  23829. showSkyboxes: !1,
  23830. showMesh: !0,
  23831. showFloors: !1,
  23832. showFloorDuration: 300,
  23833. showFloorDelay: 300,
  23834. hideFloorDuration: 300,
  23835. hideFloorDelay: 0,
  23836. reticuleOpacityTransitionTime: 250,
  23837. reticuleColor: s.newBlue,
  23838. markerOpacityTransitionTime: 500,
  23839. guiAnimationSpeed: 250,
  23840. highlightAnimationDuration: 500,
  23841. modelComponentLoadSpinnerDelay: 150,
  23842. captureErrors: !1,
  23843. maxMobileTextures: 6,
  23844. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  23845. startupFlyinDelay: 3e3,
  23846. dollhouseDefault: {
  23847. minDistance: 15,
  23848. maxDistance: 50,
  23849. minPolarAngle: n.Math.degToRad(10),
  23850. maxPolarAngle: n.Math.degToRad(90)
  23851. },
  23852. hideReticuleTimeout: 1e3,
  23853. analytics: {
  23854. inactivityThreshold: 30,
  23855. sessionTrackingRate: .15,
  23856. maxTrackedErrors: 20,
  23857. sessionDurationPingFrequency: 10,
  23858. sessionDurationTimeout: 15
  23859. },
  23860. flydown: {
  23861. movementEasing: "easeInOutQuad",
  23862. movementDelay: .001,
  23863. rotationEasing: "easeInOutQuad",
  23864. rotationDelay: .5,
  23865. modelTextureDelay: .75,
  23866. skyboxDelay: .75
  23867. },
  23868. transition: {
  23869. flySpeed: .01,
  23870. flyTime: 750,
  23871. flytimeMaxDistanceThreshold: 5,
  23872. flytimeDistanceMultiplier: 150,
  23873. aimTime: 1500,
  23874. aimSlowFactor: 1.5,
  23875. blur: .8,
  23876. movementEasing: "easeInOutQuad",
  23877. blendEasing: "easeInOutQuad",
  23878. fastForwardFactor: r.valueFromHash("mfis", 3)
  23879. },
  23880. show360Views: {
  23881. enabled: !0,
  23882. transitionTime: 1e3
  23883. },
  23884. quickstart: {
  23885. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  23886. animation: 1400,
  23887. showTextDelay: 500,
  23888. fadeOutDelay: 3e3,
  23889. fovChange: 10
  23890. },
  23891. appConfig: {
  23892. webvr_version: null,
  23893. segment_key: null,
  23894. embedly_key: null,
  23895. branch_key: null,
  23896. keen_write_key: null,
  23897. keen_project_id: null
  23898. },
  23899. vr: {
  23900. enabled: !0,
  23901. allowWebVR: !1,
  23902. option: r.valueFromHash("vr", a.CONTEXTUAL)
  23903. },
  23904. share: {
  23905. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  23906. },
  23907. input: {
  23908. longTapThreshold: 200,
  23909. moveToleranceNDC: .08,
  23910. touchMoveThreshold: 25
  23911. },
  23912. help: {
  23913. modalStayDuration: 600
  23914. },
  23915. immersive: {
  23916. timeToShowAgain: 1250,
  23917. uiStayDuration: 600
  23918. },
  23919. tourInteraction: {
  23920. disabled: "0" === r.valueFromHash("tourcta", null),
  23921. showPauseButton: 1e3,
  23922. showModal: 1500,
  23923. allowNextClick: 200,
  23924. largeModal: "1" === r.valueFromHash("tourcta", null),
  23925. smallModal: "2" === r.valueFromHash("tourcta", null)
  23926. },
  23927. labels: {
  23928. enabled: !1,
  23929. hideUntilStart: !0,
  23930. fadeInDuration: 250,
  23931. fadeInDelay: 250,
  23932. fadeOutDuration: 250,
  23933. fadeOutDelay: 0,
  23934. zoomHideThreshhold: {
  23935. mobile: r.isSmallScreen() ? .45 : .6,
  23936. desktop: 2
  23937. },
  23938. zoomTruncateThreshhold: {
  23939. mobile: r.isSmallScreen() ? .35 : .45,
  23940. desktop: .85
  23941. },
  23942. minLengthForTruncate: 16,
  23943. truncateLength: 12,
  23944. truncateSuffix: "..."
  23945. },
  23946. tags: {
  23947. enabled: r.valueFromHash("mt", 1),
  23948. startup: {
  23949. hideUntilStart: !0,
  23950. fadeInDuration: 500,
  23951. fadeInDelay: 100
  23952. },
  23953. visibility: {
  23954. anyDistance: !0,
  23955. visibleDistance: 8,
  23956. cameraClearance: .1,
  23957. alphaTestLevel: .05,
  23958. hideViaFloor: !0,
  23959. hideOffScreenDisc: !1,
  23960. hideOffScreenObject: !1
  23961. },
  23962. disc: {
  23963. opacity: 1,
  23964. disabledOpacity: .5,
  23965. scale: {
  23966. nearBound: 1.5,
  23967. farBound: 4.8,
  23968. linkFarBound: !1,
  23969. linkPercent: 40,
  23970. maxSize: 80,
  23971. minSize: 40,
  23972. baseViewportSize: 800,
  23973. responsiveness: 100
  23974. }
  23975. },
  23976. pole: {
  23977. enabled: !0,
  23978. height: .5,
  23979. width: 2,
  23980. opacity: .5,
  23981. color: "white"
  23982. },
  23983. navigate: {
  23984. nearestPano: !0,
  23985. lineOfSight: !0,
  23986. reactivate: !0,
  23987. aimAt: "disc",
  23988. tiltTolerance: 25,
  23989. rotateSpeedFactor: .6
  23990. }
  23991. },
  23992. path: {
  23993. color: s.newBlue,
  23994. colorUp: s._desat(s.newBlue, .5),
  23995. colorDown: s._darken(s.newBlue, .35),
  23996. opacity: .5,
  23997. style: "ribbon",
  23998. height: .025,
  23999. ribbonWidth: .24,
  24000. outsideHeight: .5,
  24001. waypointRadius: .5,
  24002. waypointIndoorRadius: .24,
  24003. waypointPulse: 1e3,
  24004. typ: l.BLACK,
  24005. meshFree: r.valueFromHash("mf", 1),
  24006. mapGuides: r.valueFromHash("guides", !0),
  24007. fadeInTime: 400,
  24008. fadeOutTime: 300
  24009. },
  24010. warp: {
  24011. nearPanoDist: .1,
  24012. matchCam: !1,
  24013. blur: .33,
  24014. fastTime: 1500,
  24015. teleportTime: 1500,
  24016. outsideTime: 2e3,
  24017. lookAheadMax: .3,
  24018. lookAheadDist: 2.5,
  24019. softPushDist: .37,
  24020. softPushEnd: .3,
  24021. softBendAngle: 8,
  24022. softBendTilt: 4,
  24023. softBendEnd: .3,
  24024. doBurns: r.valueFromHash("kb", !0),
  24025. burnsAngle: 35,
  24026. minBurnsAngle: 35,
  24027. minDownAngle: -35,
  24028. maxTurnPerSec: 280,
  24029. maxAimPerSec: 35,
  24030. minRotation: 12,
  24031. maxAimRotation: 33.2,
  24032. turnFriction: .2,
  24033. flySpeed: .01,
  24034. minWarpTime: 1200,
  24035. warpInterruptionRedirectTime: 500,
  24036. tourStepDelay: r.valueFromHash("st", 0),
  24037. walkDelay: 0,
  24038. walkMaxDist: 50,
  24039. walkMinDist: .8,
  24040. walkSlideShowThreshhold: 3e3,
  24041. walkExtraPanosDistance: .4,
  24042. timePerMeter: 800,
  24043. motionLeadTime: 500,
  24044. movementEasing: "easeInOutQuad",
  24045. blendEasing: "easeInOutQuad",
  24046. showBunny: !1,
  24047. loop: r.valueFromHash("lp", !1),
  24048. auto: r.valueFromHash("ts", -1),
  24049. eOrder: "YXZ",
  24050. stepFactor: .25,
  24051. brakeStrength: 2,
  24052. minBrakeAngle: .1,
  24053. maxBrakeAngle: 1.8,
  24054. climbEffort: 4
  24055. },
  24056. rotationFriction: .05,
  24057. rotationAccelerationInside: 4.5,
  24058. rotationAccelerationOutside: .15,
  24059. rotationAfterMoveMultiplier: 40,
  24060. rotationAfterMoveHistoryCount: 5,
  24061. panFriction: .09,
  24062. panAccelerationOutside: 60,
  24063. onload: r.valueFromHash("onload", o.PANORAMA),
  24064. zoomNearLimit: .1,
  24065. zoomFarLimit: 10,
  24066. navigation: {
  24067. panoScores: !1,
  24068. mouseDirection: !0,
  24069. filterStrictness: .75,
  24070. angleFactor: -30,
  24071. directionFactor: 10,
  24072. distanceFactor: -1,
  24073. optionalityFactor: 3
  24074. },
  24075. sdkInit: !1,
  24076. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24077. console: r.valueFromHash("console", !1),
  24078. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24079. panoramaNeighbourMaxDistance: 5,
  24080. panoFloorClickRadius: .35,
  24081. showScreenshotLocations: !1,
  24082. showAxis: !1,
  24083. showNeighbourRaycasts: !1,
  24084. colorMarkerOnLoad: !1,
  24085. colorMarkerByFloor: !1,
  24086. tiling: {
  24087. panoPreRenderRepeatDelay: 2500,
  24088. panoPreRenderDelay: 500,
  24089. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24090. tilingFlagNames: ["usetiles", "tiles"],
  24091. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24092. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24093. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24094. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24095. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24096. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24097. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24098. customCompression: r.valueFromHash("tilecustcomp", 0),
  24099. mobileHighQualityOverride: !1,
  24100. allowUltraHighResolution: !1
  24101. },
  24102. zoom: {
  24103. enabled: !1,
  24104. forceOff: r.valueFromHash("nozoom", 0),
  24105. overridemax: r.valueFromHash("maxzoom", null),
  24106. overridemin: r.valueFromHash("minzoom", null),
  24107. max: d.highQualityMaxZoom,
  24108. min: 1,
  24109. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24110. activationThreshold: 1.1,
  24111. restoreTime: 500
  24112. },
  24113. profiling: {
  24114. enabled: r.valueFromHash("mem", !1)
  24115. }
  24116. };
  24117. p = h.deepExtend(p, d, {
  24118. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24119. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24120. panorama: {
  24121. transitionTime: 1e3,
  24122. modelAlpha: 0,
  24123. modelAlphaDelay: p.flydown.modelTextureDelay,
  24124. modelAlphaLength: 1,
  24125. skyboxOpacity: 1,
  24126. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24127. skyboxOpacityLength: .9,
  24128. fovLength: 1,
  24129. fovDelay: 0,
  24130. cameraMatrixDuration: .8,
  24131. cameraMatrixDelay: 0,
  24132. cameraMatrixEase: c.easeInCubic,
  24133. reticuleOpacity: 1,
  24134. markerOpacity: .3,
  24135. markerOpacityOnHover: 1
  24136. },
  24137. dollhouse: {
  24138. transitionTime: 1e3,
  24139. modelAlpha: 1,
  24140. modelAlphaDelay: 0,
  24141. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24142. skyboxOpacity: 0,
  24143. skyboxOpacityDelay: 0,
  24144. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24145. fovLength: 1,
  24146. fovDelay: 0,
  24147. cameraMatrixDuration: .8,
  24148. cameraMatrixDelay: .3,
  24149. cameraMatrixEase: c.easeInCubic,
  24150. reticuleOpacity: 1,
  24151. markerOpacity: 0,
  24152. markerOpacityOnHover: 0
  24153. },
  24154. floorplan: {
  24155. transitionTime: 1e3,
  24156. modelAlpha: 1,
  24157. modelAlphaDelay: 0,
  24158. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24159. skyboxOpacity: 0,
  24160. skyboxOpacityDelay: 0,
  24161. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24162. fovLength: 1,
  24163. fovDelay: 0,
  24164. cameraMatrixDuration: .5,
  24165. cameraMatrixDelay: 0,
  24166. cameraMatrixEase: c.easeOutCubic,
  24167. reticuleOpacity: 1,
  24168. markerOpacity: 0,
  24169. markerOpacityOnHover: 0,
  24170. cameraHeight: 50
  24171. },
  24172. transitioning: {
  24173. reticuleOpacity: 0,
  24174. markerOpacity: .3,
  24175. markerOpacityOnHover: 1
  24176. },
  24177. "floorplan-dollhouse": {
  24178. rotationDelay: 0,
  24179. rotationDuration: 1
  24180. },
  24181. "floorplan-panorama": {
  24182. rotationDelay: .5,
  24183. rotationDuration: 1
  24184. },
  24185. "dollhouse-panorama": {
  24186. rotationDelay: .5,
  24187. rotationDuration: 1
  24188. },
  24189. "dollhouse-floorplan": {
  24190. rotationDelay: 0,
  24191. rotationDuration: 1,
  24192. cameraMatrixDuration: 1.05,
  24193. cameraMatrixDelay: .5
  24194. },
  24195. "panorama-dollhouse": {
  24196. rotationDelay: 0,
  24197. rotationDuration: .5
  24198. },
  24199. "panorama-floorplan": {
  24200. transitionTime: 1500,
  24201. rotationDelay: 0,
  24202. rotationDuration: .5
  24203. }
  24204. }),
  24205. p.path.meshFree && (p.path.typ = l.WALK),
  24206. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24207. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24208. t.exports = p
  24209. }
  24210. , {
  24211. "./constants": 8,
  24212. "./enum/Colors": 19,
  24213. "./enum/VROption": 47,
  24214. "./enum/Viewmode": 51,
  24215. "./enum/WarpStyle": 52,
  24216. "./util/browser": 182,
  24217. "./util/common": 185,
  24218. "./util/easing": 186,
  24219. "./util/showcase": 193,
  24220. three: 217
  24221. }],
  24222. 167: [function(e, t, i) {//"../shaders"
  24223. "use strict";
  24224. var n = e("three")
  24225. , r = e("./settings")
  24226. , 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"
  24227. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24228. t.exports = {
  24229. basicTextured: {
  24230. uniforms: {
  24231. tDiffuse: {
  24232. type: "t",
  24233. value: null
  24234. },
  24235. alpha: {
  24236. type: "f",
  24237. value: 1
  24238. }
  24239. },
  24240. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24241. 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}"
  24242. },
  24243. copyCubeMap: {
  24244. uniforms: {
  24245. tDiffuse: {
  24246. type: "t",
  24247. value: null
  24248. },
  24249. alpha: {
  24250. type: "f",
  24251. value: 1
  24252. }
  24253. },
  24254. 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}",
  24255. 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}"
  24256. },
  24257. cube: {
  24258. uniforms: {
  24259. map: {
  24260. type: "t",
  24261. value: null
  24262. },
  24263. opacity: {
  24264. type: "f",
  24265. value: 1
  24266. }
  24267. },
  24268. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24269. 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"
  24270. },
  24271. model: {
  24272. uniforms: {
  24273. map: {
  24274. type: "t",
  24275. value: null
  24276. },
  24277. modelAlpha: {
  24278. type: "f",
  24279. value: r.modelAlpha
  24280. },
  24281. opacity: {
  24282. type: "f",
  24283. value: 1
  24284. },
  24285. progress: {
  24286. type: "f",
  24287. value: 0
  24288. },
  24289. blackout: {
  24290. type: "i",
  24291. value: 0
  24292. },
  24293. pano0Map: {
  24294. type: "t",
  24295. value: null
  24296. },
  24297. pano0Position: {
  24298. type: "v3",
  24299. value: new n.Vector3
  24300. },
  24301. pano0Matrix: {
  24302. type: "m4",
  24303. value: new n.Matrix4
  24304. },
  24305. pano1Map: {
  24306. type: "t",
  24307. value: null
  24308. },
  24309. pano1Position: {
  24310. type: "v3",
  24311. value: new n.Vector3
  24312. },
  24313. pano1Matrix: {
  24314. type: "m4",
  24315. value: new n.Matrix4
  24316. }
  24317. },
  24318. 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",
  24319. 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"
  24320. },
  24321. floorLogo: {//改
  24322. uniforms: {
  24323. map: {
  24324. type: "t",
  24325. value: null
  24326. },
  24327. opacity:{
  24328. type:"f",
  24329. value: 0
  24330. },
  24331. opaRadius:{//百分比
  24332. type:"f",
  24333. value: 0.2
  24334. }
  24335. },
  24336. vertexShader: "varying vec2 vUv;void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );}",
  24337. fragmentShader: "uniform sampler2D map; uniform float opacity;uniform float opaRadius;varying vec2 vUv; void main() { vec2 vUv2 = vec2(vUv.x*2.0 - 1.0, vUv.y*2.0 - 1.0); vec4 colorFromTexture = texture2D( map, vUv ); float opa = 1.0; float r = vUv2.x*vUv2.x + vUv2.y*vUv2.y; if(r > 1.0) opa = 0.0; else if(r < opaRadius)opa = 1.0; else{ float a = -1.0 / ((opaRadius - 1.0)*(opaRadius - 1.0)); float b = -2.0 * a * opaRadius; float c = 1.0 + a * opaRadius * opaRadius; opa = a * r*r + b * r + c; } gl_FragColor = vec4(colorFromTexture.rgb, opacity * min(colorFromTexture.a, opa) );}"
  24338. },
  24339. modelOutside: {
  24340. uniforms: {
  24341. map: {
  24342. type: "t",
  24343. value: null
  24344. },
  24345. opacity: {
  24346. type: "f",
  24347. value: 1
  24348. }
  24349. },
  24350. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24351. 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"
  24352. },
  24353. ribbon: {
  24354. uniforms: {
  24355. map: {
  24356. type: "t",
  24357. value: null
  24358. },
  24359. opacity: {
  24360. type: "f",
  24361. value: 1
  24362. },
  24363. color: {
  24364. type: "c",
  24365. value: new n.Color(r.path.color)
  24366. }
  24367. },
  24368. 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",
  24369. 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"
  24370. },
  24371. waypoint: {
  24372. uniforms: {
  24373. map: {
  24374. type: "t",
  24375. value: null
  24376. },
  24377. opacity: {
  24378. type: "f",
  24379. value: 1
  24380. },
  24381. pulse: {
  24382. type: "f",
  24383. value: 1
  24384. },
  24385. nearFade: {
  24386. type: "v2",
  24387. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24388. },
  24389. color: {
  24390. type: "c",
  24391. value: new n.Color(r.reticuleColor)
  24392. }
  24393. },
  24394. 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",
  24395. 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"
  24396. },
  24397. modelDebug: {
  24398. uniforms: {
  24399. map: {
  24400. type: "t",
  24401. value: null
  24402. },
  24403. modelAlpha: {
  24404. type: "f",
  24405. value: r.modelAlpha
  24406. },
  24407. depthmapRatio: {
  24408. type: "f",
  24409. value: 0
  24410. },
  24411. opacity: {
  24412. type: "f",
  24413. value: 1
  24414. },
  24415. progress: {
  24416. type: "f",
  24417. value: 0
  24418. },
  24419. considerOcclusion: {
  24420. type: "i",
  24421. value: r.fancierTransition
  24422. },
  24423. highlightPanoSelection: {
  24424. type: "i",
  24425. value: 0
  24426. },
  24427. useThirdPano: {
  24428. type: "i",
  24429. value: r.useThirdPano
  24430. },
  24431. pano0Map: {
  24432. type: "t",
  24433. value: null
  24434. },
  24435. pano0Depth: {
  24436. type: "t",
  24437. value: null
  24438. },
  24439. pano0Position: {
  24440. type: "v3",
  24441. value: new n.Vector3
  24442. },
  24443. pano0Matrix: {
  24444. type: "m4",
  24445. value: new n.Matrix4
  24446. },
  24447. pano0Weight: {
  24448. type: "f",
  24449. value: r.transition.pano0Weight
  24450. },
  24451. pano1Map: {
  24452. type: "t",
  24453. value: null
  24454. },
  24455. pano1Depth: {
  24456. type: "t",
  24457. value: null
  24458. },
  24459. pano1Position: {
  24460. type: "v3",
  24461. value: new n.Vector3
  24462. },
  24463. pano1Matrix: {
  24464. type: "m4",
  24465. value: new n.Matrix4
  24466. },
  24467. pano1Weight: {
  24468. type: "f",
  24469. value: r.transition.pano1Weight
  24470. },
  24471. pano2Map: {
  24472. type: "t",
  24473. value: null
  24474. },
  24475. pano2Depth: {
  24476. type: "t",
  24477. value: null
  24478. },
  24479. pano2Position: {
  24480. type: "v3",
  24481. value: new n.Vector3
  24482. },
  24483. pano2Matrix: {
  24484. type: "m4",
  24485. value: new n.Matrix4
  24486. },
  24487. pano2Weight: {
  24488. type: "f",
  24489. value: r.transition.pano2Weight
  24490. }
  24491. },
  24492. 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",
  24493. 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"
  24494. },
  24495. customDepth: {
  24496. uniforms: {
  24497. panoPosition: {
  24498. type: "v3",
  24499. value: new n.Vector3
  24500. }
  24501. },
  24502. 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",
  24503. 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"
  24504. },
  24505. skysphere: {
  24506. uniforms: {
  24507. radius: {
  24508. type: "f",
  24509. value: 0
  24510. }
  24511. },
  24512. 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",
  24513. 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"
  24514. },
  24515. tagDisc: {
  24516. uniforms: {
  24517. opacity: {
  24518. type: "f",
  24519. value: 1
  24520. },
  24521. color: {
  24522. type: "c",
  24523. value: new n.Color
  24524. },
  24525. bg: {
  24526. type: "t",
  24527. value: null
  24528. },
  24529. mask: {
  24530. type: "t",
  24531. value: null
  24532. }
  24533. },
  24534. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24535. 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"
  24536. }
  24537. }
  24538. }
  24539. , {
  24540. "./settings": 166,
  24541. three: 217
  24542. }],
  24543. 168: [function(e, t, i) {///js/showcase.js
  24544. (function(i) {
  24545. "use strict";
  24546. var n = e("three")
  24547. , r = (e("url"),
  24548. e("./util/ajax"))
  24549. , o = e("./settings")
  24550. , a = e("./util/logger")
  24551. , s = e("./util/math")
  24552. , l = e("./util/showcase")
  24553. , c = e("./objects/Panorama")
  24554. , h = new a(i)
  24555. , u = e("./model/Model")
  24556. , d = e("./shaders")
  24557. , p = e("./util/transitions")
  24558. , f = e("./objects/Chunk")
  24559. , g = e("./objects/Reticule")
  24560. , m = e("./objects/Skybox")
  24561. , v = e("./objects/Floor")
  24562. , A = e("./cameras/DollhouseCamera")
  24563. , y = e("./cameras/FloorplanCamera")
  24564. , C = e("./cameras/PanoramaCamera")
  24565. , I = e("./controls/DollhouseControls")
  24566. , E = e("./controls/FloorplanControls")
  24567. , b = e("./controls/PanoramaControls");
  24568. n.ImageUtils.crossOrigin = o.crossOrigin,
  24569. t.exports = {
  24570. shaders: d,
  24571. transitions: p,
  24572. Model: u,
  24573. Chunk: f,
  24574. Floor: v,
  24575. Skybox: m,
  24576. Reticule: g,
  24577. Panorama: c,
  24578. DollhouseCamera: A,
  24579. FloorplanCamera: y,
  24580. PanoramaCamera: C,
  24581. DollhouseControls: I,
  24582. FloorplanControls: E,
  24583. PanoramaControls: b,
  24584. getModel: function(e) {
  24585. if (!e.url)
  24586. throw 'getModel(): missing parameter "url"';
  24587. e.autoload = void 0 === e.autoload || e.autoload;
  24588. var t = l.parseSidUrl(e.url);
  24589. e.urlBase = t.urlBase,
  24590. e.urlModel = t.urlModel,
  24591. e.urlFiles = t.urlFiles;
  24592. var i = this._getPlatformError();
  24593. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24594. this._loadModel().then(this._buildModel.bind(this)))
  24595. },
  24596. _getPlatformError: function() {
  24597. 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"
  24598. },
  24599. _loadModel: function() {
  24600. return r.get(this.options.urlModel, {
  24601. responseType: "json",
  24602. prefetchFrom: "model",
  24603. auth: l.getAuthorizationHeader()
  24604. }).then(null, function() {
  24605. return h.warn("Model loading failed at initial metadata load"),
  24606. "loading-failed"
  24607. })
  24608. },
  24609. _buildModel: function(e) {
  24610. e = l.normalizeModeldata(e, s);
  24611. var t = new u(this.options,e);
  24612. return this.options.autoload ? t.load(!0) : $.when(t)
  24613. }
  24614. }
  24615. }
  24616. ).call(this, "/js/showcase.js")
  24617. }
  24618. , {
  24619. "./cameras/DollhouseCamera": 5,
  24620. "./cameras/FloorplanCamera": 6,
  24621. "./cameras/PanoramaCamera": 7,
  24622. "./controls/DollhouseControls": 10,
  24623. "./controls/FloorplanControls": 11,
  24624. "./controls/PanoramaControls": 13,
  24625. "./model/Model": 139,
  24626. "./objects/Chunk": 144,
  24627. "./objects/Floor": 146,
  24628. "./objects/Panorama": 148,
  24629. "./objects/Reticule": 149,
  24630. "./objects/Skybox": 152,
  24631. "./settings": 166,
  24632. "./shaders": 167,
  24633. "./util/ajax": 181,
  24634. "./util/logger": 189,
  24635. "./util/math": 190,
  24636. "./util/showcase": 193,
  24637. "./util/transitions": 195,
  24638. three: 217,
  24639. url: 208
  24640. }],
  24641. 169: [function(e, t, i) {//./tile/PanoRenderer
  24642. "use strict";
  24643. function n() {
  24644. var e = {
  24645. renderTarget: null,
  24646. inUse: !1,
  24647. size: -1,
  24648. pano: null
  24649. };
  24650. return e
  24651. }
  24652. function r(e) {
  24653. M.push(e)
  24654. }
  24655. function o(e) {
  24656. var t = n();
  24657. return t.inUse = !0,
  24658. t.size = e,
  24659. r(t),
  24660. t
  24661. }
  24662. function a(e) {
  24663. for (var t = 0; t < M.length; t++) {
  24664. var i = M[t];
  24665. if (!i.inUse && i.size === e)
  24666. return i.inUse = !0,
  24667. i
  24668. }
  24669. return null
  24670. }
  24671. function s(e) {
  24672. for (var t = 0; t < M.length; t++) {
  24673. var i = M[t];
  24674. if (i.renderTarget === e)
  24675. return i.inUse = !1,
  24676. !0
  24677. }
  24678. return !1
  24679. }
  24680. function l() {
  24681. this.tileDirectory = {},
  24682. this.activeRenderTargetDescriptors = {},
  24683. this.activePanos = [],
  24684. this.panoLODDescriptors = {},
  24685. this.panoDescriptors = {},
  24686. this.tileTrees = {},
  24687. this.sceneRenderer = null,
  24688. this.tileDownloader = null,
  24689. this.forceQueue = [],
  24690. this.uploadQueues = {},
  24691. this.uploadInterval = null,
  24692. this.uploadIntervalCancelled = !1,
  24693. this.usingTileOverlay = !1,
  24694. this.overlayTilesLoaded = !1,
  24695. this.overlayTileBase = null,
  24696. this.overlayTilesBasic = {},
  24697. this.overlayTilesEnhanced = {},
  24698. this.zoomRenderTarget = null,
  24699. this.zoomPano = null,
  24700. this.zoomingActive = !1,
  24701. this.zoomPanoId = null,
  24702. this.zoomPanoRenderingDisabled = !1,
  24703. this.direction = new h.Vector3,
  24704. this.initTime = -1,
  24705. this.maxBaseUploadsPerFrame = x,
  24706. this.maxNonBaseUploadsPerFrame = T
  24707. }
  24708. function c() {
  24709. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  24710. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  24711. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  24712. }
  24713. var h = e("three")
  24714. , u = e("../exception/BasicException")
  24715. , d = e("../settings")
  24716. , p = e("../enum/PanoSizeClass")
  24717. , f = (e("../objects/Panorama"),
  24718. e("../enum/PanoRendererEvents"))
  24719. , g = e("../enum/SceneRendererEvents")
  24720. , m = e("../enum/TileDownloaderEvents")
  24721. , v = e("../enum/Vectors")
  24722. , A = (e("../enum/GLCubeFaces"),
  24723. e("../objects/Panorama"),
  24724. e("./TileTree"))
  24725. , y = (e("./TileDownloader"),
  24726. e("./TilePrioritizer"))
  24727. , C = e("./TileUtils")
  24728. , p = e("../enum/PanoSizeClass")
  24729. , I = (e("../util/browser"),
  24730. e("../util/panorama"))
  24731. , E = e("events").EventEmitter
  24732. , b = !1
  24733. , w = d.tiling.uploadIntervalDelay
  24734. , _ = d.tiling.initialIntervalDelay
  24735. , T = d.tiling.maxNonBaseUploadsPerFrame
  24736. , x = d.tiling.maxBaseUploadsPerFrame
  24737. , S = {
  24738. Base: 0,
  24739. Remaining: 1
  24740. }
  24741. , M = [];
  24742. l.prototype = Object.create(E.prototype),
  24743. l.prototype.init = function(e, t, i) {
  24744. this.sceneRenderer = e,
  24745. this.tileDownloader = t,
  24746. this.qualityManager = i,
  24747. this.bindEvents(),
  24748. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  24749. this.initTime = performance.now()
  24750. }
  24751. ,
  24752. l.prototype.getActivePanoTextures = function(e) {
  24753. e = e || [];
  24754. for (var t = 0; t < M.length; t++) {
  24755. var i = M[t];
  24756. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  24757. }
  24758. }
  24759. ,
  24760. l.prototype.hasQueuedTiles = function() {
  24761. var e = this.peekNextFromUploadQueue();
  24762. return null !== e && void 0 !== e
  24763. }
  24764. ,
  24765. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  24766. return this.activeRenderTargetDescriptors[e]
  24767. }
  24768. ,
  24769. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  24770. this.activeRenderTargetDescriptors[e] = t
  24771. }
  24772. ,
  24773. l.prototype.loadOverlayTiles = function() {
  24774. if (0 !== d.tiling.overlayStyle) {
  24775. var e = 0
  24776. , t = function(t, n, r) {
  24777. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  24778. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  24779. e++,
  24780. e === i.length && (this.overlayTilesLoaded = !0)
  24781. }
  24782. .bind(this)
  24783. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  24784. i.forEach(function(e) {
  24785. this.tileDownloader.loadImage(e[0], 0, e[1])
  24786. }
  24787. .bind(this)),
  24788. this.usingTileOverlay = !0
  24789. } else
  24790. this.usingTileOverlay = !1
  24791. }
  24792. ,
  24793. l.prototype.bindEvents = function() {
  24794. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  24795. }
  24796. ,
  24797. l.prototype.setupZoomRenderTarget = function() {
  24798. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  24799. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  24800. return;
  24801. var e = this.zoomRenderTarget;
  24802. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  24803. e) {
  24804. var t = e.width
  24805. , i = this.zoomRenderTarget.width;
  24806. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  24807. e.texture.dispose(),
  24808. e.texture.loaded = !1,
  24809. e.texture.version = 0,
  24810. this.sceneRenderer.deallocateCubeTexture(e.texture),
  24811. e.texture = null
  24812. }
  24813. this.zoomPanoRenderingDisabled = !1
  24814. } else
  24815. this.zoomPanoRenderingDisabled = !0
  24816. }
  24817. ,
  24818. l.prototype.enableUltraHighQualityMode = function(e) {
  24819. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  24820. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  24821. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  24822. t && (this.qualityManager.enableUltraHighQualityMode(),
  24823. this.setupZoomRenderTarget(),
  24824. e())
  24825. }
  24826. .bind(this))
  24827. }
  24828. }
  24829. ,
  24830. l.prototype.activateTiledPano = function(e, t, i) {
  24831. i && this.clearAllQueuedUploads();
  24832. for (var n = 0; n < C.FACES_PER_PANO; n++)
  24833. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  24834. this.linkAllTilesAndNodes(e);
  24835. var r = this.getActiveRenderTargetDescriptor(e.id)
  24836. , l = t;
  24837. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  24838. !r || l !== r.size) {
  24839. if (r && s(r.renderTarget),
  24840. r = a(l),
  24841. !r) {
  24842. var c = this.initTiledPano(l, !1);
  24843. r = o(c.width),
  24844. r.renderTarget = c
  24845. }
  24846. r.pano = e,
  24847. this.resetPanoDescriptor(e.id),
  24848. this.resetPanoLODDescriptors(e.id),
  24849. this.resetRenderStatus(e.id, !0, !0)
  24850. }
  24851. this.setActiveRenderTargetDescriptor(e.id, r);
  24852. var h = i ? 0 : 1;
  24853. return this.updateActivePanos(e, h),
  24854. r.renderTarget
  24855. }
  24856. ,
  24857. l.prototype.deactivateTiledPano = function(e) {
  24858. var t = this.getActiveRenderTargetDescriptor(e.id);
  24859. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  24860. this.setActiveRenderTargetDescriptor(e.id, null);
  24861. var i = this.getUploadQueueForPano(e.id);
  24862. this.clearUploadQueue(i),
  24863. this.updateActivePanos()
  24864. }
  24865. ,
  24866. l.prototype.updateActivePanos = function() {
  24867. var e = [];
  24868. return function(t, i) {
  24869. e.length = 0;
  24870. for (var n = 0; n < this.activePanos.length; n++) {
  24871. t && e.length === i && e.push(t);
  24872. var r = this.activePanos[n]
  24873. , o = this.getActiveRenderTargetDescriptor(r.id);
  24874. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  24875. }
  24876. t && i >= e.length && e.push(t),
  24877. this.activePanos.length = 0,
  24878. this.activePanos.push.apply(this.activePanos, e)
  24879. }
  24880. }(),
  24881. l.prototype.getActivePanoCount = function() {
  24882. return this.activePanos.length
  24883. }
  24884. ,
  24885. l.prototype.resetRenderStatus = function(e, t, i, n) {
  24886. var r = null;
  24887. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  24888. for (var o = function(e, n, r, o) {
  24889. i && (n.tile.zoomUploaded = !1),
  24890. t && (n.tile.uploaded = !1)
  24891. }, a = 0; a < C.FACES_PER_PANO; a++) {
  24892. var s = this.getTileTree(e, a);
  24893. s.breadthFirst({
  24894. callback: o.bind(this, a),
  24895. minLevel: r
  24896. })
  24897. }
  24898. }
  24899. ,
  24900. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  24901. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  24902. t.tile.zoomUploaded = t.tile.uploaded,
  24903. t.zoomCovered = t.covered
  24904. }, n = 0; n < C.FACES_PER_PANO; n++) {
  24905. var r = this.getTileTree(e, n);
  24906. r.breadthFirst({
  24907. callback: i.bind(this, n),
  24908. maxLevel: t
  24909. })
  24910. }
  24911. }
  24912. ,
  24913. l.prototype.renderPanoTiles = function() {
  24914. var e = [];
  24915. return function(t, i, n, r) {
  24916. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  24917. i = i || this.direction || v.FORWARD;
  24918. var o = this.getActiveRenderTargetDescriptor(t);
  24919. if (!this.isRenderTargetDescriptorValid(o))
  24920. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  24921. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  24922. var s = this.getTileTree(t, a);
  24923. e.length = 0,
  24924. s.breadthFirst({
  24925. saveVisited: e
  24926. });
  24927. for (var l = 0; l < e.length; l++) {
  24928. var c = e[l];
  24929. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  24930. }
  24931. }
  24932. this.updateDirection(i)
  24933. }
  24934. }(),
  24935. l.prototype.isRenderTargetDescriptorValid = function(e) {
  24936. return e && e.renderTarget
  24937. }
  24938. ,
  24939. l.prototype.isPanoActive = function(e) {
  24940. var t = this.getActiveRenderTargetDescriptor(e);
  24941. return this.isRenderTargetDescriptorValid(t)
  24942. }
  24943. ,
  24944. l.prototype.isPanoZoomed = function(e) {
  24945. return this.zoomingActive && this.zoomPanoId === e
  24946. }
  24947. ,
  24948. l.prototype.initTileTree = function(e, t, i) {
  24949. var n = this.tileTrees[e];
  24950. n || (n = [],
  24951. this.tileTrees[e] = n);
  24952. var r = n[t];
  24953. if (!r) {
  24954. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  24955. r = new A(C.TILE_SIZE,o),
  24956. n[t] = r
  24957. }
  24958. }
  24959. ,
  24960. l.prototype.getTileTree = function(e, t) {
  24961. var i = this.tileTrees[e];
  24962. if (!i)
  24963. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  24964. var n = i[t];
  24965. if (!n)
  24966. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  24967. return n
  24968. }
  24969. ,
  24970. l.prototype.initTiledPano = function(e, t) {
  24971. var i = this.sceneRenderer.renderer
  24972. , n = (i.context,
  24973. new h.WebGLRenderTargetCube(e,e,{
  24974. stencilBuffer: !1
  24975. }))
  24976. , r = new h.CubeTexture([]);
  24977. n.texture = r,
  24978. r.image = [null, null, null, null, null, null],
  24979. r.flipY = !0,
  24980. t ? (r.generateMipmaps = !0,
  24981. r.magFilter = h.LinearFilter,
  24982. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  24983. r.magFilter = h.LinearFilter,
  24984. r.minFilter = h.LinearFilter),
  24985. r.format = h.RGBAFormat,
  24986. i.setRenderTarget(n),
  24987. i.setRenderTarget(null);
  24988. var o = i.properties.get(r);
  24989. return o.__image__webglTextureCube = o.__webglTexture,
  24990. n
  24991. }
  24992. ,
  24993. l.prototype.getUploadQueueForPano = function(e) {
  24994. var t = this.uploadQueues[e];
  24995. return t || (t = [],
  24996. this.uploadQueues[e] = t),
  24997. t
  24998. }
  24999. ,
  25000. l.prototype.isTileUploaded = function(e) {
  25001. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25002. }
  25003. ,
  25004. l.prototype.setUploaded = function(e, t) {
  25005. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25006. }
  25007. ,
  25008. l.prototype.queueTileUpload = function(e, t, i) {
  25009. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25010. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25011. var r = this.getUploadQueueForPano(e.panoId);
  25012. 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),
  25013. e.uploadQueued = !0,
  25014. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25015. }
  25016. }
  25017. ,
  25018. l.prototype.shoulPushToFrontOfQueue = function(e) {
  25019. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25020. }
  25021. ,
  25022. l.prototype.getTopUploadQueue = function() {
  25023. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  25024. for (var n = 0; n < this.activePanos.length; n++)
  25025. if (e = this.activePanos[n],
  25026. t = this.getUploadQueueForPano(e.id),
  25027. t.length > 0)
  25028. switch (i) {
  25029. case S.Base:
  25030. if (0 === t[0].level)
  25031. return t;
  25032. break;
  25033. case S.Remaining:
  25034. return t
  25035. }
  25036. return null
  25037. }
  25038. ,
  25039. l.prototype.getNextFromUploadQueue = function() {
  25040. var e = function(e) {
  25041. var t = e.shift();
  25042. return t.uploadQueued = !1,
  25043. t
  25044. };
  25045. return function() {
  25046. if (this.forceQueue.length > 0)
  25047. return e(this.forceQueue);
  25048. var t = this.getTopUploadQueue();
  25049. return t && t.length > 0 ? e(t) : null
  25050. }
  25051. }(),
  25052. l.prototype.peekNextFromUploadQueue = function() {
  25053. if (this.forceQueue.length > 0)
  25054. return this.forceQueue[0];
  25055. var e = this.getTopUploadQueue();
  25056. return e && e.length > 0 ? e[0] : null
  25057. }
  25058. ,
  25059. l.prototype.clearAllQueuedUploads = function() {
  25060. this.clearAllUploadQueues(null, 0)
  25061. }
  25062. ,
  25063. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  25064. this.clearAllUploadQueues(e, 0)
  25065. }
  25066. ,
  25067. l.prototype.clearAllUploadQueues = function(e, t) {
  25068. if (e)
  25069. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25070. this.clearUploadQueue(this.forceQueue, t, e);
  25071. else {
  25072. for (var i = 0; i < this.activePanos.length; i++) {
  25073. var n = this.activePanos[i];
  25074. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25075. }
  25076. this.clearUploadQueue(this.forceQueue, t)
  25077. }
  25078. }
  25079. ,
  25080. l.prototype.clearUploadQueue = function(e, t, i) {
  25081. void 0 !== t && null !== t || (t = 0);
  25082. for (var n = 0; n < e.length; ) {
  25083. var r = e[n];
  25084. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25085. e.splice(n, 1)) : n++
  25086. }
  25087. }
  25088. ,
  25089. l.prototype.refreshUploadInterval = function() {
  25090. var e = null;
  25091. return function(t) {
  25092. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  25093. null !== t && void 0 !== t || (t = w),
  25094. b || (t = _),
  25095. this.uploadInterval = window.setTimeout(e, t),
  25096. this.uploadIntervalDelay = t)
  25097. }
  25098. }(),
  25099. l.prototype.update = function() {
  25100. var e = performance.now()
  25101. , t = 0;
  25102. return function() {
  25103. this.uploadIntervalCancelled = !0,
  25104. window.clearTimeout(this.uploadInterval),
  25105. this.uploadInterval = null;
  25106. var i = performance.now() - e;
  25107. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25108. e = performance.now()),
  25109. t++
  25110. }
  25111. }(),
  25112. l.prototype.updateUploadQueue = function(e, t) {
  25113. e || (e = 1);
  25114. for (var i = 0, n = 0; ; ) {
  25115. if (n >= t || i >= e)
  25116. break;
  25117. var r = this.getNextFromUploadQueue();
  25118. if (!r)
  25119. break;
  25120. if (0 !== r.level ? i++ : n++,
  25121. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25122. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25123. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25124. }
  25125. }
  25126. }
  25127. ,
  25128. l.prototype.updateDirection = function(e) {
  25129. if (e = e || this.direction) {
  25130. this.direction = e;
  25131. for (var t = 0; t < this.activePanos.length; t++) {
  25132. var i = this.activePanos[t]
  25133. , n = this.getUploadQueueForPano(i.id);
  25134. y.sortPanoTiles(n, i, this.direction)
  25135. }
  25136. }
  25137. }
  25138. ,
  25139. l.prototype.uploadTile = function() {
  25140. var e = {}
  25141. , t = (new h.Vector4,
  25142. d.tiling.overlayStyle);
  25143. return function(i, n) {
  25144. var r = i.panoId
  25145. , o = i.image
  25146. , a = i.tileSize
  25147. , s = i.panoSize
  25148. , l = i.tileIndex
  25149. , c = (i.faceTileIndex,
  25150. i.totalTiles)
  25151. , u = (i.face,
  25152. i.tileX)
  25153. , d = i.tileY
  25154. , p = !0
  25155. , g = !1
  25156. , m = (this.getPanoDescriptor(r),
  25157. this.getPanoLODDescriptor(r, s))
  25158. , v = this.getActiveRenderTargetDescriptor(r)
  25159. , A = v.renderTarget
  25160. , y = v.size;
  25161. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  25162. y = this.qualityManager.getMaxZoomPanoSize()),
  25163. this.isRenderTargetDescriptorValid(v) || (p = !1,
  25164. g = !1),
  25165. n || (this.anyUploaded(i.node) && (p = !1,
  25166. g = !0),
  25167. this.isTileUploaded(i) && (p = !1,
  25168. g = !1)),
  25169. p) {
  25170. var C = u * a
  25171. , I = d * a
  25172. , E = a / s * y
  25173. , b = C / s * y
  25174. , w = I / s * y;
  25175. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  25176. var _ = e[a];
  25177. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  25178. 1 === t || 2 === t) {
  25179. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25180. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  25181. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  25182. } else
  25183. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  25184. m.uploadCount++,
  25185. this.emit(f.TileRenderSuccess, r, s, l, c),
  25186. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  25187. this.setUploaded(i, !0),
  25188. this.addCoverageForNode(i.node)
  25189. } else
  25190. this.setUploaded(i, !1);
  25191. return i.uploadAttempted || (m.uploadAttempts++,
  25192. this.emit(f.TileUploadAttempted, r, s, l, c)),
  25193. i.uploadAttempted = !0,
  25194. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  25195. g
  25196. }
  25197. }(),
  25198. l.prototype.linkTileAndNode = function(e, t) {
  25199. t.tile = e,
  25200. e.node = t
  25201. }
  25202. ,
  25203. l.prototype.linkAllTilesAndNodes = function(e) {
  25204. for (var t = function(t, i, n, r, o) {
  25205. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  25206. this.linkTileAndNode(a, n)
  25207. }, i = 0; i < C.FACES_PER_PANO; i++) {
  25208. var n = this.getTileTree(e.id, i);
  25209. n.breadthFirst({
  25210. callback: t.bind(this, n, i)
  25211. })
  25212. }
  25213. }
  25214. ,
  25215. l.prototype.anyUploaded = function(e) {
  25216. if (!e)
  25217. return !1;
  25218. if (e.tile && this.isTileUploaded(e.tile))
  25219. return !0;
  25220. if (e.children)
  25221. for (var t = 0; t < e.children.length; t++) {
  25222. var i = e.children[t];
  25223. if (this.anyUploaded(i))
  25224. return !0
  25225. }
  25226. return !1
  25227. }
  25228. ,
  25229. l.prototype.setNodeCovered = function(e, t) {
  25230. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25231. }
  25232. ,
  25233. l.prototype.isNodeCovered = function(e) {
  25234. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25235. }
  25236. ,
  25237. l.prototype.addCoverageForNode = function(e) {
  25238. if (this.setNodeCovered(e, !0),
  25239. e.parent && e.covered) {
  25240. var t = e.parent;
  25241. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25242. }
  25243. }
  25244. ,
  25245. l.prototype.calcFullCoverage = function(e) {
  25246. var t = !1;
  25247. if (e.children)
  25248. for (var i = 0; i < e.children.length; i++) {
  25249. var n = e.children[i];
  25250. t = t || this.calcFullCoverage(n)
  25251. }
  25252. e.covered = e.tile.uploaded || t
  25253. }
  25254. ,
  25255. l.prototype.nodeSubcovered = function(e) {
  25256. if (!e.children)
  25257. return !1;
  25258. for (var t = 0; t < e.children.length; t++)
  25259. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25260. return !1;
  25261. return !0
  25262. }
  25263. ,
  25264. l.prototype.resetPanoDescriptor = function(e) {
  25265. this.getPanoDescriptor(e)
  25266. }
  25267. ,
  25268. l.prototype.getPanoDescriptor = function(e) {
  25269. var t = this.panoDescriptors[e];
  25270. return t || (t = {},
  25271. this.panoDescriptors[e] = t),
  25272. t
  25273. }
  25274. ,
  25275. l.prototype.resetPanoLODDescriptors = function(e) {
  25276. var t = this.getPanoLODDescriptors(e);
  25277. for (var i in t)
  25278. if (t.hasOwnProperty(i)) {
  25279. var n = t[i];
  25280. n.uploadCount = 0,
  25281. n.uploadAttempts = 0
  25282. }
  25283. }
  25284. ,
  25285. l.prototype.getPanoLODDescriptor = function(e, t) {
  25286. var i = this.getPanoLODDescriptors(e)
  25287. , n = i[t];
  25288. return n || (n = {
  25289. uploadCount: 0,
  25290. uploadAttempts: 0
  25291. },
  25292. i[t] = n),
  25293. n
  25294. }
  25295. ,
  25296. l.prototype.getPanoLODDescriptors = function(e) {
  25297. var t = this.panoLODDescriptors[e];
  25298. return t || (t = {},
  25299. this.panoLODDescriptors[e] = t),
  25300. t
  25301. }
  25302. ,
  25303. l.prototype.onTileDownloaded = function(e) {
  25304. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25305. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25306. if (i.downloaded = !0,
  25307. i.image = e.image,
  25308. i.panoSize = e.panoSize,
  25309. i.tileX = e.tileX,
  25310. i.tileY = e.tileY,
  25311. i.totalTiles = e.totalTiles,
  25312. i.tileIndex = e.tileIndex,
  25313. i.faceTileIndex = e.faceTileIndex,
  25314. i.face = e.face,
  25315. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  25316. i.panoId = e.panoId,
  25317. i.tileSize = e.tileSize,
  25318. i.direction = (new h.Vector3).copy(e.direction),
  25319. i.node = null,
  25320. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  25321. this.isPanoActive(i.panoId)) {
  25322. var n = this.getTileTree(i.panoId, i.face)
  25323. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  25324. this.linkTileAndNode(i, r),
  25325. this.queueTileUpload(i, !0)
  25326. }
  25327. }
  25328. ,
  25329. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25330. var r = this.tileDirectory[e];
  25331. r || (r = {},
  25332. this.tileDirectory[e] = r);
  25333. var o = 16384 * t + 1024 * i + n
  25334. , a = r[o];
  25335. return a || (a = {
  25336. downloaded: !1,
  25337. uploaded: !1,
  25338. zoomUploaded: !1
  25339. },
  25340. r[o] = a),
  25341. a._key = e + ":" + t + ":" + i + ":" + n,
  25342. a._tileKey = o,
  25343. a
  25344. }
  25345. ,
  25346. l.prototype.setZoomingActive = function(e, t, i) {
  25347. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25348. this.zoomPanoId = t.id,
  25349. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25350. }
  25351. ,
  25352. l.prototype.updateZoomedPanoFromBase = function(e) {
  25353. if (!this.zoomPanoRenderingDisabled) {
  25354. var t = this.getActiveRenderTargetDescriptor(e.id);
  25355. if (t && t.renderTarget) {
  25356. var i = this.qualityManager.getMaxZoomPanoSize()
  25357. , n = t.renderTarget
  25358. , r = t.size;
  25359. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25360. this.copyBaseRenderStatusToZoomed(e.id)
  25361. }
  25362. }
  25363. }
  25364. ,
  25365. t.exports = l
  25366. }
  25367. , {
  25368. "../enum/GLCubeFaces": 25,
  25369. "../enum/PanoRendererEvents": 35,
  25370. "../enum/PanoSizeClass": 36,
  25371. "../enum/SceneRendererEvents": 43,
  25372. "../enum/TileDownloaderEvents": 45,
  25373. "../enum/Vectors": 50,
  25374. "../exception/BasicException": 55,
  25375. "../objects/Panorama": 148,
  25376. "../settings": 166,
  25377. "../util/browser": 182,
  25378. "../util/panorama": 191,
  25379. "./TileDownloader": 171,
  25380. "./TilePrioritizer": 172,
  25381. "./TileTree": 173,
  25382. "./TileUtils": 174,
  25383. events: 202,
  25384. three: 217
  25385. }],
  25386. 170: [function(e, t, i) {//tile/QualityManager.js
  25387. "use strict";
  25388. function n(e, t, i) {
  25389. this.maxNavPanoSize = -1,
  25390. this.maxZoomPanoSize = -1,
  25391. this.devicePixelDensity = e,
  25392. this.deviceScreenSize = t,
  25393. this.clientBandwidth = i,
  25394. this.panoSizeClassMap = {},
  25395. this.useHighResolutionPanos = !0,
  25396. this.useUltraHighResolutionPanos = !1,
  25397. this.modelHasUltraHighPanos = !1
  25398. }
  25399. var r = e("../enum/PanoSizeClass")
  25400. , o = e("../settings")
  25401. , a = e("../util/browser")
  25402. , s = e("../constants")
  25403. , l = e("../util/showcase")
  25404. , c = e("../enum/ModelManagerEvents");
  25405. n.prototype.init = function(e) {
  25406. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25407. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25408. this.highSize = this.getPanoSize(r.HIGH),
  25409. this.standardSize = this.getPanoSize(r.STANDARD),
  25410. this.baseSize = this.getPanoSize(r.BASE),
  25411. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25412. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25413. this.updateMaximums(),
  25414. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25415. }
  25416. ,
  25417. n.prototype.updateFromModel = function(e) {
  25418. this.updateHighResolutionSettings(e),
  25419. this.updateUltraHighResolutionSettings(e)
  25420. }
  25421. ,
  25422. n.prototype.updateHighResolutionSettings = function(e) {
  25423. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25424. this.updateMaximums()
  25425. }
  25426. ,
  25427. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25428. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25429. this.updateMaximums()
  25430. }
  25431. ,
  25432. n.prototype.enableUltraHighQualityMode = function() {
  25433. this.modelHasUltraHighPanos = !0,
  25434. this.updateUltraHighResolutionSettings(null)
  25435. }
  25436. ,
  25437. n.prototype.ultraHighQualityModeEnabled = function() {
  25438. return this.modelHasUltraHighPanos
  25439. }
  25440. ,
  25441. n.prototype.onModelChanged = function(e) {
  25442. this.updateFromModel(e.model),
  25443. this.updateMaximums()
  25444. }
  25445. ,
  25446. n.prototype.updateMaximums = function() {
  25447. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25448. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25449. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25450. }
  25451. ,
  25452. n.prototype.buildPanoSizeClassMap = function() {
  25453. this.panoSizeClassMap[r.BASE] = 512,
  25454. this.panoSizeClassMap[r.STANDARD] = 1024,
  25455. this.panoSizeClassMap[r.HIGH] = 2048,
  25456. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25457. }
  25458. ,
  25459. n.prototype.getPanoSize = function(e) {
  25460. return this.panoSizeClassMap[e]
  25461. }
  25462. ,
  25463. n.prototype.getMaxPossiblePanoSize = function() {
  25464. return this.getPanoSize(r.ULTRAHIGH)
  25465. }
  25466. ,
  25467. n.prototype.getMaxPanoSize = function() {
  25468. return this.maxZoomPanoSize
  25469. }
  25470. ,
  25471. n.prototype.getMaxNavPanoSize = function() {
  25472. return this.maxNavPanoSize
  25473. }
  25474. ,
  25475. n.prototype.getMaxZoomPanoSize = function() {
  25476. return this.maxZoomPanoSize
  25477. }
  25478. ,
  25479. n.prototype.detectMaxNavPanoSizeClass = function() {
  25480. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : window.innerHeight < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25481. }
  25482. ,
  25483. n.prototype.detectMaxNavPanoSize = function() {
  25484. var e = this.detectMaxNavPanoSizeClass();
  25485. return this.getPanoSize(e)
  25486. }
  25487. ,
  25488. n.prototype.detectMaxZoomPanoSize = function() {
  25489. 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)
  25490. }
  25491. ,
  25492. t.exports = n
  25493. }
  25494. , {
  25495. "../constants": 8,
  25496. "../enum/ModelManagerEvents": 33,
  25497. "../enum/PanoSizeClass": 36,
  25498. "../settings": 166,
  25499. "../util/browser": 182,
  25500. "../util/showcase": 193
  25501. }],
  25502. 171: [function(e, t, i) {///js/tile/TileDownloader.js
  25503. (function(i) {
  25504. "use strict";
  25505. function n(e) {
  25506. this.panos = null,
  25507. this.retryMinimumTime = 1e4,
  25508. this.urls = null,
  25509. this.panoLoadCallbacks = {},
  25510. this.downloadDescriptors = {},
  25511. this.priorityQueue = [],
  25512. this.forceQueue = [],
  25513. this.activeDownloads = [],
  25514. this.qualityManager = null,
  25515. this.tilePrioritizer = null,
  25516. this.refreshInterval = null,
  25517. this.processPriorityQueue = !1,
  25518. this.concurrentDownloads = e.concurrentDownloads || 1,
  25519. this.downloadTestResults = {}
  25520. }
  25521. var r = e("three")
  25522. , o = (e("../enum/Viewmode"),
  25523. e("../settings"))
  25524. , a = (e("../objects/Panorama"),
  25525. e("../util/logger"))
  25526. , s = (e("../enum/Vectors"),
  25527. e("../enum/PanoSizeClass"),
  25528. e("../enum/TileDownloaderEvents"))
  25529. , l = e("./TilePrioritizer")
  25530. , c = e("./TileUtils")
  25531. , h = (e("../enum/GLCubeFaces"),
  25532. e("../enum/DownloadStatus"))
  25533. , u = e("../util/panorama")
  25534. , d = e("../util/ajax")
  25535. , p = e("../ab")
  25536. , f = e("events").EventEmitter
  25537. , g = (new a(i),
  25538. Object.freeze({
  25539. Testing: 1,
  25540. Success: 2,
  25541. Fail: 3
  25542. }));
  25543. n.prototype = Object.create(f.prototype),
  25544. n.IDLE_REFRESH_DELAY = 500,
  25545. n.ACTIVE_REFRESH_DELAY = 16,
  25546. n.DOWNLOAD_RETRIES = 4,
  25547. n.prototype.init = function(e) {
  25548. this.qualityManager = e
  25549. }
  25550. ,
  25551. n.prototype.setUrls = function(e) {
  25552. this.urls = e
  25553. }
  25554. ,
  25555. n.prototype.setPanoData = function(e, t, i) {
  25556. this.panos = e,
  25557. this.imagePanos = t,
  25558. this.panoGroupId = i
  25559. }
  25560. ,
  25561. n.prototype.start = function() {
  25562. this.refreshUpdateInterval(0)
  25563. }
  25564. ,
  25565. n.prototype.stop = function() {
  25566. window.cancel(this.refreshInterval)
  25567. }
  25568. ,
  25569. n.prototype.refreshUpdateInterval = function(e) {
  25570. e || (e = 0),
  25571. this.refreshInterval = window.setTimeout(function() {
  25572. var e = this.update();
  25573. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  25574. }
  25575. .bind(this), e)
  25576. }
  25577. ,
  25578. n.prototype.update = function() {
  25579. var e = this.forceQueue.length > 0;
  25580. return this.processQueueForDownloading(this.forceQueue),
  25581. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25582. this.priorityQueue.length > 0 && (e = !0),
  25583. this.processQueueForDownloading(this.priorityQueue)),
  25584. e
  25585. }
  25586. ,
  25587. n.prototype.forceQueueTilesForPano = function() {
  25588. var e = []
  25589. , t = [];
  25590. return function(i, n, r, o, a, s) {
  25591. e.length = 0;
  25592. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  25593. var p = u[d];
  25594. p.status !== h.None && p.status !== h.Queued || e.push(p)
  25595. }
  25596. if (r && e.length > 0) {
  25597. l.sortPanoTiles(e, i, r),
  25598. t.length = 0,
  25599. c.matchingTilesInDirection(i, n, r, o, a, t);
  25600. for (var f = 0, g = function(e) {
  25601. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  25602. }; f < e.length; ) {
  25603. var m = e[f]
  25604. , v = t.findIndex(g);
  25605. v < 0 ? e.splice(f, 1) : f++
  25606. }
  25607. }
  25608. for (var A = 0; A < e.length; A++)
  25609. this.forceQueue.push(e[A]);
  25610. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  25611. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  25612. s && this.processQueueForDownloading(this.forceQueue, !0)
  25613. }
  25614. }(),
  25615. n.prototype.clearForceQueue = function() {
  25616. this.clearQueue(this.forceQueue)
  25617. }
  25618. ,
  25619. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  25620. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  25621. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  25622. this.clearFromQueue(this.priorityQueue, h.None, !0),
  25623. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  25624. }
  25625. ,
  25626. n.prototype.clearQueue = function(e) {
  25627. this.setStatusForAllDescriptors(e, h.None),
  25628. e.length = 0
  25629. }
  25630. ,
  25631. n.prototype.clearFromQueue = function(e, t, i) {
  25632. for (var n = 0; n < e.length; n++) {
  25633. var r = e[n];
  25634. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  25635. }
  25636. }
  25637. ,
  25638. n.prototype.setStatusForAllDescriptors = function(e, t) {
  25639. for (var i = 0; i < e.length; i++) {
  25640. var n = e[i];
  25641. n && (n.status = t)
  25642. }
  25643. }
  25644. ,
  25645. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  25646. for (var i = 0; i < e.length; i++) {
  25647. var n = e[i];
  25648. n && (n.status !== t ? n.status = t : e[i] = null)
  25649. }
  25650. }
  25651. ,
  25652. n.prototype.getTileDownloadDescriptors = function(e, t) {
  25653. var i = this.getAllTileDownloadDescriptorsForPano(e)
  25654. , n = i[t];
  25655. return n || (n = this.buildDownloadDescriptorArray(t),
  25656. i[t] = n,
  25657. this.initTileDownloadDescriptors(n, e, t)),
  25658. n
  25659. }
  25660. ,
  25661. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  25662. var t = this.downloadDescriptors[e.id];
  25663. return t || (t = {},
  25664. this.downloadDescriptors[e.id] = t),
  25665. t
  25666. }
  25667. ,
  25668. n.prototype.processQueueForDownloading = function(e, t) {
  25669. if (this.cleanupActiveDownloads(),
  25670. this.activeDownloads.length < this.concurrentDownloads || t)
  25671. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  25672. var o = e.shift();
  25673. o && (this.startDownload(o),
  25674. n++)
  25675. }
  25676. }
  25677. ,
  25678. n.prototype.testDownload = function(e, t, i) {
  25679. var n = this.downloadTestResults[e];
  25680. if (n)
  25681. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  25682. this.downloadTestResults[e] = g.Testing;
  25683. var r = this.panos.list[0]
  25684. , o = this.getTileUrl(r.id, e, t, 0)
  25685. , a = function(t) {
  25686. this.downloadTestResults[e] = g.Success,
  25687. i(!0)
  25688. }
  25689. .bind(this)
  25690. , s = function() {
  25691. this.downloadTestResults[e] = g.Fail,
  25692. i(!1)
  25693. }
  25694. .bind(this);
  25695. this.loadImage(o, 0, a, s)
  25696. }
  25697. ,
  25698. n.prototype.startDownload = function(e) {
  25699. e.status = h.Downloading;
  25700. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  25701. this.activeDownloads.push(e),
  25702. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  25703. }
  25704. ,
  25705. n.prototype.downloadFailed = function(e, t) {}
  25706. ,
  25707. n.prototype.downloadComplete = function(e, t) {
  25708. if (e.panoGroupId === this.panoGroupId) {
  25709. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  25710. e.status = h.Downloaded,
  25711. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  25712. var n = {
  25713. panoId: e.pano.id,
  25714. image: t,
  25715. tileSize: e.tileSize,
  25716. panoSize: e.panoSize,
  25717. tileIndex: e.tileIndex,
  25718. faceTileIndex: e.faceTileIndex,
  25719. totalTiles: e.totalTiles,
  25720. face: e.face,
  25721. tileX: e.tileX,
  25722. tileY: e.tileY,
  25723. direction: e.direction
  25724. };
  25725. e.image = t,
  25726. this.emit(s.TileDownloadSuccess, n),
  25727. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  25728. panoId: e.pano.id,
  25729. tileSize: e.tileSize,
  25730. panoSize: e.panoSize
  25731. },
  25732. this.emit(s.PanoDownloadComplete, n),
  25733. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  25734. }
  25735. }
  25736. ,
  25737. n.prototype.cleanupActiveDownloads = function() {
  25738. var e = [];
  25739. return function() {
  25740. e.length = 0;
  25741. for (var t = 0; t < this.activeDownloads.length; t++) {
  25742. var i = this.activeDownloads[t];
  25743. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  25744. }
  25745. this.activeDownloads.length = 0,
  25746. this.activeDownloads.push.apply(this.activeDownloads, e)
  25747. }
  25748. }(),
  25749. n.prototype.isPanoDownloaded = function(e, t) {
  25750. var i = this.getTileDownloadDescriptors(e, t);
  25751. if (i.length <= 0)
  25752. return !1;
  25753. for (var n = 0; n < i.length; n++) {
  25754. var r = i[n];
  25755. if (r.status !== h.Downloaded)
  25756. return !1
  25757. }
  25758. return !0
  25759. }
  25760. ,
  25761. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  25762. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  25763. this.panoLoadCallbacks[o] = {
  25764. onLoad: i,
  25765. onFail: n,
  25766. onProgress: r
  25767. }
  25768. }
  25769. ,
  25770. n.prototype.getPanoLoadCallbacks = function(e, t) {
  25771. var i = e.id + ":" + t;
  25772. return this.panoLoadCallbacks[i]
  25773. }
  25774. ,
  25775. n.prototype.buildDownloadDescriptorArray = function(e) {
  25776. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  25777. var r = this.buildDownloadDescriptor();
  25778. i.push(r)
  25779. }
  25780. return i
  25781. }
  25782. ,
  25783. n.prototype.buildDownloadDescriptor = function() {
  25784. var e = {
  25785. panoGroupId: null,
  25786. pano: null,
  25787. panoSize: -1,
  25788. tileSize: -1,
  25789. tileIndex: -1,
  25790. totalTiles: -1,
  25791. faceTileIndex: -1,
  25792. status: h.None,
  25793. url: null,
  25794. image: null,
  25795. direction: new r.Vector3,
  25796. face: -1,
  25797. cubeFace: -1,
  25798. tileX: -1,
  25799. tileY: -1
  25800. };
  25801. return e
  25802. }
  25803. ,
  25804. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  25805. for (var n = 0; n < e.length; n++) {
  25806. var r = e[n];
  25807. this.initTileDownloadDescriptor(r, t, i, n)
  25808. }
  25809. }
  25810. ,
  25811. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  25812. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  25813. e.face = c.getFaceForTile(i, n),
  25814. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  25815. e.panoGroupId = this.panoGroupId,
  25816. e.pano = t,
  25817. e.panoSize = i,
  25818. e.tileSize = r,
  25819. e.tileIndex = n,
  25820. e.totalTiles = c.getTileCountForSize(i),
  25821. e.status = h.None,
  25822. e.image = null,
  25823. c.getTileLocation(e.panoSize, e.tileIndex, e),
  25824. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  25825. }
  25826. ,
  25827. n.prototype.getTileUrl = function() {
  25828. var e = {
  25829. 256: "256",
  25830. 512: "512",
  25831. 1024: "1k",
  25832. 2048: "2k",
  25833. 4096: "4k"
  25834. }
  25835. , t = {
  25836. face: -1,
  25837. faceTileIndex: -1,
  25838. tileX: -1,
  25839. tileY: -1
  25840. };
  25841. return function(i, n, r, a) {
  25842. c.getTileLocation(n, a, t);
  25843. var s = Math.floor(n / r)
  25844. , l = s * s
  25845. , h = Math.floor(a / l)
  25846. , u = "";
  25847. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  25848. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  25849. return d = p.changeIfTileGenerating(d)
  25850. }
  25851. }(),
  25852. n.prototype.loadImage = function(e, t, i, n) {
  25853. d.getImage(e, t).then(function(e) {
  25854. i(e)
  25855. }).fail(n)
  25856. }
  25857. ,
  25858. t.exports = n
  25859. }
  25860. ).call(this, "/js/tile/TileDownloader.js")
  25861. }
  25862. , {
  25863. "../ab": 3,
  25864. "../enum/DownloadStatus": 24,
  25865. "../enum/GLCubeFaces": 25,
  25866. "../enum/PanoSizeClass": 36,
  25867. "../enum/TileDownloaderEvents": 45,
  25868. "../enum/Vectors": 50,
  25869. "../enum/Viewmode": 51,
  25870. "../objects/Panorama": 148,
  25871. "../settings": 166,
  25872. "../util/ajax": 181,
  25873. "../util/logger": 189,
  25874. "../util/panorama": 191,
  25875. "./TilePrioritizer": 172,
  25876. "./TileUtils": 174,
  25877. events: 202,
  25878. three: 217
  25879. }],
  25880. 172: [function(e, t, i) {///js/tile/TilePrioritizer.js
  25881. (function(i) {
  25882. "use strict";
  25883. function n(e, t, i, o, a) {
  25884. this.qualityManager = e,
  25885. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  25886. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  25887. this.baseSize = t,
  25888. this.standardSize = i,
  25889. this.highSize = o,
  25890. this.ultraHighSize = a,
  25891. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  25892. }
  25893. var r = e("three")
  25894. , o = (e("../enum/Viewmode"),
  25895. e("../settings"),
  25896. e("../settings"),
  25897. e("../objects/Panorama"))
  25898. , a = e("../util/logger")
  25899. , s = (e("../enum/Vectors"),
  25900. e("../enum/PanoSizeClass"),
  25901. e("../enum/ModelManagerEvents"),
  25902. e("../enum/GLCubeFaces"),
  25903. e("../enum/DownloadStatus"))
  25904. , l = (e("../util/browser"),
  25905. e("./TileUtils"))
  25906. , c = e("../util/math")
  25907. , h = (e("events").EventEmitter,
  25908. new a(i),
  25909. Object.freeze({
  25910. None: 0,
  25911. DirectionalFOV: 1
  25912. }));
  25913. n.PriorityCriteria = function(e, t, i, n, o) {
  25914. this.pano = e,
  25915. this.cameraPosition = (new r.Vector3).copy(t),
  25916. this.cameraDir = (new r.Vector3).copy(i),
  25917. this.panoSpaceDir = (new r.Vector3).copy(n),
  25918. this.upcomingPanos = o,
  25919. this.copy = function(e) {
  25920. this.pano = e.pano,
  25921. this.cameraPosition.copy(e.cameraPosition),
  25922. this.cameraDir.copy(e.cameraDir),
  25923. this.panoSpaceDir.copy(e.panoSpaceDir),
  25924. this.upcomingPanos = o
  25925. }
  25926. ,
  25927. this.zoomingActive = !1
  25928. }
  25929. ,
  25930. n.DIRECTIONAL_FOV = 180,
  25931. n.DIRECTIONAL_FOV_NARROW = 120,
  25932. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  25933. n.MAX_SCORED_PANOS_TOADD = 2,
  25934. n.MAX_UPCOMING_PANOS_TOADD = 3,
  25935. n.DIRECTION_SCORE_STRICTNESS = .75,
  25936. n.appendQueue = function(e, t) {
  25937. if (e && t)
  25938. for (var i = 0; i < t.length; i++)
  25939. e.push(t[i])
  25940. }
  25941. ,
  25942. n.prototype.updateCriteria = function(e, t, i, n) {
  25943. this.priorityCriteria.pano = e,
  25944. this.priorityCriteria.cameraPosition.copy(t),
  25945. this.priorityCriteria.cameraDir.copy(i),
  25946. this.priorityCriteria.upcomingPanos = n,
  25947. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  25948. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  25949. }
  25950. ,
  25951. n.prototype.filterAndPrioritize = function() {
  25952. var e = []
  25953. , t = []
  25954. , i = [];
  25955. return function(r, o, a) {
  25956. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  25957. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  25958. var s = this.baseSize
  25959. , l = this.standardSize
  25960. , c = this.highSize
  25961. , h = this.ultraHighSize;
  25962. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  25963. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  25964. i.length = 0,
  25965. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  25966. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  25967. n.appendQueue(r, i),
  25968. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  25969. i.length = 0,
  25970. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  25971. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  25972. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  25973. n.appendQueue(r, i),
  25974. i.length = 0,
  25975. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  25976. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  25977. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  25978. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  25979. n.appendQueue(r, i),
  25980. this.queueTilesForPanos(r, e, a, s)
  25981. }
  25982. }(),
  25983. n.prototype.canDownloadSize = function(e) {
  25984. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  25985. }
  25986. ,
  25987. n.prototype.populateNeighborPanos = function(e, t, i) {
  25988. i = i || [],
  25989. i.length = 0;
  25990. var n = t.getNeighbours(e);
  25991. for (var r in n)
  25992. if (n.hasOwnProperty(r)) {
  25993. var o = t.get(r);
  25994. i.push(o)
  25995. }
  25996. return i
  25997. }
  25998. ,
  25999. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  26000. i = i || [],
  26001. i.length = 0;
  26002. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  26003. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  26004. , c = t.sortByScore(s, l);
  26005. if (c)
  26006. for (var h = 0; h < c.length && h < a; h++) {
  26007. var u = c[h].pano;
  26008. i.push(u)
  26009. }
  26010. return i
  26011. }
  26012. ,
  26013. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26014. for (var o = 0, a = 0; a < t.length; a++) {
  26015. var s = t[a]
  26016. , l = this.queueTilesForPano(e, i, s, n);
  26017. if (o += l > 0 ? 1 : 0,
  26018. r && o >= r)
  26019. break
  26020. }
  26021. return o
  26022. }
  26023. ,
  26024. n.prototype.queueTilesForPano = function() {
  26025. var e = {
  26026. filter: h.None
  26027. };
  26028. return function(t, i, n, r) {
  26029. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  26030. }
  26031. }(),
  26032. n.prototype.queueTilesForPanosInDirection = function() {
  26033. var e = new r.Vector3;
  26034. return function(t, i, n, r, o, a, s, l) {
  26035. for (var h = 0, u = 0; u < n.length; u++) {
  26036. var d = n[u];
  26037. e.copy(d.position),
  26038. e.sub(o),
  26039. e.normalize();
  26040. var p = Math.max(Math.min(a.dot(e), 1), -1)
  26041. , f = c.getFOVDotThreshold(s);
  26042. if (p >= f) {
  26043. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  26044. if (h += g > 0 ? 1 : 0,
  26045. l && h >= l)
  26046. break
  26047. }
  26048. }
  26049. return h
  26050. }
  26051. }(),
  26052. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26053. for (var l = 0, c = 0; c < i.length; c++) {
  26054. var h = i[c]
  26055. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  26056. if (l += u > 0 ? 1 : 0,
  26057. s && l >= s)
  26058. break
  26059. }
  26060. return l
  26061. }
  26062. ,
  26063. n.prototype.queueTilesInDirectionForPano = function() {
  26064. var e = {
  26065. filter: h.DirectionalFOV,
  26066. direction: new r.Vector3,
  26067. fov: 60
  26068. }
  26069. , t = new r.Vector3;
  26070. return function(i, n, r, o, a, s, c) {
  26071. return t.copy(s),
  26072. l.getRelativeDirection(r.quaternion, t),
  26073. e.direction.copy(t),
  26074. e.fov = c,
  26075. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  26076. }
  26077. }(),
  26078. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  26079. var e = [];
  26080. return function(t, i, n, r, o) {
  26081. var a = i.getTileDownloadDescriptors(n, r);
  26082. e.length = 0,
  26083. this.filterTileDownloadDescriptors(n, a, e, o);
  26084. for (var s = 0, l = 0; l < e.length; l++) {
  26085. var c = e[l];
  26086. c && (t.push(c),
  26087. s++)
  26088. }
  26089. return s
  26090. }
  26091. }(),
  26092. n.prototype.filterTileDownloadDescriptors = function() {
  26093. new r.Vector3;
  26094. return function(e, t, i, n) {
  26095. var r, o;
  26096. switch (n.filter) {
  26097. case h.DirectionalFOV:
  26098. for (r = 0; r < t.length; r++)
  26099. o = t[r],
  26100. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26101. break;
  26102. default:
  26103. for (r = 0; r < t.length; r++)
  26104. o = t[r],
  26105. i.push(o)
  26106. }
  26107. for (r = 0; r < i.length; r++)
  26108. o = i[r],
  26109. this.canIncludeDescriptor(o) || (i[r] = null)
  26110. }
  26111. }(),
  26112. n.prototype.canIncludeDescriptor = function(e) {
  26113. return e.status !== s.Downloading && e.status !== s.Downloaded
  26114. }
  26115. ,
  26116. n.prototype.canIncludePano = function(e, t) {
  26117. return !e.isLoaded(t)
  26118. }
  26119. ,
  26120. n.getFOVDotThreshold = function(e) {
  26121. return Math.cos(r.Math.degToRad(e / 2))
  26122. }
  26123. ;
  26124. var u = function() {
  26125. var e = function e(t, i) {
  26126. var n = e._panoSpaceDir
  26127. , r = e._fovThreshold
  26128. , o = e._fovThresholdNarrow
  26129. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  26130. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  26131. return t._dot = a,
  26132. i._dot = s,
  26133. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  26134. };
  26135. return e._panoSpaceDir = new r.Vector3,
  26136. e._fovThreshold = -1,
  26137. e._fovThresholdNarrow = -1,
  26138. e
  26139. }();
  26140. n.sortPanoTiles = function(e, t, i) {
  26141. u._panoSpaceDir.copy(i),
  26142. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  26143. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26144. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  26145. e.sort(u)
  26146. }
  26147. ,
  26148. n.insertSortedPanoTile = function(e, t, i, r) {
  26149. u._panoSpaceDir.copy(r),
  26150. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  26151. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26152. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  26153. for (var o = -1, a = 0; a < e.length; a++) {
  26154. var s = u(t, e[a]);
  26155. if (s <= 0) {
  26156. o = a;
  26157. break
  26158. }
  26159. }
  26160. if (o === -1)
  26161. e[e.length] = t;
  26162. else {
  26163. for (var h = e.length; h > o; h--)
  26164. e[h] = e[h - 1];
  26165. e[o] = t
  26166. }
  26167. }
  26168. ,
  26169. n.prototype.setZoomingActive = function(e) {
  26170. e !== this.zoomingActive && (this.zoomingActive = e)
  26171. }
  26172. ,
  26173. t.exports = n
  26174. }
  26175. ).call(this, "/js/tile/TilePrioritizer.js")
  26176. }
  26177. , {
  26178. "../enum/DownloadStatus": 24,
  26179. "../enum/GLCubeFaces": 25,
  26180. "../enum/ModelManagerEvents": 33,
  26181. "../enum/PanoSizeClass": 36,
  26182. "../enum/Vectors": 50,
  26183. "../enum/Viewmode": 51,
  26184. "../objects/Panorama": 148,
  26185. "../settings": 166,
  26186. "../util/browser": 182,
  26187. "../util/logger": 189,
  26188. "../util/math": 190,
  26189. "./TileUtils": 174,
  26190. events: 202,
  26191. three: 217
  26192. }],
  26193. 173: [function(e, t, i) {//"./TileTree"
  26194. "use strict";
  26195. function n(e, t) {
  26196. this.levels = t,
  26197. this.tileSize = e,
  26198. this.root = null,
  26199. this.allNodes = [],
  26200. a(this)
  26201. }
  26202. function r(e, t) {
  26203. this.tree = e,
  26204. this.parent = t,
  26205. this.children = [],
  26206. this.id = ++u
  26207. }
  26208. function o(e, t, i, r, a, s, l, h) {
  26209. if (e) {
  26210. l = l || n.TraversalType.PreOrder;
  26211. var u = r * c + i;
  26212. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  26213. s && s.push(e)),
  26214. e.children && 0 !== e.children.length) {
  26215. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  26216. for (var g = 0; g < c; g++)
  26217. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  26218. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  26219. s && s.push(e))
  26220. }
  26221. }
  26222. }
  26223. function a(e) {
  26224. e.root = s(e, null, 0)
  26225. }
  26226. function s(e, t, i) {
  26227. if (i > e.levels)
  26228. return null;
  26229. var n = new r(e,t);
  26230. e.allNodes.push(n);
  26231. for (var o = 0; o < h; o++)
  26232. n.children[o] = s(e, n, i + 1);
  26233. return n
  26234. }
  26235. function l(e, t, i, n, r) {
  26236. if (!e)
  26237. return null;
  26238. if (0 === i)
  26239. return e;
  26240. if (!e.children || 0 === e.children.length)
  26241. return null;
  26242. var o = Math.pow(c, i)
  26243. , a = o / c
  26244. , s = n % a
  26245. , h = r % a
  26246. , u = Math.floor(r / a)
  26247. , d = Math.floor(n / a)
  26248. , p = u * c + d
  26249. , f = e.children[p];
  26250. return l(f, t + 1, i - 1, s, h)
  26251. }
  26252. var c = (e("three"),
  26253. e("./TileUtils"),
  26254. e("../objects/Panorama"),
  26255. e("../util/panorama"),
  26256. e("events").EventEmitter,
  26257. 2)
  26258. , h = c * c;
  26259. n.TraversalType = Object.freeze({
  26260. PreOrder: 0,
  26261. PostOrder: 1
  26262. });
  26263. var u = 0;
  26264. n.getLevelCountForSize = function(e, t) {
  26265. var i = 0;
  26266. for (t < e && (t = e); ; ) {
  26267. if (t /= c,
  26268. t < e)
  26269. break;
  26270. i++
  26271. }
  26272. return i
  26273. }
  26274. ,
  26275. n.getSizeForLevel = function(e, t) {
  26276. return Math.pow(c, t) * e
  26277. }
  26278. ,
  26279. n.prototype.getSubNode = function(e, t, i) {
  26280. (!t || e < this.tileSize) && (t = 0),
  26281. (!i || e < this.tileSize) && (i = 0),
  26282. e < this.tileSize && (e = this.tileSize);
  26283. var r = n.getLevelCountForSize(this.tileSize, e)
  26284. , o = l(this.root, 0, r, t, i);
  26285. return o
  26286. }
  26287. ,
  26288. n.prototype.breadthFirst = function(e) {
  26289. e = e || {};
  26290. var t = !!e.nullLevelEnd
  26291. , i = e.maxLevel
  26292. , n = e.minLevel
  26293. , r = e.callback
  26294. , o = e.saveVisited
  26295. , a = []
  26296. , s = {}
  26297. , l = 0
  26298. , c = 0;
  26299. for (a.push(this.root),
  26300. a.push(s); a.length > 0 && !(i && l > i); ) {
  26301. var h = a.shift();
  26302. if (h === s)
  26303. (!n || l >= n) && (r && t && r(null),
  26304. o && t && o.push(null)),
  26305. a.length > 0 && a.push(s),
  26306. l++,
  26307. c = 0;
  26308. else {
  26309. if (h.children)
  26310. for (var u = 0; u < h.children.length; u++) {
  26311. var d = h.children[u];
  26312. d && a.push(h.children[u])
  26313. }
  26314. var p = this.getFaceIndexFromNode(h);
  26315. (!n || l >= n) && (r && r(h, l, p),
  26316. o && o.push(h)),
  26317. c++
  26318. }
  26319. }
  26320. }
  26321. ,
  26322. n.prototype.getFaceIndexFromNode = function(e) {
  26323. if (!e)
  26324. return -1;
  26325. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26326. var o = i.parent;
  26327. if (!o)
  26328. break;
  26329. for (var a = -1, s = 0; s < o.children.length; s++)
  26330. o.children[s] === i && (a = s);
  26331. var l = a % c
  26332. , h = Math.floor(a / c);
  26333. n = l * t + n,
  26334. r = h * t + r,
  26335. t *= c,
  26336. i = o
  26337. }
  26338. return r * t + n
  26339. }
  26340. ,
  26341. n.prototype.depthFirst = function(e, t, i) {
  26342. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26343. }
  26344. ,
  26345. t.exports = n
  26346. }
  26347. , {
  26348. "../objects/Panorama": 148,
  26349. "../util/panorama": 191,
  26350. "./TileUtils": 174,
  26351. events: 202,
  26352. three: 217
  26353. }],
  26354. 174: [function(e, t, i) {//"../tile/TileUtils" or "./TileUtils"
  26355. "use strict";
  26356. var n = e("../enum/GLCubeFaces")
  26357. , r = e("../util/MathLight")
  26358. , o = {};
  26359. o.TILE_SIZE = 512,
  26360. o.FACES_PER_PANO = 6,
  26361. o.LocationOnTile = {
  26362. Center: 0,
  26363. UpperLeft: 1,
  26364. UpperRight: 2,
  26365. LowerRight: 3,
  26366. LowerLeft: 4
  26367. },
  26368. o.getTileVector = function() {
  26369. return function(e, t, i, a, s, l, c, h) {
  26370. l = l || o.LocationOnTile.Center;
  26371. var u = e / t
  26372. , d = a / u;
  26373. s = -s + (u - 1);
  26374. var p = s / u
  26375. , f = t / e
  26376. , g = 2 * f
  26377. , m = g / 2
  26378. , v = 2 * d - 1 + m
  26379. , A = 2 * p - 1 + m;
  26380. switch (l) {
  26381. case o.LocationOnTile.UpperLeft:
  26382. v -= m,
  26383. A += m,
  26384. v += c * g;
  26385. break;
  26386. case o.LocationOnTile.UpperRight:
  26387. v += m,
  26388. A += m,
  26389. A -= c * g;
  26390. break;
  26391. case o.LocationOnTile.LowerRight:
  26392. v += m,
  26393. A -= m,
  26394. v -= c * g;
  26395. break;
  26396. case o.LocationOnTile.LowerLeft:
  26397. v -= m,
  26398. A -= m,
  26399. A += c * g;
  26400. break;
  26401. case o.LocationOnTile.Center:
  26402. }
  26403. switch (i) {
  26404. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26405. r.setVector(h, -1, A, -v);
  26406. break;
  26407. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26408. r.setVector(h, 1, A, v);
  26409. break;
  26410. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26411. r.setVector(h, -v, 1, -A);
  26412. break;
  26413. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26414. r.setVector(h, -v, -1, A);
  26415. break;
  26416. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26417. r.setVector(h, -v, A, 1);
  26418. break;
  26419. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26420. r.setVector(h, v, A, -1)
  26421. }
  26422. r.normalize(h)
  26423. }
  26424. }(),
  26425. o.getFaceForTile = function(e, t) {
  26426. var i = o.TILE_SIZE;
  26427. e < o.TILE_SIZE && (i = e);
  26428. var n = Math.floor(e / i)
  26429. , r = n * n;
  26430. return Math.floor(t / r)
  26431. }
  26432. ,
  26433. o.getTileLocation = function(e, t, i) {
  26434. var n = o.TILE_SIZE;
  26435. e < o.TILE_SIZE && (n = e);
  26436. var r = o.getFaceForTile(e, t)
  26437. , a = Math.floor(e / n)
  26438. , s = a * a
  26439. , l = t - r * s;
  26440. i.tileX = l % a,
  26441. i.tileY = Math.floor(l / a),
  26442. i.face = r,
  26443. i.faceTileIndex = l
  26444. }
  26445. ,
  26446. o.getTileCountForSize = function(e) {
  26447. if (e <= o.TILE_SIZE)
  26448. return o.FACES_PER_PANO;
  26449. var t = Math.floor(e / o.TILE_SIZE)
  26450. , i = t * t
  26451. , n = i * o.FACES_PER_PANO;
  26452. return n
  26453. }
  26454. ,
  26455. o.getRelativeDirection = function() {
  26456. var e = new r.Matrix4
  26457. , t = new r.Quaternion;
  26458. return function(i, n) {
  26459. t.copy(i),
  26460. t.inverse(),
  26461. e.makeRotationFromQuaternion(t),
  26462. e.applyToVector3(n),
  26463. r.normalize(n)
  26464. }
  26465. }(),
  26466. o.matchingTilesInDirection = function() {
  26467. var e = new r.Vector3
  26468. , t = new r.Vector3(0,0,-1)
  26469. , i = new r.Quaternion
  26470. , n = function(e, t) {
  26471. e.push({
  26472. face: t.face,
  26473. faceTileIndex: t.faceTileIndex,
  26474. tileX: t.tileX,
  26475. tileY: t.tileY
  26476. })
  26477. }
  26478. , a = function() {
  26479. var e = {
  26480. face: -1,
  26481. faceTileIndex: -1,
  26482. tileX: -1,
  26483. tileY: -1
  26484. };
  26485. return function(t, i, r) {
  26486. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  26487. o.getTileLocation(t, l, e),
  26488. i && !i(e) || (s++,
  26489. r && n(r, e));
  26490. return s
  26491. }
  26492. }();
  26493. return function(n, s, l, c, h, u) {
  26494. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  26495. o.getTileCountForSize(s);
  26496. if (!c && !h)
  26497. return a(s, null, u);
  26498. var p = !!h;
  26499. if (h = h || c,
  26500. h = Math.max(0, Math.min(h, 360)),
  26501. c = Math.max(0, Math.min(c, 360)),
  26502. r.copyVector(l, e),
  26503. o.getRelativeDirection(n.quaternion, e),
  26504. p) {
  26505. i.setFromUnitVectors(e, t);
  26506. var f = function(e) {
  26507. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  26508. };
  26509. return a(s, f, u)
  26510. }
  26511. var g = function(t) {
  26512. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  26513. };
  26514. return a(s, g, u)
  26515. }
  26516. }(),
  26517. o.isTileWithinFrustum = function() {
  26518. var e = new r.Vector3
  26519. , t = 1e-5;
  26520. return function(i, n, a, s, l, c, h, u) {
  26521. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  26522. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  26523. r.applyQuaternionToVector(c, e),
  26524. e.z >= -t)
  26525. I++;
  26526. else {
  26527. var w = -1 / e.z
  26528. , _ = e.x * w
  26529. , T = e.y * w;
  26530. T > d ? v++ : T < p && A++,
  26531. _ > f ? y++ : _ < g && C++,
  26532. E++
  26533. }
  26534. return A !== E && v !== E && y !== E && C !== E
  26535. }
  26536. }(),
  26537. o.isTileWithinFOV = function() {
  26538. var e = new r.Vector3
  26539. , t = new r.Vector3(0,1,0)
  26540. , i = new r.Vector3(1,0,0);
  26541. return function(n, a, s, l, c, h, u) {
  26542. var d = o.mapFaceToCubemapFace(s);
  26543. if (r.cross(h, t, i),
  26544. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  26545. o.isWithinFOV(e, h, u, null))
  26546. return !0;
  26547. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  26548. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  26549. if (o.getTileVector(n, a, d, l, c, v, g, e),
  26550. o.isWithinFOV(e, h, u, null))
  26551. return !0;
  26552. g += p
  26553. }
  26554. return !1
  26555. }
  26556. }(),
  26557. o.isWithinFOV = function() {
  26558. var e = new r.Vector3
  26559. , t = new r.Vector3;
  26560. return function(i, n, o, a) {
  26561. if (r.copyVector(i, t),
  26562. a) {
  26563. r.copyVector(a, e),
  26564. r.normalize(e);
  26565. var s = r.dot(e, i);
  26566. e.x *= s,
  26567. e.y *= s,
  26568. e.z *= s,
  26569. r.subVector(t, e)
  26570. }
  26571. var l = o / 2 * r.RADIANS_PER_DEGREE
  26572. , c = Math.cos(l)
  26573. , h = r.dot(t, n);
  26574. return h >= c
  26575. }
  26576. }(),
  26577. o.mapFaceToCubemapFace = function() {
  26578. var e = {
  26579. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26580. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26581. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26582. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26583. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26584. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26585. };
  26586. return function(t) {
  26587. return e[t]
  26588. }
  26589. }(),
  26590. t.exports = o
  26591. }
  26592. , {
  26593. "../enum/GLCubeFaces": 25,
  26594. "../util/MathLight": 176
  26595. }],
  26596. 175: [function(e, t, i) {///js/util/IndexedCollection.j
  26597. (function(i) {
  26598. "use strict";
  26599. function n() {
  26600. this.list = [],
  26601. this.index = {},
  26602. Object.defineProperty(this, "length", {
  26603. get: function() {
  26604. return this.list.length
  26605. }
  26606. })
  26607. }
  26608. var r = (e("./common"),
  26609. e("./logger"));
  26610. new r(i);
  26611. n.prototype.forEach = function(e) {
  26612. this.list.forEach(e)
  26613. }
  26614. ,
  26615. n.prototype.add = function(e) {
  26616. this.list.push(e),
  26617. this.index[this.getIndex(e)] = e
  26618. }
  26619. ,
  26620. n.prototype.getIndex = function(e) {
  26621. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  26622. }
  26623. ,
  26624. n.prototype.extend = function(e) {
  26625. for (var t = 0; t < e.length; t++)
  26626. this.add(e[t])
  26627. }
  26628. ,
  26629. n.prototype.get = function(e) {
  26630. return this.index[e]
  26631. }
  26632. ,
  26633. n.prototype.first = function() {
  26634. return this.list[0]
  26635. }
  26636. ,
  26637. n.prototype.last = function() {
  26638. return this.list[this.list.length - 1]
  26639. }
  26640. ,
  26641. n.prototype.reIndex = function() {
  26642. this.index = {};
  26643. var e = this;
  26644. this.forEach(function(t) {
  26645. e.index[e.getIndex(t)] = t
  26646. })
  26647. }
  26648. ,
  26649. n.prototype.filter = function(e) {
  26650. var t = this.list.filter(e);
  26651. return this.reIndex(),
  26652. t
  26653. }
  26654. ,
  26655. n.prototype.reduce = function(e, t) {
  26656. return this.list.reduce(e, t)
  26657. }
  26658. ,
  26659. n.prototype.sort = function(e) {
  26660. return this.list.sort(e)
  26661. }
  26662. ,
  26663. n.prototype.indexOf = function(e) {
  26664. for (var t = 0; t < this.list.length; ++t)
  26665. if (this.list[t] === e)
  26666. return t;
  26667. return -1
  26668. }
  26669. ,
  26670. t.exports = n
  26671. }
  26672. ).call(this, "/js/util/IndexedCollection.js")
  26673. }
  26674. , {
  26675. "./common": 185,
  26676. "./logger": 189
  26677. }],
  26678. 176: [function(e, t, i) {//"../util/MathLight"
  26679. "use strict";
  26680. var n = e("../constants")
  26681. , r = {};
  26682. r.RADIANS_PER_DEGREE = Math.PI / 180,
  26683. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  26684. r.Vector3 = function(e, t, i) {
  26685. this.x = e || 0,
  26686. this.y = t || 0,
  26687. this.z = i || 0
  26688. }
  26689. ,
  26690. r.Matrix4 = function() {
  26691. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  26692. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  26693. }
  26694. ,
  26695. r.Matrix4.prototype = {
  26696. identity: function() {
  26697. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  26698. this
  26699. },
  26700. copy: function(e) {
  26701. return this.elements.set(e.elements),
  26702. this
  26703. },
  26704. applyToVector3: function(e) {
  26705. var t = e.x
  26706. , i = e.y
  26707. , n = e.z
  26708. , r = this.elements;
  26709. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  26710. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  26711. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  26712. this
  26713. },
  26714. getInverse: function(e, t) {
  26715. var i = this.elements
  26716. , n = e.elements
  26717. , r = n[0]
  26718. , o = n[1]
  26719. , a = n[2]
  26720. , s = n[3]
  26721. , l = n[4]
  26722. , c = n[5]
  26723. , h = n[6]
  26724. , u = n[7]
  26725. , d = n[8]
  26726. , p = n[9]
  26727. , f = n[10]
  26728. , g = n[11]
  26729. , m = n[12]
  26730. , v = n[13]
  26731. , A = n[14]
  26732. , y = n[15]
  26733. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  26734. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  26735. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  26736. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  26737. , w = r * C + o * I + a * E + s * b;
  26738. if (0 === w) {
  26739. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  26740. if (t)
  26741. throw new Error(_);
  26742. return console.warn(_),
  26743. this.identity()
  26744. }
  26745. var T = 1 / w;
  26746. return i[0] = C * T,
  26747. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  26748. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  26749. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  26750. i[4] = I * T,
  26751. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  26752. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  26753. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  26754. i[8] = E * T,
  26755. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  26756. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  26757. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  26758. i[12] = b * T,
  26759. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  26760. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  26761. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  26762. this
  26763. },
  26764. makeRotationFromQuaternion: function(e) {
  26765. var t = this.elements
  26766. , i = e.x
  26767. , n = e.y
  26768. , r = e.z
  26769. , o = e.w
  26770. , a = i + i
  26771. , s = n + n
  26772. , l = r + r
  26773. , c = i * a
  26774. , h = i * s
  26775. , u = i * l
  26776. , d = n * s
  26777. , p = n * l
  26778. , f = r * l
  26779. , g = o * a
  26780. , m = o * s
  26781. , v = o * l;
  26782. return t[0] = 1 - (d + f),
  26783. t[4] = h - v,
  26784. t[8] = u + m,
  26785. t[1] = h + v,
  26786. t[5] = 1 - (c + f),
  26787. t[9] = p - g,
  26788. t[2] = u - m,
  26789. t[6] = p + g,
  26790. t[10] = 1 - (c + d),
  26791. t[3] = 0,
  26792. t[7] = 0,
  26793. t[11] = 0,
  26794. t[12] = 0,
  26795. t[13] = 0,
  26796. t[14] = 0,
  26797. t[15] = 1,
  26798. this
  26799. }
  26800. },
  26801. r.Quaternion = function(e, t, i, n) {
  26802. this._x = e || 0,
  26803. this._y = t || 0,
  26804. this._z = i || 0,
  26805. this._w = void 0 !== n ? n : 1
  26806. }
  26807. ,
  26808. r.Quaternion.prototype = {
  26809. get x() {
  26810. return this._x
  26811. },
  26812. set x(e) {
  26813. this._x = e
  26814. },
  26815. get y() {
  26816. return this._y
  26817. },
  26818. set y(e) {
  26819. this._y = e
  26820. },
  26821. get z() {
  26822. return this._z
  26823. },
  26824. set z(e) {
  26825. this._z = e
  26826. },
  26827. get w() {
  26828. return this._w
  26829. },
  26830. set w(e) {
  26831. this._w = e
  26832. },
  26833. copy: function(e) {
  26834. this._x = e.x,
  26835. this._y = e.y,
  26836. this._z = e.z,
  26837. this._w = e.w
  26838. },
  26839. inverse: function() {
  26840. return this.conjugate().normalize()
  26841. },
  26842. conjugate: function() {
  26843. return this._x *= -1,
  26844. this._y *= -1,
  26845. this._z *= -1,
  26846. this
  26847. },
  26848. length: function() {
  26849. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  26850. },
  26851. normalize: function() {
  26852. var e = this.length();
  26853. return 0 === e ? (this._x = 0,
  26854. this._y = 0,
  26855. this._z = 0,
  26856. this._w = 1) : (e = 1 / e,
  26857. this._x = this._x * e,
  26858. this._y = this._y * e,
  26859. this._z = this._z * e,
  26860. this._w = this._w * e),
  26861. this
  26862. },
  26863. setFromAxisAngle: function(e, t) {
  26864. var i = t / 2
  26865. , n = Math.sin(i);
  26866. return this._x = e.x * n,
  26867. this._y = e.y * n,
  26868. this._z = e.z * n,
  26869. this._w = Math.cos(i),
  26870. this
  26871. },
  26872. setFromUnitVectors: function() {
  26873. var e, t, i = 1e-6;
  26874. return function(n, o) {
  26875. return void 0 === e && (e = new r.Vector3),
  26876. t = r.dot(n, o) + 1,
  26877. t < i ? (t = 0,
  26878. Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  26879. this._x = e.x,
  26880. this._y = e.y,
  26881. this._z = e.z,
  26882. this._w = t,
  26883. this.normalize()
  26884. }
  26885. }(),
  26886. multiply: function(e) {
  26887. return this.multiplyQuaternions(this, e)
  26888. },
  26889. premultiply: function(e) {
  26890. return this.multiplyQuaternions(e, this)
  26891. },
  26892. multiplyQuaternions: function(e, t) {
  26893. var i = e._x
  26894. , n = e._y
  26895. , r = e._z
  26896. , o = e._w
  26897. , a = t._x
  26898. , s = t._y
  26899. , l = t._z
  26900. , c = t._w;
  26901. return this._x = i * c + o * a + n * l - r * s,
  26902. this._y = n * c + o * s + r * a - i * l,
  26903. this._z = r * c + o * l + i * s - n * a,
  26904. this._w = o * c - i * a - n * s - r * l,
  26905. this
  26906. }
  26907. },
  26908. r.convertWorkshopVector = function(e) {
  26909. return new r.Vector3(-e.x,e.y,e.z)
  26910. }
  26911. ,
  26912. r.convertWorkshopQuaternion = function(e) {
  26913. return new r.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  26914. }
  26915. ;
  26916. r.convertWorkshopOrthoZoom = function(e) {
  26917. return e === -1 ? -1 : e / 16 * ($('#player').width() / $('#player').height()) / n.workshopApsect
  26918. }
  26919. ,
  26920. r.convertWorkshopPanoramaQuaternion = function(e) {
  26921. return new r.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), 270 * r.RADIANS_PER_DEGREE))
  26922. }
  26923. ,
  26924. r.normalize = function(e) {
  26925. var t = e.x * e.x + e.y * e.y + e.z * e.z
  26926. , i = Math.sqrt(t);
  26927. e.x /= i,
  26928. e.y /= i,
  26929. e.z /= i
  26930. }
  26931. ,
  26932. r.dot = function(e, t) {
  26933. return e.x * t.x + e.y * t.y + e.z * t.z
  26934. }
  26935. ,
  26936. r.cross = function(e, t, i) {
  26937. var n = e.x
  26938. , r = e.y
  26939. , o = e.z;
  26940. i.x = r * t.z - o * t.y,
  26941. i.y = o * t.x - n * t.z,
  26942. i.z = n * t.y - r * t.x
  26943. }
  26944. ,
  26945. r.setVector = function(e, t, i, n) {
  26946. e.x = t,
  26947. e.y = i,
  26948. e.z = n
  26949. }
  26950. ,
  26951. r.copyVector = function(e, t) {
  26952. t.x = e.x,
  26953. t.y = e.y,
  26954. t.z = e.z
  26955. }
  26956. ,
  26957. r.addVector = function(e, t) {
  26958. e.x += t.x,
  26959. e.y += t.y,
  26960. e.z += t.z
  26961. }
  26962. ,
  26963. r.subVector = function(e, t) {
  26964. e.x -= t.x,
  26965. e.y -= t.y,
  26966. e.z -= t.z
  26967. }
  26968. ,
  26969. r.applyQuaternionToVector = function(e, t) {
  26970. var i = t.x
  26971. , n = t.y
  26972. , r = t.z
  26973. , o = e.x
  26974. , a = e.y
  26975. , s = e.z
  26976. , l = e.w
  26977. , c = l * i + a * r - s * n
  26978. , h = l * n + s * i - o * r
  26979. , u = l * r + o * n - a * i
  26980. , d = -o * i - a * n - s * r;
  26981. t.x = c * l + d * -o + h * -s - u * -a,
  26982. t.y = h * l + d * -a + u * -o - c * -s,
  26983. t.z = u * l + d * -s + c * -a - h * -o
  26984. }
  26985. ,
  26986. r.angleBetweenVectors = function(e, t) {
  26987. return Math.acos(r.dot(e, t))
  26988. }
  26989. ,
  26990. t.exports = r
  26991. }
  26992. , {
  26993. "../constants": 8
  26994. }],
  26995. 177: [function(e, t, i) {///js/util/ModelUrls.js
  26996. (function(i) {
  26997. "use strict";
  26998. function n(e) {
  26999. this.cache = null,
  27000. this.expires = 0
  27001. }
  27002. function r() {
  27003. this.baseUrl = null,
  27004. this.cache = null,
  27005. this.expires = 0
  27006. }
  27007. function o() {
  27008. this.baseUrl = null,
  27009. this.expires = 0
  27010. }
  27011. function a(e) {
  27012. this.initialLoadingPromise = null,
  27013. this.endpoint = e + "?type=3",
  27014. this.urlContainer = null,
  27015. this.authorizationHeader = h.getAuthorizationHeader(),
  27016. this.containerClasses = [o, r, n]
  27017. }
  27018. var s = e("./ajax")
  27019. , l = e("./logger")
  27020. , c = e("../constants")
  27021. , h = e("./showcase")
  27022. , u = (e("../ab"),
  27023. new l(i));
  27024. n.prototype = {
  27025. version: 1,
  27026. validate: function(e) {
  27027. return "catalog.json"in e && Object.keys(e).length > 0
  27028. },
  27029. update: function(e) {
  27030. return this.cache = e,
  27031. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27032. $.when()
  27033. },
  27034. get: function(e) {
  27035. return this.cache[e]
  27036. }
  27037. },
  27038. r.prototype = {
  27039. version: 2,
  27040. validate: function(e) {
  27041. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  27042. },
  27043. update: function(e) {
  27044. return this.baseUrl = e["base.url"],
  27045. this.cache = e,
  27046. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27047. $.when()
  27048. },
  27049. get: function(e) {
  27050. var t = this.cache[e];
  27051. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27052. }
  27053. },
  27054. o.prototype = {
  27055. version: 3,
  27056. validate: function(e) {
  27057. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27058. },
  27059. update: function(e) {
  27060. e.templates[0] = e.templates[0].replace("{{number}}",window.number);
  27061. return this.baseUrl = e.templates[0],
  27062. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27063. $.when()
  27064. },
  27065. get: function(e) {
  27066. return this.baseUrl.replace("{{filename}}", e)
  27067. }
  27068. },
  27069. a.prototype = {
  27070. init: function() {
  27071. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  27072. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27073. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  27074. this.refresh().done(function() {
  27075. u.debug("Refreshed")
  27076. }).fail(function() {
  27077. u.error("Failed url refresh, urls might go stale soon")
  27078. }))
  27079. }.bind(this), c.signedUrlCheckInterval),
  27080. this.initialLoadingPromise = this.refresh(),
  27081. this.initialLoadingPromise)
  27082. },
  27083. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  27084. e = e || {};
  27085. /*var t = void 0 === e.cache || e.cache;
  27086. return s.get( this.endpoint , { //file
  27087. responseType: "json",
  27088. prefetchFrom: t ? "files" : null,
  27089. cache: t,
  27090. auth: this.authorizationHeader
  27091. }).then(function(e) {
  27092. if (this.urlContainer && this.urlContainer.validate(e))
  27093. return this.urlContainer.update(e);
  27094. for (var i = 0; i < this.containerClasses.length; i++) {
  27095. var n = this.containerClasses[i]
  27096. , r = new n;
  27097. if (r.validate(e))
  27098. return u.info("Using urls version " + r.version),
  27099. this.urlContainer = r,
  27100. this.urlContainer.update(e)
  27101. }
  27102. return t ? this.refresh({
  27103. cache: !1
  27104. }) : $.Deferred().reject("missing-urls")
  27105. }
  27106. .bind(this), function(e) {
  27107. return "loading-failed"
  27108. }) */
  27109. return $.Deferred().resolve();
  27110. },
  27111. get: function(e) {
  27112. //return this.urlContainer.get(e)
  27113. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27114. }
  27115. },
  27116. t.exports = a
  27117. }
  27118. ).call(this, "/js/util/ModelUrls.js")
  27119. }
  27120. , {
  27121. "../ab": 3,
  27122. "../constants": 8,
  27123. "./ajax": 181,
  27124. "./logger": 189,
  27125. "./showcase": 193
  27126. }],
  27127. 178: [function(e, t, i) {///js/util/PanoramaCollection.js
  27128. (function(i) {
  27129. "use strict";
  27130. function n() {
  27131. u.call(this),
  27132. this.neighbourMap = {},
  27133. this.map = null
  27134. }
  27135. var r = e("three")
  27136. , o = e("./common")
  27137. , a = e("../settings")
  27138. , s = e("../objects/Panorama")
  27139. , a = e("../settings")
  27140. , l = e("./aStar")
  27141. , c = e("./logger")
  27142. , h = new c(i)
  27143. , u = e("./IndexedCollection")
  27144. , d = e("./transitions");
  27145. o.inherit(n, u),
  27146. n.prototype.getIndex = function(e) {
  27147. return e.id
  27148. }
  27149. ,
  27150. n.prototype.find = function(e, t) {
  27151. var i = o.filterAll(this.list, e);
  27152. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27153. i = o.stableSort(i, e)
  27154. }),
  27155. i[0])
  27156. }
  27157. ,
  27158. n.prototype.sortByScore = function(e, t, findByScore) {//xzw改
  27159. var i = o.filterAll(this.list, e);
  27160. return 0 === i.length ? null : (i = i.map(function(e) {
  27161. return {
  27162. pano: e,
  27163. score: t.reduce(function(t, i) {
  27164. return t + i(e)
  27165. }, 0)
  27166. }
  27167. }).sort(function(e, t) {
  27168. return t.score - e.score;
  27169. }),
  27170. findByScore ? i[0].pano : i //xzw sort返回整个array find返回第一个
  27171. )
  27172. }
  27173. ,
  27174. n.prototype.lowestByScore = function(e, t, i) {
  27175. return this.findRankedByScore(0, e, t, i)
  27176. }
  27177. ,
  27178. n.prototype.findRankedByScore = function(e, t, i, n) {
  27179. n && (n.candidates = null,
  27180. n.pano = null),
  27181. e || (e = 0);
  27182. var r = this.sortByScore(t, i);
  27183. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27184. n.pano = r[e].pano),
  27185. r[e].pano)
  27186. }
  27187. ,
  27188. n.prototype.showPanoScores = function(e) {
  27189. this.list.forEach(function(e) {
  27190. e.removeTextSprite()
  27191. });
  27192. var t = 6344768;
  27193. e.forEach(function(e) {
  27194. e.pano.addTextSprite(e.score.toFixed(2), t),
  27195. t = 16428055
  27196. })
  27197. }
  27198. ,
  27199. n.prototype.isNeighbour = function(e, t) {
  27200. return this.neighbourMap[e.id][t.id]
  27201. }
  27202. ,
  27203. n.prototype.getNeighbours = function(e) {
  27204. return this.neighbourMap[e.id]
  27205. }
  27206. ,
  27207. n.prototype.setNeighbour = function(e, t, i) {
  27208. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27209. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27210. this.neighbourMap[e.id][e.id] = !0,
  27211. this.neighbourMap[t.id][t.id] = !0,
  27212. this.neighbourMap[e.id][t.id] = i,
  27213. this.neighbourMap[t.id][e.id] = i,
  27214. this.neighbourMap[e.id]
  27215. }
  27216. ,
  27217. n.prototype.findClosest = function(e, t) {
  27218. var i = [s.filters.isPanoAligned()];
  27219. return t && i.push(s.filters.inDirection(e, t, .75)),
  27220. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  27221. }
  27222. ,
  27223. n.prototype.dualNeighbors = function(e, t) {
  27224. var i, n = [];
  27225. for (i in this.neighbourMap[e.id])
  27226. this.neighbourMap[t.id][i] && n.push(i);
  27227. return n
  27228. }
  27229. ,
  27230. n.prototype.populate_path_graph = function() {
  27231. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  27232. for (e = 0; e < this.list.length; e += 1) {
  27233. o = this.list[e],
  27234. s = {},
  27235. l = !1,
  27236. i = o.neighbourPanos || o.findNeighourPanos();
  27237. for (t in i)
  27238. if (i[t]) {
  27239. a = this.index[t],
  27240. p.copy(o.floorPosition),
  27241. p.sub(a.floorPosition);
  27242. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  27243. , v = (Math.abs(p.y) / Math.max(m, .01),
  27244. Math.max(0, Math.abs(p.y) - .2));
  27245. v > 0 ? (f += 1,
  27246. v = Math.pow(4 * v, 2),
  27247. m = Math.pow(m, 2),
  27248. n = Math.sqrt(v * v + m * m)) : (g += 1,
  27249. n = p.length()),
  27250. s[a.id] = n,
  27251. l = !0
  27252. }
  27253. l ? u[o.id] = s : d += 1
  27254. }
  27255. this.map = u,
  27256. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  27257. }
  27258. ,
  27259. n.prototype.aStarSearch = function(e, t) {
  27260. var i = Date.now()
  27261. , n = new l({
  27262. start: e,
  27263. isEnd: function(e) {
  27264. return e === t
  27265. },
  27266. neighbor: function(e) {
  27267. var t = e.neighbourPanos || e.findNeighourPanos()
  27268. , i = [];
  27269. for (var n in t)
  27270. i.push(this.index[n]);
  27271. return i
  27272. }
  27273. .bind(this),
  27274. distance: function(e, t) {
  27275. var i = this.map[e.id]
  27276. , n = i[t.id];
  27277. return n
  27278. }
  27279. .bind(this),
  27280. heuristic: function(e, t) {
  27281. return 1
  27282. }
  27283. .bind(this),
  27284. hash: function(e) {
  27285. return e.id
  27286. },
  27287. timeout: 5e3
  27288. });
  27289. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  27290. "success" !== n.status)
  27291. return h.debug("Did not find A* path from " + e + " to " + t),
  27292. null;
  27293. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27294. var r = [];
  27295. return n.path.forEach(function(e) {
  27296. r.push(e.id)
  27297. }),
  27298. r
  27299. }
  27300. ,
  27301. n.prototype.includeNodesNearPath = function() {
  27302. var e = new r.Vector3
  27303. , t = new r.Vector3
  27304. , i = new r.Vector3
  27305. , n = new r.Vector3
  27306. , o = new r.Vector3
  27307. , a = new r.Vector3
  27308. , s = new r.Vector3
  27309. , l = new r.Vector3
  27310. , c = []
  27311. , h = new r.Vector3
  27312. , u = new r.Vector3;
  27313. return function(r, d) {
  27314. if (r)
  27315. for (var p = function(e, t, i) {
  27316. return o.copy(t).sub(e),
  27317. o.dot(i)
  27318. }, f = function(e, t) {
  27319. return p(h, e.position, i) - p(h, t.position, i)
  27320. }, g = 0; g < r.length - 1; ) {
  27321. var m = r[g]
  27322. , v = r[g + 1]
  27323. , A = this.index[m]
  27324. , y = this.index[v];
  27325. h.copy(A.position),
  27326. u.copy(y.position),
  27327. c.length = 0,
  27328. e.copy(u).sub(h),
  27329. i.copy(e).normalize();
  27330. for (var C = 0; C < this.list.length; C++) {
  27331. var I = this.list[C];
  27332. o.copy(I.position).sub(h);
  27333. var E = o.dot(i);
  27334. if (E > 0) {
  27335. s.copy(i),
  27336. s.multiplyScalar(E),
  27337. a.copy(o),
  27338. a.sub(s);
  27339. var b = a.length();
  27340. if (b < d) {
  27341. t.copy(e).negate(),
  27342. n.copy(t).normalize(),
  27343. l.copy(I.position).sub(u);
  27344. var w = l.dot(n);
  27345. w > 0 && c.push(I)
  27346. }
  27347. }
  27348. }
  27349. if (c.length > 0) {
  27350. c.sort(f);
  27351. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  27352. r[_] = r[_ - c.length];
  27353. for (var T = 0; T < c.length; T++)
  27354. r[T + g + 1] = c[T].id
  27355. }
  27356. g += c.length + 1
  27357. }
  27358. }
  27359. }(),
  27360. n.prototype.fadeMarkerOpacity = function(e, t) {
  27361. var i = void 0 === e ? a.panorama.markerOpacity : e
  27362. , n = this.list.findIndex(function(e) {
  27363. return e.marker
  27364. });
  27365. if (!(n < 0)) {
  27366. var r = this.list[n].marker.material.opacity;
  27367. if (r !== e) {
  27368. var o = i - r;
  27369. d.trigger({
  27370. func: function(e, t) {
  27371. var i = r + e * o;
  27372. this.forEach(function(e) {
  27373. e.marker && (e.marker.material.opacity = i)
  27374. })
  27375. }
  27376. .bind(this),
  27377. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27378. name: "_fpm"
  27379. })
  27380. }
  27381. }
  27382. }
  27383. ,
  27384. t.exports = n
  27385. }
  27386. ).call(this, "/js/util/PanoramaCollection.js")
  27387. }
  27388. , {
  27389. "../objects/Panorama": 148,
  27390. "../settings": 166,
  27391. "./IndexedCollection": 175,
  27392. "./aStar": 180,
  27393. "./common": 185,
  27394. "./logger": 189,
  27395. "./transitions": 195,
  27396. three: 217
  27397. }],
  27398. 179: [function(e, t, i) {//"./util/ZoomStats"
  27399. "use strict";
  27400. function n() {
  27401. this.actionSequence = [],
  27402. this.actionSequenceInProgress = !1
  27403. }
  27404. function r(e, t, i, n) {
  27405. s.trackAlways("zoom_" + e, {
  27406. from: t,
  27407. to: i,
  27408. pano: n
  27409. })
  27410. }
  27411. function o(e, t) {
  27412. r("initial", 1, e, t)
  27413. }
  27414. function a(e, t, i) {
  27415. r("followup", e, t, i)
  27416. }
  27417. var s = e("../analytics");
  27418. n.prototype.reset = function(e) {
  27419. this.actionSequenceInProgress = !1,
  27420. this.actionSequence.length = 0
  27421. }
  27422. ,
  27423. n.prototype.addZoomAction = function() {
  27424. var e = null
  27425. , t = null
  27426. , i = !1
  27427. , n = function() {
  27428. if (e = null,
  27429. this.actionSequence.length > 0) {
  27430. var i = this.actionSequence[0].start
  27431. , n = this.actionSequence[this.actionSequence.length - 1].end;
  27432. 1 === i ? o(n, t) : a(i, n, t)
  27433. }
  27434. this.reset()
  27435. };
  27436. return function(r, o, a) {
  27437. if (r !== o) {
  27438. i || (n = n.bind(this),
  27439. i = !0),
  27440. e && (window.clearTimeout(e),
  27441. e = null),
  27442. a === t && this.actionSequenceInProgress || (this.reset(),
  27443. t = a),
  27444. this.actionSequenceInProgress = !0;
  27445. var s = {
  27446. start: r,
  27447. end: o
  27448. };
  27449. this.actionSequence.push(s),
  27450. e = window.setTimeout(n, 150)
  27451. }
  27452. }
  27453. }(),
  27454. t.exports = n
  27455. }
  27456. , {
  27457. "../analytics": 4
  27458. }],
  27459. 180: [function(e, t, i) {//"./aStar"
  27460. "use strict";
  27461. function n(e) {
  27462. void 0 === e.timeout && (e.timeout = 1 / 0);
  27463. var t = e.hash || o
  27464. , i = {
  27465. data: e.start,
  27466. g: 0,
  27467. h: e.heuristic(e.start)
  27468. }
  27469. , n = i;
  27470. i.f = i.h;
  27471. var h = new s
  27472. , u = new l(a)
  27473. , d = c();
  27474. u.push(i),
  27475. d.set(t(i.data), i);
  27476. for (var p = new Date; u.size(); ) {
  27477. if (new Date - p > e.timeout)
  27478. return {
  27479. status: "timeout",
  27480. cost: n.g,
  27481. path: r(n)
  27482. };
  27483. var f = u.pop();
  27484. if (d.delete(t(f.data)),
  27485. e.isEnd(f.data))
  27486. return {
  27487. status: "success",
  27488. cost: f.g,
  27489. path: r(f)
  27490. };
  27491. h.add(t(f.data));
  27492. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  27493. var v = g[m];
  27494. if (!h.contains(t(v))) {
  27495. var A = f.g + e.distance(f.data, v)
  27496. , y = d.get(t(v))
  27497. , C = !1;
  27498. if (void 0 === y)
  27499. y = {
  27500. data: v
  27501. },
  27502. d.set(t(v), y);
  27503. else {
  27504. if (y.g < A)
  27505. continue;
  27506. C = !0
  27507. }
  27508. y.parent = f,
  27509. y.g = A,
  27510. y.h = e.heuristic(v),
  27511. y.f = A + y.h,
  27512. y.h < n.h && (n = y),
  27513. C ? u.heapify() : u.push(y)
  27514. }
  27515. }
  27516. }
  27517. return {
  27518. status: "noPath",
  27519. cost: n.g,
  27520. path: r(n)
  27521. }
  27522. }
  27523. function r(e) {
  27524. if (void 0 !== e.parent) {
  27525. var t = r(e.parent);
  27526. return t.push(e.data),
  27527. t
  27528. }
  27529. return [e.data]
  27530. }
  27531. function o(e) {
  27532. return e.toString()
  27533. }
  27534. function a(e, t) {
  27535. return e.f - t.f
  27536. }
  27537. var s = e("Set")
  27538. , l = e("heap")
  27539. , c = e("dict");
  27540. t.exports = n
  27541. }
  27542. , {
  27543. Set: 196,
  27544. dict: 210,
  27545. heap: 211
  27546. }],
  27547. 181: [function(e, t, i) {////js/util/ajax.js
  27548. (function(i) {
  27549. "use strict";
  27550. function n(e, t, i) {
  27551. var n = new XMLHttpRequest;
  27552. if (i && "withCredentials"in n)
  27553. n.open(e, t, i);
  27554. else if ("undefined" != typeof XDomainRequest)
  27555. n = new XDomainRequest,
  27556. n.open(e, t);
  27557. else {
  27558. if (i)
  27559. throw "Browser does not support CORS!";
  27560. n.open(e, t)
  27561. }
  27562. return n
  27563. }
  27564. function r(e, t, i) {
  27565. function o() {
  27566. u.warn("Retrying ", t),
  27567. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  27568. }
  27569. function a(e, t) {
  27570. var i = e.response;
  27571. if ("json" === t && "object" != typeof i)
  27572. try {
  27573. i = JSON.parse(e.responseText)
  27574. } catch (e) {
  27575. return void c.reject({
  27576. error: "Failed parsing JSON"
  27577. })
  27578. }
  27579. else if ("image/jpeg" === t) {
  27580. var n = new Uint8Array(e.response)
  27581. , r = new Blob([n],{
  27582. type: "image/jpeg"
  27583. })
  27584. , o = URL.createObjectURL(r);
  27585. i = new Image,
  27586. i.src = o,
  27587. i.crossOrigin = "Anonymous",
  27588. i.onload = function() {
  27589. URL.revokeObjectURL(o)
  27590. }
  27591. }
  27592. return i
  27593. }
  27594. var s = n(e, t, !1);
  27595. if (i = i || {},
  27596. i.retries = void 0 !== i.retries ? i.retries : 0,
  27597. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27598. i.responseType)
  27599. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  27600. s.responseType = i.responseType;
  27601. else {
  27602. if ("image/jpeg" !== i.responseType)
  27603. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27604. s.responseType = "arraybuffer"
  27605. }
  27606. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  27607. i.auth && s.setRequestHeader("Authorization", i.auth),
  27608. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27609. s.setRequestHeader("Content-Type", "application/json")),
  27610. "object" == typeof i.headers)
  27611. for (var l in i.headers)
  27612. s.setRequestHeader(l, i.headers[l]);
  27613. var c = $.Deferred();
  27614. return s.onreadystatechange = function(e) {
  27615. if (4 === this.readyState)
  27616. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  27617. i.retries++,
  27618. setTimeout(o, 1e3);
  27619. else if (200 === this.status) {
  27620. var t = a(this, i.responseType);
  27621. c.resolve(t)
  27622. } else
  27623. c.reject(this)
  27624. }
  27625. ,
  27626. s.onprogress = function(e) {
  27627. c.notify(e)
  27628. }
  27629. ,
  27630. s.send(i.data),
  27631. c.promise()
  27632. }
  27633. function o(e) {
  27634. return Object.keys(e).sort().map(function(t) {
  27635. return {
  27636. key: t,
  27637. value: e[t]
  27638. }
  27639. })
  27640. }
  27641. function a(e, t) {
  27642. var i = t.responseType || null
  27643. , n = t.auth || null
  27644. , r = t.prefetchFrom || null
  27645. , a = e + "__" + i + "__" + n + "__" + r;
  27646. return t.headers && o(t.headers).forEach(function(e) {
  27647. a += "__" + e.key + ":" + e.value
  27648. }),
  27649. a
  27650. }
  27651. function s(e, t) {
  27652. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  27653. }
  27654. function l(e, t, i) {
  27655. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  27656. }
  27657. var c = e("./logger")
  27658. , h = e("../ab")
  27659. , u = new c(i);
  27660. window.URL = window.URL || window.webkitURL,
  27661. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27662. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  27663. /* setTimeout(function() {
  27664. window.MP_REQUEST_CACHE = null,
  27665. window.MP_PREFETCHED_MODELDATA = {}
  27666. }, 6e4),
  27667. window.onpageshow = function(e) {
  27668. e.persisted && (window.MP_REQUEST_CACHE = null,
  27669. window.MP_PREFETCHED_MODELDATA = {})
  27670. } */
  27671. ,
  27672. t.exports = {
  27673. get: function(e, t) {
  27674. t = t || {};
  27675. var i = void 0 === t.cache || t.cache;
  27676. if (i) {
  27677. var n = s(e, t);
  27678. if (n)
  27679. return n
  27680. }
  27681. var o;
  27682. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  27683. i && l(e, t, o),
  27684. o
  27685. },
  27686. post: function(e, t) {
  27687. return r("POST", e, t)
  27688. },
  27689. patch: function(e, t) {
  27690. return r("PATCH", e, t)
  27691. },
  27692. getImage: function(e, t) {
  27693. function i() {
  27694. u.warn("Retrying ", e),
  27695. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  27696. }
  27697. var n = $.Deferred()
  27698. , r = new Image
  27699. , o = this;
  27700. return e = h.changeIfImageOptimzing(e),
  27701. null !== t && void 0 !== t || (t = 3),
  27702. r.onerror = function() {
  27703. t > 0 ? setTimeout(i, 1e3) : n.reject()
  27704. }
  27705. ,
  27706. r.onload = function() {
  27707. n.resolve(r)
  27708. }
  27709. ,
  27710. r.crossOrigin = "anonymous",
  27711. r.src = e,
  27712. n
  27713. }
  27714. }
  27715. }
  27716. ).call(this, "/js/util/ajax.js")
  27717. }
  27718. , {
  27719. "../ab": 3,
  27720. "./logger": 189
  27721. }],
  27722. 182: [function(e, t, i) {//"./util/browser"
  27723. "use strict";
  27724. function n(e, t) {
  27725. var i = window.navigator.userAgent
  27726. , n = i.match(e);
  27727. return n = n ? n[1].split(t) : [],
  27728. {
  27729. major: parseInt(n[0]) || 0,
  27730. minor: parseInt(n[1]) || 0,
  27731. patch: parseInt(n[2]) || 0
  27732. }
  27733. }
  27734. var r = e("../exception/DeviceMismatchException");
  27735. t.exports = {
  27736. isFullscreen: function() {
  27737. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  27738. },
  27739. supportsFullscreen: function() {
  27740. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  27741. },
  27742. isPointerLocked: function() {
  27743. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  27744. },
  27745. requestFullscreen: function(e, t) {
  27746. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  27747. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  27748. },
  27749. requestPointerLock: function() {
  27750. var e;
  27751. if (document.fullscreenElement)
  27752. e = document.fullscreenElement();
  27753. else if (document.mozFullscreenElement)
  27754. e = document.mozFullscreenElement();
  27755. else if (document.mozFullScreenElement)
  27756. e = document.mozFullScreenElement();
  27757. else {
  27758. if (!document.webkitFullscreenElement)
  27759. return;
  27760. e = document.webkitFullscreenElement()
  27761. }
  27762. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  27763. e.requestPointerLock(),
  27764. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  27765. },
  27766. exitPointerLock: function() {
  27767. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  27768. document.exitPointerLock()
  27769. },
  27770. exitFullscreen: function() {
  27771. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  27772. },
  27773. details: function() {
  27774. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  27775. return e ? {
  27776. name: e[1],
  27777. version: parseInt(e[2]),
  27778. platform: navigator.platform
  27779. } : {}
  27780. },
  27781. is: function(e) {
  27782. return this.details() && this.details().name === e
  27783. },
  27784. inIframe: function() {
  27785. return window.parent !== window
  27786. },
  27787. aspectRatio: function() {
  27788. var e = $('#player').width() / $('#player').height();
  27789. return isFinite(e) ? e : 0
  27790. },
  27791. userAgent: function() {
  27792. return window.navigator.userAgent
  27793. },
  27794. isMobile: function() {
  27795. var e = navigator.userAgent || navigator.vendor || window.opera;
  27796. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  27797. },
  27798. isLandscape: function() {
  27799. return this.isMobile && this.aspectRatio() > 1
  27800. },
  27801. isSmallScreen: function() {
  27802. var e = screen.width / window.devicePixelRatio;
  27803. return e < 240
  27804. },
  27805. detectIE: function() {
  27806. var e = window.navigator.userAgent
  27807. , t = e.indexOf("MSIE ");
  27808. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  27809. },
  27810. detectSafari: function() {
  27811. var e = window.navigator.userAgent
  27812. , t = e.indexOf("Safari");
  27813. return t !== -1 && !this.detectChrome()
  27814. },
  27815. detectFirefox: function() {
  27816. var e = window.navigator.userAgent;
  27817. return e.indexOf("Firefox") !== -1
  27818. },
  27819. detectChrome: function() {
  27820. var e = window.navigator.userAgent;
  27821. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  27822. },
  27823. detectOpera: function() {
  27824. var e = window.navigator.userAgent;
  27825. return e.indexOf("OPR") !== -1
  27826. },
  27827. detectIOS: function() {
  27828. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  27829. },
  27830. detectIPad: function() {
  27831. var e = window.navigator.userAgent
  27832. , t = /iPad/;
  27833. return t.test(e)
  27834. },
  27835. detectIPod: function() {
  27836. var e = window.navigator.userAgent
  27837. , t = /iPod/;
  27838. return t.test(e)
  27839. },
  27840. detectIPhone: function() {
  27841. var e = window.navigator.userAgent
  27842. , t = /iPhone/;
  27843. return t.test(e)
  27844. },
  27845. detectAndroid: function() {
  27846. var e = window.navigator.userAgent;
  27847. return e.indexOf("Android") !== -1
  27848. },
  27849. detectAndroidMobile: function() {
  27850. var e = window.navigator.userAgent;
  27851. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  27852. },
  27853. detectSamsungNative: function() {
  27854. var e = window.navigator.userAgent;
  27855. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  27856. },
  27857. detectSamsungS6: function() {
  27858. var e = window.navigator.userAgent;
  27859. return e.indexOf("SM-G92") !== -1
  27860. },
  27861. detectWebVR: function() {
  27862. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  27863. },
  27864. getVRDisplay: function() {
  27865. var e = $.Deferred();
  27866. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  27867. t.length >= 1 && e.resolve(t[0]),
  27868. e.reject(null)
  27869. }),
  27870. e) : e.reject(null)
  27871. },
  27872. iosVersion: function() {
  27873. if (!this.detectIOS())
  27874. throw new r("Did not detect an iDevice");
  27875. var e = /((?:\d+\_?){1,3}) like Mac OS/
  27876. , t = "_";
  27877. return n(e, t)
  27878. },
  27879. androidVersion: function() {
  27880. if (!this.detectAndroid())
  27881. throw new r("Did not detect an Android based device");
  27882. var e = /Android ((?:\d+\.?){1,3})/
  27883. , t = ".";
  27884. return n(e, t)
  27885. },
  27886. valueFromCookie: function(e, t) {
  27887. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  27888. if (!i)
  27889. return t;
  27890. var n = i[1];
  27891. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  27892. },
  27893. valueFromHash: function(e, t) {
  27894. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  27895. , n = i.exec(window.location.href);
  27896. if (!n)
  27897. return t;
  27898. var r = n[1];
  27899. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  27900. }
  27901. }
  27902. }
  27903. , {
  27904. "../exception/DeviceMismatchException": 56
  27905. }],
  27906. 183: [function(e, t, i) {///js/util/camera.js
  27907. (function(i) {
  27908. "use strict";
  27909. function n(e, t) {
  27910. var i = r(t);
  27911. if (Object.keys(i).length > 0)
  27912. return i;
  27913. if (e.heroImage)
  27914. i = o(e, t);
  27915. else if (e.data.camera_start) {
  27916. var n = e.data.camera_start;
  27917. try {
  27918. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  27919. i.position = n.camera.position,
  27920. i.quaternion = n.camera.quaternion,
  27921. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  27922. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  27923. d.debug("Using camera_start"),
  27924. d.debug("Modeldata pano: ", i.pano.quaternion),
  27925. d.debug("Camera start pano: ", n.pano.quaternion)),
  27926. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  27927. } catch (e) {
  27928. d.warn(e.message)
  27929. }
  27930. }
  27931. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  27932. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  27933. i.pano = t.findClosest(i.position),
  27934. i.quaternion = i.pano.quaternion),
  27935. 0 === Object.keys(i).length) {
  27936. var a = t.list[0];
  27937. a && (i.mode = h.PANORAMA,
  27938. i.pano = a,
  27939. i.position = a.position,
  27940. i.quaternion = a.quaternion,
  27941. d.info("Starting at 1st pano " + a.id))
  27942. }
  27943. return i.mode = i.mode || h.DOLLHOUSE,
  27944. i
  27945. }
  27946. function r(e) {
  27947. var t = c.valueFromHash("start", "")
  27948. , i = {};
  27949. if ("" !== t) {
  27950. d.debug("Start override found in parameters, trying to parse..."),
  27951. i = a(t) || {};
  27952. var n = c.valueFromHash("tag", null);
  27953. n && (i.tag = n),
  27954. i.panoId && (i.pano = e.get(i.panoId))
  27955. }
  27956. return i
  27957. }
  27958. function o(e, t) {
  27959. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  27960. return {};
  27961. var i = {}
  27962. , n = e.heroImage.metadata;
  27963. d.debug("Using start position from thumbnail image"),
  27964. i.position = n.camera_position,
  27965. i.quaternion = n.camera_quaternion;
  27966. try {
  27967. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  27968. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  27969. } catch (e) {
  27970. d.debug(e.message)
  27971. }
  27972. return i
  27973. }
  27974. function a(e) {
  27975. return s.deserialize(e)
  27976. }
  27977. var s = e("../controls/serializer")
  27978. , l = e("../util/math")
  27979. , c = e("./browser")
  27980. , h = e("../enum/Viewmode")
  27981. , u = e("../util/logger")
  27982. , d = new u(i);
  27983. t.exports = {
  27984. getStartCameraOptions: n
  27985. }
  27986. }
  27987. ).call(this, "/js/util/camera.js")
  27988. }
  27989. , {
  27990. "../controls/serializer": 14,
  27991. "../enum/Viewmode": 51,
  27992. "../util/logger": 189,
  27993. "../util/math": 190,
  27994. "./browser": 182
  27995. }],
  27996. 184: [function(e, t, i) {//"../util/cameraLight"
  27997. "use strict";
  27998. function n(e, t, i) {
  27999. return o(e.fov, t, i)
  28000. }
  28001. var r = e("./MathLight")
  28002. , o = function(e, t, i) {
  28003. var n = t
  28004. , o = i
  28005. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  28006. return a
  28007. }
  28008. , a = function(e, t, i) {
  28009. var n = t
  28010. , o = i
  28011. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  28012. return a
  28013. }
  28014. , s = function(e, t, i, n) {
  28015. var r = o(e, i, n);
  28016. return r > t ? a(t, i, n) : e
  28017. };
  28018. t.exports = {
  28019. clampVFOV: s,
  28020. getHFOVForCamera: n,
  28021. getHFOVFromVFOV: o,
  28022. getVFOVFromHFOV: a
  28023. }
  28024. }
  28025. , {
  28026. "./MathLight": 176
  28027. }],
  28028. 185: [function(e, t, i) {//"./util/common"
  28029. "use strict";
  28030. var n = e("three");
  28031. t.exports = {
  28032. delayOneFrame: function(e) {
  28033. window.setTimeout(e, 1)
  28034. },
  28035. normalizeUrl: function(e) {
  28036. return e.replace("https://", "http://")
  28037. },
  28038. domainFromUrl: function(e) {
  28039. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28040. return t ? t[3] : e
  28041. },
  28042. average: function(e, t) {
  28043. if (0 === e.length)
  28044. return null;
  28045. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28046. var o = t ? e[r][t] : e[r];
  28047. i += o,
  28048. n++
  28049. }
  28050. return i / n
  28051. },
  28052. countUnique: function(e) {
  28053. for (var t = {}, i = 0; i < e.length; i++)
  28054. t[e[i]] = 1 + (t[e[i]] || 0);
  28055. return Object.keys(t).length
  28056. },
  28057. averageVectors: function(e, t) {
  28058. var i = new n.Vector3;
  28059. if (0 === e.length)
  28060. return i;
  28061. for (var r = 0, o = 0; o < e.length; o++) {
  28062. var a = t ? e[o][t] : e[o];
  28063. i.add(a),
  28064. r++
  28065. }
  28066. return i.divideScalar(r)
  28067. },
  28068. equalLists: function(e, t) {
  28069. if (e.length !== t.length)
  28070. return !1;
  28071. for (var i = 0; i < e.length; i++)
  28072. if (e[i] !== t[i])
  28073. return !1;
  28074. return !0
  28075. },
  28076. lowerMedian: function(e, t) {
  28077. if (0 === e.length)
  28078. return null;
  28079. t = t || 2,
  28080. e.sort(function(e, t) {
  28081. return e - t
  28082. });
  28083. var i = Math.floor(e.length / t);
  28084. return e[i]
  28085. },
  28086. stableSort: function(e, t) {
  28087. return e.map(function(e, t) {
  28088. return {
  28089. value: e,
  28090. index: t
  28091. }
  28092. }).sort(function(e, i) {
  28093. var n = t(e.value, i.value);
  28094. return 0 !== n ? n : e.index - i.index
  28095. }).map(function(e) {
  28096. return e.value
  28097. })
  28098. },
  28099. filterAll: function(e, t) {
  28100. return e.filter(function(e) {
  28101. return t.every(function(t) {
  28102. return t(e)
  28103. })
  28104. })
  28105. },
  28106. formatDate: function(e) {
  28107. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28108. },
  28109. formatDatetime: function(e) {
  28110. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28111. },
  28112. randomString: function(e) {
  28113. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28114. t += i.charAt(Math.floor(Math.random() * i.length));
  28115. return t
  28116. },
  28117. uint8ToBase64: function(e, t) {
  28118. t && "number" == typeof t || (t = 8192);
  28119. for (var i = [], n = 0; n < e.length; n += t)
  28120. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28121. return btoa(i.join(""))
  28122. },
  28123. uuid4: function e(t) {
  28124. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28125. },
  28126. nth: function(e) {
  28127. return e %= 10,
  28128. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28129. },
  28130. extendObject: function(e, t) {
  28131. return Object.keys(t).forEach(function(i) {
  28132. e[i] = t[i]
  28133. }),
  28134. e
  28135. },
  28136. deepExtend: function e(t) {
  28137. t = t || {};
  28138. for (var i = 1; i < arguments.length; i++) {
  28139. var n = arguments[i];
  28140. if (n)
  28141. for (var r in n)
  28142. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28143. }
  28144. return t
  28145. },
  28146. inherit: function(e, t) {
  28147. e.prototype = Object.create(t.prototype),
  28148. e.prototype.constructor = e
  28149. },
  28150. extend: function(e, t) {
  28151. for (var i in t.prototype)
  28152. e.prototype[i] = t.prototype[i]
  28153. }
  28154. },
  28155. Math.sign = function(e) {
  28156. return e < 0 ? -1 : 1
  28157. }
  28158. }
  28159. , {
  28160. three: 217
  28161. }],
  28162. 186: [function(e, t, i) {//"../util/easing"
  28163. "use strict";
  28164. var n = {};
  28165. n.linearTween = function(e, t, i, n) {
  28166. return i * e / n + t
  28167. }
  28168. ,
  28169. n.easeInQuad = function(e, t, i, n) {
  28170. return e /= n,
  28171. i * e * e + t
  28172. }
  28173. ,
  28174. n.easeOutQuad = function(e, t, i, n) {
  28175. return e /= n,
  28176. -i * e * (e - 2) + t
  28177. }
  28178. ,
  28179. n.easeInOutQuad = function(e, t, i, n) {
  28180. return e /= n / 2,
  28181. e < 1 ? i / 2 * e * e + t : (e--,
  28182. -i / 2 * (e * (e - 2) - 1) + t)
  28183. }
  28184. ,
  28185. n.easeInCubic = function(e, t, i, n) {
  28186. return e /= n,
  28187. i * e * e * e + t
  28188. }
  28189. ,
  28190. n.easeOutCubic = function(e, t, i, n) {
  28191. return e /= n,
  28192. e--,
  28193. i * (e * e * e + 1) + t
  28194. }
  28195. ,
  28196. n.easeInOutCubic = function(e, t, i, n) {
  28197. return e /= n / 2,
  28198. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  28199. i / 2 * (e * e * e + 2) + t)
  28200. }
  28201. ,
  28202. n.easeInQuart = function(e, t, i, n) {
  28203. return e /= n,
  28204. i * e * e * e * e + t
  28205. }
  28206. ,
  28207. n.easeOutQuart = function(e, t, i, n) {
  28208. return e /= n,
  28209. e--,
  28210. -i * (e * e * e * e - 1) + t
  28211. }
  28212. ,
  28213. n.easeInOutQuart = function(e, t, i, n) {
  28214. return e /= n / 2,
  28215. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  28216. -i / 2 * (e * e * e * e - 2) + t)
  28217. }
  28218. ,
  28219. n.easeInQuint = function(e, t, i, n) {
  28220. return e /= n,
  28221. i * e * e * e * e * e + t
  28222. }
  28223. ,
  28224. n.easeOutQuint = function(e, t, i, n) {
  28225. return e /= n,
  28226. e--,
  28227. i * (e * e * e * e * e + 1) + t
  28228. }
  28229. ,
  28230. n.easeInOutQuint = function(e, t, i, n) {
  28231. return e /= n / 2,
  28232. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  28233. i / 2 * (e * e * e * e * e + 2) + t)
  28234. }
  28235. ,
  28236. n.easeInSine = function(e, t, i, n) {
  28237. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28238. }
  28239. ,
  28240. n.easeOutSine = function(e, t, i, n) {
  28241. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28242. }
  28243. ,
  28244. n.easeInOutSine = function(e, t, i, n) {
  28245. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28246. }
  28247. ,
  28248. n.easeInExpo = function(e, t, i, n) {
  28249. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28250. }
  28251. ,
  28252. n.easeOutExpo = function(e, t, i, n) {
  28253. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  28254. }
  28255. ,
  28256. n.easeInOutExpo = function(e, t, i, n) {
  28257. return e /= n / 2,
  28258. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28259. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  28260. }
  28261. ,
  28262. n.easeInCirc = function(e, t, i, n) {
  28263. return e /= n,
  28264. -i * (Math.sqrt(1 - e * e) - 1) + t
  28265. }
  28266. ,
  28267. n.easeOutCirc = function(e, t, i, n) {
  28268. return e /= n,
  28269. e--,
  28270. i * Math.sqrt(1 - e * e) + t
  28271. }
  28272. ,
  28273. n.easeInOutCirc = function(e, t, i, n) {
  28274. return e /= n / 2,
  28275. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28276. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28277. }
  28278. ,
  28279. n.easeInElastic = function(e, t, i, n) {
  28280. var r = 1.70158
  28281. , o = 0
  28282. , a = i;
  28283. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28284. a < Math.abs(i) ? (a = i,
  28285. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28286. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  28287. }
  28288. ,
  28289. n.easeOutElastic = function(e, t, i, n) {
  28290. var r = 1.70158
  28291. , o = 0
  28292. , a = i;
  28293. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28294. a < Math.abs(i) ? (a = i,
  28295. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28296. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28297. }
  28298. ,
  28299. n.easeInOutElastic = function(e, t, i, n) {
  28300. var r = 1.70158
  28301. , o = 0
  28302. , a = i;
  28303. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  28304. a < Math.abs(i) ? (a = i,
  28305. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28306. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  28307. }
  28308. ,
  28309. n.easeInBack = function(e, t, i, n, r) {
  28310. return void 0 === r && (r = 1.70158),
  28311. i * (e /= n) * e * ((r + 1) * e - r) + t
  28312. }
  28313. ,
  28314. n.easeOutBack = function(e, t, i, n, r) {
  28315. return void 0 === r && (r = 1.70158),
  28316. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28317. }
  28318. ,
  28319. n.easeInOutBack = function(e, t, i, n, r) {
  28320. return void 0 === r && (r = 1.70158),
  28321. (e /= n / 2) < 1 ? i / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : i / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  28322. }
  28323. ,
  28324. n.easeOutBounce = function(e, t, i, n) {
  28325. 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
  28326. }
  28327. ,
  28328. n.easeInBounce = function(e, t, i, r) {
  28329. return i - n.easeOutBounce(r - e, 0, i, r) + t
  28330. }
  28331. ,
  28332. n.easeInOutBounce = function(e, t, i, r) {
  28333. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  28334. }
  28335. ,
  28336. t.exports = n
  28337. }
  28338. , {}],
  28339. 187: [function(e, t, i) {//"./util/history"
  28340. "use strict";
  28341. function n() {
  28342. this.events = [],
  28343. this.valid = !1
  28344. }
  28345. var r = e("../enum/Joystick");
  28346. n.prototype.push = function(e, t) {
  28347. this.events.push({
  28348. direction: e,
  28349. pano: t
  28350. }),
  28351. this.valid = !0
  28352. }
  28353. ,
  28354. n.prototype.pop = function(e) {
  28355. var t = this.events.pop();
  28356. return this.events.length < 1 && (this.valid = !1),
  28357. t
  28358. }
  28359. ,
  28360. n.prototype.peek = function() {
  28361. return this.events.length ? this.events[this.events.length - 1] : {
  28362. direction: null,
  28363. pano: null
  28364. }
  28365. }
  28366. ,
  28367. n.prototype.invalidate = function() {
  28368. this.events = [],
  28369. this.valid = !1
  28370. }
  28371. ,
  28372. n.prototype.reversePano = function(e) {
  28373. if (!this.valid)
  28374. return null;
  28375. var t = this.peek();
  28376. return r.opposite(e) === t.direction ? (this.pop(),
  28377. t.pano) : null
  28378. }
  28379. ,
  28380. t.exports = n
  28381. }
  28382. , {
  28383. "../enum/Joystick": 29
  28384. }],
  28385. 188: [function(e, t, i) {//"./util/lerp"
  28386. "use strict";
  28387. t.exports = {
  28388. vector: function(e, t) {
  28389. var i = e.clone();
  28390. return t = t.clone(),
  28391. function(n) {
  28392. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  28393. }
  28394. },
  28395. quaternion: function(e, t) {
  28396. var i = e.clone();
  28397. return function(n) {
  28398. e.copy(i).slerp(t, n)
  28399. }
  28400. },
  28401. property: function(e, t, i, n) {
  28402. var r = e[t];
  28403. return function(o) {
  28404. e[t] = r * (1 - o) + i * o,
  28405. n && n(e[t])
  28406. }
  28407. },
  28408. uniform: function(e, t, i) {
  28409. var n = e.material.uniforms[t].value;
  28410. return function(r) {
  28411. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  28412. }
  28413. },
  28414. matrix4: function(e, t) {
  28415. var i = e.clone();
  28416. return function(n) {
  28417. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  28418. r[s] = o[s] * (1 - n) + a[s] * n
  28419. }
  28420. },
  28421. allUniforms: function(e, t, i) {
  28422. var n = e.map(function(e) {
  28423. return this.uniform(e, t, i)
  28424. }
  28425. .bind(this));
  28426. return function(e) {
  28427. n.forEach(function(t) {
  28428. t(e)
  28429. })
  28430. }
  28431. }
  28432. }
  28433. }
  28434. , {}],
  28435. 189: [function(e, t, i) {//"./util/logger"
  28436. "use strict";
  28437. function n(e) {
  28438. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  28439. if (n.consoleEnabled) {
  28440. var h = function(e) {
  28441. $("#debug-console").append("<p>" + e + "</p>"),
  28442. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28443. };
  28444. t = function(e) {
  28445. h(Array.prototype.slice.call(arguments).join(" "))
  28446. }
  28447. ,
  28448. i = function(e) {
  28449. h(Array.prototype.slice.call(arguments).join(" "))
  28450. }
  28451. ,
  28452. o = function(e) {
  28453. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28454. }
  28455. ,
  28456. a = function(e) {
  28457. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28458. }
  28459. } else
  28460. console.log ? (t = console.log,
  28461. i = console.info ? console.info : console.log,
  28462. o = console.warn ? console.warn : console.log,
  28463. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  28464. ;
  28465. var u = function(e) {
  28466. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  28467. }
  28468. , d = function(t, i) {
  28469. if (r) {
  28470. var o = Array.prototype.slice.call(t).join(" ");
  28471. r.captureMessage(o, {
  28472. level: i,
  28473. path: e,
  28474. timestamp: n.timestamp()
  28475. })
  28476. }
  28477. }
  28478. , p = function(t, i) {
  28479. if (r) {
  28480. var o = Array.prototype.slice.call(t).join(" ");
  28481. r.captureException(new Error(o), {
  28482. level: i,
  28483. path: e,
  28484. timestamp: n.timestamp()
  28485. })
  28486. }
  28487. };
  28488. return {
  28489. debug: function() {
  28490. n.level >= n.levels.debug && t.apply(console, u(arguments))
  28491. },
  28492. info: function() {
  28493. n.level >= n.levels.info && i.apply(console, u(arguments))
  28494. },
  28495. warn: function() {
  28496. d(arguments, "warn"),
  28497. n.level >= n.levels.warn && o.apply(console, u(arguments))
  28498. },
  28499. error: function() {
  28500. p(arguments, "error"),
  28501. n.level >= n.levels.error && a.apply(console, u(arguments))
  28502. },
  28503. v3str: function(e, t) {
  28504. var i = void 0 === t ? 2 : t;
  28505. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28506. },
  28507. eulstr: function(e, t) {
  28508. var i = void 0 === t ? 2 : t;
  28509. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28510. },
  28511. time: function(e) {
  28512. n.level >= n.levels.debug && (c[e] = Date.now())
  28513. },
  28514. timeEnd: function(e) {
  28515. if (n.level >= n.levels.debug) {
  28516. var t = c[e];
  28517. if (!t)
  28518. return;
  28519. var i = (Date.now() - t) / 1e3;
  28520. this.debug(e, i + "s")
  28521. }
  28522. }
  28523. }
  28524. }
  28525. var r = window.Raven;
  28526. n.timestamp = function() {
  28527. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28528. }
  28529. ,
  28530. n.levels = {
  28531. debug: 3,
  28532. info: 2,
  28533. warn: 1,
  28534. error: 0
  28535. },
  28536. n.level = n.levels.info,
  28537. t.exports = n
  28538. }
  28539. , {}],
  28540. 190: [function(e, t, i) {//"../util/math"
  28541. "use strict";
  28542. var n = e("three")
  28543. , r = e("../enum/GLCubeFaces")
  28544. , o = e("../constants");
  28545. t.exports = {
  28546. convertVisionVector: function(e) {
  28547. return new n.Vector3(e.x,e.z,-e.y)
  28548. },
  28549. convertVisionQuaternion: function(e) {
  28550. return new n.Quaternion(e.x,e.z,-e.y,e.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(90)))
  28551. },
  28552. convertWorkshopVector: function(e) {
  28553. return new n.Vector3(-e.x,e.y,e.z)
  28554. },
  28555. convertWorkshopQuaternion: function(e) {
  28556. return new n.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  28557. },
  28558. convertWorkshopPanoramaQuaternion: function(e) {
  28559. return new n.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(270)))
  28560. },
  28561. convertWorkshopOrthoZoom: function(e) {
  28562. return e === -1 ? -1 : e / 16 * ($('#player').width() / $('#player').height()) / o.workshopApsect
  28563. },
  28564. toPrecision: function(e, t) {
  28565. var i = Math.pow(10, t);
  28566. return Math.round(e * i) / i
  28567. },
  28568. isEmptyQuaternion: function(e) {
  28569. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28570. },
  28571. projectPositionToCanvas: function(e, t, i) {
  28572. i = i || new n.Vector3,
  28573. i.copy(e);
  28574. var r = .5 * $('#player').width()
  28575. , o = .5 * $('#player').height();
  28576. return i.project(t),
  28577. i.x = i.x * r + r,
  28578. i.y = -(i.y * o) + o,
  28579. i
  28580. },
  28581. convertScreenPositionToNDC: function(e, t, i) {
  28582. return i = i || new n.Vector2,
  28583. i.x = e / $('#player').width() * 2 - 1,
  28584. i.y = 2 * -(t / $('#player').height()) + 1,
  28585. i
  28586. },
  28587. constrainedTurn: function(e) {
  28588. var t = e % (2 * Math.PI);
  28589. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28590. },
  28591. getFOVDotThreshold: function(e) {
  28592. return Math.cos(n.Math.degToRad(e / 2))
  28593. },
  28594. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28595. switch (e) {
  28596. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28597. i.set(1, t.y, t.x);
  28598. break;
  28599. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28600. i.set(-1, t.y, -t.x);
  28601. break;
  28602. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28603. i.set(-t.x, 1, -t.y);
  28604. break;
  28605. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28606. i.set(-t.x, -1, t.y);
  28607. break;
  28608. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28609. i.set(-t.x, t.y, 1);
  28610. break;
  28611. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28612. i.set(t.x, t.y, -1)
  28613. }
  28614. n && i.normalize()
  28615. }
  28616. }
  28617. }
  28618. , {
  28619. "../constants": 8,
  28620. "../enum/GLCubeFaces": 25,
  28621. three: 217
  28622. }],
  28623. 191: [function(e, t, i) {//"../util/panorama"
  28624. "use strict";
  28625. function n(e, t, i) {
  28626. return a.map(function(n, o) {
  28627. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  28628. }
  28629. .bind(this))
  28630. }
  28631. function r(e) {
  28632. return s[e]
  28633. }
  28634. var o = e("../enum/GLCubeFaces")
  28635. , a = [0, 1, 2, 3, 4, 5]
  28636. , s = {
  28637. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28638. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28639. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28640. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28641. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28642. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28643. };
  28644. t.exports = {
  28645. mapFaceToCubemapFace: r,
  28646. getCubemapUrls: n
  28647. }
  28648. }
  28649. , {
  28650. "../enum/GLCubeFaces": 25
  28651. }],
  28652. 192: [function(e, t, i) {//"./util/sentry"
  28653. "use strict";
  28654. t.exports = {
  28655. captureErrors: function(e, t, i) {
  28656. if ("Raven"in window) {
  28657. Raven.config(e, t).install(),
  28658. i && Raven.setTagsContext(i);
  28659. var n = console.warn
  28660. , r = console.error;
  28661. console.warn = function() {
  28662. var e = Array.prototype.slice.call(arguments);
  28663. Raven.captureMessage(e.join(" "), {
  28664. level: "warning"
  28665. }),
  28666. n.apply(console, e)
  28667. }
  28668. ,
  28669. console.error = function() {
  28670. var e = Array.prototype.slice.call(arguments);
  28671. Raven.captureException(new Error(e.join(" ")), {
  28672. level: "error"
  28673. }),
  28674. r.apply(console, e)
  28675. }
  28676. } else
  28677. console.error("Raven not found, not capturing errors.")
  28678. }
  28679. }
  28680. }
  28681. , {}],
  28682. 193: [function(e, t, i) {///js/util/showcase.js
  28683. (function(i) {
  28684. "use strict";
  28685. var n = e("./browser")
  28686. , r = e("../constants")
  28687. , o = e("url")
  28688. , a = e("./logger")
  28689. , s = new a(i)
  28690. , l = {
  28691. getAuthorizationHeader: function() {
  28692. var e = n.valueFromHash("auth");
  28693. if (e)
  28694. return e.replace(",", " ");
  28695. var t = n.valueFromCookie("token");
  28696. return t ? "Token " + t : null
  28697. },
  28698. parseSidUrl: function(e) {
  28699. var t, i;
  28700. if (e = e || "",
  28701. e.match(/^https?/)) {//改
  28702. var n = o.parse(e);
  28703. t = n.protocol + "//" + n.host,
  28704. i = e
  28705. } else //xzw 原先的不能用
  28706. //t = window.location.protocol + "//" + window.location.host, //MP
  28707. t = ""
  28708. //i = t + "/api/player/models/" + e; //MP
  28709. i = t + "data/" + e;
  28710. return {
  28711. urlBase: t ,
  28712. urlModel: i,
  28713. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  28714. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  28715. }
  28716. },
  28717. getModelIDFromQueryString: function() {
  28718. return n.valueFromHash("model") || n.valueFromHash("m")
  28719. },
  28720. normalizeModeldata: function(e, t) {
  28721. e = JSON.parse(JSON.stringify(e));
  28722. var i = null;
  28723. if (e.images.forEach(function(n) {
  28724. if (n.metadata && "string" == typeof n.metadata)
  28725. try {
  28726. n.metadata = JSON.parse(n.metadata)
  28727. } catch (e) {
  28728. s.warn("Unable to parse image metadata"),
  28729. n.metadata = null
  28730. }
  28731. else
  28732. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  28733. n.metadata && (n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  28734. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position)),
  28735. !i && e.icon && e.icon === n.sid && (i = n.metadata))
  28736. }),
  28737. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  28738. var n = {};
  28739. n.pano = {
  28740. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  28741. position: t.convertWorkshopVector(i.scan_position),
  28742. uuid: i.scan_id
  28743. },
  28744. n.camera = {
  28745. quaternion: i.camera_quaternion,
  28746. position: i.camera_position
  28747. },
  28748. e.startPano = n
  28749. }
  28750. return e
  28751. },
  28752. visionVersionToInt: function() {
  28753. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  28754. return function(t) {
  28755. if (!t)
  28756. throw new Error("Vision version is required");
  28757. var i = e.exec(t);
  28758. if (null === i)
  28759. throw new Error("String is not a vision version: " + t);
  28760. return parseInt(i[1])
  28761. }
  28762. }(),
  28763. modelDataPromisesTiles: function(e) {
  28764. if (e.vision_version)
  28765. try {
  28766. return l.visionVersionToInt(e.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  28767. } catch (t) {
  28768. s.warn("Invalid vision version: " + e.vision_version)
  28769. }
  28770. var t = e.created ? new Date(e.created) : null;
  28771. return t && t >= r.visionTilingStartDate
  28772. }
  28773. };
  28774. t.exports = l
  28775. }
  28776. ).call(this, "/js/util/showcase.js")
  28777. }
  28778. , {
  28779. "../constants": 8,
  28780. "./browser": 182,
  28781. "./logger": 189,
  28782. url: 208
  28783. }],
  28784. 194: [function(e, t, i) {//"../util/texture"
  28785. "use strict";
  28786. var n = e("../util/ajax")
  28787. , r = e("three")
  28788. , o = e("../settings")
  28789. , a = {};
  28790. t.exports = {
  28791. load: function(e, t, i) {
  28792. var s = a[e];
  28793. return s ? (t && setTimeout(function() {
  28794. t(s)
  28795. }, 1),
  28796. s) : (s = new r.Texture,
  28797. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  28798. s.magFilter = r.LinearFilter,
  28799. s.generateMipmaps = !1),
  28800. s.sourceFile = e,
  28801. a[e] = s,
  28802. n.getImage(e).then(function(e) {
  28803. s.image = e,
  28804. s.needsUpdate = !0,
  28805. t && t(s)
  28806. }).fail(i),
  28807. s)
  28808. },
  28809. loadBase64: function(e, t) {
  28810. t = t || "png";
  28811. var i = new r.Texture;
  28812. return i.image = document.createElement("img"),
  28813. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  28814. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  28815. i.magFilter = r.LinearFilter,
  28816. i.generateMipmaps = !1),
  28817. i.needsUpdate = !0,
  28818. i
  28819. },
  28820. isLoaded: function(e) {
  28821. return !!a[e]
  28822. }
  28823. }
  28824. }
  28825. , {
  28826. "../settings": 166,
  28827. "../util/ajax": 181,
  28828. three: 217
  28829. }],
  28830. 195: [function(e, t, i) {//"./util/transitions"
  28831. "use strict";
  28832. var n = e("./easing");
  28833. t.exports = {
  28834. globalDone: null,
  28835. funcs: [],
  28836. counter: 0,
  28837. uniqueID: 0,
  28838. start: function(e, t, i, r, o, a, s) {
  28839. return r = r || 0,
  28840. this.funcs.push({
  28841. func: e,
  28842. current: -r * Math.abs(t),
  28843. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  28844. done: i,
  28845. easing: o || n.linearTween,
  28846. cycling: t < 0,
  28847. running: !0,
  28848. debug: r < 0,
  28849. name: a || "T" + this.counter,
  28850. id: void 0 === s ? this.counter : s,
  28851. paused: !1
  28852. }),
  28853. e(0, 16),
  28854. this.counter += 1,
  28855. e
  28856. },
  28857. trigger: function(e) {
  28858. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  28859. , i = e.func || function() {}
  28860. , r = void 0 === e.duration ? 0 : e.duration;
  28861. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  28862. var o = e.done || null
  28863. , a = e.easing || n.linearTween
  28864. , s = e.name || "R" + this.counter
  28865. , l = void 0 === e.id ? this.counter : e.id;
  28866. return this.start(i, r, o, t, a, s, l)
  28867. },
  28868. setTimeout: function(e, t, i) {
  28869. var n = void 0 === i ? this.counter : i;
  28870. return this.trigger({
  28871. done: e,
  28872. duration: void 0 === t ? 0 : t,
  28873. name: "O" + this.counter,
  28874. id: n
  28875. })
  28876. },
  28877. pause: function() {
  28878. this.paused = !0
  28879. },
  28880. resume: function() {
  28881. this.paused = !1
  28882. },
  28883. update: function(e) {
  28884. this.funcs.forEach(function(t) {
  28885. if (!(t.paused || (t.current += 1e3 * e,
  28886. t.current < 0)))
  28887. if (t.current >= t.duration && !t.cycling) {
  28888. var i = t.easing(1, 0, 1, 1);
  28889. t.func(i, 1e3 * e),
  28890. t.done && t.done(),
  28891. t.running = !1
  28892. } else {
  28893. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  28894. , r = t.func(n, 1e3 * e) || !1;
  28895. r && (t.done && t.done(),
  28896. t.running = !1)
  28897. }
  28898. });
  28899. var t = this.funcs.length;
  28900. this.funcs = this.funcs.filter(function(e) {
  28901. return e.running
  28902. });
  28903. var i = this.funcs.length;
  28904. if (t > 0 && 0 === i && this.globalDone) {
  28905. var n = this.globalDone;
  28906. this.globalDone = null,
  28907. n()
  28908. }
  28909. },
  28910. adjustSpeed: function(e, t) {
  28911. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  28912. var r = i[n];
  28913. r.duration /= t,
  28914. r.current /= t
  28915. }
  28916. },
  28917. getById: function(e) {
  28918. return this.funcs.filter(function(t) {
  28919. return e === t.id
  28920. })
  28921. },
  28922. get: function(e) {
  28923. for (var t = 0; t < this.funcs.length; t += 1)
  28924. if (this.funcs[t].func === e)
  28925. return this.funcs[t];
  28926. return null
  28927. },
  28928. isRunning: function(e) {
  28929. var t = this.get(e);
  28930. return null !== t && t.running
  28931. },
  28932. countActive: function() {
  28933. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  28934. e += this.funcs[t].running;
  28935. return e
  28936. },
  28937. listActive: function() {
  28938. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  28939. this.funcs[t].running && e.push(this.funcs[t].name);
  28940. return e
  28941. },
  28942. done: function(e) {
  28943. this.globalDone = e
  28944. },
  28945. cancelById: function(e) {
  28946. var t = void 0 === e ? 0 : e;
  28947. this.funcs = this.funcs.filter(function(e) {
  28948. return e.id !== t
  28949. })
  28950. },
  28951. cancel: function(e) {
  28952. this.funcs = this.funcs.filter(function(t) {
  28953. return t.func !== e
  28954. })
  28955. },
  28956. getUniqueId: function() {
  28957. return this.uniqueID -= 1,
  28958. this.uniqueID
  28959. }
  28960. }
  28961. }
  28962. , {
  28963. "./easing": 186
  28964. }],
  28965. 196: [function(e, t, i) {//Set
  28966. function n(e) {
  28967. if (this.set = {},
  28968. this.infContains = function() {
  28969. return !0
  28970. }
  28971. ,
  28972. "object" == typeof e)
  28973. if (e instanceof Array)
  28974. for (var t = 0; t < e.length; t++)
  28975. this.set[e[t]] = !0;
  28976. else
  28977. this.set = e;
  28978. else if ("function" == typeof e)
  28979. this.infContains = e;
  28980. else if ("undefined" != typeof e)
  28981. throw new Error("set must be either an array or an object.")
  28982. }
  28983. t.exports = n,
  28984. n.prototype.contains = function(e) {
  28985. return !!this.set[e]
  28986. }
  28987. ,
  28988. n.prototype.has = n.prototype.contains,
  28989. n.prototype.add = function(e) {
  28990. if (1 == arguments.length)
  28991. this.set[e] = !0;
  28992. else
  28993. for (var t = 0; t < arguments.length; t++)
  28994. this.set[arguments[t]] = !0
  28995. }
  28996. ,
  28997. n.prototype.addAll = function(e) {
  28998. if ("object" != typeof e && !(e instanceof Array))
  28999. throw new Error("arr must be an array.");
  29000. for (var t = 0; t < e.length; t++)
  29001. this.add(e[t])
  29002. }
  29003. ,
  29004. n.prototype.remove = function(e) {
  29005. if (1 == arguments.length)
  29006. delete this.set[e];
  29007. else
  29008. for (var t = 0; t < arguments.length; t++)
  29009. delete this.set[arguments[t]]
  29010. }
  29011. ,
  29012. n.prototype.delete = n.prototype.remove,
  29013. n.prototype.clear = function() {
  29014. this.set = {}
  29015. }
  29016. ,
  29017. n.prototype.size = function() {
  29018. return Object.keys(this.set).length
  29019. }
  29020. ,
  29021. n.prototype.toString = function() {
  29022. return "{" + Object.keys(this.set).toString() + "}"
  29023. }
  29024. ,
  29025. n.prototype.toArray = function() {
  29026. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  29027. }
  29028. ,
  29029. n.prototype["*values"] = n.prototype.toArray
  29030. }
  29031. , {}],
  29032. 197: [function(e, t, i) {}//fs path ?
  29033. , {}],
  29034. 198: [function(e, t, i) {//buffer
  29035. (function(t) {
  29036. "use strict";
  29037. function n() {
  29038. try {
  29039. var e = new Uint8Array(1);
  29040. return e.__proto__ = {
  29041. __proto__: Uint8Array.prototype,
  29042. foo: function() {
  29043. return 42
  29044. }
  29045. },
  29046. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29047. } catch (e) {
  29048. return !1
  29049. }
  29050. }
  29051. function r() {
  29052. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29053. }
  29054. function o(e, t) {
  29055. if (r() < t)
  29056. throw new RangeError("Invalid typed array length");
  29057. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  29058. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  29059. e.length = t),
  29060. e
  29061. }
  29062. function a(e, t, i) {
  29063. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  29064. return new a(e,t,i);
  29065. if ("number" == typeof e) {
  29066. if ("string" == typeof t)
  29067. throw new Error("If encoding is specified then the first argument must be a string");
  29068. return h(this, e)
  29069. }
  29070. return s(this, e, t, i)
  29071. }
  29072. function s(e, t, i, n) {
  29073. if ("number" == typeof t)
  29074. throw new TypeError('"value" argument must not be a number');
  29075. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  29076. }
  29077. function l(e) {
  29078. if ("number" != typeof e)
  29079. throw new TypeError('"size" argument must be a number');
  29080. if (e < 0)
  29081. throw new RangeError('"size" argument must not be negative')
  29082. }
  29083. function c(e, t, i, n) {
  29084. return l(t),
  29085. 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)
  29086. }
  29087. function h(e, t) {
  29088. if (l(t),
  29089. e = o(e, t < 0 ? 0 : 0 | g(t)),
  29090. !a.TYPED_ARRAY_SUPPORT)
  29091. for (var i = 0; i < t; ++i)
  29092. e[i] = 0;
  29093. return e
  29094. }
  29095. function u(e, t, i) {
  29096. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29097. !a.isEncoding(i))
  29098. throw new TypeError('"encoding" must be a valid string encoding');
  29099. var n = 0 | v(t, i);
  29100. e = o(e, n);
  29101. var r = e.write(t, i);
  29102. return r !== n && (e = e.slice(0, r)),
  29103. e
  29104. }
  29105. function d(e, t) {
  29106. var i = t.length < 0 ? 0 : 0 | g(t.length);
  29107. e = o(e, i);
  29108. for (var n = 0; n < i; n += 1)
  29109. e[n] = 255 & t[n];
  29110. return e
  29111. }
  29112. function p(e, t, i, n) {
  29113. if (t.byteLength,
  29114. i < 0 || t.byteLength < i)
  29115. throw new RangeError("'offset' is out of bounds");
  29116. if (t.byteLength < i + (n || 0))
  29117. throw new RangeError("'length' is out of bounds");
  29118. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29119. a.TYPED_ARRAY_SUPPORT ? (e = t,
  29120. e.__proto__ = a.prototype) : e = d(e, t),
  29121. e
  29122. }
  29123. function f(e, t) {
  29124. if (a.isBuffer(t)) {
  29125. var i = 0 | g(t.length);
  29126. return e = o(e, i),
  29127. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  29128. e)
  29129. }
  29130. if (t) {
  29131. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29132. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  29133. if ("Buffer" === t.type && $(t.data))
  29134. return d(e, t.data)
  29135. }
  29136. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29137. }
  29138. function g(e) {
  29139. if (e >= r())
  29140. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  29141. return 0 | e
  29142. }
  29143. function m(e) {
  29144. return +e != e && (e = 0),
  29145. a.alloc(+e)
  29146. }
  29147. function v(e, t) {
  29148. if (a.isBuffer(e))
  29149. return e.length;
  29150. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29151. return e.byteLength;
  29152. "string" != typeof e && (e = "" + e);
  29153. var i = e.length;
  29154. if (0 === i)
  29155. return 0;
  29156. for (var n = !1; ; )
  29157. switch (t) {
  29158. case "ascii":
  29159. case "latin1":
  29160. case "binary":
  29161. return i;
  29162. case "utf8":
  29163. case "utf-8":
  29164. case void 0:
  29165. return j(e).length;
  29166. case "ucs2":
  29167. case "ucs-2":
  29168. case "utf16le":
  29169. case "utf-16le":
  29170. return 2 * i;
  29171. case "hex":
  29172. return i >>> 1;
  29173. case "base64":
  29174. return Z(e).length;
  29175. default:
  29176. if (n)
  29177. return j(e).length;
  29178. t = ("" + t).toLowerCase(),
  29179. n = !0
  29180. }
  29181. }
  29182. function A(e, t, i) {
  29183. var n = !1;
  29184. if ((void 0 === t || t < 0) && (t = 0),
  29185. t > this.length)
  29186. return "";
  29187. if ((void 0 === i || i > this.length) && (i = this.length),
  29188. i <= 0)
  29189. return "";
  29190. if (i >>>= 0,
  29191. t >>>= 0,
  29192. i <= t)
  29193. return "";
  29194. for (e || (e = "utf8"); ; )
  29195. switch (e) {
  29196. case "hex":
  29197. return L(this, t, i);
  29198. case "utf8":
  29199. case "utf-8":
  29200. return M(this, t, i);
  29201. case "ascii":
  29202. return P(this, t, i);
  29203. case "latin1":
  29204. case "binary":
  29205. return O(this, t, i);
  29206. case "base64":
  29207. return S(this, t, i);
  29208. case "ucs2":
  29209. case "ucs-2":
  29210. case "utf16le":
  29211. case "utf-16le":
  29212. return D(this, t, i);
  29213. default:
  29214. if (n)
  29215. throw new TypeError("Unknown encoding: " + e);
  29216. e = (e + "").toLowerCase(),
  29217. n = !0
  29218. }
  29219. }
  29220. function y(e, t, i) {
  29221. var n = e[t];
  29222. e[t] = e[i],
  29223. e[i] = n
  29224. }
  29225. function C(e, t, i, n, r) {
  29226. if (0 === e.length)
  29227. return -1;
  29228. if ("string" == typeof i ? (n = i,
  29229. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29230. i = +i,
  29231. isNaN(i) && (i = r ? 0 : e.length - 1),
  29232. i < 0 && (i = e.length + i),
  29233. i >= e.length) {
  29234. if (r)
  29235. return -1;
  29236. i = e.length - 1
  29237. } else if (i < 0) {
  29238. if (!r)
  29239. return -1;
  29240. i = 0
  29241. }
  29242. if ("string" == typeof t && (t = a.from(t, n)),
  29243. a.isBuffer(t))
  29244. return 0 === t.length ? -1 : I(e, t, i, n, r);
  29245. if ("number" == typeof t)
  29246. return t &= 255,
  29247. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  29248. throw new TypeError("val must be string, number or Buffer")
  29249. }
  29250. function I(e, t, i, n, r) {
  29251. function o(e, t) {
  29252. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  29253. }
  29254. var a = 1
  29255. , s = e.length
  29256. , l = t.length;
  29257. if (void 0 !== n && (n = String(n).toLowerCase(),
  29258. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29259. if (e.length < 2 || t.length < 2)
  29260. return -1;
  29261. a = 2,
  29262. s /= 2,
  29263. l /= 2,
  29264. i /= 2
  29265. }
  29266. var c;
  29267. if (r) {
  29268. var h = -1;
  29269. for (c = i; c < s; c++)
  29270. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  29271. if (h === -1 && (h = c),
  29272. c - h + 1 === l)
  29273. return h * a
  29274. } else
  29275. h !== -1 && (c -= c - h),
  29276. h = -1
  29277. } else
  29278. for (i + l > s && (i = s - l),
  29279. c = i; c >= 0; c--) {
  29280. for (var u = !0, d = 0; d < l; d++)
  29281. if (o(e, c + d) !== o(t, d)) {
  29282. u = !1;
  29283. break
  29284. }
  29285. if (u)
  29286. return c
  29287. }
  29288. return -1
  29289. }
  29290. function E(e, t, i, n) {
  29291. i = Number(i) || 0;
  29292. var r = e.length - i;
  29293. n ? (n = Number(n),
  29294. n > r && (n = r)) : n = r;
  29295. var o = t.length;
  29296. if (o % 2 !== 0)
  29297. throw new TypeError("Invalid hex string");
  29298. n > o / 2 && (n = o / 2);
  29299. for (var a = 0; a < n; ++a) {
  29300. var s = parseInt(t.substr(2 * a, 2), 16);
  29301. if (isNaN(s))
  29302. return a;
  29303. e[i + a] = s
  29304. }
  29305. return a
  29306. }
  29307. function b(e, t, i, n) {
  29308. return q(j(t, e.length - i), e, i, n)
  29309. }
  29310. function w(e, t, i, n) {
  29311. return q(Y(t), e, i, n)
  29312. }
  29313. function _(e, t, i, n) {
  29314. return w(e, t, i, n)
  29315. }
  29316. function T(e, t, i, n) {
  29317. return q(Z(t), e, i, n)
  29318. }
  29319. function x(e, t, i, n) {
  29320. return q(X(t, e.length - i), e, i, n)
  29321. }
  29322. function S(e, t, i) {
  29323. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  29324. }
  29325. function M(e, t, i) {
  29326. i = Math.min(e.length, i);
  29327. for (var n = [], r = t; r < i; ) {
  29328. var o = e[r]
  29329. , a = null
  29330. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  29331. if (r + s <= i) {
  29332. var l, c, h, u;
  29333. switch (s) {
  29334. case 1:
  29335. o < 128 && (a = o);
  29336. break;
  29337. case 2:
  29338. l = e[r + 1],
  29339. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  29340. u > 127 && (a = u));
  29341. break;
  29342. case 3:
  29343. l = e[r + 1],
  29344. c = e[r + 2],
  29345. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  29346. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  29347. break;
  29348. case 4:
  29349. l = e[r + 1],
  29350. c = e[r + 2],
  29351. h = e[r + 3],
  29352. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  29353. u > 65535 && u < 1114112 && (a = u))
  29354. }
  29355. }
  29356. null === a ? (a = 65533,
  29357. s = 1) : a > 65535 && (a -= 65536,
  29358. n.push(a >>> 10 & 1023 | 55296),
  29359. a = 56320 | 1023 & a),
  29360. n.push(a),
  29361. r += s
  29362. }
  29363. return R(n)
  29364. }
  29365. function R(e) {
  29366. var t = e.length;
  29367. if (t <= ee)
  29368. return String.fromCharCode.apply(String, e);
  29369. for (var i = "", n = 0; n < t; )
  29370. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  29371. return i
  29372. }
  29373. function P(e, t, i) {
  29374. var n = "";
  29375. i = Math.min(e.length, i);
  29376. for (var r = t; r < i; ++r)
  29377. n += String.fromCharCode(127 & e[r]);
  29378. return n
  29379. }
  29380. function O(e, t, i) {
  29381. var n = "";
  29382. i = Math.min(e.length, i);
  29383. for (var r = t; r < i; ++r)
  29384. n += String.fromCharCode(e[r]);
  29385. return n
  29386. }
  29387. function L(e, t, i) {
  29388. var n = e.length;
  29389. (!t || t < 0) && (t = 0),
  29390. (!i || i < 0 || i > n) && (i = n);
  29391. for (var r = "", o = t; o < i; ++o)
  29392. r += W(e[o]);
  29393. return r
  29394. }
  29395. function D(e, t, i) {
  29396. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29397. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29398. return r
  29399. }
  29400. function N(e, t, i) {
  29401. if (e % 1 !== 0 || e < 0)
  29402. throw new RangeError("offset is not uint");
  29403. if (e + t > i)
  29404. throw new RangeError("Trying to access beyond buffer length")
  29405. }
  29406. function B(e, t, i, n, r, o) {
  29407. if (!a.isBuffer(e))
  29408. throw new TypeError('"buffer" argument must be a Buffer instance');
  29409. if (t > r || t < o)
  29410. throw new RangeError('"value" argument is out of bounds');
  29411. if (i + n > e.length)
  29412. throw new RangeError("Index out of range")
  29413. }
  29414. function F(e, t, i, n) {
  29415. t < 0 && (t = 65535 + t + 1);
  29416. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29417. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29418. }
  29419. function V(e, t, i, n) {
  29420. t < 0 && (t = 4294967295 + t + 1);
  29421. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29422. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29423. }
  29424. function U(e, t, i, n, r, o) {
  29425. if (i + n > e.length)
  29426. throw new RangeError("Index out of range");
  29427. if (i < 0)
  29428. throw new RangeError("Index out of range")
  29429. }
  29430. function k(e, t, i, n, r) {
  29431. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  29432. J.write(e, t, i, n, 23, 4),
  29433. i + 4
  29434. }
  29435. function H(e, t, i, n, r) {
  29436. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  29437. J.write(e, t, i, n, 52, 8),
  29438. i + 8
  29439. }
  29440. function G(e) {
  29441. if (e = z(e).replace(te, ""),
  29442. e.length < 2)
  29443. return "";
  29444. for (; e.length % 4 !== 0; )
  29445. e += "=";
  29446. return e
  29447. }
  29448. function z(e) {
  29449. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29450. }
  29451. function W(e) {
  29452. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  29453. }
  29454. function j(e, t) {
  29455. t = t || 1 / 0;
  29456. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29457. if (i = e.charCodeAt(a),
  29458. i > 55295 && i < 57344) {
  29459. if (!r) {
  29460. if (i > 56319) {
  29461. (t -= 3) > -1 && o.push(239, 191, 189);
  29462. continue
  29463. }
  29464. if (a + 1 === n) {
  29465. (t -= 3) > -1 && o.push(239, 191, 189);
  29466. continue
  29467. }
  29468. r = i;
  29469. continue
  29470. }
  29471. if (i < 56320) {
  29472. (t -= 3) > -1 && o.push(239, 191, 189),
  29473. r = i;
  29474. continue
  29475. }
  29476. i = (r - 55296 << 10 | i - 56320) + 65536
  29477. } else
  29478. r && (t -= 3) > -1 && o.push(239, 191, 189);
  29479. if (r = null,
  29480. i < 128) {
  29481. if ((t -= 1) < 0)
  29482. break;
  29483. o.push(i)
  29484. } else if (i < 2048) {
  29485. if ((t -= 2) < 0)
  29486. break;
  29487. o.push(i >> 6 | 192, 63 & i | 128)
  29488. } else if (i < 65536) {
  29489. if ((t -= 3) < 0)
  29490. break;
  29491. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29492. } else {
  29493. if (!(i < 1114112))
  29494. throw new Error("Invalid code point");
  29495. if ((t -= 4) < 0)
  29496. break;
  29497. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29498. }
  29499. }
  29500. return o
  29501. }
  29502. function Y(e) {
  29503. for (var t = [], i = 0; i < e.length; ++i)
  29504. t.push(255 & e.charCodeAt(i));
  29505. return t
  29506. }
  29507. function X(e, t) {
  29508. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29509. i = e.charCodeAt(a),
  29510. n = i >> 8,
  29511. r = i % 256,
  29512. o.push(r),
  29513. o.push(n);
  29514. return o
  29515. }
  29516. function Z(e) {
  29517. return Q.toByteArray(G(e))
  29518. }
  29519. function q(e, t, i, n) {
  29520. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29521. t[r + i] = e[r];
  29522. return r
  29523. }
  29524. function K(e) {
  29525. return e !== e
  29526. }
  29527. var Q = e("base64-js")
  29528. , J = e("ieee754")
  29529. , $ = e("isarray");
  29530. i.Buffer = a,
  29531. i.SlowBuffer = m,
  29532. i.INSPECT_MAX_BYTES = 50,
  29533. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  29534. i.kMaxLength = r(),
  29535. a.poolSize = 8192,
  29536. a._augment = function(e) {
  29537. return e.__proto__ = a.prototype,
  29538. e
  29539. }
  29540. ,
  29541. a.from = function(e, t, i) {
  29542. return s(null, e, t, i)
  29543. }
  29544. ,
  29545. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  29546. a.__proto__ = Uint8Array,
  29547. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  29548. value: null,
  29549. configurable: !0
  29550. })),
  29551. a.alloc = function(e, t, i) {
  29552. return c(null, e, t, i)
  29553. }
  29554. ,
  29555. a.allocUnsafe = function(e) {
  29556. return h(null, e)
  29557. }
  29558. ,
  29559. a.allocUnsafeSlow = function(e) {
  29560. return h(null, e)
  29561. }
  29562. ,
  29563. a.isBuffer = function(e) {
  29564. return !(null == e || !e._isBuffer)
  29565. }
  29566. ,
  29567. a.compare = function(e, t) {
  29568. if (!a.isBuffer(e) || !a.isBuffer(t))
  29569. throw new TypeError("Arguments must be Buffers");
  29570. if (e === t)
  29571. return 0;
  29572. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29573. if (e[r] !== t[r]) {
  29574. i = e[r],
  29575. n = t[r];
  29576. break
  29577. }
  29578. return i < n ? -1 : n < i ? 1 : 0
  29579. }
  29580. ,
  29581. a.isEncoding = function(e) {
  29582. switch (String(e).toLowerCase()) {
  29583. case "hex":
  29584. case "utf8":
  29585. case "utf-8":
  29586. case "ascii":
  29587. case "latin1":
  29588. case "binary":
  29589. case "base64":
  29590. case "ucs2":
  29591. case "ucs-2":
  29592. case "utf16le":
  29593. case "utf-16le":
  29594. return !0;
  29595. default:
  29596. return !1
  29597. }
  29598. }
  29599. ,
  29600. a.concat = function(e, t) {
  29601. if (!$(e))
  29602. throw new TypeError('"list" argument must be an Array of Buffers');
  29603. if (0 === e.length)
  29604. return a.alloc(0);
  29605. var i;
  29606. if (void 0 === t)
  29607. for (t = 0,
  29608. i = 0; i < e.length; ++i)
  29609. t += e[i].length;
  29610. var n = a.allocUnsafe(t)
  29611. , r = 0;
  29612. for (i = 0; i < e.length; ++i) {
  29613. var o = e[i];
  29614. if (!a.isBuffer(o))
  29615. throw new TypeError('"list" argument must be an Array of Buffers');
  29616. o.copy(n, r),
  29617. r += o.length
  29618. }
  29619. return n
  29620. }
  29621. ,
  29622. a.byteLength = v,
  29623. a.prototype._isBuffer = !0,
  29624. a.prototype.swap16 = function() {
  29625. var e = this.length;
  29626. if (e % 2 !== 0)
  29627. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29628. for (var t = 0; t < e; t += 2)
  29629. y(this, t, t + 1);
  29630. return this
  29631. }
  29632. ,
  29633. a.prototype.swap32 = function() {
  29634. var e = this.length;
  29635. if (e % 4 !== 0)
  29636. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29637. for (var t = 0; t < e; t += 4)
  29638. y(this, t, t + 3),
  29639. y(this, t + 1, t + 2);
  29640. return this
  29641. }
  29642. ,
  29643. a.prototype.swap64 = function() {
  29644. var e = this.length;
  29645. if (e % 8 !== 0)
  29646. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29647. for (var t = 0; t < e; t += 8)
  29648. y(this, t, t + 7),
  29649. y(this, t + 1, t + 6),
  29650. y(this, t + 2, t + 5),
  29651. y(this, t + 3, t + 4);
  29652. return this
  29653. }
  29654. ,
  29655. a.prototype.toString = function() {
  29656. var e = 0 | this.length;
  29657. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  29658. }
  29659. ,
  29660. a.prototype.equals = function(e) {
  29661. if (!a.isBuffer(e))
  29662. throw new TypeError("Argument must be a Buffer");
  29663. return this === e || 0 === a.compare(this, e)
  29664. }
  29665. ,
  29666. a.prototype.inspect = function() {
  29667. var e = ""
  29668. , t = i.INSPECT_MAX_BYTES;
  29669. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29670. this.length > t && (e += " ... ")),
  29671. "<Buffer " + e + ">"
  29672. }
  29673. ,
  29674. a.prototype.compare = function(e, t, i, n, r) {
  29675. if (!a.isBuffer(e))
  29676. throw new TypeError("Argument must be a Buffer");
  29677. if (void 0 === t && (t = 0),
  29678. void 0 === i && (i = e ? e.length : 0),
  29679. void 0 === n && (n = 0),
  29680. void 0 === r && (r = this.length),
  29681. t < 0 || i > e.length || n < 0 || r > this.length)
  29682. throw new RangeError("out of range index");
  29683. if (n >= r && t >= i)
  29684. return 0;
  29685. if (n >= r)
  29686. return -1;
  29687. if (t >= i)
  29688. return 1;
  29689. if (t >>>= 0,
  29690. i >>>= 0,
  29691. n >>>= 0,
  29692. r >>>= 0,
  29693. this === e)
  29694. return 0;
  29695. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  29696. if (c[u] !== h[u]) {
  29697. o = c[u],
  29698. s = h[u];
  29699. break
  29700. }
  29701. return o < s ? -1 : s < o ? 1 : 0
  29702. }
  29703. ,
  29704. a.prototype.includes = function(e, t, i) {
  29705. return this.indexOf(e, t, i) !== -1
  29706. }
  29707. ,
  29708. a.prototype.indexOf = function(e, t, i) {
  29709. return C(this, e, t, i, !0)
  29710. }
  29711. ,
  29712. a.prototype.lastIndexOf = function(e, t, i) {
  29713. return C(this, e, t, i, !1)
  29714. }
  29715. ,
  29716. a.prototype.write = function(e, t, i, n) {
  29717. if (void 0 === t)
  29718. n = "utf8",
  29719. i = this.length,
  29720. t = 0;
  29721. else if (void 0 === i && "string" == typeof t)
  29722. n = t,
  29723. i = this.length,
  29724. t = 0;
  29725. else {
  29726. if (!isFinite(t))
  29727. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  29728. t |= 0,
  29729. isFinite(i) ? (i |= 0,
  29730. void 0 === n && (n = "utf8")) : (n = i,
  29731. i = void 0)
  29732. }
  29733. var r = this.length - t;
  29734. if ((void 0 === i || i > r) && (i = r),
  29735. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  29736. throw new RangeError("Attempt to write outside buffer bounds");
  29737. n || (n = "utf8");
  29738. for (var o = !1; ; )
  29739. switch (n) {
  29740. case "hex":
  29741. return E(this, e, t, i);
  29742. case "utf8":
  29743. case "utf-8":
  29744. return b(this, e, t, i);
  29745. case "ascii":
  29746. return w(this, e, t, i);
  29747. case "latin1":
  29748. case "binary":
  29749. return _(this, e, t, i);
  29750. case "base64":
  29751. return T(this, e, t, i);
  29752. case "ucs2":
  29753. case "ucs-2":
  29754. case "utf16le":
  29755. case "utf-16le":
  29756. return x(this, e, t, i);
  29757. default:
  29758. if (o)
  29759. throw new TypeError("Unknown encoding: " + n);
  29760. n = ("" + n).toLowerCase(),
  29761. o = !0
  29762. }
  29763. }
  29764. ,
  29765. a.prototype.toJSON = function() {
  29766. return {
  29767. type: "Buffer",
  29768. data: Array.prototype.slice.call(this._arr || this, 0)
  29769. }
  29770. }
  29771. ;
  29772. var ee = 4096;
  29773. a.prototype.slice = function(e, t) {
  29774. var i = this.length;
  29775. e = ~~e,
  29776. t = void 0 === t ? i : ~~t,
  29777. e < 0 ? (e += i,
  29778. e < 0 && (e = 0)) : e > i && (e = i),
  29779. t < 0 ? (t += i,
  29780. t < 0 && (t = 0)) : t > i && (t = i),
  29781. t < e && (t = e);
  29782. var n;
  29783. if (a.TYPED_ARRAY_SUPPORT)
  29784. n = this.subarray(e, t),
  29785. n.__proto__ = a.prototype;
  29786. else {
  29787. var r = t - e;
  29788. n = new a(r,void 0);
  29789. for (var o = 0; o < r; ++o)
  29790. n[o] = this[o + e]
  29791. }
  29792. return n
  29793. }
  29794. ,
  29795. a.prototype.readUIntLE = function(e, t, i) {
  29796. e |= 0,
  29797. t |= 0,
  29798. i || N(e, t, this.length);
  29799. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29800. n += this[e + o] * r;
  29801. return n
  29802. }
  29803. ,
  29804. a.prototype.readUIntBE = function(e, t, i) {
  29805. e |= 0,
  29806. t |= 0,
  29807. i || N(e, t, this.length);
  29808. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  29809. n += this[e + --t] * r;
  29810. return n
  29811. }
  29812. ,
  29813. a.prototype.readUInt8 = function(e, t) {
  29814. return t || N(e, 1, this.length),
  29815. this[e]
  29816. }
  29817. ,
  29818. a.prototype.readUInt16LE = function(e, t) {
  29819. return t || N(e, 2, this.length),
  29820. this[e] | this[e + 1] << 8
  29821. }
  29822. ,
  29823. a.prototype.readUInt16BE = function(e, t) {
  29824. return t || N(e, 2, this.length),
  29825. this[e] << 8 | this[e + 1]
  29826. }
  29827. ,
  29828. a.prototype.readUInt32LE = function(e, t) {
  29829. return t || N(e, 4, this.length),
  29830. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  29831. }
  29832. ,
  29833. a.prototype.readUInt32BE = function(e, t) {
  29834. return t || N(e, 4, this.length),
  29835. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  29836. }
  29837. ,
  29838. a.prototype.readIntLE = function(e, t, i) {
  29839. e |= 0,
  29840. t |= 0,
  29841. i || N(e, t, this.length);
  29842. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29843. n += this[e + o] * r;
  29844. return r *= 128,
  29845. n >= r && (n -= Math.pow(2, 8 * t)),
  29846. n
  29847. }
  29848. ,
  29849. a.prototype.readIntBE = function(e, t, i) {
  29850. e |= 0,
  29851. t |= 0,
  29852. i || N(e, t, this.length);
  29853. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  29854. o += this[e + --n] * r;
  29855. return r *= 128,
  29856. o >= r && (o -= Math.pow(2, 8 * t)),
  29857. o
  29858. }
  29859. ,
  29860. a.prototype.readInt8 = function(e, t) {
  29861. return t || N(e, 1, this.length),
  29862. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  29863. }
  29864. ,
  29865. a.prototype.readInt16LE = function(e, t) {
  29866. t || N(e, 2, this.length);
  29867. var i = this[e] | this[e + 1] << 8;
  29868. return 32768 & i ? 4294901760 | i : i
  29869. }
  29870. ,
  29871. a.prototype.readInt16BE = function(e, t) {
  29872. t || N(e, 2, this.length);
  29873. var i = this[e + 1] | this[e] << 8;
  29874. return 32768 & i ? 4294901760 | i : i
  29875. }
  29876. ,
  29877. a.prototype.readInt32LE = function(e, t) {
  29878. return t || N(e, 4, this.length),
  29879. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  29880. }
  29881. ,
  29882. a.prototype.readInt32BE = function(e, t) {
  29883. return t || N(e, 4, this.length),
  29884. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  29885. }
  29886. ,
  29887. a.prototype.readFloatLE = function(e, t) {
  29888. return t || N(e, 4, this.length),
  29889. J.read(this, e, !0, 23, 4)
  29890. }
  29891. ,
  29892. a.prototype.readFloatBE = function(e, t) {
  29893. return t || N(e, 4, this.length),
  29894. J.read(this, e, !1, 23, 4)
  29895. }
  29896. ,
  29897. a.prototype.readDoubleLE = function(e, t) {
  29898. return t || N(e, 8, this.length),
  29899. J.read(this, e, !0, 52, 8)
  29900. }
  29901. ,
  29902. a.prototype.readDoubleBE = function(e, t) {
  29903. return t || N(e, 8, this.length),
  29904. J.read(this, e, !1, 52, 8)
  29905. }
  29906. ,
  29907. a.prototype.writeUIntLE = function(e, t, i, n) {
  29908. if (e = +e,
  29909. t |= 0,
  29910. i |= 0,
  29911. !n) {
  29912. var r = Math.pow(2, 8 * i) - 1;
  29913. B(this, e, t, i, r, 0)
  29914. }
  29915. var o = 1
  29916. , a = 0;
  29917. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  29918. this[t + a] = e / o & 255;
  29919. return t + i
  29920. }
  29921. ,
  29922. a.prototype.writeUIntBE = function(e, t, i, n) {
  29923. if (e = +e,
  29924. t |= 0,
  29925. i |= 0,
  29926. !n) {
  29927. var r = Math.pow(2, 8 * i) - 1;
  29928. B(this, e, t, i, r, 0)
  29929. }
  29930. var o = i - 1
  29931. , a = 1;
  29932. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  29933. this[t + o] = e / a & 255;
  29934. return t + i
  29935. }
  29936. ,
  29937. a.prototype.writeUInt8 = function(e, t, i) {
  29938. return e = +e,
  29939. t |= 0,
  29940. i || B(this, e, t, 1, 255, 0),
  29941. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  29942. this[t] = 255 & e,
  29943. t + 1
  29944. }
  29945. ,
  29946. a.prototype.writeUInt16LE = function(e, t, i) {
  29947. return e = +e,
  29948. t |= 0,
  29949. i || B(this, e, t, 2, 65535, 0),
  29950. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  29951. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  29952. t + 2
  29953. }
  29954. ,
  29955. a.prototype.writeUInt16BE = function(e, t, i) {
  29956. return e = +e,
  29957. t |= 0,
  29958. i || B(this, e, t, 2, 65535, 0),
  29959. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  29960. this[t + 1] = 255 & e) : F(this, e, t, !1),
  29961. t + 2
  29962. }
  29963. ,
  29964. a.prototype.writeUInt32LE = function(e, t, i) {
  29965. return e = +e,
  29966. t |= 0,
  29967. i || B(this, e, t, 4, 4294967295, 0),
  29968. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  29969. this[t + 2] = e >>> 16,
  29970. this[t + 1] = e >>> 8,
  29971. this[t] = 255 & e) : V(this, e, t, !0),
  29972. t + 4
  29973. }
  29974. ,
  29975. a.prototype.writeUInt32BE = function(e, t, i) {
  29976. return e = +e,
  29977. t |= 0,
  29978. i || B(this, e, t, 4, 4294967295, 0),
  29979. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  29980. this[t + 1] = e >>> 16,
  29981. this[t + 2] = e >>> 8,
  29982. this[t + 3] = 255 & e) : V(this, e, t, !1),
  29983. t + 4
  29984. }
  29985. ,
  29986. a.prototype.writeIntLE = function(e, t, i, n) {
  29987. if (e = +e,
  29988. t |= 0,
  29989. !n) {
  29990. var r = Math.pow(2, 8 * i - 1);
  29991. B(this, e, t, i, r - 1, -r)
  29992. }
  29993. var o = 0
  29994. , a = 1
  29995. , s = 0;
  29996. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  29997. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  29998. this[t + o] = (e / a >> 0) - s & 255;
  29999. return t + i
  30000. }
  30001. ,
  30002. a.prototype.writeIntBE = function(e, t, i, n) {
  30003. if (e = +e,
  30004. t |= 0,
  30005. !n) {
  30006. var r = Math.pow(2, 8 * i - 1);
  30007. B(this, e, t, i, r - 1, -r)
  30008. }
  30009. var o = i - 1
  30010. , a = 1
  30011. , s = 0;
  30012. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30013. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30014. this[t + o] = (e / a >> 0) - s & 255;
  30015. return t + i
  30016. }
  30017. ,
  30018. a.prototype.writeInt8 = function(e, t, i) {
  30019. return e = +e,
  30020. t |= 0,
  30021. i || B(this, e, t, 1, 127, -128),
  30022. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30023. e < 0 && (e = 255 + e + 1),
  30024. this[t] = 255 & e,
  30025. t + 1
  30026. }
  30027. ,
  30028. a.prototype.writeInt16LE = function(e, t, i) {
  30029. return e = +e,
  30030. t |= 0,
  30031. i || B(this, e, t, 2, 32767, -32768),
  30032. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30033. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30034. t + 2
  30035. }
  30036. ,
  30037. a.prototype.writeInt16BE = function(e, t, i) {
  30038. return e = +e,
  30039. t |= 0,
  30040. i || B(this, e, t, 2, 32767, -32768),
  30041. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30042. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30043. t + 2
  30044. }
  30045. ,
  30046. a.prototype.writeInt32LE = function(e, t, i) {
  30047. return e = +e,
  30048. t |= 0,
  30049. i || B(this, e, t, 4, 2147483647, -2147483648),
  30050. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30051. this[t + 1] = e >>> 8,
  30052. this[t + 2] = e >>> 16,
  30053. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  30054. t + 4
  30055. }
  30056. ,
  30057. a.prototype.writeInt32BE = function(e, t, i) {
  30058. return e = +e,
  30059. t |= 0,
  30060. i || B(this, e, t, 4, 2147483647, -2147483648),
  30061. e < 0 && (e = 4294967295 + e + 1),
  30062. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30063. this[t + 1] = e >>> 16,
  30064. this[t + 2] = e >>> 8,
  30065. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30066. t + 4
  30067. }
  30068. ,
  30069. a.prototype.writeFloatLE = function(e, t, i) {
  30070. return k(this, e, t, !0, i)
  30071. }
  30072. ,
  30073. a.prototype.writeFloatBE = function(e, t, i) {
  30074. return k(this, e, t, !1, i)
  30075. }
  30076. ,
  30077. a.prototype.writeDoubleLE = function(e, t, i) {
  30078. return H(this, e, t, !0, i)
  30079. }
  30080. ,
  30081. a.prototype.writeDoubleBE = function(e, t, i) {
  30082. return H(this, e, t, !1, i)
  30083. }
  30084. ,
  30085. a.prototype.copy = function(e, t, i, n) {
  30086. if (i || (i = 0),
  30087. n || 0 === n || (n = this.length),
  30088. t >= e.length && (t = e.length),
  30089. t || (t = 0),
  30090. n > 0 && n < i && (n = i),
  30091. n === i)
  30092. return 0;
  30093. if (0 === e.length || 0 === this.length)
  30094. return 0;
  30095. if (t < 0)
  30096. throw new RangeError("targetStart out of bounds");
  30097. if (i < 0 || i >= this.length)
  30098. throw new RangeError("sourceStart out of bounds");
  30099. if (n < 0)
  30100. throw new RangeError("sourceEnd out of bounds");
  30101. n > this.length && (n = this.length),
  30102. e.length - t < n - i && (n = e.length - t + i);
  30103. var r, o = n - i;
  30104. if (this === e && i < t && t < n)
  30105. for (r = o - 1; r >= 0; --r)
  30106. e[r + t] = this[r + i];
  30107. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  30108. for (r = 0; r < o; ++r)
  30109. e[r + t] = this[r + i];
  30110. else
  30111. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30112. return o
  30113. }
  30114. ,
  30115. a.prototype.fill = function(e, t, i, n) {
  30116. if ("string" == typeof e) {
  30117. if ("string" == typeof t ? (n = t,
  30118. t = 0,
  30119. i = this.length) : "string" == typeof i && (n = i,
  30120. i = this.length),
  30121. 1 === e.length) {
  30122. var r = e.charCodeAt(0);
  30123. r < 256 && (e = r)
  30124. }
  30125. if (void 0 !== n && "string" != typeof n)
  30126. throw new TypeError("encoding must be a string");
  30127. if ("string" == typeof n && !a.isEncoding(n))
  30128. throw new TypeError("Unknown encoding: " + n)
  30129. } else
  30130. "number" == typeof e && (e &= 255);
  30131. if (t < 0 || this.length < t || this.length < i)
  30132. throw new RangeError("Out of range index");
  30133. if (i <= t)
  30134. return this;
  30135. t >>>= 0,
  30136. i = void 0 === i ? this.length : i >>> 0,
  30137. e || (e = 0);
  30138. var o;
  30139. if ("number" == typeof e)
  30140. for (o = t; o < i; ++o)
  30141. this[o] = e;
  30142. else {
  30143. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  30144. , l = s.length;
  30145. for (o = 0; o < i - t; ++o)
  30146. this[o + t] = s[o % l]
  30147. }
  30148. return this
  30149. }
  30150. ;
  30151. var te = /[^+\/0-9A-Za-z-_]/g
  30152. }
  30153. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30154. }
  30155. , {
  30156. "base64-js": 199,
  30157. ieee754: 200,
  30158. isarray: 201
  30159. }],
  30160. 199: [function(e, t, i) {//base64-js
  30161. "use strict";
  30162. function n(e) {
  30163. var t = e.length;
  30164. if (t % 4 > 0)
  30165. throw new Error("Invalid string. Length must be a multiple of 4");
  30166. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30167. }
  30168. function r(e) {
  30169. return 3 * e.length / 4 - n(e)
  30170. }
  30171. function o(e) {
  30172. var t, i, r, o, a, s, l = e.length;
  30173. a = n(e),
  30174. s = new u(3 * l / 4 - a),
  30175. r = a > 0 ? l - 4 : l;
  30176. var c = 0;
  30177. for (t = 0,
  30178. i = 0; t < r; t += 4,
  30179. i += 3)
  30180. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  30181. s[c++] = o >> 16 & 255,
  30182. s[c++] = o >> 8 & 255,
  30183. s[c++] = 255 & o;
  30184. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  30185. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  30186. s[c++] = o >> 8 & 255,
  30187. s[c++] = 255 & o),
  30188. s
  30189. }
  30190. function a(e) {
  30191. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  30192. }
  30193. function s(e, t, i) {
  30194. for (var n, r = [], o = t; o < i; o += 3)
  30195. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30196. r.push(a(n));
  30197. return r.join("")
  30198. }
  30199. function l(e) {
  30200. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  30201. o.push(s(e, l, l + a > h ? h : l + a));
  30202. return 1 === n ? (t = e[i - 1],
  30203. r += c[t >> 2],
  30204. r += c[t << 4 & 63],
  30205. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  30206. r += c[t >> 10],
  30207. r += c[t >> 4 & 63],
  30208. r += c[t << 2 & 63],
  30209. r += "="),
  30210. o.push(r),
  30211. o.join("")
  30212. }
  30213. i.byteLength = r,
  30214. i.toByteArray = o,
  30215. i.fromByteArray = l;
  30216. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  30217. c[p] = d[p],
  30218. h[d.charCodeAt(p)] = p;
  30219. h["-".charCodeAt(0)] = 62,
  30220. h["_".charCodeAt(0)] = 63
  30221. }
  30222. , {}],
  30223. 200: [function(e, t, i) {//ieee754
  30224. i.read = function(e, t, i, n, r) {
  30225. 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];
  30226. for (u += d,
  30227. o = p & (1 << -h) - 1,
  30228. p >>= -h,
  30229. h += s; h > 0; o = 256 * o + e[t + u],
  30230. u += d,
  30231. h -= 8)
  30232. ;
  30233. for (a = o & (1 << -h) - 1,
  30234. o >>= -h,
  30235. h += n; h > 0; a = 256 * a + e[t + u],
  30236. u += d,
  30237. h -= 8)
  30238. ;
  30239. if (0 === o)
  30240. o = 1 - c;
  30241. else {
  30242. if (o === l)
  30243. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  30244. a += Math.pow(2, n),
  30245. o -= c
  30246. }
  30247. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30248. }
  30249. ,
  30250. i.write = function(e, t, i, n, r, o) {
  30251. 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;
  30252. for (t = Math.abs(t),
  30253. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30254. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30255. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30256. l *= 2),
  30257. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  30258. t * l >= 2 && (a++,
  30259. l /= 2),
  30260. a + u >= h ? (s = 0,
  30261. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  30262. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30263. a = 0)); r >= 8; e[i + p] = 255 & s,
  30264. p += f,
  30265. s /= 256,
  30266. r -= 8)
  30267. ;
  30268. for (a = a << r | s,
  30269. c += r; c > 0; e[i + p] = 255 & a,
  30270. p += f,
  30271. a /= 256,
  30272. c -= 8)
  30273. ;
  30274. e[i + p - f] |= 128 * g
  30275. }
  30276. }
  30277. , {}],
  30278. 201: [function(e, t, i) {//isarray
  30279. var n = {}.toString;
  30280. t.exports = Array.isArray || function(e) {
  30281. return "[object Array]" == n.call(e)
  30282. }
  30283. }
  30284. , {}],
  30285. 202: [function(e, t, i) {//events
  30286. function n() {
  30287. this._events = this._events || {},
  30288. this._maxListeners = this._maxListeners || void 0
  30289. }
  30290. function r(e) {
  30291. return "function" == typeof e
  30292. }
  30293. function o(e) {
  30294. return "number" == typeof e
  30295. }
  30296. function a(e) {
  30297. return "object" == typeof e && null !== e
  30298. }
  30299. function s(e) {
  30300. return void 0 === e
  30301. }
  30302. t.exports = n,
  30303. n.EventEmitter = n,
  30304. n.prototype._events = void 0,
  30305. n.prototype._maxListeners = void 0,
  30306. n.defaultMaxListeners = 10,
  30307. n.prototype.setMaxListeners = function(e) {
  30308. if (!o(e) || e < 0 || isNaN(e))
  30309. throw TypeError("n must be a positive number");
  30310. return this._maxListeners = e,
  30311. this
  30312. }
  30313. ,
  30314. n.prototype.emit = function(e) {
  30315. var t, i, n, o, l, c;
  30316. if (this._events || (this._events = {}),
  30317. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  30318. if (t = arguments[1],
  30319. t instanceof Error)
  30320. throw t;
  30321. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30322. throw h.context = t,
  30323. h
  30324. }
  30325. if (i = this._events[e],
  30326. s(i))
  30327. return !1;
  30328. if (r(i))
  30329. switch (arguments.length) {
  30330. case 1:
  30331. i.call(this);
  30332. break;
  30333. case 2:
  30334. i.call(this, arguments[1]);
  30335. break;
  30336. case 3:
  30337. i.call(this, arguments[1], arguments[2]);
  30338. break;
  30339. default:
  30340. o = Array.prototype.slice.call(arguments, 1),
  30341. i.apply(this, o)
  30342. }
  30343. else if (a(i))
  30344. for (o = Array.prototype.slice.call(arguments, 1),
  30345. c = i.slice(),
  30346. n = c.length,
  30347. l = 0; l < n; l++)
  30348. c[l].apply(this, o);
  30349. return !0
  30350. }
  30351. ,
  30352. n.prototype.addListener = function(e, t) {
  30353. var i;
  30354. if (!r(t))
  30355. throw TypeError("listener must be a function");
  30356. return this._events || (this._events = {}),
  30357. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  30358. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30359. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  30360. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  30361. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30362. "function" == typeof console.trace && console.trace())),
  30363. this
  30364. }
  30365. ,
  30366. n.prototype.on = n.prototype.addListener,
  30367. n.prototype.once = function(e, t) {
  30368. function i() {
  30369. this.removeListener(e, i),
  30370. n || (n = !0,
  30371. t.apply(this, arguments))
  30372. }
  30373. if (!r(t))
  30374. throw TypeError("listener must be a function");
  30375. var n = !1;
  30376. return i.listener = t,
  30377. this.on(e, i),
  30378. this
  30379. }
  30380. ,
  30381. n.prototype.removeListener = function(e, t) {
  30382. var i, n, o, s;
  30383. if (!r(t))
  30384. throw TypeError("listener must be a function");
  30385. if (!this._events || !this._events[e])
  30386. return this;
  30387. if (i = this._events[e],
  30388. o = i.length,
  30389. n = -1,
  30390. i === t || r(i.listener) && i.listener === t)
  30391. delete this._events[e],
  30392. this._events.removeListener && this.emit("removeListener", e, t);
  30393. else if (a(i)) {
  30394. for (s = o; s-- > 0; )
  30395. if (i[s] === t || i[s].listener && i[s].listener === t) {
  30396. n = s;
  30397. break
  30398. }
  30399. if (n < 0)
  30400. return this;
  30401. 1 === i.length ? (i.length = 0,
  30402. delete this._events[e]) : i.splice(n, 1),
  30403. this._events.removeListener && this.emit("removeListener", e, t)
  30404. }
  30405. return this
  30406. }
  30407. ,
  30408. n.prototype.removeAllListeners = function(e) {
  30409. var t, i;
  30410. if (!this._events)
  30411. return this;
  30412. if (!this._events.removeListener)
  30413. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30414. this;
  30415. if (0 === arguments.length) {
  30416. for (t in this._events)
  30417. "removeListener" !== t && this.removeAllListeners(t);
  30418. return this.removeAllListeners("removeListener"),
  30419. this._events = {},
  30420. this
  30421. }
  30422. if (i = this._events[e],
  30423. r(i))
  30424. this.removeListener(e, i);
  30425. else if (i)
  30426. for (; i.length; )
  30427. this.removeListener(e, i[i.length - 1]);
  30428. return delete this._events[e],
  30429. this
  30430. }
  30431. ,
  30432. n.prototype.listeners = function(e) {
  30433. var t;
  30434. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30435. }
  30436. ,
  30437. n.prototype.listenerCount = function(e) {
  30438. if (this._events) {
  30439. var t = this._events[e];
  30440. if (r(t))
  30441. return 1;
  30442. if (t)
  30443. return t.length
  30444. }
  30445. return 0
  30446. }
  30447. ,
  30448. n.listenerCount = function(e, t) {
  30449. return e.listenerCount(t)
  30450. }
  30451. }
  30452. , {}],
  30453. 203: [function(e, t, i) {//_process
  30454. function n() {
  30455. throw new Error("setTimeout has not been defined")
  30456. }
  30457. function r() {
  30458. throw new Error("clearTimeout has not been defined")
  30459. }
  30460. function o(e) {
  30461. if (u === setTimeout)
  30462. return setTimeout(e, 0);
  30463. if ((u === n || !u) && setTimeout)
  30464. return u = setTimeout,
  30465. setTimeout(e, 0);
  30466. try {
  30467. return u(e, 0)
  30468. } catch (t) {
  30469. try {
  30470. return u.call(null, e, 0)
  30471. } catch (t) {
  30472. return u.call(this, e, 0)
  30473. }
  30474. }
  30475. }
  30476. function a(e) {
  30477. if (d === clearTimeout)
  30478. return clearTimeout(e);
  30479. if ((d === r || !d) && clearTimeout)
  30480. return d = clearTimeout,
  30481. clearTimeout(e);
  30482. try {
  30483. return d(e)
  30484. } catch (t) {
  30485. try {
  30486. return d.call(null, e)
  30487. } catch (t) {
  30488. return d.call(this, e)
  30489. }
  30490. }
  30491. }
  30492. function s() {
  30493. m && f && (m = !1,
  30494. f.length ? g = f.concat(g) : v = -1,
  30495. g.length && l())
  30496. }
  30497. function l() {
  30498. if (!m) {
  30499. var e = o(s);
  30500. m = !0;
  30501. for (var t = g.length; t; ) {
  30502. for (f = g,
  30503. g = []; ++v < t; )
  30504. f && f[v].run();
  30505. v = -1,
  30506. t = g.length
  30507. }
  30508. f = null,
  30509. m = !1,
  30510. a(e)
  30511. }
  30512. }
  30513. function c(e, t) {
  30514. this.fun = e,
  30515. this.array = t
  30516. }
  30517. function h() {}
  30518. var u, d, p = t.exports = {};
  30519. !function() {
  30520. try {
  30521. u = "function" == typeof setTimeout ? setTimeout : n
  30522. } catch (e) {
  30523. u = n
  30524. }
  30525. try {
  30526. d = "function" == typeof clearTimeout ? clearTimeout : r
  30527. } catch (e) {
  30528. d = r
  30529. }
  30530. }();
  30531. var f, g = [], m = !1, v = -1;
  30532. p.nextTick = function(e) {
  30533. var t = new Array(arguments.length - 1);
  30534. if (arguments.length > 1)
  30535. for (var i = 1; i < arguments.length; i++)
  30536. t[i - 1] = arguments[i];
  30537. g.push(new c(e,t)),
  30538. 1 !== g.length || m || o(l)
  30539. }
  30540. ,
  30541. c.prototype.run = function() {
  30542. this.fun.apply(null, this.array)
  30543. }
  30544. ,
  30545. p.title = "browser",
  30546. p.browser = !0,
  30547. p.env = {},
  30548. p.argv = [],
  30549. p.version = "",
  30550. p.versions = {},
  30551. p.on = h,
  30552. p.addListener = h,
  30553. p.once = h,
  30554. p.off = h,
  30555. p.removeListener = h,
  30556. p.removeAllListeners = h,
  30557. p.emit = h,
  30558. p.binding = function(e) {
  30559. throw new Error("process.binding is not supported")
  30560. }
  30561. ,
  30562. p.cwd = function() {
  30563. return "/"
  30564. }
  30565. ,
  30566. p.chdir = function(e) {
  30567. throw new Error("process.chdir is not supported")
  30568. }
  30569. ,
  30570. p.umask = function() {
  30571. return 0
  30572. }
  30573. }
  30574. , {}],
  30575. 204: [function(e, t, i) {//punycode
  30576. (function(e) {
  30577. !function(n) {
  30578. function r(e) {
  30579. throw new RangeError(L[e])
  30580. }
  30581. function o(e, t) {
  30582. for (var i = e.length, n = []; i--; )
  30583. n[i] = t(e[i]);
  30584. return n
  30585. }
  30586. function a(e, t) {
  30587. var i = e.split("@")
  30588. , n = "";
  30589. i.length > 1 && (n = i[0] + "@",
  30590. e = i[1]),
  30591. e = e.replace(O, ".");
  30592. var r = e.split(".")
  30593. , a = o(r, t).join(".");
  30594. return n + a
  30595. }
  30596. function s(e) {
  30597. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30598. t = e.charCodeAt(r++),
  30599. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  30600. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  30601. r--)) : n.push(t);
  30602. return n
  30603. }
  30604. function l(e) {
  30605. return o(e, function(e) {
  30606. var t = "";
  30607. return e > 65535 && (e -= 65536,
  30608. t += B(e >>> 10 & 1023 | 55296),
  30609. e = 56320 | 1023 & e),
  30610. t += B(e)
  30611. }).join("")
  30612. }
  30613. function c(e) {
  30614. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  30615. }
  30616. function h(e, t) {
  30617. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30618. }
  30619. function u(e, t, i) {
  30620. var n = 0;
  30621. for (e = i ? N(e / T) : e >> 1,
  30622. e += N(e / t); e > D * w >> 1; n += E)
  30623. e = N(e / D);
  30624. return N(n + (D + 1) * e / (e + _))
  30625. }
  30626. function d(e) {
  30627. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  30628. for (i = e.lastIndexOf(M),
  30629. i < 0 && (i = 0),
  30630. n = 0; n < i; ++n)
  30631. e.charCodeAt(n) >= 128 && r("not-basic"),
  30632. g.push(e.charCodeAt(n));
  30633. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  30634. for (a = v,
  30635. s = 1,
  30636. h = E; o >= m && r("invalid-input"),
  30637. d = c(e.charCodeAt(o++)),
  30638. (d >= E || d > N((I - v) / s)) && r("overflow"),
  30639. v += d * s,
  30640. p = h <= y ? b : h >= y + w ? w : h - y,
  30641. !(d < p); h += E)
  30642. f = E - p,
  30643. s > N(I / f) && r("overflow"),
  30644. s *= f;
  30645. t = g.length + 1,
  30646. y = u(v - a, t, 0 == a),
  30647. N(v / t) > I - A && r("overflow"),
  30648. A += N(v / t),
  30649. v %= t,
  30650. g.splice(v++, 0, A)
  30651. }
  30652. return l(g)
  30653. }
  30654. function p(e) {
  30655. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  30656. for (e = s(e),
  30657. m = e.length,
  30658. t = S,
  30659. i = 0,
  30660. a = x,
  30661. l = 0; l < m; ++l)
  30662. g = e[l],
  30663. g < 128 && C.push(B(g));
  30664. for (n = o = C.length,
  30665. o && C.push(M); n < m; ) {
  30666. for (c = I,
  30667. l = 0; l < m; ++l)
  30668. g = e[l],
  30669. g >= t && g < c && (c = g);
  30670. for (v = n + 1,
  30671. c - t > N((I - i) / v) && r("overflow"),
  30672. i += (c - t) * v,
  30673. t = c,
  30674. l = 0; l < m; ++l)
  30675. if (g = e[l],
  30676. g < t && ++i > I && r("overflow"),
  30677. g == t) {
  30678. for (d = i,
  30679. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  30680. !(d < f); p += E)
  30681. y = d - f,
  30682. A = E - f,
  30683. C.push(B(h(f + y % A, 0))),
  30684. d = N(y / A);
  30685. C.push(B(h(d, 0))),
  30686. a = u(i, v, n == o),
  30687. i = 0,
  30688. ++n
  30689. }
  30690. ++i,
  30691. ++t
  30692. }
  30693. return C.join("")
  30694. }
  30695. function f(e) {
  30696. return a(e, function(e) {
  30697. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  30698. })
  30699. }
  30700. function g(e) {
  30701. return a(e, function(e) {
  30702. return P.test(e) ? "xn--" + p(e) : e
  30703. })
  30704. }
  30705. var m = "object" == typeof i && i && !i.nodeType && i
  30706. , v = "object" == typeof t && t && !t.nodeType && t
  30707. , A = "object" == typeof e && e;
  30708. A.global !== A && A.window !== A && A.self !== A || (n = A);
  30709. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  30710. overflow: "Overflow: input needs wider integers to process",
  30711. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30712. "invalid-input": "Invalid input"
  30713. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  30714. if (y = {
  30715. version: "1.4.1",
  30716. ucs2: {
  30717. decode: s,
  30718. encode: l
  30719. },
  30720. decode: d,
  30721. encode: p,
  30722. toASCII: g,
  30723. toUnicode: f
  30724. },
  30725. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30726. define("punycode", function() {
  30727. return y
  30728. });
  30729. else if (m && v)
  30730. if (t.exports == m)
  30731. v.exports = y;
  30732. else
  30733. for (C in y)
  30734. y.hasOwnProperty(C) && (m[C] = y[C]);
  30735. else
  30736. n.punycode = y
  30737. }(this)
  30738. }
  30739. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30740. }
  30741. , {}],
  30742. 205: [function(e, t, i) {//"./decode"
  30743. "use strict";
  30744. function n(e, t) {
  30745. return Object.prototype.hasOwnProperty.call(e, t)
  30746. }
  30747. t.exports = function(e, t, i, o) {
  30748. t = t || "&",
  30749. i = i || "=";
  30750. var a = {};
  30751. if ("string" != typeof e || 0 === e.length)
  30752. return a;
  30753. var s = /\+/g;
  30754. e = e.split(t);
  30755. var l = 1e3;
  30756. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  30757. var c = e.length;
  30758. l > 0 && c > l && (c = l);
  30759. for (var h = 0; h < c; ++h) {
  30760. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  30761. m >= 0 ? (u = g.substr(0, m),
  30762. d = g.substr(m + 1)) : (u = g,
  30763. d = ""),
  30764. p = decodeURIComponent(u),
  30765. f = decodeURIComponent(d),
  30766. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  30767. }
  30768. return a
  30769. }
  30770. ;
  30771. var r = Array.isArray || function(e) {
  30772. return "[object Array]" === Object.prototype.toString.call(e)
  30773. }
  30774. }
  30775. , {}],
  30776. 206: [function(e, t, i) {//"./encode"
  30777. "use strict";
  30778. function n(e, t) {
  30779. if (e.map)
  30780. return e.map(t);
  30781. for (var i = [], n = 0; n < e.length; n++)
  30782. i.push(t(e[n], n));
  30783. return i
  30784. }
  30785. var r = function(e) {
  30786. switch (typeof e) {
  30787. case "string":
  30788. return e;
  30789. case "boolean":
  30790. return e ? "true" : "false";
  30791. case "number":
  30792. return isFinite(e) ? e : "";
  30793. default:
  30794. return ""
  30795. }
  30796. };
  30797. t.exports = function(e, t, i, s) {
  30798. return t = t || "&",
  30799. i = i || "=",
  30800. null === e && (e = void 0),
  30801. "object" == typeof e ? n(a(e), function(a) {
  30802. var s = encodeURIComponent(r(a)) + i;
  30803. return o(e[a]) ? n(e[a], function(e) {
  30804. return s + encodeURIComponent(r(e))
  30805. }).join(t) : s + encodeURIComponent(r(e[a]))
  30806. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  30807. }
  30808. ;
  30809. var o = Array.isArray || function(e) {
  30810. return "[object Array]" === Object.prototype.toString.call(e)
  30811. }
  30812. , a = Object.keys || function(e) {
  30813. var t = [];
  30814. for (var i in e)
  30815. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  30816. return t
  30817. }
  30818. }
  30819. , {}],
  30820. 207: [function(e, t, i) {//querystring
  30821. "use strict";
  30822. i.decode = i.parse = e("./decode"),
  30823. i.encode = i.stringify = e("./encode")
  30824. }
  30825. , {
  30826. "./decode": 205,
  30827. "./encode": 206
  30828. }],
  30829. 208: [function(e, t, i) {//url
  30830. "use strict";
  30831. function n() {
  30832. this.protocol = null,
  30833. this.slashes = null,
  30834. this.auth = null,
  30835. this.host = null,
  30836. this.port = null,
  30837. this.hostname = null,
  30838. this.hash = null,
  30839. this.search = null,
  30840. this.query = null,
  30841. this.pathname = null,
  30842. this.path = null,
  30843. this.href = null
  30844. }
  30845. function r(e, t, i) {
  30846. if (e && c.isObject(e) && e instanceof n)
  30847. return e;
  30848. var r = new n;
  30849. return r.parse(e, t, i),
  30850. r
  30851. }
  30852. function o(e) {
  30853. return c.isString(e) && (e = r(e)),
  30854. e instanceof n ? e.format() : n.prototype.format.call(e)
  30855. }
  30856. function a(e, t) {
  30857. return r(e, !1, !0).resolve(t)
  30858. }
  30859. function s(e, t) {
  30860. return e ? r(e, !1, !0).resolveObject(t) : t
  30861. }
  30862. var l = e("punycode")
  30863. , c = e("./util");
  30864. i.parse = r,
  30865. i.resolve = a,
  30866. i.resolveObject = s,
  30867. i.format = o,
  30868. i.Url = n;
  30869. var h = /^([a-z0-9.+-]+:)/i
  30870. , u = /:[0-9]*$/
  30871. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  30872. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  30873. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  30874. , g = ["'"].concat(f)
  30875. , m = ["%", "/", "?", ";", "#"].concat(g)
  30876. , v = ["/", "?", "#"]
  30877. , A = 255
  30878. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  30879. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  30880. , I = {
  30881. javascript: !0,
  30882. "javascript:": !0
  30883. }
  30884. , E = {
  30885. javascript: !0,
  30886. "javascript:": !0
  30887. }
  30888. , b = {
  30889. http: !0,
  30890. https: !0,
  30891. ftp: !0,
  30892. gopher: !0,
  30893. file: !0,
  30894. "http:": !0,
  30895. "https:": !0,
  30896. "ftp:": !0,
  30897. "gopher:": !0,
  30898. "file:": !0
  30899. }
  30900. , w = e("querystring");
  30901. n.prototype.parse = function(e, t, i) {
  30902. if (!c.isString(e))
  30903. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  30904. var n = e.indexOf("?")
  30905. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  30906. , o = e.split(r)
  30907. , a = /\\/g;
  30908. o[0] = o[0].replace(a, "/"),
  30909. e = o.join(r);
  30910. var s = e;
  30911. if (s = s.trim(),
  30912. !i && 1 === e.split("#").length) {
  30913. var u = d.exec(s);
  30914. if (u)
  30915. return this.path = s,
  30916. this.href = s,
  30917. this.pathname = u[1],
  30918. u[2] ? (this.search = u[2],
  30919. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  30920. this.query = {}),
  30921. this
  30922. }
  30923. var p = h.exec(s);
  30924. if (p) {
  30925. p = p[0];
  30926. var f = p.toLowerCase();
  30927. this.protocol = f,
  30928. s = s.substr(p.length)
  30929. }
  30930. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  30931. var _ = "//" === s.substr(0, 2);
  30932. !_ || p && E[p] || (s = s.substr(2),
  30933. this.slashes = !0)
  30934. }
  30935. if (!E[p] && (_ || p && !b[p])) {
  30936. for (var T = -1, x = 0; x < v.length; x++) {
  30937. var S = s.indexOf(v[x]);
  30938. S !== -1 && (T === -1 || S < T) && (T = S)
  30939. }
  30940. var M, R;
  30941. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  30942. R !== -1 && (M = s.slice(0, R),
  30943. s = s.slice(R + 1),
  30944. this.auth = decodeURIComponent(M)),
  30945. T = -1;
  30946. for (var x = 0; x < m.length; x++) {
  30947. var S = s.indexOf(m[x]);
  30948. S !== -1 && (T === -1 || S < T) && (T = S)
  30949. }
  30950. T === -1 && (T = s.length),
  30951. this.host = s.slice(0, T),
  30952. s = s.slice(T),
  30953. this.parseHost(),
  30954. this.hostname = this.hostname || "";
  30955. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  30956. if (!P)
  30957. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  30958. var D = O[x];
  30959. if (D && !D.match(y)) {
  30960. for (var N = "", B = 0, F = D.length; B < F; B++)
  30961. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  30962. if (!N.match(y)) {
  30963. var V = O.slice(0, x)
  30964. , U = O.slice(x + 1)
  30965. , k = D.match(C);
  30966. k && (V.push(k[1]),
  30967. U.unshift(k[2])),
  30968. U.length && (s = "/" + U.join(".") + s),
  30969. this.hostname = V.join(".");
  30970. break
  30971. }
  30972. }
  30973. }
  30974. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  30975. P || (this.hostname = l.toASCII(this.hostname));
  30976. var H = this.port ? ":" + this.port : ""
  30977. , G = this.hostname || "";
  30978. this.host = G + H,
  30979. this.href += this.host,
  30980. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  30981. "/" !== s[0] && (s = "/" + s))
  30982. }
  30983. if (!I[f])
  30984. for (var x = 0, L = g.length; x < L; x++) {
  30985. var z = g[x];
  30986. if (s.indexOf(z) !== -1) {
  30987. var W = encodeURIComponent(z);
  30988. W === z && (W = escape(z)),
  30989. s = s.split(z).join(W)
  30990. }
  30991. }
  30992. var j = s.indexOf("#");
  30993. j !== -1 && (this.hash = s.substr(j),
  30994. s = s.slice(0, j));
  30995. var Y = s.indexOf("?");
  30996. if (Y !== -1 ? (this.search = s.substr(Y),
  30997. this.query = s.substr(Y + 1),
  30998. t && (this.query = w.parse(this.query)),
  30999. s = s.slice(0, Y)) : t && (this.search = "",
  31000. this.query = {}),
  31001. s && (this.pathname = s),
  31002. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  31003. this.pathname || this.search) {
  31004. var H = this.pathname || ""
  31005. , X = this.search || "";
  31006. this.path = H + X
  31007. }
  31008. return this.href = this.format(),
  31009. this
  31010. }
  31011. ,
  31012. n.prototype.format = function() {
  31013. var e = this.auth || "";
  31014. e && (e = encodeURIComponent(e),
  31015. e = e.replace(/%3A/i, ":"),
  31016. e += "@");
  31017. var t = this.protocol || ""
  31018. , i = this.pathname || ""
  31019. , n = this.hash || ""
  31020. , r = !1
  31021. , o = "";
  31022. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  31023. this.port && (r += ":" + this.port)),
  31024. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  31025. var a = this.search || o && "?" + o || "";
  31026. return t && ":" !== t.substr(-1) && (t += ":"),
  31027. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  31028. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  31029. n && "#" !== n.charAt(0) && (n = "#" + n),
  31030. a && "?" !== a.charAt(0) && (a = "?" + a),
  31031. i = i.replace(/[?#]/g, function(e) {
  31032. return encodeURIComponent(e)
  31033. }),
  31034. a = a.replace("#", "%23"),
  31035. t + r + i + a + n
  31036. }
  31037. ,
  31038. n.prototype.resolve = function(e) {
  31039. return this.resolveObject(r(e, !1, !0)).format()
  31040. }
  31041. ,
  31042. n.prototype.resolveObject = function(e) {
  31043. if (c.isString(e)) {
  31044. var t = new n;
  31045. t.parse(e, !1, !0),
  31046. e = t
  31047. }
  31048. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  31049. var a = r[o];
  31050. i[a] = this[a]
  31051. }
  31052. if (i.hash = e.hash,
  31053. "" === e.href)
  31054. return i.href = i.format(),
  31055. i;
  31056. if (e.slashes && !e.protocol) {
  31057. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  31058. var h = s[l];
  31059. "protocol" !== h && (i[h] = e[h])
  31060. }
  31061. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31062. i.href = i.format(),
  31063. i
  31064. }
  31065. if (e.protocol && e.protocol !== i.protocol) {
  31066. if (!b[e.protocol]) {
  31067. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  31068. var p = u[d];
  31069. i[p] = e[p]
  31070. }
  31071. return i.href = i.format(),
  31072. i
  31073. }
  31074. if (i.protocol = e.protocol,
  31075. e.host || E[e.protocol])
  31076. i.pathname = e.pathname;
  31077. else {
  31078. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  31079. ;
  31080. e.host || (e.host = ""),
  31081. e.hostname || (e.hostname = ""),
  31082. "" !== f[0] && f.unshift(""),
  31083. f.length < 2 && f.unshift(""),
  31084. i.pathname = f.join("/")
  31085. }
  31086. if (i.search = e.search,
  31087. i.query = e.query,
  31088. i.host = e.host || "",
  31089. i.auth = e.auth,
  31090. i.hostname = e.hostname || e.host,
  31091. i.port = e.port,
  31092. i.pathname || i.search) {
  31093. var g = i.pathname || ""
  31094. , m = i.search || "";
  31095. i.path = g + m
  31096. }
  31097. return i.slashes = i.slashes || e.slashes,
  31098. i.href = i.format(),
  31099. i
  31100. }
  31101. var v = i.pathname && "/" === i.pathname.charAt(0)
  31102. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31103. , y = A || v || i.host && e.pathname
  31104. , C = y
  31105. , I = i.pathname && i.pathname.split("/") || []
  31106. , f = e.pathname && e.pathname.split("/") || []
  31107. , w = i.protocol && !b[i.protocol];
  31108. if (w && (i.hostname = "",
  31109. i.port = null,
  31110. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  31111. i.host = "",
  31112. e.protocol && (e.hostname = null,
  31113. e.port = null,
  31114. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  31115. e.host = null),
  31116. y = y && ("" === f[0] || "" === I[0])),
  31117. A)
  31118. i.host = e.host || "" === e.host ? e.host : i.host,
  31119. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31120. i.search = e.search,
  31121. i.query = e.query,
  31122. I = f;
  31123. else if (f.length)
  31124. I || (I = []),
  31125. I.pop(),
  31126. I = I.concat(f),
  31127. i.search = e.search,
  31128. i.query = e.query;
  31129. else if (!c.isNullOrUndefined(e.search)) {
  31130. if (w) {
  31131. i.hostname = i.host = I.shift();
  31132. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31133. _ && (i.auth = _.shift(),
  31134. i.host = i.hostname = _.shift())
  31135. }
  31136. return i.search = e.search,
  31137. i.query = e.query,
  31138. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31139. i.href = i.format(),
  31140. i
  31141. }
  31142. if (!I.length)
  31143. return i.pathname = null,
  31144. i.search ? i.path = "/" + i.search : i.path = null,
  31145. i.href = i.format(),
  31146. i;
  31147. for (var T = I.slice(-1)[0], x = (i.host || e.host || I.length > 1) && ("." === T || ".." === T) || "" === T, S = 0, M = I.length; M >= 0; M--)
  31148. T = I[M],
  31149. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  31150. S++) : S && (I.splice(M, 1),
  31151. S--);
  31152. if (!y && !C)
  31153. for (; S--; S)
  31154. I.unshift("..");
  31155. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  31156. x && "/" !== I.join("/").substr(-1) && I.push("");
  31157. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  31158. if (w) {
  31159. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  31160. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31161. _ && (i.auth = _.shift(),
  31162. i.host = i.hostname = _.shift())
  31163. }
  31164. return y = y || i.host && I.length,
  31165. y && !R && I.unshift(""),
  31166. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  31167. i.path = null),
  31168. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31169. i.auth = e.auth || i.auth,
  31170. i.slashes = i.slashes || e.slashes,
  31171. i.href = i.format(),
  31172. i
  31173. }
  31174. ,
  31175. n.prototype.parseHost = function() {
  31176. var e = this.host
  31177. , t = u.exec(e);
  31178. t && (t = t[0],
  31179. ":" !== t && (this.port = t.substr(1)),
  31180. e = e.substr(0, e.length - t.length)),
  31181. e && (this.hostname = e)
  31182. }
  31183. }
  31184. , {
  31185. "./util": 209,
  31186. punycode: 204,
  31187. querystring: 207
  31188. }],
  31189. 209: [function(e, t, i) {//"./util"
  31190. "use strict";
  31191. t.exports = {
  31192. isString: function(e) {
  31193. return "string" == typeof e
  31194. },
  31195. isObject: function(e) {
  31196. return "object" == typeof e && null !== e
  31197. },
  31198. isNull: function(e) {
  31199. return null === e
  31200. },
  31201. isNullOrUndefined: function(e) {
  31202. return null == e
  31203. }
  31204. }
  31205. }
  31206. , {}],
  31207. 210: [function(e, t, i) {//dict
  31208. "use strict";
  31209. function n(e) {
  31210. return l + e
  31211. }
  31212. function r(e) {
  31213. return e.substring(l.length)
  31214. }
  31215. function o(e, t) {
  31216. for (var i in t)
  31217. Object.defineProperty(e, i, {
  31218. value: t[i],
  31219. configurable: !0,
  31220. writable: !0
  31221. })
  31222. }
  31223. function a(e) {
  31224. if ("string" != typeof e)
  31225. throw new TypeError("key must be a string.")
  31226. }
  31227. var s = Object.prototype.hasOwnProperty
  31228. , l = "~";
  31229. t.exports = function(e) {
  31230. var t = Object.create(null)
  31231. , i = 0
  31232. , l = {};
  31233. return o(l, {
  31234. get: function(e, i) {
  31235. a(e);
  31236. var r = n(e);
  31237. return r in t ? t[r] : i
  31238. },
  31239. set: function(e, r) {
  31240. a(e);
  31241. var o = n(e);
  31242. return o in t || ++i,
  31243. t[o] = r
  31244. },
  31245. has: function(e) {
  31246. return a(e),
  31247. n(e)in t
  31248. },
  31249. delete: function(e) {
  31250. a(e);
  31251. var r = n(e);
  31252. return r in t && (--i,
  31253. delete t[r],
  31254. !0)
  31255. },
  31256. clear: function() {
  31257. t = Object.create(null),
  31258. i = 0
  31259. },
  31260. forEach: function(e, i) {
  31261. if ("function" != typeof e)
  31262. throw new TypeError("`callback` must be a function");
  31263. for (var n in t)
  31264. if (s.call(t, n)) {
  31265. var o = r(n)
  31266. , a = t[n];
  31267. e.call(i, a, o, l)
  31268. }
  31269. }
  31270. }),
  31271. Object.defineProperty(l, "size", {
  31272. get: function() {
  31273. return i
  31274. },
  31275. configurable: !0
  31276. }),
  31277. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  31278. l.set(t, e[t])
  31279. }),
  31280. l
  31281. }
  31282. }
  31283. , {}],
  31284. 211: [function(e, t, i) {//heap
  31285. t.exports = e("./lib/heap")
  31286. }
  31287. , {
  31288. "./lib/heap": 212
  31289. }],
  31290. 212: [function(e, t, i) {//"./lib/heap"
  31291. (function() {
  31292. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  31293. r = Math.floor,
  31294. u = Math.min,
  31295. n = function(e, t) {
  31296. return e < t ? -1 : e > t ? 1 : 0
  31297. }
  31298. ,
  31299. h = function(e, t, i, o, a) {
  31300. var s;
  31301. if (null == i && (i = 0),
  31302. null == a && (a = n),
  31303. i < 0)
  31304. throw new Error("lo must be non-negative");
  31305. for (null == o && (o = e.length); i < o; )
  31306. s = r((i + o) / 2),
  31307. a(t, e[s]) < 0 ? o = s : i = s + 1;
  31308. return [].splice.apply(e, [i, i - i].concat(t)),
  31309. t
  31310. }
  31311. ,
  31312. s = function(e, t, i) {
  31313. return null == i && (i = n),
  31314. e.push(t),
  31315. g(e, 0, e.length - 1, i)
  31316. }
  31317. ,
  31318. a = function(e, t) {
  31319. var i, r;
  31320. return null == t && (t = n),
  31321. i = e.pop(),
  31322. e.length ? (r = e[0],
  31323. e[0] = i,
  31324. m(e, 0, t)) : r = i,
  31325. r
  31326. }
  31327. ,
  31328. c = function(e, t, i) {
  31329. var r;
  31330. return null == i && (i = n),
  31331. r = e[0],
  31332. e[0] = t,
  31333. m(e, 0, i),
  31334. r
  31335. }
  31336. ,
  31337. l = function(e, t, i) {
  31338. var r;
  31339. return null == i && (i = n),
  31340. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  31341. t = r[0],
  31342. e[0] = r[1],
  31343. m(e, 0, i)),
  31344. t
  31345. }
  31346. ,
  31347. o = function(e, t) {
  31348. var i, o, a, s, l, c;
  31349. for (null == t && (t = n),
  31350. s = function() {
  31351. c = [];
  31352. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  31353. c.push(t);
  31354. return c
  31355. }
  31356. .apply(this).reverse(),
  31357. l = [],
  31358. o = 0,
  31359. a = s.length; o < a; o++)
  31360. i = s[o],
  31361. l.push(m(e, i, t));
  31362. return l
  31363. }
  31364. ,
  31365. f = function(e, t, i) {
  31366. var r;
  31367. if (null == i && (i = n),
  31368. r = e.indexOf(t),
  31369. r !== -1)
  31370. return g(e, 0, r, i),
  31371. m(e, r, i)
  31372. }
  31373. ,
  31374. d = function(e, t, i) {
  31375. var r, a, s, c, h;
  31376. if (null == i && (i = n),
  31377. a = e.slice(0, t),
  31378. !a.length)
  31379. return a;
  31380. for (o(a, i),
  31381. h = e.slice(t),
  31382. s = 0,
  31383. c = h.length; s < c; s++)
  31384. r = h[s],
  31385. l(a, r, i);
  31386. return a.sort(i).reverse()
  31387. }
  31388. ,
  31389. p = function(e, t, i) {
  31390. var r, s, l, c, d, p, f, g, m, v;
  31391. if (null == i && (i = n),
  31392. 10 * t <= e.length) {
  31393. if (c = e.slice(0, t).sort(i),
  31394. !c.length)
  31395. return c;
  31396. for (l = c[c.length - 1],
  31397. g = e.slice(t),
  31398. d = 0,
  31399. f = g.length; d < f; d++)
  31400. r = g[d],
  31401. i(r, l) < 0 && (h(c, r, 0, null, i),
  31402. c.pop(),
  31403. l = c[c.length - 1]);
  31404. return c
  31405. }
  31406. for (o(e, i),
  31407. v = [],
  31408. s = p = 0,
  31409. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  31410. v.push(a(e, i));
  31411. return v
  31412. }
  31413. ,
  31414. g = function(e, t, i, r) {
  31415. var o, a, s;
  31416. for (null == r && (r = n),
  31417. o = e[i]; i > t && (s = i - 1 >> 1,
  31418. a = e[s],
  31419. r(o, a) < 0); )
  31420. e[i] = a,
  31421. i = s;
  31422. return e[i] = o
  31423. }
  31424. ,
  31425. m = function(e, t, i) {
  31426. var r, o, a, s, l;
  31427. for (null == i && (i = n),
  31428. o = e.length,
  31429. l = t,
  31430. a = e[t],
  31431. r = 2 * t + 1; r < o; )
  31432. s = r + 1,
  31433. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  31434. e[t] = e[r],
  31435. t = r,
  31436. r = 2 * t + 1;
  31437. return e[t] = a,
  31438. g(e, l, t, i)
  31439. }
  31440. ,
  31441. e = function() {
  31442. function e(e) {
  31443. this.cmp = null != e ? e : n,
  31444. this.nodes = []
  31445. }
  31446. return e.push = s,
  31447. e.pop = a,
  31448. e.replace = c,
  31449. e.pushpop = l,
  31450. e.heapify = o,
  31451. e.updateItem = f,
  31452. e.nlargest = d,
  31453. e.nsmallest = p,
  31454. e.prototype.push = function(e) {
  31455. return s(this.nodes, e, this.cmp)
  31456. }
  31457. ,
  31458. e.prototype.pop = function() {
  31459. return a(this.nodes, this.cmp)
  31460. }
  31461. ,
  31462. e.prototype.peek = function() {
  31463. return this.nodes[0]
  31464. }
  31465. ,
  31466. e.prototype.contains = function(e) {
  31467. return this.nodes.indexOf(e) !== -1
  31468. }
  31469. ,
  31470. e.prototype.replace = function(e) {
  31471. return c(this.nodes, e, this.cmp)
  31472. }
  31473. ,
  31474. e.prototype.pushpop = function(e) {
  31475. return l(this.nodes, e, this.cmp)
  31476. }
  31477. ,
  31478. e.prototype.heapify = function() {
  31479. return o(this.nodes, this.cmp)
  31480. }
  31481. ,
  31482. e.prototype.updateItem = function(e) {
  31483. return f(this.nodes, e, this.cmp)
  31484. }
  31485. ,
  31486. e.prototype.clear = function() {
  31487. return this.nodes = []
  31488. }
  31489. ,
  31490. e.prototype.empty = function() {
  31491. return 0 === this.nodes.length
  31492. }
  31493. ,
  31494. e.prototype.size = function() {
  31495. return this.nodes.length
  31496. }
  31497. ,
  31498. e.prototype.clone = function() {
  31499. var t;
  31500. return t = new e,
  31501. t.nodes = this.nodes.slice(0),
  31502. t
  31503. }
  31504. ,
  31505. e.prototype.toArray = function() {
  31506. return this.nodes.slice(0)
  31507. }
  31508. ,
  31509. e.prototype.insert = e.prototype.push,
  31510. e.prototype.top = e.prototype.peek,
  31511. e.prototype.front = e.prototype.peek,
  31512. e.prototype.has = e.prototype.contains,
  31513. e.prototype.copy = e.prototype.clone,
  31514. e
  31515. }(),
  31516. function(e, n) {
  31517. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  31518. }(this, function() {
  31519. return e
  31520. })
  31521. }
  31522. ).call(this)
  31523. }
  31524. , {}],
  31525. 213: [function(e, t, i) {//"promise-polyfill"
  31526. !function(e) {
  31527. function i() {}
  31528. function n(e, t) {
  31529. return function() {
  31530. e.apply(t, arguments)
  31531. }
  31532. }
  31533. function r(e) {
  31534. if ("object" != typeof this)
  31535. throw new TypeError("Promises must be constructed via new");
  31536. if ("function" != typeof e)
  31537. throw new TypeError("not a function");
  31538. this._state = 0,
  31539. this._handled = !1,
  31540. this._value = void 0,
  31541. this._deferreds = [],
  31542. h(e, this)
  31543. }
  31544. function o(e, t) {
  31545. for (; 3 === e._state; )
  31546. e = e._value;
  31547. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  31548. void r._immediateFn(function() {
  31549. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  31550. if (null === i)
  31551. return void (1 === e._state ? a : s)(t.promise, e._value);
  31552. var n;
  31553. try {
  31554. n = i(e._value)
  31555. } catch (e) {
  31556. return void s(t.promise, e)
  31557. }
  31558. a(t.promise, n)
  31559. }))
  31560. }
  31561. function a(e, t) {
  31562. try {
  31563. if (t === e)
  31564. throw new TypeError("A promise cannot be resolved with itself.");
  31565. if (t && ("object" == typeof t || "function" == typeof t)) {
  31566. var i = t.then;
  31567. if (t instanceof r)
  31568. return e._state = 3,
  31569. e._value = t,
  31570. void l(e);
  31571. if ("function" == typeof i)
  31572. return void h(n(i, t), e)
  31573. }
  31574. e._state = 1,
  31575. e._value = t,
  31576. l(e)
  31577. } catch (t) {
  31578. s(e, t)
  31579. }
  31580. }
  31581. function s(e, t) {
  31582. e._state = 2,
  31583. e._value = t,
  31584. l(e)
  31585. }
  31586. function l(e) {
  31587. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  31588. e._handled || r._unhandledRejectionFn(e._value)
  31589. });
  31590. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31591. o(e, e._deferreds[t]);
  31592. e._deferreds = null
  31593. }
  31594. function c(e, t, i) {
  31595. this.onFulfilled = "function" == typeof e ? e : null,
  31596. this.onRejected = "function" == typeof t ? t : null,
  31597. this.promise = i
  31598. }
  31599. function h(e, t) {
  31600. var i = !1;
  31601. try {
  31602. e(function(e) {
  31603. i || (i = !0,
  31604. a(t, e))
  31605. }, function(e) {
  31606. i || (i = !0,
  31607. s(t, e))
  31608. })
  31609. } catch (e) {
  31610. if (i)
  31611. return;
  31612. i = !0,
  31613. s(t, e)
  31614. }
  31615. }
  31616. var u = setTimeout;
  31617. r.prototype.catch = function(e) {
  31618. return this.then(null, e)
  31619. }
  31620. ,
  31621. r.prototype.then = function(e, t) {
  31622. var n = new this.constructor(i);
  31623. return o(this, new c(e,t,n)),
  31624. n
  31625. }
  31626. ,
  31627. r.all = function(e) {
  31628. var t = Array.prototype.slice.call(e);
  31629. return new r(function(e, i) {
  31630. function n(o, a) {
  31631. try {
  31632. if (a && ("object" == typeof a || "function" == typeof a)) {
  31633. var s = a.then;
  31634. if ("function" == typeof s)
  31635. return void s.call(a, function(e) {
  31636. n(o, e)
  31637. }, i)
  31638. }
  31639. t[o] = a,
  31640. 0 === --r && e(t)
  31641. } catch (e) {
  31642. i(e)
  31643. }
  31644. }
  31645. if (0 === t.length)
  31646. return e([]);
  31647. for (var r = t.length, o = 0; o < t.length; o++)
  31648. n(o, t[o])
  31649. }
  31650. )
  31651. }
  31652. ,
  31653. r.resolve = function(e) {
  31654. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  31655. t(e)
  31656. }
  31657. )
  31658. }
  31659. ,
  31660. r.reject = function(e) {
  31661. return new r(function(t, i) {
  31662. i(e)
  31663. }
  31664. )
  31665. }
  31666. ,
  31667. r.race = function(e) {
  31668. return new r(function(t, i) {
  31669. for (var n = 0, r = e.length; n < r; n++)
  31670. e[n].then(t, i)
  31671. }
  31672. )
  31673. }
  31674. ,
  31675. r._immediateFn = "function" == typeof setImmediate && function(e) {
  31676. setImmediate(e)
  31677. }
  31678. || function(e) {
  31679. u(e, 0)
  31680. }
  31681. ,
  31682. r._unhandledRejectionFn = function(e) {
  31683. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31684. }
  31685. ,
  31686. r._setImmediateFn = function(e) {
  31687. r._immediateFn = e
  31688. }
  31689. ,
  31690. r._setUnhandledRejectionFn = function(e) {
  31691. r._unhandledRejectionFn = e
  31692. }
  31693. ,
  31694. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  31695. }(this)
  31696. }
  31697. , {}],
  31698. 214: [function(e, t, i) {//protobufjs
  31699. (function(i) {
  31700. !function(i, n) {
  31701. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  31702. }(this, function(t, n) {
  31703. "use strict";
  31704. var r = {};
  31705. return r.ByteBuffer = t,
  31706. r.Long = t.Long || null,
  31707. r.VERSION = "5.0.1",
  31708. r.WIRE_TYPES = {},
  31709. r.WIRE_TYPES.VARINT = 0,
  31710. r.WIRE_TYPES.BITS64 = 1,
  31711. r.WIRE_TYPES.LDELIM = 2,
  31712. r.WIRE_TYPES.STARTGROUP = 3,
  31713. r.WIRE_TYPES.ENDGROUP = 4,
  31714. r.WIRE_TYPES.BITS32 = 5,
  31715. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  31716. r.TYPES = {
  31717. int32: {
  31718. name: "int32",
  31719. wireType: r.WIRE_TYPES.VARINT,
  31720. defaultValue: 0
  31721. },
  31722. uint32: {
  31723. name: "uint32",
  31724. wireType: r.WIRE_TYPES.VARINT,
  31725. defaultValue: 0
  31726. },
  31727. sint32: {
  31728. name: "sint32",
  31729. wireType: r.WIRE_TYPES.VARINT,
  31730. defaultValue: 0
  31731. },
  31732. int64: {
  31733. name: "int64",
  31734. wireType: r.WIRE_TYPES.VARINT,
  31735. defaultValue: r.Long ? r.Long.ZERO : void 0
  31736. },
  31737. uint64: {
  31738. name: "uint64",
  31739. wireType: r.WIRE_TYPES.VARINT,
  31740. defaultValue: r.Long ? r.Long.UZERO : void 0
  31741. },
  31742. sint64: {
  31743. name: "sint64",
  31744. wireType: r.WIRE_TYPES.VARINT,
  31745. defaultValue: r.Long ? r.Long.ZERO : void 0
  31746. },
  31747. bool: {
  31748. name: "bool",
  31749. wireType: r.WIRE_TYPES.VARINT,
  31750. defaultValue: !1
  31751. },
  31752. double: {
  31753. name: "double",
  31754. wireType: r.WIRE_TYPES.BITS64,
  31755. defaultValue: 0
  31756. },
  31757. string: {
  31758. name: "string",
  31759. wireType: r.WIRE_TYPES.LDELIM,
  31760. defaultValue: ""
  31761. },
  31762. bytes: {
  31763. name: "bytes",
  31764. wireType: r.WIRE_TYPES.LDELIM,
  31765. defaultValue: null
  31766. },
  31767. fixed32: {
  31768. name: "fixed32",
  31769. wireType: r.WIRE_TYPES.BITS32,
  31770. defaultValue: 0
  31771. },
  31772. sfixed32: {
  31773. name: "sfixed32",
  31774. wireType: r.WIRE_TYPES.BITS32,
  31775. defaultValue: 0
  31776. },
  31777. fixed64: {
  31778. name: "fixed64",
  31779. wireType: r.WIRE_TYPES.BITS64,
  31780. defaultValue: r.Long ? r.Long.UZERO : void 0
  31781. },
  31782. sfixed64: {
  31783. name: "sfixed64",
  31784. wireType: r.WIRE_TYPES.BITS64,
  31785. defaultValue: r.Long ? r.Long.ZERO : void 0
  31786. },
  31787. float: {
  31788. name: "float",
  31789. wireType: r.WIRE_TYPES.BITS32,
  31790. defaultValue: 0
  31791. },
  31792. enum: {
  31793. name: "enum",
  31794. wireType: r.WIRE_TYPES.VARINT,
  31795. defaultValue: 0
  31796. },
  31797. message: {
  31798. name: "message",
  31799. wireType: r.WIRE_TYPES.LDELIM,
  31800. defaultValue: null
  31801. },
  31802. group: {
  31803. name: "group",
  31804. wireType: r.WIRE_TYPES.STARTGROUP,
  31805. defaultValue: null
  31806. }
  31807. },
  31808. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  31809. r.ID_MIN = 1,
  31810. r.ID_MAX = 536870911,
  31811. r.convertFieldsToCamelCase = !1,
  31812. r.populateAccessors = !0,
  31813. r.populateDefaults = !0,
  31814. r.Util = function() {
  31815. var t = {};
  31816. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  31817. t.XHR = function() {
  31818. for (var e = [function() {
  31819. return new XMLHttpRequest
  31820. }
  31821. , function() {
  31822. return new ActiveXObject("Msxml2.XMLHTTP")
  31823. }
  31824. , function() {
  31825. return new ActiveXObject("Msxml3.XMLHTTP")
  31826. }
  31827. , function() {
  31828. return new ActiveXObject("Microsoft.XMLHTTP")
  31829. }
  31830. ], t = null, i = 0; i < e.length; i++) {
  31831. try {
  31832. t = e[i]()
  31833. } catch (e) {
  31834. continue
  31835. }
  31836. break
  31837. }
  31838. if (!t)
  31839. throw Error("XMLHttpRequest is not supported");
  31840. return t
  31841. }
  31842. ,
  31843. t.fetch = function(i, n) {
  31844. if (n && "function" != typeof n && (n = null),
  31845. t.IS_NODE) {
  31846. var r = e("fs");
  31847. if (n)
  31848. r.readFile(i, function(e, t) {
  31849. n(e ? null : "" + t)
  31850. });
  31851. else
  31852. try {
  31853. return r.readFileSync(i)
  31854. } catch (e) {
  31855. return null
  31856. }
  31857. } else {
  31858. var o = t.XHR();
  31859. if (o.open("GET", i, !!n),
  31860. o.setRequestHeader("Accept", "text/plain"),
  31861. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  31862. !n)
  31863. return o.send(null),
  31864. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  31865. if (o.onreadystatechange = function() {
  31866. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  31867. }
  31868. ,
  31869. 4 == o.readyState)
  31870. return;
  31871. o.send(null)
  31872. }
  31873. }
  31874. ,
  31875. t.toCamelCase = function(e) {
  31876. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  31877. return t.toUpperCase()
  31878. })
  31879. }
  31880. ,
  31881. t
  31882. }(),
  31883. r.Lang = {
  31884. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  31885. RULE: /^(?:required|optional|repeated|map)$/,
  31886. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  31887. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  31888. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  31889. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  31890. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  31891. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  31892. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  31893. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  31894. NUMBER_OCT: /^0[0-7]+$/,
  31895. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  31896. BOOL: /^(?:true|false)$/i,
  31897. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31898. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31899. WHITESPACE: /\s/,
  31900. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  31901. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  31902. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  31903. },
  31904. r.DotProto = function(e, t) {
  31905. function i(e, i) {
  31906. var n = -1
  31907. , r = 1;
  31908. if ("-" == e.charAt(0) && (r = -1,
  31909. e = e.substring(1)),
  31910. t.NUMBER_DEC.test(e))
  31911. n = parseInt(e);
  31912. else if (t.NUMBER_HEX.test(e))
  31913. n = parseInt(e.substring(2), 16);
  31914. else {
  31915. if (!t.NUMBER_OCT.test(e))
  31916. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  31917. n = parseInt(e.substring(1), 8)
  31918. }
  31919. if (n = r * n | 0,
  31920. !i && n < 0)
  31921. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  31922. return n
  31923. }
  31924. function n(e) {
  31925. var i = 1;
  31926. if ("-" == e.charAt(0) && (i = -1,
  31927. e = e.substring(1)),
  31928. t.NUMBER_DEC.test(e))
  31929. return i * parseInt(e, 10);
  31930. if (t.NUMBER_HEX.test(e))
  31931. return i * parseInt(e.substring(2), 16);
  31932. if (t.NUMBER_OCT.test(e))
  31933. return i * parseInt(e.substring(1), 8);
  31934. if ("inf" === e)
  31935. return i * (1 / 0);
  31936. if ("nan" === e)
  31937. return NaN;
  31938. if (t.NUMBER_FLT.test(e))
  31939. return i * parseFloat(e);
  31940. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  31941. }
  31942. function r(e, t, i) {
  31943. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  31944. e[t].push(i))
  31945. }
  31946. var o = {}
  31947. , a = function(e) {
  31948. this.source = e + "",
  31949. this.index = 0,
  31950. this.line = 1,
  31951. this.stack = [],
  31952. this._stringOpen = null
  31953. }
  31954. , s = a.prototype;
  31955. s._readString = function() {
  31956. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  31957. e.lastIndex = this.index - 1;
  31958. var i = e.exec(this.source);
  31959. if (!i)
  31960. throw Error("unterminated string");
  31961. return this.index = e.lastIndex,
  31962. this.stack.push(this._stringOpen),
  31963. this._stringOpen = null,
  31964. i[1]
  31965. }
  31966. ,
  31967. s.next = function() {
  31968. if (this.stack.length > 0)
  31969. return this.stack.shift();
  31970. if (this.index >= this.source.length)
  31971. return null;
  31972. if (null !== this._stringOpen)
  31973. return this._readString();
  31974. var e, i, n;
  31975. do {
  31976. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  31977. if ("\n" === n && ++this.line,
  31978. ++this.index === this.source.length)
  31979. return null;
  31980. if ("/" === this.source.charAt(this.index))
  31981. if (++this.index,
  31982. "/" === this.source.charAt(this.index)) {
  31983. for (; "\n" !== this.source.charAt(++this.index); )
  31984. if (this.index == this.source.length)
  31985. return null;
  31986. ++this.index,
  31987. ++this.line,
  31988. e = !0
  31989. } else {
  31990. if ("*" !== (n = this.source.charAt(this.index)))
  31991. return "/";
  31992. do {
  31993. if ("\n" === n && ++this.line,
  31994. ++this.index === this.source.length)
  31995. return null;
  31996. i = n,
  31997. n = this.source.charAt(this.index)
  31998. } while ("*" !== i || "/" !== n);++this.index,
  31999. e = !0
  32000. }
  32001. } while (e);if (this.index === this.source.length)
  32002. return null;
  32003. var r = this.index;
  32004. t.DELIM.lastIndex = 0;
  32005. var o = t.DELIM.test(this.source.charAt(r++));
  32006. if (!o)
  32007. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  32008. ++r;
  32009. var a = this.source.substring(this.index, this.index = r);
  32010. return '"' !== a && "'" !== a || (this._stringOpen = a),
  32011. a
  32012. }
  32013. ,
  32014. s.peek = function() {
  32015. if (0 === this.stack.length) {
  32016. var e = this.next();
  32017. if (null === e)
  32018. return null;
  32019. this.stack.push(e)
  32020. }
  32021. return this.stack[0]
  32022. }
  32023. ,
  32024. s.skip = function(e) {
  32025. var t = this.next();
  32026. if (t !== e)
  32027. throw Error("illegal '" + t + "', '" + e + "' expected")
  32028. }
  32029. ,
  32030. s.omit = function(e) {
  32031. return this.peek() === e && (this.next(),
  32032. !0)
  32033. }
  32034. ,
  32035. s.toString = function() {
  32036. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32037. }
  32038. ,
  32039. o.Tokenizer = a;
  32040. var l = function(e) {
  32041. this.tn = new a(e),
  32042. this.proto3 = !1
  32043. }
  32044. , c = l.prototype;
  32045. return c.parse = function() {
  32046. var e, i, n = {
  32047. name: "[ROOT]",
  32048. package: null,
  32049. messages: [],
  32050. enums: [],
  32051. imports: [],
  32052. options: {},
  32053. services: []
  32054. }, r = !0;
  32055. try {
  32056. for (; e = this.tn.next(); )
  32057. switch (e) {
  32058. case "package":
  32059. if (!r || null !== n.package)
  32060. throw Error("unexpected 'package'");
  32061. if (e = this.tn.next(),
  32062. !t.TYPEREF.test(e))
  32063. throw Error("illegal package name: " + e);
  32064. this.tn.skip(";"),
  32065. n.package = e;
  32066. break;
  32067. case "import":
  32068. if (!r)
  32069. throw Error("unexpected 'import'");
  32070. e = this.tn.peek(),
  32071. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  32072. e = this._readString(),
  32073. this.tn.skip(";"),
  32074. i || n.imports.push(e);
  32075. break;
  32076. case "syntax":
  32077. if (!r)
  32078. throw Error("unexpected 'syntax'");
  32079. this.tn.skip("="),
  32080. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  32081. this.tn.skip(";");
  32082. break;
  32083. case "message":
  32084. this._parseMessage(n, null),
  32085. r = !1;
  32086. break;
  32087. case "enum":
  32088. this._parseEnum(n),
  32089. r = !1;
  32090. break;
  32091. case "option":
  32092. this._parseOption(n);
  32093. break;
  32094. case "service":
  32095. this._parseService(n);
  32096. break;
  32097. case "extend":
  32098. this._parseExtend(n);
  32099. break;
  32100. default:
  32101. throw Error("unexpected '" + e + "'")
  32102. }
  32103. } catch (e) {
  32104. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32105. e
  32106. }
  32107. return delete n.name,
  32108. n
  32109. }
  32110. ,
  32111. l.parse = function(e) {
  32112. return new l(e).parse()
  32113. }
  32114. ,
  32115. c._readString = function() {
  32116. var e, t, i = "";
  32117. do {
  32118. if (t = this.tn.next(),
  32119. "'" !== t && '"' !== t)
  32120. throw Error("illegal string delimiter: " + t);
  32121. i += this.tn.next(),
  32122. this.tn.skip(t),
  32123. e = this.tn.peek()
  32124. } while ('"' === e || '"' === e);return i
  32125. }
  32126. ,
  32127. c._readValue = function(e) {
  32128. var i = this.tn.peek();
  32129. if ('"' === i || "'" === i)
  32130. return this._readString();
  32131. if (this.tn.next(),
  32132. t.NUMBER.test(i))
  32133. return n(i);
  32134. if (t.BOOL.test(i))
  32135. return "true" === i.toLowerCase();
  32136. if (e && t.TYPEREF.test(i))
  32137. return i;
  32138. throw Error("illegal value: " + i)
  32139. }
  32140. ,
  32141. c._parseOption = function(e, i) {
  32142. var n = this.tn.next()
  32143. , r = !1;
  32144. if ("(" === n && (r = !0,
  32145. n = this.tn.next()),
  32146. !t.TYPEREF.test(n))
  32147. throw Error("illegal option name: " + n);
  32148. var o = n;
  32149. r && (this.tn.skip(")"),
  32150. o = "(" + o + ")",
  32151. n = this.tn.peek(),
  32152. t.FQTYPEREF.test(n) && (o += n,
  32153. this.tn.next())),
  32154. this.tn.skip("="),
  32155. this._parseOptionValue(e, o),
  32156. i || this.tn.skip(";")
  32157. }
  32158. ,
  32159. c._parseOptionValue = function(e, i) {
  32160. var n = this.tn.peek();
  32161. if ("{" !== n)
  32162. r(e.options, i, this._readValue(!0));
  32163. else
  32164. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  32165. if (!t.NAME.test(n))
  32166. throw Error("illegal option name: " + i + "." + n);
  32167. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  32168. }
  32169. }
  32170. ,
  32171. c._parseService = function(e) {
  32172. var i = this.tn.next();
  32173. if (!t.NAME.test(i))
  32174. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  32175. var n = i
  32176. , r = {
  32177. name: n,
  32178. rpc: {},
  32179. options: {}
  32180. };
  32181. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32182. if ("option" === i)
  32183. this._parseOption(r);
  32184. else {
  32185. if ("rpc" !== i)
  32186. throw Error("illegal service token: " + i);
  32187. this._parseServiceRPC(r)
  32188. }
  32189. this.tn.omit(";"),
  32190. e.services.push(r)
  32191. }
  32192. ,
  32193. c._parseServiceRPC = function(e) {
  32194. var i = "rpc"
  32195. , n = this.tn.next();
  32196. if (!t.NAME.test(n))
  32197. throw Error("illegal rpc service method name: " + n);
  32198. var r = n
  32199. , o = {
  32200. request: null,
  32201. response: null,
  32202. request_stream: !1,
  32203. response_stream: !1,
  32204. options: {}
  32205. };
  32206. if (this.tn.skip("("),
  32207. n = this.tn.next(),
  32208. "stream" === n.toLowerCase() && (o.request_stream = !0,
  32209. n = this.tn.next()),
  32210. !t.TYPEREF.test(n))
  32211. throw Error("illegal rpc service request type: " + n);
  32212. if (o.request = n,
  32213. this.tn.skip(")"),
  32214. n = this.tn.next(),
  32215. "returns" !== n.toLowerCase())
  32216. throw Error("illegal rpc service request type delimiter: " + n);
  32217. if (this.tn.skip("("),
  32218. n = this.tn.next(),
  32219. "stream" === n.toLowerCase() && (o.response_stream = !0,
  32220. n = this.tn.next()),
  32221. o.response = n,
  32222. this.tn.skip(")"),
  32223. n = this.tn.peek(),
  32224. "{" === n) {
  32225. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  32226. if ("option" !== n)
  32227. throw Error("illegal rpc service token: " + n);
  32228. this._parseOption(o)
  32229. }
  32230. this.tn.omit(";")
  32231. } else
  32232. this.tn.skip(";");
  32233. "undefined" == typeof e[i] && (e[i] = {}),
  32234. e[i][r] = o
  32235. }
  32236. ,
  32237. c._parseMessage = function(e, n) {
  32238. var r = !!n
  32239. , o = this.tn.next()
  32240. , a = {
  32241. name: "",
  32242. fields: [],
  32243. enums: [],
  32244. messages: [],
  32245. options: {},
  32246. services: [],
  32247. oneofs: {}
  32248. };
  32249. if (!t.NAME.test(o))
  32250. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  32251. for (a.name = o,
  32252. r && (this.tn.skip("="),
  32253. n.id = i(this.tn.next()),
  32254. a.isGroup = !0),
  32255. o = this.tn.peek(),
  32256. "[" === o && n && this._parseFieldOptions(n),
  32257. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  32258. if (t.RULE.test(o))
  32259. this._parseMessageField(a, o);
  32260. else if ("oneof" === o)
  32261. this._parseMessageOneOf(a);
  32262. else if ("enum" === o)
  32263. this._parseEnum(a);
  32264. else if ("message" === o)
  32265. this._parseMessage(a);
  32266. else if ("option" === o)
  32267. this._parseOption(a);
  32268. else if ("service" === o)
  32269. this._parseService(a);
  32270. else if ("extensions" === o)
  32271. a.extensions = this._parseExtensionRanges();
  32272. else if ("reserved" === o)
  32273. this._parseIgnored();
  32274. else if ("extend" === o)
  32275. this._parseExtend(a);
  32276. else {
  32277. if (!t.TYPEREF.test(o))
  32278. throw Error("illegal message token: " + o);
  32279. if (!this.proto3)
  32280. throw Error("illegal field rule: " + o);
  32281. this._parseMessageField(a, "optional", o)
  32282. }
  32283. return this.tn.omit(";"),
  32284. e.messages.push(a),
  32285. a
  32286. }
  32287. ,
  32288. c._parseIgnored = function() {
  32289. for (; ";" !== this.tn.peek(); )
  32290. this.tn.next();
  32291. this.tn.skip(";")
  32292. }
  32293. ,
  32294. c._parseMessageField = function(e, n, r) {
  32295. if (!t.RULE.test(n))
  32296. throw Error("illegal message field rule: " + n);
  32297. var o, a = {
  32298. rule: n,
  32299. type: "",
  32300. name: "",
  32301. options: {},
  32302. id: 0
  32303. };
  32304. if ("map" === n) {
  32305. if (r)
  32306. throw Error("illegal type: " + r);
  32307. if (this.tn.skip("<"),
  32308. o = this.tn.next(),
  32309. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32310. throw Error("illegal message field type: " + o);
  32311. if (a.keytype = o,
  32312. this.tn.skip(","),
  32313. o = this.tn.next(),
  32314. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32315. throw Error("illegal message field: " + o);
  32316. if (a.type = o,
  32317. this.tn.skip(">"),
  32318. o = this.tn.next(),
  32319. !t.NAME.test(o))
  32320. throw Error("illegal message field name: " + o);
  32321. a.name = o,
  32322. this.tn.skip("="),
  32323. a.id = i(this.tn.next()),
  32324. o = this.tn.peek(),
  32325. "[" === o && this._parseFieldOptions(a),
  32326. this.tn.skip(";")
  32327. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  32328. "group" === r) {
  32329. var s = this._parseMessage(e, a);
  32330. if (!/^[A-Z]/.test(s.name))
  32331. throw Error("illegal group name: " + s.name);
  32332. a.type = s.name,
  32333. a.name = s.name.toLowerCase(),
  32334. this.tn.omit(";")
  32335. } else {
  32336. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  32337. throw Error("illegal message field type: " + r);
  32338. if (a.type = r,
  32339. o = this.tn.next(),
  32340. !t.NAME.test(o))
  32341. throw Error("illegal message field name: " + o);
  32342. a.name = o,
  32343. this.tn.skip("="),
  32344. a.id = i(this.tn.next()),
  32345. o = this.tn.peek(),
  32346. "[" === o && this._parseFieldOptions(a),
  32347. this.tn.skip(";")
  32348. }
  32349. return e.fields.push(a),
  32350. a
  32351. }
  32352. ,
  32353. c._parseMessageOneOf = function(e) {
  32354. var i = this.tn.next();
  32355. if (!t.NAME.test(i))
  32356. throw Error("illegal oneof name: " + i);
  32357. var n, r = i, o = [];
  32358. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32359. n = this._parseMessageField(e, "optional", i),
  32360. n.oneof = r,
  32361. o.push(n.id);
  32362. this.tn.omit(";"),
  32363. e.oneofs[r] = o
  32364. }
  32365. ,
  32366. c._parseFieldOptions = function(e) {
  32367. this.tn.skip("[");
  32368. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  32369. i || this.tn.skip(","),
  32370. this._parseOption(e, !0),
  32371. i = !1;
  32372. this.tn.next()
  32373. }
  32374. ,
  32375. c._parseEnum = function(e) {
  32376. var n = {
  32377. name: "",
  32378. values: [],
  32379. options: {}
  32380. }
  32381. , r = this.tn.next();
  32382. if (!t.NAME.test(r))
  32383. throw Error("illegal name: " + r);
  32384. for (n.name = r,
  32385. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  32386. if ("option" === r)
  32387. this._parseOption(n);
  32388. else {
  32389. if (!t.NAME.test(r))
  32390. throw Error("illegal name: " + r);
  32391. this.tn.skip("=");
  32392. var o = {
  32393. name: r,
  32394. id: i(this.tn.next(), !0)
  32395. };
  32396. r = this.tn.peek(),
  32397. "[" === r && this._parseFieldOptions({
  32398. options: {}
  32399. }),
  32400. this.tn.skip(";"),
  32401. n.values.push(o)
  32402. }
  32403. this.tn.omit(";"),
  32404. e.enums.push(n)
  32405. }
  32406. ,
  32407. c._parseExtensionRanges = function() {
  32408. var t, i, r, o = [];
  32409. do {
  32410. for (i = []; ; ) {
  32411. switch (t = this.tn.next()) {
  32412. case "min":
  32413. r = e.ID_MIN;
  32414. break;
  32415. case "max":
  32416. r = e.ID_MAX;
  32417. break;
  32418. default:
  32419. r = n(t)
  32420. }
  32421. if (i.push(r),
  32422. 2 === i.length)
  32423. break;
  32424. if ("to" !== this.tn.peek()) {
  32425. i.push(r);
  32426. break
  32427. }
  32428. this.tn.next()
  32429. }
  32430. o.push(i)
  32431. } while (this.tn.omit(","));return this.tn.skip(";"),
  32432. o
  32433. }
  32434. ,
  32435. c._parseExtend = function(e) {
  32436. var i = this.tn.next();
  32437. if (!t.TYPEREF.test(i))
  32438. throw Error("illegal extend reference: " + i);
  32439. var n = {
  32440. ref: i,
  32441. fields: []
  32442. };
  32443. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32444. if (t.RULE.test(i))
  32445. this._parseMessageField(n, i);
  32446. else {
  32447. if (!t.TYPEREF.test(i))
  32448. throw Error("illegal extend token: " + i);
  32449. if (!this.proto3)
  32450. throw Error("illegal field rule: " + i);
  32451. this._parseMessageField(n, "optional", i)
  32452. }
  32453. return this.tn.omit(";"),
  32454. e.messages.push(n),
  32455. n
  32456. }
  32457. ,
  32458. c.toString = function() {
  32459. return "Parser at line " + this.tn.line
  32460. }
  32461. ,
  32462. o.Parser = l,
  32463. o
  32464. }(r, r.Lang),
  32465. r.Reflect = function(e) {
  32466. function i(i) {
  32467. if ("string" == typeof i && (i = e.TYPES[i]),
  32468. "undefined" == typeof i.defaultValue)
  32469. throw Error("default value for type " + i.name + " is not supported");
  32470. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  32471. }
  32472. function n(t, i) {
  32473. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  32474. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  32475. if ("string" == typeof t)
  32476. return e.Long.fromString(t, i || !1, 10);
  32477. if ("number" == typeof t)
  32478. return e.Long.fromNumber(t, i || !1);
  32479. throw Error("not convertible to Long")
  32480. }
  32481. function r(t, i) {
  32482. var n = i.readVarint32()
  32483. , o = 7 & n
  32484. , a = n >>> 3;
  32485. switch (o) {
  32486. case e.WIRE_TYPES.VARINT:
  32487. do
  32488. n = i.readUint8();
  32489. while (128 === (128 & n));break;
  32490. case e.WIRE_TYPES.BITS64:
  32491. i.offset += 8;
  32492. break;
  32493. case e.WIRE_TYPES.LDELIM:
  32494. n = i.readVarint32(),
  32495. i.offset += n;
  32496. break;
  32497. case e.WIRE_TYPES.STARTGROUP:
  32498. r(a, i);
  32499. break;
  32500. case e.WIRE_TYPES.ENDGROUP:
  32501. if (a === t)
  32502. return !1;
  32503. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  32504. case e.WIRE_TYPES.BITS32:
  32505. i.offset += 4;
  32506. break;
  32507. default:
  32508. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  32509. }
  32510. return !0
  32511. }
  32512. var o = {}
  32513. , a = function(e, t, i) {
  32514. this.builder = e,
  32515. this.parent = t,
  32516. this.name = i,
  32517. this.className
  32518. }
  32519. , s = a.prototype;
  32520. s.fqn = function() {
  32521. for (var e = this.name, t = this; ; ) {
  32522. if (t = t.parent,
  32523. null == t)
  32524. break;
  32525. e = t.name + "." + e
  32526. }
  32527. return e
  32528. }
  32529. ,
  32530. s.toString = function(e) {
  32531. return (e ? this.className + " " : "") + this.fqn()
  32532. }
  32533. ,
  32534. s.build = function() {
  32535. throw Error(this.toString(!0) + " cannot be built directly")
  32536. }
  32537. ,
  32538. o.T = a;
  32539. var l = function(e, t, i, n, r) {
  32540. a.call(this, e, t, i),
  32541. this.className = "Namespace",
  32542. this.children = [],
  32543. this.options = n || {},
  32544. this.syntax = r || "proto2"
  32545. }
  32546. , c = l.prototype = Object.create(a.prototype);
  32547. c.getChildren = function(e) {
  32548. if (e = e || null,
  32549. null == e)
  32550. return this.children.slice();
  32551. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32552. this.children[i]instanceof e && t.push(this.children[i]);
  32553. return t
  32554. }
  32555. ,
  32556. c.addChild = function(e) {
  32557. var t;
  32558. if (t = this.getChild(e.name))
  32559. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32560. t.name = t.originalName;
  32561. else {
  32562. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32563. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32564. e.name = e.originalName
  32565. }
  32566. this.children.push(e)
  32567. }
  32568. ,
  32569. c.getChild = function(e) {
  32570. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32571. if (this.children[i][t] === e)
  32572. return this.children[i];
  32573. return null
  32574. }
  32575. ,
  32576. c.resolve = function(e, t) {
  32577. var i = "string" == typeof e ? e.split(".") : e
  32578. , n = this
  32579. , r = 0;
  32580. if ("" === i[r]) {
  32581. for (; null !== n.parent; )
  32582. n = n.parent;
  32583. r++
  32584. }
  32585. var a;
  32586. do {
  32587. do {
  32588. if (!(n instanceof o.Namespace)) {
  32589. n = null;
  32590. break
  32591. }
  32592. if (a = n.getChild(i[r]),
  32593. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  32594. n = null;
  32595. break
  32596. }
  32597. n = a,
  32598. r++
  32599. } while (r < i.length);if (null != n)
  32600. break;
  32601. if (null !== this.parent)
  32602. return this.parent.resolve(e, t)
  32603. } while (null != n);return n
  32604. }
  32605. ,
  32606. c.qn = function(e) {
  32607. var t = []
  32608. , i = e;
  32609. do
  32610. t.unshift(i.name),
  32611. i = i.parent;
  32612. while (null !== i);for (var n = 1; n <= t.length; n++) {
  32613. var r = t.slice(t.length - n);
  32614. if (e === this.resolve(r, e instanceof o.Namespace))
  32615. return r.join(".")
  32616. }
  32617. return e.fqn()
  32618. }
  32619. ,
  32620. c.build = function() {
  32621. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32622. e = i[n],
  32623. e instanceof l && (t[e.name] = e.build());
  32624. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32625. value: this.buildOpt()
  32626. }),
  32627. t
  32628. }
  32629. ,
  32630. c.buildOpt = function() {
  32631. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32632. var r = t[i]
  32633. , o = this.options[t[i]];
  32634. e[r] = o
  32635. }
  32636. return e
  32637. }
  32638. ,
  32639. c.getOption = function(e) {
  32640. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  32641. }
  32642. ,
  32643. o.Namespace = l;
  32644. var h = function(t, i, n, r) {
  32645. if (this.type = t,
  32646. this.resolvedType = i,
  32647. this.isMapKey = n,
  32648. this.syntax = r,
  32649. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  32650. throw Error("Invalid map key type: " + t.name)
  32651. }
  32652. , u = h.prototype;
  32653. h.defaultFieldValue = i,
  32654. u.verifyValue = function(i) {
  32655. function r(e, t) {
  32656. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  32657. }
  32658. var o = this;
  32659. switch (this.type) {
  32660. case e.TYPES.int32:
  32661. case e.TYPES.sint32:
  32662. case e.TYPES.sfixed32:
  32663. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32664. i > 4294967295 ? 0 | i : i;
  32665. case e.TYPES.uint32:
  32666. case e.TYPES.fixed32:
  32667. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32668. i < 0 ? i >>> 0 : i;
  32669. case e.TYPES.int64:
  32670. case e.TYPES.sint64:
  32671. case e.TYPES.sfixed64:
  32672. if (e.Long)
  32673. try {
  32674. return n(i, !1)
  32675. } catch (e) {
  32676. r(typeof i, e.message)
  32677. }
  32678. else
  32679. r(typeof i, "requires Long.js");
  32680. case e.TYPES.uint64:
  32681. case e.TYPES.fixed64:
  32682. if (e.Long)
  32683. try {
  32684. return n(i, !0)
  32685. } catch (e) {
  32686. r(typeof i, e.message)
  32687. }
  32688. else
  32689. r(typeof i, "requires Long.js");
  32690. case e.TYPES.bool:
  32691. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  32692. i;
  32693. case e.TYPES.float:
  32694. case e.TYPES.double:
  32695. return "number" != typeof i && r(typeof i, "not a number"),
  32696. i;
  32697. case e.TYPES.string:
  32698. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  32699. "" + i;
  32700. case e.TYPES.bytes:
  32701. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  32702. case e.TYPES.enum:
  32703. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  32704. for (l = 0; l < a.length; l++) {
  32705. if (a[l].name == i)
  32706. return a[l].id;
  32707. if (a[l].id == i)
  32708. return a[l].id
  32709. }
  32710. if ("proto3" === this.syntax)
  32711. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32712. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  32713. i;
  32714. r(i, "not a valid enum value");
  32715. case e.TYPES.group:
  32716. case e.TYPES.message:
  32717. if (i && "object" == typeof i || r(typeof i, "object expected"),
  32718. i instanceof this.resolvedType.clazz)
  32719. return i;
  32720. if (i instanceof e.Builder.Message) {
  32721. var s = {};
  32722. for (var l in i)
  32723. i.hasOwnProperty(l) && (s[l] = i[l]);
  32724. i = s
  32725. }
  32726. return new this.resolvedType.clazz(i)
  32727. }
  32728. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  32729. }
  32730. ,
  32731. u.calculateLength = function(i, n) {
  32732. if (null === n)
  32733. return 0;
  32734. var r;
  32735. switch (this.type) {
  32736. case e.TYPES.int32:
  32737. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  32738. case e.TYPES.uint32:
  32739. return t.calculateVarint32(n);
  32740. case e.TYPES.sint32:
  32741. return t.calculateVarint32(t.zigZagEncode32(n));
  32742. case e.TYPES.fixed32:
  32743. case e.TYPES.sfixed32:
  32744. case e.TYPES.float:
  32745. return 4;
  32746. case e.TYPES.int64:
  32747. case e.TYPES.uint64:
  32748. return t.calculateVarint64(n);
  32749. case e.TYPES.sint64:
  32750. return t.calculateVarint64(t.zigZagEncode64(n));
  32751. case e.TYPES.fixed64:
  32752. case e.TYPES.sfixed64:
  32753. return 8;
  32754. case e.TYPES.bool:
  32755. return 1;
  32756. case e.TYPES.enum:
  32757. return t.calculateVarint32(n);
  32758. case e.TYPES.double:
  32759. return 8;
  32760. case e.TYPES.string:
  32761. return r = t.calculateUTF8Bytes(n),
  32762. t.calculateVarint32(r) + r;
  32763. case e.TYPES.bytes:
  32764. if (n.remaining() < 0)
  32765. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  32766. return t.calculateVarint32(n.remaining()) + n.remaining();
  32767. case e.TYPES.message:
  32768. return r = this.resolvedType.calculate(n),
  32769. t.calculateVarint32(r) + r;
  32770. case e.TYPES.group:
  32771. return r = this.resolvedType.calculate(n),
  32772. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  32773. }
  32774. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  32775. }
  32776. ,
  32777. u.encodeValue = function(i, n, r) {
  32778. if (null === n)
  32779. return r;
  32780. switch (this.type) {
  32781. case e.TYPES.int32:
  32782. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  32783. break;
  32784. case e.TYPES.uint32:
  32785. r.writeVarint32(n);
  32786. break;
  32787. case e.TYPES.sint32:
  32788. r.writeVarint32ZigZag(n);
  32789. break;
  32790. case e.TYPES.fixed32:
  32791. r.writeUint32(n);
  32792. break;
  32793. case e.TYPES.sfixed32:
  32794. r.writeInt32(n);
  32795. break;
  32796. case e.TYPES.int64:
  32797. case e.TYPES.uint64:
  32798. r.writeVarint64(n);
  32799. break;
  32800. case e.TYPES.sint64:
  32801. r.writeVarint64ZigZag(n);
  32802. break;
  32803. case e.TYPES.fixed64:
  32804. r.writeUint64(n);
  32805. break;
  32806. case e.TYPES.sfixed64:
  32807. r.writeInt64(n);
  32808. break;
  32809. case e.TYPES.bool:
  32810. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  32811. break;
  32812. case e.TYPES.enum:
  32813. r.writeVarint32(n);
  32814. break;
  32815. case e.TYPES.float:
  32816. r.writeFloat32(n);
  32817. break;
  32818. case e.TYPES.double:
  32819. r.writeFloat64(n);
  32820. break;
  32821. case e.TYPES.string:
  32822. r.writeVString(n);
  32823. break;
  32824. case e.TYPES.bytes:
  32825. if (n.remaining() < 0)
  32826. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  32827. var o = n.offset;
  32828. r.writeVarint32(n.remaining()),
  32829. r.append(n),
  32830. n.offset = o;
  32831. break;
  32832. case e.TYPES.message:
  32833. var a = (new t).LE();
  32834. this.resolvedType.encode(n, a),
  32835. r.writeVarint32(a.offset),
  32836. r.append(a.flip());
  32837. break;
  32838. case e.TYPES.group:
  32839. this.resolvedType.encode(n, r),
  32840. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  32841. break;
  32842. default:
  32843. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  32844. }
  32845. return r
  32846. }
  32847. ,
  32848. u.decode = function(t, i, n) {
  32849. if (i != this.type.wireType)
  32850. throw Error("Unexpected wire type for element");
  32851. var r, o;
  32852. switch (this.type) {
  32853. case e.TYPES.int32:
  32854. return 0 | t.readVarint32();
  32855. case e.TYPES.uint32:
  32856. return t.readVarint32() >>> 0;
  32857. case e.TYPES.sint32:
  32858. return 0 | t.readVarint32ZigZag();
  32859. case e.TYPES.fixed32:
  32860. return t.readUint32() >>> 0;
  32861. case e.TYPES.sfixed32:
  32862. return 0 | t.readInt32();
  32863. case e.TYPES.int64:
  32864. return t.readVarint64();
  32865. case e.TYPES.uint64:
  32866. return t.readVarint64().toUnsigned();
  32867. case e.TYPES.sint64:
  32868. return t.readVarint64ZigZag();
  32869. case e.TYPES.fixed64:
  32870. return t.readUint64();
  32871. case e.TYPES.sfixed64:
  32872. return t.readInt64();
  32873. case e.TYPES.bool:
  32874. return !!t.readVarint32();
  32875. case e.TYPES.enum:
  32876. return t.readVarint32();
  32877. case e.TYPES.float:
  32878. return t.readFloat();
  32879. case e.TYPES.double:
  32880. return t.readDouble();
  32881. case e.TYPES.string:
  32882. return t.readVString();
  32883. case e.TYPES.bytes:
  32884. if (o = t.readVarint32(),
  32885. t.remaining() < o)
  32886. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  32887. return r = t.clone(),
  32888. r.limit = r.offset + o,
  32889. t.offset += o,
  32890. r;
  32891. case e.TYPES.message:
  32892. return o = t.readVarint32(),
  32893. this.resolvedType.decode(t, o);
  32894. case e.TYPES.group:
  32895. return this.resolvedType.decode(t, -1, n)
  32896. }
  32897. throw Error("[INTERNAL] Illegal decode type")
  32898. }
  32899. ,
  32900. u.valueFromString = function(i) {
  32901. if (!this.isMapKey)
  32902. throw Error("valueFromString() called on non-map-key element");
  32903. switch (this.type) {
  32904. case e.TYPES.int32:
  32905. case e.TYPES.sint32:
  32906. case e.TYPES.sfixed32:
  32907. case e.TYPES.uint32:
  32908. case e.TYPES.fixed32:
  32909. return this.verifyValue(parseInt(i));
  32910. case e.TYPES.int64:
  32911. case e.TYPES.sint64:
  32912. case e.TYPES.sfixed64:
  32913. case e.TYPES.uint64:
  32914. case e.TYPES.fixed64:
  32915. return this.verifyValue(i);
  32916. case e.TYPES.bool:
  32917. return "true" === i;
  32918. case e.TYPES.string:
  32919. return this.verifyValue(i);
  32920. case e.TYPES.bytes:
  32921. return t.fromBinary(i)
  32922. }
  32923. }
  32924. ,
  32925. u.valueToString = function(t) {
  32926. if (!this.isMapKey)
  32927. throw Error("valueToString() called on non-map-key element");
  32928. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  32929. }
  32930. ,
  32931. o.Element = h;
  32932. var d = function(e, t, i, n, r, o) {
  32933. l.call(this, e, t, i, n, o),
  32934. this.className = "Message",
  32935. this.extensions = void 0,
  32936. this.clazz = null,
  32937. this.isGroup = !!r,
  32938. this._fields = null,
  32939. this._fieldsById = null,
  32940. this._fieldsByName = null
  32941. }
  32942. , p = d.prototype = Object.create(l.prototype);
  32943. p.build = function(i) {
  32944. if (this.clazz && !i)
  32945. return this.clazz;
  32946. var n = function(e, i) {
  32947. function n(i, r, o, a) {
  32948. if (null === i || "object" != typeof i) {
  32949. if (a && a instanceof e.Reflect.Enum) {
  32950. var s = e.Reflect.Enum.getName(a.object, i);
  32951. if (null !== s)
  32952. return s
  32953. }
  32954. return i
  32955. }
  32956. if (t.isByteBuffer(i))
  32957. return r ? i.toBase64() : i.toBuffer();
  32958. if (e.Long.isLong(i))
  32959. return o ? i.toString() : e.Long.fromValue(i);
  32960. var l;
  32961. if (Array.isArray(i))
  32962. return l = [],
  32963. i.forEach(function(e, t) {
  32964. l[t] = n(e, r, o, a)
  32965. }),
  32966. l;
  32967. if (l = {},
  32968. i instanceof e.Map) {
  32969. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  32970. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  32971. return l
  32972. }
  32973. var u = i.$type
  32974. , d = void 0;
  32975. for (var p in i)
  32976. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  32977. return l
  32978. }
  32979. var r = i.getChildren(e.Reflect.Message.Field)
  32980. , o = i.getChildren(e.Reflect.Message.OneOf)
  32981. , a = function(n, s) {
  32982. e.Builder.Message.call(this);
  32983. for (var l = 0, c = o.length; l < c; ++l)
  32984. this[o[l].name] = null;
  32985. for (l = 0,
  32986. c = r.length; l < c; ++l) {
  32987. var h = r[l];
  32988. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  32989. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  32990. }
  32991. if (arguments.length > 0) {
  32992. var u;
  32993. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  32994. for (l = 0,
  32995. c = arguments.length; l < c; ++l)
  32996. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  32997. else
  32998. this.$set(n)
  32999. }
  33000. }
  33001. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  33002. s.add = function(t, n, r) {
  33003. var o = i._fieldsByName[t];
  33004. if (!r) {
  33005. if (!o)
  33006. throw Error(this + "#" + t + " is undefined");
  33007. if (!(o instanceof e.Reflect.Message.Field))
  33008. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  33009. if (!o.repeated)
  33010. throw Error(this + "#" + t + " is not a repeated field");
  33011. n = o.verifyValue(n, !0)
  33012. }
  33013. return null === this[t] && (this[t] = []),
  33014. this[t].push(n),
  33015. this
  33016. }
  33017. ,
  33018. s.$add = s.add,
  33019. s.set = function(t, n, r) {
  33020. if (t && "object" == typeof t) {
  33021. r = n;
  33022. for (var o in t)
  33023. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  33024. return this
  33025. }
  33026. var a = i._fieldsByName[t];
  33027. if (r)
  33028. this[t] = n;
  33029. else {
  33030. if (!a)
  33031. throw Error(this + "#" + t + " is not a field: undefined");
  33032. if (!(a instanceof e.Reflect.Message.Field))
  33033. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  33034. this[a.name] = n = a.verifyValue(n)
  33035. }
  33036. if (a && a.oneof) {
  33037. var s = this[a.oneof.name];
  33038. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  33039. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  33040. }
  33041. return this
  33042. }
  33043. ,
  33044. s.$set = s.set,
  33045. s.get = function(t, n) {
  33046. if (n)
  33047. return this[t];
  33048. var r = i._fieldsByName[t];
  33049. if (!(r && r instanceof e.Reflect.Message.Field))
  33050. throw Error(this + "#" + t + " is not a field: undefined");
  33051. if (!(r instanceof e.Reflect.Message.Field))
  33052. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  33053. return this[r.name]
  33054. }
  33055. ,
  33056. s.$get = s.get;
  33057. for (var l = 0; l < r.length; l++) {
  33058. var c = r[l];
  33059. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  33060. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33061. return e.toUpperCase().replace("_", "")
  33062. });
  33063. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  33064. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  33065. return "_" + e
  33066. })
  33067. , r = function(t, i) {
  33068. return this[e.name] = i ? t : e.verifyValue(t),
  33069. this
  33070. }
  33071. , o = function() {
  33072. return this[e.name]
  33073. };
  33074. null === i.getChild("set" + t) && (s["set" + t] = r),
  33075. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  33076. null === i.getChild("get" + t) && (s["get" + t] = o),
  33077. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  33078. }(c)
  33079. }
  33080. s.encode = function(e, n) {
  33081. "boolean" == typeof e && (n = e,
  33082. e = void 0);
  33083. var r = !1;
  33084. e || (e = new t,
  33085. r = !0);
  33086. var o = e.littleEndian;
  33087. try {
  33088. return i.encode(this, e.LE(), n),
  33089. (r ? e.flip() : e).LE(o)
  33090. } catch (t) {
  33091. throw e.LE(o),
  33092. t
  33093. }
  33094. }
  33095. ,
  33096. a.encode = function(e, t, i) {
  33097. return new a(e).encode(t, i)
  33098. }
  33099. ,
  33100. s.calculate = function() {
  33101. return i.calculate(this)
  33102. }
  33103. ,
  33104. s.encodeDelimited = function(e, n) {
  33105. var r = !1;
  33106. e || (e = new t,
  33107. r = !0);
  33108. var o = (new t).LE();
  33109. return i.encode(this, o, n).flip(),
  33110. e.writeVarint32(o.remaining()),
  33111. e.append(o),
  33112. r ? e.flip() : e
  33113. }
  33114. ,
  33115. s.encodeAB = function() {
  33116. try {
  33117. return this.encode().toArrayBuffer()
  33118. } catch (e) {
  33119. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33120. e
  33121. }
  33122. }
  33123. ,
  33124. s.toArrayBuffer = s.encodeAB,
  33125. s.encodeNB = function() {
  33126. try {
  33127. return this.encode().toBuffer()
  33128. } catch (e) {
  33129. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33130. e
  33131. }
  33132. }
  33133. ,
  33134. s.toBuffer = s.encodeNB,
  33135. s.encode64 = function() {
  33136. try {
  33137. return this.encode().toBase64()
  33138. } catch (e) {
  33139. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33140. e
  33141. }
  33142. }
  33143. ,
  33144. s.toBase64 = s.encode64,
  33145. s.encodeHex = function() {
  33146. try {
  33147. return this.encode().toHex()
  33148. } catch (e) {
  33149. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33150. e
  33151. }
  33152. }
  33153. ,
  33154. s.toHex = s.encodeHex,
  33155. s.toRaw = function(e, t) {
  33156. return n(this, !!e, !!t, this.$type)
  33157. }
  33158. ,
  33159. s.encodeJSON = function() {
  33160. return JSON.stringify(n(this, !0, !0, this.$type))
  33161. }
  33162. ,
  33163. a.decode = function(e, n, r) {
  33164. "string" == typeof n && (r = n,
  33165. n = -1),
  33166. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  33167. e = t.isByteBuffer(e) ? e : t.wrap(e);
  33168. var o = e.littleEndian;
  33169. try {
  33170. var a = i.decode(e.LE());
  33171. return e.LE(o),
  33172. a
  33173. } catch (t) {
  33174. throw e.LE(o),
  33175. t
  33176. }
  33177. }
  33178. ,
  33179. a.decodeDelimited = function(e, n) {
  33180. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  33181. e = t.isByteBuffer(e) ? e : t.wrap(e),
  33182. e.remaining() < 1)
  33183. return null;
  33184. var r = e.offset
  33185. , o = e.readVarint32();
  33186. if (e.remaining() < o)
  33187. return e.offset = r,
  33188. null;
  33189. try {
  33190. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  33191. return e.offset += o,
  33192. a
  33193. } catch (t) {
  33194. throw e.offset += o,
  33195. t
  33196. }
  33197. }
  33198. ,
  33199. a.decode64 = function(e) {
  33200. return a.decode(e, "base64")
  33201. }
  33202. ,
  33203. a.decodeHex = function(e) {
  33204. return a.decode(e, "hex")
  33205. }
  33206. ,
  33207. a.decodeJSON = function(e) {
  33208. return new a(JSON.parse(e))
  33209. }
  33210. ,
  33211. s.toString = function() {
  33212. return i.toString()
  33213. }
  33214. ;
  33215. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  33216. value: i.buildOpt()
  33217. }),
  33218. Object.defineProperty(s, "$options", {
  33219. value: a.$options
  33220. }),
  33221. Object.defineProperty(a, "$type", {
  33222. value: i
  33223. }),
  33224. Object.defineProperty(s, "$type", {
  33225. value: i
  33226. })),
  33227. a
  33228. }(e, this);
  33229. this._fields = [],
  33230. this._fieldsById = {},
  33231. this._fieldsByName = {};
  33232. for (var r, o = 0, a = this.children.length; o < a; o++)
  33233. if (r = this.children[o],
  33234. r instanceof A || r instanceof d || r instanceof E) {
  33235. if (n.hasOwnProperty(r.name))
  33236. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  33237. n[r.name] = r.build()
  33238. } else if (r instanceof d.Field)
  33239. r.build(),
  33240. this._fields.push(r),
  33241. this._fieldsById[r.id] = r,
  33242. this._fieldsByName[r.name] = r;
  33243. else if (!(r instanceof d.OneOf || r instanceof I))
  33244. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  33245. return this.clazz = n
  33246. }
  33247. ,
  33248. p.encode = function(e, t, i) {
  33249. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33250. n = this._fields[a],
  33251. r = e[n.name],
  33252. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33253. if (null !== o) {
  33254. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33255. throw l.encoded = t,
  33256. l
  33257. }
  33258. return t
  33259. }
  33260. ,
  33261. p.calculate = function(e) {
  33262. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33263. if (t = this._fields[r],
  33264. i = e[t.name],
  33265. t.required && null === i)
  33266. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33267. n += t.calculate(i, e)
  33268. }
  33269. return n
  33270. }
  33271. ,
  33272. p.decode = function(t, i, n) {
  33273. i = "number" == typeof i ? i : -1;
  33274. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  33275. if (o = t.readVarint32(),
  33276. a = 7 & o,
  33277. s = o >>> 3,
  33278. a === e.WIRE_TYPES.ENDGROUP) {
  33279. if (s !== n)
  33280. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  33281. break
  33282. }
  33283. if (l = this._fieldsById[s]) {
  33284. if (l.repeated && !l.options.packed)
  33285. h[l.name].push(l.decode(a, t));
  33286. else if (l.map) {
  33287. var u = l.decode(a, t);
  33288. h[l.name].set(u[0], u[1])
  33289. } else if (h[l.name] = l.decode(a, t),
  33290. l.oneof) {
  33291. var d = h[l.oneof.name];
  33292. null !== d && d !== l.name && (h[d] = null),
  33293. h[l.oneof.name] = l.name
  33294. }
  33295. } else
  33296. switch (a) {
  33297. case e.WIRE_TYPES.VARINT:
  33298. t.readVarint32();
  33299. break;
  33300. case e.WIRE_TYPES.BITS32:
  33301. t.offset += 4;
  33302. break;
  33303. case e.WIRE_TYPES.BITS64:
  33304. t.offset += 8;
  33305. break;
  33306. case e.WIRE_TYPES.LDELIM:
  33307. var p = t.readVarint32();
  33308. t.offset += p;
  33309. break;
  33310. case e.WIRE_TYPES.STARTGROUP:
  33311. for (; r(s, t); )
  33312. ;
  33313. break;
  33314. default:
  33315. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  33316. }
  33317. }
  33318. for (var f = 0, g = this._fields.length; f < g; ++f)
  33319. if (l = this._fields[f],
  33320. null === h[l.name])
  33321. if ("proto3" === this.syntax)
  33322. h[l.name] = l.defaultValue;
  33323. else {
  33324. if (l.required) {
  33325. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  33326. throw m.decoded = h,
  33327. m
  33328. }
  33329. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  33330. }
  33331. return h
  33332. }
  33333. ,
  33334. o.Message = d;
  33335. var f = function(t, i, n, r, o, s, l, c, h, u) {
  33336. a.call(this, t, i, s),
  33337. this.className = "Message.Field",
  33338. this.required = "required" === n,
  33339. this.repeated = "repeated" === n,
  33340. this.map = "map" === n,
  33341. this.keyType = r || null,
  33342. this.type = o,
  33343. this.resolvedType = null,
  33344. this.id = l,
  33345. this.options = c || {},
  33346. this.defaultValue = null,
  33347. this.oneof = h || null,
  33348. this.syntax = u || "proto2",
  33349. this.originalName = this.name,
  33350. this.element = null,
  33351. this.keyElement = null,
  33352. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  33353. }
  33354. , g = f.prototype = Object.create(a.prototype);
  33355. g.build = function() {
  33356. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  33357. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  33358. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  33359. }
  33360. ,
  33361. g.verifyValue = function(t, i) {
  33362. function n(e, t) {
  33363. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33364. }
  33365. i = i || !1;
  33366. var r = this;
  33367. if (null === t)
  33368. return this.required && n(typeof t, "required"),
  33369. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  33370. null;
  33371. var o;
  33372. if (this.repeated && !i) {
  33373. Array.isArray(t) || (t = [t]);
  33374. var a = [];
  33375. for (o = 0; o < t.length; o++)
  33376. a.push(this.element.verifyValue(t[o]));
  33377. return a
  33378. }
  33379. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  33380. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  33381. this.element.verifyValue(t))
  33382. }
  33383. ,
  33384. g.hasWirePresence = function(t, i) {
  33385. if ("proto3" !== this.syntax)
  33386. return null !== t;
  33387. if (this.oneof && i[this.oneof.name] === this.name)
  33388. return !0;
  33389. switch (this.type) {
  33390. case e.TYPES.int32:
  33391. case e.TYPES.sint32:
  33392. case e.TYPES.sfixed32:
  33393. case e.TYPES.uint32:
  33394. case e.TYPES.fixed32:
  33395. return 0 !== t;
  33396. case e.TYPES.int64:
  33397. case e.TYPES.sint64:
  33398. case e.TYPES.sfixed64:
  33399. case e.TYPES.uint64:
  33400. case e.TYPES.fixed64:
  33401. return 0 !== t.low || 0 !== t.high;
  33402. case e.TYPES.bool:
  33403. return t;
  33404. case e.TYPES.float:
  33405. case e.TYPES.double:
  33406. return 0 !== t;
  33407. case e.TYPES.string:
  33408. return t.length > 0;
  33409. case e.TYPES.bytes:
  33410. return t.remaining() > 0;
  33411. case e.TYPES.enum:
  33412. return 0 !== t;
  33413. case e.TYPES.message:
  33414. return null !== t;
  33415. default:
  33416. return !0
  33417. }
  33418. }
  33419. ,
  33420. g.encode = function(i, n, r) {
  33421. if (null === this.type || "object" != typeof this.type)
  33422. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33423. if (null === i || this.repeated && 0 == i.length)
  33424. return n;
  33425. try {
  33426. if (this.repeated) {
  33427. var o;
  33428. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33429. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33430. n.ensureCapacity(n.offset += 1);
  33431. var a = n.offset;
  33432. for (o = 0; o < i.length; o++)
  33433. this.element.encodeValue(this.id, i[o], n);
  33434. var s = n.offset - a
  33435. , l = t.calculateVarint32(s);
  33436. if (l > 1) {
  33437. var c = n.slice(a, n.offset);
  33438. a += l - 1,
  33439. n.offset = a,
  33440. n.append(c)
  33441. }
  33442. n.writeVarint32(s, a - l)
  33443. } else
  33444. for (o = 0; o < i.length; o++)
  33445. n.writeVarint32(this.id << 3 | this.type.wireType),
  33446. this.element.encodeValue(this.id, i[o], n)
  33447. } else
  33448. this.map ? i.forEach(function(i, r, o) {
  33449. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33450. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33451. n.writeVarint32(a),
  33452. n.writeVarint32(8 | this.keyType.wireType),
  33453. this.keyElement.encodeValue(1, r, n),
  33454. n.writeVarint32(16 | this.type.wireType),
  33455. this.element.encodeValue(2, i, n)
  33456. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  33457. this.element.encodeValue(this.id, i, n))
  33458. } catch (e) {
  33459. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33460. }
  33461. return n
  33462. }
  33463. ,
  33464. g.calculate = function(i, n) {
  33465. if (i = this.verifyValue(i),
  33466. null === this.type || "object" != typeof this.type)
  33467. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33468. if (null === i || this.repeated && 0 == i.length)
  33469. return 0;
  33470. var r = 0;
  33471. try {
  33472. if (this.repeated) {
  33473. var o, a;
  33474. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33475. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33476. a = 0,
  33477. o = 0; o < i.length; o++)
  33478. a += this.element.calculateLength(this.id, i[o]);
  33479. r += t.calculateVarint32(a),
  33480. r += a
  33481. } else
  33482. for (o = 0; o < i.length; o++)
  33483. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33484. r += this.element.calculateLength(this.id, i[o])
  33485. } else
  33486. this.map ? i.forEach(function(i, n, o) {
  33487. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33488. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33489. r += t.calculateVarint32(a),
  33490. r += a
  33491. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33492. r += this.element.calculateLength(this.id, i))
  33493. } catch (e) {
  33494. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33495. }
  33496. return r
  33497. }
  33498. ,
  33499. g.decode = function(t, i, n) {
  33500. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  33501. if (!a)
  33502. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  33503. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  33504. o = i.readVarint32(),
  33505. o = i.offset + o;
  33506. for (var s = []; i.offset < o; )
  33507. s.push(this.decode(this.type.wireType, i, !0));
  33508. return s
  33509. }
  33510. if (this.map) {
  33511. var l = h.defaultFieldValue(this.keyType);
  33512. if (r = h.defaultFieldValue(this.type),
  33513. o = i.readVarint32(),
  33514. i.remaining() < o)
  33515. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  33516. var c = i.clone();
  33517. for (c.limit = c.offset + o,
  33518. i.offset += o; c.remaining() > 0; ) {
  33519. var u = c.readVarint32();
  33520. t = 7 & u;
  33521. var d = u >>> 3;
  33522. if (1 === d)
  33523. l = this.keyElement.decode(c, t, d);
  33524. else {
  33525. if (2 !== d)
  33526. throw Error("Unexpected tag in map field key/value submessage");
  33527. r = this.element.decode(c, t, d)
  33528. }
  33529. }
  33530. return [l, r]
  33531. }
  33532. return this.element.decode(i, t, this.id)
  33533. }
  33534. ,
  33535. o.Message.Field = f;
  33536. var m = function(e, t, i, n, r, o, a) {
  33537. f.call(this, e, t, i, null, n, r, o, a),
  33538. this.extension
  33539. };
  33540. m.prototype = Object.create(f.prototype),
  33541. o.Message.ExtensionField = m;
  33542. var v = function(e, t, i) {
  33543. a.call(this, e, t, i),
  33544. this.fields = []
  33545. };
  33546. o.Message.OneOf = v;
  33547. var A = function(e, t, i, n, r) {
  33548. l.call(this, e, t, i, n, r),
  33549. this.className = "Enum",
  33550. this.object = null
  33551. };
  33552. A.getName = function(e, t) {
  33553. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33554. if (e[i = n[r]] === t)
  33555. return i;
  33556. return null
  33557. }
  33558. ;
  33559. var y = A.prototype = Object.create(l.prototype);
  33560. y.build = function(t) {
  33561. if (this.object && !t)
  33562. return this.object;
  33563. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  33564. i[n[r].name] = n[r].id;
  33565. return Object.defineProperty && Object.defineProperty(i, "$options", {
  33566. value: this.buildOpt(),
  33567. enumerable: !1
  33568. }),
  33569. this.object = i
  33570. }
  33571. ,
  33572. o.Enum = A;
  33573. var C = function(e, t, i, n) {
  33574. a.call(this, e, t, i),
  33575. this.className = "Enum.Value",
  33576. this.id = n
  33577. };
  33578. C.prototype = Object.create(a.prototype),
  33579. o.Enum.Value = C;
  33580. var I = function(e, t, i, n) {
  33581. a.call(this, e, t, i),
  33582. this.field = n
  33583. };
  33584. I.prototype = Object.create(a.prototype),
  33585. o.Extension = I;
  33586. var E = function(e, t, i, n) {
  33587. l.call(this, e, t, i, n),
  33588. this.className = "Service",
  33589. this.clazz = null
  33590. }
  33591. , b = E.prototype = Object.create(l.prototype);
  33592. b.build = function(i) {
  33593. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  33594. for (var n = function(t) {
  33595. e.Builder.Service.call(this),
  33596. this.rpcImpl = t || function(e, t, i) {
  33597. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33598. }
  33599. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  33600. !function(e) {
  33601. r[e.name] = function(n, r) {
  33602. try {
  33603. try {
  33604. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  33605. } catch (e) {
  33606. if (!(e instanceof TypeError))
  33607. throw e
  33608. }
  33609. if (null === n || "object" != typeof n)
  33610. throw Error("Illegal arguments");
  33611. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  33612. this.rpcImpl(e.fqn(), n, function(t, n) {
  33613. if (t)
  33614. return void r(t);
  33615. null === n && (n = "");
  33616. try {
  33617. n = e.resolvedResponseType.clazz.decode(n)
  33618. } catch (e) {}
  33619. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  33620. })
  33621. } catch (e) {
  33622. setTimeout(r.bind(this, e), 0)
  33623. }
  33624. }
  33625. ,
  33626. n[e.name] = function(t, i, r) {
  33627. new n(t)[e.name](i, r)
  33628. }
  33629. ,
  33630. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  33631. value: e.buildOpt()
  33632. }),
  33633. Object.defineProperty(r[e.name], "$options", {
  33634. value: n[e.name].$options
  33635. }))
  33636. }(o[a]);
  33637. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  33638. value: i.buildOpt()
  33639. }),
  33640. Object.defineProperty(r, "$options", {
  33641. value: n.$options
  33642. }),
  33643. Object.defineProperty(n, "$type", {
  33644. value: i
  33645. }),
  33646. Object.defineProperty(r, "$type", {
  33647. value: i
  33648. })),
  33649. n
  33650. }(e, this)
  33651. }
  33652. ,
  33653. o.Service = E;
  33654. var w = function(e, t, i, n) {
  33655. a.call(this, e, t, i),
  33656. this.className = "Service.Method",
  33657. this.options = n || {}
  33658. }
  33659. , _ = w.prototype = Object.create(a.prototype);
  33660. _.buildOpt = c.buildOpt,
  33661. o.Service.Method = w;
  33662. var T = function(e, t, i, n, r, o, a, s) {
  33663. w.call(this, e, t, i, s),
  33664. this.className = "Service.RPCMethod",
  33665. this.requestName = n,
  33666. this.responseName = r,
  33667. this.requestStream = o,
  33668. this.responseStream = a,
  33669. this.resolvedRequestType = null,
  33670. this.resolvedResponseType = null
  33671. };
  33672. return T.prototype = Object.create(w.prototype),
  33673. o.Service.RPCMethod = T,
  33674. o
  33675. }(r),
  33676. r.Builder = function(t, i, n) {
  33677. function r(e) {
  33678. e.messages && e.messages.forEach(function(t) {
  33679. t.syntax = e.syntax,
  33680. r(t)
  33681. }),
  33682. e.enums && e.enums.forEach(function(t) {
  33683. t.syntax = e.syntax
  33684. })
  33685. }
  33686. var o = function(e) {
  33687. this.ns = new n.Namespace(this,null,""),
  33688. this.ptr = this.ns,
  33689. this.resolved = !1,
  33690. this.result = null,
  33691. this.files = {},
  33692. this.importRoot = null,
  33693. this.options = e || {}
  33694. }
  33695. , a = o.prototype;
  33696. return o.isMessage = function(e) {
  33697. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  33698. }
  33699. ,
  33700. o.isMessageField = function(e) {
  33701. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  33702. }
  33703. ,
  33704. o.isEnum = function(e) {
  33705. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33706. }
  33707. ,
  33708. o.isService = function(e) {
  33709. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33710. }
  33711. ,
  33712. o.isExtend = function(e) {
  33713. return "string" == typeof e.ref
  33714. }
  33715. ,
  33716. a.reset = function() {
  33717. return this.ptr = this.ns,
  33718. this
  33719. }
  33720. ,
  33721. a.define = function(e) {
  33722. if ("string" != typeof e || !i.TYPEREF.test(e))
  33723. throw Error("illegal namespace: " + e);
  33724. return e.split(".").forEach(function(e) {
  33725. var t = this.ptr.getChild(e);
  33726. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  33727. this.ptr = t
  33728. }, this),
  33729. this
  33730. }
  33731. ,
  33732. a.create = function(e) {
  33733. if (!e)
  33734. return this;
  33735. if (Array.isArray(e)) {
  33736. if (0 === e.length)
  33737. return this;
  33738. e = e.slice()
  33739. } else
  33740. e = [e];
  33741. for (var i = [e]; i.length > 0; ) {
  33742. if (e = i.pop(),
  33743. !Array.isArray(e))
  33744. throw Error("not a valid namespace: " + JSON.stringify(e));
  33745. for (; e.length > 0; ) {
  33746. var r = e.shift();
  33747. if (o.isMessage(r)) {
  33748. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  33749. , s = {};
  33750. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  33751. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  33752. }, this),
  33753. r.fields && r.fields.forEach(function(e) {
  33754. if (null !== a.getChild(0 | e.id))
  33755. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  33756. if (e.options && "object" != typeof e.options)
  33757. throw Error("illegal field options in " + a.name + "#" + e.name);
  33758. var t = null;
  33759. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  33760. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  33761. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  33762. t && t.fields.push(e),
  33763. a.addChild(e)
  33764. }, this);
  33765. var l = [];
  33766. if (r.enums && r.enums.forEach(function(e) {
  33767. l.push(e)
  33768. }),
  33769. r.messages && r.messages.forEach(function(e) {
  33770. l.push(e)
  33771. }),
  33772. r.services && r.services.forEach(function(e) {
  33773. l.push(e)
  33774. }),
  33775. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  33776. this.ptr.addChild(a),
  33777. l.length > 0) {
  33778. i.push(e),
  33779. e = l,
  33780. l = null,
  33781. this.ptr = a,
  33782. a = null;
  33783. continue
  33784. }
  33785. l = null
  33786. } else if (o.isEnum(r))
  33787. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  33788. r.values.forEach(function(e) {
  33789. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  33790. }, this),
  33791. this.ptr.addChild(a);
  33792. else if (o.isService(r))
  33793. a = new n.Service(this,this.ptr,r.name,r.options),
  33794. Object.keys(r.rpc).forEach(function(e) {
  33795. var t = r.rpc[e];
  33796. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33797. }, this),
  33798. this.ptr.addChild(a);
  33799. else {
  33800. if (!o.isExtend(r))
  33801. throw Error("not a valid definition: " + JSON.stringify(r));
  33802. if (a = this.ptr.resolve(r.ref, !0))
  33803. r.fields.forEach(function(e) {
  33804. if (null !== a.getChild(0 | e.id))
  33805. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  33806. if (a.extensions) {
  33807. var i = !1;
  33808. if (a.extensions.forEach(function(t) {
  33809. e.id >= t[0] && e.id <= t[1] && (i = !0)
  33810. }),
  33811. !i)
  33812. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  33813. }
  33814. var r = e.name;
  33815. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  33816. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  33817. , s = new n.Extension(this,this.ptr,e.name,o);
  33818. o.extension = s,
  33819. this.ptr.addChild(s),
  33820. a.addChild(o)
  33821. }, this);
  33822. else if (!/\.?google\.protobuf\./.test(r.ref))
  33823. throw Error("extended message " + r.ref + " is not defined")
  33824. }
  33825. r = null,
  33826. a = null
  33827. }
  33828. e = null,
  33829. this.ptr = this.ptr.parent
  33830. }
  33831. return this.resolved = !1,
  33832. this.result = null,
  33833. this
  33834. }
  33835. ,
  33836. a.import = function(i, n) {
  33837. var o = "/";
  33838. if ("string" == typeof n) {
  33839. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  33840. this.files[n] === !0)
  33841. return this.reset();
  33842. this.files[n] = !0
  33843. } else if ("object" == typeof n) {
  33844. var a = n.root;
  33845. t.Util.IS_NODE && (a = e("path").resolve(a)),
  33846. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  33847. var s = a + o + n.file;
  33848. if (this.files[s] === !0)
  33849. return this.reset();
  33850. this.files[s] = !0
  33851. }
  33852. if (i.imports && i.imports.length > 0) {
  33853. var l, c = !1;
  33854. "object" == typeof n ? (this.importRoot = n.root,
  33855. c = !0,
  33856. l = this.importRoot,
  33857. n = n.file,
  33858. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  33859. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  33860. o = "\\") : l = "." : l = null;
  33861. for (var h = 0; h < i.imports.length; h++)
  33862. if ("string" == typeof i.imports[h]) {
  33863. if (!l)
  33864. throw Error("cannot determine import root");
  33865. var u = i.imports[h];
  33866. if ("google/protobuf/descriptor.proto" === u)
  33867. continue;
  33868. if (u = l + o + u,
  33869. this.files[u] === !0)
  33870. continue;
  33871. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  33872. var d = t.Util.fetch(u);
  33873. if (null === d)
  33874. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  33875. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  33876. } else
  33877. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  33878. return t + "_import" + h + "." + i
  33879. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  33880. c && (this.importRoot = null)
  33881. }
  33882. i.package && this.define(i.package),
  33883. i.syntax && r(i);
  33884. var p = this.ptr;
  33885. return i.options && Object.keys(i.options).forEach(function(e) {
  33886. p.options[e] = i.options[e]
  33887. }),
  33888. i.messages && (this.create(i.messages),
  33889. this.ptr = p),
  33890. i.enums && (this.create(i.enums),
  33891. this.ptr = p),
  33892. i.services && (this.create(i.services),
  33893. this.ptr = p),
  33894. i.extends && this.create(i.extends),
  33895. this.reset()
  33896. }
  33897. ,
  33898. a.resolveAll = function() {
  33899. var e;
  33900. if (null == this.ptr || "object" == typeof this.ptr.type)
  33901. return this;
  33902. if (this.ptr instanceof n.Namespace)
  33903. this.ptr.children.forEach(function(e) {
  33904. this.ptr = e,
  33905. this.resolveAll()
  33906. }, this);
  33907. else if (this.ptr instanceof n.Message.Field) {
  33908. if (i.TYPE.test(this.ptr.type))
  33909. this.ptr.type = t.TYPES[this.ptr.type];
  33910. else {
  33911. if (!i.TYPEREF.test(this.ptr.type))
  33912. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33913. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  33914. !e)
  33915. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33916. if (this.ptr.resolvedType = e,
  33917. e instanceof n.Enum) {
  33918. if (this.ptr.type = t.TYPES.enum,
  33919. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  33920. throw Error("proto3 message cannot reference proto2 enum")
  33921. } else {
  33922. if (!(e instanceof n.Message))
  33923. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33924. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  33925. }
  33926. }
  33927. if (this.ptr.map) {
  33928. if (!i.TYPE.test(this.ptr.keyType))
  33929. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  33930. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  33931. }
  33932. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  33933. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  33934. throw Error("illegal service type in " + this.ptr.toString(!0));
  33935. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  33936. !(e && e instanceof t.Reflect.Message))
  33937. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  33938. if (this.ptr.resolvedRequestType = e,
  33939. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  33940. !(e && e instanceof t.Reflect.Message))
  33941. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  33942. this.ptr.resolvedResponseType = e
  33943. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  33944. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  33945. return this.reset()
  33946. }
  33947. ,
  33948. a.build = function(e) {
  33949. if (this.reset(),
  33950. this.resolved || (this.resolveAll(),
  33951. this.resolved = !0,
  33952. this.result = null),
  33953. null === this.result && (this.result = this.ns.build()),
  33954. !e)
  33955. return this.result;
  33956. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  33957. if (!i[t[n]]) {
  33958. i = null;
  33959. break
  33960. }
  33961. i = i[t[n]]
  33962. }
  33963. return i
  33964. }
  33965. ,
  33966. a.lookup = function(e, t) {
  33967. return e ? this.ns.resolve(e, t) : this.ns
  33968. }
  33969. ,
  33970. a.toString = function() {
  33971. return "Builder"
  33972. }
  33973. ,
  33974. o.Message = function() {}
  33975. ,
  33976. o.Enum = function() {}
  33977. ,
  33978. o.Service = function() {}
  33979. ,
  33980. o
  33981. }(r, r.Lang, r.Reflect),
  33982. r.Map = function(e, t) {
  33983. function i(e) {
  33984. var t = 0;
  33985. return {
  33986. next: function() {
  33987. return t < e.length ? {
  33988. done: !1,
  33989. value: e[t++]
  33990. } : {
  33991. done: !0
  33992. }
  33993. }
  33994. }
  33995. }
  33996. var n = function(e, i) {
  33997. if (!e.map)
  33998. throw Error("field is not a map");
  33999. if (this.field = e,
  34000. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  34001. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  34002. this.map = {},
  34003. Object.defineProperty(this, "size", {
  34004. get: function() {
  34005. return Object.keys(this.map).length
  34006. }
  34007. }),
  34008. i)
  34009. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  34010. var o = this.keyElem.valueFromString(n[r])
  34011. , a = this.valueElem.verifyValue(i[n[r]]);
  34012. this.map[this.keyElem.valueToString(o)] = {
  34013. key: o,
  34014. value: a
  34015. }
  34016. }
  34017. }
  34018. , r = n.prototype;
  34019. return r.clear = function() {
  34020. this.map = {}
  34021. }
  34022. ,
  34023. r.delete = function(e) {
  34024. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34025. , i = t in this.map;
  34026. return delete this.map[t],
  34027. i
  34028. }
  34029. ,
  34030. r.entries = function() {
  34031. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  34032. t.push([(e = this.map[n[r]]).key, e.value]);
  34033. return i(t)
  34034. }
  34035. ,
  34036. r.keys = function() {
  34037. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34038. e.push(this.map[t[n]].key);
  34039. return i(e)
  34040. }
  34041. ,
  34042. r.values = function() {
  34043. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34044. e.push(this.map[t[n]].value);
  34045. return i(e)
  34046. }
  34047. ,
  34048. r.forEach = function(e, t) {
  34049. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34050. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34051. }
  34052. ,
  34053. r.set = function(e, t) {
  34054. var i = this.keyElem.verifyValue(e)
  34055. , n = this.valueElem.verifyValue(t);
  34056. return this.map[this.keyElem.valueToString(i)] = {
  34057. key: i,
  34058. value: n
  34059. },
  34060. this
  34061. }
  34062. ,
  34063. r.get = function(e) {
  34064. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34065. if (t in this.map)
  34066. return this.map[t].value
  34067. }
  34068. ,
  34069. r.has = function(e) {
  34070. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34071. return t in this.map
  34072. }
  34073. ,
  34074. n
  34075. }(r, r.Reflect),
  34076. r.loadProto = function(e, t, i) {
  34077. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34078. t = void 0),
  34079. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  34080. }
  34081. ,
  34082. r.protoFromString = r.loadProto,
  34083. r.loadProtoFile = function(e, t, i) {
  34084. if (t && "object" == typeof t ? (i = t,
  34085. t = null) : t && "function" == typeof t || (t = null),
  34086. t)
  34087. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34088. if (null === n)
  34089. return void t(Error("Failed to fetch file"));
  34090. try {
  34091. t(null, r.loadProto(n, i, e))
  34092. } catch (e) {
  34093. t(e)
  34094. }
  34095. });
  34096. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34097. return null === n ? null : r.loadProto(n, i, e)
  34098. }
  34099. ,
  34100. r.protoFromFile = r.loadProtoFile,
  34101. r.newBuilder = function(e) {
  34102. return e = e || {},
  34103. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  34104. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  34105. new r.Builder(e)
  34106. }
  34107. ,
  34108. r.loadJson = function(e, t, i) {
  34109. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34110. t = null),
  34111. t && "object" == typeof t || (t = r.newBuilder()),
  34112. "string" == typeof e && (e = JSON.parse(e)),
  34113. t.import(e, i),
  34114. t.resolveAll(),
  34115. t
  34116. }
  34117. ,
  34118. r.loadJsonFile = function(e, t, i) {
  34119. if (t && "object" == typeof t ? (i = t,
  34120. t = null) : t && "function" == typeof t || (t = null),
  34121. t)
  34122. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34123. if (null === n)
  34124. return void t(Error("Failed to fetch file"));
  34125. try {
  34126. t(null, r.loadJson(JSON.parse(n), i, e))
  34127. } catch (e) {
  34128. t(e)
  34129. }
  34130. });
  34131. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34132. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  34133. }
  34134. ,
  34135. r
  34136. })
  34137. }
  34138. ).call(this, e("_process"))
  34139. }
  34140. , {
  34141. _process: 203,
  34142. bytebuffer: 215,
  34143. fs: 197,
  34144. path: 197
  34145. }],
  34146. 215: [function(e, t, i) {//bytebuffer
  34147. !function(i, n) {
  34148. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  34149. var t;
  34150. try {
  34151. t = e("long")
  34152. } catch (e) {}
  34153. return n(t)
  34154. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  34155. }(this, function(e) {
  34156. "use strict";
  34157. function t(e) {
  34158. var t = 0;
  34159. return function() {
  34160. return t < e.length ? e.charCodeAt(t++) : null
  34161. }
  34162. }
  34163. function i() {
  34164. var e = []
  34165. , t = [];
  34166. return function() {
  34167. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  34168. e.length = 0),
  34169. void Array.prototype.push.apply(e, arguments))
  34170. }
  34171. }
  34172. function n(e, t, i, n, r) {
  34173. 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];
  34174. for (u += d,
  34175. o = p & (1 << -h) - 1,
  34176. p >>= -h,
  34177. h += s; h > 0; o = 256 * o + e[t + u],
  34178. u += d,
  34179. h -= 8)
  34180. ;
  34181. for (a = o & (1 << -h) - 1,
  34182. o >>= -h,
  34183. h += n; h > 0; a = 256 * a + e[t + u],
  34184. u += d,
  34185. h -= 8)
  34186. ;
  34187. if (0 === o)
  34188. o = 1 - c;
  34189. else {
  34190. if (o === l)
  34191. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  34192. a += Math.pow(2, n),
  34193. o -= c
  34194. }
  34195. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34196. }
  34197. function r(e, t, i, n, r, o) {
  34198. 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;
  34199. for (t = Math.abs(t),
  34200. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34201. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34202. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34203. l *= 2),
  34204. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  34205. t * l >= 2 && (a++,
  34206. l /= 2),
  34207. a + u >= h ? (s = 0,
  34208. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  34209. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34210. a = 0)); r >= 8; e[i + p] = 255 & s,
  34211. p += f,
  34212. s /= 256,
  34213. r -= 8)
  34214. ;
  34215. for (a = a << r | s,
  34216. c += r; c > 0; e[i + p] = 255 & a,
  34217. p += f,
  34218. a /= 256,
  34219. c -= 8)
  34220. ;
  34221. e[i + p - f] |= 128 * g
  34222. }
  34223. var o = function(e, t, i) {
  34224. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  34225. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  34226. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  34227. !i) {
  34228. if (e |= 0,
  34229. e < 0)
  34230. throw RangeError("Illegal capacity");
  34231. t = !!t,
  34232. i = !!i
  34233. }
  34234. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  34235. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34236. this.offset = 0,
  34237. this.markedOffset = -1,
  34238. this.limit = e,
  34239. this.littleEndian = t,
  34240. this.noAssert = i
  34241. };
  34242. o.VERSION = "5.0.1",
  34243. o.LITTLE_ENDIAN = !0,
  34244. o.BIG_ENDIAN = !1,
  34245. o.DEFAULT_CAPACITY = 16,
  34246. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  34247. o.DEFAULT_NOASSERT = !1,
  34248. o.Long = e || null;
  34249. var a = o.prototype;
  34250. a.__isByteBuffer__,
  34251. Object.defineProperty(a, "__isByteBuffer__", {
  34252. value: !0,
  34253. enumerable: !1,
  34254. configurable: !1
  34255. });
  34256. var s = new ArrayBuffer(0)
  34257. , l = String.fromCharCode;
  34258. o.accessor = function() {
  34259. return Uint8Array
  34260. }
  34261. ,
  34262. o.allocate = function(e, t, i) {
  34263. return new o(e,t,i)
  34264. }
  34265. ,
  34266. o.concat = function(e, t, i, n) {
  34267. "boolean" != typeof t && "string" == typeof t || (n = i,
  34268. i = t,
  34269. t = void 0);
  34270. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  34271. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  34272. r = e[s].limit - e[s].offset,
  34273. r > 0 && (a += r);
  34274. if (0 === a)
  34275. return new o(0,i,n);
  34276. var c, h = new o(a,i,n);
  34277. for (s = 0; s < l; )
  34278. c = e[s++],
  34279. r = c.limit - c.offset,
  34280. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  34281. h.offset += r);
  34282. return h.limit = h.offset,
  34283. h.offset = 0,
  34284. h
  34285. }
  34286. ,
  34287. o.isByteBuffer = function(e) {
  34288. return (e && e.__isByteBuffer__) === !0
  34289. }
  34290. ,
  34291. o.type = function() {
  34292. return ArrayBuffer
  34293. }
  34294. ,
  34295. o.wrap = function(e, t, i, n) {
  34296. if ("string" != typeof t && (n = i,
  34297. i = t,
  34298. t = void 0),
  34299. "string" == typeof e)
  34300. switch ("undefined" == typeof t && (t = "utf8"),
  34301. t) {
  34302. case "base64":
  34303. return o.fromBase64(e, i);
  34304. case "hex":
  34305. return o.fromHex(e, i);
  34306. case "binary":
  34307. return o.fromBinary(e, i);
  34308. case "utf8":
  34309. return o.fromUTF8(e, i);
  34310. case "debug":
  34311. return o.fromDebug(e, i);
  34312. default:
  34313. throw Error("Unsupported encoding: " + t)
  34314. }
  34315. if (null === e || "object" != typeof e)
  34316. throw TypeError("Illegal buffer");
  34317. var r;
  34318. if (o.isByteBuffer(e))
  34319. return r = a.clone.call(e),
  34320. r.markedOffset = -1,
  34321. r;
  34322. if (e instanceof Uint8Array)
  34323. r = new o(0,i,n),
  34324. e.length > 0 && (r.buffer = e.buffer,
  34325. r.offset = e.byteOffset,
  34326. r.limit = e.byteOffset + e.byteLength,
  34327. r.view = new Uint8Array(e.buffer));
  34328. else if (e instanceof ArrayBuffer)
  34329. r = new o(0,i,n),
  34330. e.byteLength > 0 && (r.buffer = e,
  34331. r.offset = 0,
  34332. r.limit = e.byteLength,
  34333. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  34334. else {
  34335. if ("[object Array]" !== Object.prototype.toString.call(e))
  34336. throw TypeError("Illegal buffer");
  34337. r = new o(e.length,i,n),
  34338. r.limit = e.length;
  34339. for (var s = 0; s < e.length; ++s)
  34340. r.view[s] = e[s]
  34341. }
  34342. return r
  34343. }
  34344. ,
  34345. a.writeBitSet = function(e, t) {
  34346. var i = "undefined" == typeof t;
  34347. if (i && (t = this.offset),
  34348. !this.noAssert) {
  34349. if (!(e instanceof Array))
  34350. throw TypeError("Illegal BitSet: Not an array");
  34351. if ("number" != typeof t || t % 1 !== 0)
  34352. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34353. if (t >>>= 0,
  34354. t < 0 || t + 0 > this.buffer.byteLength)
  34355. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34356. }
  34357. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34358. for (t += this.writeVarint32(o, t); a--; )
  34359. 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,
  34360. this.writeByte(n, t++);
  34361. if (s < o) {
  34362. var l = 0;
  34363. for (n = 0; s < o; )
  34364. n |= (1 & !!e[s++]) << l++;
  34365. this.writeByte(n, t++)
  34366. }
  34367. return i ? (this.offset = t,
  34368. this) : t - r
  34369. }
  34370. ,
  34371. a.readBitSet = function(e) {
  34372. var t = "undefined" == typeof e;
  34373. t && (e = this.offset);
  34374. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34375. for (e += n.length; o--; )
  34376. i = this.readByte(e++),
  34377. s[a++] = !!(1 & i),
  34378. s[a++] = !!(2 & i),
  34379. s[a++] = !!(4 & i),
  34380. s[a++] = !!(8 & i),
  34381. s[a++] = !!(16 & i),
  34382. s[a++] = !!(32 & i),
  34383. s[a++] = !!(64 & i),
  34384. s[a++] = !!(128 & i);
  34385. if (a < r) {
  34386. var l = 0;
  34387. for (i = this.readByte(e++); a < r; )
  34388. s[a++] = !!(i >> l++ & 1)
  34389. }
  34390. return t && (this.offset = e),
  34391. s
  34392. }
  34393. ,
  34394. a.readBytes = function(e, t) {
  34395. var i = "undefined" == typeof t;
  34396. if (i && (t = this.offset),
  34397. !this.noAssert) {
  34398. if ("number" != typeof t || t % 1 !== 0)
  34399. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34400. if (t >>>= 0,
  34401. t < 0 || t + e > this.buffer.byteLength)
  34402. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34403. }
  34404. var n = this.slice(t, t + e);
  34405. return i && (this.offset += e),
  34406. n
  34407. }
  34408. ,
  34409. a.writeBytes = a.append,
  34410. a.writeInt8 = function(e, t) {
  34411. var i = "undefined" == typeof t;
  34412. if (i && (t = this.offset),
  34413. !this.noAssert) {
  34414. if ("number" != typeof e || e % 1 !== 0)
  34415. throw TypeError("Illegal value: " + e + " (not an integer)");
  34416. if (e |= 0,
  34417. "number" != typeof t || t % 1 !== 0)
  34418. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34419. if (t >>>= 0,
  34420. t < 0 || t + 0 > this.buffer.byteLength)
  34421. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34422. }
  34423. t += 1;
  34424. var n = this.buffer.byteLength;
  34425. return t > n && this.resize((n *= 2) > t ? n : t),
  34426. t -= 1,
  34427. this.view[t] = e,
  34428. i && (this.offset += 1),
  34429. this
  34430. }
  34431. ,
  34432. a.writeByte = a.writeInt8,
  34433. a.readInt8 = function(e) {
  34434. var t = "undefined" == typeof e;
  34435. if (t && (e = this.offset),
  34436. !this.noAssert) {
  34437. if ("number" != typeof e || e % 1 !== 0)
  34438. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34439. if (e >>>= 0,
  34440. e < 0 || e + 1 > this.buffer.byteLength)
  34441. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34442. }
  34443. var i = this.view[e];
  34444. return 128 === (128 & i) && (i = -(255 - i + 1)),
  34445. t && (this.offset += 1),
  34446. i
  34447. }
  34448. ,
  34449. a.readByte = a.readInt8,
  34450. a.writeUint8 = function(e, t) {
  34451. var i = "undefined" == typeof t;
  34452. if (i && (t = this.offset),
  34453. !this.noAssert) {
  34454. if ("number" != typeof e || e % 1 !== 0)
  34455. throw TypeError("Illegal value: " + e + " (not an integer)");
  34456. if (e >>>= 0,
  34457. "number" != typeof t || t % 1 !== 0)
  34458. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34459. if (t >>>= 0,
  34460. t < 0 || t + 0 > this.buffer.byteLength)
  34461. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34462. }
  34463. t += 1;
  34464. var n = this.buffer.byteLength;
  34465. return t > n && this.resize((n *= 2) > t ? n : t),
  34466. t -= 1,
  34467. this.view[t] = e,
  34468. i && (this.offset += 1),
  34469. this
  34470. }
  34471. ,
  34472. a.writeUInt8 = a.writeUint8,
  34473. a.readUint8 = function(e) {
  34474. var t = "undefined" == typeof e;
  34475. if (t && (e = this.offset),
  34476. !this.noAssert) {
  34477. if ("number" != typeof e || e % 1 !== 0)
  34478. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34479. if (e >>>= 0,
  34480. e < 0 || e + 1 > this.buffer.byteLength)
  34481. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34482. }
  34483. var i = this.view[e];
  34484. return t && (this.offset += 1),
  34485. i
  34486. }
  34487. ,
  34488. a.readUInt8 = a.readUint8,
  34489. a.writeInt16 = function(e, t) {
  34490. var i = "undefined" == typeof t;
  34491. if (i && (t = this.offset),
  34492. !this.noAssert) {
  34493. if ("number" != typeof e || e % 1 !== 0)
  34494. throw TypeError("Illegal value: " + e + " (not an integer)");
  34495. if (e |= 0,
  34496. "number" != typeof t || t % 1 !== 0)
  34497. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34498. if (t >>>= 0,
  34499. t < 0 || t + 0 > this.buffer.byteLength)
  34500. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34501. }
  34502. t += 2;
  34503. var n = this.buffer.byteLength;
  34504. return t > n && this.resize((n *= 2) > t ? n : t),
  34505. t -= 2,
  34506. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34507. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34508. this.view[t + 1] = 255 & e),
  34509. i && (this.offset += 2),
  34510. this
  34511. }
  34512. ,
  34513. a.writeShort = a.writeInt16,
  34514. a.readInt16 = function(e) {
  34515. var t = "undefined" == typeof e;
  34516. if (t && (e = this.offset),
  34517. !this.noAssert) {
  34518. if ("number" != typeof e || e % 1 !== 0)
  34519. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34520. if (e >>>= 0,
  34521. e < 0 || e + 2 > this.buffer.byteLength)
  34522. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34523. }
  34524. var i = 0;
  34525. return this.littleEndian ? (i = this.view[e],
  34526. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34527. i |= this.view[e + 1]),
  34528. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  34529. t && (this.offset += 2),
  34530. i
  34531. }
  34532. ,
  34533. a.readShort = a.readInt16,
  34534. a.writeUint16 = function(e, t) {
  34535. var i = "undefined" == typeof t;
  34536. if (i && (t = this.offset),
  34537. !this.noAssert) {
  34538. if ("number" != typeof e || e % 1 !== 0)
  34539. throw TypeError("Illegal value: " + e + " (not an integer)");
  34540. if (e >>>= 0,
  34541. "number" != typeof t || t % 1 !== 0)
  34542. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34543. if (t >>>= 0,
  34544. t < 0 || t + 0 > this.buffer.byteLength)
  34545. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34546. }
  34547. t += 2;
  34548. var n = this.buffer.byteLength;
  34549. return t > n && this.resize((n *= 2) > t ? n : t),
  34550. t -= 2,
  34551. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34552. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34553. this.view[t + 1] = 255 & e),
  34554. i && (this.offset += 2),
  34555. this
  34556. }
  34557. ,
  34558. a.writeUInt16 = a.writeUint16,
  34559. a.readUint16 = function(e) {
  34560. var t = "undefined" == typeof e;
  34561. if (t && (e = this.offset),
  34562. !this.noAssert) {
  34563. if ("number" != typeof e || e % 1 !== 0)
  34564. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34565. if (e >>>= 0,
  34566. e < 0 || e + 2 > this.buffer.byteLength)
  34567. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34568. }
  34569. var i = 0;
  34570. return this.littleEndian ? (i = this.view[e],
  34571. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34572. i |= this.view[e + 1]),
  34573. t && (this.offset += 2),
  34574. i
  34575. }
  34576. ,
  34577. a.readUInt16 = a.readUint16,
  34578. a.writeInt32 = function(e, t) {
  34579. var i = "undefined" == typeof t;
  34580. if (i && (t = this.offset),
  34581. !this.noAssert) {
  34582. if ("number" != typeof e || e % 1 !== 0)
  34583. throw TypeError("Illegal value: " + e + " (not an integer)");
  34584. if (e |= 0,
  34585. "number" != typeof t || t % 1 !== 0)
  34586. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34587. if (t >>>= 0,
  34588. t < 0 || t + 0 > this.buffer.byteLength)
  34589. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34590. }
  34591. t += 4;
  34592. var n = this.buffer.byteLength;
  34593. return t > n && this.resize((n *= 2) > t ? n : t),
  34594. t -= 4,
  34595. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34596. this.view[t + 2] = e >>> 16 & 255,
  34597. this.view[t + 1] = e >>> 8 & 255,
  34598. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34599. this.view[t + 1] = e >>> 16 & 255,
  34600. this.view[t + 2] = e >>> 8 & 255,
  34601. this.view[t + 3] = 255 & e),
  34602. i && (this.offset += 4),
  34603. this
  34604. }
  34605. ,
  34606. a.writeInt = a.writeInt32,
  34607. a.readInt32 = function(e) {
  34608. var t = "undefined" == typeof e;
  34609. if (t && (e = this.offset),
  34610. !this.noAssert) {
  34611. if ("number" != typeof e || e % 1 !== 0)
  34612. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34613. if (e >>>= 0,
  34614. e < 0 || e + 4 > this.buffer.byteLength)
  34615. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34616. }
  34617. var i = 0;
  34618. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34619. i |= this.view[e + 1] << 8,
  34620. i |= this.view[e],
  34621. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34622. i |= this.view[e + 2] << 8,
  34623. i |= this.view[e + 3],
  34624. i += this.view[e] << 24 >>> 0),
  34625. i |= 0,
  34626. t && (this.offset += 4),
  34627. i
  34628. }
  34629. ,
  34630. a.readInt = a.readInt32,
  34631. a.writeUint32 = function(e, t) {
  34632. var i = "undefined" == typeof t;
  34633. if (i && (t = this.offset),
  34634. !this.noAssert) {
  34635. if ("number" != typeof e || e % 1 !== 0)
  34636. throw TypeError("Illegal value: " + e + " (not an integer)");
  34637. if (e >>>= 0,
  34638. "number" != typeof t || t % 1 !== 0)
  34639. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34640. if (t >>>= 0,
  34641. t < 0 || t + 0 > this.buffer.byteLength)
  34642. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34643. }
  34644. t += 4;
  34645. var n = this.buffer.byteLength;
  34646. return t > n && this.resize((n *= 2) > t ? n : t),
  34647. t -= 4,
  34648. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34649. this.view[t + 2] = e >>> 16 & 255,
  34650. this.view[t + 1] = e >>> 8 & 255,
  34651. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34652. this.view[t + 1] = e >>> 16 & 255,
  34653. this.view[t + 2] = e >>> 8 & 255,
  34654. this.view[t + 3] = 255 & e),
  34655. i && (this.offset += 4),
  34656. this
  34657. }
  34658. ,
  34659. a.writeUInt32 = a.writeUint32,
  34660. a.readUint32 = function(e) {
  34661. var t = "undefined" == typeof e;
  34662. if (t && (e = this.offset),
  34663. !this.noAssert) {
  34664. if ("number" != typeof e || e % 1 !== 0)
  34665. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34666. if (e >>>= 0,
  34667. e < 0 || e + 4 > this.buffer.byteLength)
  34668. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34669. }
  34670. var i = 0;
  34671. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34672. i |= this.view[e + 1] << 8,
  34673. i |= this.view[e],
  34674. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34675. i |= this.view[e + 2] << 8,
  34676. i |= this.view[e + 3],
  34677. i += this.view[e] << 24 >>> 0),
  34678. t && (this.offset += 4),
  34679. i
  34680. }
  34681. ,
  34682. a.readUInt32 = a.readUint32,
  34683. e && (a.writeInt64 = function(t, i) {
  34684. var n = "undefined" == typeof i;
  34685. if (n && (i = this.offset),
  34686. !this.noAssert) {
  34687. if ("number" == typeof t)
  34688. t = e.fromNumber(t);
  34689. else if ("string" == typeof t)
  34690. t = e.fromString(t);
  34691. else if (!(t && t instanceof e))
  34692. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  34693. if ("number" != typeof i || i % 1 !== 0)
  34694. throw TypeError("Illegal offset: " + i + " (not an integer)");
  34695. if (i >>>= 0,
  34696. i < 0 || i + 0 > this.buffer.byteLength)
  34697. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  34698. }
  34699. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  34700. i += 8;
  34701. var r = this.buffer.byteLength;
  34702. i > r && this.resize((r *= 2) > i ? r : i),
  34703. i -= 8;
  34704. var o = t.low
  34705. , a = t.high;
  34706. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  34707. this.view[i + 2] = o >>> 16 & 255,
  34708. this.view[i + 1] = o >>> 8 & 255,
  34709. this.view[i] = 255 & o,
  34710. i += 4,
  34711. this.view[i + 3] = a >>> 24 & 255,
  34712. this.view[i + 2] = a >>> 16 & 255,
  34713. this.view[i + 1] = a >>> 8 & 255,
  34714. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  34715. this.view[i + 1] = a >>> 16 & 255,
  34716. this.view[i + 2] = a >>> 8 & 255,
  34717. this.view[i + 3] = 255 & a,
  34718. i += 4,
  34719. this.view[i] = o >>> 24 & 255,
  34720. this.view[i + 1] = o >>> 16 & 255,
  34721. this.view[i + 2] = o >>> 8 & 255,
  34722. this.view[i + 3] = 255 & o),
  34723. n && (this.offset += 8),
  34724. this
  34725. }
  34726. ,
  34727. a.writeLong = a.writeInt64,
  34728. a.readInt64 = function(t) {
  34729. var i = "undefined" == typeof t;
  34730. if (i && (t = this.offset),
  34731. !this.noAssert) {
  34732. if ("number" != typeof t || t % 1 !== 0)
  34733. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34734. if (t >>>= 0,
  34735. t < 0 || t + 8 > this.buffer.byteLength)
  34736. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  34737. }
  34738. var n = 0
  34739. , r = 0;
  34740. this.littleEndian ? (n = this.view[t + 2] << 16,
  34741. n |= this.view[t + 1] << 8,
  34742. n |= this.view[t],
  34743. n += this.view[t + 3] << 24 >>> 0,
  34744. t += 4,
  34745. r = this.view[t + 2] << 16,
  34746. r |= this.view[t + 1] << 8,
  34747. r |= this.view[t],
  34748. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  34749. r |= this.view[t + 2] << 8,
  34750. r |= this.view[t + 3],
  34751. r += this.view[t] << 24 >>> 0,
  34752. t += 4,
  34753. n = this.view[t + 1] << 16,
  34754. n |= this.view[t + 2] << 8,
  34755. n |= this.view[t + 3],
  34756. n += this.view[t] << 24 >>> 0);
  34757. var o = new e(n,r,!1);
  34758. return i && (this.offset += 8),
  34759. o
  34760. }
  34761. ,
  34762. a.readLong = a.readInt64,
  34763. a.writeUint64 = function(t, i) {
  34764. var n = "undefined" == typeof i;
  34765. if (n && (i = this.offset),
  34766. !this.noAssert) {
  34767. if ("number" == typeof t)
  34768. t = e.fromNumber(t);
  34769. else if ("string" == typeof t)
  34770. t = e.fromString(t);
  34771. else if (!(t && t instanceof e))
  34772. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  34773. if ("number" != typeof i || i % 1 !== 0)
  34774. throw TypeError("Illegal offset: " + i + " (not an integer)");
  34775. if (i >>>= 0,
  34776. i < 0 || i + 0 > this.buffer.byteLength)
  34777. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  34778. }
  34779. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  34780. i += 8;
  34781. var r = this.buffer.byteLength;
  34782. i > r && this.resize((r *= 2) > i ? r : i),
  34783. i -= 8;
  34784. var o = t.low
  34785. , a = t.high;
  34786. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  34787. this.view[i + 2] = o >>> 16 & 255,
  34788. this.view[i + 1] = o >>> 8 & 255,
  34789. this.view[i] = 255 & o,
  34790. i += 4,
  34791. this.view[i + 3] = a >>> 24 & 255,
  34792. this.view[i + 2] = a >>> 16 & 255,
  34793. this.view[i + 1] = a >>> 8 & 255,
  34794. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  34795. this.view[i + 1] = a >>> 16 & 255,
  34796. this.view[i + 2] = a >>> 8 & 255,
  34797. this.view[i + 3] = 255 & a,
  34798. i += 4,
  34799. this.view[i] = o >>> 24 & 255,
  34800. this.view[i + 1] = o >>> 16 & 255,
  34801. this.view[i + 2] = o >>> 8 & 255,
  34802. this.view[i + 3] = 255 & o),
  34803. n && (this.offset += 8),
  34804. this
  34805. }
  34806. ,
  34807. a.writeUInt64 = a.writeUint64,
  34808. a.readUint64 = function(t) {
  34809. var i = "undefined" == typeof t;
  34810. if (i && (t = this.offset),
  34811. !this.noAssert) {
  34812. if ("number" != typeof t || t % 1 !== 0)
  34813. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34814. if (t >>>= 0,
  34815. t < 0 || t + 8 > this.buffer.byteLength)
  34816. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  34817. }
  34818. var n = 0
  34819. , r = 0;
  34820. this.littleEndian ? (n = this.view[t + 2] << 16,
  34821. n |= this.view[t + 1] << 8,
  34822. n |= this.view[t],
  34823. n += this.view[t + 3] << 24 >>> 0,
  34824. t += 4,
  34825. r = this.view[t + 2] << 16,
  34826. r |= this.view[t + 1] << 8,
  34827. r |= this.view[t],
  34828. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  34829. r |= this.view[t + 2] << 8,
  34830. r |= this.view[t + 3],
  34831. r += this.view[t] << 24 >>> 0,
  34832. t += 4,
  34833. n = this.view[t + 1] << 16,
  34834. n |= this.view[t + 2] << 8,
  34835. n |= this.view[t + 3],
  34836. n += this.view[t] << 24 >>> 0);
  34837. var o = new e(n,r,!0);
  34838. return i && (this.offset += 8),
  34839. o
  34840. }
  34841. ,
  34842. a.readUInt64 = a.readUint64),
  34843. a.writeFloat32 = function(e, t) {
  34844. var i = "undefined" == typeof t;
  34845. if (i && (t = this.offset),
  34846. !this.noAssert) {
  34847. if ("number" != typeof e)
  34848. throw TypeError("Illegal value: " + e + " (not a number)");
  34849. if ("number" != typeof t || t % 1 !== 0)
  34850. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34851. if (t >>>= 0,
  34852. t < 0 || t + 0 > this.buffer.byteLength)
  34853. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34854. }
  34855. t += 4;
  34856. var n = this.buffer.byteLength;
  34857. return t > n && this.resize((n *= 2) > t ? n : t),
  34858. t -= 4,
  34859. r(this.view, e, t, this.littleEndian, 23, 4),
  34860. i && (this.offset += 4),
  34861. this
  34862. }
  34863. ,
  34864. a.writeFloat = a.writeFloat32,
  34865. a.readFloat32 = function(e) {
  34866. var t = "undefined" == typeof e;
  34867. if (t && (e = this.offset),
  34868. !this.noAssert) {
  34869. if ("number" != typeof e || e % 1 !== 0)
  34870. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34871. if (e >>>= 0,
  34872. e < 0 || e + 4 > this.buffer.byteLength)
  34873. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34874. }
  34875. var i = n(this.view, e, this.littleEndian, 23, 4);
  34876. return t && (this.offset += 4),
  34877. i
  34878. }
  34879. ,
  34880. a.readFloat = a.readFloat32,
  34881. a.writeFloat64 = function(e, t) {
  34882. var i = "undefined" == typeof t;
  34883. if (i && (t = this.offset),
  34884. !this.noAssert) {
  34885. if ("number" != typeof e)
  34886. throw TypeError("Illegal value: " + e + " (not a number)");
  34887. if ("number" != typeof t || t % 1 !== 0)
  34888. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34889. if (t >>>= 0,
  34890. t < 0 || t + 0 > this.buffer.byteLength)
  34891. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34892. }
  34893. t += 8;
  34894. var n = this.buffer.byteLength;
  34895. return t > n && this.resize((n *= 2) > t ? n : t),
  34896. t -= 8,
  34897. r(this.view, e, t, this.littleEndian, 52, 8),
  34898. i && (this.offset += 8),
  34899. this
  34900. }
  34901. ,
  34902. a.writeDouble = a.writeFloat64,
  34903. a.readFloat64 = function(e) {
  34904. var t = "undefined" == typeof e;
  34905. if (t && (e = this.offset),
  34906. !this.noAssert) {
  34907. if ("number" != typeof e || e % 1 !== 0)
  34908. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34909. if (e >>>= 0,
  34910. e < 0 || e + 8 > this.buffer.byteLength)
  34911. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34912. }
  34913. var i = n(this.view, e, this.littleEndian, 52, 8);
  34914. return t && (this.offset += 8),
  34915. i
  34916. }
  34917. ,
  34918. a.readDouble = a.readFloat64,
  34919. o.MAX_VARINT32_BYTES = 5,
  34920. o.calculateVarint32 = function(e) {
  34921. return e >>>= 0,
  34922. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  34923. }
  34924. ,
  34925. o.zigZagEncode32 = function(e) {
  34926. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  34927. }
  34928. ,
  34929. o.zigZagDecode32 = function(e) {
  34930. return e >>> 1 ^ -(1 & e) | 0
  34931. }
  34932. ,
  34933. a.writeVarint32 = function(e, t) {
  34934. var i = "undefined" == typeof t;
  34935. if (i && (t = this.offset),
  34936. !this.noAssert) {
  34937. if ("number" != typeof e || e % 1 !== 0)
  34938. throw TypeError("Illegal value: " + e + " (not an integer)");
  34939. if (e |= 0,
  34940. "number" != typeof t || t % 1 !== 0)
  34941. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34942. if (t >>>= 0,
  34943. t < 0 || t + 0 > this.buffer.byteLength)
  34944. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34945. }
  34946. var n, r = o.calculateVarint32(e);
  34947. t += r;
  34948. var a = this.buffer.byteLength;
  34949. for (t > a && this.resize((a *= 2) > t ? a : t),
  34950. t -= r,
  34951. e >>>= 0; e >= 128; )
  34952. n = 127 & e | 128,
  34953. this.view[t++] = n,
  34954. e >>>= 7;
  34955. return this.view[t++] = e,
  34956. i ? (this.offset = t,
  34957. this) : r
  34958. }
  34959. ,
  34960. a.writeVarint32ZigZag = function(e, t) {
  34961. return this.writeVarint32(o.zigZagEncode32(e), t)
  34962. }
  34963. ,
  34964. a.readVarint32 = function(e) {
  34965. var t = "undefined" == typeof e;
  34966. if (t && (e = this.offset),
  34967. !this.noAssert) {
  34968. if ("number" != typeof e || e % 1 !== 0)
  34969. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34970. if (e >>>= 0,
  34971. e < 0 || e + 1 > this.buffer.byteLength)
  34972. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34973. }
  34974. var i, n = 0, r = 0;
  34975. do {
  34976. if (!this.noAssert && e > this.limit) {
  34977. var o = Error("Truncated");
  34978. throw o.truncated = !0,
  34979. o
  34980. }
  34981. i = this.view[e++],
  34982. n < 5 && (r |= (127 & i) << 7 * n),
  34983. ++n
  34984. } while (0 !== (128 & i));return r |= 0,
  34985. t ? (this.offset = e,
  34986. r) : {
  34987. value: r,
  34988. length: n
  34989. }
  34990. }
  34991. ,
  34992. a.readVarint32ZigZag = function(e) {
  34993. var t = this.readVarint32(e);
  34994. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  34995. t
  34996. }
  34997. ,
  34998. e && (o.MAX_VARINT64_BYTES = 10,
  34999. o.calculateVarint64 = function(t) {
  35000. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  35001. var i = t.toInt() >>> 0
  35002. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  35003. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  35004. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  35005. }
  35006. ,
  35007. o.zigZagEncode64 = function(t) {
  35008. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35009. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  35010. }
  35011. ,
  35012. o.zigZagDecode64 = function(t) {
  35013. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35014. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  35015. }
  35016. ,
  35017. a.writeVarint64 = function(t, i) {
  35018. var n = "undefined" == typeof i;
  35019. if (n && (i = this.offset),
  35020. !this.noAssert) {
  35021. if ("number" == typeof t)
  35022. t = e.fromNumber(t);
  35023. else if ("string" == typeof t)
  35024. t = e.fromString(t);
  35025. else if (!(t && t instanceof e))
  35026. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35027. if ("number" != typeof i || i % 1 !== 0)
  35028. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35029. if (i >>>= 0,
  35030. i < 0 || i + 0 > this.buffer.byteLength)
  35031. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35032. }
  35033. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  35034. var r = o.calculateVarint64(t)
  35035. , a = t.toInt() >>> 0
  35036. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  35037. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  35038. i += r;
  35039. var c = this.buffer.byteLength;
  35040. switch (i > c && this.resize((c *= 2) > i ? c : i),
  35041. i -= r,
  35042. r) {
  35043. case 10:
  35044. this.view[i + 9] = l >>> 7 & 1;
  35045. case 9:
  35046. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  35047. case 8:
  35048. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  35049. case 7:
  35050. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  35051. case 6:
  35052. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  35053. case 5:
  35054. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  35055. case 4:
  35056. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  35057. case 3:
  35058. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  35059. case 2:
  35060. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  35061. case 1:
  35062. this.view[i] = 1 !== r ? 128 | a : 127 & a
  35063. }
  35064. return n ? (this.offset += r,
  35065. this) : r
  35066. }
  35067. ,
  35068. a.writeVarint64ZigZag = function(e, t) {
  35069. return this.writeVarint64(o.zigZagEncode64(e), t)
  35070. }
  35071. ,
  35072. a.readVarint64 = function(t) {
  35073. var i = "undefined" == typeof t;
  35074. if (i && (t = this.offset),
  35075. !this.noAssert) {
  35076. if ("number" != typeof t || t % 1 !== 0)
  35077. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35078. if (t >>>= 0,
  35079. t < 0 || t + 1 > this.buffer.byteLength)
  35080. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  35081. }
  35082. var n = t
  35083. , r = 0
  35084. , o = 0
  35085. , a = 0
  35086. , s = 0;
  35087. if (s = this.view[t++],
  35088. r = 127 & s,
  35089. 128 & s && (s = this.view[t++],
  35090. r |= (127 & s) << 7,
  35091. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35092. r |= (127 & s) << 14,
  35093. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35094. r |= (127 & s) << 21,
  35095. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35096. o = 127 & s,
  35097. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35098. o |= (127 & s) << 7,
  35099. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35100. o |= (127 & s) << 14,
  35101. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35102. o |= (127 & s) << 21,
  35103. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35104. a = 127 & s,
  35105. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35106. a |= (127 & s) << 7,
  35107. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  35108. throw Error("Buffer overrun");
  35109. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  35110. return i ? (this.offset = t,
  35111. l) : {
  35112. value: l,
  35113. length: t - n
  35114. }
  35115. }
  35116. ,
  35117. a.readVarint64ZigZag = function(t) {
  35118. var i = this.readVarint64(t);
  35119. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  35120. i
  35121. }
  35122. ),
  35123. a.writeCString = function(e, i) {
  35124. var n = "undefined" == typeof i;
  35125. n && (i = this.offset);
  35126. var r, o = e.length;
  35127. if (!this.noAssert) {
  35128. if ("string" != typeof e)
  35129. throw TypeError("Illegal str: Not a string");
  35130. for (r = 0; r < o; ++r)
  35131. if (0 === e.charCodeAt(r))
  35132. throw RangeError("Illegal str: Contains NULL-characters");
  35133. if ("number" != typeof i || i % 1 !== 0)
  35134. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35135. if (i >>>= 0,
  35136. i < 0 || i + 0 > this.buffer.byteLength)
  35137. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35138. }
  35139. o = h.calculateUTF16asUTF8(t(e))[1],
  35140. i += o + 1;
  35141. var a = this.buffer.byteLength;
  35142. return i > a && this.resize((a *= 2) > i ? a : i),
  35143. i -= o + 1,
  35144. h.encodeUTF16toUTF8(t(e), function(e) {
  35145. this.view[i++] = e
  35146. }
  35147. .bind(this)),
  35148. this.view[i++] = 0,
  35149. n ? (this.offset = i,
  35150. this) : o
  35151. }
  35152. ,
  35153. a.readCString = function(e) {
  35154. var t = "undefined" == typeof e;
  35155. if (t && (e = this.offset),
  35156. !this.noAssert) {
  35157. if ("number" != typeof e || e % 1 !== 0)
  35158. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35159. if (e >>>= 0,
  35160. e < 0 || e + 1 > this.buffer.byteLength)
  35161. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35162. }
  35163. var n, r = e, o = -1;
  35164. return h.decodeUTF8toUTF16(function() {
  35165. if (0 === o)
  35166. return null;
  35167. if (e >= this.limit)
  35168. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35169. return o = this.view[e++],
  35170. 0 === o ? null : o
  35171. }
  35172. .bind(this), n = i(), !0),
  35173. t ? (this.offset = e,
  35174. n()) : {
  35175. string: n(),
  35176. length: e - r
  35177. }
  35178. }
  35179. ,
  35180. a.writeIString = function(e, i) {
  35181. var n = "undefined" == typeof i;
  35182. if (n && (i = this.offset),
  35183. !this.noAssert) {
  35184. if ("string" != typeof e)
  35185. throw TypeError("Illegal str: Not a string");
  35186. if ("number" != typeof i || i % 1 !== 0)
  35187. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35188. if (i >>>= 0,
  35189. i < 0 || i + 0 > this.buffer.byteLength)
  35190. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35191. }
  35192. var r, o = i;
  35193. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35194. i += 4 + r;
  35195. var a = this.buffer.byteLength;
  35196. if (i > a && this.resize((a *= 2) > i ? a : i),
  35197. i -= 4 + r,
  35198. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  35199. this.view[i + 2] = r >>> 16 & 255,
  35200. this.view[i + 1] = r >>> 8 & 255,
  35201. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  35202. this.view[i + 1] = r >>> 16 & 255,
  35203. this.view[i + 2] = r >>> 8 & 255,
  35204. this.view[i + 3] = 255 & r),
  35205. i += 4,
  35206. h.encodeUTF16toUTF8(t(e), function(e) {
  35207. this.view[i++] = e
  35208. }
  35209. .bind(this)),
  35210. i !== o + 4 + r)
  35211. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  35212. return n ? (this.offset = i,
  35213. this) : i - o
  35214. }
  35215. ,
  35216. a.readIString = function(e) {
  35217. var t = "undefined" == typeof e;
  35218. if (t && (e = this.offset),
  35219. !this.noAssert) {
  35220. if ("number" != typeof e || e % 1 !== 0)
  35221. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35222. if (e >>>= 0,
  35223. e < 0 || e + 4 > this.buffer.byteLength)
  35224. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35225. }
  35226. var i = e
  35227. , n = this.readUint32(e)
  35228. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  35229. return e += r.length,
  35230. t ? (this.offset = e,
  35231. r.string) : {
  35232. string: r.string,
  35233. length: e - i
  35234. }
  35235. }
  35236. ,
  35237. o.METRICS_CHARS = "c",
  35238. o.METRICS_BYTES = "b",
  35239. a.writeUTF8String = function(e, i) {
  35240. var n = "undefined" == typeof i;
  35241. if (n && (i = this.offset),
  35242. !this.noAssert) {
  35243. if ("number" != typeof i || i % 1 !== 0)
  35244. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35245. if (i >>>= 0,
  35246. i < 0 || i + 0 > this.buffer.byteLength)
  35247. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35248. }
  35249. var r, o = i;
  35250. r = h.calculateUTF16asUTF8(t(e))[1],
  35251. i += r;
  35252. var a = this.buffer.byteLength;
  35253. return i > a && this.resize((a *= 2) > i ? a : i),
  35254. i -= r,
  35255. h.encodeUTF16toUTF8(t(e), function(e) {
  35256. this.view[i++] = e
  35257. }
  35258. .bind(this)),
  35259. n ? (this.offset = i,
  35260. this) : i - o
  35261. }
  35262. ,
  35263. a.writeString = a.writeUTF8String,
  35264. o.calculateUTF8Chars = function(e) {
  35265. return h.calculateUTF16asUTF8(t(e))[0]
  35266. }
  35267. ,
  35268. o.calculateUTF8Bytes = function(e) {
  35269. return h.calculateUTF16asUTF8(t(e))[1]
  35270. }
  35271. ,
  35272. o.calculateString = o.calculateUTF8Bytes,
  35273. a.readUTF8String = function(e, t, n) {
  35274. "number" == typeof t && (n = t,
  35275. t = void 0);
  35276. var r = "undefined" == typeof n;
  35277. if (r && (n = this.offset),
  35278. "undefined" == typeof t && (t = o.METRICS_CHARS),
  35279. !this.noAssert) {
  35280. if ("number" != typeof e || e % 1 !== 0)
  35281. throw TypeError("Illegal length: " + e + " (not an integer)");
  35282. if (e |= 0,
  35283. "number" != typeof n || n % 1 !== 0)
  35284. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35285. if (n >>>= 0,
  35286. n < 0 || n + 0 > this.buffer.byteLength)
  35287. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  35288. }
  35289. var a, s = 0, l = n;
  35290. if (t === o.METRICS_CHARS) {
  35291. if (a = i(),
  35292. h.decodeUTF8(function() {
  35293. return s < e && n < this.limit ? this.view[n++] : null
  35294. }
  35295. .bind(this), function(e) {
  35296. ++s,
  35297. h.UTF8toUTF16(e, a)
  35298. }),
  35299. s !== e)
  35300. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  35301. return r ? (this.offset = n,
  35302. a()) : {
  35303. string: a(),
  35304. length: n - l
  35305. }
  35306. }
  35307. if (t === o.METRICS_BYTES) {
  35308. if (!this.noAssert) {
  35309. if ("number" != typeof n || n % 1 !== 0)
  35310. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35311. if (n >>>= 0,
  35312. n < 0 || n + e > this.buffer.byteLength)
  35313. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  35314. }
  35315. var c = n + e;
  35316. if (h.decodeUTF8toUTF16(function() {
  35317. return n < c ? this.view[n++] : null
  35318. }
  35319. .bind(this), a = i(), this.noAssert),
  35320. n !== c)
  35321. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  35322. return r ? (this.offset = n,
  35323. a()) : {
  35324. string: a(),
  35325. length: n - l
  35326. }
  35327. }
  35328. throw TypeError("Unsupported metrics: " + t)
  35329. }
  35330. ,
  35331. a.readString = a.readUTF8String,
  35332. a.writeVString = function(e, i) {
  35333. var n = "undefined" == typeof i;
  35334. if (n && (i = this.offset),
  35335. !this.noAssert) {
  35336. if ("string" != typeof e)
  35337. throw TypeError("Illegal str: Not a string");
  35338. if ("number" != typeof i || i % 1 !== 0)
  35339. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35340. if (i >>>= 0,
  35341. i < 0 || i + 0 > this.buffer.byteLength)
  35342. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35343. }
  35344. var r, a, s = i;
  35345. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35346. a = o.calculateVarint32(r),
  35347. i += a + r;
  35348. var l = this.buffer.byteLength;
  35349. if (i > l && this.resize((l *= 2) > i ? l : i),
  35350. i -= a + r,
  35351. i += this.writeVarint32(r, i),
  35352. h.encodeUTF16toUTF8(t(e), function(e) {
  35353. this.view[i++] = e
  35354. }
  35355. .bind(this)),
  35356. i !== s + r + a)
  35357. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  35358. return n ? (this.offset = i,
  35359. this) : i - s
  35360. }
  35361. ,
  35362. a.readVString = function(e) {
  35363. var t = "undefined" == typeof e;
  35364. if (t && (e = this.offset),
  35365. !this.noAssert) {
  35366. if ("number" != typeof e || e % 1 !== 0)
  35367. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35368. if (e >>>= 0,
  35369. e < 0 || e + 1 > this.buffer.byteLength)
  35370. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35371. }
  35372. var i = e
  35373. , n = this.readVarint32(e)
  35374. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  35375. return e += r.length,
  35376. t ? (this.offset = e,
  35377. r.string) : {
  35378. string: r.string,
  35379. length: e - i
  35380. }
  35381. }
  35382. ,
  35383. a.append = function(e, t, i) {
  35384. "number" != typeof t && "string" == typeof t || (i = t,
  35385. t = void 0);
  35386. var n = "undefined" == typeof i;
  35387. if (n && (i = this.offset),
  35388. !this.noAssert) {
  35389. if ("number" != typeof i || i % 1 !== 0)
  35390. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35391. if (i >>>= 0,
  35392. i < 0 || i + 0 > this.buffer.byteLength)
  35393. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35394. }
  35395. e instanceof o || (e = o.wrap(e, t));
  35396. var r = e.limit - e.offset;
  35397. if (r <= 0)
  35398. return this;
  35399. i += r;
  35400. var a = this.buffer.byteLength;
  35401. return i > a && this.resize((a *= 2) > i ? a : i),
  35402. i -= r,
  35403. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35404. e.offset += r,
  35405. n && (this.offset += r),
  35406. this
  35407. }
  35408. ,
  35409. a.appendTo = function(e, t) {
  35410. return e.append(this, t),
  35411. this
  35412. }
  35413. ,
  35414. a.assert = function(e) {
  35415. return this.noAssert = !e,
  35416. this
  35417. }
  35418. ,
  35419. a.capacity = function() {
  35420. return this.buffer.byteLength
  35421. }
  35422. ,
  35423. a.clear = function() {
  35424. return this.offset = 0,
  35425. this.limit = this.buffer.byteLength,
  35426. this.markedOffset = -1,
  35427. this
  35428. }
  35429. ,
  35430. a.clone = function(e) {
  35431. var t = new o(0,this.littleEndian,this.noAssert);
  35432. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35433. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35434. t.view = this.view),
  35435. t.offset = this.offset,
  35436. t.markedOffset = this.markedOffset,
  35437. t.limit = this.limit,
  35438. t
  35439. }
  35440. ,
  35441. a.compact = function(e, t) {
  35442. if ("undefined" == typeof e && (e = this.offset),
  35443. "undefined" == typeof t && (t = this.limit),
  35444. !this.noAssert) {
  35445. if ("number" != typeof e || e % 1 !== 0)
  35446. throw TypeError("Illegal begin: Not an integer");
  35447. if (e >>>= 0,
  35448. "number" != typeof t || t % 1 !== 0)
  35449. throw TypeError("Illegal end: Not an integer");
  35450. if (t >>>= 0,
  35451. e < 0 || e > t || t > this.buffer.byteLength)
  35452. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35453. }
  35454. if (0 === e && t === this.buffer.byteLength)
  35455. return this;
  35456. var i = t - e;
  35457. if (0 === i)
  35458. return this.buffer = s,
  35459. this.view = null,
  35460. this.markedOffset >= 0 && (this.markedOffset -= e),
  35461. this.offset = 0,
  35462. this.limit = 0,
  35463. this;
  35464. var n = new ArrayBuffer(i)
  35465. , r = new Uint8Array(n);
  35466. return r.set(this.view.subarray(e, t)),
  35467. this.buffer = n,
  35468. this.view = r,
  35469. this.markedOffset >= 0 && (this.markedOffset -= e),
  35470. this.offset = 0,
  35471. this.limit = i,
  35472. this
  35473. }
  35474. ,
  35475. a.copy = function(e, t) {
  35476. if ("undefined" == typeof e && (e = this.offset),
  35477. "undefined" == typeof t && (t = this.limit),
  35478. !this.noAssert) {
  35479. if ("number" != typeof e || e % 1 !== 0)
  35480. throw TypeError("Illegal begin: Not an integer");
  35481. if (e >>>= 0,
  35482. "number" != typeof t || t % 1 !== 0)
  35483. throw TypeError("Illegal end: Not an integer");
  35484. if (t >>>= 0,
  35485. e < 0 || e > t || t > this.buffer.byteLength)
  35486. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35487. }
  35488. if (e === t)
  35489. return new o(0,this.littleEndian,this.noAssert);
  35490. var i = t - e
  35491. , n = new o(i,this.littleEndian,this.noAssert);
  35492. return n.offset = 0,
  35493. n.limit = i,
  35494. n.markedOffset >= 0 && (n.markedOffset -= e),
  35495. this.copyTo(n, 0, e, t),
  35496. n
  35497. }
  35498. ,
  35499. a.copyTo = function(e, t, i, n) {
  35500. var r, a;
  35501. if (!this.noAssert && !o.isByteBuffer(e))
  35502. throw TypeError("Illegal target: Not a ByteBuffer");
  35503. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  35504. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  35505. n = "undefined" == typeof n ? this.limit : 0 | n,
  35506. t < 0 || t > e.buffer.byteLength)
  35507. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35508. if (i < 0 || n > this.buffer.byteLength)
  35509. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35510. var s = n - i;
  35511. return 0 === s ? e : (e.ensureCapacity(t + s),
  35512. e.view.set(this.view.subarray(i, n), t),
  35513. r && (this.offset += s),
  35514. a && (e.offset += s),
  35515. this)
  35516. }
  35517. ,
  35518. a.ensureCapacity = function(e) {
  35519. var t = this.buffer.byteLength;
  35520. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35521. }
  35522. ,
  35523. a.fill = function(e, t, i) {
  35524. var n = "undefined" == typeof t;
  35525. if (n && (t = this.offset),
  35526. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  35527. "undefined" == typeof t && (t = this.offset),
  35528. "undefined" == typeof i && (i = this.limit),
  35529. !this.noAssert) {
  35530. if ("number" != typeof e || e % 1 !== 0)
  35531. throw TypeError("Illegal value: " + e + " (not an integer)");
  35532. if (e |= 0,
  35533. "number" != typeof t || t % 1 !== 0)
  35534. throw TypeError("Illegal begin: Not an integer");
  35535. if (t >>>= 0,
  35536. "number" != typeof i || i % 1 !== 0)
  35537. throw TypeError("Illegal end: Not an integer");
  35538. if (i >>>= 0,
  35539. t < 0 || t > i || i > this.buffer.byteLength)
  35540. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35541. }
  35542. if (t >= i)
  35543. return this;
  35544. for (; t < i; )
  35545. this.view[t++] = e;
  35546. return n && (this.offset = t),
  35547. this
  35548. }
  35549. ,
  35550. a.flip = function() {
  35551. return this.limit = this.offset,
  35552. this.offset = 0,
  35553. this
  35554. }
  35555. ,
  35556. a.mark = function(e) {
  35557. if (e = "undefined" == typeof e ? this.offset : e,
  35558. !this.noAssert) {
  35559. if ("number" != typeof e || e % 1 !== 0)
  35560. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35561. if (e >>>= 0,
  35562. e < 0 || e + 0 > this.buffer.byteLength)
  35563. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35564. }
  35565. return this.markedOffset = e,
  35566. this
  35567. }
  35568. ,
  35569. a.order = function(e) {
  35570. if (!this.noAssert && "boolean" != typeof e)
  35571. throw TypeError("Illegal littleEndian: Not a boolean");
  35572. return this.littleEndian = !!e,
  35573. this
  35574. }
  35575. ,
  35576. a.LE = function(e) {
  35577. return this.littleEndian = "undefined" == typeof e || !!e,
  35578. this
  35579. }
  35580. ,
  35581. a.BE = function(e) {
  35582. return this.littleEndian = "undefined" != typeof e && !e,
  35583. this
  35584. }
  35585. ,
  35586. a.prepend = function(e, t, i) {
  35587. "number" != typeof t && "string" == typeof t || (i = t,
  35588. t = void 0);
  35589. var n = "undefined" == typeof i;
  35590. if (n && (i = this.offset),
  35591. !this.noAssert) {
  35592. if ("number" != typeof i || i % 1 !== 0)
  35593. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35594. if (i >>>= 0,
  35595. i < 0 || i + 0 > this.buffer.byteLength)
  35596. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35597. }
  35598. e instanceof o || (e = o.wrap(e, t));
  35599. var r = e.limit - e.offset;
  35600. if (r <= 0)
  35601. return this;
  35602. var a = r - i;
  35603. if (a > 0) {
  35604. var s = new ArrayBuffer(this.buffer.byteLength + a)
  35605. , l = new Uint8Array(s);
  35606. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  35607. this.buffer = s,
  35608. this.view = l,
  35609. this.offset += a,
  35610. this.markedOffset >= 0 && (this.markedOffset += a),
  35611. this.limit += a,
  35612. i += a
  35613. } else {
  35614. new Uint8Array(this.buffer)
  35615. }
  35616. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35617. e.offset = e.limit,
  35618. n && (this.offset -= r),
  35619. this
  35620. }
  35621. ,
  35622. a.prependTo = function(e, t) {
  35623. return e.prepend(this, t),
  35624. this
  35625. }
  35626. ,
  35627. a.printDebug = function(e) {
  35628. "function" != typeof e && (e = console.log.bind(console)),
  35629. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35630. }
  35631. ,
  35632. a.remaining = function() {
  35633. return this.limit - this.offset
  35634. }
  35635. ,
  35636. a.reset = function() {
  35637. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  35638. this.markedOffset = -1) : this.offset = 0,
  35639. this
  35640. }
  35641. ,
  35642. a.resize = function(e) {
  35643. if (!this.noAssert) {
  35644. if ("number" != typeof e || e % 1 !== 0)
  35645. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35646. if (e |= 0,
  35647. e < 0)
  35648. throw RangeError("Illegal capacity: 0 <= " + e)
  35649. }
  35650. if (this.buffer.byteLength < e) {
  35651. var t = new ArrayBuffer(e)
  35652. , i = new Uint8Array(t);
  35653. i.set(this.view),
  35654. this.buffer = t,
  35655. this.view = i
  35656. }
  35657. return this
  35658. }
  35659. ,
  35660. a.reverse = function(e, t) {
  35661. if ("undefined" == typeof e && (e = this.offset),
  35662. "undefined" == typeof t && (t = this.limit),
  35663. !this.noAssert) {
  35664. if ("number" != typeof e || e % 1 !== 0)
  35665. throw TypeError("Illegal begin: Not an integer");
  35666. if (e >>>= 0,
  35667. "number" != typeof t || t % 1 !== 0)
  35668. throw TypeError("Illegal end: Not an integer");
  35669. if (t >>>= 0,
  35670. e < 0 || e > t || t > this.buffer.byteLength)
  35671. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35672. }
  35673. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  35674. this)
  35675. }
  35676. ,
  35677. a.skip = function(e) {
  35678. if (!this.noAssert) {
  35679. if ("number" != typeof e || e % 1 !== 0)
  35680. throw TypeError("Illegal length: " + e + " (not an integer)");
  35681. e |= 0
  35682. }
  35683. var t = this.offset + e;
  35684. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35685. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35686. return this.offset = t,
  35687. this
  35688. }
  35689. ,
  35690. a.slice = function(e, t) {
  35691. if ("undefined" == typeof e && (e = this.offset),
  35692. "undefined" == typeof t && (t = this.limit),
  35693. !this.noAssert) {
  35694. if ("number" != typeof e || e % 1 !== 0)
  35695. throw TypeError("Illegal begin: Not an integer");
  35696. if (e >>>= 0,
  35697. "number" != typeof t || t % 1 !== 0)
  35698. throw TypeError("Illegal end: Not an integer");
  35699. if (t >>>= 0,
  35700. e < 0 || e > t || t > this.buffer.byteLength)
  35701. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35702. }
  35703. var i = this.clone();
  35704. return i.offset = e,
  35705. i.limit = t,
  35706. i
  35707. }
  35708. ,
  35709. a.toBuffer = function(e) {
  35710. var t = this.offset
  35711. , i = this.limit;
  35712. if (!this.noAssert) {
  35713. if ("number" != typeof t || t % 1 !== 0)
  35714. throw TypeError("Illegal offset: Not an integer");
  35715. if (t >>>= 0,
  35716. "number" != typeof i || i % 1 !== 0)
  35717. throw TypeError("Illegal limit: Not an integer");
  35718. if (i >>>= 0,
  35719. t < 0 || t > i || i > this.buffer.byteLength)
  35720. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35721. }
  35722. if (!e && 0 === t && i === this.buffer.byteLength)
  35723. return this.buffer;
  35724. if (t === i)
  35725. return s;
  35726. var n = new ArrayBuffer(i - t);
  35727. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35728. n
  35729. }
  35730. ,
  35731. a.toArrayBuffer = a.toBuffer,
  35732. a.toString = function(e, t, i) {
  35733. if ("undefined" == typeof e)
  35734. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35735. switch ("number" == typeof e && (e = "utf8",
  35736. t = e,
  35737. i = t),
  35738. e) {
  35739. case "utf8":
  35740. return this.toUTF8(t, i);
  35741. case "base64":
  35742. return this.toBase64(t, i);
  35743. case "hex":
  35744. return this.toHex(t, i);
  35745. case "binary":
  35746. return this.toBinary(t, i);
  35747. case "debug":
  35748. return this.toDebug();
  35749. case "columns":
  35750. return this.toColumns();
  35751. default:
  35752. throw Error("Unsupported encoding: " + e)
  35753. }
  35754. }
  35755. ;
  35756. var c = function() {
  35757. for (var e = {}, t = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = t.length; n < r; ++n)
  35758. i[t[n]] = n;
  35759. return e.encode = function(e, i) {
  35760. for (var n, r; null !== (n = e()); )
  35761. i(t[n >> 2 & 63]),
  35762. r = (3 & n) << 4,
  35763. null !== (n = e()) ? (r |= n >> 4 & 15,
  35764. i(t[63 & (r | n >> 4 & 15)]),
  35765. r = (15 & n) << 2,
  35766. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  35767. i(t[63 & n])) : (i(t[63 & r]),
  35768. i(61))) : (i(t[63 & r]),
  35769. i(61),
  35770. i(61))
  35771. }
  35772. ,
  35773. e.decode = function(e, t) {
  35774. function n(e) {
  35775. throw Error("Illegal character code: " + e)
  35776. }
  35777. for (var r, o, a; null !== (r = e()); )
  35778. if (o = i[r],
  35779. "undefined" == typeof o && n(r),
  35780. null !== (r = e()) && (a = i[r],
  35781. "undefined" == typeof a && n(r),
  35782. t(o << 2 >>> 0 | (48 & a) >> 4),
  35783. null !== (r = e()))) {
  35784. if (o = i[r],
  35785. "undefined" == typeof o) {
  35786. if (61 === r)
  35787. break;
  35788. n(r)
  35789. }
  35790. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  35791. null !== (r = e())) {
  35792. if (a = i[r],
  35793. "undefined" == typeof a) {
  35794. if (61 === r)
  35795. break;
  35796. n(r)
  35797. }
  35798. t((3 & o) << 6 >>> 0 | a)
  35799. }
  35800. }
  35801. }
  35802. ,
  35803. e.test = function(e) {
  35804. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35805. }
  35806. ,
  35807. e
  35808. }();
  35809. a.toBase64 = function(e, t) {
  35810. if ("undefined" == typeof e && (e = this.offset),
  35811. "undefined" == typeof t && (t = this.limit),
  35812. e |= 0,
  35813. t |= 0,
  35814. e < 0 || t > this.capacity || e > t)
  35815. throw RangeError("begin, end");
  35816. var n;
  35817. return c.encode(function() {
  35818. return e < t ? this.view[e++] : null
  35819. }
  35820. .bind(this), n = i()),
  35821. n()
  35822. }
  35823. ,
  35824. o.fromBase64 = function(e, i) {
  35825. if ("string" != typeof e)
  35826. throw TypeError("str");
  35827. var n = new o(e.length / 4 * 3,i)
  35828. , r = 0;
  35829. return c.decode(t(e), function(e) {
  35830. n.view[r++] = e
  35831. }),
  35832. n.limit = r,
  35833. n
  35834. }
  35835. ,
  35836. o.btoa = function(e) {
  35837. return o.fromBinary(e).toBase64()
  35838. }
  35839. ,
  35840. o.atob = function(e) {
  35841. return o.fromBase64(e).toBinary()
  35842. }
  35843. ,
  35844. a.toBinary = function(e, t) {
  35845. if ("undefined" == typeof e && (e = this.offset),
  35846. "undefined" == typeof t && (t = this.limit),
  35847. e |= 0,
  35848. t |= 0,
  35849. e < 0 || t > this.capacity() || e > t)
  35850. throw RangeError("begin, end");
  35851. if (e === t)
  35852. return "";
  35853. for (var i = [], n = []; e < t; )
  35854. i.push(this.view[e++]),
  35855. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  35856. i = []);
  35857. return n.join("") + String.fromCharCode.apply(String, i)
  35858. }
  35859. ,
  35860. o.fromBinary = function(e, t) {
  35861. if ("string" != typeof e)
  35862. throw TypeError("str");
  35863. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  35864. if (i = e.charCodeAt(n),
  35865. i > 255)
  35866. throw RangeError("illegal char code: " + i);
  35867. a.view[n++] = i
  35868. }
  35869. return a.limit = r,
  35870. a
  35871. }
  35872. ,
  35873. a.toDebug = function(e) {
  35874. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35875. if (i !== -1 && (t = this.view[i],
  35876. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35877. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  35878. ++i,
  35879. e && i > 0 && i % 16 === 0 && i !== n) {
  35880. for (; r.length < 51; )
  35881. r += " ";
  35882. a += r + o + "\n",
  35883. r = o = ""
  35884. }
  35885. 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 ? " " : ""
  35886. }
  35887. if (e && " " !== r) {
  35888. for (; r.length < 51; )
  35889. r += " ";
  35890. a += r + o + "\n"
  35891. }
  35892. return e ? a : r
  35893. }
  35894. ,
  35895. o.fromDebug = function(e, t, i) {
  35896. for (var n, r, a = e.length, s = new o((a + 1) / 3 | 0,t,i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  35897. switch (n = e.charAt(l++)) {
  35898. case "!":
  35899. if (!i) {
  35900. if (u || d || p) {
  35901. f = !0;
  35902. break
  35903. }
  35904. u = d = p = !0
  35905. }
  35906. s.offset = s.markedOffset = s.limit = c,
  35907. h = !1;
  35908. break;
  35909. case "|":
  35910. if (!i) {
  35911. if (u || p) {
  35912. f = !0;
  35913. break
  35914. }
  35915. u = p = !0
  35916. }
  35917. s.offset = s.limit = c,
  35918. h = !1;
  35919. break;
  35920. case "[":
  35921. if (!i) {
  35922. if (u || d) {
  35923. f = !0;
  35924. break
  35925. }
  35926. u = d = !0
  35927. }
  35928. s.offset = s.markedOffset = c,
  35929. h = !1;
  35930. break;
  35931. case "<":
  35932. if (!i) {
  35933. if (u) {
  35934. f = !0;
  35935. break
  35936. }
  35937. u = !0
  35938. }
  35939. s.offset = c,
  35940. h = !1;
  35941. break;
  35942. case "]":
  35943. if (!i) {
  35944. if (p || d) {
  35945. f = !0;
  35946. break
  35947. }
  35948. p = d = !0
  35949. }
  35950. s.limit = s.markedOffset = c,
  35951. h = !1;
  35952. break;
  35953. case ">":
  35954. if (!i) {
  35955. if (p) {
  35956. f = !0;
  35957. break
  35958. }
  35959. p = !0
  35960. }
  35961. s.limit = c,
  35962. h = !1;
  35963. break;
  35964. case "'":
  35965. if (!i) {
  35966. if (d) {
  35967. f = !0;
  35968. break
  35969. }
  35970. d = !0
  35971. }
  35972. s.markedOffset = c,
  35973. h = !1;
  35974. break;
  35975. case " ":
  35976. h = !1;
  35977. break;
  35978. default:
  35979. if (!i && h) {
  35980. f = !0;
  35981. break
  35982. }
  35983. if (r = parseInt(n + e.charAt(l++), 16),
  35984. !i && (isNaN(r) || r < 0 || r > 255))
  35985. throw TypeError("Illegal str: Not a debug encoded string");
  35986. s.view[c++] = r,
  35987. h = !0
  35988. }
  35989. if (f)
  35990. throw TypeError("Illegal str: Invalid symbol at " + l)
  35991. }
  35992. if (!i) {
  35993. if (!u || !p)
  35994. throw TypeError("Illegal str: Missing offset or limit");
  35995. if (c < s.buffer.byteLength)
  35996. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  35997. }
  35998. return s
  35999. }
  36000. ,
  36001. a.toHex = function(e, t) {
  36002. if (e = "undefined" == typeof e ? this.offset : e,
  36003. t = "undefined" == typeof t ? this.limit : t,
  36004. !this.noAssert) {
  36005. if ("number" != typeof e || e % 1 !== 0)
  36006. throw TypeError("Illegal begin: Not an integer");
  36007. if (e >>>= 0,
  36008. "number" != typeof t || t % 1 !== 0)
  36009. throw TypeError("Illegal end: Not an integer");
  36010. if (t >>>= 0,
  36011. e < 0 || e > t || t > this.buffer.byteLength)
  36012. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36013. }
  36014. for (var i, n = new Array(t - e); e < t; )
  36015. i = this.view[e++],
  36016. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36017. return n.join("")
  36018. }
  36019. ,
  36020. o.fromHex = function(e, t, i) {
  36021. if (!i) {
  36022. if ("string" != typeof e)
  36023. throw TypeError("Illegal str: Not a string");
  36024. if (e.length % 2 !== 0)
  36025. throw TypeError("Illegal str: Length not a multiple of 2")
  36026. }
  36027. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  36028. if (n = parseInt(e.substring(s, s + 2), 16),
  36029. !i && (!isFinite(n) || n < 0 || n > 255))
  36030. throw TypeError("Illegal str: Contains non-hex characters");
  36031. a.view[l++] = n
  36032. }
  36033. return a.limit = l,
  36034. a
  36035. }
  36036. ;
  36037. var h = function() {
  36038. var e = {};
  36039. return e.MAX_CODEPOINT = 1114111,
  36040. e.encodeUTF8 = function(e, t) {
  36041. var i = null;
  36042. for ("number" == typeof e && (i = e,
  36043. e = function() {
  36044. return null
  36045. }
  36046. ); null !== i || null !== (i = e()); )
  36047. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  36048. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  36049. t(i >> 6 & 63 | 128),
  36050. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  36051. t(i >> 12 & 63 | 128),
  36052. t(i >> 6 & 63 | 128),
  36053. t(63 & i | 128)),
  36054. i = null
  36055. }
  36056. ,
  36057. e.decodeUTF8 = function(e, t) {
  36058. for (var i, n, r, o, a = function(e) {
  36059. e = e.slice(0, e.indexOf(null));
  36060. var t = Error(e.toString());
  36061. throw t.name = "TruncatedError",
  36062. t.bytes = e,
  36063. t
  36064. }; null !== (i = e()); )
  36065. if (0 === (128 & i))
  36066. t(i);
  36067. else if (192 === (224 & i))
  36068. null === (n = e()) && a([i, n]),
  36069. t((31 & i) << 6 | 63 & n);
  36070. else if (224 === (240 & i))
  36071. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  36072. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36073. else {
  36074. if (240 !== (248 & i))
  36075. throw RangeError("Illegal starting byte: " + i);
  36076. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  36077. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36078. }
  36079. }
  36080. ,
  36081. e.UTF16toUTF8 = function(e, t) {
  36082. for (var i, n = null; ; ) {
  36083. if (null === (i = null !== n ? n : e()))
  36084. break;
  36085. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36086. n = null) : t(i)
  36087. }
  36088. null !== n && t(n)
  36089. }
  36090. ,
  36091. e.UTF8toUTF16 = function(e, t) {
  36092. var i = null;
  36093. for ("number" == typeof e && (i = e,
  36094. e = function() {
  36095. return null
  36096. }
  36097. ); null !== i || null !== (i = e()); )
  36098. i <= 65535 ? t(i) : (i -= 65536,
  36099. t((i >> 10) + 55296),
  36100. t(i % 1024 + 56320)),
  36101. i = null
  36102. }
  36103. ,
  36104. e.encodeUTF16toUTF8 = function(t, i) {
  36105. e.UTF16toUTF8(t, function(t) {
  36106. e.encodeUTF8(t, i)
  36107. })
  36108. }
  36109. ,
  36110. e.decodeUTF8toUTF16 = function(t, i) {
  36111. e.decodeUTF8(t, function(t) {
  36112. e.UTF8toUTF16(t, i)
  36113. })
  36114. }
  36115. ,
  36116. e.calculateCodePoint = function(e) {
  36117. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36118. }
  36119. ,
  36120. e.calculateUTF8 = function(e) {
  36121. for (var t, i = 0; null !== (t = e()); )
  36122. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36123. return i
  36124. }
  36125. ,
  36126. e.calculateUTF16asUTF8 = function(t) {
  36127. var i = 0
  36128. , n = 0;
  36129. return e.UTF16toUTF8(t, function(e) {
  36130. ++i,
  36131. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36132. }),
  36133. [i, n]
  36134. }
  36135. ,
  36136. e
  36137. }();
  36138. return a.toUTF8 = function(e, t) {
  36139. if ("undefined" == typeof e && (e = this.offset),
  36140. "undefined" == typeof t && (t = this.limit),
  36141. !this.noAssert) {
  36142. if ("number" != typeof e || e % 1 !== 0)
  36143. throw TypeError("Illegal begin: Not an integer");
  36144. if (e >>>= 0,
  36145. "number" != typeof t || t % 1 !== 0)
  36146. throw TypeError("Illegal end: Not an integer");
  36147. if (t >>>= 0,
  36148. e < 0 || e > t || t > this.buffer.byteLength)
  36149. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36150. }
  36151. var n;
  36152. try {
  36153. h.decodeUTF8toUTF16(function() {
  36154. return e < t ? this.view[e++] : null
  36155. }
  36156. .bind(this), n = i())
  36157. } catch (i) {
  36158. if (e !== t)
  36159. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  36160. }
  36161. return n()
  36162. }
  36163. ,
  36164. o.fromUTF8 = function(e, i, n) {
  36165. if (!n && "string" != typeof e)
  36166. throw TypeError("Illegal str: Not a string");
  36167. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  36168. , a = 0;
  36169. return h.encodeUTF16toUTF8(t(e), function(e) {
  36170. r.view[a++] = e
  36171. }),
  36172. r.limit = a,
  36173. r
  36174. }
  36175. ,
  36176. o
  36177. })
  36178. }
  36179. , {
  36180. long: 216
  36181. }],
  36182. 216: [function(e, t, i) {//long
  36183. !function(i, n) {
  36184. "function" == typeof define && define.amd ? define([], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n()
  36185. }(this, function() {
  36186. "use strict";
  36187. function e(e, t, i) {
  36188. this.low = 0 | e,
  36189. this.high = 0 | t,
  36190. this.unsigned = !!i
  36191. }
  36192. function t(e) {
  36193. return (e && e.__isLong__) === !0
  36194. }
  36195. function i(e, t) {
  36196. var i, n, o;
  36197. return t ? (e >>>= 0,
  36198. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  36199. o && (l[e] = i),
  36200. i)) : (e |= 0,
  36201. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  36202. o && (s[e] = i),
  36203. i))
  36204. }
  36205. function n(e, t) {
  36206. if (isNaN(e) || !isFinite(e))
  36207. return t ? m : g;
  36208. if (t) {
  36209. if (e < 0)
  36210. return m;
  36211. if (e >= d)
  36212. return I
  36213. } else {
  36214. if (e <= -p)
  36215. return E;
  36216. if (e + 1 >= p)
  36217. return C
  36218. }
  36219. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  36220. }
  36221. function r(t, i, n) {
  36222. return new e(t,i,n)
  36223. }
  36224. function o(e, t, i) {
  36225. if (0 === e.length)
  36226. throw Error("empty string");
  36227. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36228. return g;
  36229. if ("number" == typeof t ? (i = t,
  36230. t = !1) : t = !!t,
  36231. i = i || 10,
  36232. i < 2 || 36 < i)
  36233. throw RangeError("radix");
  36234. var r;
  36235. if ((r = e.indexOf("-")) > 0)
  36236. throw Error("interior hyphen");
  36237. if (0 === r)
  36238. return o(e.substring(1), t, i).neg();
  36239. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  36240. var h = Math.min(8, e.length - l)
  36241. , u = parseInt(e.substring(l, l + h), i);
  36242. if (h < 8) {
  36243. var d = n(c(i, h));
  36244. s = s.mul(d).add(n(u))
  36245. } else
  36246. s = s.mul(a),
  36247. s = s.add(n(u))
  36248. }
  36249. return s.unsigned = t,
  36250. s
  36251. }
  36252. function a(t) {
  36253. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  36254. }
  36255. e.prototype.__isLong__,
  36256. Object.defineProperty(e.prototype, "__isLong__", {
  36257. value: !0,
  36258. enumerable: !1,
  36259. configurable: !1
  36260. }),
  36261. e.isLong = t;
  36262. var s = {}
  36263. , l = {};
  36264. e.fromInt = i,
  36265. e.fromNumber = n,
  36266. e.fromBits = r;
  36267. var c = Math.pow;
  36268. e.fromString = o,
  36269. e.fromValue = a;
  36270. var h = 1 << 24
  36271. , u = 4294967296
  36272. , d = 0x10000000000000000
  36273. , p = d / 2
  36274. , f = i(h)
  36275. , g = i(0);
  36276. e.ZERO = g;
  36277. var m = i(0, !0);
  36278. e.UZERO = m;
  36279. var v = i(1);
  36280. e.ONE = v;
  36281. var A = i(1, !0);
  36282. e.UONE = A;
  36283. var y = i(-1);
  36284. e.NEG_ONE = y;
  36285. var C = r(-1, 2147483647, !1);
  36286. e.MAX_VALUE = C;
  36287. var I = r(-1, -1, !0);
  36288. e.MAX_UNSIGNED_VALUE = I;
  36289. var E = r(0, -2147483648, !1);
  36290. e.MIN_VALUE = E;
  36291. var b = e.prototype;
  36292. return b.toInt = function() {
  36293. return this.unsigned ? this.low >>> 0 : this.low
  36294. }
  36295. ,
  36296. b.toNumber = function() {
  36297. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  36298. }
  36299. ,
  36300. b.toString = function(e) {
  36301. if (e = e || 10,
  36302. e < 2 || 36 < e)
  36303. throw RangeError("radix");
  36304. if (this.isZero())
  36305. return "0";
  36306. if (this.isNegative()) {
  36307. if (this.eq(E)) {
  36308. var t = n(e)
  36309. , i = this.div(t)
  36310. , r = i.mul(t).sub(this);
  36311. return i.toString(e) + r.toInt().toString(e)
  36312. }
  36313. return "-" + this.neg().toString(e)
  36314. }
  36315. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  36316. var l = a.div(o)
  36317. , h = a.sub(l.mul(o)).toInt() >>> 0
  36318. , u = h.toString(e);
  36319. if (a = l,
  36320. a.isZero())
  36321. return u + s;
  36322. for (; u.length < 6; )
  36323. u = "0" + u;
  36324. s = "" + u + s
  36325. }
  36326. }
  36327. ,
  36328. b.getHighBits = function() {
  36329. return this.high
  36330. }
  36331. ,
  36332. b.getHighBitsUnsigned = function() {
  36333. return this.high >>> 0
  36334. }
  36335. ,
  36336. b.getLowBits = function() {
  36337. return this.low
  36338. }
  36339. ,
  36340. b.getLowBitsUnsigned = function() {
  36341. return this.low >>> 0
  36342. }
  36343. ,
  36344. b.getNumBitsAbs = function() {
  36345. if (this.isNegative())
  36346. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36347. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  36348. ;
  36349. return 0 != this.high ? t + 33 : t + 1
  36350. }
  36351. ,
  36352. b.isZero = function() {
  36353. return 0 === this.high && 0 === this.low
  36354. }
  36355. ,
  36356. b.isNegative = function() {
  36357. return !this.unsigned && this.high < 0
  36358. }
  36359. ,
  36360. b.isPositive = function() {
  36361. return this.unsigned || this.high >= 0
  36362. }
  36363. ,
  36364. b.isOdd = function() {
  36365. return 1 === (1 & this.low)
  36366. }
  36367. ,
  36368. b.isEven = function() {
  36369. return 0 === (1 & this.low)
  36370. }
  36371. ,
  36372. b.equals = function(e) {
  36373. return t(e) || (e = a(e)),
  36374. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  36375. }
  36376. ,
  36377. b.eq = b.equals,
  36378. b.notEquals = function(e) {
  36379. return !this.eq(e)
  36380. }
  36381. ,
  36382. b.neq = b.notEquals,
  36383. b.lessThan = function(e) {
  36384. return this.comp(e) < 0
  36385. }
  36386. ,
  36387. b.lt = b.lessThan,
  36388. b.lessThanOrEqual = function(e) {
  36389. return this.comp(e) <= 0
  36390. }
  36391. ,
  36392. b.lte = b.lessThanOrEqual,
  36393. b.greaterThan = function(e) {
  36394. return this.comp(e) > 0
  36395. }
  36396. ,
  36397. b.gt = b.greaterThan,
  36398. b.greaterThanOrEqual = function(e) {
  36399. return this.comp(e) >= 0
  36400. }
  36401. ,
  36402. b.gte = b.greaterThanOrEqual,
  36403. b.compare = function(e) {
  36404. if (t(e) || (e = a(e)),
  36405. this.eq(e))
  36406. return 0;
  36407. var i = this.isNegative()
  36408. , n = e.isNegative();
  36409. return i && !n ? -1 : !i && n ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  36410. }
  36411. ,
  36412. b.comp = b.compare,
  36413. b.negate = function() {
  36414. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  36415. }
  36416. ,
  36417. b.neg = b.negate,
  36418. b.add = function(e) {
  36419. t(e) || (e = a(e));
  36420. var i = this.high >>> 16
  36421. , n = 65535 & this.high
  36422. , o = this.low >>> 16
  36423. , s = 65535 & this.low
  36424. , l = e.high >>> 16
  36425. , c = 65535 & e.high
  36426. , h = e.low >>> 16
  36427. , u = 65535 & e.low
  36428. , d = 0
  36429. , p = 0
  36430. , f = 0
  36431. , g = 0;
  36432. return g += s + u,
  36433. f += g >>> 16,
  36434. g &= 65535,
  36435. f += o + h,
  36436. p += f >>> 16,
  36437. f &= 65535,
  36438. p += n + c,
  36439. d += p >>> 16,
  36440. p &= 65535,
  36441. d += i + l,
  36442. d &= 65535,
  36443. r(f << 16 | g, d << 16 | p, this.unsigned)
  36444. }
  36445. ,
  36446. b.subtract = function(e) {
  36447. return t(e) || (e = a(e)),
  36448. this.add(e.neg())
  36449. }
  36450. ,
  36451. b.sub = b.subtract,
  36452. b.multiply = function(e) {
  36453. if (this.isZero())
  36454. return g;
  36455. if (t(e) || (e = a(e)),
  36456. e.isZero())
  36457. return g;
  36458. if (this.eq(E))
  36459. return e.isOdd() ? E : g;
  36460. if (e.eq(E))
  36461. return this.isOdd() ? E : g;
  36462. if (this.isNegative())
  36463. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36464. if (e.isNegative())
  36465. return this.mul(e.neg()).neg();
  36466. if (this.lt(f) && e.lt(f))
  36467. return n(this.toNumber() * e.toNumber(), this.unsigned);
  36468. var i = this.high >>> 16
  36469. , o = 65535 & this.high
  36470. , s = this.low >>> 16
  36471. , l = 65535 & this.low
  36472. , c = e.high >>> 16
  36473. , h = 65535 & e.high
  36474. , u = e.low >>> 16
  36475. , d = 65535 & e.low
  36476. , p = 0
  36477. , m = 0
  36478. , v = 0
  36479. , A = 0;
  36480. return A += l * d,
  36481. v += A >>> 16,
  36482. A &= 65535,
  36483. v += s * d,
  36484. m += v >>> 16,
  36485. v &= 65535,
  36486. v += l * u,
  36487. m += v >>> 16,
  36488. v &= 65535,
  36489. m += o * d,
  36490. p += m >>> 16,
  36491. m &= 65535,
  36492. m += s * u,
  36493. p += m >>> 16,
  36494. m &= 65535,
  36495. m += l * h,
  36496. p += m >>> 16,
  36497. m &= 65535,
  36498. p += i * d + o * u + s * h + l * c,
  36499. p &= 65535,
  36500. r(v << 16 | A, p << 16 | m, this.unsigned)
  36501. }
  36502. ,
  36503. b.mul = b.multiply,
  36504. b.divide = function(e) {
  36505. if (t(e) || (e = a(e)),
  36506. e.isZero())
  36507. throw Error("division by zero");
  36508. if (this.isZero())
  36509. return this.unsigned ? m : g;
  36510. var i, r, o;
  36511. if (this.unsigned) {
  36512. if (e.unsigned || (e = e.toUnsigned()),
  36513. e.gt(this))
  36514. return m;
  36515. if (e.gt(this.shru(1)))
  36516. return A;
  36517. o = m
  36518. } else {
  36519. if (this.eq(E)) {
  36520. if (e.eq(v) || e.eq(y))
  36521. return E;
  36522. if (e.eq(E))
  36523. return v;
  36524. var s = this.shr(1);
  36525. return i = s.div(e).shl(1),
  36526. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  36527. o = i.add(r.div(e)))
  36528. }
  36529. if (e.eq(E))
  36530. return this.unsigned ? m : g;
  36531. if (this.isNegative())
  36532. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36533. if (e.isNegative())
  36534. return this.div(e.neg()).neg();
  36535. o = g
  36536. }
  36537. for (r = this; r.gte(e); ) {
  36538. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  36539. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); )
  36540. i -= h,
  36541. u = n(i, this.unsigned),
  36542. d = u.mul(e);
  36543. u.isZero() && (u = v),
  36544. o = o.add(u),
  36545. r = r.sub(d)
  36546. }
  36547. return o
  36548. }
  36549. ,
  36550. b.div = b.divide,
  36551. b.modulo = function(e) {
  36552. return t(e) || (e = a(e)),
  36553. this.sub(this.div(e).mul(e))
  36554. }
  36555. ,
  36556. b.mod = b.modulo,
  36557. b.not = function() {
  36558. return r(~this.low, ~this.high, this.unsigned)
  36559. }
  36560. ,
  36561. b.and = function(e) {
  36562. return t(e) || (e = a(e)),
  36563. r(this.low & e.low, this.high & e.high, this.unsigned)
  36564. }
  36565. ,
  36566. b.or = function(e) {
  36567. return t(e) || (e = a(e)),
  36568. r(this.low | e.low, this.high | e.high, this.unsigned)
  36569. }
  36570. ,
  36571. b.xor = function(e) {
  36572. return t(e) || (e = a(e)),
  36573. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36574. }
  36575. ,
  36576. b.shiftLeft = function(e) {
  36577. return t(e) && (e = e.toInt()),
  36578. 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : r(0, this.low << e - 32, this.unsigned)
  36579. }
  36580. ,
  36581. b.shl = b.shiftLeft,
  36582. b.shiftRight = function(e) {
  36583. return t(e) && (e = e.toInt()),
  36584. 0 === (e &= 63) ? this : e < 32 ? r(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : r(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  36585. }
  36586. ,
  36587. b.shr = b.shiftRight,
  36588. b.shiftRightUnsigned = function(e) {
  36589. if (t(e) && (e = e.toInt()),
  36590. e &= 63,
  36591. 0 === e)
  36592. return this;
  36593. var i = this.high;
  36594. if (e < 32) {
  36595. var n = this.low;
  36596. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  36597. }
  36598. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  36599. }
  36600. ,
  36601. b.shru = b.shiftRightUnsigned,
  36602. b.toSigned = function() {
  36603. return this.unsigned ? r(this.low, this.high, !1) : this
  36604. }
  36605. ,
  36606. b.toUnsigned = function() {
  36607. return this.unsigned ? this : r(this.low, this.high, !0)
  36608. }
  36609. ,
  36610. b.toBytes = function(e) {
  36611. return e ? this.toBytesLE() : this.toBytesBE()
  36612. }
  36613. ,
  36614. b.toBytesLE = function() {
  36615. var e = this.high
  36616. , t = this.low;
  36617. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36618. }
  36619. ,
  36620. b.toBytesBE = function() {
  36621. var e = this.high
  36622. , t = this.low;
  36623. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36624. }
  36625. ,
  36626. e
  36627. })
  36628. }
  36629. , {}],
  36630. 217: [function(e, t, i) {//three.js
  36631. var n = {
  36632. REVISION: "75"
  36633. };
  36634. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  36635. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36636. void 0 === Math.sign && (Math.sign = function(e) {
  36637. return e < 0 ? -1 : e > 0 ? 1 : +e
  36638. }
  36639. ),
  36640. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36641. get: function() {
  36642. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36643. }
  36644. }),
  36645. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36646. writable: !0,
  36647. configurable: !0,
  36648. value: function(e) {
  36649. "use strict";
  36650. if (void 0 === e || null === e)
  36651. throw new TypeError("Cannot convert first argument to object");
  36652. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36653. var r = arguments[i];
  36654. if (void 0 !== r && null !== r) {
  36655. r = Object(r);
  36656. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36657. var l = o[a]
  36658. , c = Object.getOwnPropertyDescriptor(r, l);
  36659. void 0 !== c && c.enumerable && (t[l] = r[l])
  36660. }
  36661. }
  36662. }
  36663. return t
  36664. }
  36665. }),
  36666. n.MOUSE = {
  36667. LEFT: 0,
  36668. MIDDLE: 1,
  36669. RIGHT: 2
  36670. },
  36671. n.CullFaceNone = 0,
  36672. n.CullFaceBack = 1,
  36673. n.CullFaceFront = 2,
  36674. n.CullFaceFrontBack = 3,
  36675. n.FrontFaceDirectionCW = 0,
  36676. n.FrontFaceDirectionCCW = 1,
  36677. n.BasicShadowMap = 0,
  36678. n.PCFShadowMap = 1,
  36679. n.PCFSoftShadowMap = 2,
  36680. n.FrontSide = 0,
  36681. n.BackSide = 1,
  36682. n.DoubleSide = 2,
  36683. n.FlatShading = 1,
  36684. n.SmoothShading = 2,
  36685. n.NoColors = 0,
  36686. n.FaceColors = 1,
  36687. n.VertexColors = 2,
  36688. n.NoBlending = 0,
  36689. n.NormalBlending = 1,
  36690. n.AdditiveBlending = 2,
  36691. n.SubtractiveBlending = 3,
  36692. n.MultiplyBlending = 4,
  36693. n.CustomBlending = 5,
  36694. n.AddEquation = 100,
  36695. n.SubtractEquation = 101,
  36696. n.ReverseSubtractEquation = 102,
  36697. n.MinEquation = 103,
  36698. n.MaxEquation = 104,
  36699. n.ZeroFactor = 200,
  36700. n.OneFactor = 201,
  36701. n.SrcColorFactor = 202,
  36702. n.OneMinusSrcColorFactor = 203,
  36703. n.SrcAlphaFactor = 204,
  36704. n.OneMinusSrcAlphaFactor = 205,
  36705. n.DstAlphaFactor = 206,
  36706. n.OneMinusDstAlphaFactor = 207,
  36707. n.DstColorFactor = 208,
  36708. n.OneMinusDstColorFactor = 209,
  36709. n.SrcAlphaSaturateFactor = 210,
  36710. n.NeverDepth = 0,
  36711. n.AlwaysDepth = 1,
  36712. n.LessDepth = 2,
  36713. n.LessEqualDepth = 3,
  36714. n.EqualDepth = 4,
  36715. n.GreaterEqualDepth = 5,
  36716. n.GreaterDepth = 6,
  36717. n.NotEqualDepth = 7,
  36718. n.MultiplyOperation = 0,
  36719. n.MixOperation = 1,
  36720. n.AddOperation = 2,
  36721. n.NoToneMapping = 0,
  36722. n.LinearToneMapping = 1,
  36723. n.ReinhardToneMapping = 2,
  36724. n.Uncharted2ToneMapping = 3,
  36725. n.CineonToneMapping = 4,
  36726. n.UVMapping = 300,
  36727. n.CubeReflectionMapping = 301,
  36728. n.CubeRefractionMapping = 302,
  36729. n.EquirectangularReflectionMapping = 303,
  36730. n.EquirectangularRefractionMapping = 304,
  36731. n.SphericalReflectionMapping = 305,
  36732. n.CubeUVReflectionMapping = 306,
  36733. n.CubeUVRefractionMapping = 307,
  36734. n.RepeatWrapping = 1e3,
  36735. n.ClampToEdgeWrapping = 1001,
  36736. n.MirroredRepeatWrapping = 1002,
  36737. n.NearestFilter = 1003,
  36738. n.NearestMipMapNearestFilter = 1004,
  36739. n.NearestMipMapLinearFilter = 1005,
  36740. n.LinearFilter = 1006,
  36741. n.LinearMipMapNearestFilter = 1007,
  36742. n.LinearMipMapLinearFilter = 1008,
  36743. n.UnsignedByteType = 1009,
  36744. n.ByteType = 1010,
  36745. n.ShortType = 1011,
  36746. n.UnsignedShortType = 1012,
  36747. n.IntType = 1013,
  36748. n.UnsignedIntType = 1014,
  36749. n.FloatType = 1015,
  36750. n.HalfFloatType = 1025,
  36751. n.UnsignedShort4444Type = 1016,
  36752. n.UnsignedShort5551Type = 1017,
  36753. n.UnsignedShort565Type = 1018,
  36754. n.AlphaFormat = 1019,
  36755. n.RGBFormat = 1020,
  36756. n.RGBAFormat = 1021,
  36757. n.LuminanceFormat = 1022,
  36758. n.LuminanceAlphaFormat = 1023,
  36759. n.RGBEFormat = n.RGBAFormat,
  36760. n.RGB_S3TC_DXT1_Format = 2001,
  36761. n.RGBA_S3TC_DXT1_Format = 2002,
  36762. n.RGBA_S3TC_DXT3_Format = 2003,
  36763. n.RGBA_S3TC_DXT5_Format = 2004,
  36764. n.RGB_PVRTC_4BPPV1_Format = 2100,
  36765. n.RGB_PVRTC_2BPPV1_Format = 2101,
  36766. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  36767. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  36768. n.RGB_ETC1_Format = 2151,
  36769. n.LoopOnce = 2200,
  36770. n.LoopRepeat = 2201,
  36771. n.LoopPingPong = 2202,
  36772. n.InterpolateDiscrete = 2300,
  36773. n.InterpolateLinear = 2301,
  36774. n.InterpolateSmooth = 2302,
  36775. n.ZeroCurvatureEnding = 2400,
  36776. n.ZeroSlopeEnding = 2401,
  36777. n.WrapAroundEnding = 2402,
  36778. n.TrianglesDrawMode = 0,
  36779. n.TriangleStripDrawMode = 1,
  36780. n.TriangleFanDrawMode = 2,
  36781. n.LinearEncoding = 3e3,
  36782. n.sRGBEncoding = 3001,
  36783. n.GammaEncoding = 3007,
  36784. n.RGBEEncoding = 3002,
  36785. n.LogLuvEncoding = 3003,
  36786. n.RGBM7Encoding = 3004,
  36787. n.RGBM16Encoding = 3005,
  36788. n.RGBDEncoding = 3006,
  36789. n.Color = function(e) {
  36790. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36791. }
  36792. ,
  36793. n.Color.prototype = {
  36794. constructor: n.Color,
  36795. r: 1,
  36796. g: 1,
  36797. b: 1,
  36798. set: function(e) {
  36799. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36800. this
  36801. },
  36802. setScalar: function(e) {
  36803. this.r = e,
  36804. this.g = e,
  36805. this.b = e
  36806. },
  36807. setHex: function(e) {
  36808. return e = Math.floor(e),
  36809. this.r = (e >> 16 & 255) / 255,
  36810. this.g = (e >> 8 & 255) / 255,
  36811. this.b = (255 & e) / 255,
  36812. this
  36813. },
  36814. setRGB: function(e, t, i) {
  36815. return this.r = e,
  36816. this.g = t,
  36817. this.b = i,
  36818. this
  36819. },
  36820. setHSL: function() {
  36821. function e(e, t, i) {
  36822. return i < 0 && (i += 1),
  36823. i > 1 && (i -= 1),
  36824. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36825. }
  36826. return function(t, i, r) {
  36827. if (t = n.Math.euclideanModulo(t, 1),
  36828. i = n.Math.clamp(i, 0, 1),
  36829. r = n.Math.clamp(r, 0, 1),
  36830. 0 === i)
  36831. this.r = this.g = this.b = r;
  36832. else {
  36833. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  36834. , a = 2 * r - o;
  36835. this.r = e(a, o, t + 1 / 3),
  36836. this.g = e(a, o, t),
  36837. this.b = e(a, o, t - 1 / 3)
  36838. }
  36839. return this
  36840. }
  36841. }(),
  36842. setStyle: function(e) {
  36843. function t(t) {
  36844. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  36845. }
  36846. var i;
  36847. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  36848. var r, o = i[1], a = i[2];
  36849. switch (o) {
  36850. case "rgb":
  36851. case "rgba":
  36852. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  36853. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  36854. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  36855. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  36856. t(r[5]),
  36857. this;
  36858. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  36859. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  36860. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  36861. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  36862. t(r[5]),
  36863. this;
  36864. break;
  36865. case "hsl":
  36866. case "hsla":
  36867. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  36868. var s = parseFloat(r[1]) / 360
  36869. , l = parseInt(r[2], 10) / 100
  36870. , c = parseInt(r[3], 10) / 100;
  36871. return t(r[5]),
  36872. this.setHSL(s, l, c)
  36873. }
  36874. }
  36875. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  36876. var h = i[1]
  36877. , u = h.length;
  36878. if (3 === u)
  36879. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  36880. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  36881. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  36882. this;
  36883. if (6 === u)
  36884. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  36885. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  36886. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  36887. this
  36888. }
  36889. if (e && e.length > 0) {
  36890. var h = n.ColorKeywords[e];
  36891. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  36892. }
  36893. return this
  36894. },
  36895. clone: function() {
  36896. return new this.constructor(this.r,this.g,this.b)
  36897. },
  36898. copy: function(e) {
  36899. return this.r = e.r,
  36900. this.g = e.g,
  36901. this.b = e.b,
  36902. this
  36903. },
  36904. copyGammaToLinear: function(e, t) {
  36905. return void 0 === t && (t = 2),
  36906. this.r = Math.pow(e.r, t),
  36907. this.g = Math.pow(e.g, t),
  36908. this.b = Math.pow(e.b, t),
  36909. this
  36910. },
  36911. copyLinearToGamma: function(e, t) {
  36912. void 0 === t && (t = 2);
  36913. var i = t > 0 ? 1 / t : 1;
  36914. return this.r = Math.pow(e.r, i),
  36915. this.g = Math.pow(e.g, i),
  36916. this.b = Math.pow(e.b, i),
  36917. this
  36918. },
  36919. convertGammaToLinear: function() {
  36920. var e = this.r
  36921. , t = this.g
  36922. , i = this.b;
  36923. return this.r = e * e,
  36924. this.g = t * t,
  36925. this.b = i * i,
  36926. this
  36927. },
  36928. convertLinearToGamma: function() {
  36929. return this.r = Math.sqrt(this.r),
  36930. this.g = Math.sqrt(this.g),
  36931. this.b = Math.sqrt(this.b),
  36932. this
  36933. },
  36934. getHex: function() {
  36935. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  36936. },
  36937. getHexString: function() {
  36938. return ("000000" + this.getHex().toString(16)).slice(-6)
  36939. },
  36940. getHSL: function(e) {
  36941. var t, i, n = e || {
  36942. h: 0,
  36943. s: 0,
  36944. l: 0
  36945. }, 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;
  36946. if (l === s)
  36947. t = 0,
  36948. i = 0;
  36949. else {
  36950. var h = s - l;
  36951. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  36952. s) {
  36953. case r:
  36954. t = (o - a) / h + (o < a ? 6 : 0);
  36955. break;
  36956. case o:
  36957. t = (a - r) / h + 2;
  36958. break;
  36959. case a:
  36960. t = (r - o) / h + 4
  36961. }
  36962. t /= 6
  36963. }
  36964. return n.h = t,
  36965. n.s = i,
  36966. n.l = c,
  36967. n
  36968. },
  36969. getStyle: function() {
  36970. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  36971. },
  36972. offsetHSL: function(e, t, i) {
  36973. var n = this.getHSL();
  36974. return n.h += e,
  36975. n.s += t,
  36976. n.l += i,
  36977. this.setHSL(n.h, n.s, n.l),
  36978. this
  36979. },
  36980. add: function(e) {
  36981. return this.r += e.r,
  36982. this.g += e.g,
  36983. this.b += e.b,
  36984. this
  36985. },
  36986. addColors: function(e, t) {
  36987. return this.r = e.r + t.r,
  36988. this.g = e.g + t.g,
  36989. this.b = e.b + t.b,
  36990. this
  36991. },
  36992. addScalar: function(e) {
  36993. return this.r += e,
  36994. this.g += e,
  36995. this.b += e,
  36996. this
  36997. },
  36998. multiply: function(e) {
  36999. return this.r *= e.r,
  37000. this.g *= e.g,
  37001. this.b *= e.b,
  37002. this
  37003. },
  37004. multiplyScalar: function(e) {
  37005. return this.r *= e,
  37006. this.g *= e,
  37007. this.b *= e,
  37008. this
  37009. },
  37010. lerp: function(e, t) {
  37011. return this.r += (e.r - this.r) * t,
  37012. this.g += (e.g - this.g) * t,
  37013. this.b += (e.b - this.b) * t,
  37014. this
  37015. },
  37016. equals: function(e) {
  37017. return e.r === this.r && e.g === this.g && e.b === this.b
  37018. },
  37019. fromArray: function(e, t) {
  37020. return void 0 === t && (t = 0),
  37021. this.r = e[t],
  37022. this.g = e[t + 1],
  37023. this.b = e[t + 2],
  37024. this
  37025. },
  37026. toArray: function(e, t) {
  37027. return void 0 === e && (e = []),
  37028. void 0 === t && (t = 0),
  37029. e[t] = this.r,
  37030. e[t + 1] = this.g,
  37031. e[t + 2] = this.b,
  37032. e
  37033. }
  37034. },
  37035. n.ColorKeywords = {
  37036. aliceblue: 15792383,
  37037. antiquewhite: 16444375,
  37038. aqua: 65535,
  37039. aquamarine: 8388564,
  37040. azure: 15794175,
  37041. beige: 16119260,
  37042. bisque: 16770244,
  37043. black: 0,
  37044. blanchedalmond: 16772045,
  37045. blue: 255,
  37046. blueviolet: 9055202,
  37047. brown: 10824234,
  37048. burlywood: 14596231,
  37049. cadetblue: 6266528,
  37050. chartreuse: 8388352,
  37051. chocolate: 13789470,
  37052. coral: 16744272,
  37053. cornflowerblue: 6591981,
  37054. cornsilk: 16775388,
  37055. crimson: 14423100,
  37056. cyan: 65535,
  37057. darkblue: 139,
  37058. darkcyan: 35723,
  37059. darkgoldenrod: 12092939,
  37060. darkgray: 11119017,
  37061. darkgreen: 25600,
  37062. darkgrey: 11119017,
  37063. darkkhaki: 12433259,
  37064. darkmagenta: 9109643,
  37065. darkolivegreen: 5597999,
  37066. darkorange: 16747520,
  37067. darkorchid: 10040012,
  37068. darkred: 9109504,
  37069. darksalmon: 15308410,
  37070. darkseagreen: 9419919,
  37071. darkslateblue: 4734347,
  37072. darkslategray: 3100495,
  37073. darkslategrey: 3100495,
  37074. darkturquoise: 52945,
  37075. darkviolet: 9699539,
  37076. deeppink: 16716947,
  37077. deepskyblue: 49151,
  37078. dimgray: 6908265,
  37079. dimgrey: 6908265,
  37080. dodgerblue: 2003199,
  37081. firebrick: 11674146,
  37082. floralwhite: 16775920,
  37083. forestgreen: 2263842,
  37084. fuchsia: 16711935,
  37085. gainsboro: 14474460,
  37086. ghostwhite: 16316671,
  37087. gold: 16766720,
  37088. goldenrod: 14329120,
  37089. gray: 8421504,
  37090. green: 32768,
  37091. greenyellow: 11403055,
  37092. grey: 8421504,
  37093. honeydew: 15794160,
  37094. hotpink: 16738740,
  37095. indianred: 13458524,
  37096. indigo: 4915330,
  37097. ivory: 16777200,
  37098. khaki: 15787660,
  37099. lavender: 15132410,
  37100. lavenderblush: 16773365,
  37101. lawngreen: 8190976,
  37102. lemonchiffon: 16775885,
  37103. lightblue: 11393254,
  37104. lightcoral: 15761536,
  37105. lightcyan: 14745599,
  37106. lightgoldenrodyellow: 16448210,
  37107. lightgray: 13882323,
  37108. lightgreen: 9498256,
  37109. lightgrey: 13882323,
  37110. lightpink: 16758465,
  37111. lightsalmon: 16752762,
  37112. lightseagreen: 2142890,
  37113. lightskyblue: 8900346,
  37114. lightslategray: 7833753,
  37115. lightslategrey: 7833753,
  37116. lightsteelblue: 11584734,
  37117. lightyellow: 16777184,
  37118. lime: 65280,
  37119. limegreen: 3329330,
  37120. linen: 16445670,
  37121. magenta: 16711935,
  37122. maroon: 8388608,
  37123. mediumaquamarine: 6737322,
  37124. mediumblue: 205,
  37125. mediumorchid: 12211667,
  37126. mediumpurple: 9662683,
  37127. mediumseagreen: 3978097,
  37128. mediumslateblue: 8087790,
  37129. mediumspringgreen: 64154,
  37130. mediumturquoise: 4772300,
  37131. mediumvioletred: 13047173,
  37132. midnightblue: 1644912,
  37133. mintcream: 16121850,
  37134. mistyrose: 16770273,
  37135. moccasin: 16770229,
  37136. navajowhite: 16768685,
  37137. navy: 128,
  37138. oldlace: 16643558,
  37139. olive: 8421376,
  37140. olivedrab: 7048739,
  37141. orange: 16753920,
  37142. orangered: 16729344,
  37143. orchid: 14315734,
  37144. palegoldenrod: 15657130,
  37145. palegreen: 10025880,
  37146. paleturquoise: 11529966,
  37147. palevioletred: 14381203,
  37148. papayawhip: 16773077,
  37149. peachpuff: 16767673,
  37150. peru: 13468991,
  37151. pink: 16761035,
  37152. plum: 14524637,
  37153. powderblue: 11591910,
  37154. purple: 8388736,
  37155. red: 16711680,
  37156. rosybrown: 12357519,
  37157. royalblue: 4286945,
  37158. saddlebrown: 9127187,
  37159. salmon: 16416882,
  37160. sandybrown: 16032864,
  37161. seagreen: 3050327,
  37162. seashell: 16774638,
  37163. sienna: 10506797,
  37164. silver: 12632256,
  37165. skyblue: 8900331,
  37166. slateblue: 6970061,
  37167. slategray: 7372944,
  37168. slategrey: 7372944,
  37169. snow: 16775930,
  37170. springgreen: 65407,
  37171. steelblue: 4620980,
  37172. tan: 13808780,
  37173. teal: 32896,
  37174. thistle: 14204888,
  37175. tomato: 16737095,
  37176. turquoise: 4251856,
  37177. violet: 15631086,
  37178. wheat: 16113331,
  37179. white: 16777215,
  37180. whitesmoke: 16119285,
  37181. yellow: 16776960,
  37182. yellowgreen: 10145074
  37183. },
  37184. n.Quaternion = function(e, t, i, n) {
  37185. this._x = e || 0,
  37186. this._y = t || 0,
  37187. this._z = i || 0,
  37188. this._w = void 0 !== n ? n : 1
  37189. }
  37190. ,
  37191. n.Quaternion.prototype = {
  37192. constructor: n.Quaternion,
  37193. get x() {
  37194. return this._x
  37195. },
  37196. set x(e) {
  37197. this._x = e,
  37198. this.onChangeCallback()
  37199. },
  37200. get y() {
  37201. return this._y
  37202. },
  37203. set y(e) {
  37204. this._y = e,
  37205. this.onChangeCallback()
  37206. },
  37207. get z() {
  37208. return this._z
  37209. },
  37210. set z(e) {
  37211. this._z = e,
  37212. this.onChangeCallback()
  37213. },
  37214. get w() {
  37215. return this._w
  37216. },
  37217. set w(e) {
  37218. this._w = e,
  37219. this.onChangeCallback()
  37220. },
  37221. set: function(e, t, i, n) {
  37222. return this._x = e,
  37223. this._y = t,
  37224. this._z = i,
  37225. this._w = n,
  37226. this.onChangeCallback(),
  37227. this
  37228. },
  37229. clone: function() {
  37230. return new this.constructor(this._x,this._y,this._z,this._w)
  37231. },
  37232. copy: function(e) {
  37233. return this._x = e.x,
  37234. this._y = e.y,
  37235. this._z = e.z,
  37236. this._w = e.w,
  37237. this.onChangeCallback(),
  37238. this
  37239. },
  37240. setFromEuler: function(e, t) {
  37241. if (e instanceof n.Euler == !1)
  37242. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37243. var i = Math.cos(e._x / 2)
  37244. , r = Math.cos(e._y / 2)
  37245. , o = Math.cos(e._z / 2)
  37246. , a = Math.sin(e._x / 2)
  37247. , s = Math.sin(e._y / 2)
  37248. , l = Math.sin(e._z / 2)
  37249. , c = e.order;
  37250. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  37251. this._y = i * s * o - a * r * l,
  37252. this._z = i * r * l + a * s * o,
  37253. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  37254. this._y = i * s * o - a * r * l,
  37255. this._z = i * r * l - a * s * o,
  37256. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  37257. this._y = i * s * o + a * r * l,
  37258. this._z = i * r * l + a * s * o,
  37259. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  37260. this._y = i * s * o + a * r * l,
  37261. this._z = i * r * l - a * s * o,
  37262. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  37263. this._y = i * s * o + a * r * l,
  37264. this._z = i * r * l - a * s * o,
  37265. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  37266. this._y = i * s * o - a * r * l,
  37267. this._z = i * r * l + a * s * o,
  37268. this._w = i * r * o + a * s * l),
  37269. t !== !1 && this.onChangeCallback(),
  37270. this
  37271. },
  37272. setFromAxisAngle: function(e, t) {
  37273. var i = t / 2
  37274. , n = Math.sin(i);
  37275. return this._x = e.x * n,
  37276. this._y = e.y * n,
  37277. this._z = e.z * n,
  37278. this._w = Math.cos(i),
  37279. this.onChangeCallback(),
  37280. this
  37281. },
  37282. setFromRotationMatrix: function(e) {
  37283. 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;
  37284. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  37285. this._w = .25 / t,
  37286. this._x = (h - l) * t,
  37287. this._y = (o - c) * t,
  37288. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  37289. this._w = (h - l) / t,
  37290. this._x = .25 * t,
  37291. this._y = (r + a) / t,
  37292. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  37293. this._w = (o - c) / t,
  37294. this._x = (r + a) / t,
  37295. this._y = .25 * t,
  37296. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37297. this._w = (a - r) / t,
  37298. this._x = (o + c) / t,
  37299. this._y = (l + h) / t,
  37300. this._z = .25 * t),
  37301. this.onChangeCallback(),
  37302. this
  37303. },
  37304. setFromUnitVectors: function() {
  37305. var e, t, i = 1e-6;
  37306. return function(r, o) {
  37307. return void 0 === e && (e = new n.Vector3),
  37308. t = r.dot(o) + 1,
  37309. t < i ? (t = 0,
  37310. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  37311. this._x = e.x,
  37312. this._y = e.y,
  37313. this._z = e.z,
  37314. this._w = t,
  37315. this.normalize(),
  37316. this
  37317. }
  37318. }(),
  37319. inverse: function() {
  37320. return this.conjugate().normalize(),
  37321. this
  37322. },
  37323. conjugate: function() {
  37324. return this._x *= -1,
  37325. this._y *= -1,
  37326. this._z *= -1,
  37327. this.onChangeCallback(),
  37328. this
  37329. },
  37330. dot: function(e) {
  37331. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37332. },
  37333. lengthSq: function() {
  37334. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37335. },
  37336. length: function() {
  37337. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37338. },
  37339. normalize: function() {
  37340. var e = this.length();
  37341. return 0 === e ? (this._x = 0,
  37342. this._y = 0,
  37343. this._z = 0,
  37344. this._w = 1) : (e = 1 / e,
  37345. this._x = this._x * e,
  37346. this._y = this._y * e,
  37347. this._z = this._z * e,
  37348. this._w = this._w * e),
  37349. this.onChangeCallback(),
  37350. this
  37351. },
  37352. multiply: function(e, t) {
  37353. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37354. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37355. },
  37356. multiplyQuaternions: function(e, t) {
  37357. var i = e._x
  37358. , n = e._y
  37359. , r = e._z
  37360. , o = e._w
  37361. , a = t._x
  37362. , s = t._y
  37363. , l = t._z
  37364. , c = t._w;
  37365. return this._x = i * c + o * a + n * l - r * s,
  37366. this._y = n * c + o * s + r * a - i * l,
  37367. this._z = r * c + o * l + i * s - n * a,
  37368. this._w = o * c - i * a - n * s - r * l,
  37369. this.onChangeCallback(),
  37370. this
  37371. },
  37372. slerp: function(e, t) {
  37373. if (0 === t)
  37374. return this;
  37375. if (1 === t)
  37376. return this.copy(e);
  37377. var i = this._x
  37378. , n = this._y
  37379. , r = this._z
  37380. , o = this._w
  37381. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37382. if (a < 0 ? (this._w = -e._w,
  37383. this._x = -e._x,
  37384. this._y = -e._y,
  37385. this._z = -e._z,
  37386. a = -a) : this.copy(e),
  37387. a >= 1)
  37388. return this._w = o,
  37389. this._x = i,
  37390. this._y = n,
  37391. this._z = r,
  37392. this;
  37393. var s = Math.sqrt(1 - a * a);
  37394. if (Math.abs(s) < .001)
  37395. return this._w = .5 * (o + this._w),
  37396. this._x = .5 * (i + this._x),
  37397. this._y = .5 * (n + this._y),
  37398. this._z = .5 * (r + this._z),
  37399. this;
  37400. var l = Math.atan2(s, a)
  37401. , c = Math.sin((1 - t) * l) / s
  37402. , h = Math.sin(t * l) / s;
  37403. return this._w = o * c + this._w * h,
  37404. this._x = i * c + this._x * h,
  37405. this._y = n * c + this._y * h,
  37406. this._z = r * c + this._z * h,
  37407. this.onChangeCallback(),
  37408. this
  37409. },
  37410. equals: function(e) {
  37411. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37412. },
  37413. fromArray: function(e, t) {
  37414. return void 0 === t && (t = 0),
  37415. this._x = e[t],
  37416. this._y = e[t + 1],
  37417. this._z = e[t + 2],
  37418. this._w = e[t + 3],
  37419. this.onChangeCallback(),
  37420. this
  37421. },
  37422. toArray: function(e, t) {
  37423. return void 0 === e && (e = []),
  37424. void 0 === t && (t = 0),
  37425. e[t] = this._x,
  37426. e[t + 1] = this._y,
  37427. e[t + 2] = this._z,
  37428. e[t + 3] = this._w,
  37429. e
  37430. },
  37431. onChange: function(e) {
  37432. return this.onChangeCallback = e,
  37433. this
  37434. },
  37435. onChangeCallback: function() {}
  37436. },
  37437. Object.assign(n.Quaternion, {
  37438. slerp: function(e, t, i, n) {
  37439. return i.copy(e).slerp(t, n)
  37440. },
  37441. slerpFlat: function(e, t, i, n, r, o, a) {
  37442. var s = i[n + 0]
  37443. , l = i[n + 1]
  37444. , c = i[n + 2]
  37445. , h = i[n + 3]
  37446. , u = r[o + 0]
  37447. , d = r[o + 1]
  37448. , p = r[o + 2]
  37449. , f = r[o + 3];
  37450. if (h !== f || s !== u || l !== d || c !== p) {
  37451. var g = 1 - a
  37452. , m = s * u + l * d + c * p + h * f
  37453. , v = m >= 0 ? 1 : -1
  37454. , A = 1 - m * m;
  37455. if (A > Number.EPSILON) {
  37456. var y = Math.sqrt(A)
  37457. , C = Math.atan2(y, m * v);
  37458. g = Math.sin(g * C) / y,
  37459. a = Math.sin(a * C) / y
  37460. }
  37461. var I = a * v;
  37462. if (s = s * g + u * I,
  37463. l = l * g + d * I,
  37464. c = c * g + p * I,
  37465. h = h * g + f * I,
  37466. g === 1 - a) {
  37467. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37468. s *= E,
  37469. l *= E,
  37470. c *= E,
  37471. h *= E
  37472. }
  37473. }
  37474. e[t] = s,
  37475. e[t + 1] = l,
  37476. e[t + 2] = c,
  37477. e[t + 3] = h
  37478. }
  37479. }),
  37480. n.Vector2 = function(e, t) {
  37481. this.x = e || 0,
  37482. this.y = t || 0
  37483. }
  37484. ,
  37485. n.Vector2.prototype = {
  37486. constructor: n.Vector2,
  37487. get width() {
  37488. return this.x
  37489. },
  37490. set width(e) {
  37491. this.x = e
  37492. },
  37493. get height() {
  37494. return this.y
  37495. },
  37496. set height(e) {
  37497. this.y = e
  37498. },
  37499. set: function(e, t) {
  37500. return this.x = e,
  37501. this.y = t,
  37502. this
  37503. },
  37504. setScalar: function(e) {
  37505. return this.x = e,
  37506. this.y = e,
  37507. this
  37508. },
  37509. setX: function(e) {
  37510. return this.x = e,
  37511. this
  37512. },
  37513. setY: function(e) {
  37514. return this.y = e,
  37515. this
  37516. },
  37517. setComponent: function(e, t) {
  37518. switch (e) {
  37519. case 0:
  37520. this.x = t;
  37521. break;
  37522. case 1:
  37523. this.y = t;
  37524. break;
  37525. default:
  37526. throw new Error("index is out of range: " + e)
  37527. }
  37528. },
  37529. getComponent: function(e) {
  37530. switch (e) {
  37531. case 0:
  37532. return this.x;
  37533. case 1:
  37534. return this.y;
  37535. default:
  37536. throw new Error("index is out of range: " + e)
  37537. }
  37538. },
  37539. clone: function() {
  37540. return new this.constructor(this.x,this.y)
  37541. },
  37542. copy: function(e) {
  37543. return this.x = e.x,
  37544. this.y = e.y,
  37545. this
  37546. },
  37547. add: function(e, t) {
  37548. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37549. this.addVectors(e, t)) : (this.x += e.x,
  37550. this.y += e.y,
  37551. this)
  37552. },
  37553. addScalar: function(e) {
  37554. return this.x += e,
  37555. this.y += e,
  37556. this
  37557. },
  37558. addVectors: function(e, t) {
  37559. return this.x = e.x + t.x,
  37560. this.y = e.y + t.y,
  37561. this
  37562. },
  37563. addScaledVector: function(e, t) {
  37564. return this.x += e.x * t,
  37565. this.y += e.y * t,
  37566. this
  37567. },
  37568. sub: function(e, t) {
  37569. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37570. this.subVectors(e, t)) : (this.x -= e.x,
  37571. this.y -= e.y,
  37572. this)
  37573. },
  37574. subScalar: function(e) {
  37575. return this.x -= e,
  37576. this.y -= e,
  37577. this
  37578. },
  37579. subVectors: function(e, t) {
  37580. return this.x = e.x - t.x,
  37581. this.y = e.y - t.y,
  37582. this
  37583. },
  37584. multiply: function(e) {
  37585. return this.x *= e.x,
  37586. this.y *= e.y,
  37587. this
  37588. },
  37589. multiplyScalar: function(e) {
  37590. return isFinite(e) ? (this.x *= e,
  37591. this.y *= e) : (this.x = 0,
  37592. this.y = 0),
  37593. this
  37594. },
  37595. divide: function(e) {
  37596. return this.x /= e.x,
  37597. this.y /= e.y,
  37598. this
  37599. },
  37600. divideScalar: function(e) {
  37601. return this.multiplyScalar(1 / e)
  37602. },
  37603. min: function(e) {
  37604. return this.x = Math.min(this.x, e.x),
  37605. this.y = Math.min(this.y, e.y),
  37606. this
  37607. },
  37608. max: function(e) {
  37609. return this.x = Math.max(this.x, e.x),
  37610. this.y = Math.max(this.y, e.y),
  37611. this
  37612. },
  37613. clamp: function(e, t) {
  37614. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37615. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37616. this
  37617. },
  37618. clampScalar: function() {
  37619. var e, t;
  37620. return function(i, r) {
  37621. return void 0 === e && (e = new n.Vector2,
  37622. t = new n.Vector2),
  37623. e.set(i, i),
  37624. t.set(r, r),
  37625. this.clamp(e, t)
  37626. }
  37627. }(),
  37628. clampLength: function(e, t) {
  37629. var i = this.length();
  37630. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37631. this
  37632. },
  37633. floor: function() {
  37634. return this.x = Math.floor(this.x),
  37635. this.y = Math.floor(this.y),
  37636. this
  37637. },
  37638. ceil: function() {
  37639. return this.x = Math.ceil(this.x),
  37640. this.y = Math.ceil(this.y),
  37641. this
  37642. },
  37643. round: function() {
  37644. return this.x = Math.round(this.x),
  37645. this.y = Math.round(this.y),
  37646. this
  37647. },
  37648. roundToZero: function() {
  37649. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37650. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37651. this
  37652. },
  37653. negate: function() {
  37654. return this.x = -this.x,
  37655. this.y = -this.y,
  37656. this
  37657. },
  37658. dot: function(e) {
  37659. return this.x * e.x + this.y * e.y
  37660. },
  37661. lengthSq: function() {
  37662. return this.x * this.x + this.y * this.y
  37663. },
  37664. length: function() {
  37665. return Math.sqrt(this.x * this.x + this.y * this.y)
  37666. },
  37667. lengthManhattan: function() {
  37668. return Math.abs(this.x) + Math.abs(this.y)
  37669. },
  37670. normalize: function() {
  37671. return this.divideScalar(this.length())
  37672. },
  37673. angle: function() {
  37674. var e = Math.atan2(this.y, this.x);
  37675. return e < 0 && (e += 2 * Math.PI),
  37676. e
  37677. },
  37678. distanceTo: function(e) {
  37679. return Math.sqrt(this.distanceToSquared(e))
  37680. },
  37681. distanceToSquared: function(e) {
  37682. var t = this.x - e.x
  37683. , i = this.y - e.y;
  37684. return t * t + i * i
  37685. },
  37686. setLength: function(e) {
  37687. return this.multiplyScalar(e / this.length())
  37688. },
  37689. lerp: function(e, t) {
  37690. return this.x += (e.x - this.x) * t,
  37691. this.y += (e.y - this.y) * t,
  37692. this
  37693. },
  37694. lerpVectors: function(e, t, i) {
  37695. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37696. this
  37697. },
  37698. equals: function(e) {
  37699. return e.x === this.x && e.y === this.y
  37700. },
  37701. fromArray: function(e, t) {
  37702. return void 0 === t && (t = 0),
  37703. this.x = e[t],
  37704. this.y = e[t + 1],
  37705. this
  37706. },
  37707. toArray: function(e, t) {
  37708. return void 0 === e && (e = []),
  37709. void 0 === t && (t = 0),
  37710. e[t] = this.x,
  37711. e[t + 1] = this.y,
  37712. e
  37713. },
  37714. fromAttribute: function(e, t, i) {
  37715. return void 0 === i && (i = 0),
  37716. t = t * e.itemSize + i,
  37717. this.x = e.array[t],
  37718. this.y = e.array[t + 1],
  37719. this
  37720. },
  37721. rotateAround: function(e, t) {
  37722. var i = Math.cos(t)
  37723. , n = Math.sin(t)
  37724. , r = this.x - e.x
  37725. , o = this.y - e.y;
  37726. return this.x = r * i - o * n + e.x,
  37727. this.y = r * n + o * i + e.y,
  37728. this
  37729. }
  37730. },
  37731. n.Vector3 = function(e, t, i) {
  37732. this.x = e || 0,
  37733. this.y = t || 0,
  37734. this.z = i || 0
  37735. }
  37736. ,
  37737. n.Vector3.prototype = {
  37738. constructor: n.Vector3,
  37739. set: function(e, t, i) {
  37740. return this.x = e,
  37741. this.y = t,
  37742. this.z = i,
  37743. this
  37744. },
  37745. setScalar: function(e) {
  37746. return this.x = e,
  37747. this.y = e,
  37748. this.z = e,
  37749. this
  37750. },
  37751. setX: function(e) {
  37752. return this.x = e,
  37753. this
  37754. },
  37755. setY: function(e) {
  37756. return this.y = e,
  37757. this
  37758. },
  37759. setZ: function(e) {
  37760. return this.z = e,
  37761. this
  37762. },
  37763. setComponent: function(e, t) {
  37764. switch (e) {
  37765. case 0:
  37766. this.x = t;
  37767. break;
  37768. case 1:
  37769. this.y = t;
  37770. break;
  37771. case 2:
  37772. this.z = t;
  37773. break;
  37774. default:
  37775. throw new Error("index is out of range: " + e)
  37776. }
  37777. },
  37778. getComponent: function(e) {
  37779. switch (e) {
  37780. case 0:
  37781. return this.x;
  37782. case 1:
  37783. return this.y;
  37784. case 2:
  37785. return this.z;
  37786. default:
  37787. throw new Error("index is out of range: " + e)
  37788. }
  37789. },
  37790. clone: function() {
  37791. return new this.constructor(this.x,this.y,this.z)
  37792. },
  37793. copy: function(e) {
  37794. return this.x = e.x,
  37795. this.y = e.y,
  37796. this.z = e.z,
  37797. this
  37798. },
  37799. add: function(e, t) {
  37800. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37801. this.addVectors(e, t)) : (this.x += e.x,
  37802. this.y += e.y,
  37803. this.z += e.z,
  37804. this)
  37805. },
  37806. addScalar: function(e) {
  37807. return this.x += e,
  37808. this.y += e,
  37809. this.z += e,
  37810. this
  37811. },
  37812. addVectors: function(e, t) {
  37813. return this.x = e.x + t.x,
  37814. this.y = e.y + t.y,
  37815. this.z = e.z + t.z,
  37816. this
  37817. },
  37818. addScaledVector: function(e, t) {
  37819. return this.x += e.x * t,
  37820. this.y += e.y * t,
  37821. this.z += e.z * t,
  37822. this
  37823. },
  37824. sub: function(e, t) {
  37825. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37826. this.subVectors(e, t)) : (this.x -= e.x,
  37827. this.y -= e.y,
  37828. this.z -= e.z,
  37829. this)
  37830. },
  37831. subScalar: function(e) {
  37832. return this.x -= e,
  37833. this.y -= e,
  37834. this.z -= e,
  37835. this
  37836. },
  37837. subVectors: function(e, t) {
  37838. return this.x = e.x - t.x,
  37839. this.y = e.y - t.y,
  37840. this.z = e.z - t.z,
  37841. this
  37842. },
  37843. multiply: function(e, t) {
  37844. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37845. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37846. this.y *= e.y,
  37847. this.z *= e.z,
  37848. this)
  37849. },
  37850. multiplyScalar: function(e) {
  37851. return isFinite(e) ? (this.x *= e,
  37852. this.y *= e,
  37853. this.z *= e) : (this.x = 0,
  37854. this.y = 0,
  37855. this.z = 0),
  37856. this
  37857. },
  37858. multiplyVectors: function(e, t) {
  37859. return this.x = e.x * t.x,
  37860. this.y = e.y * t.y,
  37861. this.z = e.z * t.z,
  37862. this
  37863. },
  37864. applyEuler: function() {
  37865. var e;
  37866. return function(t) {
  37867. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  37868. void 0 === e && (e = new n.Quaternion),
  37869. this.applyQuaternion(e.setFromEuler(t)),
  37870. this
  37871. }
  37872. }(),
  37873. applyAxisAngle: function() {
  37874. var e;
  37875. return function(t, i) {
  37876. return void 0 === e && (e = new n.Quaternion),
  37877. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  37878. this
  37879. }
  37880. }(),
  37881. applyMatrix3: function(e) {
  37882. var t = this.x
  37883. , i = this.y
  37884. , n = this.z
  37885. , r = e.elements;
  37886. return this.x = r[0] * t + r[3] * i + r[6] * n,
  37887. this.y = r[1] * t + r[4] * i + r[7] * n,
  37888. this.z = r[2] * t + r[5] * i + r[8] * n,
  37889. this
  37890. },
  37891. applyMatrix4: function(e) {
  37892. var t = this.x
  37893. , i = this.y
  37894. , n = this.z
  37895. , r = e.elements;
  37896. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  37897. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  37898. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  37899. this
  37900. },
  37901. applyProjection: function(e) {
  37902. var t = this.x
  37903. , i = this.y
  37904. , n = this.z
  37905. , r = e.elements
  37906. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  37907. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  37908. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  37909. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  37910. this
  37911. },
  37912. applyQuaternion: function(e) {
  37913. var t = this.x
  37914. , i = this.y
  37915. , n = this.z
  37916. , r = e.x
  37917. , o = e.y
  37918. , a = e.z
  37919. , s = e.w
  37920. , l = s * t + o * n - a * i
  37921. , c = s * i + a * t - r * n
  37922. , h = s * n + r * i - o * t
  37923. , u = -r * t - o * i - a * n;
  37924. return this.x = l * s + u * -r + c * -a - h * -o,
  37925. this.y = c * s + u * -o + h * -r - l * -a,
  37926. this.z = h * s + u * -a + l * -o - c * -r,
  37927. this
  37928. },
  37929. project: function() {
  37930. var e;
  37931. return function(t) {
  37932. return void 0 === e && (e = new n.Matrix4),
  37933. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  37934. this.applyProjection(e)
  37935. }
  37936. }(),
  37937. unproject: function() {
  37938. var e;
  37939. return function(t) {
  37940. return void 0 === e && (e = new n.Matrix4),
  37941. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  37942. this.applyProjection(e)
  37943. }
  37944. }(),
  37945. transformDirection: function(e) {
  37946. var t = this.x
  37947. , i = this.y
  37948. , n = this.z
  37949. , r = e.elements;
  37950. return this.x = r[0] * t + r[4] * i + r[8] * n,
  37951. this.y = r[1] * t + r[5] * i + r[9] * n,
  37952. this.z = r[2] * t + r[6] * i + r[10] * n,
  37953. this.normalize(),
  37954. this
  37955. },
  37956. divide: function(e) {
  37957. return this.x /= e.x,
  37958. this.y /= e.y,
  37959. this.z /= e.z,
  37960. this
  37961. },
  37962. divideScalar: function(e) {
  37963. return this.multiplyScalar(1 / e)
  37964. },
  37965. min: function(e) {
  37966. return this.x = Math.min(this.x, e.x),
  37967. this.y = Math.min(this.y, e.y),
  37968. this.z = Math.min(this.z, e.z),
  37969. this
  37970. },
  37971. max: function(e) {
  37972. return this.x = Math.max(this.x, e.x),
  37973. this.y = Math.max(this.y, e.y),
  37974. this.z = Math.max(this.z, e.z),
  37975. this
  37976. },
  37977. clamp: function(e, t) {
  37978. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37979. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37980. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  37981. this
  37982. },
  37983. clampScalar: function() {
  37984. var e, t;
  37985. return function(i, r) {
  37986. return void 0 === e && (e = new n.Vector3,
  37987. t = new n.Vector3),
  37988. e.set(i, i, i),
  37989. t.set(r, r, r),
  37990. this.clamp(e, t)
  37991. }
  37992. }(),
  37993. clampLength: function(e, t) {
  37994. var i = this.length();
  37995. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37996. this
  37997. },
  37998. floor: function() {
  37999. return this.x = Math.floor(this.x),
  38000. this.y = Math.floor(this.y),
  38001. this.z = Math.floor(this.z),
  38002. this
  38003. },
  38004. ceil: function() {
  38005. return this.x = Math.ceil(this.x),
  38006. this.y = Math.ceil(this.y),
  38007. this.z = Math.ceil(this.z),
  38008. this
  38009. },
  38010. round: function() {
  38011. return this.x = Math.round(this.x),
  38012. this.y = Math.round(this.y),
  38013. this.z = Math.round(this.z),
  38014. this
  38015. },
  38016. roundToZero: function() {
  38017. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38018. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38019. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38020. this
  38021. },
  38022. negate: function() {
  38023. return this.x = -this.x,
  38024. this.y = -this.y,
  38025. this.z = -this.z,
  38026. this
  38027. },
  38028. dot: function(e) {
  38029. return this.x * e.x + this.y * e.y + this.z * e.z
  38030. },
  38031. lengthSq: function() {
  38032. return this.x * this.x + this.y * this.y + this.z * this.z
  38033. },
  38034. length: function() {
  38035. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38036. },
  38037. lengthManhattan: function() {
  38038. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38039. },
  38040. normalize: function() {
  38041. return this.divideScalar(this.length())
  38042. },
  38043. setLength: function(e) {
  38044. return this.multiplyScalar(e / this.length())
  38045. },
  38046. lerp: function(e, t) {
  38047. return this.x += (e.x - this.x) * t,
  38048. this.y += (e.y - this.y) * t,
  38049. this.z += (e.z - this.z) * t,
  38050. this
  38051. },
  38052. lerpVectors: function(e, t, i) {
  38053. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38054. this
  38055. },
  38056. cross: function(e, t) {
  38057. if (void 0 !== t)
  38058. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38059. this.crossVectors(e, t);
  38060. var i = this.x
  38061. , n = this.y
  38062. , r = this.z;
  38063. return this.x = n * e.z - r * e.y,
  38064. this.y = r * e.x - i * e.z,
  38065. this.z = i * e.y - n * e.x,
  38066. this
  38067. },
  38068. crossVectors: function(e, t) {
  38069. var i = e.x
  38070. , n = e.y
  38071. , r = e.z
  38072. , o = t.x
  38073. , a = t.y
  38074. , s = t.z;
  38075. return this.x = n * s - r * a,
  38076. this.y = r * o - i * s,
  38077. this.z = i * a - n * o,
  38078. this
  38079. },
  38080. projectOnVector: function() {
  38081. var e, t;
  38082. return function(i) {
  38083. return void 0 === e && (e = new n.Vector3),
  38084. e.copy(i).normalize(),
  38085. t = this.dot(e),
  38086. this.copy(e).multiplyScalar(t)
  38087. }
  38088. }(),
  38089. projectOnPlane: function() {
  38090. var e;
  38091. return function(t) {
  38092. return void 0 === e && (e = new n.Vector3),
  38093. e.copy(this).projectOnVector(t),
  38094. this.sub(e)
  38095. }
  38096. }(),
  38097. reflect: function() {
  38098. var e;
  38099. return function(t) {
  38100. return void 0 === e && (e = new n.Vector3),
  38101. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  38102. }
  38103. }(),
  38104. angleTo: function(e) {
  38105. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38106. return Math.acos(n.Math.clamp(t, -1, 1))
  38107. },
  38108. distanceTo: function(e) {
  38109. return Math.sqrt(this.distanceToSquared(e))
  38110. },
  38111. distanceToSquared: function(e) {
  38112. var t = this.x - e.x
  38113. , i = this.y - e.y
  38114. , n = this.z - e.z;
  38115. return t * t + i * i + n * n
  38116. },
  38117. setFromSpherical: function(e) {
  38118. var t = Math.sin(e.phi) * e.radius;
  38119. return this.x = t * Math.sin(e.theta),
  38120. this.y = Math.cos(e.phi) * e.radius,
  38121. this.z = t * Math.cos(e.theta),
  38122. this
  38123. },
  38124. setFromMatrixPosition: function(e) {
  38125. return this.setFromMatrixColumn(e, 3)
  38126. },
  38127. setFromMatrixScale: function(e) {
  38128. var t = this.setFromMatrixColumn(e, 0).length()
  38129. , i = this.setFromMatrixColumn(e, 1).length()
  38130. , n = this.setFromMatrixColumn(e, 2).length();
  38131. return this.x = t,
  38132. this.y = i,
  38133. this.z = n,
  38134. this
  38135. },
  38136. setFromMatrixColumn: function(e, t) {
  38137. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38138. e = arguments[1],
  38139. t = arguments[0]),
  38140. this.fromArray(e.elements, 4 * t)
  38141. },
  38142. equals: function(e) {
  38143. return e.x === this.x && e.y === this.y && e.z === this.z
  38144. },
  38145. fromArray: function(e, t) {
  38146. return void 0 === t && (t = 0),
  38147. this.x = e[t],
  38148. this.y = e[t + 1],
  38149. this.z = e[t + 2],
  38150. this
  38151. },
  38152. toArray: function(e, t) {
  38153. return void 0 === e && (e = []),
  38154. void 0 === t && (t = 0),
  38155. e[t] = this.x,
  38156. e[t + 1] = this.y,
  38157. e[t + 2] = this.z,
  38158. e
  38159. },
  38160. fromAttribute: function(e, t, i) {
  38161. return void 0 === i && (i = 0),
  38162. t = t * e.itemSize + i,
  38163. this.x = e.array[t],
  38164. this.y = e.array[t + 1],
  38165. this.z = e.array[t + 2],
  38166. this
  38167. }
  38168. },
  38169. n.Vector4 = function(e, t, i, n) {
  38170. this.x = e || 0,
  38171. this.y = t || 0,
  38172. this.z = i || 0,
  38173. this.w = void 0 !== n ? n : 1
  38174. }
  38175. ,
  38176. n.Vector4.prototype = {
  38177. constructor: n.Vector4,
  38178. set: function(e, t, i, n) {
  38179. return this.x = e,
  38180. this.y = t,
  38181. this.z = i,
  38182. this.w = n,
  38183. this
  38184. },
  38185. setScalar: function(e) {
  38186. return this.x = e,
  38187. this.y = e,
  38188. this.z = e,
  38189. this.w = e,
  38190. this
  38191. },
  38192. setX: function(e) {
  38193. return this.x = e,
  38194. this
  38195. },
  38196. setY: function(e) {
  38197. return this.y = e,
  38198. this
  38199. },
  38200. setZ: function(e) {
  38201. return this.z = e,
  38202. this
  38203. },
  38204. setW: function(e) {
  38205. return this.w = e,
  38206. this
  38207. },
  38208. setComponent: function(e, t) {
  38209. switch (e) {
  38210. case 0:
  38211. this.x = t;
  38212. break;
  38213. case 1:
  38214. this.y = t;
  38215. break;
  38216. case 2:
  38217. this.z = t;
  38218. break;
  38219. case 3:
  38220. this.w = t;
  38221. break;
  38222. default:
  38223. throw new Error("index is out of range: " + e)
  38224. }
  38225. },
  38226. getComponent: function(e) {
  38227. switch (e) {
  38228. case 0:
  38229. return this.x;
  38230. case 1:
  38231. return this.y;
  38232. case 2:
  38233. return this.z;
  38234. case 3:
  38235. return this.w;
  38236. default:
  38237. throw new Error("index is out of range: " + e)
  38238. }
  38239. },
  38240. clone: function() {
  38241. return new this.constructor(this.x,this.y,this.z,this.w)
  38242. },
  38243. copy: function(e) {
  38244. return this.x = e.x,
  38245. this.y = e.y,
  38246. this.z = e.z,
  38247. this.w = void 0 !== e.w ? e.w : 1,
  38248. this
  38249. },
  38250. add: function(e, t) {
  38251. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38252. this.addVectors(e, t)) : (this.x += e.x,
  38253. this.y += e.y,
  38254. this.z += e.z,
  38255. this.w += e.w,
  38256. this)
  38257. },
  38258. addScalar: function(e) {
  38259. return this.x += e,
  38260. this.y += e,
  38261. this.z += e,
  38262. this.w += e,
  38263. this
  38264. },
  38265. addVectors: function(e, t) {
  38266. return this.x = e.x + t.x,
  38267. this.y = e.y + t.y,
  38268. this.z = e.z + t.z,
  38269. this.w = e.w + t.w,
  38270. this
  38271. },
  38272. addScaledVector: function(e, t) {
  38273. return this.x += e.x * t,
  38274. this.y += e.y * t,
  38275. this.z += e.z * t,
  38276. this.w += e.w * t,
  38277. this
  38278. },
  38279. sub: function(e, t) {
  38280. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38281. this.subVectors(e, t)) : (this.x -= e.x,
  38282. this.y -= e.y,
  38283. this.z -= e.z,
  38284. this.w -= e.w,
  38285. this)
  38286. },
  38287. subScalar: function(e) {
  38288. return this.x -= e,
  38289. this.y -= e,
  38290. this.z -= e,
  38291. this.w -= e,
  38292. this
  38293. },
  38294. subVectors: function(e, t) {
  38295. return this.x = e.x - t.x,
  38296. this.y = e.y - t.y,
  38297. this.z = e.z - t.z,
  38298. this.w = e.w - t.w,
  38299. this
  38300. },
  38301. multiplyScalar: function(e) {
  38302. return isFinite(e) ? (this.x *= e,
  38303. this.y *= e,
  38304. this.z *= e,
  38305. this.w *= e) : (this.x = 0,
  38306. this.y = 0,
  38307. this.z = 0,
  38308. this.w = 0),
  38309. this
  38310. },
  38311. applyMatrix4: function(e) {
  38312. var t = this.x
  38313. , i = this.y
  38314. , n = this.z
  38315. , r = this.w
  38316. , o = e.elements;
  38317. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38318. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38319. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38320. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38321. this
  38322. },
  38323. divideScalar: function(e) {
  38324. return this.multiplyScalar(1 / e)
  38325. },
  38326. setAxisAngleFromQuaternion: function(e) {
  38327. this.w = 2 * Math.acos(e.w);
  38328. var t = Math.sqrt(1 - e.w * e.w);
  38329. return t < 1e-4 ? (this.x = 1,
  38330. this.y = 0,
  38331. this.z = 0) : (this.x = e.x / t,
  38332. this.y = e.y / t,
  38333. this.z = e.z / t),
  38334. this
  38335. },
  38336. setAxisAngleFromRotationMatrix: function(e) {
  38337. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  38338. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  38339. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  38340. return this.set(1, 0, 0, 0),
  38341. this;
  38342. t = Math.PI;
  38343. var v = (l + 1) / 2
  38344. , A = (d + 1) / 2
  38345. , y = (m + 1) / 2
  38346. , C = (c + u) / 4
  38347. , I = (h + f) / 4
  38348. , E = (p + g) / 4;
  38349. return v > A && v > y ? v < o ? (i = 0,
  38350. n = .707106781,
  38351. r = .707106781) : (i = Math.sqrt(v),
  38352. n = C / i,
  38353. r = I / i) : A > y ? A < o ? (i = .707106781,
  38354. n = 0,
  38355. r = .707106781) : (n = Math.sqrt(A),
  38356. i = C / n,
  38357. r = E / n) : y < o ? (i = .707106781,
  38358. n = .707106781,
  38359. r = 0) : (r = Math.sqrt(y),
  38360. i = I / r,
  38361. n = E / r),
  38362. this.set(i, n, r, t),
  38363. this
  38364. }
  38365. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  38366. return Math.abs(b) < .001 && (b = 1),
  38367. this.x = (g - p) / b,
  38368. this.y = (h - f) / b,
  38369. this.z = (u - c) / b,
  38370. this.w = Math.acos((l + d + m - 1) / 2),
  38371. this
  38372. },
  38373. min: function(e) {
  38374. return this.x = Math.min(this.x, e.x),
  38375. this.y = Math.min(this.y, e.y),
  38376. this.z = Math.min(this.z, e.z),
  38377. this.w = Math.min(this.w, e.w),
  38378. this
  38379. },
  38380. max: function(e) {
  38381. return this.x = Math.max(this.x, e.x),
  38382. this.y = Math.max(this.y, e.y),
  38383. this.z = Math.max(this.z, e.z),
  38384. this.w = Math.max(this.w, e.w),
  38385. this
  38386. },
  38387. clamp: function(e, t) {
  38388. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38389. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38390. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38391. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38392. this
  38393. },
  38394. clampScalar: function() {
  38395. var e, t;
  38396. return function(i, r) {
  38397. return void 0 === e && (e = new n.Vector4,
  38398. t = new n.Vector4),
  38399. e.set(i, i, i, i),
  38400. t.set(r, r, r, r),
  38401. this.clamp(e, t)
  38402. }
  38403. }(),
  38404. floor: function() {
  38405. return this.x = Math.floor(this.x),
  38406. this.y = Math.floor(this.y),
  38407. this.z = Math.floor(this.z),
  38408. this.w = Math.floor(this.w),
  38409. this
  38410. },
  38411. ceil: function() {
  38412. return this.x = Math.ceil(this.x),
  38413. this.y = Math.ceil(this.y),
  38414. this.z = Math.ceil(this.z),
  38415. this.w = Math.ceil(this.w),
  38416. this
  38417. },
  38418. round: function() {
  38419. return this.x = Math.round(this.x),
  38420. this.y = Math.round(this.y),
  38421. this.z = Math.round(this.z),
  38422. this.w = Math.round(this.w),
  38423. this
  38424. },
  38425. roundToZero: function() {
  38426. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38427. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38428. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38429. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38430. this
  38431. },
  38432. negate: function() {
  38433. return this.x = -this.x,
  38434. this.y = -this.y,
  38435. this.z = -this.z,
  38436. this.w = -this.w,
  38437. this
  38438. },
  38439. dot: function(e) {
  38440. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38441. },
  38442. lengthSq: function() {
  38443. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38444. },
  38445. length: function() {
  38446. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38447. },
  38448. lengthManhattan: function() {
  38449. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38450. },
  38451. normalize: function() {
  38452. return this.divideScalar(this.length())
  38453. },
  38454. setLength: function(e) {
  38455. return this.multiplyScalar(e / this.length())
  38456. },
  38457. lerp: function(e, t) {
  38458. return this.x += (e.x - this.x) * t,
  38459. this.y += (e.y - this.y) * t,
  38460. this.z += (e.z - this.z) * t,
  38461. this.w += (e.w - this.w) * t,
  38462. this
  38463. },
  38464. lerpVectors: function(e, t, i) {
  38465. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38466. this
  38467. },
  38468. equals: function(e) {
  38469. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38470. },
  38471. fromArray: function(e, t) {
  38472. return void 0 === t && (t = 0),
  38473. this.x = e[t],
  38474. this.y = e[t + 1],
  38475. this.z = e[t + 2],
  38476. this.w = e[t + 3],
  38477. this
  38478. },
  38479. toArray: function(e, t) {
  38480. return void 0 === e && (e = []),
  38481. void 0 === t && (t = 0),
  38482. e[t] = this.x,
  38483. e[t + 1] = this.y,
  38484. e[t + 2] = this.z,
  38485. e[t + 3] = this.w,
  38486. e
  38487. },
  38488. fromAttribute: function(e, t, i) {
  38489. return void 0 === i && (i = 0),
  38490. t = t * e.itemSize + i,
  38491. this.x = e.array[t],
  38492. this.y = e.array[t + 1],
  38493. this.z = e.array[t + 2],
  38494. this.w = e.array[t + 3],
  38495. this
  38496. }
  38497. },
  38498. n.Euler = function(e, t, i, r) {
  38499. this._x = e || 0,
  38500. this._y = t || 0,
  38501. this._z = i || 0,
  38502. this._order = r || n.Euler.DefaultOrder
  38503. }
  38504. ,
  38505. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38506. n.Euler.DefaultOrder = "XYZ",
  38507. n.Euler.prototype = {
  38508. constructor: n.Euler,
  38509. get x() {
  38510. return this._x
  38511. },
  38512. set x(e) {
  38513. this._x = e,
  38514. this.onChangeCallback()
  38515. },
  38516. get y() {
  38517. return this._y
  38518. },
  38519. set y(e) {
  38520. this._y = e,
  38521. this.onChangeCallback()
  38522. },
  38523. get z() {
  38524. return this._z
  38525. },
  38526. set z(e) {
  38527. this._z = e,
  38528. this.onChangeCallback()
  38529. },
  38530. get order() {
  38531. return this._order
  38532. },
  38533. set order(e) {
  38534. this._order = e,
  38535. this.onChangeCallback()
  38536. },
  38537. set: function(e, t, i, n) {
  38538. return this._x = e,
  38539. this._y = t,
  38540. this._z = i,
  38541. this._order = n || this._order,
  38542. this.onChangeCallback(),
  38543. this
  38544. },
  38545. clone: function() {
  38546. return new this.constructor(this._x,this._y,this._z,this._order)
  38547. },
  38548. copy: function(e) {
  38549. return this._x = e._x,
  38550. this._y = e._y,
  38551. this._z = e._z,
  38552. this._order = e._order,
  38553. this.onChangeCallback(),
  38554. this
  38555. },
  38556. setFromRotationMatrix: function(e, t, i) {
  38557. var r = n.Math.clamp
  38558. , o = e.elements
  38559. , a = o[0]
  38560. , s = o[4]
  38561. , l = o[8]
  38562. , c = o[1]
  38563. , h = o[5]
  38564. , u = o[9]
  38565. , d = o[2]
  38566. , p = o[6]
  38567. , f = o[10];
  38568. return t = t || this._order,
  38569. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  38570. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  38571. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  38572. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  38573. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  38574. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  38575. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  38576. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  38577. this._z = Math.atan2(-s, h)) : (this._y = 0,
  38578. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  38579. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  38580. this._z = Math.atan2(c, a)) : (this._x = 0,
  38581. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  38582. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  38583. this._y = Math.atan2(-d, a)) : (this._x = 0,
  38584. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  38585. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  38586. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  38587. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38588. this._order = t,
  38589. i !== !1 && this.onChangeCallback(),
  38590. this
  38591. },
  38592. setFromQuaternion: function() {
  38593. var e;
  38594. return function(t, i, r) {
  38595. return void 0 === e && (e = new n.Matrix4),
  38596. e.makeRotationFromQuaternion(t),
  38597. this.setFromRotationMatrix(e, i, r),
  38598. this
  38599. }
  38600. }(),
  38601. setFromVector3: function(e, t) {
  38602. return this.set(e.x, e.y, e.z, t || this._order)
  38603. },
  38604. reorder: function() {
  38605. var e = new n.Quaternion;
  38606. return function(t) {
  38607. e.setFromEuler(this),
  38608. this.setFromQuaternion(e, t)
  38609. }
  38610. }(),
  38611. equals: function(e) {
  38612. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38613. },
  38614. fromArray: function(e) {
  38615. return this._x = e[0],
  38616. this._y = e[1],
  38617. this._z = e[2],
  38618. void 0 !== e[3] && (this._order = e[3]),
  38619. this.onChangeCallback(),
  38620. this
  38621. },
  38622. toArray: function(e, t) {
  38623. return void 0 === e && (e = []),
  38624. void 0 === t && (t = 0),
  38625. e[t] = this._x,
  38626. e[t + 1] = this._y,
  38627. e[t + 2] = this._z,
  38628. e[t + 3] = this._order,
  38629. e
  38630. },
  38631. toVector3: function(e) {
  38632. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  38633. },
  38634. onChange: function(e) {
  38635. return this.onChangeCallback = e,
  38636. this
  38637. },
  38638. onChangeCallback: function() {}
  38639. },
  38640. n.Line3 = function(e, t) {
  38641. this.start = void 0 !== e ? e : new n.Vector3,
  38642. this.end = void 0 !== t ? t : new n.Vector3
  38643. }
  38644. ,
  38645. n.Line3.prototype = {
  38646. constructor: n.Line3,
  38647. set: function(e, t) {
  38648. return this.start.copy(e),
  38649. this.end.copy(t),
  38650. this
  38651. },
  38652. clone: function() {
  38653. return (new this.constructor).copy(this)
  38654. },
  38655. copy: function(e) {
  38656. return this.start.copy(e.start),
  38657. this.end.copy(e.end),
  38658. this
  38659. },
  38660. center: function(e) {
  38661. var t = e || new n.Vector3;
  38662. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  38663. },
  38664. delta: function(e) {
  38665. var t = e || new n.Vector3;
  38666. return t.subVectors(this.end, this.start)
  38667. },
  38668. distanceSq: function() {
  38669. return this.start.distanceToSquared(this.end)
  38670. },
  38671. distance: function() {
  38672. return this.start.distanceTo(this.end)
  38673. },
  38674. at: function(e, t) {
  38675. var i = t || new n.Vector3;
  38676. return this.delta(i).multiplyScalar(e).add(this.start)
  38677. },
  38678. closestPointToPointParameter: function() {
  38679. var e = new n.Vector3
  38680. , t = new n.Vector3;
  38681. return function(i, r) {
  38682. e.subVectors(i, this.start),
  38683. t.subVectors(this.end, this.start);
  38684. var o = t.dot(t)
  38685. , a = t.dot(e)
  38686. , s = a / o;
  38687. return r && (s = n.Math.clamp(s, 0, 1)),
  38688. s
  38689. }
  38690. }(),
  38691. closestPointToPoint: function(e, t, i) {
  38692. var r = this.closestPointToPointParameter(e, t)
  38693. , o = i || new n.Vector3;
  38694. return this.delta(o).multiplyScalar(r).add(this.start)
  38695. },
  38696. applyMatrix4: function(e) {
  38697. return this.start.applyMatrix4(e),
  38698. this.end.applyMatrix4(e),
  38699. this
  38700. },
  38701. equals: function(e) {
  38702. return e.start.equals(this.start) && e.end.equals(this.end)
  38703. }
  38704. },
  38705. n.Box2 = function(e, t) {
  38706. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  38707. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  38708. }
  38709. ,
  38710. n.Box2.prototype = {
  38711. constructor: n.Box2,
  38712. set: function(e, t) {
  38713. return this.min.copy(e),
  38714. this.max.copy(t),
  38715. this
  38716. },
  38717. setFromPoints: function(e) {
  38718. this.makeEmpty();
  38719. for (var t = 0, i = e.length; t < i; t++)
  38720. this.expandByPoint(e[t]);
  38721. return this
  38722. },
  38723. setFromCenterAndSize: function() {
  38724. var e = new n.Vector2;
  38725. return function(t, i) {
  38726. var n = e.copy(i).multiplyScalar(.5);
  38727. return this.min.copy(t).sub(n),
  38728. this.max.copy(t).add(n),
  38729. this
  38730. }
  38731. }(),
  38732. clone: function() {
  38733. return (new this.constructor).copy(this)
  38734. },
  38735. copy: function(e) {
  38736. return this.min.copy(e.min),
  38737. this.max.copy(e.max),
  38738. this
  38739. },
  38740. makeEmpty: function() {
  38741. return this.min.x = this.min.y = +(1 / 0),
  38742. this.max.x = this.max.y = -(1 / 0),
  38743. this
  38744. },
  38745. isEmpty: function() {
  38746. return this.max.x < this.min.x || this.max.y < this.min.y
  38747. },
  38748. center: function(e) {
  38749. var t = e || new n.Vector2;
  38750. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  38751. },
  38752. size: function(e) {
  38753. var t = e || new n.Vector2;
  38754. return t.subVectors(this.max, this.min)
  38755. },
  38756. expandByPoint: function(e) {
  38757. return this.min.min(e),
  38758. this.max.max(e),
  38759. this
  38760. },
  38761. expandByVector: function(e) {
  38762. return this.min.sub(e),
  38763. this.max.add(e),
  38764. this
  38765. },
  38766. expandByScalar: function(e) {
  38767. return this.min.addScalar(-e),
  38768. this.max.addScalar(e),
  38769. this
  38770. },
  38771. containsPoint: function(e) {
  38772. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38773. },
  38774. containsBox: function(e) {
  38775. 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
  38776. },
  38777. getParameter: function(e, t) {
  38778. var i = t || new n.Vector2;
  38779. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  38780. },
  38781. intersectsBox: function(e) {
  38782. 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)
  38783. },
  38784. clampPoint: function(e, t) {
  38785. var i = t || new n.Vector2;
  38786. return i.copy(e).clamp(this.min, this.max)
  38787. },
  38788. distanceToPoint: function() {
  38789. var e = new n.Vector2;
  38790. return function(t) {
  38791. var i = e.copy(t).clamp(this.min, this.max);
  38792. return i.sub(t).length()
  38793. }
  38794. }(),
  38795. intersect: function(e) {
  38796. return this.min.max(e.min),
  38797. this.max.min(e.max),
  38798. this
  38799. },
  38800. union: function(e) {
  38801. return this.min.min(e.min),
  38802. this.max.max(e.max),
  38803. this
  38804. },
  38805. translate: function(e) {
  38806. return this.min.add(e),
  38807. this.max.add(e),
  38808. this
  38809. },
  38810. equals: function(e) {
  38811. return e.min.equals(this.min) && e.max.equals(this.max)
  38812. }
  38813. },
  38814. n.Box3 = function(e, t) {
  38815. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  38816. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  38817. }
  38818. ,
  38819. n.Box3.prototype = {
  38820. constructor: n.Box3,
  38821. set: function(e, t) {
  38822. return this.min.copy(e),
  38823. this.max.copy(t),
  38824. this
  38825. },
  38826. setFromArray: function(e) {
  38827. this.makeEmpty();
  38828. 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) {
  38829. var c = e[s]
  38830. , h = e[s + 1]
  38831. , u = e[s + 2];
  38832. c < t && (t = c),
  38833. h < i && (i = h),
  38834. u < n && (n = u),
  38835. c > r && (r = c),
  38836. h > o && (o = h),
  38837. u > a && (a = u)
  38838. }
  38839. this.min.set(t, i, n),
  38840. this.max.set(r, o, a)
  38841. },
  38842. setFromPoints: function(e) {
  38843. this.makeEmpty();
  38844. for (var t = 0, i = e.length; t < i; t++)
  38845. this.expandByPoint(e[t]);
  38846. return this
  38847. },
  38848. setFromCenterAndSize: function() {
  38849. var e = new n.Vector3;
  38850. return function(t, i) {
  38851. var n = e.copy(i).multiplyScalar(.5);
  38852. return this.min.copy(t).sub(n),
  38853. this.max.copy(t).add(n),
  38854. this
  38855. }
  38856. }(),
  38857. setFromObject: function() {
  38858. var e;
  38859. return function(t) {
  38860. void 0 === e && (e = new n.Box3);
  38861. var i = this;
  38862. return this.makeEmpty(),
  38863. t.updateMatrixWorld(!0),
  38864. t.traverse(function(t) {
  38865. var n = t.geometry;
  38866. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  38867. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  38868. e.applyMatrix4(t.matrixWorld),
  38869. i.union(e)))
  38870. }),
  38871. this
  38872. }
  38873. }(),
  38874. clone: function() {
  38875. return (new this.constructor).copy(this)
  38876. },
  38877. copy: function(e) {
  38878. return this.min.copy(e.min),
  38879. this.max.copy(e.max),
  38880. this
  38881. },
  38882. makeEmpty: function() {
  38883. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  38884. this.max.x = this.max.y = this.max.z = -(1 / 0),
  38885. this
  38886. },
  38887. isEmpty: function() {
  38888. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38889. },
  38890. center: function(e) {
  38891. var t = e || new n.Vector3;
  38892. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  38893. },
  38894. size: function(e) {
  38895. var t = e || new n.Vector3;
  38896. return t.subVectors(this.max, this.min)
  38897. },
  38898. expandByPoint: function(e) {
  38899. return this.min.min(e),
  38900. this.max.max(e),
  38901. this
  38902. },
  38903. expandByVector: function(e) {
  38904. return this.min.sub(e),
  38905. this.max.add(e),
  38906. this
  38907. },
  38908. expandByScalar: function(e) {
  38909. return this.min.addScalar(-e),
  38910. this.max.addScalar(e),
  38911. this
  38912. },
  38913. containsPoint: function(e) {
  38914. 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)
  38915. },
  38916. containsBox: function(e) {
  38917. 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
  38918. },
  38919. getParameter: function(e, t) {
  38920. var i = t || new n.Vector3;
  38921. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  38922. },
  38923. intersectsBox: function(e) {
  38924. 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)
  38925. },
  38926. intersectsSphere: function() {
  38927. var e;
  38928. return function(t) {
  38929. return void 0 === e && (e = new n.Vector3),
  38930. this.clampPoint(t.center, e),
  38931. e.distanceToSquared(t.center) <= t.radius * t.radius
  38932. }
  38933. }(),
  38934. intersectsPlane: function(e) {
  38935. var t, i;
  38936. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  38937. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  38938. i = e.normal.x * this.min.x),
  38939. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  38940. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  38941. i += e.normal.y * this.min.y),
  38942. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  38943. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  38944. i += e.normal.z * this.min.z),
  38945. t <= e.constant && i >= e.constant
  38946. },
  38947. clampPoint: function(e, t) {
  38948. var i = t || new n.Vector3;
  38949. return i.copy(e).clamp(this.min, this.max)
  38950. },
  38951. distanceToPoint: function() {
  38952. var e = new n.Vector3;
  38953. return function(t) {
  38954. var i = e.copy(t).clamp(this.min, this.max);
  38955. return i.sub(t).length()
  38956. }
  38957. }(),
  38958. getBoundingSphere: function() {
  38959. var e = new n.Vector3;
  38960. return function(t) {
  38961. var i = t || new n.Sphere;
  38962. return i.center = this.center(),
  38963. i.radius = .5 * this.size(e).length(),
  38964. i
  38965. }
  38966. }(),
  38967. intersect: function(e) {
  38968. return this.min.max(e.min),
  38969. this.max.min(e.max),
  38970. this
  38971. },
  38972. union: function(e) {
  38973. return this.min.min(e.min),
  38974. this.max.max(e.max),
  38975. this
  38976. },
  38977. applyMatrix4: function() {
  38978. var e = [new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3];
  38979. return function(t) {
  38980. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  38981. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  38982. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  38983. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  38984. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  38985. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  38986. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  38987. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  38988. this.makeEmpty(),
  38989. this.setFromPoints(e),
  38990. this
  38991. }
  38992. }(),
  38993. translate: function(e) {
  38994. return this.min.add(e),
  38995. this.max.add(e),
  38996. this
  38997. },
  38998. equals: function(e) {
  38999. return e.min.equals(this.min) && e.max.equals(this.max)
  39000. }
  39001. },
  39002. n.Matrix3 = function() {
  39003. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39004. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39005. }
  39006. ,
  39007. n.Matrix3.prototype = {
  39008. constructor: n.Matrix3,
  39009. set: function(e, t, i, n, r, o, a, s, l) {
  39010. var c = this.elements;
  39011. return c[0] = e,
  39012. c[1] = n,
  39013. c[2] = a,
  39014. c[3] = t,
  39015. c[4] = r,
  39016. c[5] = s,
  39017. c[6] = i,
  39018. c[7] = o,
  39019. c[8] = l,
  39020. this
  39021. },
  39022. identity: function() {
  39023. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39024. this
  39025. },
  39026. clone: function() {
  39027. return (new this.constructor).fromArray(this.elements)
  39028. },
  39029. copy: function(e) {
  39030. var t = e.elements;
  39031. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39032. this
  39033. },
  39034. setFromMatrix4: function(e) {
  39035. var t = e.elements;
  39036. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39037. this
  39038. },
  39039. applyToVector3Array: function() {
  39040. var e;
  39041. return function(t, i, r) {
  39042. void 0 === e && (e = new n.Vector3),
  39043. void 0 === i && (i = 0),
  39044. void 0 === r && (r = t.length);
  39045. for (var o = 0, a = i; o < r; o += 3,
  39046. a += 3)
  39047. e.fromArray(t, a),
  39048. e.applyMatrix3(this),
  39049. e.toArray(t, a);
  39050. return t
  39051. }
  39052. }(),
  39053. applyToBuffer: function() {
  39054. var e;
  39055. return function(t, i, r) {
  39056. void 0 === e && (e = new n.Vector3),
  39057. void 0 === i && (i = 0),
  39058. void 0 === r && (r = t.length / t.itemSize);
  39059. for (var o = 0, a = i; o < r; o++,
  39060. a++)
  39061. e.x = t.getX(a),
  39062. e.y = t.getY(a),
  39063. e.z = t.getZ(a),
  39064. e.applyMatrix3(this),
  39065. t.setXYZ(e.x, e.y, e.z);
  39066. return t
  39067. }
  39068. }(),
  39069. multiplyScalar: function(e) {
  39070. var t = this.elements;
  39071. return t[0] *= e,
  39072. t[3] *= e,
  39073. t[6] *= e,
  39074. t[1] *= e,
  39075. t[4] *= e,
  39076. t[7] *= e,
  39077. t[2] *= e,
  39078. t[5] *= e,
  39079. t[8] *= e,
  39080. this
  39081. },
  39082. determinant: function() {
  39083. var e = this.elements
  39084. , t = e[0]
  39085. , i = e[1]
  39086. , n = e[2]
  39087. , r = e[3]
  39088. , o = e[4]
  39089. , a = e[5]
  39090. , s = e[6]
  39091. , l = e[7]
  39092. , c = e[8];
  39093. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39094. },
  39095. getInverse: function(e, t) {
  39096. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39097. var i = e.elements
  39098. , r = this.elements
  39099. , o = i[0]
  39100. , a = i[1]
  39101. , s = i[2]
  39102. , l = i[3]
  39103. , c = i[4]
  39104. , h = i[5]
  39105. , u = i[6]
  39106. , d = i[7]
  39107. , p = i[8]
  39108. , f = p * c - h * d
  39109. , g = h * u - p * l
  39110. , m = d * l - c * u
  39111. , v = o * f + a * g + s * m;
  39112. if (0 === v) {
  39113. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39114. if (t)
  39115. throw new Error(A);
  39116. return console.warn(A),
  39117. this.identity()
  39118. }
  39119. return r[0] = f,
  39120. r[1] = s * d - p * a,
  39121. r[2] = h * a - s * c,
  39122. r[3] = g,
  39123. r[4] = p * o - s * u,
  39124. r[5] = s * l - h * o,
  39125. r[6] = m,
  39126. r[7] = a * u - d * o,
  39127. r[8] = c * o - a * l,
  39128. this.multiplyScalar(1 / v)
  39129. },
  39130. transpose: function() {
  39131. var e, t = this.elements;
  39132. return e = t[1],
  39133. t[1] = t[3],
  39134. t[3] = e,
  39135. e = t[2],
  39136. t[2] = t[6],
  39137. t[6] = e,
  39138. e = t[5],
  39139. t[5] = t[7],
  39140. t[7] = e,
  39141. this
  39142. },
  39143. flattenToArrayOffset: function(e, t) {
  39144. var i = this.elements;
  39145. return e[t] = i[0],
  39146. e[t + 1] = i[1],
  39147. e[t + 2] = i[2],
  39148. e[t + 3] = i[3],
  39149. e[t + 4] = i[4],
  39150. e[t + 5] = i[5],
  39151. e[t + 6] = i[6],
  39152. e[t + 7] = i[7],
  39153. e[t + 8] = i[8],
  39154. e
  39155. },
  39156. getNormalMatrix: function(e) {
  39157. return this.setFromMatrix4(e).getInverse(this).transpose()
  39158. },
  39159. transposeIntoArray: function(e) {
  39160. var t = this.elements;
  39161. return e[0] = t[0],
  39162. e[1] = t[3],
  39163. e[2] = t[6],
  39164. e[3] = t[1],
  39165. e[4] = t[4],
  39166. e[5] = t[7],
  39167. e[6] = t[2],
  39168. e[7] = t[5],
  39169. e[8] = t[8],
  39170. this
  39171. },
  39172. fromArray: function(e) {
  39173. return this.elements.set(e),
  39174. this
  39175. },
  39176. toArray: function() {
  39177. var e = this.elements;
  39178. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39179. }
  39180. },
  39181. n.Matrix4 = function() {
  39182. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39183. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39184. }
  39185. ,
  39186. n.Matrix4.prototype = {
  39187. constructor: n.Matrix4,
  39188. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39189. var m = this.elements;
  39190. return m[0] = e,
  39191. m[4] = t,
  39192. m[8] = i,
  39193. m[12] = n,
  39194. m[1] = r,
  39195. m[5] = o,
  39196. m[9] = a,
  39197. m[13] = s,
  39198. m[2] = l,
  39199. m[6] = c,
  39200. m[10] = h,
  39201. m[14] = u,
  39202. m[3] = d,
  39203. m[7] = p,
  39204. m[11] = f,
  39205. m[15] = g,
  39206. this
  39207. },
  39208. identity: function() {
  39209. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39210. this
  39211. },
  39212. clone: function() {
  39213. return (new n.Matrix4).fromArray(this.elements)
  39214. },
  39215. copy: function(e) {
  39216. return this.elements.set(e.elements),
  39217. this
  39218. },
  39219. copyPosition: function(e) {
  39220. var t = this.elements
  39221. , i = e.elements;
  39222. return t[12] = i[12],
  39223. t[13] = i[13],
  39224. t[14] = i[14],
  39225. this
  39226. },
  39227. extractBasis: function(e, t, i) {
  39228. return e.setFromMatrixColumn(this, 0),
  39229. t.setFromMatrixColumn(this, 1),
  39230. i.setFromMatrixColumn(this, 2),
  39231. this
  39232. },
  39233. makeBasis: function(e, t, i) {
  39234. 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),
  39235. this
  39236. },
  39237. extractRotation: function() {
  39238. var e;
  39239. return function(t) {
  39240. void 0 === e && (e = new n.Vector3);
  39241. var i = this.elements
  39242. , r = t.elements
  39243. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  39244. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  39245. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  39246. return i[0] = r[0] * o,
  39247. i[1] = r[1] * o,
  39248. i[2] = r[2] * o,
  39249. i[4] = r[4] * a,
  39250. i[5] = r[5] * a,
  39251. i[6] = r[6] * a,
  39252. i[8] = r[8] * s,
  39253. i[9] = r[9] * s,
  39254. i[10] = r[10] * s,
  39255. this
  39256. }
  39257. }(),
  39258. makeRotationFromEuler: function(e) {
  39259. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39260. var t = this.elements
  39261. , i = e.x
  39262. , r = e.y
  39263. , o = e.z
  39264. , a = Math.cos(i)
  39265. , s = Math.sin(i)
  39266. , l = Math.cos(r)
  39267. , c = Math.sin(r)
  39268. , h = Math.cos(o)
  39269. , u = Math.sin(o);
  39270. if ("XYZ" === e.order) {
  39271. var d = a * h
  39272. , p = a * u
  39273. , f = s * h
  39274. , g = s * u;
  39275. t[0] = l * h,
  39276. t[4] = -l * u,
  39277. t[8] = c,
  39278. t[1] = p + f * c,
  39279. t[5] = d - g * c,
  39280. t[9] = -s * l,
  39281. t[2] = g - d * c,
  39282. t[6] = f + p * c,
  39283. t[10] = a * l
  39284. } else if ("YXZ" === e.order) {
  39285. var m = l * h
  39286. , v = l * u
  39287. , A = c * h
  39288. , y = c * u;
  39289. t[0] = m + y * s,
  39290. t[4] = A * s - v,
  39291. t[8] = a * c,
  39292. t[1] = a * u,
  39293. t[5] = a * h,
  39294. t[9] = -s,
  39295. t[2] = v * s - A,
  39296. t[6] = y + m * s,
  39297. t[10] = a * l
  39298. } else if ("ZXY" === e.order) {
  39299. var m = l * h
  39300. , v = l * u
  39301. , A = c * h
  39302. , y = c * u;
  39303. t[0] = m - y * s,
  39304. t[4] = -a * u,
  39305. t[8] = A + v * s,
  39306. t[1] = v + A * s,
  39307. t[5] = a * h,
  39308. t[9] = y - m * s,
  39309. t[2] = -a * c,
  39310. t[6] = s,
  39311. t[10] = a * l
  39312. } else if ("ZYX" === e.order) {
  39313. var d = a * h
  39314. , p = a * u
  39315. , f = s * h
  39316. , g = s * u;
  39317. t[0] = l * h,
  39318. t[4] = f * c - p,
  39319. t[8] = d * c + g,
  39320. t[1] = l * u,
  39321. t[5] = g * c + d,
  39322. t[9] = p * c - f,
  39323. t[2] = -c,
  39324. t[6] = s * l,
  39325. t[10] = a * l
  39326. } else if ("YZX" === e.order) {
  39327. var C = a * l
  39328. , I = a * c
  39329. , E = s * l
  39330. , b = s * c;
  39331. t[0] = l * h,
  39332. t[4] = b - C * u,
  39333. t[8] = E * u + I,
  39334. t[1] = u,
  39335. t[5] = a * h,
  39336. t[9] = -s * h,
  39337. t[2] = -c * h,
  39338. t[6] = I * u + E,
  39339. t[10] = C - b * u
  39340. } else if ("XZY" === e.order) {
  39341. var C = a * l
  39342. , I = a * c
  39343. , E = s * l
  39344. , b = s * c;
  39345. t[0] = l * h,
  39346. t[4] = -u,
  39347. t[8] = c * h,
  39348. t[1] = C * u + b,
  39349. t[5] = a * h,
  39350. t[9] = I * u - E,
  39351. t[2] = E * u - I,
  39352. t[6] = s * h,
  39353. t[10] = b * u + C
  39354. }
  39355. return t[3] = 0,
  39356. t[7] = 0,
  39357. t[11] = 0,
  39358. t[12] = 0,
  39359. t[13] = 0,
  39360. t[14] = 0,
  39361. t[15] = 1,
  39362. this
  39363. },
  39364. makeRotationFromQuaternion: function(e) {
  39365. var t = this.elements
  39366. , i = e.x
  39367. , n = e.y
  39368. , r = e.z
  39369. , o = e.w
  39370. , a = i + i
  39371. , s = n + n
  39372. , l = r + r
  39373. , c = i * a
  39374. , h = i * s
  39375. , u = i * l
  39376. , d = n * s
  39377. , p = n * l
  39378. , f = r * l
  39379. , g = o * a
  39380. , m = o * s
  39381. , v = o * l;
  39382. return t[0] = 1 - (d + f),
  39383. t[4] = h - v,
  39384. t[8] = u + m,
  39385. t[1] = h + v,
  39386. t[5] = 1 - (c + f),
  39387. t[9] = p - g,
  39388. t[2] = u - m,
  39389. t[6] = p + g,
  39390. t[10] = 1 - (c + d),
  39391. t[3] = 0,
  39392. t[7] = 0,
  39393. t[11] = 0,
  39394. t[12] = 0,
  39395. t[13] = 0,
  39396. t[14] = 0,
  39397. t[15] = 1,
  39398. this
  39399. },
  39400. lookAt: function() {
  39401. var e, t, i;
  39402. return function(r, o, a) {
  39403. void 0 === e && (e = new n.Vector3),
  39404. void 0 === t && (t = new n.Vector3),
  39405. void 0 === i && (i = new n.Vector3);
  39406. var s = this.elements;
  39407. return i.subVectors(r, o).normalize(),
  39408. 0 === i.lengthSq() && (i.z = 1),
  39409. e.crossVectors(a, i).normalize(),
  39410. 0 === e.lengthSq() && (i.x += 1e-4,
  39411. e.crossVectors(a, i).normalize()),
  39412. t.crossVectors(i, e),
  39413. s[0] = e.x,
  39414. s[4] = t.x,
  39415. s[8] = i.x,
  39416. s[1] = e.y,
  39417. s[5] = t.y,
  39418. s[9] = i.y,
  39419. s[2] = e.z,
  39420. s[6] = t.z,
  39421. s[10] = i.z,
  39422. this
  39423. }
  39424. }(),
  39425. multiply: function(e, t) {
  39426. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39427. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39428. },
  39429. multiplyMatrices: function(e, t) {
  39430. var i = e.elements
  39431. , n = t.elements
  39432. , r = this.elements
  39433. , o = i[0]
  39434. , a = i[4]
  39435. , s = i[8]
  39436. , l = i[12]
  39437. , c = i[1]
  39438. , h = i[5]
  39439. , u = i[9]
  39440. , d = i[13]
  39441. , p = i[2]
  39442. , f = i[6]
  39443. , g = i[10]
  39444. , m = i[14]
  39445. , v = i[3]
  39446. , A = i[7]
  39447. , y = i[11]
  39448. , C = i[15]
  39449. , I = n[0]
  39450. , E = n[4]
  39451. , b = n[8]
  39452. , w = n[12]
  39453. , _ = n[1]
  39454. , T = n[5]
  39455. , x = n[9]
  39456. , S = n[13]
  39457. , M = n[2]
  39458. , R = n[6]
  39459. , P = n[10]
  39460. , O = n[14]
  39461. , L = n[3]
  39462. , D = n[7]
  39463. , N = n[11]
  39464. , B = n[15];
  39465. return r[0] = o * I + a * _ + s * M + l * L,
  39466. r[4] = o * E + a * T + s * R + l * D,
  39467. r[8] = o * b + a * x + s * P + l * N,
  39468. r[12] = o * w + a * S + s * O + l * B,
  39469. r[1] = c * I + h * _ + u * M + d * L,
  39470. r[5] = c * E + h * T + u * R + d * D,
  39471. r[9] = c * b + h * x + u * P + d * N,
  39472. r[13] = c * w + h * S + u * O + d * B,
  39473. r[2] = p * I + f * _ + g * M + m * L,
  39474. r[6] = p * E + f * T + g * R + m * D,
  39475. r[10] = p * b + f * x + g * P + m * N,
  39476. r[14] = p * w + f * S + g * O + m * B,
  39477. r[3] = v * I + A * _ + y * M + C * L,
  39478. r[7] = v * E + A * T + y * R + C * D,
  39479. r[11] = v * b + A * x + y * P + C * N,
  39480. r[15] = v * w + A * S + y * O + C * B,
  39481. this
  39482. },
  39483. multiplyToArray: function(e, t, i) {
  39484. var n = this.elements;
  39485. return this.multiplyMatrices(e, t),
  39486. i[0] = n[0],
  39487. i[1] = n[1],
  39488. i[2] = n[2],
  39489. i[3] = n[3],
  39490. i[4] = n[4],
  39491. i[5] = n[5],
  39492. i[6] = n[6],
  39493. i[7] = n[7],
  39494. i[8] = n[8],
  39495. i[9] = n[9],
  39496. i[10] = n[10],
  39497. i[11] = n[11],
  39498. i[12] = n[12],
  39499. i[13] = n[13],
  39500. i[14] = n[14],
  39501. i[15] = n[15],
  39502. this
  39503. },
  39504. multiplyScalar: function(e) {
  39505. var t = this.elements;
  39506. return t[0] *= e,
  39507. t[4] *= e,
  39508. t[8] *= e,
  39509. t[12] *= e,
  39510. t[1] *= e,
  39511. t[5] *= e,
  39512. t[9] *= e,
  39513. t[13] *= e,
  39514. t[2] *= e,
  39515. t[6] *= e,
  39516. t[10] *= e,
  39517. t[14] *= e,
  39518. t[3] *= e,
  39519. t[7] *= e,
  39520. t[11] *= e,
  39521. t[15] *= e,
  39522. this
  39523. },
  39524. applyToVector3Array: function() {
  39525. var e;
  39526. return function(t, i, r) {
  39527. void 0 === e && (e = new n.Vector3),
  39528. void 0 === i && (i = 0),
  39529. void 0 === r && (r = t.length);
  39530. for (var o = 0, a = i; o < r; o += 3,
  39531. a += 3)
  39532. e.fromArray(t, a),
  39533. e.applyMatrix4(this),
  39534. e.toArray(t, a);
  39535. return t
  39536. }
  39537. }(),
  39538. applyToBuffer: function() {
  39539. var e;
  39540. return function(t, i, r) {
  39541. void 0 === e && (e = new n.Vector3),
  39542. void 0 === i && (i = 0),
  39543. void 0 === r && (r = t.length / t.itemSize);
  39544. for (var o = 0, a = i; o < r; o++,
  39545. a++)
  39546. e.x = t.getX(a),
  39547. e.y = t.getY(a),
  39548. e.z = t.getZ(a),
  39549. e.applyMatrix4(this),
  39550. t.setXYZ(e.x, e.y, e.z);
  39551. return t
  39552. }
  39553. }(),
  39554. determinant: function() {
  39555. var e = this.elements
  39556. , t = e[0]
  39557. , i = e[4]
  39558. , n = e[8]
  39559. , r = e[12]
  39560. , o = e[1]
  39561. , a = e[5]
  39562. , s = e[9]
  39563. , l = e[13]
  39564. , c = e[2]
  39565. , h = e[6]
  39566. , u = e[10]
  39567. , d = e[14]
  39568. , p = e[3]
  39569. , f = e[7]
  39570. , g = e[11]
  39571. , m = e[15];
  39572. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39573. },
  39574. transpose: function() {
  39575. var e, t = this.elements;
  39576. return e = t[1],
  39577. t[1] = t[4],
  39578. t[4] = e,
  39579. e = t[2],
  39580. t[2] = t[8],
  39581. t[8] = e,
  39582. e = t[6],
  39583. t[6] = t[9],
  39584. t[9] = e,
  39585. e = t[3],
  39586. t[3] = t[12],
  39587. t[12] = e,
  39588. e = t[7],
  39589. t[7] = t[13],
  39590. t[13] = e,
  39591. e = t[11],
  39592. t[11] = t[14],
  39593. t[14] = e,
  39594. this
  39595. },
  39596. flattenToArrayOffset: function(e, t) {
  39597. var i = this.elements;
  39598. return e[t] = i[0],
  39599. e[t + 1] = i[1],
  39600. e[t + 2] = i[2],
  39601. e[t + 3] = i[3],
  39602. e[t + 4] = i[4],
  39603. e[t + 5] = i[5],
  39604. e[t + 6] = i[6],
  39605. e[t + 7] = i[7],
  39606. e[t + 8] = i[8],
  39607. e[t + 9] = i[9],
  39608. e[t + 10] = i[10],
  39609. e[t + 11] = i[11],
  39610. e[t + 12] = i[12],
  39611. e[t + 13] = i[13],
  39612. e[t + 14] = i[14],
  39613. e[t + 15] = i[15],
  39614. e
  39615. },
  39616. getPosition: function() {
  39617. var e;
  39618. return function() {
  39619. return void 0 === e && (e = new n.Vector3),
  39620. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39621. e.setFromMatrixColumn(this, 3)
  39622. }
  39623. }(),
  39624. setPosition: function(e) {
  39625. var t = this.elements;
  39626. return t[12] = e.x,
  39627. t[13] = e.y,
  39628. t[14] = e.z,
  39629. this
  39630. },
  39631. getInverse: function(e, t) {
  39632. var i = this.elements
  39633. , n = e.elements
  39634. , r = n[0]
  39635. , o = n[1]
  39636. , a = n[2]
  39637. , s = n[3]
  39638. , l = n[4]
  39639. , c = n[5]
  39640. , h = n[6]
  39641. , u = n[7]
  39642. , d = n[8]
  39643. , p = n[9]
  39644. , f = n[10]
  39645. , g = n[11]
  39646. , m = n[12]
  39647. , v = n[13]
  39648. , A = n[14]
  39649. , y = n[15]
  39650. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  39651. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  39652. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  39653. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  39654. , w = r * C + o * I + a * E + s * b;
  39655. if (0 === w) {
  39656. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39657. if (t)
  39658. throw new Error(_);
  39659. return console.warn(_),
  39660. this.identity()
  39661. }
  39662. return i[0] = C,
  39663. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  39664. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  39665. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39666. i[4] = I,
  39667. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  39668. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  39669. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39670. i[8] = E,
  39671. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  39672. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  39673. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39674. i[12] = b,
  39675. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  39676. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  39677. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39678. this.multiplyScalar(1 / w)
  39679. },
  39680. scale: function(e) {
  39681. var t = this.elements
  39682. , i = e.x
  39683. , n = e.y
  39684. , r = e.z;
  39685. return t[0] *= i,
  39686. t[4] *= n,
  39687. t[8] *= r,
  39688. t[1] *= i,
  39689. t[5] *= n,
  39690. t[9] *= r,
  39691. t[2] *= i,
  39692. t[6] *= n,
  39693. t[10] *= r,
  39694. t[3] *= i,
  39695. t[7] *= n,
  39696. t[11] *= r,
  39697. this
  39698. },
  39699. getMaxScaleOnAxis: function() {
  39700. var e = this.elements
  39701. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39702. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39703. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39704. return Math.sqrt(Math.max(t, i, n))
  39705. },
  39706. makeTranslation: function(e, t, i) {
  39707. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39708. this
  39709. },
  39710. makeRotationX: function(e) {
  39711. var t = Math.cos(e)
  39712. , i = Math.sin(e);
  39713. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39714. this
  39715. },
  39716. makeRotationY: function(e) {
  39717. var t = Math.cos(e)
  39718. , i = Math.sin(e);
  39719. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39720. this
  39721. },
  39722. makeRotationZ: function(e) {
  39723. var t = Math.cos(e)
  39724. , i = Math.sin(e);
  39725. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39726. this
  39727. },
  39728. makeRotationAxis: function(e, t) {
  39729. var i = Math.cos(t)
  39730. , n = Math.sin(t)
  39731. , r = 1 - i
  39732. , o = e.x
  39733. , a = e.y
  39734. , s = e.z
  39735. , l = r * o
  39736. , c = r * a;
  39737. 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),
  39738. this
  39739. },
  39740. makeScale: function(e, t, i) {
  39741. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39742. this
  39743. },
  39744. compose: function(e, t, i) {
  39745. return this.makeRotationFromQuaternion(t),
  39746. this.scale(i),
  39747. this.setPosition(e),
  39748. this
  39749. },
  39750. decompose: function() {
  39751. var e, t;
  39752. return function(i, r, o) {
  39753. void 0 === e && (e = new n.Vector3),
  39754. void 0 === t && (t = new n.Matrix4);
  39755. var a = this.elements
  39756. , s = e.set(a[0], a[1], a[2]).length()
  39757. , l = e.set(a[4], a[5], a[6]).length()
  39758. , c = e.set(a[8], a[9], a[10]).length()
  39759. , h = this.determinant();
  39760. h < 0 && (s = -s),
  39761. i.x = a[12],
  39762. i.y = a[13],
  39763. i.z = a[14],
  39764. t.elements.set(this.elements);
  39765. var u = 1 / s
  39766. , d = 1 / l
  39767. , p = 1 / c;
  39768. return t.elements[0] *= u,
  39769. t.elements[1] *= u,
  39770. t.elements[2] *= u,
  39771. t.elements[4] *= d,
  39772. t.elements[5] *= d,
  39773. t.elements[6] *= d,
  39774. t.elements[8] *= p,
  39775. t.elements[9] *= p,
  39776. t.elements[10] *= p,
  39777. r.setFromRotationMatrix(t),
  39778. o.x = s,
  39779. o.y = l,
  39780. o.z = c,
  39781. this
  39782. }
  39783. }(),
  39784. makeFrustum: function(e, t, i, n, r, o) {
  39785. var a = this.elements
  39786. , s = 2 * r / (t - e)
  39787. , l = 2 * r / (n - i)
  39788. , c = (t + e) / (t - e)
  39789. , h = (n + i) / (n - i)
  39790. , u = -(o + r) / (o - r)
  39791. , d = -2 * o * r / (o - r);
  39792. return a[0] = s,
  39793. a[4] = 0,
  39794. a[8] = c,
  39795. a[12] = 0,
  39796. a[1] = 0,
  39797. a[5] = l,
  39798. a[9] = h,
  39799. a[13] = 0,
  39800. a[2] = 0,
  39801. a[6] = 0,
  39802. a[10] = u,
  39803. a[14] = d,
  39804. a[3] = 0,
  39805. a[7] = 0,
  39806. a[11] = -1,
  39807. a[15] = 0,
  39808. this
  39809. },
  39810. makePerspective: function(e, t, i, r) {
  39811. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  39812. , a = -o
  39813. , s = a * t
  39814. , l = o * t;
  39815. return this.makeFrustum(s, l, a, o, i, r)
  39816. },
  39817. makeOrthographic: function(e, t, i, n, r, o) {
  39818. var a = this.elements
  39819. , s = 1 / (t - e)
  39820. , l = 1 / (i - n)
  39821. , c = 1 / (o - r)
  39822. , h = (t + e) * s
  39823. , u = (i + n) * l
  39824. , d = (o + r) * c;
  39825. return a[0] = 2 * s,
  39826. a[4] = 0,
  39827. a[8] = 0,
  39828. a[12] = -h,
  39829. a[1] = 0,
  39830. a[5] = 2 * l,
  39831. a[9] = 0,
  39832. a[13] = -u,
  39833. a[2] = 0,
  39834. a[6] = 0,
  39835. a[10] = -2 * c,
  39836. a[14] = -d,
  39837. a[3] = 0,
  39838. a[7] = 0,
  39839. a[11] = 0,
  39840. a[15] = 1,
  39841. this
  39842. },
  39843. equals: function(e) {
  39844. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39845. if (t[n] !== i[n])
  39846. return !1;
  39847. return !0
  39848. },
  39849. fromArray: function(e) {
  39850. return this.elements.set(e),
  39851. this
  39852. },
  39853. toArray: function() {
  39854. var e = this.elements;
  39855. 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]]
  39856. }
  39857. },
  39858. n.Ray = function(e, t) {
  39859. this.origin = void 0 !== e ? e : new n.Vector3,
  39860. this.direction = void 0 !== t ? t : new n.Vector3
  39861. }
  39862. ,
  39863. n.Ray.prototype = {
  39864. constructor: n.Ray,
  39865. set: function(e, t) {
  39866. return this.origin.copy(e),
  39867. this.direction.copy(t),
  39868. this
  39869. },
  39870. clone: function() {
  39871. return (new this.constructor).copy(this)
  39872. },
  39873. copy: function(e) {
  39874. return this.origin.copy(e.origin),
  39875. this.direction.copy(e.direction),
  39876. this
  39877. },
  39878. at: function(e, t) {
  39879. var i = t || new n.Vector3;
  39880. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  39881. },
  39882. lookAt: function(e) {
  39883. this.direction.copy(e).sub(this.origin).normalize()
  39884. },
  39885. recast: function() {
  39886. var e = new n.Vector3;
  39887. return function(t) {
  39888. return this.origin.copy(this.at(t, e)),
  39889. this
  39890. }
  39891. }(),
  39892. closestPointToPoint: function(e, t) {
  39893. var i = t || new n.Vector3;
  39894. i.subVectors(e, this.origin);
  39895. var r = i.dot(this.direction);
  39896. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  39897. },
  39898. distanceToPoint: function(e) {
  39899. return Math.sqrt(this.distanceSqToPoint(e))
  39900. },
  39901. distanceSqToPoint: function() {
  39902. var e = new n.Vector3;
  39903. return function(t) {
  39904. var i = e.subVectors(t, this.origin).dot(this.direction);
  39905. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  39906. e.distanceToSquared(t))
  39907. }
  39908. }(),
  39909. distanceSqToSegment: function() {
  39910. var e = new n.Vector3
  39911. , t = new n.Vector3
  39912. , i = new n.Vector3;
  39913. return function(n, r, o, a) {
  39914. e.copy(n).add(r).multiplyScalar(.5),
  39915. t.copy(r).sub(n).normalize(),
  39916. i.copy(this.origin).sub(e);
  39917. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  39918. if (m > 0)
  39919. if (s = d * f - p,
  39920. l = d * p - f,
  39921. h = u * m,
  39922. s >= 0)
  39923. if (l >= -h)
  39924. if (l <= h) {
  39925. var v = 1 / m;
  39926. s *= v,
  39927. l *= v,
  39928. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  39929. } else
  39930. l = u,
  39931. s = Math.max(0, -(d * l + p)),
  39932. c = -s * s + l * (l + 2 * f) + g;
  39933. else
  39934. l = -u,
  39935. s = Math.max(0, -(d * l + p)),
  39936. c = -s * s + l * (l + 2 * f) + g;
  39937. else
  39938. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  39939. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  39940. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  39941. l = Math.min(Math.max(-u, -f), u),
  39942. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  39943. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  39944. c = -s * s + l * (l + 2 * f) + g);
  39945. else
  39946. l = d > 0 ? -u : u,
  39947. s = Math.max(0, -(d * l + p)),
  39948. c = -s * s + l * (l + 2 * f) + g;
  39949. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  39950. a && a.copy(t).multiplyScalar(l).add(e),
  39951. c
  39952. }
  39953. }(),
  39954. intersectSphere: function() {
  39955. var e = new n.Vector3;
  39956. return function(t, i) {
  39957. e.subVectors(t.center, this.origin);
  39958. var n = e.dot(this.direction)
  39959. , r = e.dot(e) - n * n
  39960. , o = t.radius * t.radius;
  39961. if (r > o)
  39962. return null;
  39963. var a = Math.sqrt(o - r)
  39964. , s = n - a
  39965. , l = n + a;
  39966. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  39967. }
  39968. }(),
  39969. intersectsSphere: function(e) {
  39970. return this.distanceToPoint(e.center) <= e.radius
  39971. },
  39972. distanceToPlane: function(e) {
  39973. var t = e.normal.dot(this.direction);
  39974. if (0 === t)
  39975. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  39976. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  39977. return i >= 0 ? i : null
  39978. },
  39979. intersectPlane: function(e, t) {
  39980. var i = this.distanceToPlane(e);
  39981. return null === i ? null : this.at(i, t)
  39982. },
  39983. intersectsPlane: function(e) {
  39984. var t = e.distanceToPoint(this.origin);
  39985. if (0 === t)
  39986. return !0;
  39987. var i = e.normal.dot(this.direction);
  39988. return i * t < 0
  39989. },
  39990. intersectBox: function(e, t) {
  39991. 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;
  39992. return l >= 0 ? (i = (e.min.x - u.x) * l,
  39993. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  39994. n = (e.min.x - u.x) * l),
  39995. c >= 0 ? (r = (e.min.y - u.y) * c,
  39996. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  39997. o = (e.min.y - u.y) * c),
  39998. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  39999. (o < n || n !== n) && (n = o),
  40000. h >= 0 ? (a = (e.min.z - u.z) * h,
  40001. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40002. s = (e.min.z - u.z) * h),
  40003. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  40004. (s < n || n !== n) && (n = s),
  40005. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  40006. },
  40007. intersectsBox: function() {
  40008. var e = new n.Vector3;
  40009. return function(t) {
  40010. return null !== this.intersectBox(t, e)
  40011. }
  40012. }(),
  40013. intersectTriangle: function() {
  40014. var e = new n.Vector3
  40015. , t = new n.Vector3
  40016. , i = new n.Vector3
  40017. , r = new n.Vector3;
  40018. return function(n, o, a, s, l) {
  40019. t.subVectors(o, n),
  40020. i.subVectors(a, n),
  40021. r.crossVectors(t, i);
  40022. var c, h = this.direction.dot(r);
  40023. if (h > 0) {
  40024. if (s)
  40025. return null;
  40026. c = 1
  40027. } else {
  40028. if (!(h < 0))
  40029. return null;
  40030. c = -1,
  40031. h = -h
  40032. }
  40033. e.subVectors(this.origin, n);
  40034. var u = c * this.direction.dot(i.crossVectors(e, i));
  40035. if (u < 0)
  40036. return null;
  40037. var d = c * this.direction.dot(t.cross(e));
  40038. if (d < 0)
  40039. return null;
  40040. if (u + d > h)
  40041. return null;
  40042. var p = -c * e.dot(r);
  40043. return p < 0 ? null : this.at(p / h, l)
  40044. }
  40045. }(),
  40046. applyMatrix4: function(e) {
  40047. return this.direction.add(this.origin).applyMatrix4(e),
  40048. this.origin.applyMatrix4(e),
  40049. this.direction.sub(this.origin),
  40050. this.direction.normalize(),
  40051. this
  40052. },
  40053. equals: function(e) {
  40054. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40055. }
  40056. },
  40057. n.Sphere = function(e, t) {
  40058. this.center = void 0 !== e ? e : new n.Vector3,
  40059. this.radius = void 0 !== t ? t : 0
  40060. }
  40061. ,
  40062. n.Sphere.prototype = {
  40063. constructor: n.Sphere,
  40064. set: function(e, t) {
  40065. return this.center.copy(e),
  40066. this.radius = t,
  40067. this
  40068. },
  40069. setFromPoints: function() {
  40070. var e = new n.Box3;
  40071. return function(t, i) {
  40072. var n = this.center;
  40073. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  40074. for (var r = 0, o = 0, a = t.length; o < a; o++)
  40075. r = Math.max(r, n.distanceToSquared(t[o]));
  40076. return this.radius = Math.sqrt(r),
  40077. this
  40078. }
  40079. }(),
  40080. clone: function() {
  40081. return (new this.constructor).copy(this)
  40082. },
  40083. copy: function(e) {
  40084. return this.center.copy(e.center),
  40085. this.radius = e.radius,
  40086. this
  40087. },
  40088. empty: function() {
  40089. return this.radius <= 0
  40090. },
  40091. containsPoint: function(e) {
  40092. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40093. },
  40094. distanceToPoint: function(e) {
  40095. return e.distanceTo(this.center) - this.radius
  40096. },
  40097. intersectsSphere: function(e) {
  40098. var t = this.radius + e.radius;
  40099. return e.center.distanceToSquared(this.center) <= t * t
  40100. },
  40101. intersectsBox: function(e) {
  40102. return e.intersectsSphere(this)
  40103. },
  40104. intersectsPlane: function(e) {
  40105. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40106. },
  40107. clampPoint: function(e, t) {
  40108. var i = this.center.distanceToSquared(e)
  40109. , r = t || new n.Vector3;
  40110. return r.copy(e),
  40111. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  40112. r.multiplyScalar(this.radius).add(this.center)),
  40113. r
  40114. },
  40115. getBoundingBox: function(e) {
  40116. var t = e || new n.Box3;
  40117. return t.set(this.center, this.center),
  40118. t.expandByScalar(this.radius),
  40119. t
  40120. },
  40121. applyMatrix4: function(e) {
  40122. return this.center.applyMatrix4(e),
  40123. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40124. this
  40125. },
  40126. translate: function(e) {
  40127. return this.center.add(e),
  40128. this
  40129. },
  40130. equals: function(e) {
  40131. return e.center.equals(this.center) && e.radius === this.radius
  40132. }
  40133. },
  40134. n.Frustum = function(e, t, i, r, o, a) {
  40135. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  40136. }
  40137. ,
  40138. n.Frustum.prototype = {
  40139. constructor: n.Frustum,
  40140. set: function(e, t, i, n, r, o) {
  40141. var a = this.planes;
  40142. return a[0].copy(e),
  40143. a[1].copy(t),
  40144. a[2].copy(i),
  40145. a[3].copy(n),
  40146. a[4].copy(r),
  40147. a[5].copy(o),
  40148. this
  40149. },
  40150. clone: function() {
  40151. return (new this.constructor).copy(this)
  40152. },
  40153. copy: function(e) {
  40154. for (var t = this.planes, i = 0; i < 6; i++)
  40155. t[i].copy(e.planes[i]);
  40156. return this
  40157. },
  40158. setFromMatrix: function(e) {
  40159. var t = this.planes
  40160. , i = e.elements
  40161. , n = i[0]
  40162. , r = i[1]
  40163. , o = i[2]
  40164. , a = i[3]
  40165. , s = i[4]
  40166. , l = i[5]
  40167. , c = i[6]
  40168. , h = i[7]
  40169. , u = i[8]
  40170. , d = i[9]
  40171. , p = i[10]
  40172. , f = i[11]
  40173. , g = i[12]
  40174. , m = i[13]
  40175. , v = i[14]
  40176. , A = i[15];
  40177. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  40178. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  40179. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  40180. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  40181. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  40182. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  40183. this
  40184. },
  40185. intersectsObject: function() {
  40186. var e = new n.Sphere;
  40187. return function(t) {
  40188. var i = t.geometry;
  40189. return null === i.boundingSphere && i.computeBoundingSphere(),
  40190. e.copy(i.boundingSphere),
  40191. e.applyMatrix4(t.matrixWorld),
  40192. this.intersectsSphere(e)
  40193. }
  40194. }(),
  40195. intersectsSphere: function(e) {
  40196. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40197. var o = t[r].distanceToPoint(i);
  40198. if (o < n)
  40199. return !1
  40200. }
  40201. return !0
  40202. },
  40203. intersectsBox: function() {
  40204. var e = new n.Vector3
  40205. , t = new n.Vector3;
  40206. return function(i) {
  40207. for (var n = this.planes, r = 0; r < 6; r++) {
  40208. var o = n[r];
  40209. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  40210. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  40211. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  40212. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  40213. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  40214. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  40215. var a = o.distanceToPoint(e)
  40216. , s = o.distanceToPoint(t);
  40217. if (a < 0 && s < 0)
  40218. return !1
  40219. }
  40220. return !0
  40221. }
  40222. }(),
  40223. containsPoint: function(e) {
  40224. for (var t = this.planes, i = 0; i < 6; i++)
  40225. if (t[i].distanceToPoint(e) < 0)
  40226. return !1;
  40227. return !0
  40228. }
  40229. },
  40230. n.Plane = function(e, t) {
  40231. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  40232. this.constant = void 0 !== t ? t : 0
  40233. }
  40234. ,
  40235. n.Plane.prototype = {
  40236. constructor: n.Plane,
  40237. set: function(e, t) {
  40238. return this.normal.copy(e),
  40239. this.constant = t,
  40240. this
  40241. },
  40242. setComponents: function(e, t, i, n) {
  40243. return this.normal.set(e, t, i),
  40244. this.constant = n,
  40245. this
  40246. },
  40247. setFromNormalAndCoplanarPoint: function(e, t) {
  40248. return this.normal.copy(e),
  40249. this.constant = -t.dot(this.normal),
  40250. this
  40251. },
  40252. setFromCoplanarPoints: function() {
  40253. var e = new n.Vector3
  40254. , t = new n.Vector3;
  40255. return function(i, n, r) {
  40256. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  40257. return this.setFromNormalAndCoplanarPoint(o, i),
  40258. this
  40259. }
  40260. }(),
  40261. clone: function() {
  40262. return (new this.constructor).copy(this)
  40263. },
  40264. copy: function(e) {
  40265. return this.normal.copy(e.normal),
  40266. this.constant = e.constant,
  40267. this
  40268. },
  40269. normalize: function() {
  40270. var e = 1 / this.normal.length();
  40271. return this.normal.multiplyScalar(e),
  40272. this.constant *= e,
  40273. this
  40274. },
  40275. negate: function() {
  40276. return this.constant *= -1,
  40277. this.normal.negate(),
  40278. this
  40279. },
  40280. distanceToPoint: function(e) {
  40281. return this.normal.dot(e) + this.constant
  40282. },
  40283. distanceToSphere: function(e) {
  40284. return this.distanceToPoint(e.center) - e.radius
  40285. },
  40286. projectPoint: function(e, t) {
  40287. return this.orthoPoint(e, t).sub(e).negate()
  40288. },
  40289. orthoPoint: function(e, t) {
  40290. var i = this.distanceToPoint(e)
  40291. , r = t || new n.Vector3;
  40292. return r.copy(this.normal).multiplyScalar(i)
  40293. },
  40294. intersectLine: function() {
  40295. var e = new n.Vector3;
  40296. return function(t, i) {
  40297. var r = i || new n.Vector3
  40298. , o = t.delta(e)
  40299. , a = this.normal.dot(o);
  40300. if (0 !== a) {
  40301. var s = -(t.start.dot(this.normal) + this.constant) / a;
  40302. if (!(s < 0 || s > 1))
  40303. return r.copy(o).multiplyScalar(s).add(t.start)
  40304. } else if (0 === this.distanceToPoint(t.start))
  40305. return r.copy(t.start)
  40306. }
  40307. }(),
  40308. intersectsLine: function(e) {
  40309. var t = this.distanceToPoint(e.start)
  40310. , i = this.distanceToPoint(e.end);
  40311. return t < 0 && i > 0 || i < 0 && t > 0
  40312. },
  40313. intersectsBox: function(e) {
  40314. return e.intersectsPlane(this)
  40315. },
  40316. intersectsSphere: function(e) {
  40317. return e.intersectsPlane(this)
  40318. },
  40319. coplanarPoint: function(e) {
  40320. var t = e || new n.Vector3;
  40321. return t.copy(this.normal).multiplyScalar(-this.constant)
  40322. },
  40323. applyMatrix4: function() {
  40324. var e = new n.Vector3
  40325. , t = new n.Vector3
  40326. , i = new n.Matrix3;
  40327. return function(n, r) {
  40328. var o = r || i.getNormalMatrix(n)
  40329. , a = e.copy(this.normal).applyMatrix3(o)
  40330. , s = this.coplanarPoint(t);
  40331. return s.applyMatrix4(n),
  40332. this.setFromNormalAndCoplanarPoint(a, s),
  40333. this
  40334. }
  40335. }(),
  40336. translate: function(e) {
  40337. return this.constant = this.constant - e.dot(this.normal),
  40338. this
  40339. },
  40340. equals: function(e) {
  40341. return e.normal.equals(this.normal) && e.constant === this.constant
  40342. }
  40343. },
  40344. n.Spherical = function(e, t, i) {
  40345. return this.radius = void 0 !== e ? e : 1,
  40346. this.phi = void 0 !== t ? t : 0,
  40347. this.theta = void 0 !== i ? i : 0,
  40348. this
  40349. }
  40350. ,
  40351. n.Spherical.prototype = {
  40352. constructor: n.Spherical,
  40353. set: function(e, t, i) {
  40354. this.radius = e,
  40355. this.phi = t,
  40356. this.theta = i
  40357. },
  40358. clone: function() {
  40359. return (new this.constructor).copy(this)
  40360. },
  40361. copy: function(e) {
  40362. return this.radius.copy(e.radius),
  40363. this.phi.copy(e.phi),
  40364. this.theta.copy(e.theta),
  40365. this
  40366. },
  40367. makeSafe: function() {
  40368. var e = 1e-6;
  40369. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  40370. },
  40371. setFromVector3: function(e) {
  40372. return this.radius = e.length(),
  40373. 0 === this.radius ? (this.theta = 0,
  40374. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40375. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  40376. this
  40377. }
  40378. },
  40379. n.Math = {
  40380. generateUUID: function() {
  40381. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  40382. return function() {
  40383. for (var r = 0; r < 36; r++)
  40384. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  40385. e = 15 & n,
  40386. n >>= 4,
  40387. i[r] = t[19 === r ? 3 & e | 8 : e]);
  40388. return i.join("")
  40389. }
  40390. }(),
  40391. clamp: function(e, t, i) {
  40392. return Math.max(t, Math.min(i, e))
  40393. },
  40394. euclideanModulo: function(e, t) {
  40395. return (e % t + t) % t
  40396. },
  40397. mapLinear: function(e, t, i, n, r) {
  40398. return n + (e - t) * (r - n) / (i - t)
  40399. },
  40400. smoothstep: function(e, t, i) {
  40401. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40402. e * e * (3 - 2 * e))
  40403. },
  40404. smootherstep: function(e, t, i) {
  40405. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40406. e * e * e * (e * (6 * e - 15) + 10))
  40407. },
  40408. random16: function() {
  40409. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40410. Math.random()
  40411. },
  40412. randInt: function(e, t) {
  40413. return e + Math.floor(Math.random() * (t - e + 1))
  40414. },
  40415. randFloat: function(e, t) {
  40416. return e + Math.random() * (t - e)
  40417. },
  40418. randFloatSpread: function(e) {
  40419. return e * (.5 - Math.random())
  40420. },
  40421. degToRad: function() {
  40422. var e = Math.PI / 180;
  40423. return function(t) {
  40424. return t * e
  40425. }
  40426. }(),
  40427. radToDeg: function() {
  40428. var e = 180 / Math.PI;
  40429. return function(t) {
  40430. return t * e
  40431. }
  40432. }(),
  40433. isPowerOfTwo: function(e) {
  40434. return 0 === (e & e - 1) && 0 !== e
  40435. },
  40436. nearestPowerOfTwo: function(e) {
  40437. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40438. },
  40439. nextPowerOfTwo: function(e) {
  40440. return e--,
  40441. e |= e >> 1,
  40442. e |= e >> 2,
  40443. e |= e >> 4,
  40444. e |= e >> 8,
  40445. e |= e >> 16,
  40446. e++,
  40447. e
  40448. }
  40449. },
  40450. n.Spline = function(e) {
  40451. function t(e, t, i, n, r, o, a) {
  40452. var s = .5 * (i - e)
  40453. , l = .5 * (n - t);
  40454. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40455. }
  40456. this.points = e;
  40457. var i, r, o, a, s, l, c, h, u, d = [], p = {
  40458. x: 0,
  40459. y: 0,
  40460. z: 0
  40461. };
  40462. this.initFromArray = function(e) {
  40463. this.points = [];
  40464. for (var t = 0; t < e.length; t++)
  40465. this.points[t] = {
  40466. x: e[t][0],
  40467. y: e[t][1],
  40468. z: e[t][2]
  40469. }
  40470. }
  40471. ,
  40472. this.getPoint = function(e) {
  40473. return i = (this.points.length - 1) * e,
  40474. r = Math.floor(i),
  40475. o = i - r,
  40476. d[0] = 0 === r ? r : r - 1,
  40477. d[1] = r,
  40478. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  40479. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  40480. l = this.points[d[0]],
  40481. c = this.points[d[1]],
  40482. h = this.points[d[2]],
  40483. u = this.points[d[3]],
  40484. a = o * o,
  40485. s = o * a,
  40486. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  40487. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  40488. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  40489. p
  40490. }
  40491. ,
  40492. this.getControlPointsArray = function() {
  40493. var e, t, i = this.points.length, n = [];
  40494. for (e = 0; e < i; e++)
  40495. t = this.points[e],
  40496. n[e] = [t.x, t.y, t.z];
  40497. return n
  40498. }
  40499. ,
  40500. this.getLength = function(e) {
  40501. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  40502. for (u[0] = 0,
  40503. e || (e = 100),
  40504. r = this.points.length * e,
  40505. c.copy(this.points[0]),
  40506. t = 1; t < r; t++)
  40507. i = t / r,
  40508. o = this.getPoint(i),
  40509. h.copy(o),
  40510. d += h.distanceTo(c),
  40511. c.copy(o),
  40512. a = (this.points.length - 1) * i,
  40513. s = Math.floor(a),
  40514. s !== l && (u[s] = d,
  40515. l = s);
  40516. return u[u.length] = d,
  40517. {
  40518. chunks: u,
  40519. total: d
  40520. }
  40521. }
  40522. ,
  40523. this.reparametrizeByArcLength = function(e) {
  40524. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  40525. for (h.push(u.copy(this.points[0]).clone()),
  40526. t = 1; t < this.points.length; t++) {
  40527. for (s = d.chunks[t] - d.chunks[t - 1],
  40528. l = Math.ceil(e * s / d.total),
  40529. o = (t - 1) / (this.points.length - 1),
  40530. a = t / (this.points.length - 1),
  40531. i = 1; i < l - 1; i++)
  40532. r = o + i * (1 / l) * (a - o),
  40533. c = this.getPoint(r),
  40534. h.push(u.copy(c).clone());
  40535. h.push(u.copy(this.points[t]).clone())
  40536. }
  40537. this.points = h
  40538. }
  40539. }
  40540. ,
  40541. n.Triangle = function(e, t, i) {
  40542. this.a = void 0 !== e ? e : new n.Vector3,
  40543. this.b = void 0 !== t ? t : new n.Vector3,
  40544. this.c = void 0 !== i ? i : new n.Vector3
  40545. }
  40546. ,
  40547. n.Triangle.normal = function() {
  40548. var e = new n.Vector3;
  40549. return function(t, i, r, o) {
  40550. var a = o || new n.Vector3;
  40551. a.subVectors(r, i),
  40552. e.subVectors(t, i),
  40553. a.cross(e);
  40554. var s = a.lengthSq();
  40555. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  40556. }
  40557. }(),
  40558. n.Triangle.barycoordFromPoint = function() {
  40559. var e = new n.Vector3
  40560. , t = new n.Vector3
  40561. , i = new n.Vector3;
  40562. return function(r, o, a, s, l) {
  40563. e.subVectors(s, o),
  40564. t.subVectors(a, o),
  40565. i.subVectors(r, o);
  40566. var c = e.dot(e)
  40567. , h = e.dot(t)
  40568. , u = e.dot(i)
  40569. , d = t.dot(t)
  40570. , p = t.dot(i)
  40571. , f = c * d - h * h
  40572. , g = l || new n.Vector3;
  40573. if (0 === f)
  40574. return g.set(-2, -1, -1);
  40575. var m = 1 / f
  40576. , v = (d * u - h * p) * m
  40577. , A = (c * p - h * u) * m;
  40578. return g.set(1 - v - A, A, v)
  40579. }
  40580. }(),
  40581. n.Triangle.containsPoint = function() {
  40582. var e = new n.Vector3;
  40583. return function(t, i, r, o) {
  40584. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  40585. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  40586. }
  40587. }(),
  40588. n.Triangle.prototype = {
  40589. constructor: n.Triangle,
  40590. set: function(e, t, i) {
  40591. return this.a.copy(e),
  40592. this.b.copy(t),
  40593. this.c.copy(i),
  40594. this
  40595. },
  40596. setFromPointsAndIndices: function(e, t, i, n) {
  40597. return this.a.copy(e[t]),
  40598. this.b.copy(e[i]),
  40599. this.c.copy(e[n]),
  40600. this
  40601. },
  40602. clone: function() {
  40603. return (new this.constructor).copy(this)
  40604. },
  40605. copy: function(e) {
  40606. return this.a.copy(e.a),
  40607. this.b.copy(e.b),
  40608. this.c.copy(e.c),
  40609. this
  40610. },
  40611. area: function() {
  40612. var e = new n.Vector3
  40613. , t = new n.Vector3;
  40614. return function() {
  40615. return e.subVectors(this.c, this.b),
  40616. t.subVectors(this.a, this.b),
  40617. .5 * e.cross(t).length()
  40618. }
  40619. }(),
  40620. midpoint: function(e) {
  40621. var t = e || new n.Vector3;
  40622. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40623. },
  40624. normal: function(e) {
  40625. return n.Triangle.normal(this.a, this.b, this.c, e)
  40626. },
  40627. plane: function(e) {
  40628. var t = e || new n.Plane;
  40629. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  40630. },
  40631. barycoordFromPoint: function(e, t) {
  40632. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40633. },
  40634. containsPoint: function(e) {
  40635. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  40636. },
  40637. equals: function(e) {
  40638. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40639. }
  40640. },
  40641. n.Interpolant = function(e, t, i, n) {
  40642. this.parameterPositions = e,
  40643. this._cachedIndex = 0,
  40644. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40645. this.sampleValues = t,
  40646. this.valueSize = i
  40647. }
  40648. ,
  40649. n.Interpolant.prototype = {
  40650. constructor: n.Interpolant,
  40651. evaluate: function(e) {
  40652. var t = this.parameterPositions
  40653. , i = this._cachedIndex
  40654. , n = t[i]
  40655. , r = t[i - 1];
  40656. e: {
  40657. t: {
  40658. var o;
  40659. i: {
  40660. n: if (!(e < n)) {
  40661. for (var a = i + 2; ; ) {
  40662. if (void 0 === n) {
  40663. if (e < r)
  40664. break n;
  40665. return i = t.length,
  40666. this._cachedIndex = i,
  40667. this.afterEnd_(i - 1, e, r)
  40668. }
  40669. if (i === a)
  40670. break;
  40671. if (r = n,
  40672. n = t[++i],
  40673. e < n)
  40674. break t
  40675. }
  40676. o = t.length;
  40677. break i
  40678. }
  40679. {
  40680. if (e >= r)
  40681. break e;
  40682. var s = t[1];
  40683. e < s && (i = 2,
  40684. r = s);
  40685. for (var a = i - 2; ; ) {
  40686. if (void 0 === r)
  40687. return this._cachedIndex = 0,
  40688. this.beforeStart_(0, e, n);
  40689. if (i === a)
  40690. break;
  40691. if (n = r,
  40692. r = t[--i - 1],
  40693. e >= r)
  40694. break t
  40695. }
  40696. o = i,
  40697. i = 0
  40698. }
  40699. }
  40700. for (; i < o; ) {
  40701. var l = i + o >>> 1;
  40702. e < t[l] ? o = l : i = l + 1
  40703. }
  40704. if (n = t[i],
  40705. r = t[i - 1],
  40706. void 0 === r)
  40707. return this._cachedIndex = 0,
  40708. this.beforeStart_(0, e, n);
  40709. if (void 0 === n)
  40710. return i = t.length,
  40711. this._cachedIndex = i,
  40712. this.afterEnd_(i - 1, r, e)
  40713. }
  40714. this._cachedIndex = i,
  40715. this.intervalChanged_(i, r, n)
  40716. }
  40717. return this.interpolate_(i, r, e, n)
  40718. },
  40719. settings: null,
  40720. DefaultSettings_: {},
  40721. getSettings_: function() {
  40722. return this.settings || this.DefaultSettings_
  40723. },
  40724. copySampleValue_: function(e) {
  40725. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40726. t[o] = i[r + o];
  40727. return t
  40728. },
  40729. interpolate_: function(e, t, i, n) {
  40730. throw new Error("call to abstract method")
  40731. },
  40732. intervalChanged_: function(e, t, i) {}
  40733. },
  40734. Object.assign(n.Interpolant.prototype, {
  40735. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  40736. afterEnd_: n.Interpolant.prototype.copySampleValue_
  40737. }),
  40738. n.CubicInterpolant = function(e, t, i, r) {
  40739. n.Interpolant.call(this, e, t, i, r),
  40740. this._weightPrev = -0,
  40741. this._offsetPrev = -0,
  40742. this._weightNext = -0,
  40743. this._offsetNext = -0
  40744. }
  40745. ,
  40746. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40747. constructor: n.CubicInterpolant,
  40748. DefaultSettings_: {
  40749. endingStart: n.ZeroCurvatureEnding,
  40750. endingEnd: n.ZeroCurvatureEnding
  40751. },
  40752. intervalChanged_: function(e, t, i) {
  40753. var r = this.parameterPositions
  40754. , o = e - 2
  40755. , a = e + 1
  40756. , s = r[o]
  40757. , l = r[a];
  40758. if (void 0 === s)
  40759. switch (this.getSettings_().endingStart) {
  40760. case n.ZeroSlopeEnding:
  40761. o = e,
  40762. s = 2 * t - i;
  40763. break;
  40764. case n.WrapAroundEnding:
  40765. o = r.length - 2,
  40766. s = t + r[o] - r[o + 1];
  40767. break;
  40768. default:
  40769. o = e,
  40770. s = i
  40771. }
  40772. if (void 0 === l)
  40773. switch (this.getSettings_().endingEnd) {
  40774. case n.ZeroSlopeEnding:
  40775. a = e,
  40776. l = 2 * i - t;
  40777. break;
  40778. case n.WrapAroundEnding:
  40779. a = 1,
  40780. l = i + r[1] - r[0];
  40781. break;
  40782. default:
  40783. a = e - 1,
  40784. l = t
  40785. }
  40786. var c = .5 * (i - t)
  40787. , h = this.valueSize;
  40788. this._weightPrev = c / (t - s),
  40789. this._weightNext = c / (l - i),
  40790. this._offsetPrev = o * h,
  40791. this._offsetNext = a * h
  40792. },
  40793. interpolate_: function(e, t, i, n) {
  40794. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  40795. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  40796. return r
  40797. }
  40798. }),
  40799. n.DiscreteInterpolant = function(e, t, i, r) {
  40800. n.Interpolant.call(this, e, t, i, r)
  40801. }
  40802. ,
  40803. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40804. constructor: n.DiscreteInterpolant,
  40805. interpolate_: function(e, t, i, n) {
  40806. return this.copySampleValue_(e - 1)
  40807. }
  40808. }),
  40809. n.LinearInterpolant = function(e, t, i, r) {
  40810. n.Interpolant.call(this, e, t, i, r)
  40811. }
  40812. ,
  40813. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40814. constructor: n.LinearInterpolant,
  40815. interpolate_: function(e, t, i, n) {
  40816. 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)
  40817. r[u] = o[l + u] * h + o[s + u] * c;
  40818. return r
  40819. }
  40820. }),
  40821. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  40822. n.Interpolant.call(this, e, t, i, r)
  40823. }
  40824. ,
  40825. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40826. constructor: n.QuaternionLinearInterpolant,
  40827. interpolate_: function(e, t, i, r) {
  40828. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4)
  40829. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  40830. return o
  40831. }
  40832. }),
  40833. n.Clock = function(e) {
  40834. this.autoStart = void 0 === e || e,
  40835. this.startTime = 0,
  40836. this.oldTime = 0,
  40837. this.elapsedTime = 0,
  40838. this.running = !1
  40839. }
  40840. ,
  40841. n.Clock.prototype = {
  40842. constructor: n.Clock,
  40843. start: function() {
  40844. this.startTime = performance.now(),
  40845. this.oldTime = this.startTime,
  40846. this.running = !0
  40847. },
  40848. stop: function() {
  40849. this.getElapsedTime(),
  40850. this.running = !1
  40851. },
  40852. getElapsedTime: function() {
  40853. return this.getDelta(),
  40854. this.elapsedTime
  40855. },
  40856. getDelta: function() {
  40857. var e = 0;
  40858. if (this.autoStart && !this.running && this.start(),
  40859. this.running) {
  40860. var t = performance.now();
  40861. e = .001 * (t - this.oldTime),
  40862. this.oldTime = t,
  40863. this.elapsedTime += e
  40864. }
  40865. return e
  40866. }
  40867. },
  40868. n.EventDispatcher = function() {}
  40869. ,
  40870. n.EventDispatcher.prototype = {
  40871. constructor: n.EventDispatcher,
  40872. apply: function(e) {
  40873. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  40874. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  40875. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  40876. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  40877. },
  40878. addEventListener: function(e, t) {
  40879. void 0 === this._listeners && (this._listeners = {});
  40880. var i = this._listeners;
  40881. void 0 === i[e] && (i[e] = []),
  40882. i[e].indexOf(t) === -1 && i[e].push(t)
  40883. },
  40884. hasEventListener: function(e, t) {
  40885. if (void 0 === this._listeners)
  40886. return !1;
  40887. var i = this._listeners;
  40888. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  40889. },
  40890. removeEventListener: function(e, t) {
  40891. if (void 0 !== this._listeners) {
  40892. var i = this._listeners
  40893. , n = i[e];
  40894. if (void 0 !== n) {
  40895. var r = n.indexOf(t);
  40896. r !== -1 && n.splice(r, 1)
  40897. }
  40898. }
  40899. },
  40900. dispatchEvent: function(e) {
  40901. if (void 0 !== this._listeners) {
  40902. var t = this._listeners
  40903. , i = t[e.type];
  40904. if (void 0 !== i) {
  40905. e.target = this;
  40906. for (var n = [], r = i.length, o = 0; o < r; o++)
  40907. n[o] = i[o];
  40908. for (var o = 0; o < r; o++)
  40909. n[o].call(this, e)
  40910. }
  40911. }
  40912. }
  40913. },
  40914. n.Layers = function() {
  40915. this.mask = 1
  40916. }
  40917. ,
  40918. n.Layers.prototype = {
  40919. constructor: n.Layers,
  40920. set: function(e) {
  40921. this.mask = 1 << e
  40922. },
  40923. enable: function(e) {
  40924. this.mask |= 1 << e
  40925. },
  40926. toggle: function(e) {
  40927. this.mask ^= 1 << e
  40928. },
  40929. disable: function(e) {
  40930. this.mask &= ~(1 << e)
  40931. },
  40932. test: function(e) {
  40933. return 0 !== (this.mask & e.mask)
  40934. }
  40935. },
  40936. function(e) {
  40937. function t(e, t) {
  40938. return e.distance - t.distance
  40939. }
  40940. function i(e, t, n, r) {
  40941. if (e.visible !== !1 && (e.raycast(t, n),
  40942. r === !0))
  40943. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  40944. i(o[a], t, n, !0)
  40945. }
  40946. e.Raycaster = function(t, i, n, r) {
  40947. this.ray = new e.Ray(t,i),
  40948. this.near = n || 0,
  40949. this.far = r || 1 / 0,
  40950. this.params = {
  40951. Mesh: {},
  40952. Line: {},
  40953. LOD: {},
  40954. Points: {
  40955. threshold: 1
  40956. },
  40957. Sprite: {}
  40958. },
  40959. Object.defineProperties(this.params, {
  40960. PointCloud: {
  40961. get: function() {
  40962. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40963. this.Points
  40964. }
  40965. }
  40966. })
  40967. }
  40968. ,
  40969. e.Raycaster.prototype = {
  40970. constructor: e.Raycaster,
  40971. linePrecision: 1,
  40972. set: function(e, t) {
  40973. this.ray.set(e, t)
  40974. },
  40975. setFromCamera: function(t, i) {
  40976. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  40977. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  40978. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40979. },
  40980. intersectObject: function(e, n) {
  40981. var r = [];
  40982. return i(e, this, r, n),
  40983. r.sort(t),
  40984. r
  40985. },
  40986. intersectObjects: function(e, n) {
  40987. var r = [];
  40988. if (Array.isArray(e) === !1)
  40989. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40990. r;
  40991. for (var o = 0, a = e.length; o < a; o++)
  40992. i(e[o], this, r, n);
  40993. return r.sort(t),
  40994. r
  40995. }
  40996. }
  40997. }(n),
  40998. n.Object3D = function() {
  40999. function e() {
  41000. o.setFromEuler(r, !1)
  41001. }
  41002. function t() {
  41003. r.setFromQuaternion(o, void 0, !1)
  41004. }
  41005. Object.defineProperty(this, "id", {
  41006. value: n.Object3DIdCount++
  41007. }),
  41008. this.uuid = n.Math.generateUUID(),
  41009. this.name = "",
  41010. this.type = "Object3D",
  41011. this.parent = null,
  41012. this.children = [],
  41013. this.up = n.Object3D.DefaultUp.clone();
  41014. var i = new n.Vector3
  41015. , r = new n.Euler
  41016. , o = new n.Quaternion
  41017. , a = new n.Vector3(1,1,1);
  41018. r.onChange(e),
  41019. o.onChange(t),
  41020. Object.defineProperties(this, {
  41021. position: {
  41022. enumerable: !0,
  41023. value: i
  41024. },
  41025. rotation: {
  41026. enumerable: !0,
  41027. value: r
  41028. },
  41029. quaternion: {
  41030. enumerable: !0,
  41031. value: o
  41032. },
  41033. scale: {
  41034. enumerable: !0,
  41035. value: a
  41036. },
  41037. modelViewMatrix: {
  41038. value: new n.Matrix4
  41039. },
  41040. normalMatrix: {
  41041. value: new n.Matrix3
  41042. }
  41043. }),
  41044. this.rotationAutoUpdate = !0,
  41045. this.matrix = new n.Matrix4,
  41046. this.matrixWorld = new n.Matrix4,
  41047. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  41048. this.matrixWorldNeedsUpdate = !1,
  41049. this.layers = new n.Layers,
  41050. this.visible = !0,
  41051. this.castShadow = !1,
  41052. this.receiveShadow = !1,
  41053. this.frustumCulled = !0,
  41054. this.renderOrder = 0,
  41055. this.userData = {}
  41056. }
  41057. ,
  41058. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  41059. n.Object3D.DefaultMatrixAutoUpdate = !0,
  41060. n.Object3D.prototype = {
  41061. constructor: n.Object3D,
  41062. applyMatrix: function(e) {
  41063. this.matrix.multiplyMatrices(e, this.matrix),
  41064. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41065. },
  41066. setRotationFromAxisAngle: function(e, t) {
  41067. this.quaternion.setFromAxisAngle(e, t)
  41068. },
  41069. setRotationFromEuler: function(e) {
  41070. this.quaternion.setFromEuler(e, !0)
  41071. },
  41072. setRotationFromMatrix: function(e) {
  41073. this.quaternion.setFromRotationMatrix(e)
  41074. },
  41075. setRotationFromQuaternion: function(e) {
  41076. this.quaternion.copy(e)
  41077. },
  41078. rotateOnAxis: function() {
  41079. var e = new n.Quaternion;
  41080. return function(t, i) {
  41081. return e.setFromAxisAngle(t, i),
  41082. this.quaternion.multiply(e),
  41083. this
  41084. }
  41085. }(),
  41086. rotateX: function() {
  41087. var e = new n.Vector3(1,0,0);
  41088. return function(t) {
  41089. return this.rotateOnAxis(e, t)
  41090. }
  41091. }(),
  41092. rotateY: function() {
  41093. var e = new n.Vector3(0,1,0);
  41094. return function(t) {
  41095. return this.rotateOnAxis(e, t)
  41096. }
  41097. }(),
  41098. rotateZ: function() {
  41099. var e = new n.Vector3(0,0,1);
  41100. return function(t) {
  41101. return this.rotateOnAxis(e, t)
  41102. }
  41103. }(),
  41104. translateOnAxis: function() {
  41105. var e = new n.Vector3;
  41106. return function(t, i) {
  41107. return e.copy(t).applyQuaternion(this.quaternion),
  41108. this.position.add(e.multiplyScalar(i)),
  41109. this
  41110. }
  41111. }(),
  41112. translateX: function() {
  41113. var e = new n.Vector3(1,0,0);
  41114. return function(t) {
  41115. return this.translateOnAxis(e, t)
  41116. }
  41117. }(),
  41118. translateY: function() {
  41119. var e = new n.Vector3(0,1,0);
  41120. return function(t) {
  41121. return this.translateOnAxis(e, t)
  41122. }
  41123. }(),
  41124. translateZ: function() {
  41125. var e = new n.Vector3(0,0,1);
  41126. return function(t) {
  41127. return this.translateOnAxis(e, t)
  41128. }
  41129. }(),
  41130. localToWorld: function(e) {
  41131. return e.applyMatrix4(this.matrixWorld)
  41132. },
  41133. worldToLocal: function() {
  41134. var e = new n.Matrix4;
  41135. return function(t) {
  41136. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  41137. }
  41138. }(),
  41139. lookAt: function() {
  41140. var e = new n.Matrix4;
  41141. return function(t) {
  41142. e.lookAt(t, this.position, this.up),
  41143. this.quaternion.setFromRotationMatrix(e)
  41144. }
  41145. }(),
  41146. add: function(e) {
  41147. if (arguments.length > 1) {
  41148. for (var t = 0; t < arguments.length; t++)
  41149. this.add(arguments[t]);
  41150. return this
  41151. }
  41152. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  41153. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  41154. e.parent = this,
  41155. e.dispatchEvent({
  41156. type: "added"
  41157. }),
  41158. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41159. this)
  41160. },
  41161. remove: function(e) {
  41162. if (arguments.length > 1)
  41163. for (var t = 0; t < arguments.length; t++)
  41164. this.remove(arguments[t]);
  41165. var i = this.children.indexOf(e);
  41166. i !== -1 && (e.parent = null,
  41167. e.dispatchEvent({
  41168. type: "removed"
  41169. }),
  41170. this.children.splice(i, 1))
  41171. },
  41172. getObjectById: function(e) {
  41173. return this.getObjectByProperty("id", e)
  41174. },
  41175. getObjectByName: function(e) {
  41176. return this.getObjectByProperty("name", e)
  41177. },
  41178. getObjectByProperty: function(e, t) {
  41179. if (this[e] === t)
  41180. return this;
  41181. for (var i = 0, n = this.children.length; i < n; i++) {
  41182. var r = this.children[i]
  41183. , o = r.getObjectByProperty(e, t);
  41184. if (void 0 !== o)
  41185. return o
  41186. }
  41187. },
  41188. getWorldPosition: function(e) {
  41189. var t = e || new n.Vector3;
  41190. return this.updateMatrixWorld(!0),
  41191. t.setFromMatrixPosition(this.matrixWorld)
  41192. },
  41193. getWorldQuaternion: function() {
  41194. var e = new n.Vector3
  41195. , t = new n.Vector3;
  41196. return function(i) {
  41197. var r = i || new n.Quaternion;
  41198. return this.updateMatrixWorld(!0),
  41199. this.matrixWorld.decompose(e, r, t),
  41200. r
  41201. }
  41202. }(),
  41203. getWorldRotation: function() {
  41204. var e = new n.Quaternion;
  41205. return function(t) {
  41206. var i = t || new n.Euler;
  41207. return this.getWorldQuaternion(e),
  41208. i.setFromQuaternion(e, this.rotation.order, !1)
  41209. }
  41210. }(),
  41211. getWorldScale: function() {
  41212. var e = new n.Vector3
  41213. , t = new n.Quaternion;
  41214. return function(i) {
  41215. var r = i || new n.Vector3;
  41216. return this.updateMatrixWorld(!0),
  41217. this.matrixWorld.decompose(e, t, r),
  41218. r
  41219. }
  41220. }(),
  41221. getWorldDirection: function() {
  41222. var e = new n.Quaternion;
  41223. return function(t) {
  41224. var i = t || new n.Vector3;
  41225. return this.getWorldQuaternion(e),
  41226. i.set(0, 0, 1).applyQuaternion(e)
  41227. }
  41228. }(),
  41229. raycast: function() {},
  41230. traverse: function(e) {
  41231. e(this);
  41232. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41233. t[i].traverse(e)
  41234. },
  41235. traverseVisible: function(e) {
  41236. if (this.visible !== !1) {
  41237. e(this);
  41238. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41239. t[i].traverseVisible(e)
  41240. }
  41241. },
  41242. traverseAncestors: function(e) {
  41243. var t = this.parent;
  41244. null !== t && (e(t),
  41245. t.traverseAncestors(e))
  41246. },
  41247. updateMatrix: function() {
  41248. this.matrix.compose(this.position, this.quaternion, this.scale),
  41249. this.matrixWorldNeedsUpdate = !0
  41250. },
  41251. updateMatrixWorld: function(e) {
  41252. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  41253. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41254. this.matrixWorldNeedsUpdate = !1,
  41255. e = !0);
  41256. for (var t = 0, i = this.children.length; t < i; t++)
  41257. this.children[t].updateMatrixWorld(e)
  41258. },
  41259. toJSON: function(e) {
  41260. function t(e) {
  41261. var t = [];
  41262. for (var i in e) {
  41263. var n = e[i];
  41264. delete n.metadata,
  41265. t.push(n)
  41266. }
  41267. return t
  41268. }
  41269. var i = void 0 === e
  41270. , n = {};
  41271. i && (e = {
  41272. geometries: {},
  41273. materials: {},
  41274. textures: {},
  41275. images: {}
  41276. },
  41277. n.metadata = {
  41278. version: 4.4,
  41279. type: "Object",
  41280. generator: "Object3D.toJSON"
  41281. });
  41282. var r = {};
  41283. if (r.uuid = this.uuid,
  41284. r.type = this.type,
  41285. "" !== this.name && (r.name = this.name),
  41286. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41287. this.castShadow === !0 && (r.castShadow = !0),
  41288. this.receiveShadow === !0 && (r.receiveShadow = !0),
  41289. this.visible === !1 && (r.visible = !1),
  41290. r.matrix = this.matrix.toArray(),
  41291. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41292. r.geometry = this.geometry.uuid),
  41293. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41294. r.material = this.material.uuid),
  41295. this.children.length > 0) {
  41296. r.children = [];
  41297. for (var o = 0; o < this.children.length; o++)
  41298. r.children.push(this.children[o].toJSON(e).object)
  41299. }
  41300. if (i) {
  41301. var a = t(e.geometries)
  41302. , s = t(e.materials)
  41303. , l = t(e.textures)
  41304. , c = t(e.images);
  41305. a.length > 0 && (n.geometries = a),
  41306. s.length > 0 && (n.materials = s),
  41307. l.length > 0 && (n.textures = l),
  41308. c.length > 0 && (n.images = c)
  41309. }
  41310. return n.object = r,
  41311. n
  41312. },
  41313. clone: function(e) {
  41314. return (new this.constructor).copy(this, e)
  41315. },
  41316. copy: function(e, t) {
  41317. if (void 0 === t && (t = !0),
  41318. this.name = e.name,
  41319. this.up.copy(e.up),
  41320. this.position.copy(e.position),
  41321. this.quaternion.copy(e.quaternion),
  41322. this.scale.copy(e.scale),
  41323. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41324. this.matrix.copy(e.matrix),
  41325. this.matrixWorld.copy(e.matrixWorld),
  41326. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41327. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41328. this.visible = e.visible,
  41329. this.castShadow = e.castShadow,
  41330. this.receiveShadow = e.receiveShadow,
  41331. this.frustumCulled = e.frustumCulled,
  41332. this.renderOrder = e.renderOrder,
  41333. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41334. t === !0)
  41335. for (var i = 0; i < e.children.length; i++) {
  41336. var n = e.children[i];
  41337. this.add(n.clone())
  41338. }
  41339. return this
  41340. }
  41341. },
  41342. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  41343. n.Object3DIdCount = 0,
  41344. n.Face3 = function(e, t, i, r, o, a) {
  41345. this.a = e,
  41346. this.b = t,
  41347. this.c = i,
  41348. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  41349. this.vertexNormals = Array.isArray(r) ? r : [],
  41350. this.color = o instanceof n.Color ? o : new n.Color,
  41351. this.vertexColors = Array.isArray(o) ? o : [],
  41352. this.materialIndex = void 0 !== a ? a : 0
  41353. }
  41354. ,
  41355. n.Face3.prototype = {
  41356. constructor: n.Face3,
  41357. clone: function() {
  41358. return (new this.constructor).copy(this)
  41359. },
  41360. copy: function(e) {
  41361. this.a = e.a,
  41362. this.b = e.b,
  41363. this.c = e.c,
  41364. this.normal.copy(e.normal),
  41365. this.color.copy(e.color),
  41366. this.materialIndex = e.materialIndex;
  41367. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41368. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41369. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  41370. this.vertexColors[t] = e.vertexColors[t].clone();
  41371. return this
  41372. }
  41373. },
  41374. n.BufferAttribute = function(e, t) {
  41375. this.uuid = n.Math.generateUUID(),
  41376. this.array = e,
  41377. this.itemSize = t,
  41378. this.dynamic = !1,
  41379. this.updateRange = {
  41380. offset: 0,
  41381. count: -1
  41382. },
  41383. this.version = 0
  41384. }
  41385. ,
  41386. n.BufferAttribute.prototype = {
  41387. constructor: n.BufferAttribute,
  41388. get count() {
  41389. return this.array.length / this.itemSize
  41390. },
  41391. set needsUpdate(e) {
  41392. e === !0 && this.version++
  41393. },
  41394. setDynamic: function(e) {
  41395. return this.dynamic = e,
  41396. this
  41397. },
  41398. copy: function(e) {
  41399. return this.array = new e.array.constructor(e.array),
  41400. this.itemSize = e.itemSize,
  41401. this.dynamic = e.dynamic,
  41402. this
  41403. },
  41404. copyAt: function(e, t, i) {
  41405. e *= this.itemSize,
  41406. i *= t.itemSize;
  41407. for (var n = 0, r = this.itemSize; n < r; n++)
  41408. this.array[e + n] = t.array[i + n];
  41409. return this
  41410. },
  41411. copyArray: function(e) {
  41412. return this.array.set(e),
  41413. this
  41414. },
  41415. copyColorsArray: function(e) {
  41416. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41417. var a = e[r];
  41418. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  41419. a = new n.Color),
  41420. t[i++] = a.r,
  41421. t[i++] = a.g,
  41422. t[i++] = a.b
  41423. }
  41424. return this
  41425. },
  41426. copyIndicesArray: function(e) {
  41427. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41428. var o = e[n];
  41429. t[i++] = o.a,
  41430. t[i++] = o.b,
  41431. t[i++] = o.c
  41432. }
  41433. return this
  41434. },
  41435. copyVector2sArray: function(e) {
  41436. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41437. var a = e[r];
  41438. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  41439. a = new n.Vector2),
  41440. t[i++] = a.x,
  41441. t[i++] = a.y
  41442. }
  41443. return this
  41444. },
  41445. copyVector3sArray: function(e) {
  41446. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41447. var a = e[r];
  41448. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  41449. a = new n.Vector3),
  41450. t[i++] = a.x,
  41451. t[i++] = a.y,
  41452. t[i++] = a.z
  41453. }
  41454. return this
  41455. },
  41456. copyVector4sArray: function(e) {
  41457. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41458. var a = e[r];
  41459. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  41460. a = new n.Vector4),
  41461. t[i++] = a.x,
  41462. t[i++] = a.y,
  41463. t[i++] = a.z,
  41464. t[i++] = a.w
  41465. }
  41466. return this
  41467. },
  41468. set: function(e, t) {
  41469. return void 0 === t && (t = 0),
  41470. this.array.set(e, t),
  41471. this
  41472. },
  41473. getX: function(e) {
  41474. return this.array[e * this.itemSize]
  41475. },
  41476. setX: function(e, t) {
  41477. return this.array[e * this.itemSize] = t,
  41478. this
  41479. },
  41480. getY: function(e) {
  41481. return this.array[e * this.itemSize + 1]
  41482. },
  41483. setY: function(e, t) {
  41484. return this.array[e * this.itemSize + 1] = t,
  41485. this
  41486. },
  41487. getZ: function(e) {
  41488. return this.array[e * this.itemSize + 2]
  41489. },
  41490. setZ: function(e, t) {
  41491. return this.array[e * this.itemSize + 2] = t,
  41492. this
  41493. },
  41494. getW: function(e) {
  41495. return this.array[e * this.itemSize + 3]
  41496. },
  41497. setW: function(e, t) {
  41498. return this.array[e * this.itemSize + 3] = t,
  41499. this
  41500. },
  41501. setXY: function(e, t, i) {
  41502. return e *= this.itemSize,
  41503. this.array[e + 0] = t,
  41504. this.array[e + 1] = i,
  41505. this
  41506. },
  41507. setXYZ: function(e, t, i, n) {
  41508. return e *= this.itemSize,
  41509. this.array[e + 0] = t,
  41510. this.array[e + 1] = i,
  41511. this.array[e + 2] = n,
  41512. this
  41513. },
  41514. setXYZW: function(e, t, i, n, r) {
  41515. return e *= this.itemSize,
  41516. this.array[e + 0] = t,
  41517. this.array[e + 1] = i,
  41518. this.array[e + 2] = n,
  41519. this.array[e + 3] = r,
  41520. this
  41521. },
  41522. clone: function() {
  41523. return (new this.constructor).copy(this)
  41524. }
  41525. },
  41526. n.Int8Attribute = function(e, t) {
  41527. return new n.BufferAttribute(new Int8Array(e),t)
  41528. }
  41529. ,
  41530. n.Uint8Attribute = function(e, t) {
  41531. return new n.BufferAttribute(new Uint8Array(e),t)
  41532. }
  41533. ,
  41534. n.Uint8ClampedAttribute = function(e, t) {
  41535. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  41536. }
  41537. ,
  41538. n.Int16Attribute = function(e, t) {
  41539. return new n.BufferAttribute(new Int16Array(e),t)
  41540. }
  41541. ,
  41542. n.Uint16Attribute = function(e, t) {
  41543. return new n.BufferAttribute(new Uint16Array(e),t)
  41544. }
  41545. ;
  41546. n.Int32Attribute = function(e, t) {
  41547. return new n.BufferAttribute(new Int32Array(e),t)
  41548. }
  41549. ;
  41550. n.Uint32Attribute = function(e, t) {
  41551. return new n.BufferAttribute(new Uint32Array(e),t)
  41552. }
  41553. ,
  41554. n.Float32Attribute = function(e, t) {
  41555. return new n.BufferAttribute(new Float32Array(e),t)
  41556. }
  41557. ,
  41558. n.Float64Attribute = function(e, t) {
  41559. return new n.BufferAttribute(new Float64Array(e),t)
  41560. }
  41561. ,
  41562. n.DynamicBufferAttribute = function(e, t) {
  41563. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41564. new n.BufferAttribute(e,t).setDynamic(!0)
  41565. }
  41566. ,
  41567. n.InstancedBufferAttribute = function(e, t, i) {
  41568. n.BufferAttribute.call(this, e, t),
  41569. this.meshPerAttribute = i || 1
  41570. }
  41571. ,
  41572. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  41573. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  41574. n.InstancedBufferAttribute.prototype.copy = function(e) {
  41575. return n.BufferAttribute.prototype.copy.call(this, e),
  41576. this.meshPerAttribute = e.meshPerAttribute,
  41577. this
  41578. }
  41579. ,
  41580. n.InterleavedBuffer = function(e, t) {
  41581. this.uuid = n.Math.generateUUID(),
  41582. this.array = e,
  41583. this.stride = t,
  41584. this.dynamic = !1,
  41585. this.updateRange = {
  41586. offset: 0,
  41587. count: -1
  41588. },
  41589. this.version = 0
  41590. }
  41591. ,
  41592. n.InterleavedBuffer.prototype = {
  41593. constructor: n.InterleavedBuffer,
  41594. get length() {
  41595. return this.array.length
  41596. },
  41597. get count() {
  41598. return this.array.length / this.stride
  41599. },
  41600. set needsUpdate(e) {
  41601. e === !0 && this.version++
  41602. },
  41603. setDynamic: function(e) {
  41604. return this.dynamic = e,
  41605. this
  41606. },
  41607. copy: function(e) {
  41608. return this.array = new e.array.constructor(e.array),
  41609. this.stride = e.stride,
  41610. this.dynamic = e.dynamic,
  41611. this
  41612. },
  41613. copyAt: function(e, t, i) {
  41614. e *= this.stride,
  41615. i *= t.stride;
  41616. for (var n = 0, r = this.stride; n < r; n++)
  41617. this.array[e + n] = t.array[i + n];
  41618. return this
  41619. },
  41620. set: function(e, t) {
  41621. return void 0 === t && (t = 0),
  41622. this.array.set(e, t),
  41623. this
  41624. },
  41625. clone: function() {
  41626. return (new this.constructor).copy(this)
  41627. }
  41628. },
  41629. n.InstancedInterleavedBuffer = function(e, t, i) {
  41630. n.InterleavedBuffer.call(this, e, t),
  41631. this.meshPerAttribute = i || 1
  41632. }
  41633. ,
  41634. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  41635. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  41636. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41637. return n.InterleavedBuffer.prototype.copy.call(this, e),
  41638. this.meshPerAttribute = e.meshPerAttribute,
  41639. this
  41640. }
  41641. ,
  41642. n.InterleavedBufferAttribute = function(e, t, i) {
  41643. this.uuid = n.Math.generateUUID(),
  41644. this.data = e,
  41645. this.itemSize = t,
  41646. this.offset = i
  41647. }
  41648. ,
  41649. n.InterleavedBufferAttribute.prototype = {
  41650. constructor: n.InterleavedBufferAttribute,
  41651. get length() {
  41652. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41653. this.array.length
  41654. },
  41655. get count() {
  41656. return this.data.count
  41657. },
  41658. setX: function(e, t) {
  41659. return this.data.array[e * this.data.stride + this.offset] = t,
  41660. this
  41661. },
  41662. setY: function(e, t) {
  41663. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41664. this
  41665. },
  41666. setZ: function(e, t) {
  41667. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41668. this
  41669. },
  41670. setW: function(e, t) {
  41671. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41672. this
  41673. },
  41674. getX: function(e) {
  41675. return this.data.array[e * this.data.stride + this.offset]
  41676. },
  41677. getY: function(e) {
  41678. return this.data.array[e * this.data.stride + this.offset + 1]
  41679. },
  41680. getZ: function(e) {
  41681. return this.data.array[e * this.data.stride + this.offset + 2]
  41682. },
  41683. getW: function(e) {
  41684. return this.data.array[e * this.data.stride + this.offset + 3]
  41685. },
  41686. setXY: function(e, t, i) {
  41687. return e = e * this.data.stride + this.offset,
  41688. this.data.array[e + 0] = t,
  41689. this.data.array[e + 1] = i,
  41690. this
  41691. },
  41692. setXYZ: function(e, t, i, n) {
  41693. return e = e * this.data.stride + this.offset,
  41694. this.data.array[e + 0] = t,
  41695. this.data.array[e + 1] = i,
  41696. this.data.array[e + 2] = n,
  41697. this
  41698. },
  41699. setXYZW: function(e, t, i, n, r) {
  41700. return e = e * this.data.stride + this.offset,
  41701. this.data.array[e + 0] = t,
  41702. this.data.array[e + 1] = i,
  41703. this.data.array[e + 2] = n,
  41704. this.data.array[e + 3] = r,
  41705. this
  41706. }
  41707. },
  41708. n.Geometry = function() {
  41709. Object.defineProperty(this, "id", {
  41710. value: n.GeometryIdCount++
  41711. }),
  41712. this.uuid = n.Math.generateUUID(),
  41713. this.name = "",
  41714. this.type = "Geometry",
  41715. this.vertices = [],
  41716. this.colors = [],
  41717. this.faces = [],
  41718. this.faceVertexUvs = [[]],
  41719. this.morphTargets = [],
  41720. this.morphNormals = [],
  41721. this.skinWeights = [],
  41722. this.skinIndices = [],
  41723. this.lineDistances = [],
  41724. this.boundingBox = null,
  41725. this.boundingSphere = null,
  41726. this.verticesNeedUpdate = !1,
  41727. this.elementsNeedUpdate = !1,
  41728. this.uvsNeedUpdate = !1,
  41729. this.normalsNeedUpdate = !1,
  41730. this.colorsNeedUpdate = !1,
  41731. this.lineDistancesNeedUpdate = !1,
  41732. this.groupsNeedUpdate = !1
  41733. }
  41734. ,
  41735. n.Geometry.prototype = {
  41736. constructor: n.Geometry,
  41737. applyMatrix: function(e) {
  41738. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  41739. var o = this.vertices[i];
  41740. o.applyMatrix4(e)
  41741. }
  41742. for (var i = 0, r = this.faces.length; i < r; i++) {
  41743. var a = this.faces[i];
  41744. a.normal.applyMatrix3(t).normalize();
  41745. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  41746. a.vertexNormals[s].applyMatrix3(t).normalize()
  41747. }
  41748. return null !== this.boundingBox && this.computeBoundingBox(),
  41749. null !== this.boundingSphere && this.computeBoundingSphere(),
  41750. this.verticesNeedUpdate = !0,
  41751. this.normalsNeedUpdate = !0,
  41752. this
  41753. },
  41754. rotateX: function() {
  41755. var e;
  41756. return function(t) {
  41757. return void 0 === e && (e = new n.Matrix4),
  41758. e.makeRotationX(t),
  41759. this.applyMatrix(e),
  41760. this
  41761. }
  41762. }(),
  41763. rotateY: function() {
  41764. var e;
  41765. return function(t) {
  41766. return void 0 === e && (e = new n.Matrix4),
  41767. e.makeRotationY(t),
  41768. this.applyMatrix(e),
  41769. this
  41770. }
  41771. }(),
  41772. rotateZ: function() {
  41773. var e;
  41774. return function(t) {
  41775. return void 0 === e && (e = new n.Matrix4),
  41776. e.makeRotationZ(t),
  41777. this.applyMatrix(e),
  41778. this
  41779. }
  41780. }(),
  41781. translate: function() {
  41782. var e;
  41783. return function(t, i, r) {
  41784. return void 0 === e && (e = new n.Matrix4),
  41785. e.makeTranslation(t, i, r),
  41786. this.applyMatrix(e),
  41787. this
  41788. }
  41789. }(),
  41790. scale: function() {
  41791. var e;
  41792. return function(t, i, r) {
  41793. return void 0 === e && (e = new n.Matrix4),
  41794. e.makeScale(t, i, r),
  41795. this.applyMatrix(e),
  41796. this
  41797. }
  41798. }(),
  41799. lookAt: function() {
  41800. var e;
  41801. return function(t) {
  41802. void 0 === e && (e = new n.Object3D),
  41803. e.lookAt(t),
  41804. e.updateMatrix(),
  41805. this.applyMatrix(e.matrix)
  41806. }
  41807. }(),
  41808. fromBufferGeometry: function(e) {
  41809. function t(e, t, r, o) {
  41810. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  41811. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  41812. , g = new n.Face3(e,t,r,a,f,o);
  41813. i.faces.push(g),
  41814. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  41815. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  41816. }
  41817. var i = this
  41818. , r = null !== e.index ? e.index.array : void 0
  41819. , o = e.attributes
  41820. , a = o.position.array
  41821. , s = void 0 !== o.normal ? o.normal.array : void 0
  41822. , l = void 0 !== o.color ? o.color.array : void 0
  41823. , c = void 0 !== o.uv ? o.uv.array : void 0
  41824. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  41825. void 0 !== h && (this.faceVertexUvs[1] = []);
  41826. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  41827. g += 2)
  41828. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  41829. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  41830. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  41831. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  41832. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  41833. if (void 0 !== r) {
  41834. var m = e.groups;
  41835. if (m.length > 0)
  41836. for (var f = 0; f < m.length; f++)
  41837. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  41838. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  41839. else
  41840. for (var f = 0; f < r.length; f += 3)
  41841. t(r[f], r[f + 1], r[f + 2])
  41842. } else
  41843. for (var f = 0; f < a.length / 3; f += 3)
  41844. t(f, f + 1, f + 2);
  41845. return this.computeFaceNormals(),
  41846. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41847. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41848. this
  41849. },
  41850. center: function() {
  41851. this.computeBoundingBox();
  41852. var e = this.boundingBox.center().negate();
  41853. return this.translate(e.x, e.y, e.z),
  41854. e
  41855. },
  41856. normalize: function() {
  41857. this.computeBoundingSphere();
  41858. var e = this.boundingSphere.center
  41859. , t = this.boundingSphere.radius
  41860. , i = 0 === t ? 1 : 1 / t
  41861. , r = new n.Matrix4;
  41862. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  41863. this.applyMatrix(r),
  41864. this
  41865. },
  41866. computeFaceNormals: function() {
  41867. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  41868. var o = this.faces[i]
  41869. , a = this.vertices[o.a]
  41870. , s = this.vertices[o.b]
  41871. , l = this.vertices[o.c];
  41872. e.subVectors(l, s),
  41873. t.subVectors(a, s),
  41874. e.cross(t),
  41875. e.normalize(),
  41876. o.normal.copy(e)
  41877. }
  41878. },
  41879. computeVertexNormals: function(e) {
  41880. void 0 === e && (e = !0);
  41881. var t, i, r, o, a, s;
  41882. for (s = new Array(this.vertices.length),
  41883. t = 0,
  41884. i = this.vertices.length; t < i; t++)
  41885. s[t] = new n.Vector3;
  41886. if (e) {
  41887. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  41888. for (r = 0,
  41889. o = this.faces.length; r < o; r++)
  41890. a = this.faces[r],
  41891. l = this.vertices[a.a],
  41892. c = this.vertices[a.b],
  41893. h = this.vertices[a.c],
  41894. u.subVectors(h, c),
  41895. d.subVectors(l, c),
  41896. u.cross(d),
  41897. s[a.a].add(u),
  41898. s[a.b].add(u),
  41899. s[a.c].add(u)
  41900. } else
  41901. for (r = 0,
  41902. o = this.faces.length; r < o; r++)
  41903. a = this.faces[r],
  41904. s[a.a].add(a.normal),
  41905. s[a.b].add(a.normal),
  41906. s[a.c].add(a.normal);
  41907. for (t = 0,
  41908. i = this.vertices.length; t < i; t++)
  41909. s[t].normalize();
  41910. for (r = 0,
  41911. o = this.faces.length; r < o; r++) {
  41912. a = this.faces[r];
  41913. var p = a.vertexNormals;
  41914. 3 === p.length ? (p[0].copy(s[a.a]),
  41915. p[1].copy(s[a.b]),
  41916. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  41917. p[1] = s[a.b].clone(),
  41918. p[2] = s[a.c].clone())
  41919. }
  41920. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  41921. },
  41922. computeMorphNormals: function() {
  41923. var e, t, i, r, o;
  41924. for (i = 0,
  41925. r = this.faces.length; i < r; i++)
  41926. for (o = this.faces[i],
  41927. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  41928. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  41929. e = 0,
  41930. t = o.vertexNormals.length; e < t; e++)
  41931. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  41932. var a = new n.Geometry;
  41933. for (a.faces = this.faces,
  41934. e = 0,
  41935. t = this.morphTargets.length; e < t; e++) {
  41936. if (!this.morphNormals[e]) {
  41937. this.morphNormals[e] = {},
  41938. this.morphNormals[e].faceNormals = [],
  41939. this.morphNormals[e].vertexNormals = [];
  41940. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  41941. for (i = 0,
  41942. r = this.faces.length; i < r; i++)
  41943. s = new n.Vector3,
  41944. l = {
  41945. a: new n.Vector3,
  41946. b: new n.Vector3,
  41947. c: new n.Vector3
  41948. },
  41949. c.push(s),
  41950. h.push(l)
  41951. }
  41952. var u = this.morphNormals[e];
  41953. a.vertices = this.morphTargets[e].vertices,
  41954. a.computeFaceNormals(),
  41955. a.computeVertexNormals();
  41956. var s, l;
  41957. for (i = 0,
  41958. r = this.faces.length; i < r; i++)
  41959. o = this.faces[i],
  41960. s = u.faceNormals[i],
  41961. l = u.vertexNormals[i],
  41962. s.copy(o.normal),
  41963. l.a.copy(o.vertexNormals[0]),
  41964. l.b.copy(o.vertexNormals[1]),
  41965. l.c.copy(o.vertexNormals[2])
  41966. }
  41967. for (i = 0,
  41968. r = this.faces.length; i < r; i++)
  41969. o = this.faces[i],
  41970. o.normal = o.__originalFaceNormal,
  41971. o.vertexNormals = o.__originalVertexNormals
  41972. },
  41973. computeTangents: function() {
  41974. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41975. },
  41976. computeLineDistances: function() {
  41977. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41978. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  41979. this.lineDistances[i] = e
  41980. },
  41981. computeBoundingBox: function() {
  41982. null === this.boundingBox && (this.boundingBox = new n.Box3),
  41983. this.boundingBox.setFromPoints(this.vertices)
  41984. },
  41985. computeBoundingSphere: function() {
  41986. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  41987. this.boundingSphere.setFromPoints(this.vertices)
  41988. },
  41989. merge: function(e, t, i) {
  41990. if (e instanceof n.Geometry == !1)
  41991. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  41992. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  41993. void 0 === i && (i = 0),
  41994. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  41995. for (var d = 0, p = s.length; d < p; d++) {
  41996. var f = s[d]
  41997. , g = f.clone();
  41998. void 0 !== t && g.applyMatrix4(t),
  41999. a.push(g)
  42000. }
  42001. for (d = 0,
  42002. p = c.length; d < p; d++) {
  42003. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  42004. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  42005. m.normal.copy(y.normal),
  42006. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  42007. for (var E = 0, b = C.length; E < b; E++)
  42008. v = C[E].clone(),
  42009. void 0 !== r && v.applyMatrix3(r).normalize(),
  42010. m.vertexNormals.push(v);
  42011. m.color.copy(y.color);
  42012. for (var E = 0, b = I.length; E < b; E++)
  42013. A = I[E],
  42014. m.vertexColors.push(A.clone());
  42015. m.materialIndex = y.materialIndex + i,
  42016. l.push(m)
  42017. }
  42018. for (d = 0,
  42019. p = u.length; d < p; d++) {
  42020. var w = u[d]
  42021. , _ = [];
  42022. if (void 0 !== w) {
  42023. for (var E = 0, b = w.length; E < b; E++)
  42024. _.push(w[E].clone());
  42025. h.push(_)
  42026. }
  42027. }
  42028. },
  42029. mergeMesh: function(e) {
  42030. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42031. void this.merge(e.geometry, e.matrix))
  42032. },
  42033. mergeVertices: function() {
  42034. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  42035. for (i = 0,
  42036. n = this.vertices.length; i < n; i++)
  42037. e = this.vertices[i],
  42038. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  42039. void 0 === l[t] ? (l[t] = i,
  42040. c.push(this.vertices[i]),
  42041. h[i] = c.length - 1) : h[i] = h[l[t]];
  42042. var p = [];
  42043. for (i = 0,
  42044. n = this.faces.length; i < n; i++) {
  42045. r = this.faces[i],
  42046. r.a = h[r.a],
  42047. r.b = h[r.b],
  42048. r.c = h[r.c],
  42049. o = [r.a, r.b, r.c];
  42050. for (var f = -1, g = 0; g < 3; g++)
  42051. if (o[g] === o[(g + 1) % 3]) {
  42052. f = g,
  42053. p.push(i);
  42054. break
  42055. }
  42056. }
  42057. for (i = p.length - 1; i >= 0; i--) {
  42058. var m = p[i];
  42059. for (this.faces.splice(m, 1),
  42060. a = 0,
  42061. s = this.faceVertexUvs.length; a < s; a++)
  42062. this.faceVertexUvs[a].splice(m, 1)
  42063. }
  42064. var v = this.vertices.length - c.length;
  42065. return this.vertices = c,
  42066. v
  42067. },
  42068. sortFacesByMaterialIndex: function() {
  42069. function e(e, t) {
  42070. return e.materialIndex - t.materialIndex
  42071. }
  42072. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  42073. t[n]._id = n;
  42074. t.sort(e);
  42075. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  42076. a && a.length === i && (r = []),
  42077. s && s.length === i && (o = []);
  42078. for (var n = 0; n < i; n++) {
  42079. var l = t[n]._id;
  42080. r && r.push(a[l]),
  42081. o && o.push(s[l])
  42082. }
  42083. r && (this.faceVertexUvs[0] = r),
  42084. o && (this.faceVertexUvs[1] = o)
  42085. },
  42086. toJSON: function() {
  42087. function e(e, t, i) {
  42088. return i ? e | 1 << t : e & ~(1 << t)
  42089. }
  42090. function t(e) {
  42091. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42092. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  42093. u.push(e.x, e.y, e.z),
  42094. d[t])
  42095. }
  42096. function i(e) {
  42097. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42098. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  42099. p.push(e.getHex()),
  42100. f[t])
  42101. }
  42102. function n(e) {
  42103. var t = e.x.toString() + e.y.toString();
  42104. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  42105. g.push(e.x, e.y),
  42106. m[t])
  42107. }
  42108. var r = {
  42109. metadata: {
  42110. version: 4.4,
  42111. type: "Geometry",
  42112. generator: "Geometry.toJSON"
  42113. }
  42114. };
  42115. if (r.uuid = this.uuid,
  42116. r.type = this.type,
  42117. "" !== this.name && (r.name = this.name),
  42118. void 0 !== this.parameters) {
  42119. var o = this.parameters;
  42120. for (var a in o)
  42121. void 0 !== o[a] && (r[a] = o[a]);
  42122. return r
  42123. }
  42124. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42125. var c = this.vertices[l];
  42126. s.push(c.x, c.y, c.z)
  42127. }
  42128. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  42129. var v = this.faces[l]
  42130. , A = !0
  42131. , y = !1
  42132. , C = void 0 !== this.faceVertexUvs[0][l]
  42133. , I = v.normal.length() > 0
  42134. , E = v.vertexNormals.length > 0
  42135. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42136. , w = v.vertexColors.length > 0
  42137. , _ = 0;
  42138. if (_ = e(_, 0, 0),
  42139. _ = e(_, 1, A),
  42140. _ = e(_, 2, y),
  42141. _ = e(_, 3, C),
  42142. _ = e(_, 4, I),
  42143. _ = e(_, 5, E),
  42144. _ = e(_, 6, b),
  42145. _ = e(_, 7, w),
  42146. h.push(_),
  42147. h.push(v.a, v.b, v.c),
  42148. h.push(v.materialIndex),
  42149. C) {
  42150. var T = this.faceVertexUvs[0][l];
  42151. h.push(n(T[0]), n(T[1]), n(T[2]))
  42152. }
  42153. if (I && h.push(t(v.normal)),
  42154. E) {
  42155. var x = v.vertexNormals;
  42156. h.push(t(x[0]), t(x[1]), t(x[2]))
  42157. }
  42158. if (b && h.push(i(v.color)),
  42159. w) {
  42160. var S = v.vertexColors;
  42161. h.push(i(S[0]), i(S[1]), i(S[2]))
  42162. }
  42163. }
  42164. return r.data = {},
  42165. r.data.vertices = s,
  42166. r.data.normals = u,
  42167. p.length > 0 && (r.data.colors = p),
  42168. g.length > 0 && (r.data.uvs = [g]),
  42169. r.data.faces = h,
  42170. r
  42171. },
  42172. clone: function() {
  42173. return (new n.Geometry).copy(this)
  42174. },
  42175. copy: function(e) {
  42176. this.vertices = [],
  42177. this.faces = [],
  42178. this.faceVertexUvs = [[]];
  42179. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42180. this.vertices.push(t[i].clone());
  42181. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  42182. this.faces.push(r[i].clone());
  42183. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  42184. var o = e.faceVertexUvs[i];
  42185. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42186. for (var a = 0, s = o.length; a < s; a++) {
  42187. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42188. var d = l[h];
  42189. c.push(d.clone())
  42190. }
  42191. this.faceVertexUvs[i].push(c)
  42192. }
  42193. }
  42194. return this
  42195. },
  42196. dispose: function() {
  42197. this.dispatchEvent({
  42198. type: "dispose"
  42199. })
  42200. }
  42201. },
  42202. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  42203. n.GeometryIdCount = 0,
  42204. n.DirectGeometry = function() {
  42205. Object.defineProperty(this, "id", {
  42206. value: n.GeometryIdCount++
  42207. }),
  42208. this.uuid = n.Math.generateUUID(),
  42209. this.name = "",
  42210. this.type = "DirectGeometry",
  42211. this.indices = [],
  42212. this.vertices = [],
  42213. this.normals = [],
  42214. this.colors = [],
  42215. this.uvs = [],
  42216. this.uvs2 = [],
  42217. this.groups = [],
  42218. this.morphTargets = {},
  42219. this.skinWeights = [],
  42220. this.skinIndices = [],
  42221. this.boundingBox = null,
  42222. this.boundingSphere = null,
  42223. this.verticesNeedUpdate = !1,
  42224. this.normalsNeedUpdate = !1,
  42225. this.colorsNeedUpdate = !1,
  42226. this.uvsNeedUpdate = !1,
  42227. this.groupsNeedUpdate = !1
  42228. }
  42229. ,
  42230. n.DirectGeometry.prototype = {
  42231. constructor: n.DirectGeometry,
  42232. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  42233. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  42234. computeFaceNormals: function() {
  42235. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42236. },
  42237. computeVertexNormals: function() {
  42238. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42239. },
  42240. computeGroups: function(e) {
  42241. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42242. var a = r[o];
  42243. a.materialIndex !== i && (i = a.materialIndex,
  42244. void 0 !== t && (t.count = 3 * o - t.start,
  42245. n.push(t)),
  42246. t = {
  42247. start: 3 * o,
  42248. materialIndex: i
  42249. })
  42250. }
  42251. void 0 !== t && (t.count = 3 * o - t.start,
  42252. n.push(t)),
  42253. this.groups = n
  42254. },
  42255. fromGeometry: function(e) {
  42256. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  42257. if (c > 0) {
  42258. t = [];
  42259. for (var h = 0; h < c; h++)
  42260. t[h] = [];
  42261. this.morphTargets.position = t
  42262. }
  42263. var u, d = e.morphNormals, p = d.length;
  42264. if (p > 0) {
  42265. u = [];
  42266. for (var h = 0; h < p; h++)
  42267. u[h] = [];
  42268. this.morphTargets.normal = u
  42269. }
  42270. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  42271. var A = i[h];
  42272. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  42273. var y = A.vertexNormals;
  42274. if (3 === y.length)
  42275. this.normals.push(y[0], y[1], y[2]);
  42276. else {
  42277. var C = A.normal;
  42278. this.normals.push(C, C, C)
  42279. }
  42280. var I = A.vertexColors;
  42281. if (3 === I.length)
  42282. this.colors.push(I[0], I[1], I[2]);
  42283. else {
  42284. var E = A.color;
  42285. this.colors.push(E, E, E)
  42286. }
  42287. if (a === !0) {
  42288. var b = o[0][h];
  42289. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  42290. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42291. }
  42292. if (s === !0) {
  42293. var b = o[1][h];
  42294. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  42295. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42296. }
  42297. for (var w = 0; w < c; w++) {
  42298. var _ = l[w].vertices;
  42299. t[w].push(_[A.a], _[A.b], _[A.c])
  42300. }
  42301. for (var w = 0; w < p; w++) {
  42302. var T = d[w].vertexNormals[h];
  42303. u[w].push(T.a, T.b, T.c)
  42304. }
  42305. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  42306. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  42307. }
  42308. return this.computeGroups(e),
  42309. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42310. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42311. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42312. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42313. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42314. this
  42315. },
  42316. dispose: function() {
  42317. this.dispatchEvent({
  42318. type: "dispose"
  42319. })
  42320. }
  42321. },
  42322. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  42323. n.BufferGeometry = function() {
  42324. Object.defineProperty(this, "id", {
  42325. value: n.GeometryIdCount++
  42326. }),
  42327. this.uuid = n.Math.generateUUID(),
  42328. this.name = "",
  42329. this.type = "BufferGeometry",
  42330. this.index = null,
  42331. this.attributes = {},
  42332. this.morphAttributes = {},
  42333. this.groups = [],
  42334. this.boundingBox = null,
  42335. this.boundingSphere = null,
  42336. this.drawRange = {
  42337. start: 0,
  42338. count: 1 / 0
  42339. }
  42340. }
  42341. ,
  42342. n.BufferGeometry.prototype = {
  42343. constructor: n.BufferGeometry,
  42344. getIndex: function() {
  42345. return this.index
  42346. },
  42347. setIndex: function(e) {
  42348. this.index = e
  42349. },
  42350. addAttribute: function(e, t) {
  42351. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42352. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42353. void this.setIndex(t)) : (this.attributes[e] = t,
  42354. this)
  42355. },
  42356. getAttribute: function(e) {
  42357. return this.attributes[e]
  42358. },
  42359. removeAttribute: function(e) {
  42360. return delete this.attributes[e],
  42361. this
  42362. },
  42363. addGroup: function(e, t, i) {
  42364. this.groups.push({
  42365. start: e,
  42366. count: t,
  42367. materialIndex: void 0 !== i ? i : 0
  42368. })
  42369. },
  42370. clearGroups: function() {
  42371. this.groups = []
  42372. },
  42373. setDrawRange: function(e, t) {
  42374. this.drawRange.start = e,
  42375. this.drawRange.count = t
  42376. },
  42377. applyMatrix: function(e) {
  42378. var t = this.attributes.position;
  42379. void 0 !== t && (e.applyToVector3Array(t.array),
  42380. t.needsUpdate = !0);
  42381. var i = this.attributes.normal;
  42382. if (void 0 !== i) {
  42383. var r = (new n.Matrix3).getNormalMatrix(e);
  42384. r.applyToVector3Array(i.array),
  42385. i.needsUpdate = !0
  42386. }
  42387. return null !== this.boundingBox && this.computeBoundingBox(),
  42388. null !== this.boundingSphere && this.computeBoundingSphere(),
  42389. this
  42390. },
  42391. rotateX: function() {
  42392. var e;
  42393. return function(t) {
  42394. return void 0 === e && (e = new n.Matrix4),
  42395. e.makeRotationX(t),
  42396. this.applyMatrix(e),
  42397. this
  42398. }
  42399. }(),
  42400. rotateY: function() {
  42401. var e;
  42402. return function(t) {
  42403. return void 0 === e && (e = new n.Matrix4),
  42404. e.makeRotationY(t),
  42405. this.applyMatrix(e),
  42406. this
  42407. }
  42408. }(),
  42409. rotateZ: function() {
  42410. var e;
  42411. return function(t) {
  42412. return void 0 === e && (e = new n.Matrix4),
  42413. e.makeRotationZ(t),
  42414. this.applyMatrix(e),
  42415. this
  42416. }
  42417. }(),
  42418. translate: function() {
  42419. var e;
  42420. return function(t, i, r) {
  42421. return void 0 === e && (e = new n.Matrix4),
  42422. e.makeTranslation(t, i, r),
  42423. this.applyMatrix(e),
  42424. this
  42425. }
  42426. }(),
  42427. scale: function() {
  42428. var e;
  42429. return function(t, i, r) {
  42430. return void 0 === e && (e = new n.Matrix4),
  42431. e.makeScale(t, i, r),
  42432. this.applyMatrix(e),
  42433. this
  42434. }
  42435. }(),
  42436. lookAt: function() {
  42437. var e;
  42438. return function(t) {
  42439. void 0 === e && (e = new n.Object3D),
  42440. e.lookAt(t),
  42441. e.updateMatrix(),
  42442. this.applyMatrix(e.matrix)
  42443. }
  42444. }(),
  42445. center: function() {
  42446. this.computeBoundingBox();
  42447. var e = this.boundingBox.center().negate();
  42448. return this.translate(e.x, e.y, e.z),
  42449. e
  42450. },
  42451. setFromObject: function(e) {
  42452. var t = e.geometry;
  42453. if (e instanceof n.Points || e instanceof n.Line) {
  42454. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  42455. , r = new n.Float32Attribute(3 * t.colors.length,3);
  42456. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42457. this.addAttribute("color", r.copyColorsArray(t.colors)),
  42458. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42459. var o = new n.Float32Attribute(t.lineDistances.length,1);
  42460. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  42461. }
  42462. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42463. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42464. } else
  42465. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  42466. return this
  42467. },
  42468. updateFromObject: function(e) {
  42469. var t = e.geometry;
  42470. if (e instanceof n.Mesh) {
  42471. var i = t.__directGeometry;
  42472. if (void 0 === i)
  42473. return this.fromGeometry(t);
  42474. i.verticesNeedUpdate = t.verticesNeedUpdate,
  42475. i.normalsNeedUpdate = t.normalsNeedUpdate,
  42476. i.colorsNeedUpdate = t.colorsNeedUpdate,
  42477. i.uvsNeedUpdate = t.uvsNeedUpdate,
  42478. i.groupsNeedUpdate = t.groupsNeedUpdate,
  42479. t.verticesNeedUpdate = !1,
  42480. t.normalsNeedUpdate = !1,
  42481. t.colorsNeedUpdate = !1,
  42482. t.uvsNeedUpdate = !1,
  42483. t.groupsNeedUpdate = !1,
  42484. t = i
  42485. }
  42486. if (t.verticesNeedUpdate === !0) {
  42487. var r = this.attributes.position;
  42488. void 0 !== r && (r.copyVector3sArray(t.vertices),
  42489. r.needsUpdate = !0),
  42490. t.verticesNeedUpdate = !1
  42491. }
  42492. if (t.normalsNeedUpdate === !0) {
  42493. var r = this.attributes.normal;
  42494. void 0 !== r && (r.copyVector3sArray(t.normals),
  42495. r.needsUpdate = !0),
  42496. t.normalsNeedUpdate = !1
  42497. }
  42498. if (t.colorsNeedUpdate === !0) {
  42499. var r = this.attributes.color;
  42500. void 0 !== r && (r.copyColorsArray(t.colors),
  42501. r.needsUpdate = !0),
  42502. t.colorsNeedUpdate = !1
  42503. }
  42504. if (t.uvsNeedUpdate) {
  42505. var r = this.attributes.uv;
  42506. void 0 !== r && (r.copyVector2sArray(t.uvs),
  42507. r.needsUpdate = !0),
  42508. t.uvsNeedUpdate = !1
  42509. }
  42510. if (t.lineDistancesNeedUpdate) {
  42511. var r = this.attributes.lineDistance;
  42512. void 0 !== r && (r.copyArray(t.lineDistances),
  42513. r.needsUpdate = !0),
  42514. t.lineDistancesNeedUpdate = !1
  42515. }
  42516. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  42517. this.groups = t.groups,
  42518. t.groupsNeedUpdate = !1),
  42519. this
  42520. },
  42521. fromGeometry: function(e) {
  42522. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  42523. this.fromDirectGeometry(e.__directGeometry)
  42524. },
  42525. fromDirectGeometry: function(e) {
  42526. var t = new Float32Array(3 * e.vertices.length);
  42527. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42528. e.normals.length > 0) {
  42529. var i = new Float32Array(3 * e.normals.length);
  42530. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42531. }
  42532. if (e.colors.length > 0) {
  42533. var r = new Float32Array(3 * e.colors.length);
  42534. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  42535. }
  42536. if (e.uvs.length > 0) {
  42537. var o = new Float32Array(2 * e.uvs.length);
  42538. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  42539. }
  42540. if (e.uvs2.length > 0) {
  42541. var a = new Float32Array(2 * e.uvs2.length);
  42542. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  42543. }
  42544. if (e.indices.length > 0) {
  42545. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  42546. , l = new s(3 * e.indices.length);
  42547. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  42548. }
  42549. this.groups = e.groups;
  42550. for (var c in e.morphTargets) {
  42551. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  42552. var f = u[d]
  42553. , g = new n.Float32Attribute(3 * f.length,3);
  42554. h.push(g.copyVector3sArray(f))
  42555. }
  42556. this.morphAttributes[c] = h
  42557. }
  42558. if (e.skinIndices.length > 0) {
  42559. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  42560. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  42561. }
  42562. if (e.skinWeights.length > 0) {
  42563. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  42564. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  42565. }
  42566. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42567. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42568. this
  42569. },
  42570. computeBoundingBox: function() {
  42571. new n.Vector3;
  42572. return function() {
  42573. null === this.boundingBox && (this.boundingBox = new n.Box3);
  42574. var e = this.attributes.position.array;
  42575. e && this.boundingBox.setFromArray(e),
  42576. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42577. this.boundingBox.max.set(0, 0, 0)),
  42578. (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)
  42579. }
  42580. }(),
  42581. computeBoundingSphere: function() {
  42582. var e = new n.Box3
  42583. , t = new n.Vector3;
  42584. return function() {
  42585. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  42586. var i = this.attributes.position.array;
  42587. if (i) {
  42588. var r = this.boundingSphere.center;
  42589. e.setFromArray(i),
  42590. e.center(r);
  42591. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  42592. t.fromArray(i, a),
  42593. o = Math.max(o, r.distanceToSquared(t));
  42594. this.boundingSphere.radius = Math.sqrt(o),
  42595. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42596. }
  42597. }
  42598. }(),
  42599. computeFaceNormals: function() {},
  42600. computeVertexNormals: function() {
  42601. var e = this.index
  42602. , t = this.attributes
  42603. , i = this.groups;
  42604. if (t.position) {
  42605. var r = t.position.array;
  42606. if (void 0 === t.normal)
  42607. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  42608. else
  42609. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  42610. o[a] = 0;
  42611. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  42612. if (e) {
  42613. var v = e.array;
  42614. 0 === i.length && this.addGroup(0, v.length);
  42615. for (var A = 0, y = i.length; A < y; ++A)
  42616. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  42617. l = 3 * v[a + 0],
  42618. c = 3 * v[a + 1],
  42619. h = 3 * v[a + 2],
  42620. d.fromArray(r, l),
  42621. p.fromArray(r, c),
  42622. f.fromArray(r, h),
  42623. g.subVectors(f, p),
  42624. m.subVectors(d, p),
  42625. g.cross(m),
  42626. u[l] += g.x,
  42627. u[l + 1] += g.y,
  42628. u[l + 2] += g.z,
  42629. u[c] += g.x,
  42630. u[c + 1] += g.y,
  42631. u[c + 2] += g.z,
  42632. u[h] += g.x,
  42633. u[h + 1] += g.y,
  42634. u[h + 2] += g.z
  42635. } else
  42636. for (var a = 0, s = r.length; a < s; a += 9)
  42637. d.fromArray(r, a),
  42638. p.fromArray(r, a + 3),
  42639. f.fromArray(r, a + 6),
  42640. g.subVectors(f, p),
  42641. m.subVectors(d, p),
  42642. g.cross(m),
  42643. u[a] = g.x,
  42644. u[a + 1] = g.y,
  42645. u[a + 2] = g.z,
  42646. u[a + 3] = g.x,
  42647. u[a + 4] = g.y,
  42648. u[a + 5] = g.z,
  42649. u[a + 6] = g.x,
  42650. u[a + 7] = g.y,
  42651. u[a + 8] = g.z;
  42652. this.normalizeNormals(),
  42653. t.normal.needsUpdate = !0
  42654. }
  42655. },
  42656. merge: function(e, t) {
  42657. if (e instanceof n.BufferGeometry == !1)
  42658. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  42659. void 0 === t && (t = 0);
  42660. var i = this.attributes;
  42661. for (var r in i)
  42662. if (void 0 !== e.attributes[r])
  42663. for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++,
  42664. u++)
  42665. a[u] = l[h];
  42666. return this
  42667. },
  42668. normalizeNormals: function() {
  42669. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42670. e = r[o],
  42671. t = r[o + 1],
  42672. i = r[o + 2],
  42673. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42674. r[o] *= n,
  42675. r[o + 1] *= n,
  42676. r[o + 2] *= n
  42677. },
  42678. toNonIndexed: function() {
  42679. if (null === this.index)
  42680. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42681. this;
  42682. var e = new n.BufferGeometry
  42683. , t = this.index.array
  42684. , i = this.attributes;
  42685. for (var r in i) {
  42686. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  42687. c = t[u] * s;
  42688. for (var p = 0; p < s; p++)
  42689. l[h++] = a[c++]
  42690. }
  42691. e.addAttribute(r, new n.BufferAttribute(l,s))
  42692. }
  42693. return e
  42694. },
  42695. toJSON: function() {
  42696. var e = {
  42697. metadata: {
  42698. version: 4.4,
  42699. type: "BufferGeometry",
  42700. generator: "BufferGeometry.toJSON"
  42701. }
  42702. };
  42703. if (e.uuid = this.uuid,
  42704. e.type = this.type,
  42705. "" !== this.name && (e.name = this.name),
  42706. void 0 !== this.parameters) {
  42707. var t = this.parameters;
  42708. for (var i in t)
  42709. void 0 !== t[i] && (e[i] = t[i]);
  42710. return e
  42711. }
  42712. e.data = {
  42713. attributes: {}
  42714. };
  42715. var n = this.index;
  42716. if (null !== n) {
  42717. var r = Array.prototype.slice.call(n.array);
  42718. e.data.index = {
  42719. type: n.array.constructor.name,
  42720. array: r
  42721. }
  42722. }
  42723. var o = this.attributes;
  42724. for (var i in o) {
  42725. var a = o[i]
  42726. , r = Array.prototype.slice.call(a.array);
  42727. e.data.attributes[i] = {
  42728. itemSize: a.itemSize,
  42729. type: a.array.constructor.name,
  42730. array: r
  42731. }
  42732. }
  42733. var s = this.groups;
  42734. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42735. var l = this.boundingSphere;
  42736. return null !== l && (e.data.boundingSphere = {
  42737. center: l.center.toArray(),
  42738. radius: l.radius
  42739. }),
  42740. e
  42741. },
  42742. clone: function() {
  42743. return (new n.BufferGeometry).copy(this)
  42744. },
  42745. copy: function(e) {
  42746. var t = e.index;
  42747. null !== t && this.setIndex(t.clone());
  42748. var i = e.attributes;
  42749. for (var n in i) {
  42750. var r = i[n];
  42751. this.addAttribute(n, r.clone())
  42752. }
  42753. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42754. var l = o[a];
  42755. this.addGroup(l.start, l.count)
  42756. }
  42757. return this
  42758. },
  42759. dispose: function() {
  42760. this.dispatchEvent({
  42761. type: "dispose"
  42762. })
  42763. }
  42764. },
  42765. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  42766. n.BufferGeometry.MaxIndex = 65535,
  42767. n.InstancedBufferGeometry = function() {
  42768. n.BufferGeometry.call(this),
  42769. this.type = "InstancedBufferGeometry",
  42770. this.maxInstancedCount = void 0
  42771. }
  42772. ,
  42773. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  42774. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  42775. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42776. this.groups.push({
  42777. start: e,
  42778. count: t,
  42779. instances: i
  42780. })
  42781. }
  42782. ,
  42783. n.InstancedBufferGeometry.prototype.copy = function(e) {
  42784. var t = e.index;
  42785. null !== t && this.setIndex(t.clone());
  42786. var i = e.attributes;
  42787. for (var n in i) {
  42788. var r = i[n];
  42789. this.addAttribute(n, r.clone())
  42790. }
  42791. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42792. var l = o[a];
  42793. this.addGroup(l.start, l.count, l.instances)
  42794. }
  42795. return this
  42796. }
  42797. ,
  42798. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  42799. n.Uniform = function(e, t) {
  42800. this.type = e,
  42801. this.value = t,
  42802. this.dynamic = !1
  42803. }
  42804. ,
  42805. n.Uniform.prototype = {
  42806. constructor: n.Uniform,
  42807. onUpdate: function(e) {
  42808. return this.dynamic = !0,
  42809. this.onUpdateCallback = e,
  42810. this
  42811. }
  42812. },
  42813. n.AnimationClip = function(e, t, i) {
  42814. this.name = e || n.Math.generateUUID(),
  42815. this.tracks = i,
  42816. this.duration = void 0 !== t ? t : -1,
  42817. this.duration < 0 && this.resetDuration(),
  42818. this.trim(),
  42819. this.optimize()
  42820. }
  42821. ,
  42822. n.AnimationClip.prototype = {
  42823. constructor: n.AnimationClip,
  42824. resetDuration: function() {
  42825. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  42826. var r = this.tracks[i];
  42827. t = Math.max(t, r.times[r.times.length - 1])
  42828. }
  42829. this.duration = t
  42830. },
  42831. trim: function() {
  42832. for (var e = 0; e < this.tracks.length; e++)
  42833. this.tracks[e].trim(0, this.duration);
  42834. return this
  42835. },
  42836. optimize: function() {
  42837. for (var e = 0; e < this.tracks.length; e++)
  42838. this.tracks[e].optimize();
  42839. return this
  42840. }
  42841. },
  42842. Object.assign(n.AnimationClip, {
  42843. parse: function(e) {
  42844. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  42845. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  42846. return new n.AnimationClip(e.name,e.duration,t)
  42847. },
  42848. toJSON: function(e) {
  42849. for (var t = [], i = e.tracks, r = {
  42850. name: e.name,
  42851. duration: e.duration,
  42852. tracks: t
  42853. }, o = 0, a = i.length; o !== a; ++o)
  42854. t.push(n.KeyframeTrack.toJSON(i[o]));
  42855. return r
  42856. },
  42857. CreateFromMorphTargetSequence: function(e, t, i) {
  42858. for (var r = t.length, o = [], a = 0; a < r; a++) {
  42859. var s = []
  42860. , l = [];
  42861. s.push((a + r - 1) % r, a, (a + 1) % r),
  42862. l.push(0, 1, 0);
  42863. var c = n.AnimationUtils.getKeyframeOrder(s);
  42864. s = n.AnimationUtils.sortedArray(s, 1, c),
  42865. l = n.AnimationUtils.sortedArray(l, 1, c),
  42866. 0 === s[0] && (s.push(r),
  42867. l.push(l[0])),
  42868. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  42869. }
  42870. return new n.AnimationClip(e,-1,o)
  42871. },
  42872. findByName: function(e, t) {
  42873. for (var i = 0; i < e.length; i++)
  42874. if (e[i].name === t)
  42875. return e[i];
  42876. return null
  42877. },
  42878. CreateClipsFromMorphTargetSequences: function(e, t) {
  42879. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  42880. var s = e[o]
  42881. , l = s.name.match(r);
  42882. if (l && l.length > 1) {
  42883. var c = l[1]
  42884. , h = i[c];
  42885. h || (i[c] = h = []),
  42886. h.push(s)
  42887. }
  42888. }
  42889. var u = [];
  42890. for (var c in i)
  42891. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  42892. return u
  42893. },
  42894. parseAnimation: function(e, t, i) {
  42895. if (!e)
  42896. return console.error(" no animation in JSONLoader data"),
  42897. null;
  42898. for (var r = function(e, t, i, r, o) {
  42899. if (0 !== i.length) {
  42900. var a = []
  42901. , s = [];
  42902. n.AnimationUtils.flattenJSON(i, a, s, r),
  42903. 0 !== a.length && o.push(new e(t,a,s))
  42904. }
  42905. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  42906. var u = c[h].keys;
  42907. if (u && 0 != u.length)
  42908. if (u[0].morphTargets) {
  42909. for (var d = {}, p = 0; p < u.length; p++)
  42910. if (u[p].morphTargets)
  42911. for (var f = 0; f < u[p].morphTargets.length; f++)
  42912. d[u[p].morphTargets[f]] = -1;
  42913. for (var g in d) {
  42914. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  42915. var A = u[p];
  42916. m.push(A.time),
  42917. v.push(A.morphTarget === g ? 1 : 0)
  42918. }
  42919. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  42920. }
  42921. s = d.length * (l || 1)
  42922. } else {
  42923. var y = ".bones[" + t[h].name + "]";
  42924. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  42925. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  42926. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  42927. }
  42928. }
  42929. if (0 === o.length)
  42930. return null;
  42931. var C = new n.AnimationClip(a,s,o);
  42932. return C
  42933. }
  42934. }),
  42935. n.AnimationMixer = function(e) {
  42936. this._root = e,
  42937. this._initMemoryManager(),
  42938. this._accuIndex = 0,
  42939. this.time = 0,
  42940. this.timeScale = 1
  42941. }
  42942. ,
  42943. n.AnimationMixer.prototype = {
  42944. constructor: n.AnimationMixer,
  42945. clipAction: function(e, t) {
  42946. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  42947. if (void 0 !== l) {
  42948. var c = l.actionByRoot[o];
  42949. if (void 0 !== c)
  42950. return c;
  42951. if (i = l.knownActions[0],
  42952. s = i._clip,
  42953. e !== a && e !== s)
  42954. throw new Error("Different clips with the same name detected!")
  42955. }
  42956. if (null === s)
  42957. return null;
  42958. var h = new n.AnimationMixer._Action(this,s,t);
  42959. return this._bindAction(h, i),
  42960. this._addInactiveAction(h, a, o),
  42961. h
  42962. },
  42963. existingAction: function(e, t) {
  42964. var i = t || this._root
  42965. , n = i.uuid
  42966. , r = "string" == typeof e ? e : e.name
  42967. , o = this._actionsByClip[r];
  42968. return void 0 !== o ? o.actionByRoot[n] || null : null
  42969. },
  42970. stopAllAction: function() {
  42971. var e = this._actions
  42972. , t = this._nActiveActions
  42973. , i = this._bindings
  42974. , n = this._nActiveBindings;
  42975. this._nActiveActions = 0,
  42976. this._nActiveBindings = 0;
  42977. for (var r = 0; r !== t; ++r)
  42978. e[r].reset();
  42979. for (var r = 0; r !== n; ++r)
  42980. i[r].useCount = 0;
  42981. return this
  42982. },
  42983. update: function(e) {
  42984. e *= this.timeScale;
  42985. 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) {
  42986. var s = t[a];
  42987. s.enabled && s._update(n, e, r, o)
  42988. }
  42989. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  42990. l[a].apply(o);
  42991. return this
  42992. },
  42993. getRoot: function() {
  42994. return this._root
  42995. },
  42996. uncacheClip: function(e) {
  42997. var t = this._actions
  42998. , i = e.name
  42999. , n = this._actionsByClip
  43000. , r = n[i];
  43001. if (void 0 !== r) {
  43002. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43003. var l = o[a];
  43004. this._deactivateAction(l);
  43005. var c = l._cacheIndex
  43006. , h = t[t.length - 1];
  43007. l._cacheIndex = null,
  43008. l._byClipCacheIndex = null,
  43009. h._cacheIndex = c,
  43010. t[c] = h,
  43011. t.pop(),
  43012. this._removeInactiveBindingsForAction(l)
  43013. }
  43014. delete n[i]
  43015. }
  43016. },
  43017. uncacheRoot: function(e) {
  43018. var t = e.uuid
  43019. , i = this._actionsByClip;
  43020. for (var n in i) {
  43021. var r = i[n].actionByRoot
  43022. , o = r[t];
  43023. void 0 !== o && (this._deactivateAction(o),
  43024. this._removeInactiveAction(o))
  43025. }
  43026. var a = this._bindingsByRootAndName
  43027. , s = a[t];
  43028. if (void 0 !== s)
  43029. for (var l in s) {
  43030. var c = s[l];
  43031. c.restoreOriginalState(),
  43032. this._removeInactiveBinding(c)
  43033. }
  43034. },
  43035. uncacheAction: function(e, t) {
  43036. var i = this.existingAction(e, t);
  43037. null !== i && (this._deactivateAction(i),
  43038. this._removeInactiveAction(i))
  43039. }
  43040. },
  43041. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  43042. n.AnimationMixer._Action = function(e, t, i) {
  43043. this._mixer = e,
  43044. this._clip = t,
  43045. this._localRoot = i || null;
  43046. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  43047. endingStart: n.ZeroCurvatureEnding,
  43048. endingEnd: n.ZeroCurvatureEnding
  43049. }, l = 0; l !== o; ++l) {
  43050. var c = r[l].createInterpolant(null);
  43051. a[l] = c,
  43052. c.settings = s
  43053. }
  43054. this._interpolantSettings = s,
  43055. this._interpolants = a,
  43056. this._propertyBindings = new Array(o),
  43057. this._cacheIndex = null,
  43058. this._byClipCacheIndex = null,
  43059. this._timeScaleInterpolant = null,
  43060. this._weightInterpolant = null,
  43061. this.loop = n.LoopRepeat,
  43062. this._loopCount = -1,
  43063. this._startTime = null,
  43064. this.time = 0,
  43065. this.timeScale = 1,
  43066. this._effectiveTimeScale = 1,
  43067. this.weight = 1,
  43068. this._effectiveWeight = 1,
  43069. this.repetitions = 1 / 0,
  43070. this.paused = !1,
  43071. this.enabled = !0,
  43072. this.clampWhenFinished = !1,
  43073. this.zeroSlopeAtStart = !0,
  43074. this.zeroSlopeAtEnd = !0
  43075. }
  43076. ,
  43077. n.AnimationMixer._Action.prototype = {
  43078. constructor: n.AnimationMixer._Action,
  43079. play: function() {
  43080. return this._mixer._activateAction(this),
  43081. this
  43082. },
  43083. stop: function() {
  43084. return this._mixer._deactivateAction(this),
  43085. this.reset()
  43086. },
  43087. reset: function() {
  43088. return this.paused = !1,
  43089. this.enabled = !0,
  43090. this.time = 0,
  43091. this._loopCount = -1,
  43092. this._startTime = null,
  43093. this.stopFading().stopWarping()
  43094. },
  43095. isRunning: function() {
  43096. this._startTime;
  43097. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43098. },
  43099. isScheduled: function() {
  43100. return this._mixer._isActiveAction(this)
  43101. },
  43102. startAt: function(e) {
  43103. return this._startTime = e,
  43104. this
  43105. },
  43106. setLoop: function(e, t) {
  43107. return this.loop = e,
  43108. this.repetitions = t,
  43109. this
  43110. },
  43111. setEffectiveWeight: function(e) {
  43112. return this.weight = e,
  43113. this._effectiveWeight = this.enabled ? e : 0,
  43114. this.stopFading()
  43115. },
  43116. getEffectiveWeight: function() {
  43117. return this._effectiveWeight
  43118. },
  43119. fadeIn: function(e) {
  43120. return this._scheduleFading(e, 0, 1)
  43121. },
  43122. fadeOut: function(e) {
  43123. return this._scheduleFading(e, 1, 0)
  43124. },
  43125. crossFadeFrom: function(e, t, i) {
  43126. this._mixer;
  43127. if (e.fadeOut(t),
  43128. this.fadeIn(t),
  43129. i) {
  43130. var n = this._clip.duration
  43131. , r = e._clip.duration
  43132. , o = r / n
  43133. , a = n / r;
  43134. e.warp(1, o, t),
  43135. this.warp(a, 1, t)
  43136. }
  43137. return this
  43138. },
  43139. crossFadeTo: function(e, t, i) {
  43140. return e.crossFadeFrom(this, t, i)
  43141. },
  43142. stopFading: function() {
  43143. var e = this._weightInterpolant;
  43144. return null !== e && (this._weightInterpolant = null,
  43145. this._mixer._takeBackControlInterpolant(e)),
  43146. this
  43147. },
  43148. setEffectiveTimeScale: function(e) {
  43149. return this.timeScale = e,
  43150. this._effectiveTimeScale = this.paused ? 0 : e,
  43151. this.stopWarping()
  43152. },
  43153. getEffectiveTimeScale: function() {
  43154. return this._effectiveTimeScale
  43155. },
  43156. setDuration: function(e) {
  43157. return this.timeScale = this._clip.duration / e,
  43158. this.stopWarping()
  43159. },
  43160. syncWith: function(e) {
  43161. return this.time = e.time,
  43162. this.timeScale = e.timeScale,
  43163. this.stopWarping()
  43164. },
  43165. halt: function(e) {
  43166. return this.warp(this._currentTimeScale, 0, e)
  43167. },
  43168. warp: function(e, t, i) {
  43169. var n = this._mixer
  43170. , r = n.time
  43171. , o = this._timeScaleInterpolant
  43172. , a = this.timeScale;
  43173. null === o && (o = n._lendControlInterpolant(),
  43174. this._timeScaleInterpolant = o);
  43175. var s = o.parameterPositions
  43176. , l = o.sampleValues;
  43177. return s[0] = r,
  43178. s[1] = r + i,
  43179. l[0] = e / a,
  43180. l[1] = t / a,
  43181. this
  43182. },
  43183. stopWarping: function() {
  43184. var e = this._timeScaleInterpolant;
  43185. return null !== e && (this._timeScaleInterpolant = null,
  43186. this._mixer._takeBackControlInterpolant(e)),
  43187. this
  43188. },
  43189. getMixer: function() {
  43190. return this._mixer
  43191. },
  43192. getClip: function() {
  43193. return this._clip
  43194. },
  43195. getRoot: function() {
  43196. return this._localRoot || this._mixer._root
  43197. },
  43198. _update: function(e, t, i, n) {
  43199. var r = this._startTime;
  43200. if (null !== r) {
  43201. var o = (e - r) * i;
  43202. if (o < 0 || 0 === i)
  43203. return;
  43204. this._startTime = null,
  43205. t = i * o
  43206. }
  43207. t *= this._updateTimeScale(e);
  43208. var a = this._updateTime(t)
  43209. , s = this._updateWeight(e);
  43210. if (s > 0)
  43211. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43212. l[h].evaluate(a),
  43213. c[h].accumulate(n, s)
  43214. },
  43215. _updateWeight: function(e) {
  43216. var t = 0;
  43217. if (this.enabled) {
  43218. t = this.weight;
  43219. var i = this._weightInterpolant;
  43220. if (null !== i) {
  43221. var n = i.evaluate(e)[0];
  43222. t *= n,
  43223. e > i.parameterPositions[1] && (this.stopFading(),
  43224. 0 === n && (this.enabled = !1))
  43225. }
  43226. }
  43227. return this._effectiveWeight = t,
  43228. t
  43229. },
  43230. _updateTimeScale: function(e) {
  43231. var t = 0;
  43232. if (!this.paused) {
  43233. t = this.timeScale;
  43234. var i = this._timeScaleInterpolant;
  43235. if (null !== i) {
  43236. var n = i.evaluate(e)[0];
  43237. t *= n,
  43238. e > i.parameterPositions[1] && (this.stopWarping(),
  43239. 0 === t ? this.pause = !0 : this.timeScale = t)
  43240. }
  43241. }
  43242. return this._effectiveTimeScale = t,
  43243. t
  43244. },
  43245. _updateTime: function(e) {
  43246. var t = this.time + e;
  43247. if (0 === e)
  43248. return t;
  43249. var i = this._clip.duration
  43250. , r = this.loop
  43251. , o = this._loopCount
  43252. , a = !1;
  43253. switch (r) {
  43254. case n.LoopOnce:
  43255. if (o === -1 && (this.loopCount = 0,
  43256. this._setEndings(!0, !0, !1)),
  43257. t >= i)
  43258. t = i;
  43259. else {
  43260. if (!(t < 0))
  43261. break;
  43262. t = 0
  43263. }
  43264. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43265. this._mixer.dispatchEvent({
  43266. type: "finished",
  43267. action: this,
  43268. direction: e < 0 ? -1 : 1
  43269. });
  43270. break;
  43271. case n.LoopPingPong:
  43272. a = !0;
  43273. case n.LoopRepeat:
  43274. if (o === -1 && (e > 0 ? (o = 0,
  43275. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  43276. t >= i || t < 0) {
  43277. var s = Math.floor(t / i);
  43278. t -= i * s,
  43279. o += Math.abs(s);
  43280. var l = this.repetitions - o;
  43281. if (l < 0) {
  43282. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43283. t = e > 0 ? i : 0,
  43284. this._mixer.dispatchEvent({
  43285. type: "finished",
  43286. action: this,
  43287. direction: e > 0 ? 1 : -1
  43288. });
  43289. break
  43290. }
  43291. if (0 === l) {
  43292. var c = e < 0;
  43293. this._setEndings(c, !c, a)
  43294. } else
  43295. this._setEndings(!1, !1, a);
  43296. this._loopCount = o,
  43297. this._mixer.dispatchEvent({
  43298. type: "loop",
  43299. action: this,
  43300. loopDelta: s
  43301. })
  43302. }
  43303. if (r === n.LoopPingPong && 1 === (1 & o))
  43304. return this.time = t,
  43305. i - t
  43306. }
  43307. return this.time = t,
  43308. t
  43309. },
  43310. _setEndings: function(e, t, i) {
  43311. var r = this._interpolantSettings;
  43312. i ? (r.endingStart = n.ZeroSlopeEnding,
  43313. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  43314. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  43315. },
  43316. _scheduleFading: function(e, t, i) {
  43317. var n = this._mixer
  43318. , r = n.time
  43319. , o = this._weightInterpolant;
  43320. null === o && (o = n._lendControlInterpolant(),
  43321. this._weightInterpolant = o);
  43322. var a = o.parameterPositions
  43323. , s = o.sampleValues;
  43324. return a[0] = r,
  43325. s[0] = t,
  43326. a[1] = r + e,
  43327. s[1] = i,
  43328. this
  43329. }
  43330. },
  43331. Object.assign(n.AnimationMixer.prototype, {
  43332. _bindAction: function(e, t) {
  43333. var i = e._localRoot || this._root
  43334. , r = e._clip.tracks
  43335. , o = r.length
  43336. , a = e._propertyBindings
  43337. , s = e._interpolants
  43338. , l = i.uuid
  43339. , c = this._bindingsByRootAndName
  43340. , h = c[l];
  43341. void 0 === h && (h = {},
  43342. c[l] = h);
  43343. for (var u = 0; u !== o; ++u) {
  43344. var d = r[u]
  43345. , p = d.name
  43346. , f = h[p];
  43347. if (void 0 !== f)
  43348. a[u] = f;
  43349. else {
  43350. if (f = a[u],
  43351. void 0 !== f) {
  43352. null === f._cacheIndex && (++f.referenceCount,
  43353. this._addInactiveBinding(f, l, p));
  43354. continue
  43355. }
  43356. var g = t && t._propertyBindings[u].binding.parsedPath;
  43357. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  43358. ++f.referenceCount,
  43359. this._addInactiveBinding(f, l, p),
  43360. a[u] = f
  43361. }
  43362. s[u].resultBuffer = f.buffer
  43363. }
  43364. },
  43365. _activateAction: function(e) {
  43366. if (!this._isActiveAction(e)) {
  43367. if (null === e._cacheIndex) {
  43368. var t = (e._localRoot || this._root).uuid
  43369. , i = e._clip.name
  43370. , n = this._actionsByClip[i];
  43371. this._bindAction(e, n && n.knownActions[0]),
  43372. this._addInactiveAction(e, i, t)
  43373. }
  43374. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43375. var s = r[o];
  43376. 0 === s.useCount++ && (this._lendBinding(s),
  43377. s.saveOriginalState())
  43378. }
  43379. this._lendAction(e)
  43380. }
  43381. },
  43382. _deactivateAction: function(e) {
  43383. if (this._isActiveAction(e)) {
  43384. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43385. var r = t[i];
  43386. 0 === --r.useCount && (r.restoreOriginalState(),
  43387. this._takeBackBinding(r))
  43388. }
  43389. this._takeBackAction(e)
  43390. }
  43391. },
  43392. _initMemoryManager: function() {
  43393. this._actions = [],
  43394. this._nActiveActions = 0,
  43395. this._actionsByClip = {},
  43396. this._bindings = [],
  43397. this._nActiveBindings = 0,
  43398. this._bindingsByRootAndName = {},
  43399. this._controlInterpolants = [],
  43400. this._nActiveControlInterpolants = 0;
  43401. var e = this;
  43402. this.stats = {
  43403. actions: {
  43404. get total() {
  43405. return e._actions.length
  43406. },
  43407. get inUse() {
  43408. return e._nActiveActions
  43409. }
  43410. },
  43411. bindings: {
  43412. get total() {
  43413. return e._bindings.length
  43414. },
  43415. get inUse() {
  43416. return e._nActiveBindings
  43417. }
  43418. },
  43419. controlInterpolants: {
  43420. get total() {
  43421. return e._controlInterpolants.length
  43422. },
  43423. get inUse() {
  43424. return e._nActiveControlInterpolants
  43425. }
  43426. }
  43427. }
  43428. },
  43429. _isActiveAction: function(e) {
  43430. var t = e._cacheIndex;
  43431. return null !== t && t < this._nActiveActions
  43432. },
  43433. _addInactiveAction: function(e, t, i) {
  43434. var n = this._actions
  43435. , r = this._actionsByClip
  43436. , o = r[t];
  43437. if (void 0 === o)
  43438. o = {
  43439. knownActions: [e],
  43440. actionByRoot: {}
  43441. },
  43442. e._byClipCacheIndex = 0,
  43443. r[t] = o;
  43444. else {
  43445. var a = o.knownActions;
  43446. e._byClipCacheIndex = a.length,
  43447. a.push(e)
  43448. }
  43449. e._cacheIndex = n.length,
  43450. n.push(e),
  43451. o.actionByRoot[i] = e
  43452. },
  43453. _removeInactiveAction: function(e) {
  43454. var t = this._actions
  43455. , i = t[t.length - 1]
  43456. , n = e._cacheIndex;
  43457. i._cacheIndex = n,
  43458. t[n] = i,
  43459. t.pop(),
  43460. e._cacheIndex = null;
  43461. var r = e._clip.name
  43462. , o = this._actionsByClip
  43463. , a = o[r]
  43464. , s = a.knownActions
  43465. , l = s[s.length - 1]
  43466. , c = e._byClipCacheIndex;
  43467. l._byClipCacheIndex = c,
  43468. s[c] = l,
  43469. s.pop(),
  43470. e._byClipCacheIndex = null;
  43471. var h = a.actionByRoot
  43472. , u = (t._localRoot || this._root).uuid;
  43473. delete h[u],
  43474. 0 === s.length && delete o[r],
  43475. this._removeInactiveBindingsForAction(e)
  43476. },
  43477. _removeInactiveBindingsForAction: function(e) {
  43478. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43479. var r = t[i];
  43480. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  43481. }
  43482. },
  43483. _lendAction: function(e) {
  43484. var t = this._actions
  43485. , i = e._cacheIndex
  43486. , n = this._nActiveActions++
  43487. , r = t[n];
  43488. e._cacheIndex = n,
  43489. t[n] = e,
  43490. r._cacheIndex = i,
  43491. t[i] = r
  43492. },
  43493. _takeBackAction: function(e) {
  43494. var t = this._actions
  43495. , i = e._cacheIndex
  43496. , n = --this._nActiveActions
  43497. , r = t[n];
  43498. e._cacheIndex = n,
  43499. t[n] = e,
  43500. r._cacheIndex = i,
  43501. t[i] = r
  43502. },
  43503. _addInactiveBinding: function(e, t, i) {
  43504. var n = this._bindingsByRootAndName
  43505. , r = n[t]
  43506. , o = this._bindings;
  43507. void 0 === r && (r = {},
  43508. n[t] = r),
  43509. r[i] = e,
  43510. e._cacheIndex = o.length,
  43511. o.push(e)
  43512. },
  43513. _removeInactiveBinding: function(e) {
  43514. var t = this._bindings
  43515. , i = e.binding
  43516. , n = i.rootNode.uuid
  43517. , r = i.path
  43518. , o = this._bindingsByRootAndName
  43519. , a = o[n]
  43520. , s = t[t.length - 1]
  43521. , l = e._cacheIndex;
  43522. s._cacheIndex = l,
  43523. t[l] = s,
  43524. t.pop(),
  43525. delete a[r];
  43526. e: {
  43527. for (var c in a)
  43528. break e;
  43529. delete o[n]
  43530. }
  43531. },
  43532. _lendBinding: function(e) {
  43533. var t = this._bindings
  43534. , i = e._cacheIndex
  43535. , n = this._nActiveBindings++
  43536. , r = t[n];
  43537. e._cacheIndex = n,
  43538. t[n] = e,
  43539. r._cacheIndex = i,
  43540. t[i] = r
  43541. },
  43542. _takeBackBinding: function(e) {
  43543. var t = this._bindings
  43544. , i = e._cacheIndex
  43545. , n = --this._nActiveBindings
  43546. , r = t[n];
  43547. e._cacheIndex = n,
  43548. t[n] = e,
  43549. r._cacheIndex = i,
  43550. t[i] = r
  43551. },
  43552. _lendControlInterpolant: function() {
  43553. var e = this._controlInterpolants
  43554. , t = this._nActiveControlInterpolants++
  43555. , i = e[t];
  43556. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  43557. i.__cacheIndex = t,
  43558. e[t] = i),
  43559. i
  43560. },
  43561. _takeBackControlInterpolant: function(e) {
  43562. var t = this._controlInterpolants
  43563. , i = e.__cacheIndex
  43564. , n = --this._nActiveControlInterpolants
  43565. , r = t[n];
  43566. e.__cacheIndex = n,
  43567. t[n] = e,
  43568. r.__cacheIndex = i,
  43569. t[i] = r
  43570. },
  43571. _controlInterpolantsResultBuffer: new Float32Array(1)
  43572. }),
  43573. n.AnimationObjectGroup = function(e) {
  43574. this.uuid = n.Math.generateUUID(),
  43575. this._objects = Array.prototype.slice.call(arguments),
  43576. this.nCachedObjects_ = 0;
  43577. var t = {};
  43578. this._indicesByUUID = t;
  43579. for (var i = 0, r = arguments.length; i !== r; ++i)
  43580. t[arguments[i].uuid] = i;
  43581. this._paths = [],
  43582. this._parsedPaths = [],
  43583. this._bindings = [],
  43584. this._bindingsIndicesByPath = {};
  43585. var o = this;
  43586. this.stats = {
  43587. objects: {
  43588. get total() {
  43589. return o._objects.length
  43590. },
  43591. get inUse() {
  43592. return this.total - o.nCachedObjects_
  43593. }
  43594. },
  43595. get bindingsPerObject() {
  43596. return o._bindings.length
  43597. }
  43598. }
  43599. }
  43600. ,
  43601. n.AnimationObjectGroup.prototype = {
  43602. constructor: n.AnimationObjectGroup,
  43603. add: function(e) {
  43604. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  43605. var d = arguments[h]
  43606. , p = d.uuid
  43607. , f = o[p];
  43608. if (void 0 === f) {
  43609. f = i++,
  43610. o[p] = f,
  43611. t.push(d);
  43612. for (var g = 0, m = c; g !== m; ++g)
  43613. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  43614. } else if (f < r) {
  43615. var v = t[f]
  43616. , A = --r
  43617. , y = t[A];
  43618. o[y.uuid] = f,
  43619. t[f] = y,
  43620. o[p] = A,
  43621. t[A] = d;
  43622. for (var g = 0, m = c; g !== m; ++g) {
  43623. var C = l[g]
  43624. , I = C[A]
  43625. , E = C[f];
  43626. C[f] = I,
  43627. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  43628. C[A] = E
  43629. }
  43630. } else
  43631. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43632. }
  43633. this.nCachedObjects_ = r
  43634. },
  43635. remove: function(e) {
  43636. for (var t = this._objects, i = (t.length,
  43637. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43638. var l = arguments[a]
  43639. , c = l.uuid
  43640. , h = n[c];
  43641. if (void 0 !== h && h >= i) {
  43642. var u = i++
  43643. , d = t[u];
  43644. n[d.uuid] = h,
  43645. t[h] = d,
  43646. n[c] = u,
  43647. t[u] = l;
  43648. for (var p = 0, f = o; p !== f; ++p) {
  43649. var g = r[p]
  43650. , m = g[u]
  43651. , v = g[h];
  43652. g[h] = m,
  43653. g[u] = v
  43654. }
  43655. }
  43656. }
  43657. this.nCachedObjects_ = i
  43658. },
  43659. uncache: function(e) {
  43660. 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) {
  43661. var c = arguments[s]
  43662. , h = c.uuid
  43663. , u = r[h];
  43664. if (void 0 !== u)
  43665. if (delete r[h],
  43666. u < n) {
  43667. var d = --n
  43668. , p = t[d]
  43669. , f = --i
  43670. , g = t[f];
  43671. r[p.uuid] = u,
  43672. t[u] = p,
  43673. r[g.uuid] = d,
  43674. t[d] = g,
  43675. t.pop();
  43676. for (var m = 0, v = a; m !== v; ++m) {
  43677. var A = o[m]
  43678. , y = A[d]
  43679. , C = A[f];
  43680. A[u] = y,
  43681. A[d] = C,
  43682. A.pop()
  43683. }
  43684. } else {
  43685. var f = --i
  43686. , g = t[f];
  43687. r[g.uuid] = u,
  43688. t[u] = g,
  43689. t.pop();
  43690. for (var m = 0, v = a; m !== v; ++m) {
  43691. var A = o[m];
  43692. A[u] = A[f],
  43693. A.pop()
  43694. }
  43695. }
  43696. }
  43697. this.nCachedObjects_ = n
  43698. },
  43699. subscribe_: function(e, t) {
  43700. var i = this._bindingsIndicesByPath
  43701. , r = i[e]
  43702. , o = this._bindings;
  43703. if (void 0 !== r)
  43704. return o[r];
  43705. var a = this._paths
  43706. , s = this._parsedPaths
  43707. , l = this._objects
  43708. , c = l.length
  43709. , h = this.nCachedObjects_
  43710. , u = new Array(c);
  43711. r = o.length,
  43712. i[e] = r,
  43713. a.push(e),
  43714. s.push(t),
  43715. o.push(u);
  43716. for (var d = h, p = l.length; d !== p; ++d) {
  43717. var f = l[d];
  43718. u[d] = new n.PropertyBinding(f,e,t)
  43719. }
  43720. return u
  43721. },
  43722. unsubscribe_: function(e) {
  43723. var t = this._bindingsIndicesByPath
  43724. , i = t[e];
  43725. if (void 0 !== i) {
  43726. var n = this._paths
  43727. , r = this._parsedPaths
  43728. , o = this._bindings
  43729. , a = o.length - 1
  43730. , s = o[a]
  43731. , l = e[a];
  43732. t[l] = i,
  43733. o[i] = s,
  43734. o.pop(),
  43735. r[i] = r[a],
  43736. r.pop(),
  43737. n[i] = n[a],
  43738. n.pop()
  43739. }
  43740. }
  43741. },
  43742. n.AnimationUtils = {
  43743. arraySlice: function(e, t, i) {
  43744. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43745. },
  43746. convertArray: function(e, t, i) {
  43747. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43748. },
  43749. isTypedArray: function(e) {
  43750. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43751. },
  43752. getKeyframeOrder: function(e) {
  43753. function t(t, i) {
  43754. return e[t] - e[i]
  43755. }
  43756. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  43757. n[r] = r;
  43758. return n.sort(t),
  43759. n
  43760. },
  43761. sortedArray: function(e, t, i) {
  43762. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43763. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43764. r[a++] = e[s + l];
  43765. return r
  43766. },
  43767. flattenJSON: function(e, t, i, n) {
  43768. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43769. o = e[r++];
  43770. if (void 0 !== o) {
  43771. var a = o[n];
  43772. if (void 0 !== a)
  43773. if (Array.isArray(a)) {
  43774. do
  43775. a = o[n],
  43776. void 0 !== a && (t.push(o.time),
  43777. i.push.apply(i, a)),
  43778. o = e[r++];
  43779. while (void 0 !== o)
  43780. } else if (void 0 !== a.toArray) {
  43781. do
  43782. a = o[n],
  43783. void 0 !== a && (t.push(o.time),
  43784. a.toArray(i, i.length)),
  43785. o = e[r++];
  43786. while (void 0 !== o)
  43787. } else
  43788. do
  43789. a = o[n],
  43790. void 0 !== a && (t.push(o.time),
  43791. i.push(a)),
  43792. o = e[r++];
  43793. while (void 0 !== o)
  43794. }
  43795. }
  43796. },
  43797. n.KeyframeTrack = function(e, t, i, r) {
  43798. if (void 0 === e)
  43799. throw new Error("track name is undefined");
  43800. if (void 0 === t || 0 === t.length)
  43801. throw new Error("no keyframes in track named " + e);
  43802. this.name = e,
  43803. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  43804. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  43805. this.setInterpolation(r || this.DefaultInterpolation),
  43806. this.validate(),
  43807. this.optimize()
  43808. }
  43809. ,
  43810. n.KeyframeTrack.prototype = {
  43811. constructor: n.KeyframeTrack,
  43812. TimeBufferType: Float32Array,
  43813. ValueBufferType: Float32Array,
  43814. DefaultInterpolation: n.InterpolateLinear,
  43815. InterpolantFactoryMethodDiscrete: function(e) {
  43816. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43817. },
  43818. InterpolantFactoryMethodLinear: function(e) {
  43819. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43820. },
  43821. InterpolantFactoryMethodSmooth: function(e) {
  43822. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43823. },
  43824. setInterpolation: function(e) {
  43825. var t = void 0;
  43826. switch (e) {
  43827. case n.InterpolateDiscrete:
  43828. t = this.InterpolantFactoryMethodDiscrete;
  43829. break;
  43830. case n.InterpolateLinear:
  43831. t = this.InterpolantFactoryMethodLinear;
  43832. break;
  43833. case n.InterpolateSmooth:
  43834. t = this.InterpolantFactoryMethodSmooth
  43835. }
  43836. if (void 0 === t) {
  43837. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43838. if (void 0 === this.createInterpolant) {
  43839. if (e === this.DefaultInterpolation)
  43840. throw new Error(i);
  43841. this.setInterpolation(this.DefaultInterpolation)
  43842. }
  43843. return void console.warn(i)
  43844. }
  43845. this.createInterpolant = t
  43846. },
  43847. getInterpolation: function() {
  43848. switch (this.createInterpolant) {
  43849. case this.InterpolantFactoryMethodDiscrete:
  43850. return n.InterpolateDiscrete;
  43851. case this.InterpolantFactoryMethodLinear:
  43852. return n.InterpolateLinear;
  43853. case this.InterpolantFactoryMethodSmooth:
  43854. return n.InterpolateSmooth
  43855. }
  43856. },
  43857. getValueSize: function() {
  43858. return this.values.length / this.times.length
  43859. },
  43860. shift: function(e) {
  43861. if (0 !== e)
  43862. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43863. t[i] += e;
  43864. return this
  43865. },
  43866. scale: function(e) {
  43867. if (1 !== e)
  43868. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43869. t[i] *= e;
  43870. return this
  43871. },
  43872. trim: function(e, t) {
  43873. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  43874. ++o;
  43875. for (; a !== -1 && i[a] > t; )
  43876. --a;
  43877. if (++a,
  43878. 0 !== o || a !== r) {
  43879. o >= a && (a = Math.max(a, 1),
  43880. o = a - 1);
  43881. var s = this.getValueSize();
  43882. this.times = n.AnimationUtils.arraySlice(i, o, a),
  43883. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  43884. }
  43885. return this
  43886. },
  43887. validate: function() {
  43888. var e = !0
  43889. , t = this.getValueSize();
  43890. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  43891. e = !1);
  43892. var i = this.times
  43893. , r = this.values
  43894. , o = i.length;
  43895. 0 === o && (console.error("track is empty", this),
  43896. e = !1);
  43897. for (var a = null, s = 0; s !== o; s++) {
  43898. var l = i[s];
  43899. if ("number" == typeof l && isNaN(l)) {
  43900. console.error("time is not a valid number", this, s, l),
  43901. e = !1;
  43902. break
  43903. }
  43904. if (null !== a && a > l) {
  43905. console.error("out of order keys", this, s, l, a),
  43906. e = !1;
  43907. break
  43908. }
  43909. a = l
  43910. }
  43911. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  43912. for (var s = 0, c = r.length; s !== c; ++s) {
  43913. var h = r[s];
  43914. if (isNaN(h)) {
  43915. console.error("value is not a valid number", this, s, h),
  43916. e = !1;
  43917. break
  43918. }
  43919. }
  43920. return e
  43921. },
  43922. optimize: function() {
  43923. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  43924. var s = !1
  43925. , l = e[o]
  43926. , c = e[o + 1];
  43927. if (l !== c && (1 !== o || l !== l[0]))
  43928. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  43929. var f = t[h + p];
  43930. if (f !== t[u + p] || f !== t[d + p]) {
  43931. s = !0;
  43932. break
  43933. }
  43934. }
  43935. if (s) {
  43936. if (o !== r) {
  43937. e[r] = e[o];
  43938. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  43939. t[m + p] = t[g + p]
  43940. }
  43941. ++r
  43942. }
  43943. }
  43944. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  43945. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  43946. this
  43947. }
  43948. },
  43949. Object.assign(n.KeyframeTrack, {
  43950. parse: function(e) {
  43951. if (void 0 === e.type)
  43952. throw new Error("track type undefined, can not parse");
  43953. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43954. if (void 0 === e.times) {
  43955. console.warn("legacy JSON format detected, converting");
  43956. var i = []
  43957. , r = [];
  43958. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  43959. e.times = i,
  43960. e.values = r
  43961. }
  43962. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43963. },
  43964. toJSON: function(e) {
  43965. var t, i = e.constructor;
  43966. if (void 0 !== i.toJSON)
  43967. t = i.toJSON(e);
  43968. else {
  43969. t = {
  43970. name: e.name,
  43971. times: n.AnimationUtils.convertArray(e.times, Array),
  43972. values: n.AnimationUtils.convertArray(e.values, Array)
  43973. };
  43974. var r = e.getInterpolation();
  43975. r !== e.DefaultInterpolation && (t.interpolation = r)
  43976. }
  43977. return t.type = e.ValueTypeName,
  43978. t
  43979. },
  43980. _getTrackTypeForValueTypeName: function(e) {
  43981. switch (e.toLowerCase()) {
  43982. case "scalar":
  43983. case "double":
  43984. case "float":
  43985. case "number":
  43986. case "integer":
  43987. return n.NumberKeyframeTrack;
  43988. case "vector":
  43989. case "vector2":
  43990. case "vector3":
  43991. case "vector4":
  43992. return n.VectorKeyframeTrack;
  43993. case "color":
  43994. return n.ColorKeyframeTrack;
  43995. case "quaternion":
  43996. return n.QuaternionKeyframeTrack;
  43997. case "bool":
  43998. case "boolean":
  43999. return n.BooleanKeyframeTrack;
  44000. case "string":
  44001. return n.StringKeyframeTrack
  44002. }
  44003. throw new Error("Unsupported typeName: " + e)
  44004. }
  44005. }),
  44006. n.PropertyBinding = function(e, t, i) {
  44007. this.path = t,
  44008. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  44009. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44010. this.rootNode = e
  44011. }
  44012. ,
  44013. n.PropertyBinding.prototype = {
  44014. constructor: n.PropertyBinding,
  44015. getValue: function(e, t) {
  44016. this.bind(),
  44017. this.getValue(e, t)
  44018. },
  44019. setValue: function(e, t) {
  44020. this.bind(),
  44021. this.setValue(e, t)
  44022. },
  44023. bind: function() {
  44024. var e = this.node
  44025. , t = this.parsedPath
  44026. , i = t.objectName
  44027. , r = t.propertyName
  44028. , o = t.propertyIndex;
  44029. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44030. this.node = e),
  44031. this.getValue = this._getValue_unavailable,
  44032. this.setValue = this._setValue_unavailable,
  44033. !e)
  44034. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  44035. if (i) {
  44036. var a = t.objectIndex;
  44037. switch (i) {
  44038. case "materials":
  44039. if (!e.material)
  44040. return void console.error(" can not bind to material as node does not have a material", this);
  44041. if (!e.material.materials)
  44042. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44043. e = e.material.materials;
  44044. break;
  44045. case "bones":
  44046. if (!e.skeleton)
  44047. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44048. e = e.skeleton.bones;
  44049. for (var s = 0; s < e.length; s++)
  44050. if (e[s].name === a) {
  44051. a = s;
  44052. break
  44053. }
  44054. break;
  44055. default:
  44056. if (void 0 === e[i])
  44057. return void console.error(" can not bind to objectName of node, undefined", this);
  44058. e = e[i]
  44059. }
  44060. if (void 0 !== a) {
  44061. if (void 0 === e[a])
  44062. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44063. e = e[a]
  44064. }
  44065. }
  44066. var l = e[r];
  44067. if (!l) {
  44068. var c = t.nodeName;
  44069. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  44070. }
  44071. var h = this.Versioning.None;
  44072. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  44073. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  44074. this.targetObject = e);
  44075. var u = this.BindingType.Direct;
  44076. if (void 0 !== o) {
  44077. if ("morphTargetInfluences" === r) {
  44078. if (!e.geometry)
  44079. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44080. if (!e.geometry.morphTargets)
  44081. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44082. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  44083. if (e.geometry.morphTargets[s].name === o) {
  44084. o = s;
  44085. break
  44086. }
  44087. }
  44088. u = this.BindingType.ArrayElement,
  44089. this.resolvedProperty = l,
  44090. this.propertyIndex = o
  44091. } else
  44092. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  44093. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  44094. this.resolvedProperty = l) : this.propertyName = r;
  44095. this.getValue = this.GetterByBindingType[u],
  44096. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  44097. },
  44098. unbind: function() {
  44099. this.node = null,
  44100. this.getValue = this._getValue_unbound,
  44101. this.setValue = this._setValue_unbound
  44102. }
  44103. },
  44104. Object.assign(n.PropertyBinding.prototype, {
  44105. _getValue_unavailable: function() {},
  44106. _setValue_unavailable: function() {},
  44107. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  44108. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  44109. BindingType: {
  44110. Direct: 0,
  44111. EntireArray: 1,
  44112. ArrayElement: 2,
  44113. HasFromToArray: 3
  44114. },
  44115. Versioning: {
  44116. None: 0,
  44117. NeedsUpdate: 1,
  44118. MatrixWorldNeedsUpdate: 2
  44119. },
  44120. GetterByBindingType: [function(e, t) {
  44121. e[t] = this.node[this.propertyName]
  44122. }
  44123. , function(e, t) {
  44124. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44125. e[t++] = i[n]
  44126. }
  44127. , function(e, t) {
  44128. e[t] = this.resolvedProperty[this.propertyIndex]
  44129. }
  44130. , function(e, t) {
  44131. this.resolvedProperty.toArray(e, t)
  44132. }
  44133. ],
  44134. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44135. this.node[this.propertyName] = e[t]
  44136. }
  44137. , function(e, t) {
  44138. this.node[this.propertyName] = e[t],
  44139. this.targetObject.needsUpdate = !0
  44140. }
  44141. , function(e, t) {
  44142. this.node[this.propertyName] = e[t],
  44143. this.targetObject.matrixWorldNeedsUpdate = !0
  44144. }
  44145. ], [function(e, t) {
  44146. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44147. i[n] = e[t++]
  44148. }
  44149. , function(e, t) {
  44150. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44151. i[n] = e[t++];
  44152. this.targetObject.needsUpdate = !0
  44153. }
  44154. , function(e, t) {
  44155. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44156. i[n] = e[t++];
  44157. this.targetObject.matrixWorldNeedsUpdate = !0
  44158. }
  44159. ], [function(e, t) {
  44160. this.resolvedProperty[this.propertyIndex] = e[t]
  44161. }
  44162. , function(e, t) {
  44163. this.resolvedProperty[this.propertyIndex] = e[t],
  44164. this.targetObject.needsUpdate = !0
  44165. }
  44166. , function(e, t) {
  44167. this.resolvedProperty[this.propertyIndex] = e[t],
  44168. this.targetObject.matrixWorldNeedsUpdate = !0
  44169. }
  44170. ], [function(e, t) {
  44171. this.resolvedProperty.fromArray(e, t)
  44172. }
  44173. , function(e, t) {
  44174. this.resolvedProperty.fromArray(e, t),
  44175. this.targetObject.needsUpdate = !0
  44176. }
  44177. , function(e, t) {
  44178. this.resolvedProperty.fromArray(e, t),
  44179. this.targetObject.matrixWorldNeedsUpdate = !0
  44180. }
  44181. ]]
  44182. }),
  44183. n.PropertyBinding.Composite = function(e, t, i) {
  44184. var r = i || n.PropertyBinding.parseTrackName(t);
  44185. this._targetGroup = e,
  44186. this._bindings = e.subscribe_(t, r)
  44187. }
  44188. ,
  44189. n.PropertyBinding.Composite.prototype = {
  44190. constructor: n.PropertyBinding.Composite,
  44191. getValue: function(e, t) {
  44192. this.bind();
  44193. var i = this._targetGroup.nCachedObjects_
  44194. , n = this._bindings[i];
  44195. void 0 !== n && n.getValue(e, t)
  44196. },
  44197. setValue: function(e, t) {
  44198. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44199. i[n].setValue(e, t)
  44200. },
  44201. bind: function() {
  44202. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44203. e[t].bind()
  44204. },
  44205. unbind: function() {
  44206. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44207. e[t].unbind()
  44208. }
  44209. },
  44210. n.PropertyBinding.create = function(e, t, i) {
  44211. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  44212. }
  44213. ,
  44214. n.PropertyBinding.parseTrackName = function(e) {
  44215. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44216. , i = t.exec(e);
  44217. if (!i)
  44218. throw new Error("cannot parse trackName at all: " + e);
  44219. i.index === t.lastIndex && t.lastIndex++;
  44220. var n = {
  44221. nodeName: i[3],
  44222. objectName: i[5],
  44223. objectIndex: i[7],
  44224. propertyName: i[9],
  44225. propertyIndex: i[11]
  44226. };
  44227. if (null === n.propertyName || 0 === n.propertyName.length)
  44228. throw new Error("can not parse propertyName from trackName: " + e);
  44229. return n
  44230. }
  44231. ,
  44232. n.PropertyBinding.findNode = function(e, t) {
  44233. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  44234. return e;
  44235. if (e.skeleton) {
  44236. var i = function(e) {
  44237. for (var i = 0; i < e.bones.length; i++) {
  44238. var n = e.bones[i];
  44239. if (n.name === t)
  44240. return n
  44241. }
  44242. return null
  44243. }
  44244. , n = i(e.skeleton);
  44245. if (n)
  44246. return n
  44247. }
  44248. if (e.children) {
  44249. var r = function(e) {
  44250. for (var i = 0; i < e.length; i++) {
  44251. var n = e[i];
  44252. if (n.name === t || n.uuid === t)
  44253. return n;
  44254. var o = r(n.children);
  44255. if (o)
  44256. return o
  44257. }
  44258. return null
  44259. }
  44260. , o = r(e.children);
  44261. if (o)
  44262. return o
  44263. }
  44264. return null
  44265. }
  44266. ,
  44267. n.PropertyMixer = function(e, t, i) {
  44268. this.binding = e,
  44269. this.valueSize = i;
  44270. var n, r = Float64Array;
  44271. switch (t) {
  44272. case "quaternion":
  44273. n = this._slerp;
  44274. break;
  44275. case "string":
  44276. case "bool":
  44277. r = Array,
  44278. n = this._select;
  44279. break;
  44280. default:
  44281. n = this._lerp
  44282. }
  44283. this.buffer = new r(4 * i),
  44284. this._mixBufferRegion = n,
  44285. this.cumulativeWeight = 0,
  44286. this.useCount = 0,
  44287. this.referenceCount = 0
  44288. }
  44289. ,
  44290. n.PropertyMixer.prototype = {
  44291. constructor: n.PropertyMixer,
  44292. accumulate: function(e, t) {
  44293. var i = this.buffer
  44294. , n = this.valueSize
  44295. , r = e * n + n
  44296. , o = this.cumulativeWeight;
  44297. if (0 === o) {
  44298. for (var a = 0; a !== n; ++a)
  44299. i[r + a] = i[a];
  44300. o = t
  44301. } else {
  44302. o += t;
  44303. var s = t / o;
  44304. this._mixBufferRegion(i, r, 0, s, n)
  44305. }
  44306. this.cumulativeWeight = o
  44307. },
  44308. apply: function(e) {
  44309. var t = this.valueSize
  44310. , i = this.buffer
  44311. , n = e * t + t
  44312. , r = this.cumulativeWeight
  44313. , o = this.binding;
  44314. if (this.cumulativeWeight = 0,
  44315. r < 1) {
  44316. var a = 3 * t;
  44317. this._mixBufferRegion(i, n, a, 1 - r, t)
  44318. }
  44319. for (var s = t, l = t + t; s !== l; ++s)
  44320. if (i[s] !== i[s + t]) {
  44321. o.setValue(i, n);
  44322. break
  44323. }
  44324. },
  44325. saveOriginalState: function() {
  44326. var e = this.binding
  44327. , t = this.buffer
  44328. , i = this.valueSize
  44329. , n = 3 * i;
  44330. e.getValue(t, n);
  44331. for (var r = i, o = n; r !== o; ++r)
  44332. t[r] = t[n + r % i];
  44333. this.cumulativeWeight = 0
  44334. },
  44335. restoreOriginalState: function() {
  44336. var e = 3 * this.valueSize;
  44337. this.binding.setValue(this.buffer, e)
  44338. },
  44339. _select: function(e, t, i, n, r) {
  44340. if (n >= .5)
  44341. for (var o = 0; o !== r; ++o)
  44342. e[t + o] = e[i + o]
  44343. },
  44344. _slerp: function(e, t, i, r, o) {
  44345. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  44346. },
  44347. _lerp: function(e, t, i, n, r) {
  44348. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44349. var s = t + a;
  44350. e[s] = e[s] * o + e[i + a] * n
  44351. }
  44352. }
  44353. },
  44354. n.BooleanKeyframeTrack = function(e, t, i) {
  44355. n.KeyframeTrack.call(this, e, t, i)
  44356. }
  44357. ,
  44358. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44359. constructor: n.BooleanKeyframeTrack,
  44360. ValueTypeName: "bool",
  44361. ValueBufferType: Array,
  44362. DefaultInterpolation: n.IntepolateDiscrete,
  44363. InterpolantFactoryMethodLinear: void 0,
  44364. InterpolantFactoryMethodSmooth: void 0
  44365. }),
  44366. n.NumberKeyframeTrack = function(e, t, i, r) {
  44367. n.KeyframeTrack.call(this, e, t, i, r)
  44368. }
  44369. ,
  44370. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44371. constructor: n.NumberKeyframeTrack,
  44372. ValueTypeName: "number"
  44373. }),
  44374. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  44375. n.KeyframeTrack.call(this, e, t, i, r)
  44376. }
  44377. ,
  44378. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44379. constructor: n.QuaternionKeyframeTrack,
  44380. ValueTypeName: "quaternion",
  44381. DefaultInterpolation: n.InterpolateLinear,
  44382. InterpolantFactoryMethodLinear: function(e) {
  44383. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44384. },
  44385. InterpolantFactoryMethodSmooth: void 0
  44386. }),
  44387. n.StringKeyframeTrack = function(e, t, i, r) {
  44388. n.KeyframeTrack.call(this, e, t, i, r)
  44389. }
  44390. ,
  44391. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44392. constructor: n.StringKeyframeTrack,
  44393. ValueTypeName: "string",
  44394. ValueBufferType: Array,
  44395. DefaultInterpolation: n.IntepolateDiscrete,
  44396. InterpolantFactoryMethodLinear: void 0,
  44397. InterpolantFactoryMethodSmooth: void 0
  44398. }),
  44399. n.VectorKeyframeTrack = function(e, t, i, r) {
  44400. n.KeyframeTrack.call(this, e, t, i, r)
  44401. }
  44402. ,
  44403. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44404. constructor: n.VectorKeyframeTrack,
  44405. ValueTypeName: "vector"
  44406. }),
  44407. n.Audio = function(e) {
  44408. n.Object3D.call(this),
  44409. this.type = "Audio",
  44410. this.context = e.context,
  44411. this.source = this.context.createBufferSource(),
  44412. this.source.onended = this.onEnded.bind(this),
  44413. this.gain = this.context.createGain(),
  44414. this.gain.connect(e.getInput()),
  44415. this.autoplay = !1,
  44416. this.startTime = 0,
  44417. this.playbackRate = 1,
  44418. this.isPlaying = !1,
  44419. this.hasPlaybackControl = !0,
  44420. this.sourceType = "empty",
  44421. this.filter = null
  44422. }
  44423. ,
  44424. n.Audio.prototype = Object.create(n.Object3D.prototype),
  44425. n.Audio.prototype.constructor = n.Audio,
  44426. n.Audio.prototype.getOutput = function() {
  44427. return this.gain
  44428. }
  44429. ,
  44430. n.Audio.prototype.load = function(e) {
  44431. var t = new n.AudioBuffer(this.context);
  44432. return t.load(e),
  44433. this.setBuffer(t),
  44434. this
  44435. }
  44436. ,
  44437. n.Audio.prototype.setNodeSource = function(e) {
  44438. return this.hasPlaybackControl = !1,
  44439. this.sourceType = "audioNode",
  44440. this.source = e,
  44441. this.connect(),
  44442. this
  44443. }
  44444. ,
  44445. n.Audio.prototype.setBuffer = function(e) {
  44446. var t = this;
  44447. return e.onReady(function(e) {
  44448. t.source.buffer = e,
  44449. t.sourceType = "buffer",
  44450. t.autoplay && t.play()
  44451. }),
  44452. this
  44453. }
  44454. ,
  44455. n.Audio.prototype.play = function() {
  44456. if (this.isPlaying === !0)
  44457. return void console.warn("THREE.Audio: Audio is already playing.");
  44458. if (this.hasPlaybackControl === !1)
  44459. return void console.warn("THREE.Audio: this Audio has no playback control.");
  44460. var e = this.context.createBufferSource();
  44461. e.buffer = this.source.buffer,
  44462. e.loop = this.source.loop,
  44463. e.onended = this.source.onended,
  44464. e.start(0, this.startTime),
  44465. e.playbackRate.value = this.playbackRate,
  44466. this.isPlaying = !0,
  44467. this.source = e,
  44468. this.connect()
  44469. }
  44470. ,
  44471. n.Audio.prototype.pause = function() {
  44472. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44473. void (this.startTime = this.context.currentTime))
  44474. }
  44475. ,
  44476. n.Audio.prototype.stop = function() {
  44477. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44478. void (this.startTime = 0))
  44479. }
  44480. ,
  44481. n.Audio.prototype.connect = function() {
  44482. null !== this.filter ? (this.source.connect(this.filter),
  44483. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44484. }
  44485. ,
  44486. n.Audio.prototype.disconnect = function() {
  44487. null !== this.filter ? (this.source.disconnect(this.filter),
  44488. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44489. }
  44490. ,
  44491. n.Audio.prototype.getFilter = function() {
  44492. return this.filter
  44493. }
  44494. ,
  44495. n.Audio.prototype.setFilter = function(e) {
  44496. void 0 === e && (e = null),
  44497. this.isPlaying === !0 ? (this.disconnect(),
  44498. this.filter = e,
  44499. this.connect()) : this.filter = e
  44500. }
  44501. ,
  44502. n.Audio.prototype.setPlaybackRate = function(e) {
  44503. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44504. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  44505. }
  44506. ,
  44507. n.Audio.prototype.getPlaybackRate = function() {
  44508. return this.playbackRate
  44509. }
  44510. ,
  44511. n.Audio.prototype.onEnded = function() {
  44512. this.isPlaying = !1
  44513. }
  44514. ,
  44515. n.Audio.prototype.setLoop = function(e) {
  44516. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44517. }
  44518. ,
  44519. n.Audio.prototype.getLoop = function() {
  44520. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44521. !1) : this.source.loop
  44522. }
  44523. ,
  44524. n.Audio.prototype.setVolume = function(e) {
  44525. this.gain.gain.value = e
  44526. }
  44527. ,
  44528. n.Audio.prototype.getVolume = function() {
  44529. return this.gain.gain.value
  44530. }
  44531. ,
  44532. n.AudioAnalyser = function(e, t) {
  44533. this.analyser = e.context.createAnalyser(),
  44534. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44535. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44536. e.getOutput().connect(this.analyser)
  44537. }
  44538. ,
  44539. n.AudioAnalyser.prototype = {
  44540. constructor: n.AudioAnalyser,
  44541. getData: function() {
  44542. return this.analyser.getByteFrequencyData(this.data),
  44543. this.data
  44544. }
  44545. },
  44546. n.AudioBuffer = function(e) {
  44547. this.context = e,
  44548. this.ready = !1,
  44549. this.readyCallbacks = []
  44550. }
  44551. ,
  44552. n.AudioBuffer.prototype.load = function(e) {
  44553. var t = this
  44554. , i = new XMLHttpRequest;
  44555. return i.open("GET", e, !0),
  44556. i.responseType = "arraybuffer",
  44557. i.onload = function(e) {
  44558. t.context.decodeAudioData(this.response, function(e) {
  44559. t.buffer = e,
  44560. t.ready = !0;
  44561. for (var i = 0; i < t.readyCallbacks.length; i++)
  44562. t.readyCallbacks[i](t.buffer);
  44563. t.readyCallbacks = []
  44564. })
  44565. }
  44566. ,
  44567. i.send(),
  44568. this
  44569. }
  44570. ,
  44571. n.AudioBuffer.prototype.onReady = function(e) {
  44572. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44573. }
  44574. ,
  44575. n.PositionalAudio = function(e) {
  44576. n.Audio.call(this, e),
  44577. this.panner = this.context.createPanner(),
  44578. this.panner.connect(this.gain)
  44579. }
  44580. ,
  44581. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  44582. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  44583. n.PositionalAudio.prototype.getOutput = function() {
  44584. return this.panner
  44585. }
  44586. ,
  44587. n.PositionalAudio.prototype.setRefDistance = function(e) {
  44588. this.panner.refDistance = e
  44589. }
  44590. ,
  44591. n.PositionalAudio.prototype.getRefDistance = function() {
  44592. return this.panner.refDistance
  44593. }
  44594. ,
  44595. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44596. this.panner.rolloffFactor = e
  44597. }
  44598. ,
  44599. n.PositionalAudio.prototype.getRolloffFactor = function() {
  44600. return this.panner.rolloffFactor
  44601. }
  44602. ,
  44603. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  44604. this.panner.distanceModel = e
  44605. }
  44606. ,
  44607. n.PositionalAudio.prototype.getDistanceModel = function() {
  44608. return this.panner.distanceModel
  44609. }
  44610. ,
  44611. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  44612. this.panner.maxDistance = e
  44613. }
  44614. ,
  44615. n.PositionalAudio.prototype.getMaxDistance = function() {
  44616. return this.panner.maxDistance
  44617. }
  44618. ,
  44619. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  44620. var e = new n.Vector3;
  44621. return function(t) {
  44622. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  44623. e.setFromMatrixPosition(this.matrixWorld),
  44624. this.panner.setPosition(e.x, e.y, e.z)
  44625. }
  44626. }(),
  44627. n.AudioListener = function() {
  44628. n.Object3D.call(this),
  44629. this.type = "AudioListener",
  44630. this.context = new (window.AudioContext || window.webkitAudioContext),
  44631. this.gain = this.context.createGain(),
  44632. this.gain.connect(this.context.destination),
  44633. this.filter = null
  44634. }
  44635. ,
  44636. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  44637. n.AudioListener.prototype.constructor = n.AudioListener,
  44638. n.AudioListener.prototype.getInput = function() {
  44639. return this.gain
  44640. }
  44641. ,
  44642. n.AudioListener.prototype.removeFilter = function() {
  44643. null !== this.filter && (this.gain.disconnect(this.filter),
  44644. this.filter.disconnect(this.context.destination),
  44645. this.gain.connect(this.context.destination),
  44646. this.filter = null)
  44647. }
  44648. ,
  44649. n.AudioListener.prototype.setFilter = function(e) {
  44650. null !== this.filter ? (this.gain.disconnect(this.filter),
  44651. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44652. this.filter = e,
  44653. this.gain.connect(this.filter),
  44654. this.filter.connect(this.context.destination)
  44655. }
  44656. ,
  44657. n.AudioListener.prototype.getFilter = function() {
  44658. return this.filter
  44659. }
  44660. ,
  44661. n.AudioListener.prototype.setMasterVolume = function(e) {
  44662. this.gain.gain.value = e
  44663. }
  44664. ,
  44665. n.AudioListener.prototype.getMasterVolume = function() {
  44666. return this.gain.gain.value
  44667. }
  44668. ,
  44669. n.AudioListener.prototype.updateMatrixWorld = function() {
  44670. var e = new n.Vector3
  44671. , t = new n.Quaternion
  44672. , i = new n.Vector3
  44673. , r = new n.Vector3;
  44674. return function(o) {
  44675. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  44676. var a = this.context.listener
  44677. , s = this.up;
  44678. this.matrixWorld.decompose(e, t, i),
  44679. r.set(0, 0, -1).applyQuaternion(t),
  44680. a.setPosition(e.x, e.y, e.z),
  44681. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  44682. }
  44683. }(),
  44684. n.Camera = function() {
  44685. n.Object3D.call(this),
  44686. this.type = "Camera",
  44687. this.matrixWorldInverse = new n.Matrix4,
  44688. this.projectionMatrix = new n.Matrix4
  44689. }
  44690. ,
  44691. n.Camera.prototype = Object.create(n.Object3D.prototype),
  44692. n.Camera.prototype.constructor = n.Camera,
  44693. n.Camera.prototype.getWorldDirection = function() {
  44694. var e = new n.Quaternion;
  44695. return function(t) {
  44696. var i = t || new n.Vector3;
  44697. return this.getWorldQuaternion(e),
  44698. i.set(0, 0, -1).applyQuaternion(e)
  44699. }
  44700. }(),
  44701. n.Camera.prototype.lookAt = function() {
  44702. var e = new n.Matrix4;
  44703. return function(t) {
  44704. e.lookAt(this.position, t, this.up),
  44705. this.quaternion.setFromRotationMatrix(e)
  44706. }
  44707. }(),
  44708. n.Camera.prototype.clone = function() {
  44709. return (new this.constructor).copy(this)
  44710. }
  44711. ,
  44712. n.Camera.prototype.copy = function(e) {
  44713. return n.Object3D.prototype.copy.call(this, e),
  44714. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44715. this.projectionMatrix.copy(e.projectionMatrix),
  44716. this
  44717. }
  44718. ,
  44719. n.CubeCamera = function(e, t, i) {
  44720. n.Object3D.call(this),
  44721. this.type = "CubeCamera";
  44722. var r = 90
  44723. , o = 1
  44724. , a = new n.PerspectiveCamera(r,o,e,t);
  44725. a.up.set(0, -1, 0),
  44726. a.lookAt(new n.Vector3(1,0,0)),
  44727. this.add(a);
  44728. var s = new n.PerspectiveCamera(r,o,e,t);
  44729. s.up.set(0, -1, 0),
  44730. s.lookAt(new n.Vector3(-1,0,0)),
  44731. this.add(s);
  44732. var l = new n.PerspectiveCamera(r,o,e,t);
  44733. l.up.set(0, 0, 1),
  44734. l.lookAt(new n.Vector3(0,1,0)),
  44735. this.add(l);
  44736. var c = new n.PerspectiveCamera(r,o,e,t);
  44737. c.up.set(0, 0, -1),
  44738. c.lookAt(new n.Vector3(0,-1,0)),
  44739. this.add(c);
  44740. var h = new n.PerspectiveCamera(r,o,e,t);
  44741. h.up.set(0, -1, 0),
  44742. h.lookAt(new n.Vector3(0,0,1)),
  44743. this.add(h);
  44744. var u = new n.PerspectiveCamera(r,o,e,t);
  44745. u.up.set(0, -1, 0),
  44746. u.lookAt(new n.Vector3(0,0,-1)),
  44747. this.add(u);
  44748. var d = {
  44749. format: n.RGBFormat,
  44750. magFilter: n.LinearFilter,
  44751. minFilter: n.LinearFilter
  44752. };
  44753. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  44754. this.updateCubeMap = function(e, t) {
  44755. null === this.parent && this.updateMatrixWorld();
  44756. var i = this.renderTarget
  44757. , n = i.texture.generateMipmaps;
  44758. i.texture.generateMipmaps = !1,
  44759. i.activeCubeFace = 0,
  44760. e.render(t, a, i),
  44761. i.activeCubeFace = 1,
  44762. e.render(t, s, i),
  44763. i.activeCubeFace = 2,
  44764. e.render(t, l, i),
  44765. i.activeCubeFace = 3,
  44766. e.render(t, c, i),
  44767. i.activeCubeFace = 4,
  44768. e.render(t, h, i),
  44769. i.texture.generateMipmaps = n,
  44770. i.activeCubeFace = 5,
  44771. e.render(t, u, i),
  44772. e.setRenderTarget(null)
  44773. }
  44774. }
  44775. ,
  44776. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  44777. n.CubeCamera.prototype.constructor = n.CubeCamera,
  44778. n.OrthographicCamera = function(e, t, i, r, o, a) {
  44779. n.Camera.call(this),
  44780. this.type = "OrthographicCamera",
  44781. this.zoom = 1,
  44782. this.left = e,
  44783. this.right = t,
  44784. this.top = i,
  44785. this.bottom = r,
  44786. this.near = void 0 !== o ? o : .1,
  44787. this.far = void 0 !== a ? a : 2e3,
  44788. this.updateProjectionMatrix()
  44789. }
  44790. ,
  44791. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  44792. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  44793. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44794. var e = (this.right - this.left) / (2 * this.zoom)
  44795. , t = (this.top - this.bottom) / (2 * this.zoom)
  44796. , i = (this.right + this.left) / 2
  44797. , n = (this.top + this.bottom) / 2;
  44798. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44799. }
  44800. ,
  44801. n.OrthographicCamera.prototype.copy = function(e) {
  44802. return n.Camera.prototype.copy.call(this, e),
  44803. this.left = e.left,
  44804. this.right = e.right,
  44805. this.top = e.top,
  44806. this.bottom = e.bottom,
  44807. this.near = e.near,
  44808. this.far = e.far,
  44809. this.zoom = e.zoom,
  44810. this
  44811. }
  44812. ,
  44813. n.OrthographicCamera.prototype.toJSON = function(e) {
  44814. var t = n.Object3D.prototype.toJSON.call(this, e);
  44815. return t.object.zoom = this.zoom,
  44816. t.object.left = this.left,
  44817. t.object.right = this.right,
  44818. t.object.top = this.top,
  44819. t.object.bottom = this.bottom,
  44820. t.object.near = this.near,
  44821. t.object.far = this.far,
  44822. t
  44823. }
  44824. ,
  44825. n.PerspectiveCamera = function(e, t, i, r) {
  44826. n.Camera.call(this),
  44827. this.type = "PerspectiveCamera",
  44828. this.focalLength = 10,
  44829. this.zoom = 1,
  44830. this.fov = void 0 !== e ? e : 50,
  44831. this.aspect = void 0 !== t ? t : 1,
  44832. this.near = void 0 !== i ? i : .1,
  44833. this.far = void 0 !== r ? r : 2e3,
  44834. this.updateProjectionMatrix()
  44835. }
  44836. ,
  44837. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  44838. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  44839. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  44840. void 0 === t && (t = 24),
  44841. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  44842. this.updateProjectionMatrix()
  44843. }
  44844. ,
  44845. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44846. this.fullWidth = e,
  44847. this.fullHeight = t,
  44848. this.x = i,
  44849. this.y = n,
  44850. this.width = r,
  44851. this.height = o,
  44852. this.updateProjectionMatrix()
  44853. }
  44854. ,
  44855. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44856. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  44857. if (this.fullWidth) {
  44858. var t = this.fullWidth / this.fullHeight
  44859. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  44860. , r = -i
  44861. , o = t * r
  44862. , a = t * i
  44863. , s = Math.abs(a - o)
  44864. , l = Math.abs(i - r);
  44865. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  44866. } else
  44867. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44868. }
  44869. ,
  44870. n.PerspectiveCamera.prototype.copy = function(e) {
  44871. return n.Camera.prototype.copy.call(this, e),
  44872. this.focalLength = e.focalLength,
  44873. this.zoom = e.zoom,
  44874. this.fov = e.fov,
  44875. this.aspect = e.aspect,
  44876. this.near = e.near,
  44877. this.far = e.far,
  44878. this
  44879. }
  44880. ,
  44881. n.PerspectiveCamera.prototype.toJSON = function(e) {
  44882. var t = n.Object3D.prototype.toJSON.call(this, e);
  44883. return t.object.focalLength = this.focalLength,
  44884. t.object.zoom = this.zoom,
  44885. t.object.fov = this.fov,
  44886. t.object.aspect = this.aspect,
  44887. t.object.near = this.near,
  44888. t.object.far = this.far,
  44889. t
  44890. }
  44891. ,
  44892. n.StereoCamera = function() {
  44893. this.type = "StereoCamera",
  44894. this.aspect = 1,
  44895. this.cameraL = new n.PerspectiveCamera,
  44896. this.cameraL.layers.enable(1),
  44897. this.cameraL.matrixAutoUpdate = !1,
  44898. this.cameraR = new n.PerspectiveCamera,
  44899. this.cameraR.layers.enable(2),
  44900. this.cameraR.matrixAutoUpdate = !1
  44901. }
  44902. ,
  44903. n.StereoCamera.prototype = {
  44904. constructor: n.StereoCamera,
  44905. update: function() {
  44906. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  44907. return function(l) {
  44908. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  44909. if (c) {
  44910. e = l.focalLength,
  44911. t = l.fov,
  44912. i = l.aspect * this.aspect,
  44913. r = l.near,
  44914. o = l.far;
  44915. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  44916. s.elements[12] = -p,
  44917. a.elements[12] = p,
  44918. h = -g * i + f,
  44919. u = g * i + f,
  44920. d.elements[0] = 2 * r / (u - h),
  44921. d.elements[8] = (u + h) / (u - h),
  44922. this.cameraL.projectionMatrix.copy(d),
  44923. h = -g * i - f,
  44924. u = g * i - f,
  44925. d.elements[0] = 2 * r / (u - h),
  44926. d.elements[8] = (u + h) / (u - h),
  44927. this.cameraR.projectionMatrix.copy(d)
  44928. }
  44929. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  44930. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  44931. }
  44932. }()
  44933. },
  44934. n.Light = function(e, t) {
  44935. n.Object3D.call(this),
  44936. this.type = "Light",
  44937. this.color = new n.Color(e),
  44938. this.intensity = void 0 !== t ? t : 1,
  44939. this.receiveShadow = void 0
  44940. }
  44941. ,
  44942. n.Light.prototype = Object.create(n.Object3D.prototype),
  44943. n.Light.prototype.constructor = n.Light,
  44944. n.Light.prototype.copy = function(e) {
  44945. return n.Object3D.prototype.copy.call(this, e),
  44946. this.color.copy(e.color),
  44947. this.intensity = e.intensity,
  44948. this
  44949. }
  44950. ,
  44951. n.Light.prototype.toJSON = function(e) {
  44952. var t = n.Object3D.prototype.toJSON.call(this, e);
  44953. return t.object.color = this.color.getHex(),
  44954. t.object.intensity = this.intensity,
  44955. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44956. void 0 !== this.distance && (t.object.distance = this.distance),
  44957. void 0 !== this.angle && (t.object.angle = this.angle),
  44958. void 0 !== this.decay && (t.object.decay = this.decay),
  44959. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44960. t
  44961. }
  44962. ,
  44963. n.LightShadow = function(e) {
  44964. this.camera = e,
  44965. this.bias = 0,
  44966. this.radius = 1,
  44967. this.mapSize = new n.Vector2(512,512),
  44968. this.map = null,
  44969. this.matrix = new n.Matrix4
  44970. }
  44971. ,
  44972. n.LightShadow.prototype = {
  44973. constructor: n.LightShadow,
  44974. copy: function(e) {
  44975. return this.camera = e.camera.clone(),
  44976. this.bias = e.bias,
  44977. this.radius = e.radius,
  44978. this.mapSize.copy(e.mapSize),
  44979. this
  44980. },
  44981. clone: function() {
  44982. return (new this.constructor).copy(this)
  44983. }
  44984. },
  44985. n.AmbientLight = function(e, t) {
  44986. n.Light.call(this, e, t),
  44987. this.type = "AmbientLight",
  44988. this.castShadow = void 0
  44989. }
  44990. ,
  44991. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  44992. n.AmbientLight.prototype.constructor = n.AmbientLight,
  44993. n.DirectionalLight = function(e, t) {
  44994. n.Light.call(this, e, t),
  44995. this.type = "DirectionalLight",
  44996. this.position.set(0, 1, 0),
  44997. this.updateMatrix(),
  44998. this.target = new n.Object3D,
  44999. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  45000. }
  45001. ,
  45002. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  45003. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  45004. n.DirectionalLight.prototype.copy = function(e) {
  45005. return n.Light.prototype.copy.call(this, e),
  45006. this.target = e.target.clone(),
  45007. this.shadow = e.shadow.clone(),
  45008. this
  45009. }
  45010. ,
  45011. n.HemisphereLight = function(e, t, i) {
  45012. n.Light.call(this, e, i),
  45013. this.type = "HemisphereLight",
  45014. this.castShadow = void 0,
  45015. this.position.set(0, 1, 0),
  45016. this.updateMatrix(),
  45017. this.groundColor = new n.Color(t)
  45018. }
  45019. ,
  45020. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  45021. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  45022. n.HemisphereLight.prototype.copy = function(e) {
  45023. return n.Light.prototype.copy.call(this, e),
  45024. this.groundColor.copy(e.groundColor),
  45025. this
  45026. }
  45027. ,
  45028. n.PointLight = function(e, t, i, r) {
  45029. n.Light.call(this, e, t),
  45030. this.type = "PointLight",
  45031. this.distance = void 0 !== i ? i : 0,
  45032. this.decay = void 0 !== r ? r : 1,
  45033. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  45034. }
  45035. ,
  45036. n.PointLight.prototype = Object.create(n.Light.prototype),
  45037. n.PointLight.prototype.constructor = n.PointLight,
  45038. Object.defineProperty(n.PointLight.prototype, "power", {
  45039. get: function() {
  45040. return 4 * this.intensity * Math.PI
  45041. },
  45042. set: function(e) {
  45043. this.intensity = e / (4 * Math.PI)
  45044. }
  45045. }),
  45046. n.PointLight.prototype.copy = function(e) {
  45047. return n.Light.prototype.copy.call(this, e),
  45048. this.distance = e.distance,
  45049. this.decay = e.decay,
  45050. this.shadow = e.shadow.clone(),
  45051. this
  45052. }
  45053. ,
  45054. n.SpotLight = function(e, t, i, r, o, a) {
  45055. n.Light.call(this, e, t),
  45056. this.type = "SpotLight",
  45057. this.position.set(0, 1, 0),
  45058. this.updateMatrix(),
  45059. this.target = new n.Object3D,
  45060. this.distance = void 0 !== i ? i : 0,
  45061. this.angle = void 0 !== r ? r : Math.PI / 3,
  45062. this.penumbra = void 0 !== o ? o : 0,
  45063. this.decay = void 0 !== a ? a : 1,
  45064. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  45065. }
  45066. ,
  45067. n.SpotLight.prototype = Object.create(n.Light.prototype),
  45068. n.SpotLight.prototype.constructor = n.SpotLight,
  45069. Object.defineProperty(n.SpotLight.prototype, "power", {
  45070. get: function() {
  45071. return this.intensity * Math.PI
  45072. },
  45073. set: function(e) {
  45074. this.intensity = e / Math.PI
  45075. }
  45076. }),
  45077. n.SpotLight.prototype.copy = function(e) {
  45078. return n.Light.prototype.copy.call(this, e),
  45079. this.distance = e.distance,
  45080. this.angle = e.angle,
  45081. this.penumbra = e.penumbra,
  45082. this.decay = e.decay,
  45083. this.target = e.target.clone(),
  45084. this.shadow = e.shadow.clone(),
  45085. this
  45086. }
  45087. ,
  45088. n.Cache = {
  45089. enabled: !1,
  45090. files: {},
  45091. add: function(e, t) {
  45092. this.enabled !== !1 && (this.files[e] = t)
  45093. },
  45094. get: function(e) {
  45095. if (this.enabled !== !1)
  45096. return this.files[e]
  45097. },
  45098. remove: function(e) {
  45099. delete this.files[e]
  45100. },
  45101. clear: function() {
  45102. this.files = {}
  45103. }
  45104. },
  45105. n.Loader = function() {
  45106. this.onLoadStart = function() {}
  45107. ,
  45108. this.onLoadProgress = function() {}
  45109. ,
  45110. this.onLoadComplete = function() {}
  45111. }
  45112. ,
  45113. n.Loader.prototype = {
  45114. constructor: n.Loader,
  45115. crossOrigin: void 0,
  45116. extractUrlBase: function(e) {
  45117. var t = e.split("/");
  45118. return 1 === t.length ? "./" : (t.pop(),
  45119. t.join("/") + "/")
  45120. },
  45121. initMaterials: function(e, t, i) {
  45122. for (var n = [], r = 0; r < e.length; ++r)
  45123. n[r] = this.createMaterial(e[r], t, i);
  45124. return n
  45125. },
  45126. createMaterial: function() {
  45127. var e, t, i;
  45128. return function(r, o, a) {
  45129. function s(e, i, r, s, c) {
  45130. var h, u = o + e, d = n.Loader.Handlers.get(u);
  45131. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  45132. h = t.load(u)),
  45133. void 0 !== i && (h.repeat.fromArray(i),
  45134. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  45135. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  45136. void 0 !== r && h.offset.fromArray(r),
  45137. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  45138. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  45139. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  45140. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  45141. void 0 !== c && (h.anisotropy = c);
  45142. var p = n.Math.generateUUID();
  45143. return l[p] = h,
  45144. p
  45145. }
  45146. void 0 === e && (e = new n.Color),
  45147. void 0 === t && (t = new n.TextureLoader),
  45148. void 0 === i && (i = new n.MaterialLoader);
  45149. var l = {}
  45150. , c = {
  45151. uuid: n.Math.generateUUID(),
  45152. type: "MeshLambertMaterial"
  45153. };
  45154. for (var h in r) {
  45155. var u = r[h];
  45156. switch (h) {
  45157. case "DbgColor":
  45158. case "DbgIndex":
  45159. case "opticalDensity":
  45160. case "illumination":
  45161. break;
  45162. case "DbgName":
  45163. c.name = u;
  45164. break;
  45165. case "blending":
  45166. c.blending = n[u];
  45167. break;
  45168. case "colorAmbient":
  45169. case "mapAmbient":
  45170. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  45171. break;
  45172. case "colorDiffuse":
  45173. c.color = e.fromArray(u).getHex();
  45174. break;
  45175. case "colorSpecular":
  45176. c.specular = e.fromArray(u).getHex();
  45177. break;
  45178. case "colorEmissive":
  45179. c.emissive = e.fromArray(u).getHex();
  45180. break;
  45181. case "specularCoef":
  45182. c.shininess = u;
  45183. break;
  45184. case "shading":
  45185. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  45186. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  45187. break;
  45188. case "mapDiffuse":
  45189. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  45190. break;
  45191. case "mapDiffuseRepeat":
  45192. case "mapDiffuseOffset":
  45193. case "mapDiffuseWrap":
  45194. case "mapDiffuseAnisotropy":
  45195. break;
  45196. case "mapLight":
  45197. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  45198. break;
  45199. case "mapLightRepeat":
  45200. case "mapLightOffset":
  45201. case "mapLightWrap":
  45202. case "mapLightAnisotropy":
  45203. break;
  45204. case "mapAO":
  45205. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  45206. break;
  45207. case "mapAORepeat":
  45208. case "mapAOOffset":
  45209. case "mapAOWrap":
  45210. case "mapAOAnisotropy":
  45211. break;
  45212. case "mapBump":
  45213. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  45214. break;
  45215. case "mapBumpScale":
  45216. c.bumpScale = u;
  45217. break;
  45218. case "mapBumpRepeat":
  45219. case "mapBumpOffset":
  45220. case "mapBumpWrap":
  45221. case "mapBumpAnisotropy":
  45222. break;
  45223. case "mapNormal":
  45224. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  45225. break;
  45226. case "mapNormalFactor":
  45227. c.normalScale = [u, u];
  45228. break;
  45229. case "mapNormalRepeat":
  45230. case "mapNormalOffset":
  45231. case "mapNormalWrap":
  45232. case "mapNormalAnisotropy":
  45233. break;
  45234. case "mapSpecular":
  45235. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  45236. break;
  45237. case "mapSpecularRepeat":
  45238. case "mapSpecularOffset":
  45239. case "mapSpecularWrap":
  45240. case "mapSpecularAnisotropy":
  45241. break;
  45242. case "mapAlpha":
  45243. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  45244. break;
  45245. case "mapAlphaRepeat":
  45246. case "mapAlphaOffset":
  45247. case "mapAlphaWrap":
  45248. case "mapAlphaAnisotropy":
  45249. break;
  45250. case "flipSided":
  45251. c.side = n.BackSide;
  45252. break;
  45253. case "doubleSided":
  45254. c.side = n.DoubleSide;
  45255. break;
  45256. case "transparency":
  45257. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45258. c.opacity = u;
  45259. break;
  45260. case "depthTest":
  45261. case "depthWrite":
  45262. case "colorWrite":
  45263. case "opacity":
  45264. case "reflectivity":
  45265. case "transparent":
  45266. case "visible":
  45267. case "wireframe":
  45268. c[h] = u;
  45269. break;
  45270. case "vertexColors":
  45271. u === !0 && (c.vertexColors = n.VertexColors),
  45272. "face" === u && (c.vertexColors = n.FaceColors);
  45273. break;
  45274. default:
  45275. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  45276. }
  45277. }
  45278. return "MeshBasicMaterial" === c.type && delete c.emissive,
  45279. "MeshPhongMaterial" !== c.type && delete c.specular,
  45280. c.opacity < 1 && (c.transparent = !0),
  45281. i.setTextures(l),
  45282. i.parse(c)
  45283. }
  45284. }()
  45285. },
  45286. n.Loader.Handlers = {
  45287. handlers: [],
  45288. add: function(e, t) {
  45289. this.handlers.push(e, t)
  45290. },
  45291. get: function(e) {
  45292. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45293. var r = t[i]
  45294. , o = t[i + 1];
  45295. if (r.test(e))
  45296. return o
  45297. }
  45298. return null
  45299. }
  45300. },
  45301. n.XHRLoader = function(e) {
  45302. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45303. }
  45304. ,
  45305. n.XHRLoader.prototype = {
  45306. constructor: n.XHRLoader,
  45307. load: function(e, t, i, r) {
  45308. void 0 !== this.path && (e = this.path + e);
  45309. var o = this
  45310. , a = n.Cache.get(e);
  45311. if (void 0 !== a)
  45312. return t && setTimeout(function() {
  45313. t(a)
  45314. }, 0),
  45315. a;
  45316. var s = new XMLHttpRequest;
  45317. return s.overrideMimeType("text/plain"),
  45318. s.open("GET", e, !0),
  45319. s.addEventListener("load", function(i) {
  45320. var a = i.target.response;
  45321. n.Cache.add(e, a),
  45322. 200 === this.status ? (t && t(a),
  45323. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45324. t && t(a),
  45325. o.manager.itemEnd(e)) : (r && r(i),
  45326. o.manager.itemError(e))
  45327. }, !1),
  45328. void 0 !== i && s.addEventListener("progress", function(e) {
  45329. i(e)
  45330. }, !1),
  45331. s.addEventListener("error", function(t) {
  45332. r && r(t),
  45333. o.manager.itemError(e)
  45334. }, !1),
  45335. void 0 !== this.responseType && (s.responseType = this.responseType),
  45336. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  45337. s.send(null),
  45338. o.manager.itemStart(e),
  45339. s
  45340. },
  45341. setPath: function(e) {
  45342. this.path = e
  45343. },
  45344. setResponseType: function(e) {
  45345. this.responseType = e
  45346. },
  45347. setWithCredentials: function(e) {
  45348. this.withCredentials = e
  45349. }
  45350. },
  45351. n.FontLoader = function(e) {
  45352. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45353. }
  45354. ,
  45355. n.FontLoader.prototype = {
  45356. constructor: n.FontLoader,
  45357. load: function(e, t, i, r) {
  45358. var o = new n.XHRLoader(this.manager);
  45359. o.load(e, function(e) {
  45360. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  45361. }, i, r)
  45362. }
  45363. },
  45364. n.ImageLoader = function(e) {
  45365. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45366. }
  45367. ,
  45368. n.ImageLoader.prototype = {
  45369. constructor: n.ImageLoader,
  45370. load: function(e, t, i, r) {
  45371. void 0 !== this.path && (e = this.path + e);
  45372. var o = this
  45373. , a = n.Cache.get(e);
  45374. if (void 0 !== a)
  45375. return o.manager.itemStart(e),
  45376. t ? setTimeout(function() {
  45377. t(a),
  45378. o.manager.itemEnd(e)
  45379. }, 0) : o.manager.itemEnd(e),
  45380. a;
  45381. var s = document.createElement("img");
  45382. return s.addEventListener("load", function(i) {
  45383. n.Cache.add(e, this),
  45384. t && t(this),
  45385. o.manager.itemEnd(e)
  45386. }, !1),
  45387. void 0 !== i && s.addEventListener("progress", function(e) {
  45388. i(e)
  45389. }, !1),
  45390. s.addEventListener("error", function(t) {
  45391. r && r(t),
  45392. o.manager.itemError(e)
  45393. }, !1),
  45394. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  45395. o.manager.itemStart(e),
  45396. s.src = e,
  45397. s
  45398. },
  45399. setCrossOrigin: function(e) {
  45400. this.crossOrigin = e
  45401. },
  45402. setPath: function(e) {
  45403. this.path = e
  45404. }
  45405. },
  45406. n.JSONLoader = function(e) {
  45407. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45408. e = void 0),
  45409. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45410. this.withCredentials = !1
  45411. }
  45412. ,
  45413. n.JSONLoader.prototype = {
  45414. constructor: n.JSONLoader,
  45415. get statusDomElement() {
  45416. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45417. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45418. this._statusDomElement
  45419. },
  45420. load: function(e, t, i, r) {
  45421. var o = this
  45422. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  45423. , s = new n.XHRLoader(this.manager);
  45424. s.setWithCredentials(this.withCredentials),
  45425. s.load(e, function(i) {
  45426. var n = JSON.parse(i)
  45427. , r = n.metadata;
  45428. if (void 0 !== r) {
  45429. var s = r.type;
  45430. if (void 0 !== s) {
  45431. if ("object" === s.toLowerCase())
  45432. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  45433. if ("scene" === s.toLowerCase())
  45434. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  45435. }
  45436. }
  45437. var l = o.parse(n, a);
  45438. t(l.geometry, l.materials)
  45439. }, i, r)
  45440. },
  45441. setTexturePath: function(e) {
  45442. this.texturePath = e
  45443. },
  45444. parse: function(e, t) {
  45445. function i(t) {
  45446. function i(e, t) {
  45447. return e & 1 << t
  45448. }
  45449. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  45450. if (void 0 !== e.uvs) {
  45451. for (r = 0; r < e.uvs.length; r++)
  45452. e.uvs[r].length && B++;
  45453. for (r = 0; r < B; r++)
  45454. s.faceVertexUvs[r] = []
  45455. }
  45456. for (l = 0,
  45457. c = L.length; l < c; )
  45458. E = new n.Vector3,
  45459. E.x = L[l++] * t,
  45460. E.y = L[l++] * t,
  45461. E.z = L[l++] * t,
  45462. s.vertices.push(E);
  45463. for (l = 0,
  45464. c = O.length; l < c; )
  45465. if (f = O[l++],
  45466. g = i(f, 0),
  45467. m = i(f, 1),
  45468. v = i(f, 3),
  45469. A = i(f, 4),
  45470. y = i(f, 5),
  45471. C = i(f, 6),
  45472. I = i(f, 7),
  45473. g) {
  45474. if (w = new n.Face3,
  45475. w.a = O[l],
  45476. w.b = O[l + 1],
  45477. w.c = O[l + 3],
  45478. _ = new n.Face3,
  45479. _.a = O[l + 1],
  45480. _.b = O[l + 2],
  45481. _.c = O[l + 3],
  45482. l += 4,
  45483. m && (p = O[l++],
  45484. w.materialIndex = p,
  45485. _.materialIndex = p),
  45486. a = s.faces.length,
  45487. v)
  45488. for (r = 0; r < B; r++)
  45489. for (S = e.uvs[r],
  45490. s.faceVertexUvs[r][a] = [],
  45491. s.faceVertexUvs[r][a + 1] = [],
  45492. o = 0; o < 4; o++)
  45493. d = O[l++],
  45494. R = S[2 * d],
  45495. P = S[2 * d + 1],
  45496. M = new n.Vector2(R,P),
  45497. 2 !== o && s.faceVertexUvs[r][a].push(M),
  45498. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  45499. if (A && (u = 3 * O[l++],
  45500. w.normal.set(D[u++], D[u++], D[u]),
  45501. _.normal.copy(w.normal)),
  45502. y)
  45503. for (r = 0; r < 4; r++)
  45504. u = 3 * O[l++],
  45505. x = new n.Vector3(D[u++],D[u++],D[u]),
  45506. 2 !== r && w.vertexNormals.push(x),
  45507. 0 !== r && _.vertexNormals.push(x);
  45508. if (C && (h = O[l++],
  45509. T = N[h],
  45510. w.color.setHex(T),
  45511. _.color.setHex(T)),
  45512. I)
  45513. for (r = 0; r < 4; r++)
  45514. h = O[l++],
  45515. T = N[h],
  45516. 2 !== r && w.vertexColors.push(new n.Color(T)),
  45517. 0 !== r && _.vertexColors.push(new n.Color(T));
  45518. s.faces.push(w),
  45519. s.faces.push(_)
  45520. } else {
  45521. if (b = new n.Face3,
  45522. b.a = O[l++],
  45523. b.b = O[l++],
  45524. b.c = O[l++],
  45525. m && (p = O[l++],
  45526. b.materialIndex = p),
  45527. a = s.faces.length,
  45528. v)
  45529. for (r = 0; r < B; r++)
  45530. for (S = e.uvs[r],
  45531. s.faceVertexUvs[r][a] = [],
  45532. o = 0; o < 3; o++)
  45533. d = O[l++],
  45534. R = S[2 * d],
  45535. P = S[2 * d + 1],
  45536. M = new n.Vector2(R,P),
  45537. s.faceVertexUvs[r][a].push(M);
  45538. if (A && (u = 3 * O[l++],
  45539. b.normal.set(D[u++], D[u++], D[u])),
  45540. y)
  45541. for (r = 0; r < 3; r++)
  45542. u = 3 * O[l++],
  45543. x = new n.Vector3(D[u++],D[u++],D[u]),
  45544. b.vertexNormals.push(x);
  45545. if (C && (h = O[l++],
  45546. b.color.setHex(N[h])),
  45547. I)
  45548. for (r = 0; r < 3; r++)
  45549. h = O[l++],
  45550. b.vertexColors.push(new n.Color(N[h]));
  45551. s.faces.push(b)
  45552. }
  45553. }
  45554. function r() {
  45555. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  45556. if (e.skinWeights)
  45557. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  45558. var o = e.skinWeights[i]
  45559. , a = t > 1 ? e.skinWeights[i + 1] : 0
  45560. , l = t > 2 ? e.skinWeights[i + 2] : 0
  45561. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  45562. s.skinWeights.push(new n.Vector4(o,a,l,c))
  45563. }
  45564. if (e.skinIndices)
  45565. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  45566. var h = e.skinIndices[i]
  45567. , u = t > 1 ? e.skinIndices[i + 1] : 0
  45568. , d = t > 2 ? e.skinIndices[i + 2] : 0
  45569. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  45570. s.skinIndices.push(new n.Vector4(h,u,d,p))
  45571. }
  45572. s.bones = e.bones,
  45573. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  45574. }
  45575. function o(t) {
  45576. if (void 0 !== e.morphTargets)
  45577. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  45578. s.morphTargets[i] = {},
  45579. s.morphTargets[i].name = e.morphTargets[i].name,
  45580. s.morphTargets[i].vertices = [];
  45581. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  45582. var h = new n.Vector3;
  45583. h.x = a[l] * t,
  45584. h.y = a[l + 1] * t,
  45585. h.z = a[l + 2] * t,
  45586. o.push(h)
  45587. }
  45588. }
  45589. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  45590. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45591. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  45592. u[i].color.fromArray(d, 3 * i)
  45593. }
  45594. }
  45595. function a() {
  45596. var t = []
  45597. , i = [];
  45598. void 0 !== e.animation && i.push(e.animation),
  45599. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  45600. for (var r = 0; r < i.length; r++) {
  45601. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  45602. o && t.push(o)
  45603. }
  45604. if (s.morphTargets) {
  45605. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  45606. t = t.concat(a)
  45607. }
  45608. t.length > 0 && (s.animations = t)
  45609. }
  45610. var s = new n.Geometry
  45611. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  45612. if (i(l),
  45613. r(),
  45614. o(l),
  45615. a(),
  45616. s.computeFaceNormals(),
  45617. s.computeBoundingSphere(),
  45618. void 0 === e.materials || 0 === e.materials.length)
  45619. return {
  45620. geometry: s
  45621. };
  45622. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  45623. return {
  45624. geometry: s,
  45625. materials: c
  45626. }
  45627. }
  45628. },
  45629. n.LoadingManager = function(e, t, i) {
  45630. var n = this
  45631. , r = !1
  45632. , o = 0
  45633. , a = 0;
  45634. this.onStart = void 0,
  45635. this.onLoad = e,
  45636. this.onProgress = t,
  45637. this.onError = i,
  45638. this.itemStart = function(e) {
  45639. a++,
  45640. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  45641. r = !0
  45642. }
  45643. ,
  45644. this.itemEnd = function(e) {
  45645. o++,
  45646. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45647. o === a && (r = !1,
  45648. void 0 !== n.onLoad && n.onLoad())
  45649. }
  45650. ,
  45651. this.itemError = function(e) {
  45652. void 0 !== n.onError && n.onError(e)
  45653. }
  45654. }
  45655. ,
  45656. n.DefaultLoadingManager = new n.LoadingManager,
  45657. n.BufferGeometryLoader = function(e) {
  45658. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45659. }
  45660. ,
  45661. n.BufferGeometryLoader.prototype = {
  45662. constructor: n.BufferGeometryLoader,
  45663. load: function(e, t, i, r) {
  45664. var o = this
  45665. , a = new n.XHRLoader(o.manager);
  45666. a.load(e, function(e) {
  45667. t(o.parse(JSON.parse(e)))
  45668. }, i, r)
  45669. },
  45670. parse: function(e) {
  45671. var t = new n.BufferGeometry
  45672. , i = e.data.index
  45673. , r = {
  45674. Int8Array: Int8Array,
  45675. Uint8Array: Uint8Array,
  45676. Uint8ClampedArray: Uint8ClampedArray,
  45677. Int16Array: Int16Array,
  45678. Uint16Array: Uint16Array,
  45679. Int32Array: Int32Array,
  45680. Uint32Array: Uint32Array,
  45681. Float32Array: Float32Array,
  45682. Float64Array: Float64Array
  45683. };
  45684. if (void 0 !== i) {
  45685. var o = new r[i.type](i.array);
  45686. t.setIndex(new n.BufferAttribute(o,1))
  45687. }
  45688. var a = e.data.attributes;
  45689. for (var s in a) {
  45690. var l = a[s]
  45691. , o = new r[l.type](l.array);
  45692. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  45693. }
  45694. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  45695. if (void 0 !== c)
  45696. for (var h = 0, u = c.length; h !== u; ++h) {
  45697. var d = c[h];
  45698. t.addGroup(d.start, d.count, d.materialIndex)
  45699. }
  45700. var p = e.data.boundingSphere;
  45701. if (void 0 !== p) {
  45702. var f = new n.Vector3;
  45703. void 0 !== p.center && f.fromArray(p.center),
  45704. t.boundingSphere = new n.Sphere(f,p.radius)
  45705. }
  45706. return t
  45707. }
  45708. },
  45709. n.MaterialLoader = function(e) {
  45710. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45711. this.textures = {}
  45712. }
  45713. ,
  45714. n.MaterialLoader.prototype = {
  45715. constructor: n.MaterialLoader,
  45716. load: function(e, t, i, r) {
  45717. var o = this
  45718. , a = new n.XHRLoader(o.manager);
  45719. a.load(e, function(e) {
  45720. t(o.parse(JSON.parse(e)))
  45721. }, i, r)
  45722. },
  45723. setTextures: function(e) {
  45724. this.textures = e
  45725. },
  45726. getTexture: function(e) {
  45727. var t = this.textures;
  45728. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45729. t[e]
  45730. },
  45731. parse: function(e) {
  45732. var t = new n[e.type];
  45733. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45734. void 0 !== e.name && (t.name = e.name),
  45735. void 0 !== e.color && t.color.setHex(e.color),
  45736. void 0 !== e.roughness && (t.roughness = e.roughness),
  45737. void 0 !== e.metalness && (t.metalness = e.metalness),
  45738. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45739. void 0 !== e.specular && t.specular.setHex(e.specular),
  45740. void 0 !== e.shininess && (t.shininess = e.shininess),
  45741. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45742. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45743. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45744. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45745. void 0 !== e.shading && (t.shading = e.shading),
  45746. void 0 !== e.blending && (t.blending = e.blending),
  45747. void 0 !== e.side && (t.side = e.side),
  45748. void 0 !== e.opacity && (t.opacity = e.opacity),
  45749. void 0 !== e.transparent && (t.transparent = e.transparent),
  45750. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45751. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45752. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45753. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45754. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45755. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45756. void 0 !== e.size && (t.size = e.size),
  45757. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45758. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45759. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45760. t.transparent = !0),
  45761. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45762. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45763. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45764. void 0 !== e.normalScale) {
  45765. var i = e.normalScale;
  45766. Array.isArray(i) === !1 && (i = [i, i]),
  45767. t.normalScale = (new n.Vector2).fromArray(i)
  45768. }
  45769. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45770. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45771. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45772. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45773. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45774. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45775. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45776. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45777. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45778. t.combine = n.MultiplyOperation),
  45779. e.reflectivity && (t.reflectivity = e.reflectivity),
  45780. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45781. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45782. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45783. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45784. void 0 !== e.materials)
  45785. for (var r = 0, o = e.materials.length; r < o; r++)
  45786. t.materials.push(this.parse(e.materials[r]));
  45787. return t
  45788. }
  45789. },
  45790. n.ObjectLoader = function(e) {
  45791. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45792. this.texturePath = ""
  45793. }
  45794. ,
  45795. n.ObjectLoader.prototype = {
  45796. constructor: n.ObjectLoader,
  45797. load: function(e, t, i, r) {
  45798. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45799. var o = this
  45800. , a = new n.XHRLoader(o.manager);
  45801. a.load(e, function(e) {
  45802. o.parse(JSON.parse(e), t)
  45803. }, i, r)
  45804. },
  45805. setTexturePath: function(e) {
  45806. this.texturePath = e
  45807. },
  45808. setCrossOrigin: function(e) {
  45809. this.crossOrigin = e
  45810. },
  45811. parse: function(e, t) {
  45812. var i = this.parseGeometries(e.geometries)
  45813. , n = this.parseImages(e.images, function() {
  45814. void 0 !== t && t(a)
  45815. })
  45816. , r = this.parseTextures(e.textures, n)
  45817. , o = this.parseMaterials(e.materials, r)
  45818. , a = this.parseObject(e.object, i, o);
  45819. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45820. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45821. a
  45822. },
  45823. parseGeometries: function(e) {
  45824. var t = {};
  45825. if (void 0 !== e)
  45826. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  45827. var s, l = e[o];
  45828. switch (l.type) {
  45829. case "PlaneGeometry":
  45830. case "PlaneBufferGeometry":
  45831. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  45832. break;
  45833. case "BoxGeometry":
  45834. case "BoxBufferGeometry":
  45835. case "CubeGeometry":
  45836. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  45837. break;
  45838. case "CircleGeometry":
  45839. case "CircleBufferGeometry":
  45840. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  45841. break;
  45842. case "CylinderGeometry":
  45843. case "CylinderBufferGeometry":
  45844. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  45845. break;
  45846. case "SphereGeometry":
  45847. case "SphereBufferGeometry":
  45848. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  45849. break;
  45850. case "DodecahedronGeometry":
  45851. s = new n.DodecahedronGeometry(l.radius,l.detail);
  45852. break;
  45853. case "IcosahedronGeometry":
  45854. s = new n.IcosahedronGeometry(l.radius,l.detail);
  45855. break;
  45856. case "OctahedronGeometry":
  45857. s = new n.OctahedronGeometry(l.radius,l.detail);
  45858. break;
  45859. case "TetrahedronGeometry":
  45860. s = new n.TetrahedronGeometry(l.radius,l.detail);
  45861. break;
  45862. case "RingGeometry":
  45863. case "RingBufferGeometry":
  45864. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  45865. break;
  45866. case "TorusGeometry":
  45867. case "TorusBufferGeometry":
  45868. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  45869. break;
  45870. case "TorusKnotGeometry":
  45871. case "TorusKnotBufferGeometry":
  45872. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  45873. break;
  45874. case "LatheGeometry":
  45875. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  45876. break;
  45877. case "BufferGeometry":
  45878. s = r.parse(l);
  45879. break;
  45880. case "Geometry":
  45881. s = i.parse(l.data, this.texturePath).geometry;
  45882. break;
  45883. default:
  45884. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  45885. continue
  45886. }
  45887. s.uuid = l.uuid,
  45888. void 0 !== l.name && (s.name = l.name),
  45889. t[l.uuid] = s
  45890. }
  45891. return t
  45892. },
  45893. parseMaterials: function(e, t) {
  45894. var i = {};
  45895. if (void 0 !== e) {
  45896. var r = new n.MaterialLoader;
  45897. r.setTextures(t);
  45898. for (var o = 0, a = e.length; o < a; o++) {
  45899. var s = r.parse(e[o]);
  45900. i[s.uuid] = s
  45901. }
  45902. }
  45903. return i
  45904. },
  45905. parseAnimations: function(e) {
  45906. for (var t = [], i = 0; i < e.length; i++) {
  45907. var r = n.AnimationClip.parse(e[i]);
  45908. t.push(r)
  45909. }
  45910. return t
  45911. },
  45912. parseImages: function(e, t) {
  45913. function i(e) {
  45914. return r.manager.itemStart(e),
  45915. s.load(e, function() {
  45916. r.manager.itemEnd(e)
  45917. })
  45918. }
  45919. var r = this
  45920. , o = {};
  45921. if (void 0 !== e && e.length > 0) {
  45922. var a = new n.LoadingManager(t)
  45923. , s = new n.ImageLoader(a);
  45924. s.setCrossOrigin(this.crossOrigin);
  45925. for (var l = 0, c = e.length; l < c; l++) {
  45926. var h = e[l]
  45927. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  45928. o[h.uuid] = i(u)
  45929. }
  45930. }
  45931. return o
  45932. },
  45933. parseTextures: function(e, t) {
  45934. function i(e) {
  45935. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45936. n[e])
  45937. }
  45938. var r = {};
  45939. if (void 0 !== e)
  45940. for (var o = 0, a = e.length; o < a; o++) {
  45941. var s = e[o];
  45942. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  45943. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  45944. var l = new n.Texture(t[s.image]);
  45945. l.needsUpdate = !0,
  45946. l.uuid = s.uuid,
  45947. void 0 !== s.name && (l.name = s.name),
  45948. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  45949. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  45950. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  45951. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  45952. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  45953. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  45954. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  45955. l.wrapT = i(s.wrap[1])),
  45956. r[s.uuid] = l
  45957. }
  45958. return r
  45959. },
  45960. parseObject: function() {
  45961. var e = new n.Matrix4;
  45962. return function(t, i, r) {
  45963. function o(e) {
  45964. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45965. i[e]
  45966. }
  45967. function a(e) {
  45968. if (void 0 !== e)
  45969. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45970. r[e]
  45971. }
  45972. var s;
  45973. switch (t.type) {
  45974. case "Scene":
  45975. s = new n.Scene;
  45976. break;
  45977. case "PerspectiveCamera":
  45978. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  45979. break;
  45980. case "OrthographicCamera":
  45981. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  45982. break;
  45983. case "AmbientLight":
  45984. s = new n.AmbientLight(t.color,t.intensity);
  45985. break;
  45986. case "DirectionalLight":
  45987. s = new n.DirectionalLight(t.color,t.intensity);
  45988. break;
  45989. case "PointLight":
  45990. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  45991. break;
  45992. case "SpotLight":
  45993. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  45994. break;
  45995. case "HemisphereLight":
  45996. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  45997. break;
  45998. case "Mesh":
  45999. var l = o(t.geometry)
  46000. , c = a(t.material);
  46001. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  46002. break;
  46003. case "LOD":
  46004. s = new n.LOD;
  46005. break;
  46006. case "Line":
  46007. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  46008. break;
  46009. case "PointCloud":
  46010. case "Points":
  46011. s = new n.Points(o(t.geometry),a(t.material));
  46012. break;
  46013. case "Sprite":
  46014. s = new n.Sprite(a(t.material));
  46015. break;
  46016. case "Group":
  46017. s = new n.Group;
  46018. break;
  46019. default:
  46020. s = new n.Object3D
  46021. }
  46022. if (s.uuid = t.uuid,
  46023. void 0 !== t.name && (s.name = t.name),
  46024. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  46025. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  46026. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  46027. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  46028. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  46029. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  46030. void 0 !== t.visible && (s.visible = t.visible),
  46031. void 0 !== t.userData && (s.userData = t.userData),
  46032. void 0 !== t.children)
  46033. for (var h in t.children)
  46034. s.add(this.parseObject(t.children[h], i, r));
  46035. if ("LOD" === t.type)
  46036. for (var u = t.levels, d = 0; d < u.length; d++) {
  46037. var p = u[d]
  46038. , h = s.getObjectByProperty("uuid", p.object);
  46039. void 0 !== h && s.addLevel(h, p.distance)
  46040. }
  46041. return s
  46042. }
  46043. }()
  46044. },
  46045. n.TextureLoader = function(e) {
  46046. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46047. }
  46048. ,
  46049. n.TextureLoader.prototype = {
  46050. constructor: n.TextureLoader,
  46051. load: function(e, t, i, r) {
  46052. var o = new n.Texture
  46053. , a = new n.ImageLoader(this.manager);
  46054. return a.setCrossOrigin(this.crossOrigin),
  46055. a.setPath(this.path),
  46056. a.load(e, function(e) {
  46057. o.image = e,
  46058. o.needsUpdate = !0,
  46059. void 0 !== t && t(o)
  46060. }, i, r),
  46061. o
  46062. },
  46063. setCrossOrigin: function(e) {
  46064. this.crossOrigin = e
  46065. },
  46066. setPath: function(e) {
  46067. this.path = e
  46068. }
  46069. },
  46070. n.CubeTextureLoader = function(e) {
  46071. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46072. }
  46073. ,
  46074. n.CubeTextureLoader.prototype = {
  46075. constructor: n.CubeTextureLoader,
  46076. load: function(e, t, i, r) {
  46077. function o(i) {
  46078. s.load(e[i], function(e) {
  46079. a.images[i] = e,
  46080. l++,
  46081. 6 === l && (a.needsUpdate = !0,
  46082. t && t(a))
  46083. }, void 0, r)
  46084. }
  46085. var a = new n.CubeTexture
  46086. , s = new n.ImageLoader(this.manager);
  46087. s.setCrossOrigin(this.crossOrigin),
  46088. s.setPath(this.path);
  46089. for (var l = 0, c = 0; c < e.length; ++c)
  46090. o(c);
  46091. return a
  46092. },
  46093. setCrossOrigin: function(e) {
  46094. this.crossOrigin = e
  46095. },
  46096. setPath: function(e) {
  46097. this.path = e
  46098. }
  46099. },
  46100. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  46101. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46102. this._parser = null
  46103. }
  46104. ,
  46105. n.BinaryTextureLoader.prototype = {
  46106. constructor: n.BinaryTextureLoader,
  46107. load: function(e, t, i, r) {
  46108. var o = this
  46109. , a = new n.DataTexture
  46110. , s = new n.XHRLoader(this.manager);
  46111. return s.setResponseType("arraybuffer"),
  46112. s.load(e, function(e) {
  46113. var i = o._parser(e);
  46114. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  46115. a.image.height = i.height,
  46116. a.image.data = i.data),
  46117. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  46118. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  46119. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  46120. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  46121. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  46122. void 0 !== i.format && (a.format = i.format),
  46123. void 0 !== i.type && (a.type = i.type),
  46124. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  46125. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  46126. a.needsUpdate = !0,
  46127. t && t(a, i))
  46128. }, i, r),
  46129. a
  46130. }
  46131. },
  46132. n.CompressedTextureLoader = function(e) {
  46133. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46134. this._parser = null
  46135. }
  46136. ;
  46137. n.CompressedTextureLoader.prototype = {
  46138. constructor: n.CompressedTextureLoader,
  46139. load: function(e, t, i, r) {
  46140. function o(o) {
  46141. c.load(e[o], function(e) {
  46142. var i = a._parser(e, !0);
  46143. s[o] = {
  46144. width: i.width,
  46145. height: i.height,
  46146. format: i.format,
  46147. mipmaps: i.mipmaps
  46148. },
  46149. h += 1,
  46150. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46151. l.format = i.format,
  46152. l.needsUpdate = !0,
  46153. t && t(l))
  46154. }, i, r)
  46155. }
  46156. var a = this
  46157. , s = []
  46158. , l = new n.CompressedTexture;
  46159. l.image = s;
  46160. var c = new n.XHRLoader(this.manager);
  46161. if (c.setPath(this.path),
  46162. c.setResponseType("arraybuffer"),
  46163. Array.isArray(e))
  46164. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  46165. o(u);
  46166. else
  46167. c.load(e, function(e) {
  46168. var i = a._parser(e, !0);
  46169. if (i.isCubemap)
  46170. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  46171. s[o] = {
  46172. mipmaps: []
  46173. };
  46174. for (var c = 0; c < i.mipmapCount; c++)
  46175. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  46176. s[o].format = i.format,
  46177. s[o].width = i.width,
  46178. s[o].height = i.height
  46179. }
  46180. else
  46181. l.image.width = i.width,
  46182. l.image.height = i.height,
  46183. l.mipmaps = i.mipmaps;
  46184. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46185. l.format = i.format,
  46186. l.needsUpdate = !0,
  46187. t && t(l)
  46188. }, i, r);
  46189. return l
  46190. },
  46191. setPath: function(e) {
  46192. this.path = e
  46193. }
  46194. };
  46195. n.Material = function() {
  46196. Object.defineProperty(this, "id", {
  46197. value: n.MaterialIdCount++
  46198. }),
  46199. this.uuid = n.Math.generateUUID(),
  46200. this.name = "",
  46201. this.type = "Material",
  46202. this.side = n.FrontSide,
  46203. this.opacity = 1,
  46204. this.transparent = !1,
  46205. this.blending = n.NormalBlending,
  46206. this.blendSrc = n.SrcAlphaFactor,
  46207. this.blendDst = n.OneMinusSrcAlphaFactor,
  46208. this.blendEquation = n.AddEquation,
  46209. this.blendSrcAlpha = null,
  46210. this.blendDstAlpha = null,
  46211. this.blendEquationAlpha = null,
  46212. this.depthFunc = n.LessEqualDepth,
  46213. this.depthTest = !0,
  46214. this.depthWrite = !0,
  46215. this.colorWrite = !0,
  46216. this.precision = null,
  46217. this.polygonOffset = !1,
  46218. this.polygonOffsetFactor = 0,
  46219. this.polygonOffsetUnits = 0,
  46220. this.alphaTest = 0,
  46221. this.premultipliedAlpha = !1,
  46222. this.overdraw = 0,
  46223. this.visible = !0,
  46224. this._needsUpdate = !0
  46225. }
  46226. ,
  46227. n.Material.prototype = {
  46228. constructor: n.Material,
  46229. get needsUpdate() {
  46230. return this._needsUpdate
  46231. },
  46232. set needsUpdate(e) {
  46233. e === !0 && this.update(),
  46234. this._needsUpdate = e
  46235. },
  46236. setValues: function(e) {
  46237. if (void 0 !== e)
  46238. for (var t in e) {
  46239. var i = e[t];
  46240. if (void 0 !== i) {
  46241. var r = this[t];
  46242. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  46243. } else
  46244. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46245. }
  46246. },
  46247. toJSON: function(e) {
  46248. function t(e) {
  46249. var t = [];
  46250. for (var i in e) {
  46251. var n = e[i];
  46252. delete n.metadata,
  46253. t.push(n)
  46254. }
  46255. return t
  46256. }
  46257. var i = void 0 === e;
  46258. i && (e = {
  46259. textures: {},
  46260. images: {}
  46261. });
  46262. var r = {
  46263. metadata: {
  46264. version: 4.4,
  46265. type: "Material",
  46266. generator: "Material.toJSON"
  46267. }
  46268. };
  46269. if (r.uuid = this.uuid,
  46270. r.type = this.type,
  46271. "" !== this.name && (r.name = this.name),
  46272. this.color instanceof n.Color && (r.color = this.color.getHex()),
  46273. .5 !== this.roughness && (r.roughness = this.roughness),
  46274. .5 !== this.metalness && (r.metalness = this.metalness),
  46275. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  46276. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  46277. void 0 !== this.shininess && (r.shininess = this.shininess),
  46278. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  46279. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  46280. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  46281. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  46282. r.bumpScale = this.bumpScale),
  46283. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  46284. r.normalScale = this.normalScale.toArray()),
  46285. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  46286. r.displacementScale = this.displacementScale,
  46287. r.displacementBias = this.displacementBias),
  46288. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46289. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46290. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46291. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  46292. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  46293. r.reflectivity = this.reflectivity),
  46294. void 0 !== this.size && (r.size = this.size),
  46295. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  46296. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  46297. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  46298. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  46299. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  46300. this.opacity < 1 && (r.opacity = this.opacity),
  46301. this.transparent === !0 && (r.transparent = this.transparent),
  46302. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  46303. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  46304. this.wireframe === !0 && (r.wireframe = this.wireframe),
  46305. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  46306. i) {
  46307. var o = t(e.textures)
  46308. , a = t(e.images);
  46309. o.length > 0 && (r.textures = o),
  46310. a.length > 0 && (r.images = a)
  46311. }
  46312. return r
  46313. },
  46314. clone: function() {
  46315. return (new this.constructor).copy(this)
  46316. },
  46317. copy: function(e) {
  46318. return this.name = e.name,
  46319. this.side = e.side,
  46320. this.opacity = e.opacity,
  46321. this.transparent = e.transparent,
  46322. this.blending = e.blending,
  46323. this.blendSrc = e.blendSrc,
  46324. this.blendDst = e.blendDst,
  46325. this.blendEquation = e.blendEquation,
  46326. this.blendSrcAlpha = e.blendSrcAlpha,
  46327. this.blendDstAlpha = e.blendDstAlpha,
  46328. this.blendEquationAlpha = e.blendEquationAlpha,
  46329. this.depthFunc = e.depthFunc,
  46330. this.depthTest = e.depthTest,
  46331. this.depthWrite = e.depthWrite,
  46332. this.colorWrite = e.colorWrite,
  46333. this.precision = e.precision,
  46334. this.polygonOffset = e.polygonOffset,
  46335. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46336. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46337. this.alphaTest = e.alphaTest,
  46338. this.premultipliedAlpha = e.premultipliedAlpha,
  46339. this.overdraw = e.overdraw,
  46340. this.visible = e.visible,
  46341. this
  46342. },
  46343. update: function() {
  46344. this.dispatchEvent({
  46345. type: "update"
  46346. })
  46347. },
  46348. dispose: function() {
  46349. this.dispatchEvent({
  46350. type: "dispose"
  46351. })
  46352. }
  46353. },
  46354. n.EventDispatcher.prototype.apply(n.Material.prototype),
  46355. n.MaterialIdCount = 0,
  46356. n.LineBasicMaterial = function(e) {
  46357. n.Material.call(this),
  46358. this.type = "LineBasicMaterial",
  46359. this.color = new n.Color(16777215),
  46360. this.linewidth = 1,
  46361. this.linecap = "round",
  46362. this.linejoin = "round",
  46363. this.blending = n.NormalBlending,
  46364. this.vertexColors = n.NoColors,
  46365. this.fog = !0,
  46366. this.setValues(e)
  46367. }
  46368. ,
  46369. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  46370. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  46371. n.LineBasicMaterial.prototype.copy = function(e) {
  46372. return n.Material.prototype.copy.call(this, e),
  46373. this.color.copy(e.color),
  46374. this.linewidth = e.linewidth,
  46375. this.linecap = e.linecap,
  46376. this.linejoin = e.linejoin,
  46377. this.vertexColors = e.vertexColors,
  46378. this.fog = e.fog,
  46379. this
  46380. }
  46381. ,
  46382. n.LineDashedMaterial = function(e) {
  46383. n.Material.call(this),
  46384. this.type = "LineDashedMaterial",
  46385. this.color = new n.Color(16777215),
  46386. this.linewidth = 1,
  46387. this.scale = 1,
  46388. this.dashSize = 3,
  46389. this.gapSize = 1,
  46390. this.blending = n.NormalBlending,
  46391. this.vertexColors = n.NoColors,
  46392. this.fog = !0,
  46393. this.setValues(e)
  46394. }
  46395. ,
  46396. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  46397. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  46398. n.LineDashedMaterial.prototype.copy = function(e) {
  46399. return n.Material.prototype.copy.call(this, e),
  46400. this.color.copy(e.color),
  46401. this.linewidth = e.linewidth,
  46402. this.scale = e.scale,
  46403. this.dashSize = e.dashSize,
  46404. this.gapSize = e.gapSize,
  46405. this.vertexColors = e.vertexColors,
  46406. this.fog = e.fog,
  46407. this
  46408. }
  46409. ,
  46410. n.MeshBasicMaterial = function(e) {
  46411. n.Material.call(this),
  46412. this.type = "MeshBasicMaterial",
  46413. this.color = new n.Color(16777215),
  46414. this.map = null,
  46415. this.aoMap = null,
  46416. this.aoMapIntensity = 1,
  46417. this.specularMap = null,
  46418. this.alphaMap = null,
  46419. this.envMap = null,
  46420. this.combine = n.MultiplyOperation,
  46421. this.reflectivity = 1,
  46422. this.refractionRatio = .98,
  46423. this.fog = !0,
  46424. this.shading = n.SmoothShading,
  46425. this.blending = n.NormalBlending,
  46426. this.wireframe = !1,
  46427. this.wireframeLinewidth = 1,
  46428. this.wireframeLinecap = "round",
  46429. this.wireframeLinejoin = "round",
  46430. this.vertexColors = n.NoColors,
  46431. this.skinning = !1,
  46432. this.morphTargets = !1,
  46433. this.setValues(e)
  46434. }
  46435. ,
  46436. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  46437. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  46438. n.MeshBasicMaterial.prototype.copy = function(e) {
  46439. return n.Material.prototype.copy.call(this, e),
  46440. this.color.copy(e.color),
  46441. this.map = e.map,
  46442. this.aoMap = e.aoMap,
  46443. this.aoMapIntensity = e.aoMapIntensity,
  46444. this.specularMap = e.specularMap,
  46445. this.alphaMap = e.alphaMap,
  46446. this.envMap = e.envMap,
  46447. this.combine = e.combine,
  46448. this.reflectivity = e.reflectivity,
  46449. this.refractionRatio = e.refractionRatio,
  46450. this.fog = e.fog,
  46451. this.shading = e.shading,
  46452. this.wireframe = e.wireframe,
  46453. this.wireframeLinewidth = e.wireframeLinewidth,
  46454. this.wireframeLinecap = e.wireframeLinecap,
  46455. this.wireframeLinejoin = e.wireframeLinejoin,
  46456. this.vertexColors = e.vertexColors,
  46457. this.skinning = e.skinning,
  46458. this.morphTargets = e.morphTargets,
  46459. this
  46460. }
  46461. ,
  46462. n.MeshLambertMaterial = function(e) {
  46463. n.Material.call(this),
  46464. this.type = "MeshLambertMaterial",
  46465. this.color = new n.Color(16777215),
  46466. this.map = null,
  46467. this.lightMap = null,
  46468. this.lightMapIntensity = 1,
  46469. this.aoMap = null,
  46470. this.aoMapIntensity = 1,
  46471. this.emissive = new n.Color(0),
  46472. this.emissiveIntensity = 1,
  46473. this.emissiveMap = null,
  46474. this.specularMap = null,
  46475. this.alphaMap = null,
  46476. this.envMap = null,
  46477. this.combine = n.MultiplyOperation,
  46478. this.reflectivity = 1,
  46479. this.refractionRatio = .98,
  46480. this.fog = !0,
  46481. this.blending = n.NormalBlending,
  46482. this.wireframe = !1,
  46483. this.wireframeLinewidth = 1,
  46484. this.wireframeLinecap = "round",
  46485. this.wireframeLinejoin = "round",
  46486. this.vertexColors = n.NoColors,
  46487. this.skinning = !1,
  46488. this.morphTargets = !1,
  46489. this.morphNormals = !1,
  46490. this.setValues(e)
  46491. }
  46492. ,
  46493. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  46494. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  46495. n.MeshLambertMaterial.prototype.copy = function(e) {
  46496. return n.Material.prototype.copy.call(this, e),
  46497. this.color.copy(e.color),
  46498. this.map = e.map,
  46499. this.lightMap = e.lightMap,
  46500. this.lightMapIntensity = e.lightMapIntensity,
  46501. this.aoMap = e.aoMap,
  46502. this.aoMapIntensity = e.aoMapIntensity,
  46503. this.emissive.copy(e.emissive),
  46504. this.emissiveMap = e.emissiveMap,
  46505. this.emissiveIntensity = e.emissiveIntensity,
  46506. this.specularMap = e.specularMap,
  46507. this.alphaMap = e.alphaMap,
  46508. this.envMap = e.envMap,
  46509. this.combine = e.combine,
  46510. this.reflectivity = e.reflectivity,
  46511. this.refractionRatio = e.refractionRatio,
  46512. this.fog = e.fog,
  46513. this.wireframe = e.wireframe,
  46514. this.wireframeLinewidth = e.wireframeLinewidth,
  46515. this.wireframeLinecap = e.wireframeLinecap,
  46516. this.wireframeLinejoin = e.wireframeLinejoin,
  46517. this.vertexColors = e.vertexColors,
  46518. this.skinning = e.skinning,
  46519. this.morphTargets = e.morphTargets,
  46520. this.morphNormals = e.morphNormals,
  46521. this
  46522. }
  46523. ,
  46524. n.MeshPhongMaterial = function(e) {
  46525. n.Material.call(this),
  46526. this.type = "MeshPhongMaterial",
  46527. this.color = new n.Color(16777215),
  46528. this.specular = new n.Color(1118481),
  46529. this.shininess = 30,
  46530. this.map = null,
  46531. this.lightMap = null,
  46532. this.lightMapIntensity = 1,
  46533. this.aoMap = null,
  46534. this.aoMapIntensity = 1,
  46535. this.emissive = new n.Color(0),
  46536. this.emissiveIntensity = 1,
  46537. this.emissiveMap = null,
  46538. this.bumpMap = null,
  46539. this.bumpScale = 1,
  46540. this.normalMap = null,
  46541. this.normalScale = new n.Vector2(1,1),
  46542. this.displacementMap = null,
  46543. this.displacementScale = 1,
  46544. this.displacementBias = 0,
  46545. this.specularMap = null,
  46546. this.alphaMap = null,
  46547. this.envMap = null,
  46548. this.combine = n.MultiplyOperation,
  46549. this.reflectivity = 1,
  46550. this.refractionRatio = .98,
  46551. this.fog = !0,
  46552. this.shading = n.SmoothShading,
  46553. this.blending = n.NormalBlending,
  46554. this.wireframe = !1,
  46555. this.wireframeLinewidth = 1,
  46556. this.wireframeLinecap = "round",
  46557. this.wireframeLinejoin = "round",
  46558. this.vertexColors = n.NoColors,
  46559. this.skinning = !1,
  46560. this.morphTargets = !1,
  46561. this.morphNormals = !1,
  46562. this.setValues(e)
  46563. }
  46564. ,
  46565. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  46566. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  46567. n.MeshPhongMaterial.prototype.copy = function(e) {
  46568. return n.Material.prototype.copy.call(this, e),
  46569. this.color.copy(e.color),
  46570. this.specular.copy(e.specular),
  46571. this.shininess = e.shininess,
  46572. this.map = e.map,
  46573. this.lightMap = e.lightMap,
  46574. this.lightMapIntensity = e.lightMapIntensity,
  46575. this.aoMap = e.aoMap,
  46576. this.aoMapIntensity = e.aoMapIntensity,
  46577. this.emissive.copy(e.emissive),
  46578. this.emissiveMap = e.emissiveMap,
  46579. this.emissiveIntensity = e.emissiveIntensity,
  46580. this.bumpMap = e.bumpMap,
  46581. this.bumpScale = e.bumpScale,
  46582. this.normalMap = e.normalMap,
  46583. this.normalScale.copy(e.normalScale),
  46584. this.displacementMap = e.displacementMap,
  46585. this.displacementScale = e.displacementScale,
  46586. this.displacementBias = e.displacementBias,
  46587. this.specularMap = e.specularMap,
  46588. this.alphaMap = e.alphaMap,
  46589. this.envMap = e.envMap,
  46590. this.combine = e.combine,
  46591. this.reflectivity = e.reflectivity,
  46592. this.refractionRatio = e.refractionRatio,
  46593. this.fog = e.fog,
  46594. this.shading = e.shading,
  46595. this.wireframe = e.wireframe,
  46596. this.wireframeLinewidth = e.wireframeLinewidth,
  46597. this.wireframeLinecap = e.wireframeLinecap,
  46598. this.wireframeLinejoin = e.wireframeLinejoin,
  46599. this.vertexColors = e.vertexColors,
  46600. this.skinning = e.skinning,
  46601. this.morphTargets = e.morphTargets,
  46602. this.morphNormals = e.morphNormals,
  46603. this
  46604. }
  46605. ,
  46606. n.MeshStandardMaterial = function(e) {
  46607. n.Material.call(this),
  46608. this.type = "MeshStandardMaterial",
  46609. this.color = new n.Color(16777215),
  46610. this.roughness = .5,
  46611. this.metalness = .5,
  46612. this.map = null,
  46613. this.lightMap = null,
  46614. this.lightMapIntensity = 1,
  46615. this.aoMap = null,
  46616. this.aoMapIntensity = 1,
  46617. this.emissive = new n.Color(0),
  46618. this.emissiveIntensity = 1,
  46619. this.emissiveMap = null,
  46620. this.bumpMap = null,
  46621. this.bumpScale = 1,
  46622. this.normalMap = null,
  46623. this.normalScale = new n.Vector2(1,1),
  46624. this.displacementMap = null,
  46625. this.displacementScale = 1,
  46626. this.displacementBias = 0,
  46627. this.roughnessMap = null,
  46628. this.metalnessMap = null,
  46629. this.alphaMap = null,
  46630. this.envMap = null,
  46631. this.envMapIntensity = 1,
  46632. this.refractionRatio = .98,
  46633. this.fog = !0,
  46634. this.shading = n.SmoothShading,
  46635. this.blending = n.NormalBlending,
  46636. this.wireframe = !1,
  46637. this.wireframeLinewidth = 1,
  46638. this.wireframeLinecap = "round",
  46639. this.wireframeLinejoin = "round",
  46640. this.vertexColors = n.NoColors,
  46641. this.skinning = !1,
  46642. this.morphTargets = !1,
  46643. this.morphNormals = !1,
  46644. this.setValues(e)
  46645. }
  46646. ,
  46647. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  46648. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  46649. n.MeshStandardMaterial.prototype.copy = function(e) {
  46650. return n.Material.prototype.copy.call(this, e),
  46651. this.color.copy(e.color),
  46652. this.roughness = e.roughness,
  46653. this.metalness = e.metalness,
  46654. this.map = e.map,
  46655. this.lightMap = e.lightMap,
  46656. this.lightMapIntensity = e.lightMapIntensity,
  46657. this.aoMap = e.aoMap,
  46658. this.aoMapIntensity = e.aoMapIntensity,
  46659. this.emissive.copy(e.emissive),
  46660. this.emissiveMap = e.emissiveMap,
  46661. this.emissiveIntensity = e.emissiveIntensity,
  46662. this.bumpMap = e.bumpMap,
  46663. this.bumpScale = e.bumpScale,
  46664. this.normalMap = e.normalMap,
  46665. this.normalScale.copy(e.normalScale),
  46666. this.displacementMap = e.displacementMap,
  46667. this.displacementScale = e.displacementScale,
  46668. this.displacementBias = e.displacementBias,
  46669. this.roughnessMap = e.roughnessMap,
  46670. this.metalnessMap = e.metalnessMap,
  46671. this.alphaMap = e.alphaMap,
  46672. this.envMap = e.envMap,
  46673. this.envMapIntensity = e.envMapIntensity,
  46674. this.refractionRatio = e.refractionRatio,
  46675. this.fog = e.fog,
  46676. this.shading = e.shading,
  46677. this.wireframe = e.wireframe,
  46678. this.wireframeLinewidth = e.wireframeLinewidth,
  46679. this.wireframeLinecap = e.wireframeLinecap,
  46680. this.wireframeLinejoin = e.wireframeLinejoin,
  46681. this.vertexColors = e.vertexColors,
  46682. this.skinning = e.skinning,
  46683. this.morphTargets = e.morphTargets,
  46684. this.morphNormals = e.morphNormals,
  46685. this
  46686. }
  46687. ,
  46688. n.MeshDepthMaterial = function(e) {
  46689. n.Material.call(this),
  46690. this.type = "MeshDepthMaterial",
  46691. this.morphTargets = !1,
  46692. this.wireframe = !1,
  46693. this.wireframeLinewidth = 1,
  46694. this.setValues(e)
  46695. }
  46696. ,
  46697. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  46698. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  46699. n.MeshDepthMaterial.prototype.copy = function(e) {
  46700. return n.Material.prototype.copy.call(this, e),
  46701. this.wireframe = e.wireframe,
  46702. this.wireframeLinewidth = e.wireframeLinewidth,
  46703. this
  46704. }
  46705. ,
  46706. n.MeshNormalMaterial = function(e) {
  46707. n.Material.call(this, e),
  46708. this.type = "MeshNormalMaterial",
  46709. this.wireframe = !1,
  46710. this.wireframeLinewidth = 1,
  46711. this.morphTargets = !1,
  46712. this.setValues(e)
  46713. }
  46714. ,
  46715. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  46716. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  46717. n.MeshNormalMaterial.prototype.copy = function(e) {
  46718. return n.Material.prototype.copy.call(this, e),
  46719. this.wireframe = e.wireframe,
  46720. this.wireframeLinewidth = e.wireframeLinewidth,
  46721. this
  46722. }
  46723. ,
  46724. n.MultiMaterial = function(e) {
  46725. this.uuid = n.Math.generateUUID(),
  46726. this.type = "MultiMaterial",
  46727. this.materials = e instanceof Array ? e : [],
  46728. this.visible = !0
  46729. }
  46730. ,
  46731. n.MultiMaterial.prototype = {
  46732. constructor: n.MultiMaterial,
  46733. toJSON: function(e) {
  46734. for (var t = {
  46735. metadata: {
  46736. version: 4.2,
  46737. type: "material",
  46738. generator: "MaterialExporter"
  46739. },
  46740. uuid: this.uuid,
  46741. type: this.type,
  46742. materials: []
  46743. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46744. var o = i[n].toJSON(e);
  46745. delete o.metadata,
  46746. t.materials.push(o)
  46747. }
  46748. return t.visible = this.visible,
  46749. t
  46750. },
  46751. clone: function() {
  46752. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46753. e.materials.push(this.materials[t].clone());
  46754. return e.visible = this.visible,
  46755. e
  46756. }
  46757. },
  46758. n.PointsMaterial = function(e) {
  46759. n.Material.call(this),
  46760. this.type = "PointsMaterial",
  46761. this.color = new n.Color(16777215),
  46762. this.map = null,
  46763. this.size = 1,
  46764. this.sizeAttenuation = !0,
  46765. this.blending = n.NormalBlending,
  46766. this.vertexColors = n.NoColors,
  46767. this.fog = !0,
  46768. this.setValues(e)
  46769. }
  46770. ,
  46771. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  46772. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  46773. n.PointsMaterial.prototype.copy = function(e) {
  46774. return n.Material.prototype.copy.call(this, e),
  46775. this.color.copy(e.color),
  46776. this.map = e.map,
  46777. this.size = e.size,
  46778. this.sizeAttenuation = e.sizeAttenuation,
  46779. this.vertexColors = e.vertexColors,
  46780. this.fog = e.fog,
  46781. this
  46782. }
  46783. ,
  46784. n.ShaderMaterial = function(e) {
  46785. n.Material.call(this),
  46786. this.type = "ShaderMaterial",
  46787. this.defines = {},
  46788. this.uniforms = {},
  46789. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46790. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46791. this.shading = n.SmoothShading,
  46792. this.linewidth = 1,
  46793. this.wireframe = !1,
  46794. this.wireframeLinewidth = 1,
  46795. this.fog = !1,
  46796. this.lights = !1,
  46797. this.vertexColors = n.NoColors,
  46798. this.skinning = !1,
  46799. this.morphTargets = !1,
  46800. this.morphNormals = !1,
  46801. this.extensions = {
  46802. derivatives: !1,
  46803. fragDepth: !1,
  46804. drawBuffers: !1,
  46805. shaderTextureLOD: !1
  46806. },
  46807. this.defaultAttributeValues = {
  46808. color: [1, 1, 1],
  46809. uv: [0, 0],
  46810. uv2: [0, 0]
  46811. },
  46812. this.index0AttributeName = void 0,
  46813. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46814. this.setValues(e))
  46815. }
  46816. ,
  46817. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  46818. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  46819. n.ShaderMaterial.prototype.copy = function(e) {
  46820. return n.Material.prototype.copy.call(this, e),
  46821. this.fragmentShader = e.fragmentShader,
  46822. this.vertexShader = e.vertexShader,
  46823. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  46824. this.defines = e.defines,
  46825. this.shading = e.shading,
  46826. this.wireframe = e.wireframe,
  46827. this.wireframeLinewidth = e.wireframeLinewidth,
  46828. this.fog = e.fog,
  46829. this.lights = e.lights,
  46830. this.vertexColors = e.vertexColors,
  46831. this.skinning = e.skinning,
  46832. this.morphTargets = e.morphTargets,
  46833. this.morphNormals = e.morphNormals,
  46834. this.extensions = e.extensions,
  46835. this
  46836. }
  46837. ,
  46838. n.ShaderMaterial.prototype.toJSON = function(e) {
  46839. var t = n.Material.prototype.toJSON.call(this, e);
  46840. return t.uniforms = this.uniforms,
  46841. t.vertexShader = this.vertexShader,
  46842. t.fragmentShader = this.fragmentShader,
  46843. t
  46844. }
  46845. ,
  46846. n.RawShaderMaterial = function(e) {
  46847. n.ShaderMaterial.call(this, e),
  46848. this.type = "RawShaderMaterial"
  46849. }
  46850. ,
  46851. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  46852. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  46853. n.SpriteMaterial = function(e) {
  46854. n.Material.call(this),
  46855. this.type = "SpriteMaterial",
  46856. this.color = new n.Color(16777215),
  46857. this.map = null,
  46858. this.rotation = 0,
  46859. this.fog = !1,
  46860. this.setValues(e)
  46861. }
  46862. ,
  46863. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  46864. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  46865. n.SpriteMaterial.prototype.copy = function(e) {
  46866. return n.Material.prototype.copy.call(this, e),
  46867. this.color.copy(e.color),
  46868. this.map = e.map,
  46869. this.rotation = e.rotation,
  46870. this.fog = e.fog,
  46871. this
  46872. }
  46873. ,
  46874. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  46875. Object.defineProperty(this, "id", {
  46876. value: n.TextureIdCount++
  46877. }),
  46878. this.uuid = n.Math.generateUUID(),
  46879. this.name = "",
  46880. this.sourceFile = "",
  46881. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  46882. this.mipmaps = [],
  46883. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  46884. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  46885. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  46886. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  46887. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  46888. this.anisotropy = void 0 !== c ? c : 1,
  46889. this.format = void 0 !== s ? s : n.RGBAFormat,
  46890. this.type = void 0 !== l ? l : n.UnsignedByteType,
  46891. this.offset = new n.Vector2(0,0),
  46892. this.repeat = new n.Vector2(1,1),
  46893. this.generateMipmaps = !0,
  46894. this.premultiplyAlpha = !1,
  46895. this.flipY = !0,
  46896. this.unpackAlignment = 4,
  46897. this.encoding = n.LinearEncoding,
  46898. this.version = 0,
  46899. this.onUpdate = null
  46900. }
  46901. ,
  46902. n.Texture.DEFAULT_IMAGE = void 0,
  46903. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  46904. n.Texture.prototype = {
  46905. constructor: n.Texture,
  46906. set needsUpdate(e) {
  46907. e === !0 && this.version++
  46908. },
  46909. clone: function() {
  46910. return (new this.constructor).copy(this)
  46911. },
  46912. copy: function(e) {
  46913. return this.image = e.image,
  46914. this.mipmaps = e.mipmaps.slice(0),
  46915. this.mapping = e.mapping,
  46916. this.wrapS = e.wrapS,
  46917. this.wrapT = e.wrapT,
  46918. this.magFilter = e.magFilter,
  46919. this.minFilter = e.minFilter,
  46920. this.anisotropy = e.anisotropy,
  46921. this.format = e.format,
  46922. this.type = e.type,
  46923. this.offset.copy(e.offset),
  46924. this.repeat.copy(e.repeat),
  46925. this.generateMipmaps = e.generateMipmaps,
  46926. this.premultiplyAlpha = e.premultiplyAlpha,
  46927. this.flipY = e.flipY,
  46928. this.unpackAlignment = e.unpackAlignment,
  46929. this.encoding = e.encoding,
  46930. this
  46931. },
  46932. toJSON: function(e) {
  46933. function t(e) {
  46934. var t;
  46935. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  46936. t.width = e.width,
  46937. t.height = e.height,
  46938. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  46939. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  46940. }
  46941. if (void 0 !== e.textures[this.uuid])
  46942. return e.textures[this.uuid];
  46943. var i = {
  46944. metadata: {
  46945. version: 4.4,
  46946. type: "Texture",
  46947. generator: "Texture.toJSON"
  46948. },
  46949. uuid: this.uuid,
  46950. name: this.name,
  46951. mapping: this.mapping,
  46952. repeat: [this.repeat.x, this.repeat.y],
  46953. offset: [this.offset.x, this.offset.y],
  46954. wrap: [this.wrapS, this.wrapT],
  46955. minFilter: this.minFilter,
  46956. magFilter: this.magFilter,
  46957. anisotropy: this.anisotropy
  46958. };
  46959. if (void 0 !== this.image) {
  46960. var r = this.image;
  46961. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  46962. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46963. uuid: r.uuid,
  46964. url: t(r)
  46965. }),
  46966. i.image = r.uuid
  46967. }
  46968. return e.textures[this.uuid] = i,
  46969. i
  46970. },
  46971. dispose: function() {
  46972. this.dispatchEvent({
  46973. type: "dispose"
  46974. })
  46975. },
  46976. transformUv: function(e) {
  46977. if (this.mapping === n.UVMapping) {
  46978. if (e.multiply(this.repeat),
  46979. e.add(this.offset),
  46980. e.x < 0 || e.x > 1)
  46981. switch (this.wrapS) {
  46982. case n.RepeatWrapping:
  46983. e.x = e.x - Math.floor(e.x);
  46984. break;
  46985. case n.ClampToEdgeWrapping:
  46986. e.x = e.x < 0 ? 0 : 1;
  46987. break;
  46988. case n.MirroredRepeatWrapping:
  46989. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46990. }
  46991. if (e.y < 0 || e.y > 1)
  46992. switch (this.wrapT) {
  46993. case n.RepeatWrapping:
  46994. e.y = e.y - Math.floor(e.y);
  46995. break;
  46996. case n.ClampToEdgeWrapping:
  46997. e.y = e.y < 0 ? 0 : 1;
  46998. break;
  46999. case n.MirroredRepeatWrapping:
  47000. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47001. }
  47002. this.flipY && (e.y = 1 - e.y)
  47003. }
  47004. }
  47005. },
  47006. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  47007. n.TextureIdCount = 0,
  47008. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  47009. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47010. this.needsUpdate = !0
  47011. }
  47012. ,
  47013. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  47014. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  47015. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  47016. e = void 0 !== e ? e : [],
  47017. t = void 0 !== t ? t : n.CubeReflectionMapping,
  47018. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47019. this.flipY = !1
  47020. }
  47021. ,
  47022. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  47023. n.CubeTexture.prototype.constructor = n.CubeTexture,
  47024. Object.defineProperty(n.CubeTexture.prototype, "images", {
  47025. get: function() {
  47026. return this.image
  47027. },
  47028. set: function(e) {
  47029. this.image = e
  47030. }
  47031. }),
  47032. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47033. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47034. this.image = {
  47035. width: t,
  47036. height: i
  47037. },
  47038. this.mipmaps = e,
  47039. this.flipY = !1,
  47040. this.generateMipmaps = !1
  47041. }
  47042. ,
  47043. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  47044. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  47045. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47046. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47047. this.image = {
  47048. data: e,
  47049. width: t,
  47050. height: i
  47051. },
  47052. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  47053. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  47054. this.flipY = !1,
  47055. this.generateMipmaps = !1
  47056. }
  47057. ,
  47058. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  47059. n.DataTexture.prototype.constructor = n.DataTexture,
  47060. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  47061. function h() {
  47062. requestAnimationFrame(h),
  47063. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  47064. }
  47065. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47066. this.generateMipmaps = !1;
  47067. var u = this;
  47068. h()
  47069. }
  47070. ,
  47071. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  47072. n.VideoTexture.prototype.constructor = n.VideoTexture,
  47073. n.Group = function() {
  47074. n.Object3D.call(this),
  47075. this.type = "Group"
  47076. }
  47077. ,
  47078. n.Group.prototype = Object.create(n.Object3D.prototype),
  47079. n.Group.prototype.constructor = n.Group,
  47080. n.Points = function(e, t) {
  47081. n.Object3D.call(this),
  47082. this.type = "Points",
  47083. this.geometry = void 0 !== e ? e : new n.Geometry,
  47084. this.material = void 0 !== t ? t : new n.PointsMaterial({
  47085. color: 16777215 * Math.random()
  47086. })
  47087. }
  47088. ,
  47089. n.Points.prototype = Object.create(n.Object3D.prototype),
  47090. n.Points.prototype.constructor = n.Points,
  47091. n.Points.prototype.raycast = function() {
  47092. var e = new n.Matrix4
  47093. , t = new n.Ray
  47094. , i = new n.Sphere;
  47095. return function(r, o) {
  47096. function a(e, i) {
  47097. var n = t.distanceSqToPoint(e);
  47098. if (n < d) {
  47099. var a = t.closestPointToPoint(e);
  47100. a.applyMatrix4(c);
  47101. var l = r.ray.origin.distanceTo(a);
  47102. if (l < r.near || l > r.far)
  47103. return;
  47104. o.push({
  47105. distance: l,
  47106. distanceToRay: Math.sqrt(n),
  47107. point: a.clone(),
  47108. index: i,
  47109. face: null,
  47110. object: s
  47111. })
  47112. }
  47113. }
  47114. var s = this
  47115. , l = this.geometry
  47116. , c = this.matrixWorld
  47117. , h = r.params.Points.threshold;
  47118. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47119. i.copy(l.boundingSphere),
  47120. i.applyMatrix4(c),
  47121. r.ray.intersectsSphere(i) !== !1) {
  47122. e.getInverse(c),
  47123. t.copy(r.ray).applyMatrix4(e);
  47124. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47125. , d = u * u
  47126. , p = new n.Vector3;
  47127. if (l instanceof n.BufferGeometry) {
  47128. var f = l.index
  47129. , g = l.attributes
  47130. , m = g.position.array;
  47131. if (null !== f)
  47132. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  47133. var C = v[A];
  47134. p.fromArray(m, 3 * C),
  47135. a(p, C)
  47136. }
  47137. else
  47138. for (var A = 0, I = m.length / 3; A < I; A++)
  47139. p.fromArray(m, 3 * A),
  47140. a(p, A)
  47141. } else
  47142. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  47143. a(E[A], A)
  47144. }
  47145. }
  47146. }(),
  47147. n.Points.prototype.clone = function() {
  47148. return new this.constructor(this.geometry,this.material).copy(this)
  47149. }
  47150. ,
  47151. n.Line = function(e, t, i) {
  47152. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47153. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  47154. this.type = "Line",
  47155. this.geometry = void 0 !== e ? e : new n.Geometry,
  47156. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  47157. color: 16777215 * Math.random()
  47158. })))
  47159. }
  47160. ,
  47161. n.Line.prototype = Object.create(n.Object3D.prototype),
  47162. n.Line.prototype.constructor = n.Line,
  47163. n.Line.prototype.raycast = function() {
  47164. var e = new n.Matrix4
  47165. , t = new n.Ray
  47166. , i = new n.Sphere;
  47167. return function(r, o) {
  47168. var a = r.linePrecision
  47169. , s = a * a
  47170. , l = this.geometry
  47171. , c = this.matrixWorld;
  47172. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47173. i.copy(l.boundingSphere),
  47174. i.applyMatrix4(c),
  47175. r.ray.intersectsSphere(i) !== !1) {
  47176. e.getInverse(c),
  47177. t.copy(r.ray).applyMatrix4(e);
  47178. var h = new n.Vector3
  47179. , u = new n.Vector3
  47180. , d = new n.Vector3
  47181. , p = new n.Vector3
  47182. , f = this instanceof n.LineSegments ? 2 : 1;
  47183. if (l instanceof n.BufferGeometry) {
  47184. var g = l.index
  47185. , m = l.attributes
  47186. , v = m.position.array;
  47187. if (null !== g)
  47188. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  47189. var I = A[y]
  47190. , E = A[y + 1];
  47191. h.fromArray(v, 3 * I),
  47192. u.fromArray(v, 3 * E);
  47193. var b = t.distanceSqToSegment(h, u, p, d);
  47194. if (!(b > s)) {
  47195. p.applyMatrix4(this.matrixWorld);
  47196. var w = r.ray.origin.distanceTo(p);
  47197. w < r.near || w > r.far || o.push({
  47198. distance: w,
  47199. point: d.clone().applyMatrix4(this.matrixWorld),
  47200. index: y,
  47201. face: null,
  47202. faceIndex: null,
  47203. object: this
  47204. })
  47205. }
  47206. }
  47207. else
  47208. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  47209. h.fromArray(v, 3 * y),
  47210. u.fromArray(v, 3 * y + 3);
  47211. var b = t.distanceSqToSegment(h, u, p, d);
  47212. if (!(b > s)) {
  47213. p.applyMatrix4(this.matrixWorld);
  47214. var w = r.ray.origin.distanceTo(p);
  47215. w < r.near || w > r.far || o.push({
  47216. distance: w,
  47217. point: d.clone().applyMatrix4(this.matrixWorld),
  47218. index: y,
  47219. face: null,
  47220. faceIndex: null,
  47221. object: this
  47222. })
  47223. }
  47224. }
  47225. } else if (l instanceof n.Geometry)
  47226. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  47227. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  47228. if (!(b > s)) {
  47229. p.applyMatrix4(this.matrixWorld);
  47230. var w = r.ray.origin.distanceTo(p);
  47231. w < r.near || w > r.far || o.push({
  47232. distance: w,
  47233. point: d.clone().applyMatrix4(this.matrixWorld),
  47234. index: y,
  47235. face: null,
  47236. faceIndex: null,
  47237. object: this
  47238. })
  47239. }
  47240. }
  47241. }
  47242. }
  47243. }(),
  47244. n.Line.prototype.clone = function() {
  47245. return new this.constructor(this.geometry,this.material).copy(this)
  47246. }
  47247. ,
  47248. n.LineStrip = 0,
  47249. n.LinePieces = 1,
  47250. n.LineSegments = function(e, t) {
  47251. n.Line.call(this, e, t),
  47252. this.type = "LineSegments"
  47253. }
  47254. ,
  47255. n.LineSegments.prototype = Object.create(n.Line.prototype),
  47256. n.LineSegments.prototype.constructor = n.LineSegments,
  47257. n.Mesh = function(e, t) {
  47258. n.Object3D.call(this),
  47259. this.type = "Mesh",
  47260. this.geometry = void 0 !== e ? e : new n.Geometry,
  47261. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  47262. color: 16777215 * Math.random()
  47263. }),
  47264. this.drawMode = n.TrianglesDrawMode,
  47265. this.updateMorphTargets()
  47266. }
  47267. ,
  47268. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  47269. n.Mesh.prototype.constructor = n.Mesh,
  47270. n.Mesh.prototype.setDrawMode = function(e) {
  47271. this.drawMode = e
  47272. }
  47273. ,
  47274. n.Mesh.prototype.updateMorphTargets = function() {
  47275. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  47276. this.morphTargetBase = -1,
  47277. this.morphTargetInfluences = [],
  47278. this.morphTargetDictionary = {};
  47279. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47280. this.morphTargetInfluences.push(0),
  47281. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47282. }
  47283. }
  47284. ,
  47285. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47286. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47287. 0)
  47288. }
  47289. ,
  47290. n.Mesh.prototype.raycast = function() {
  47291. function e(e, t, i, r, o, a, s) {
  47292. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  47293. o.multiplyScalar(m.x),
  47294. a.multiplyScalar(m.y),
  47295. s.multiplyScalar(m.z),
  47296. o.add(a).add(s),
  47297. o.clone()
  47298. }
  47299. function t(e, t, i, r, o, a, s) {
  47300. var l, c = e.material;
  47301. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  47302. null === l)
  47303. return null;
  47304. A.copy(s),
  47305. A.applyMatrix4(e.matrixWorld);
  47306. var h = t.ray.origin.distanceTo(A);
  47307. return h < t.near || h > t.far ? null : {
  47308. distance: h,
  47309. point: A.clone(),
  47310. object: e
  47311. }
  47312. }
  47313. function i(i, r, o, a, h, u, d, m) {
  47314. s.fromArray(a, 3 * u),
  47315. l.fromArray(a, 3 * d),
  47316. c.fromArray(a, 3 * m);
  47317. var A = t(i, r, o, s, l, c, v);
  47318. return A && (h && (p.fromArray(h, 2 * u),
  47319. f.fromArray(h, 2 * d),
  47320. g.fromArray(h, 2 * m),
  47321. A.uv = e(v, s, l, c, p, f, g)),
  47322. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  47323. A.faceIndex = u),
  47324. A
  47325. }
  47326. var r = new n.Matrix4
  47327. , o = new n.Ray
  47328. , a = new n.Sphere
  47329. , s = new n.Vector3
  47330. , l = new n.Vector3
  47331. , c = new n.Vector3
  47332. , h = new n.Vector3
  47333. , u = new n.Vector3
  47334. , d = new n.Vector3
  47335. , p = new n.Vector2
  47336. , f = new n.Vector2
  47337. , g = new n.Vector2
  47338. , m = new n.Vector3
  47339. , v = new n.Vector3
  47340. , A = new n.Vector3;
  47341. return function(m, A) {
  47342. var y = this.geometry
  47343. , C = this.material
  47344. , I = this.matrixWorld;
  47345. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  47346. a.copy(y.boundingSphere),
  47347. a.applyMatrix4(I),
  47348. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  47349. o.copy(m.ray).applyMatrix4(r),
  47350. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  47351. var E, b;
  47352. if (y instanceof n.BufferGeometry) {
  47353. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  47354. if (void 0 !== S.uv && (E = S.uv.array),
  47355. null !== x)
  47356. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  47357. w = R[P],
  47358. _ = R[P + 1],
  47359. T = R[P + 2],
  47360. b = i(this, m, o, M, E, w, _, T),
  47361. b && (b.faceIndex = Math.floor(P / 3),
  47362. A.push(b));
  47363. else
  47364. for (var P = 0, O = M.length; P < O; P += 9)
  47365. w = P / 3,
  47366. _ = w + 1,
  47367. T = w + 2,
  47368. b = i(this, m, o, M, E, w, _, T),
  47369. b && (b.index = w,
  47370. A.push(b))
  47371. } else if (y instanceof n.Geometry) {
  47372. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  47373. k.length > 0 && (E = k);
  47374. for (var H = 0, G = U.length; H < G; H++) {
  47375. var z = U[H]
  47376. , W = B === !0 ? F[z.materialIndex] : C;
  47377. if (void 0 !== W) {
  47378. if (L = V[z.a],
  47379. D = V[z.b],
  47380. N = V[z.c],
  47381. W.morphTargets === !0) {
  47382. var j = y.morphTargets
  47383. , Y = this.morphTargetInfluences;
  47384. s.set(0, 0, 0),
  47385. l.set(0, 0, 0),
  47386. c.set(0, 0, 0);
  47387. for (var X = 0, Z = j.length; X < Z; X++) {
  47388. var q = Y[X];
  47389. if (0 !== q) {
  47390. var K = j[X].vertices;
  47391. s.addScaledVector(h.subVectors(K[z.a], L), q),
  47392. l.addScaledVector(u.subVectors(K[z.b], D), q),
  47393. c.addScaledVector(d.subVectors(K[z.c], N), q)
  47394. }
  47395. }
  47396. s.add(L),
  47397. l.add(D),
  47398. c.add(N),
  47399. L = s,
  47400. D = l,
  47401. N = c
  47402. }
  47403. if (b = t(this, m, o, L, D, N, v)) {
  47404. if (E) {
  47405. var Q = E[H];
  47406. p.copy(Q[0]),
  47407. f.copy(Q[1]),
  47408. g.copy(Q[2]),
  47409. b.uv = e(v, L, D, N, p, f, g)
  47410. }
  47411. b.face = z,
  47412. b.faceIndex = H,
  47413. A.push(b)
  47414. }
  47415. }
  47416. }
  47417. }
  47418. }
  47419. }
  47420. }(),
  47421. n.Mesh.prototype.clone = function() {
  47422. return new this.constructor(this.geometry,this.material).copy(this)
  47423. }
  47424. ,
  47425. n.Bone = function(e) {
  47426. n.Object3D.call(this),
  47427. this.type = "Bone",
  47428. this.skin = e
  47429. }
  47430. ,
  47431. n.Bone.prototype = Object.create(n.Object3D.prototype),
  47432. n.Bone.prototype.constructor = n.Bone,
  47433. n.Bone.prototype.copy = function(e) {
  47434. return n.Object3D.prototype.copy.call(this, e),
  47435. this.skin = e.skin,
  47436. this
  47437. }
  47438. ,
  47439. n.Skeleton = function(e, t, i) {
  47440. if (this.useVertexTexture = void 0 === i || i,
  47441. this.identityMatrix = new n.Matrix4,
  47442. e = e || [],
  47443. this.bones = e.slice(0),
  47444. this.useVertexTexture) {
  47445. var r = Math.sqrt(4 * this.bones.length);
  47446. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  47447. r = Math.max(r, 4),
  47448. this.boneTextureWidth = r,
  47449. this.boneTextureHeight = r,
  47450. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47451. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  47452. } else
  47453. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47454. if (void 0 === t)
  47455. this.calculateInverses();
  47456. else if (this.bones.length === t.length)
  47457. this.boneInverses = t.slice(0);
  47458. else {
  47459. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47460. this.boneInverses = [];
  47461. for (var o = 0, a = this.bones.length; o < a; o++)
  47462. this.boneInverses.push(new n.Matrix4)
  47463. }
  47464. }
  47465. ,
  47466. n.Skeleton.prototype.calculateInverses = function() {
  47467. this.boneInverses = [];
  47468. for (var e = 0, t = this.bones.length; e < t; e++) {
  47469. var i = new n.Matrix4;
  47470. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47471. this.boneInverses.push(i)
  47472. }
  47473. }
  47474. ,
  47475. n.Skeleton.prototype.pose = function() {
  47476. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47477. e = this.bones[t],
  47478. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  47479. for (var t = 0, i = this.bones.length; t < i; t++)
  47480. e = this.bones[t],
  47481. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47482. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47483. e.matrix.decompose(e.position, e.quaternion, e.scale));
  47484. }
  47485. ,
  47486. n.Skeleton.prototype.update = function() {
  47487. var e = new n.Matrix4;
  47488. return function() {
  47489. for (var t = 0, i = this.bones.length; t < i; t++) {
  47490. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  47491. e.multiplyMatrices(n, this.boneInverses[t]),
  47492. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  47493. }
  47494. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47495. }
  47496. }(),
  47497. n.Skeleton.prototype.clone = function() {
  47498. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47499. }
  47500. ,
  47501. n.SkinnedMesh = function(e, t, i) {
  47502. n.Mesh.call(this, e, t),
  47503. this.type = "SkinnedMesh",
  47504. this.bindMode = "attached",
  47505. this.bindMatrix = new n.Matrix4,
  47506. this.bindMatrixInverse = new n.Matrix4;
  47507. var r = [];
  47508. if (this.geometry && void 0 !== this.geometry.bones) {
  47509. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  47510. a = this.geometry.bones[s],
  47511. o = new n.Bone(this),
  47512. r.push(o),
  47513. o.name = a.name,
  47514. o.position.fromArray(a.pos),
  47515. o.quaternion.fromArray(a.rotq),
  47516. void 0 !== a.scl && o.scale.fromArray(a.scl);
  47517. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  47518. a = this.geometry.bones[s],
  47519. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  47520. }
  47521. this.normalizeSkinWeights(),
  47522. this.updateMatrixWorld(!0),
  47523. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  47524. }
  47525. ,
  47526. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  47527. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  47528. n.SkinnedMesh.prototype.bind = function(e, t) {
  47529. this.skeleton = e,
  47530. void 0 === t && (this.updateMatrixWorld(!0),
  47531. this.skeleton.calculateInverses(),
  47532. t = this.matrixWorld),
  47533. this.bindMatrix.copy(t),
  47534. this.bindMatrixInverse.getInverse(t)
  47535. }
  47536. ,
  47537. n.SkinnedMesh.prototype.pose = function() {
  47538. this.skeleton.pose()
  47539. }
  47540. ,
  47541. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47542. if (this.geometry instanceof n.Geometry)
  47543. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47544. var t = this.geometry.skinWeights[e]
  47545. , i = 1 / t.lengthManhattan();
  47546. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  47547. }
  47548. else if (this.geometry instanceof n.BufferGeometry)
  47549. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  47550. r.x = o.getX(e),
  47551. r.y = o.getY(e),
  47552. r.z = o.getZ(e),
  47553. r.w = o.getW(e);
  47554. var i = 1 / r.lengthManhattan();
  47555. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  47556. o.setXYZW(e, r.x, r.y, r.z, r.w)
  47557. }
  47558. }
  47559. ,
  47560. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47561. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47562. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47563. }
  47564. ,
  47565. n.SkinnedMesh.prototype.clone = function() {
  47566. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47567. }
  47568. ,
  47569. n.LOD = function() {
  47570. n.Object3D.call(this),
  47571. this.type = "LOD",
  47572. Object.defineProperties(this, {
  47573. levels: {
  47574. enumerable: !0,
  47575. value: []
  47576. },
  47577. objects: {
  47578. get: function() {
  47579. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47580. this.levels
  47581. }
  47582. }
  47583. })
  47584. }
  47585. ,
  47586. n.LOD.prototype = Object.create(n.Object3D.prototype),
  47587. n.LOD.prototype.constructor = n.LOD,
  47588. n.LOD.prototype.addLevel = function(e, t) {
  47589. void 0 === t && (t = 0),
  47590. t = Math.abs(t);
  47591. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47592. ;
  47593. i.splice(n, 0, {
  47594. distance: t,
  47595. object: e
  47596. }),
  47597. this.add(e)
  47598. }
  47599. ,
  47600. n.LOD.prototype.getObjectForDistance = function(e) {
  47601. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47602. ;
  47603. return t[i - 1].object
  47604. }
  47605. ,
  47606. n.LOD.prototype.raycast = function() {
  47607. var e = new n.Vector3;
  47608. return function(t, i) {
  47609. e.setFromMatrixPosition(this.matrixWorld);
  47610. var n = t.ray.origin.distanceTo(e);
  47611. this.getObjectForDistance(n).raycast(t, i)
  47612. }
  47613. }(),
  47614. n.LOD.prototype.update = function() {
  47615. var e = new n.Vector3
  47616. , t = new n.Vector3;
  47617. return function(i) {
  47618. var n = this.levels;
  47619. if (n.length > 1) {
  47620. e.setFromMatrixPosition(i.matrixWorld),
  47621. t.setFromMatrixPosition(this.matrixWorld);
  47622. var r = e.distanceTo(t);
  47623. n[0].object.visible = !0;
  47624. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  47625. n[o - 1].object.visible = !1,
  47626. n[o].object.visible = !0;
  47627. for (; o < a; o++)
  47628. n[o].object.visible = !1
  47629. }
  47630. }
  47631. }(),
  47632. n.LOD.prototype.copy = function(e) {
  47633. n.Object3D.prototype.copy.call(this, e, !1);
  47634. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  47635. var o = t[i];
  47636. this.addLevel(o.object.clone(), o.distance)
  47637. }
  47638. return this
  47639. }
  47640. ,
  47641. n.LOD.prototype.toJSON = function(e) {
  47642. var t = n.Object3D.prototype.toJSON.call(this, e);
  47643. t.object.levels = [];
  47644. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  47645. var a = i[r];
  47646. t.object.levels.push({
  47647. object: a.object.uuid,
  47648. distance: a.distance
  47649. })
  47650. }
  47651. return t
  47652. }
  47653. ,
  47654. n.Sprite = function() {
  47655. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  47656. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  47657. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  47658. , r = new n.BufferGeometry;
  47659. return r.setIndex(new n.BufferAttribute(e,1)),
  47660. r.addAttribute("position", new n.BufferAttribute(t,3)),
  47661. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  47662. function(e) {
  47663. n.Object3D.call(this),
  47664. this.type = "Sprite",
  47665. this.geometry = r,
  47666. this.material = void 0 !== e ? e : new n.SpriteMaterial
  47667. }
  47668. }(),
  47669. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  47670. n.Sprite.prototype.constructor = n.Sprite,
  47671. n.Sprite.prototype.raycast = function() {
  47672. var e = new n.Vector3;
  47673. return function(t, i) {
  47674. e.setFromMatrixPosition(this.matrixWorld);
  47675. var n = t.ray.distanceSqToPoint(e)
  47676. , r = this.scale.x * this.scale.y;
  47677. n > r || i.push({
  47678. distance: Math.sqrt(n),
  47679. point: this.position,
  47680. face: null,
  47681. object: this
  47682. })
  47683. }
  47684. }(),
  47685. n.Sprite.prototype.clone = function() {
  47686. return new this.constructor(this.material).copy(this)
  47687. }
  47688. ,
  47689. n.Particle = n.Sprite,
  47690. n.LensFlare = function(e, t, i, r, o) {
  47691. n.Object3D.call(this),
  47692. this.lensFlares = [],
  47693. this.positionScreen = new n.Vector3,
  47694. this.customUpdateCallback = void 0,
  47695. void 0 !== e && this.add(e, t, i, r, o)
  47696. }
  47697. ,
  47698. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  47699. n.LensFlare.prototype.constructor = n.LensFlare,
  47700. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  47701. void 0 === t && (t = -1),
  47702. void 0 === i && (i = 0),
  47703. void 0 === a && (a = 1),
  47704. void 0 === o && (o = new n.Color(16777215)),
  47705. void 0 === r && (r = n.NormalBlending),
  47706. i = Math.min(i, Math.max(0, i)),
  47707. this.lensFlares.push({
  47708. texture: e,
  47709. size: t,
  47710. distance: i,
  47711. x: 0,
  47712. y: 0,
  47713. z: 0,
  47714. scale: 1,
  47715. rotation: 0,
  47716. opacity: a,
  47717. color: o,
  47718. blending: r
  47719. })
  47720. }
  47721. ,
  47722. n.LensFlare.prototype.updateLensFlares = function() {
  47723. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47724. for (e = 0; e < i; e++)
  47725. t = this.lensFlares[e],
  47726. t.x = this.positionScreen.x + n * t.distance,
  47727. t.y = this.positionScreen.y + r * t.distance,
  47728. t.wantedRotation = t.x * Math.PI * .25,
  47729. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47730. }
  47731. ,
  47732. n.LensFlare.prototype.copy = function(e) {
  47733. n.Object3D.prototype.copy.call(this, e),
  47734. this.positionScreen.copy(e.positionScreen),
  47735. this.customUpdateCallback = e.customUpdateCallback;
  47736. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47737. this.lensFlares.push(e.lensFlares[t]);
  47738. return this
  47739. }
  47740. ,
  47741. n.Scene = function() {
  47742. n.Object3D.call(this),
  47743. this.type = "Scene",
  47744. this.fog = null,
  47745. this.overrideMaterial = null,
  47746. this.autoUpdate = !0
  47747. }
  47748. ,
  47749. n.Scene.prototype = Object.create(n.Object3D.prototype),
  47750. n.Scene.prototype.constructor = n.Scene,
  47751. n.Scene.prototype.copy = function(e, t) {
  47752. return n.Object3D.prototype.copy.call(this, e, t),
  47753. null !== e.fog && (this.fog = e.fog.clone()),
  47754. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47755. this.autoUpdate = e.autoUpdate,
  47756. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47757. this
  47758. }
  47759. ,
  47760. n.Fog = function(e, t, i) {
  47761. this.name = "",
  47762. this.color = new n.Color(e),
  47763. this.near = void 0 !== t ? t : 1,
  47764. this.far = void 0 !== i ? i : 1e3
  47765. }
  47766. ,
  47767. n.Fog.prototype.clone = function() {
  47768. return new n.Fog(this.color.getHex(),this.near,this.far)
  47769. }
  47770. ,
  47771. n.FogExp2 = function(e, t) {
  47772. this.name = "",
  47773. this.color = new n.Color(e),
  47774. this.density = void 0 !== t ? t : 25e-5
  47775. }
  47776. ,
  47777. n.FogExp2.prototype.clone = function() {
  47778. return new n.FogExp2(this.color.getHex(),this.density)
  47779. }
  47780. ,
  47781. n.ShaderChunk = {},
  47782. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47783. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47784. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47785. n.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  47786. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47787. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47788. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47789. n.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  47790. n.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  47791. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47792. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47793. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47794. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47795. n.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  47796. n.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  47797. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47798. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47799. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47800. n.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  47801. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47802. n.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  47803. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47804. n.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  47805. n.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  47806. n.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  47807. n.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  47808. n.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  47809. n.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  47810. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47811. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47812. n.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  47813. n.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  47814. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47815. n.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  47816. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47817. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47818. n.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  47819. n.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  47820. n.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  47821. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47822. n.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  47823. n.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  47824. n.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  47825. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47826. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47827. n.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  47828. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47829. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47830. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47831. n.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  47832. n.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif";
  47833. n.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n";
  47834. n.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  47835. n.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  47836. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47837. n.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  47838. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47839. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47840. n.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  47841. n.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  47842. n.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  47843. n.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  47844. n.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  47845. n.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  47846. n.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  47847. n.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  47848. n.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  47849. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47850. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47851. n.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  47852. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47853. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47854. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47855. n.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  47856. n.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  47857. n.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  47858. n.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  47859. n.UniformsUtils = {
  47860. merge: function(e) {
  47861. for (var t = {}, i = 0; i < e.length; i++) {
  47862. var n = this.clone(e[i]);
  47863. for (var r in n)
  47864. t[r] = n[r]
  47865. }
  47866. return t
  47867. },
  47868. clone: function(e) {
  47869. var t = {};
  47870. for (var i in e) {
  47871. t[i] = {};
  47872. for (var r in e[i]) {
  47873. var o = e[i][r];
  47874. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  47875. }
  47876. }
  47877. return t
  47878. }
  47879. },
  47880. n.UniformsLib = {
  47881. common: {
  47882. diffuse: {
  47883. type: "c",
  47884. value: new n.Color(15658734)
  47885. },
  47886. opacity: {
  47887. type: "f",
  47888. value: 1
  47889. },
  47890. map: {
  47891. type: "t",
  47892. value: null
  47893. },
  47894. offsetRepeat: {
  47895. type: "v4",
  47896. value: new n.Vector4(0,0,1,1)
  47897. },
  47898. specularMap: {
  47899. type: "t",
  47900. value: null
  47901. },
  47902. alphaMap: {
  47903. type: "t",
  47904. value: null
  47905. },
  47906. envMap: {
  47907. type: "t",
  47908. value: null
  47909. },
  47910. flipEnvMap: {
  47911. type: "f",
  47912. value: -1
  47913. },
  47914. reflectivity: {
  47915. type: "f",
  47916. value: 1
  47917. },
  47918. refractionRatio: {
  47919. type: "f",
  47920. value: .98
  47921. }
  47922. },
  47923. aomap: {
  47924. aoMap: {
  47925. type: "t",
  47926. value: null
  47927. },
  47928. aoMapIntensity: {
  47929. type: "f",
  47930. value: 1
  47931. }
  47932. },
  47933. lightmap: {
  47934. lightMap: {
  47935. type: "t",
  47936. value: null
  47937. },
  47938. lightMapIntensity: {
  47939. type: "f",
  47940. value: 1
  47941. }
  47942. },
  47943. emissivemap: {
  47944. emissiveMap: {
  47945. type: "t",
  47946. value: null
  47947. }
  47948. },
  47949. bumpmap: {
  47950. bumpMap: {
  47951. type: "t",
  47952. value: null
  47953. },
  47954. bumpScale: {
  47955. type: "f",
  47956. value: 1
  47957. }
  47958. },
  47959. normalmap: {
  47960. normalMap: {
  47961. type: "t",
  47962. value: null
  47963. },
  47964. normalScale: {
  47965. type: "v2",
  47966. value: new n.Vector2(1,1)
  47967. }
  47968. },
  47969. displacementmap: {
  47970. displacementMap: {
  47971. type: "t",
  47972. value: null
  47973. },
  47974. displacementScale: {
  47975. type: "f",
  47976. value: 1
  47977. },
  47978. displacementBias: {
  47979. type: "f",
  47980. value: 0
  47981. }
  47982. },
  47983. roughnessmap: {
  47984. roughnessMap: {
  47985. type: "t",
  47986. value: null
  47987. }
  47988. },
  47989. metalnessmap: {
  47990. metalnessMap: {
  47991. type: "t",
  47992. value: null
  47993. }
  47994. },
  47995. fog: {
  47996. fogDensity: {
  47997. type: "f",
  47998. value: 25e-5
  47999. },
  48000. fogNear: {
  48001. type: "f",
  48002. value: 1
  48003. },
  48004. fogFar: {
  48005. type: "f",
  48006. value: 2e3
  48007. },
  48008. fogColor: {
  48009. type: "c",
  48010. value: new n.Color(16777215)
  48011. }
  48012. },
  48013. lights: {
  48014. ambientLightColor: {
  48015. type: "fv",
  48016. value: []
  48017. },
  48018. directionalLights: {
  48019. type: "sa",
  48020. value: [],
  48021. properties: {
  48022. direction: {
  48023. type: "v3"
  48024. },
  48025. color: {
  48026. type: "c"
  48027. },
  48028. shadow: {
  48029. type: "i"
  48030. },
  48031. shadowBias: {
  48032. type: "f"
  48033. },
  48034. shadowRadius: {
  48035. type: "f"
  48036. },
  48037. shadowMapSize: {
  48038. type: "v2"
  48039. }
  48040. }
  48041. },
  48042. directionalShadowMap: {
  48043. type: "tv",
  48044. value: []
  48045. },
  48046. directionalShadowMatrix: {
  48047. type: "m4v",
  48048. value: []
  48049. },
  48050. spotLights: {
  48051. type: "sa",
  48052. value: [],
  48053. properties: {
  48054. color: {
  48055. type: "c"
  48056. },
  48057. position: {
  48058. type: "v3"
  48059. },
  48060. direction: {
  48061. type: "v3"
  48062. },
  48063. distance: {
  48064. type: "f"
  48065. },
  48066. coneCos: {
  48067. type: "f"
  48068. },
  48069. penumbraCos: {
  48070. type: "f"
  48071. },
  48072. decay: {
  48073. type: "f"
  48074. },
  48075. shadow: {
  48076. type: "i"
  48077. },
  48078. shadowBias: {
  48079. type: "f"
  48080. },
  48081. shadowRadius: {
  48082. type: "f"
  48083. },
  48084. shadowMapSize: {
  48085. type: "v2"
  48086. }
  48087. }
  48088. },
  48089. spotShadowMap: {
  48090. type: "tv",
  48091. value: []
  48092. },
  48093. spotShadowMatrix: {
  48094. type: "m4v",
  48095. value: []
  48096. },
  48097. pointLights: {
  48098. type: "sa",
  48099. value: [],
  48100. properties: {
  48101. color: {
  48102. type: "c"
  48103. },
  48104. position: {
  48105. type: "v3"
  48106. },
  48107. decay: {
  48108. type: "f"
  48109. },
  48110. distance: {
  48111. type: "f"
  48112. },
  48113. shadow: {
  48114. type: "i"
  48115. },
  48116. shadowBias: {
  48117. type: "f"
  48118. },
  48119. shadowRadius: {
  48120. type: "f"
  48121. },
  48122. shadowMapSize: {
  48123. type: "v2"
  48124. }
  48125. }
  48126. },
  48127. pointShadowMap: {
  48128. type: "tv",
  48129. value: []
  48130. },
  48131. pointShadowMatrix: {
  48132. type: "m4v",
  48133. value: []
  48134. },
  48135. hemisphereLights: {
  48136. type: "sa",
  48137. value: [],
  48138. properties: {
  48139. direction: {
  48140. type: "v3"
  48141. },
  48142. skyColor: {
  48143. type: "c"
  48144. },
  48145. groundColor: {
  48146. type: "c"
  48147. }
  48148. }
  48149. }
  48150. },
  48151. points: {
  48152. diffuse: {
  48153. type: "c",
  48154. value: new n.Color(15658734)
  48155. },
  48156. opacity: {
  48157. type: "f",
  48158. value: 1
  48159. },
  48160. size: {
  48161. type: "f",
  48162. value: 1
  48163. },
  48164. scale: {
  48165. type: "f",
  48166. value: 1
  48167. },
  48168. map: {
  48169. type: "t",
  48170. value: null
  48171. },
  48172. offsetRepeat: {
  48173. type: "v4",
  48174. value: new n.Vector4(0,0,1,1)
  48175. }
  48176. }
  48177. },
  48178. n.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  48179. n.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48180. n.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  48181. n.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48182. n.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  48183. n.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48184. n.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  48185. n.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  48186. n.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  48187. n.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48188. n.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48189. n.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  48190. n.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48191. n.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  48192. n.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48193. n.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48194. n.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48195. n.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48196. n.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48197. n.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48198. n.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  48199. n.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48200. n.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48201. n.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48202. n.ShaderLib = {
  48203. basic: {
  48204. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  48205. vertexShader: n.ShaderChunk.meshbasic_vert,
  48206. fragmentShader: n.ShaderChunk.meshbasic_frag
  48207. },
  48208. lambert: {
  48209. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48210. emissive: {
  48211. type: "c",
  48212. value: new n.Color(0)
  48213. }
  48214. }]),
  48215. vertexShader: n.ShaderChunk.meshlambert_vert,
  48216. fragmentShader: n.ShaderChunk.meshlambert_frag
  48217. },
  48218. phong: {
  48219. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48220. emissive: {
  48221. type: "c",
  48222. value: new n.Color(0)
  48223. },
  48224. specular: {
  48225. type: "c",
  48226. value: new n.Color(1118481)
  48227. },
  48228. shininess: {
  48229. type: "f",
  48230. value: 30
  48231. }
  48232. }]),
  48233. vertexShader: n.ShaderChunk.meshphong_vert,
  48234. fragmentShader: n.ShaderChunk.meshphong_frag
  48235. },
  48236. standard: {
  48237. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48238. emissive: {
  48239. type: "c",
  48240. value: new n.Color(0)
  48241. },
  48242. roughness: {
  48243. type: "f",
  48244. value: .5
  48245. },
  48246. metalness: {
  48247. type: "f",
  48248. value: 0
  48249. },
  48250. envMapIntensity: {
  48251. type: "f",
  48252. value: 1
  48253. }
  48254. }]),
  48255. vertexShader: n.ShaderChunk.meshstandard_vert,
  48256. fragmentShader: n.ShaderChunk.meshstandard_frag
  48257. },
  48258. points: {
  48259. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  48260. vertexShader: n.ShaderChunk.points_vert,
  48261. fragmentShader: n.ShaderChunk.points_frag
  48262. },
  48263. dashed: {
  48264. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  48265. scale: {
  48266. type: "f",
  48267. value: 1
  48268. },
  48269. dashSize: {
  48270. type: "f",
  48271. value: 1
  48272. },
  48273. totalSize: {
  48274. type: "f",
  48275. value: 2
  48276. }
  48277. }]),
  48278. vertexShader: n.ShaderChunk.linedashed_vert,
  48279. fragmentShader: n.ShaderChunk.linedashed_frag
  48280. },
  48281. depth: {
  48282. uniforms: {
  48283. mNear: {
  48284. type: "f",
  48285. value: 1
  48286. },
  48287. mFar: {
  48288. type: "f",
  48289. value: 2e3
  48290. },
  48291. opacity: {
  48292. type: "f",
  48293. value: 1
  48294. }
  48295. },
  48296. vertexShader: n.ShaderChunk.depth_vert,
  48297. fragmentShader: n.ShaderChunk.depth_frag
  48298. },
  48299. normal: {
  48300. uniforms: {
  48301. opacity: {
  48302. type: "f",
  48303. value: 1
  48304. }
  48305. },
  48306. vertexShader: n.ShaderChunk.normal_vert,
  48307. fragmentShader: n.ShaderChunk.normal_frag
  48308. },
  48309. cube: {
  48310. uniforms: {
  48311. tCube: {
  48312. type: "t",
  48313. value: null
  48314. },
  48315. tFlip: {
  48316. type: "f",
  48317. value: -1
  48318. }
  48319. },
  48320. vertexShader: n.ShaderChunk.cube_vert,
  48321. fragmentShader: n.ShaderChunk.cube_frag
  48322. },
  48323. equirect: {
  48324. uniforms: {
  48325. tEquirect: {
  48326. type: "t",
  48327. value: null
  48328. },
  48329. tFlip: {
  48330. type: "f",
  48331. value: -1
  48332. }
  48333. },
  48334. vertexShader: n.ShaderChunk.equirect_vert,
  48335. fragmentShader: n.ShaderChunk.equirect_frag
  48336. },
  48337. depthRGBA: {
  48338. uniforms: {},
  48339. vertexShader: n.ShaderChunk.depthRGBA_vert,
  48340. fragmentShader: n.ShaderChunk.depthRGBA_frag
  48341. },
  48342. distanceRGBA: {
  48343. uniforms: {
  48344. lightPos: {
  48345. type: "v3",
  48346. value: new n.Vector3(0,0,0)
  48347. }
  48348. },
  48349. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  48350. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  48351. }
  48352. },
  48353. n.WebGLRenderer = function(e) {
  48354. function t() {
  48355. return null === ye ? Oe : 1
  48356. }
  48357. function i(e, t, i, n) {
  48358. se === !0 && (e *= n,
  48359. t *= n,
  48360. i *= n),
  48361. Ye.clearColor(e, t, i, n)
  48362. }
  48363. function r() {
  48364. Ye.init(),
  48365. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  48366. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  48367. i(Se.r, Se.g, Se.b, Me)
  48368. }
  48369. function o() {
  48370. Ae = null,
  48371. be = null,
  48372. Ee = "",
  48373. Ie = -1,
  48374. Ye.reset()
  48375. }
  48376. function a(e) {
  48377. e.preventDefault(),
  48378. o(),
  48379. r(),
  48380. Xe.clear()
  48381. }
  48382. function s(e) {
  48383. var t = e.target;
  48384. t.removeEventListener("dispose", s),
  48385. h(t),
  48386. ke.textures--
  48387. }
  48388. function l(e) {
  48389. var t = e.target;
  48390. t.removeEventListener("dispose", l),
  48391. u(t),
  48392. ke.textures--
  48393. }
  48394. function c(e) {
  48395. var t = e.target;
  48396. t.removeEventListener("dispose", c),
  48397. d(t)
  48398. }
  48399. function h(e) {
  48400. var t = Xe.get(e);
  48401. if (e.image && t.__image__webglTextureCube)
  48402. Ge.deleteTexture(t.__image__webglTextureCube);
  48403. else {
  48404. if (void 0 === t.__webglInit)
  48405. return;
  48406. Ge.deleteTexture(t.__webglTexture)
  48407. }
  48408. Xe.delete(e)
  48409. }
  48410. function u(e) {
  48411. var t = Xe.get(e)
  48412. , i = Xe.get(e.texture);
  48413. if (e && void 0 !== i.__webglTexture) {
  48414. if (Ge.deleteTexture(i.__webglTexture),
  48415. e instanceof n.WebGLRenderTargetCube)
  48416. for (var r = 0; r < 6; r++)
  48417. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  48418. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  48419. else
  48420. Ge.deleteFramebuffer(t.__webglFramebuffer),
  48421. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  48422. Xe.delete(e.texture),
  48423. Xe.delete(e)
  48424. }
  48425. }
  48426. function d(e) {
  48427. p(e),
  48428. Xe.delete(e)
  48429. }
  48430. function p(e) {
  48431. var t = Xe.get(e).program;
  48432. e.program = void 0,
  48433. void 0 !== t && qe.releaseProgram(t)
  48434. }
  48435. function f(e, t, i, r) {
  48436. var o;
  48437. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  48438. null === o))
  48439. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  48440. void 0 === r && (r = 0),
  48441. Ye.initAttributes();
  48442. var a = i.attributes
  48443. , s = t.getAttributes()
  48444. , l = e.defaultAttributeValues;
  48445. for (var c in s) {
  48446. var h = s[c];
  48447. if (h >= 0) {
  48448. var u = a[c];
  48449. if (void 0 !== u) {
  48450. var d = u.itemSize
  48451. , p = Ze.getAttributeBuffer(u);
  48452. if (u instanceof n.InterleavedBufferAttribute) {
  48453. var f = u.data
  48454. , g = f.stride
  48455. , m = u.offset;
  48456. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  48457. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  48458. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48459. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  48460. } else
  48461. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  48462. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  48463. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48464. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  48465. } else if (void 0 !== l) {
  48466. var v = l[c];
  48467. if (void 0 !== v)
  48468. switch (v.length) {
  48469. case 2:
  48470. Ge.vertexAttrib2fv(h, v);
  48471. break;
  48472. case 3:
  48473. Ge.vertexAttrib3fv(h, v);
  48474. break;
  48475. case 4:
  48476. Ge.vertexAttrib4fv(h, v);
  48477. break;
  48478. default:
  48479. Ge.vertexAttrib1fv(h, v)
  48480. }
  48481. }
  48482. }
  48483. }
  48484. Ye.disableUnusedAttributes()
  48485. }
  48486. function g(e, t) {
  48487. return Math.abs(t[0]) - Math.abs(e[0])
  48488. }
  48489. function m(e, t) {
  48490. 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
  48491. }
  48492. function v(e, t) {
  48493. 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
  48494. }
  48495. function A(e, t, i, n, r) {
  48496. var o, a;
  48497. i.transparent ? (o = de,
  48498. a = ++pe) : (o = he,
  48499. a = ++ue);
  48500. var s = o[a];
  48501. void 0 !== s ? (s.id = e.id,
  48502. s.object = e,
  48503. s.geometry = t,
  48504. s.material = i,
  48505. s.z = Ve.z,
  48506. s.group = r) : (s = {
  48507. id: e.id,
  48508. object: e,
  48509. geometry: t,
  48510. material: i,
  48511. z: Ve.z,
  48512. group: r
  48513. },
  48514. o.push(s))
  48515. }
  48516. function y(e, t) {
  48517. if (e.visible !== !1) {
  48518. if (e.layers.test(t.layers))
  48519. if (e instanceof n.Light)
  48520. ce.push(e);
  48521. else if (e instanceof n.Sprite)
  48522. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  48523. else if (e instanceof n.LensFlare)
  48524. me.push(e);
  48525. else if (e instanceof n.ImmediateRenderObject)
  48526. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48527. Ve.applyProjection(Fe)),
  48528. A(e, null, e.material, Ve.z, null);
  48529. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  48530. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  48531. var i = e.material;
  48532. if (i.visible === !0) {
  48533. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48534. Ve.applyProjection(Fe));
  48535. var r = Ze.update(e);
  48536. if (i instanceof n.MultiMaterial)
  48537. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  48538. var c = o[s]
  48539. , h = a[c.materialIndex];
  48540. h.visible === !0 && A(e, r, h, Ve.z, c)
  48541. }
  48542. else
  48543. A(e, r, i, Ve.z, null)
  48544. }
  48545. }
  48546. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  48547. y(u[s], t)
  48548. }
  48549. }
  48550. function C(e, t, i, r) {
  48551. for (var o = 0, a = e.length; o < a; o++) {
  48552. var s = e[o]
  48553. , l = s.object
  48554. , c = s.geometry
  48555. , h = void 0 === r ? s.material : r
  48556. , u = s.group;
  48557. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  48558. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  48559. l instanceof n.ImmediateRenderObject) {
  48560. E(h);
  48561. var d = w(t, i, h, l);
  48562. Ee = "",
  48563. l.render(function(e) {
  48564. ve.renderBufferImmediate(e, d, h)
  48565. })
  48566. } else
  48567. ve.renderBufferDirect(t, i, c, h, l, u)
  48568. }
  48569. }
  48570. function I(e, t, i) {
  48571. var r = Xe.get(e)
  48572. , o = qe.getParameters(e, Ue, t, i)
  48573. , a = qe.getProgramCode(e, o)
  48574. , s = r.program
  48575. , l = !0;
  48576. if (void 0 === s)
  48577. e.addEventListener("dispose", c);
  48578. else if (s.code !== a)
  48579. p(e);
  48580. else {
  48581. if (void 0 !== o.shaderID)
  48582. return;
  48583. l = !1
  48584. }
  48585. if (l) {
  48586. if (o.shaderID) {
  48587. var h = n.ShaderLib[o.shaderID];
  48588. r.__webglShader = {
  48589. name: e.type,
  48590. uniforms: n.UniformsUtils.clone(h.uniforms),
  48591. vertexShader: h.vertexShader,
  48592. fragmentShader: h.fragmentShader
  48593. }
  48594. } else
  48595. r.__webglShader = {
  48596. name: e.type,
  48597. uniforms: e.uniforms,
  48598. vertexShader: e.vertexShader,
  48599. fragmentShader: e.fragmentShader
  48600. };
  48601. e.__webglShader = r.__webglShader,
  48602. s = qe.acquireProgram(e, o, a),
  48603. r.program = s,
  48604. e.program = s
  48605. }
  48606. var u = s.getAttributes();
  48607. if (e.morphTargets) {
  48608. e.numSupportedMorphTargets = 0;
  48609. for (var d = 0; d < ve.maxMorphTargets; d++)
  48610. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  48611. }
  48612. if (e.morphNormals) {
  48613. e.numSupportedMorphNormals = 0;
  48614. for (var d = 0; d < ve.maxMorphNormals; d++)
  48615. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  48616. }
  48617. r.uniformsList = [];
  48618. var f = r.__webglShader.uniforms
  48619. , g = r.program.getUniforms();
  48620. for (var m in f) {
  48621. var v = g[m];
  48622. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  48623. }
  48624. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  48625. f.ambientLightColor.value = Ue.ambient,
  48626. f.directionalLights.value = Ue.directional,
  48627. f.spotLights.value = Ue.spot,
  48628. f.pointLights.value = Ue.point,
  48629. f.hemisphereLights.value = Ue.hemi,
  48630. f.directionalShadowMap.value = Ue.directionalShadowMap,
  48631. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  48632. f.spotShadowMap.value = Ue.spotShadowMap,
  48633. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  48634. f.pointShadowMap.value = Ue.pointShadowMap,
  48635. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  48636. r.hasDynamicUniforms = !1;
  48637. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  48638. var C = r.uniformsList[A][0];
  48639. if (C.dynamic === !0) {
  48640. r.hasDynamicUniforms = !0;
  48641. break
  48642. }
  48643. }
  48644. }
  48645. function E(e) {
  48646. b(e),
  48647. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  48648. Ye.setDepthFunc(e.depthFunc),
  48649. Ye.setDepthTest(e.depthTest),
  48650. Ye.setDepthWrite(e.depthWrite),
  48651. Ye.setColorWrite(e.colorWrite),
  48652. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48653. }
  48654. function b(e) {
  48655. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  48656. Ye.setFlipSided(e.side === n.BackSide)
  48657. }
  48658. function w(e, t, i, r) {
  48659. xe = 0;
  48660. var o = Xe.get(i);
  48661. void 0 === o.program && (i.needsUpdate = !0),
  48662. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  48663. i.needsUpdate && (I(i, t, r),
  48664. i.needsUpdate = !1);
  48665. var a = !1
  48666. , s = !1
  48667. , l = !1
  48668. , c = o.program
  48669. , h = c.getUniforms()
  48670. , u = o.__webglShader.uniforms;
  48671. if (c.id !== Ae && (Ge.useProgram(c.program),
  48672. Ae = c.id,
  48673. a = !0,
  48674. s = !0,
  48675. l = !0),
  48676. i.id !== Ie && (Ie = i.id,
  48677. s = !0),
  48678. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  48679. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48680. e !== be && (be = e,
  48681. s = !0,
  48682. l = !0),
  48683. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  48684. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  48685. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  48686. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  48687. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  48688. i.skinning)
  48689. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  48690. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  48691. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  48692. if (void 0 !== h.boneTexture) {
  48693. var d = B();
  48694. Ge.uniform1i(h.boneTexture, d),
  48695. ve.setTexture(r.skeleton.boneTexture, d)
  48696. }
  48697. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  48698. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  48699. } else
  48700. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  48701. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  48702. t && i.fog && R(u, t),
  48703. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  48704. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  48705. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  48706. u.mFar.value = e.far,
  48707. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  48708. V(o.uniformsList)),
  48709. N(h, r),
  48710. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  48711. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  48712. c
  48713. }
  48714. function _(e, t, i) {
  48715. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48716. var a = e[r][0]
  48717. , s = a.onUpdateCallback;
  48718. void 0 !== s && (s.bind(a)(t, i),
  48719. n.push(e[r]))
  48720. }
  48721. V(n)
  48722. }
  48723. function T(e, t) {
  48724. e.opacity.value = t.opacity,
  48725. e.diffuse.value = t.color,
  48726. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48727. e.map.value = t.map,
  48728. e.specularMap.value = t.specularMap,
  48729. e.alphaMap.value = t.alphaMap,
  48730. t.aoMap && (e.aoMap.value = t.aoMap,
  48731. e.aoMapIntensity.value = t.aoMapIntensity);
  48732. var i;
  48733. if (t.map ? i = t.map : t.specularMap ? i = t.specularMap : t.displacementMap ? i = t.displacementMap : t.normalMap ? i = t.normalMap : t.bumpMap ? i = t.bumpMap : t.roughnessMap ? i = t.roughnessMap : t.metalnessMap ? i = t.metalnessMap : t.alphaMap ? i = t.alphaMap : t.emissiveMap && (i = t.emissiveMap),
  48734. void 0 !== i) {
  48735. i instanceof n.WebGLRenderTarget && (i = i.texture);
  48736. var r = i.offset
  48737. , o = i.repeat;
  48738. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  48739. }
  48740. e.envMap.value = t.envMap,
  48741. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  48742. e.reflectivity.value = t.reflectivity,
  48743. e.refractionRatio.value = t.refractionRatio
  48744. }
  48745. function x(e, t) {
  48746. e.diffuse.value = t.color,
  48747. e.opacity.value = t.opacity
  48748. }
  48749. function S(e, t) {
  48750. e.dashSize.value = t.dashSize,
  48751. e.totalSize.value = t.dashSize + t.gapSize,
  48752. e.scale.value = t.scale
  48753. }
  48754. function M(e, t) {
  48755. if (e.diffuse.value = t.color,
  48756. e.opacity.value = t.opacity,
  48757. e.size.value = t.size * Oe,
  48758. e.scale.value = te.clientHeight / 2,
  48759. e.map.value = t.map,
  48760. null !== t.map) {
  48761. var i = t.map.offset
  48762. , n = t.map.repeat;
  48763. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48764. }
  48765. }
  48766. function R(e, t) {
  48767. e.fogColor.value = t.color,
  48768. t instanceof n.Fog ? (e.fogNear.value = t.near,
  48769. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  48770. }
  48771. function P(e, t) {
  48772. t.lightMap && (e.lightMap.value = t.lightMap,
  48773. e.lightMapIntensity.value = t.lightMapIntensity),
  48774. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48775. }
  48776. function O(e, t) {
  48777. e.specular.value = t.specular,
  48778. e.shininess.value = Math.max(t.shininess, 1e-4),
  48779. t.lightMap && (e.lightMap.value = t.lightMap,
  48780. e.lightMapIntensity.value = t.lightMapIntensity),
  48781. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48782. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48783. e.bumpScale.value = t.bumpScale),
  48784. t.normalMap && (e.normalMap.value = t.normalMap,
  48785. e.normalScale.value.copy(t.normalScale)),
  48786. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48787. e.displacementScale.value = t.displacementScale,
  48788. e.displacementBias.value = t.displacementBias)
  48789. }
  48790. function L(e, t) {
  48791. e.roughness.value = t.roughness,
  48792. e.metalness.value = t.metalness,
  48793. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48794. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48795. t.lightMap && (e.lightMap.value = t.lightMap,
  48796. e.lightMapIntensity.value = t.lightMapIntensity),
  48797. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48798. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48799. e.bumpScale.value = t.bumpScale),
  48800. t.normalMap && (e.normalMap.value = t.normalMap,
  48801. e.normalScale.value.copy(t.normalScale)),
  48802. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48803. e.displacementScale.value = t.displacementScale,
  48804. e.displacementBias.value = t.displacementBias),
  48805. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48806. }
  48807. function D(e, t) {
  48808. e.ambientLightColor.needsUpdate = t,
  48809. e.directionalLights.needsUpdate = t,
  48810. e.pointLights.needsUpdate = t,
  48811. e.spotLights.needsUpdate = t,
  48812. e.hemisphereLights.needsUpdate = t
  48813. }
  48814. function N(e, t) {
  48815. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48816. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48817. }
  48818. function B() {
  48819. var e = xe;
  48820. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  48821. xe += 1,
  48822. e
  48823. }
  48824. function F(e, t, i, r) {
  48825. var o, a;
  48826. if ("1i" === t)
  48827. Ge.uniform1i(i, r);
  48828. else if ("1f" === t)
  48829. Ge.uniform1f(i, r);
  48830. else if ("2f" === t)
  48831. Ge.uniform2f(i, r[0], r[1]);
  48832. else if ("3f" === t)
  48833. Ge.uniform3f(i, r[0], r[1], r[2]);
  48834. else if ("4f" === t)
  48835. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  48836. else if ("1iv" === t)
  48837. Ge.uniform1iv(i, r);
  48838. else if ("3iv" === t)
  48839. Ge.uniform3iv(i, r);
  48840. else if ("1fv" === t)
  48841. Ge.uniform1fv(i, r);
  48842. else if ("2fv" === t)
  48843. Ge.uniform2fv(i, r);
  48844. else if ("3fv" === t)
  48845. Ge.uniform3fv(i, r);
  48846. else if ("4fv" === t)
  48847. Ge.uniform4fv(i, r);
  48848. else if ("Matrix2fv" === t)
  48849. Ge.uniformMatrix2fv(i, !1, r);
  48850. else if ("Matrix3fv" === t)
  48851. Ge.uniformMatrix3fv(i, !1, r);
  48852. else if ("Matrix4fv" === t)
  48853. Ge.uniformMatrix4fv(i, !1, r);
  48854. else if ("i" === t)
  48855. Ge.uniform1i(i, r);
  48856. else if ("f" === t)
  48857. Ge.uniform1f(i, r);
  48858. else if ("v2" === t)
  48859. Ge.uniform2f(i, r.x, r.y);
  48860. else if ("v3" === t)
  48861. Ge.uniform3f(i, r.x, r.y, r.z);
  48862. else if ("v4" === t)
  48863. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  48864. else if ("c" === t)
  48865. Ge.uniform3f(i, r.r, r.g, r.b);
  48866. else if ("s" === t) {
  48867. var s = e.properties;
  48868. for (var l in s) {
  48869. var c = s[l]
  48870. , h = i[l]
  48871. , u = r[l];
  48872. F(c, c.type, h, u)
  48873. }
  48874. } else if ("sa" === t)
  48875. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  48876. for (var l in s) {
  48877. var c = s[l]
  48878. , h = i[d][l]
  48879. , u = r[d][l];
  48880. F(c, c.type, h, u)
  48881. }
  48882. else if ("iv1" === t)
  48883. Ge.uniform1iv(i, r);
  48884. else if ("iv" === t)
  48885. Ge.uniform3iv(i, r);
  48886. else if ("fv1" === t)
  48887. Ge.uniform1fv(i, r);
  48888. else if ("fv" === t)
  48889. Ge.uniform3fv(i, r);
  48890. else if ("v2v" === t) {
  48891. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  48892. for (var d = 0, f = 0, g = r.length; d < g; d++,
  48893. f += 2)
  48894. e._array[f + 0] = r[d].x,
  48895. e._array[f + 1] = r[d].y;
  48896. Ge.uniform2fv(i, e._array)
  48897. } else if ("v3v" === t) {
  48898. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  48899. for (var d = 0, m = 0, g = r.length; d < g; d++,
  48900. m += 3)
  48901. e._array[m + 0] = r[d].x,
  48902. e._array[m + 1] = r[d].y,
  48903. e._array[m + 2] = r[d].z;
  48904. Ge.uniform3fv(i, e._array)
  48905. } else if ("v4v" === t) {
  48906. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  48907. for (var d = 0, v = 0, g = r.length; d < g; d++,
  48908. v += 4)
  48909. e._array[v + 0] = r[d].x,
  48910. e._array[v + 1] = r[d].y,
  48911. e._array[v + 2] = r[d].z,
  48912. e._array[v + 3] = r[d].w;
  48913. Ge.uniform4fv(i, e._array)
  48914. } else if ("m2" === t)
  48915. Ge.uniformMatrix2fv(i, !1, r.elements);
  48916. else if ("m3" === t)
  48917. Ge.uniformMatrix3fv(i, !1, r.elements);
  48918. else if ("m3v" === t) {
  48919. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  48920. for (var d = 0, g = r.length; d < g; d++)
  48921. r[d].flattenToArrayOffset(e._array, 9 * d);
  48922. Ge.uniformMatrix3fv(i, !1, e._array)
  48923. } else if ("m4" === t)
  48924. Ge.uniformMatrix4fv(i, !1, r.elements);
  48925. else if ("m4v" === t) {
  48926. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  48927. for (var d = 0, g = r.length; d < g; d++)
  48928. r[d].flattenToArrayOffset(e._array, 16 * d);
  48929. Ge.uniformMatrix4fv(i, !1, e._array)
  48930. } else if ("t" === t) {
  48931. if (o = r,
  48932. a = B(),
  48933. Ge.uniform1i(i, a),
  48934. !o)
  48935. return;
  48936. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  48937. } else if ("tv" === t) {
  48938. void 0 === e._array && (e._array = []);
  48939. for (var d = 0, g = e.value.length; d < g; d++)
  48940. e._array[d] = B();
  48941. Ge.uniform1iv(i, e._array);
  48942. for (var d = 0, g = e.value.length; d < g; d++)
  48943. o = e.value[d],
  48944. a = e._array[d],
  48945. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  48946. } else
  48947. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48948. }
  48949. function V(e) {
  48950. for (var t = 0, i = e.length; t < i; t++) {
  48951. var n = e[t][0];
  48952. if (n.needsUpdate !== !1) {
  48953. var r = n.type
  48954. , o = e[t][1]
  48955. , a = n.value;
  48956. F(n, r, o, a)
  48957. }
  48958. }
  48959. }
  48960. function U(e, t) {
  48961. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  48962. for (Ue.shadowsPointLight = 0,
  48963. i = 0,
  48964. r = e.length; i < r; i++)
  48965. if (o = e[i],
  48966. a = o.color,
  48967. s = o.intensity,
  48968. l = o.distance,
  48969. o instanceof n.AmbientLight)
  48970. c += a.r * s,
  48971. h += a.g * s,
  48972. u += a.b * s;
  48973. else if (o instanceof n.DirectionalLight) {
  48974. var A = Ke.get(o);
  48975. A.color.copy(o.color).multiplyScalar(o.intensity),
  48976. A.direction.setFromMatrixPosition(o.matrixWorld),
  48977. Ve.setFromMatrixPosition(o.target.matrixWorld),
  48978. A.direction.sub(Ve),
  48979. A.direction.transformDirection(d),
  48980. A.shadow = o.castShadow,
  48981. o.castShadow && (A.shadowBias = o.shadow.bias,
  48982. A.shadowRadius = o.shadow.radius,
  48983. A.shadowMapSize = o.shadow.mapSize,
  48984. Ue.shadows[v++] = o),
  48985. Ue.directionalShadowMap[p] = o.shadow.map,
  48986. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  48987. Ue.directional[p++] = A
  48988. } else if (o instanceof n.SpotLight) {
  48989. var A = Ke.get(o);
  48990. A.position.setFromMatrixPosition(o.matrixWorld),
  48991. A.position.applyMatrix4(d),
  48992. A.color.copy(a).multiplyScalar(s),
  48993. A.distance = l,
  48994. A.direction.setFromMatrixPosition(o.matrixWorld),
  48995. Ve.setFromMatrixPosition(o.target.matrixWorld),
  48996. A.direction.sub(Ve),
  48997. A.direction.transformDirection(d),
  48998. A.coneCos = Math.cos(o.angle),
  48999. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  49000. A.decay = 0 === o.distance ? 0 : o.decay,
  49001. A.shadow = o.castShadow,
  49002. o.castShadow && (A.shadowBias = o.shadow.bias,
  49003. A.shadowRadius = o.shadow.radius,
  49004. A.shadowMapSize = o.shadow.mapSize,
  49005. Ue.shadows[v++] = o),
  49006. Ue.spotShadowMap[g] = o.shadow.map,
  49007. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  49008. Ue.spot[g++] = A
  49009. } else if (o instanceof n.PointLight) {
  49010. var A = Ke.get(o);
  49011. A.position.setFromMatrixPosition(o.matrixWorld),
  49012. A.position.applyMatrix4(d),
  49013. A.color.copy(o.color).multiplyScalar(o.intensity),
  49014. A.distance = o.distance,
  49015. A.decay = 0 === o.distance ? 0 : o.decay,
  49016. A.shadow = o.castShadow,
  49017. o.castShadow && (A.shadowBias = o.shadow.bias,
  49018. A.shadowRadius = o.shadow.radius,
  49019. A.shadowMapSize = o.shadow.mapSize,
  49020. Ue.shadows[v++] = o),
  49021. Ue.pointShadowMap[f] = o.shadow.map,
  49022. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  49023. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  49024. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  49025. Ue.point[f++] = A
  49026. } else if (o instanceof n.HemisphereLight) {
  49027. var A = Ke.get(o);
  49028. A.direction.setFromMatrixPosition(o.matrixWorld),
  49029. A.direction.transformDirection(d),
  49030. A.direction.normalize(),
  49031. A.skyColor.copy(o.color).multiplyScalar(s),
  49032. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  49033. Ue.hemi[m++] = A
  49034. }
  49035. Ue.ambient[0] = c,
  49036. Ue.ambient[1] = h,
  49037. Ue.ambient[2] = u,
  49038. Ue.directional.length = p,
  49039. Ue.spot.length = g,
  49040. Ue.point.length = f,
  49041. Ue.hemi.length = m,
  49042. Ue.shadows.length = v,
  49043. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  49044. }
  49045. function k(e, t, i) {
  49046. var r;
  49047. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  49048. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  49049. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  49050. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  49051. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  49052. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  49053. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  49054. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  49055. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  49056. r = We.get("EXT_texture_filter_anisotropic")) {
  49057. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  49058. return;
  49059. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  49060. return;
  49061. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  49062. Xe.get(t).__currentAnisotropy = t.anisotropy)
  49063. }
  49064. }
  49065. function H(e, t, i) {
  49066. void 0 === e.__webglInit && (e.__webglInit = !0,
  49067. t.addEventListener("dispose", s),
  49068. e.__webglTexture = Ge.createTexture(),
  49069. ke.textures++),
  49070. Ye.activeTexture(Ge.TEXTURE0 + i),
  49071. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  49072. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49073. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49074. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  49075. var r = G(t.image, je.maxTextureSize);
  49076. W(t) && z(r) === !1 && (r = j(r));
  49077. var o = z(r)
  49078. , a = ee(t.format)
  49079. , l = ee(t.type);
  49080. k(Ge.TEXTURE_2D, t, o);
  49081. var c, h = t.mipmaps;
  49082. if (t instanceof n.DataTexture)
  49083. if (h.length > 0 && o) {
  49084. for (var u = 0, d = h.length; u < d; u++)
  49085. c = h[u],
  49086. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49087. t.generateMipmaps = !1
  49088. } else
  49089. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  49090. else if (t instanceof n.CompressedTexture)
  49091. for (var u = 0, d = h.length; u < d; u++)
  49092. c = h[u],
  49093. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49094. else if (h.length > 0 && o) {
  49095. for (var u = 0, d = h.length; u < d; u++)
  49096. c = h[u],
  49097. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  49098. t.generateMipmaps = !1
  49099. } else
  49100. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  49101. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49102. e.__version = t.version,
  49103. t.onUpdate && t.onUpdate(t)
  49104. }
  49105. function G(e, t) {
  49106. if (e.width > t || e.height > t) {
  49107. var i = t / Math.max(e.width, e.height)
  49108. , n = document.createElement("canvas");
  49109. n.width = Math.floor(e.width * i),
  49110. n.height = Math.floor(e.height * i);
  49111. var r = n.getContext("2d");
  49112. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49113. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49114. n
  49115. }
  49116. return e
  49117. }
  49118. function z(e) {
  49119. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  49120. }
  49121. function W(e) {
  49122. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  49123. }
  49124. function j(e) {
  49125. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49126. var t = document.createElement("canvas");
  49127. t.width = n.Math.nearestPowerOfTwo(e.width),
  49128. t.height = n.Math.nearestPowerOfTwo(e.height);
  49129. var i = t.getContext("2d");
  49130. return i.drawImage(e, 0, 0, t.width, t.height),
  49131. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49132. t
  49133. }
  49134. return e
  49135. }
  49136. function Y(e, t) {
  49137. var i = Xe.get(e);
  49138. if (6 === e.image.length)
  49139. if (e.version > 0 && i.__version !== e.version) {
  49140. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  49141. i.__image__webglTextureCube = Ge.createTexture(),
  49142. ke.textures++),
  49143. Ye.activeTexture(Ge.TEXTURE0 + t),
  49144. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49145. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49146. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  49147. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  49148. var c = a[0]
  49149. , h = z(c)
  49150. , u = ee(e.format)
  49151. , d = ee(e.type);
  49152. k(Ge.TEXTURE_CUBE_MAP, e, h);
  49153. for (var l = 0; l < 6; l++)
  49154. if (r)
  49155. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  49156. p = f[g],
  49157. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  49158. else
  49159. o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  49160. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49161. i.__version = e.version,
  49162. e.onUpdate && e.onUpdate(e)
  49163. } else
  49164. Ye.activeTexture(Ge.TEXTURE0 + t),
  49165. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49166. }
  49167. function X(e, t) {
  49168. Ye.activeTexture(Ge.TEXTURE0 + t),
  49169. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  49170. }
  49171. function Z(e, t, i, n) {
  49172. var r = ee(t.texture.format)
  49173. , o = ee(t.texture.type);
  49174. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49175. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  49176. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  49177. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49178. }
  49179. function q(e, t) {
  49180. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  49181. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  49182. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  49183. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  49184. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  49185. }
  49186. function K(e) {
  49187. var t = Xe.get(e)
  49188. , i = e instanceof n.WebGLRenderTargetCube;
  49189. if (i) {
  49190. t.__webglDepthbuffer = [];
  49191. for (var r = 0; r < 6; r++)
  49192. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  49193. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  49194. q(t.__webglDepthbuffer[r], e)
  49195. } else
  49196. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  49197. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  49198. q(t.__webglDepthbuffer, e);
  49199. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49200. }
  49201. function Q(e) {
  49202. var t = Xe.get(e)
  49203. , i = Xe.get(e.texture);
  49204. e.addEventListener("dispose", l),
  49205. i.__webglTexture = Ge.createTexture(),
  49206. ke.textures++;
  49207. var r = e instanceof n.WebGLRenderTargetCube
  49208. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  49209. if (r) {
  49210. t.__webglFramebuffer = [];
  49211. for (var a = 0; a < 6; a++)
  49212. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  49213. } else
  49214. t.__webglFramebuffer = Ge.createFramebuffer();
  49215. if (r) {
  49216. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  49217. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  49218. for (var a = 0; a < 6; a++)
  49219. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  49220. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49221. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  49222. } else
  49223. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  49224. k(Ge.TEXTURE_2D, e.texture, o),
  49225. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  49226. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49227. Ye.bindTexture(Ge.TEXTURE_2D, null);
  49228. e.depthBuffer && K(e)
  49229. }
  49230. function J(e) {
  49231. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  49232. , i = Xe.get(e.texture).__webglTexture;
  49233. Ye.bindTexture(t, i),
  49234. Ge.generateMipmap(t),
  49235. Ye.bindTexture(t, null)
  49236. }
  49237. function $(e) {
  49238. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  49239. }
  49240. function ee(e) {
  49241. var t;
  49242. if (e === n.RepeatWrapping)
  49243. return Ge.REPEAT;
  49244. if (e === n.ClampToEdgeWrapping)
  49245. return Ge.CLAMP_TO_EDGE;
  49246. if (e === n.MirroredRepeatWrapping)
  49247. return Ge.MIRRORED_REPEAT;
  49248. if (e === n.NearestFilter)
  49249. return Ge.NEAREST;
  49250. if (e === n.NearestMipMapNearestFilter)
  49251. return Ge.NEAREST_MIPMAP_NEAREST;
  49252. if (e === n.NearestMipMapLinearFilter)
  49253. return Ge.NEAREST_MIPMAP_LINEAR;
  49254. if (e === n.LinearFilter)
  49255. return Ge.LINEAR;
  49256. if (e === n.LinearMipMapNearestFilter)
  49257. return Ge.LINEAR_MIPMAP_NEAREST;
  49258. if (e === n.LinearMipMapLinearFilter)
  49259. return Ge.LINEAR_MIPMAP_LINEAR;
  49260. if (e === n.UnsignedByteType)
  49261. return Ge.UNSIGNED_BYTE;
  49262. if (e === n.UnsignedShort4444Type)
  49263. return Ge.UNSIGNED_SHORT_4_4_4_4;
  49264. if (e === n.UnsignedShort5551Type)
  49265. return Ge.UNSIGNED_SHORT_5_5_5_1;
  49266. if (e === n.UnsignedShort565Type)
  49267. return Ge.UNSIGNED_SHORT_5_6_5;
  49268. if (e === n.ByteType)
  49269. return Ge.BYTE;
  49270. if (e === n.ShortType)
  49271. return Ge.SHORT;
  49272. if (e === n.UnsignedShortType)
  49273. return Ge.UNSIGNED_SHORT;
  49274. if (e === n.IntType)
  49275. return Ge.INT;
  49276. if (e === n.UnsignedIntType)
  49277. return Ge.UNSIGNED_INT;
  49278. if (e === n.FloatType)
  49279. return Ge.FLOAT;
  49280. if (t = We.get("OES_texture_half_float"),
  49281. null !== t && e === n.HalfFloatType)
  49282. return t.HALF_FLOAT_OES;
  49283. if (e === n.AlphaFormat)
  49284. return Ge.ALPHA;
  49285. if (e === n.RGBFormat)
  49286. return Ge.RGB;
  49287. if (e === n.RGBAFormat)
  49288. return Ge.RGBA;
  49289. if (e === n.LuminanceFormat)
  49290. return Ge.LUMINANCE;
  49291. if (e === n.LuminanceAlphaFormat)
  49292. return Ge.LUMINANCE_ALPHA;
  49293. if (e === n.AddEquation)
  49294. return Ge.FUNC_ADD;
  49295. if (e === n.SubtractEquation)
  49296. return Ge.FUNC_SUBTRACT;
  49297. if (e === n.ReverseSubtractEquation)
  49298. return Ge.FUNC_REVERSE_SUBTRACT;
  49299. if (e === n.ZeroFactor)
  49300. return Ge.ZERO;
  49301. if (e === n.OneFactor)
  49302. return Ge.ONE;
  49303. if (e === n.SrcColorFactor)
  49304. return Ge.SRC_COLOR;
  49305. if (e === n.OneMinusSrcColorFactor)
  49306. return Ge.ONE_MINUS_SRC_COLOR;
  49307. if (e === n.SrcAlphaFactor)
  49308. return Ge.SRC_ALPHA;
  49309. if (e === n.OneMinusSrcAlphaFactor)
  49310. return Ge.ONE_MINUS_SRC_ALPHA;
  49311. if (e === n.DstAlphaFactor)
  49312. return Ge.DST_ALPHA;
  49313. if (e === n.OneMinusDstAlphaFactor)
  49314. return Ge.ONE_MINUS_DST_ALPHA;
  49315. if (e === n.DstColorFactor)
  49316. return Ge.DST_COLOR;
  49317. if (e === n.OneMinusDstColorFactor)
  49318. return Ge.ONE_MINUS_DST_COLOR;
  49319. if (e === n.SrcAlphaSaturateFactor)
  49320. return Ge.SRC_ALPHA_SATURATE;
  49321. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  49322. null !== t) {
  49323. if (e === n.RGB_S3TC_DXT1_Format)
  49324. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49325. if (e === n.RGBA_S3TC_DXT1_Format)
  49326. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49327. if (e === n.RGBA_S3TC_DXT3_Format)
  49328. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49329. if (e === n.RGBA_S3TC_DXT5_Format)
  49330. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49331. }
  49332. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  49333. null !== t) {
  49334. if (e === n.RGB_PVRTC_4BPPV1_Format)
  49335. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49336. if (e === n.RGB_PVRTC_2BPPV1_Format)
  49337. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49338. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  49339. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49340. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  49341. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49342. }
  49343. if (t = We.get("WEBGL_compressed_texture_etc1"),
  49344. null !== t && e === n.RGB_ETC1_Format)
  49345. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49346. if (t = We.get("EXT_blend_minmax"),
  49347. null !== t) {
  49348. if (e === n.MinEquation)
  49349. return t.MIN_EXT;
  49350. if (e === n.MaxEquation)
  49351. return t.MAX_EXT
  49352. }
  49353. return 0
  49354. }
  49355. console.log("THREE.WebGLRenderer", n.REVISION),
  49356. e = e || {};
  49357. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  49358. , ie = void 0 !== e.context ? e.context : null
  49359. , ne = void 0 !== e.alpha && e.alpha
  49360. , re = void 0 === e.depth || e.depth
  49361. , oe = void 0 === e.stencil || e.stencil
  49362. , ae = void 0 !== e.antialias && e.antialias
  49363. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49364. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49365. , ce = []
  49366. , he = []
  49367. , ue = -1
  49368. , de = []
  49369. , pe = -1
  49370. , fe = new Float32Array(8)
  49371. , ge = []
  49372. , me = [];
  49373. this.domElement = te,
  49374. this.context = null,
  49375. this.autoClear = !0,
  49376. this.autoClearColor = !0,
  49377. this.autoClearDepth = !0,
  49378. this.autoClearStencil = !0,
  49379. this.sortObjects = !0,
  49380. this.gammaFactor = 2,
  49381. this.gammaInput = !1,
  49382. this.gammaOutput = !1,
  49383. this.physicallyCorrectLights = !1,
  49384. this.toneMapping = n.LinearToneMapping,
  49385. this.toneMappingExposure = 1,
  49386. this.toneMappingWhitePoint = 1,
  49387. this.maxMorphTargets = 8,
  49388. this.maxMorphNormals = 4,
  49389. this.autoScaleCubemaps = !0;
  49390. var ve = this
  49391. , Ae = null
  49392. , ye = null
  49393. , Ce = null
  49394. , Ie = -1
  49395. , Ee = ""
  49396. , be = null
  49397. , we = new n.Vector4
  49398. , _e = null
  49399. , Te = new n.Vector4
  49400. , xe = 0
  49401. , Se = new n.Color(0)
  49402. , Me = 0
  49403. , Re = te.width
  49404. , Pe = te.height
  49405. , Oe = 1
  49406. , Le = new n.Vector4(0,0,Re,Pe)
  49407. , De = !1
  49408. , Ne = new n.Vector4(0,0,Re,Pe)
  49409. , Be = new n.Frustum
  49410. , Fe = new n.Matrix4
  49411. , Ve = new n.Vector3
  49412. , Ue = {
  49413. hash: "",
  49414. ambient: [0, 0, 0],
  49415. directional: [],
  49416. directionalShadowMap: [],
  49417. directionalShadowMatrix: [],
  49418. spot: [],
  49419. spotShadowMap: [],
  49420. spotShadowMatrix: [],
  49421. point: [],
  49422. pointShadowMap: [],
  49423. pointShadowMatrix: [],
  49424. hemi: [],
  49425. shadows: [],
  49426. shadowsPointLight: 0
  49427. }
  49428. , ke = {
  49429. geometries: 0,
  49430. textures: 0
  49431. }
  49432. , He = {
  49433. calls: 0,
  49434. vertices: 0,
  49435. faces: 0,
  49436. points: 0
  49437. };
  49438. this.info = {
  49439. render: He,
  49440. memory: ke,
  49441. programs: null
  49442. };
  49443. var Ge;
  49444. try {
  49445. var ze = {
  49446. alpha: ne,
  49447. depth: re,
  49448. stencil: oe,
  49449. antialias: ae,
  49450. premultipliedAlpha: se,
  49451. preserveDrawingBuffer: le
  49452. };
  49453. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  49454. null === Ge)
  49455. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49456. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  49457. return {
  49458. rangeMin: 1,
  49459. rangeMax: 1,
  49460. precision: 1
  49461. }
  49462. }
  49463. ),
  49464. te.addEventListener("webglcontextlost", a, !1)
  49465. } catch (e) {
  49466. console.error("THREE.WebGLRenderer: " + e)
  49467. }
  49468. var We = new n.WebGLExtensions(Ge);
  49469. We.get("OES_texture_float"),
  49470. We.get("OES_texture_float_linear"),
  49471. We.get("OES_texture_half_float"),
  49472. We.get("OES_texture_half_float_linear"),
  49473. We.get("OES_standard_derivatives"),
  49474. We.get("ANGLE_instanced_arrays"),
  49475. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  49476. var je = new n.WebGLCapabilities(Ge,We,e)
  49477. , Ye = new n.WebGLState(Ge,We,ee)
  49478. , Xe = new n.WebGLProperties
  49479. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  49480. , qe = new n.WebGLPrograms(this,je)
  49481. , Ke = new n.WebGLLights;
  49482. this.info.programs = qe.programs;
  49483. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  49484. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  49485. r(),
  49486. this.context = Ge,
  49487. this.capabilities = je,
  49488. this.extensions = We,
  49489. this.properties = Xe,
  49490. this.state = Ye;
  49491. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  49492. this.shadowMap = $e;
  49493. var et = new n.SpritePlugin(this,ge)
  49494. , tt = new n.LensFlarePlugin(this,me);
  49495. this.getContext = function() {
  49496. return Ge
  49497. }
  49498. ,
  49499. this.getContextAttributes = function() {
  49500. return Ge.getContextAttributes()
  49501. }
  49502. ,
  49503. this.forceContextLoss = function() {
  49504. We.get("WEBGL_lose_context").loseContext()
  49505. }
  49506. ,
  49507. this.getMaxAnisotropy = function() {
  49508. var e;
  49509. return function() {
  49510. if (void 0 !== e)
  49511. return e;
  49512. var t = We.get("EXT_texture_filter_anisotropic");
  49513. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49514. }
  49515. }(),
  49516. this.getPrecision = function() {
  49517. return je.precision
  49518. }
  49519. ,
  49520. this.getPixelRatio = function() {
  49521. return Oe
  49522. }
  49523. ,
  49524. this.setPixelRatio = function(e) {
  49525. void 0 !== e && (Oe = e,
  49526. this.setSize(Ne.z, Ne.w, !1))
  49527. }
  49528. ,
  49529. this.getSize = function() {
  49530. return {
  49531. width: Re,
  49532. height: Pe
  49533. }
  49534. }
  49535. ,
  49536. this.setSize = function(e, t, i, devicePixelRatio) {
  49537. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  49538. Re = e,
  49539. Pe = t,
  49540. te.width = e * Oe,
  49541. te.height = t * Oe,
  49542. i !== !1 && (te.style.width = e + "px",
  49543. te.style.height = t + "px"),
  49544. this.setViewport(0, 0, e, t)
  49545. }
  49546. ,
  49547. this.setViewport = function(e, t, i, n) {
  49548. Ye.viewport(Ne.set(e, t, i, n))
  49549. }
  49550. ,
  49551. this.setScissor = function(e, t, i, n) {
  49552. Ye.scissor(Le.set(e, t, i, n))
  49553. }
  49554. ,
  49555. this.setScissorTest = function(e) {
  49556. Ye.setScissorTest(De = e)
  49557. }
  49558. ,
  49559. this.getClearColor = function() {
  49560. return Se
  49561. }
  49562. ,
  49563. this.setClearColor = function(e, t) {
  49564. Se.set(e),
  49565. Me = void 0 !== t ? t : 1,
  49566. i(Se.r, Se.g, Se.b, Me)
  49567. }
  49568. ,
  49569. this.getClearAlpha = function() {
  49570. return Me
  49571. }
  49572. ,
  49573. this.setClearAlpha = function(e) {
  49574. Me = e,
  49575. i(Se.r, Se.g, Se.b, Me)
  49576. }
  49577. ,
  49578. this.clear = function(e, t, i) {
  49579. var n = 0;
  49580. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  49581. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  49582. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  49583. Ge.clear(n)
  49584. }
  49585. ,
  49586. this.clearColor = function() {
  49587. this.clear(!0, !1, !1)
  49588. }
  49589. ,
  49590. this.clearDepth = function() {
  49591. this.clear(!1, !0, !1)
  49592. }
  49593. ,
  49594. this.clearStencil = function() {
  49595. this.clear(!1, !1, !0)
  49596. }
  49597. ,
  49598. this.clearTarget = function(e, t, i, n) {
  49599. this.setRenderTarget(e),
  49600. this.clear(t, i, n)
  49601. }
  49602. ,
  49603. this.resetGLState = o,
  49604. this.dispose = function() {
  49605. te.removeEventListener("webglcontextlost", a, !1)
  49606. }
  49607. ,
  49608. this.renderBufferImmediate = function(e, t, i) {
  49609. Ye.initAttributes();
  49610. var r = Xe.get(e);
  49611. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  49612. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  49613. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  49614. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  49615. var o = t.getAttributes();
  49616. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  49617. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  49618. Ye.enableAttribute(o.position),
  49619. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  49620. e.hasNormals) {
  49621. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  49622. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  49623. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  49624. var l = e.normalArray
  49625. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  49626. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  49627. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  49628. l[a + 0] = c,
  49629. l[a + 1] = h,
  49630. l[a + 2] = u,
  49631. l[a + 3] = c,
  49632. l[a + 4] = h,
  49633. l[a + 5] = u,
  49634. l[a + 6] = c,
  49635. l[a + 7] = h,
  49636. l[a + 8] = u
  49637. }
  49638. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  49639. Ye.enableAttribute(o.normal),
  49640. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  49641. }
  49642. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  49643. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  49644. Ye.enableAttribute(o.uv),
  49645. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  49646. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  49647. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  49648. Ye.enableAttribute(o.color),
  49649. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  49650. Ye.disableUnusedAttributes(),
  49651. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  49652. e.count = 0
  49653. }
  49654. ,
  49655. this.renderBufferDirect = function(e, i, r, o, a, s) {
  49656. E(o);
  49657. var l = w(e, i, o, a)
  49658. , c = !1
  49659. , h = r.id + "_" + l.id + "_" + o.wireframe;
  49660. h !== Ee && (Ee = h,
  49661. c = !0);
  49662. var u = a.morphTargetInfluences;
  49663. if (void 0 !== u) {
  49664. for (var d = [], p = 0, m = u.length; p < m; p++) {
  49665. var v = u[p];
  49666. d.push([v, p])
  49667. }
  49668. d.sort(g),
  49669. d.length > 8 && (d.length = 8);
  49670. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  49671. var v = d[p];
  49672. if (fe[p] = v[0],
  49673. 0 !== v[0]) {
  49674. var y = v[1];
  49675. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  49676. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  49677. } else
  49678. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  49679. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  49680. }
  49681. var C = l.getUniforms();
  49682. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  49683. c = !0
  49684. }
  49685. var y = r.index
  49686. , I = r.attributes.position;
  49687. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  49688. var b;
  49689. null !== y ? (b = Je,
  49690. b.setIndex(y)) : b = Qe,
  49691. c && (f(o, l, r),
  49692. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  49693. var _ = 0
  49694. , T = 1 / 0;
  49695. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  49696. var x = r.drawRange.start
  49697. , S = r.drawRange.count
  49698. , M = null !== s ? s.start : 0
  49699. , R = null !== s ? s.count : 1 / 0
  49700. , P = Math.max(_, x, M)
  49701. , O = Math.min(_ + T, x + S, M + R) - 1
  49702. , L = Math.max(0, O - P + 1);
  49703. if (a instanceof n.Mesh)
  49704. if (o.wireframe === !0)
  49705. Ye.setLineWidth(o.wireframeLinewidth * t()),
  49706. b.setMode(Ge.LINES);
  49707. else
  49708. switch (a.drawMode) {
  49709. case n.TrianglesDrawMode:
  49710. b.setMode(Ge.TRIANGLES);
  49711. break;
  49712. case n.TriangleStripDrawMode:
  49713. b.setMode(Ge.TRIANGLE_STRIP);
  49714. break;
  49715. case n.TriangleFanDrawMode:
  49716. b.setMode(Ge.TRIANGLE_FAN)
  49717. }
  49718. else if (a instanceof n.Line) {
  49719. var D = o.linewidth;
  49720. void 0 === D && (D = 1),
  49721. Ye.setLineWidth(D * t()),
  49722. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  49723. } else
  49724. a instanceof n.Points && b.setMode(Ge.POINTS);
  49725. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  49726. }
  49727. ,
  49728. this.render = function(e, t, i, r) {
  49729. if (t instanceof n.Camera == !1)
  49730. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  49731. var o = e.fog;
  49732. if (Ee = "",
  49733. Ie = -1,
  49734. be = null,
  49735. e.autoUpdate === !0 && e.updateMatrixWorld(),
  49736. null === t.parent && t.updateMatrixWorld(),
  49737. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49738. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49739. Be.setFromMatrix(Fe),
  49740. ce.length = 0,
  49741. ue = -1,
  49742. pe = -1,
  49743. ge.length = 0,
  49744. me.length = 0,
  49745. y(e, t),
  49746. he.length = ue + 1,
  49747. de.length = pe + 1,
  49748. ve.sortObjects === !0 && (he.sort(m),
  49749. de.sort(v)),
  49750. U(ce, t),
  49751. $e.render(e, t),
  49752. He.calls = 0,
  49753. He.vertices = 0,
  49754. He.faces = 0,
  49755. He.points = 0,
  49756. void 0 === i && (i = null),
  49757. this.setRenderTarget(i),
  49758. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49759. e.overrideMaterial) {
  49760. var a = e.overrideMaterial;
  49761. C(he, t, o, a),
  49762. C(de, t, o, a)
  49763. } else
  49764. Ye.setBlending(n.NoBlending),
  49765. C(he, t, o),
  49766. C(de, t, o);
  49767. if (et.render(e, t),
  49768. tt.render(e, t, Te),
  49769. i) {
  49770. var s = i.texture;
  49771. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  49772. }
  49773. Ye.setDepthTest(!0),
  49774. Ye.setDepthWrite(!0),
  49775. Ye.setColorWrite(!0)
  49776. }
  49777. ,
  49778. this.setFaceCulling = function(e, t) {
  49779. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  49780. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  49781. Ye.enable(Ge.CULL_FACE))
  49782. }
  49783. ,
  49784. this.setTexture = function(e, t) {
  49785. var i = Xe.get(e);
  49786. if (e.version > 0 && i.__version !== e.version) {
  49787. var n = e.image;
  49788. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  49789. }
  49790. Ye.activeTexture(Ge.TEXTURE0 + t),
  49791. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  49792. }
  49793. ,
  49794. this.getCurrentRenderTarget = function() {
  49795. return ye
  49796. }
  49797. ,
  49798. this.setRenderTarget = function(e) {
  49799. ye = e,
  49800. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  49801. var t, i = e instanceof n.WebGLRenderTargetCube;
  49802. if (e) {
  49803. var r = Xe.get(e);
  49804. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  49805. we.copy(e.scissor),
  49806. _e = e.scissorTest,
  49807. Te.copy(e.viewport)
  49808. } else
  49809. t = null,
  49810. we.copy(Le).multiplyScalar(Oe),
  49811. _e = De,
  49812. Te.copy(Ne).multiplyScalar(Oe);
  49813. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  49814. Ce = t),
  49815. Ye.scissor(we),
  49816. Ye.setScissorTest(_e),
  49817. Ye.viewport(Te),
  49818. i) {
  49819. var o = Xe.get(e.texture);
  49820. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  49821. }
  49822. }
  49823. ,
  49824. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  49825. if (e instanceof n.WebGLRenderTarget == !1)
  49826. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  49827. var s = Xe.get(e).__webglFramebuffer;
  49828. if (s) {
  49829. var l = !1;
  49830. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  49831. l = !0);
  49832. try {
  49833. var c = e.texture;
  49834. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  49835. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49836. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  49837. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49838. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  49839. } finally {
  49840. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  49841. }
  49842. }
  49843. }
  49844. }
  49845. ,
  49846. n.WebGLRenderTarget = function(e, t, i) {
  49847. this.uuid = n.Math.generateUUID(),
  49848. this.width = e,
  49849. this.height = t,
  49850. this.scissor = new n.Vector4(0,0,e,t),
  49851. this.scissorTest = !1,
  49852. this.viewport = new n.Vector4(0,0,e,t),
  49853. i = i || {},
  49854. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  49855. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49856. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49857. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49858. }
  49859. ,
  49860. n.WebGLRenderTarget.prototype = {
  49861. constructor: n.WebGLRenderTarget,
  49862. setSize: function(e, t) {
  49863. this.width === e && this.height === t || (this.width = e,
  49864. this.height = t,
  49865. this.dispose()),
  49866. this.viewport.set(0, 0, e, t),
  49867. this.scissor.set(0, 0, e, t)
  49868. },
  49869. clone: function() {
  49870. return (new this.constructor).copy(this)
  49871. },
  49872. copy: function(e) {
  49873. return this.width = e.width,
  49874. this.height = e.height,
  49875. this.viewport.copy(e.viewport),
  49876. this.texture = e.texture.clone(),
  49877. this.depthBuffer = e.depthBuffer,
  49878. this.stencilBuffer = e.stencilBuffer,
  49879. this
  49880. },
  49881. dispose: function() {
  49882. this.dispatchEvent({
  49883. type: "dispose"
  49884. })
  49885. }
  49886. },
  49887. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  49888. n.WebGLRenderTargetCube = function(e, t, i) {
  49889. n.WebGLRenderTarget.call(this, e, t, i),
  49890. this.activeCubeFace = 0,
  49891. this.activeMipMapLevel = 0
  49892. }
  49893. ,
  49894. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  49895. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  49896. n.WebGLBufferRenderer = function(e, t, i) {
  49897. function r(e) {
  49898. s = e
  49899. }
  49900. function o(t, n) {
  49901. e.drawArrays(s, t, n),
  49902. i.calls++,
  49903. i.vertices += n,
  49904. s === e.TRIANGLES && (i.faces += n / 3)
  49905. }
  49906. function a(r) {
  49907. var o = t.get("ANGLE_instanced_arrays");
  49908. if (null === o)
  49909. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49910. var a = r.attributes.position
  49911. , l = 0;
  49912. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  49913. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  49914. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  49915. i.calls++,
  49916. i.vertices += l * r.maxInstancedCount,
  49917. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  49918. }
  49919. var s;
  49920. this.setMode = r,
  49921. this.render = o,
  49922. this.renderInstances = a
  49923. }
  49924. ,
  49925. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  49926. function n(e) {
  49927. s = e
  49928. }
  49929. function r(i) {
  49930. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  49931. c = 4) : (l = e.UNSIGNED_SHORT,
  49932. c = 2)
  49933. }
  49934. function o(t, n) {
  49935. e.drawElements(s, n, l, t * c),
  49936. i.calls++,
  49937. i.vertices += n,
  49938. s === e.TRIANGLES && (i.faces += n / 3)
  49939. }
  49940. function a(n, r, o) {
  49941. var a = t.get("ANGLE_instanced_arrays");
  49942. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  49943. i.calls++,
  49944. i.vertices += o * n.maxInstancedCount,
  49945. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  49946. }
  49947. var s, l, c;
  49948. this.setMode = n,
  49949. this.setIndex = r,
  49950. this.render = o,
  49951. this.renderInstances = a
  49952. }
  49953. ,
  49954. n.WebGLExtensions = function(e) {
  49955. var t = {};
  49956. this.get = function(i) {
  49957. if (void 0 !== t[i])
  49958. return t[i];
  49959. var n;
  49960. switch (i) {
  49961. case "EXT_texture_filter_anisotropic":
  49962. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49963. break;
  49964. case "WEBGL_compressed_texture_s3tc":
  49965. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49966. break;
  49967. case "WEBGL_compressed_texture_pvrtc":
  49968. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49969. break;
  49970. case "WEBGL_compressed_texture_etc1":
  49971. n = e.getExtension("WEBGL_compressed_texture_etc1");
  49972. break;
  49973. default:
  49974. n = e.getExtension(i)
  49975. }
  49976. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  49977. t[i] = n,
  49978. n
  49979. }
  49980. }
  49981. ,
  49982. n.WebGLCapabilities = function(e, t, i) {
  49983. function n(t) {
  49984. if ("highp" === t) {
  49985. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  49986. return "highp";
  49987. t = "mediump"
  49988. }
  49989. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  49990. }
  49991. this.getMaxPrecision = n,
  49992. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49993. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49994. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  49995. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49996. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  49997. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  49998. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  49999. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  50000. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  50001. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  50002. this.vertexTextures = this.maxVertexTextures > 0,
  50003. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  50004. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50005. var r = n(this.precision);
  50006. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50007. this.precision = r),
  50008. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  50009. }
  50010. ,
  50011. n.WebGLGeometries = function(e, t, i) {
  50012. function r(e) {
  50013. var t = e.geometry;
  50014. if (void 0 !== h[t.id])
  50015. return h[t.id];
  50016. t.addEventListener("dispose", o);
  50017. var r;
  50018. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  50019. r = t._bufferGeometry),
  50020. h[t.id] = r,
  50021. i.memory.geometries++,
  50022. r
  50023. }
  50024. function o(e) {
  50025. var n = e.target
  50026. , r = h[n.id];
  50027. null !== r.index && s(r.index),
  50028. l(r.attributes),
  50029. n.removeEventListener("dispose", o),
  50030. delete h[n.id];
  50031. var a = t.get(n);
  50032. a.wireframe && s(a.wireframe),
  50033. t.delete(n);
  50034. var c = t.get(r);
  50035. c.wireframe && s(c.wireframe),
  50036. t.delete(r),
  50037. i.memory.geometries--
  50038. }
  50039. function a(e) {
  50040. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50041. }
  50042. function s(t) {
  50043. var i = a(t);
  50044. void 0 !== i && (e.deleteBuffer(i),
  50045. c(t))
  50046. }
  50047. function l(e) {
  50048. for (var t in e)
  50049. s(e[t])
  50050. }
  50051. function c(e) {
  50052. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  50053. }
  50054. var h = {};
  50055. this.get = r
  50056. }
  50057. ,
  50058. n.WebGLLights = function() {
  50059. var e = {};
  50060. this.get = function(t) {
  50061. if (void 0 !== e[t.id])
  50062. return e[t.id];
  50063. var i;
  50064. switch (t.type) {
  50065. case "DirectionalLight":
  50066. i = {
  50067. direction: new n.Vector3,
  50068. color: new n.Color,
  50069. shadow: !1,
  50070. shadowBias: 0,
  50071. shadowRadius: 1,
  50072. shadowMapSize: new n.Vector2
  50073. };
  50074. break;
  50075. case "SpotLight":
  50076. i = {
  50077. position: new n.Vector3,
  50078. direction: new n.Vector3,
  50079. color: new n.Color,
  50080. distance: 0,
  50081. coneCos: 0,
  50082. penumbraCos: 0,
  50083. decay: 0,
  50084. shadow: !1,
  50085. shadowBias: 0,
  50086. shadowRadius: 1,
  50087. shadowMapSize: new n.Vector2
  50088. };
  50089. break;
  50090. case "PointLight":
  50091. i = {
  50092. position: new n.Vector3,
  50093. color: new n.Color,
  50094. distance: 0,
  50095. decay: 0,
  50096. shadow: !1,
  50097. shadowBias: 0,
  50098. shadowRadius: 1,
  50099. shadowMapSize: new n.Vector2
  50100. };
  50101. break;
  50102. case "HemisphereLight":
  50103. i = {
  50104. direction: new n.Vector3,
  50105. skyColor: new n.Color,
  50106. groundColor: new n.Color
  50107. }
  50108. }
  50109. return e[t.id] = i,
  50110. i
  50111. }
  50112. }
  50113. ,
  50114. n.WebGLObjects = function(e, t, i) {
  50115. function r(t) {
  50116. var i = u.get(t);
  50117. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  50118. var r = i.index
  50119. , a = i.attributes;
  50120. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  50121. for (var s in a)
  50122. o(a[s], e.ARRAY_BUFFER);
  50123. var l = i.morphAttributes;
  50124. for (var s in l)
  50125. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  50126. o(c[h], e.ARRAY_BUFFER);
  50127. return i
  50128. }
  50129. function o(e, i) {
  50130. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  50131. , o = t.get(r);
  50132. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  50133. }
  50134. function a(t, i, n) {
  50135. t.__webglBuffer = e.createBuffer(),
  50136. e.bindBuffer(n, t.__webglBuffer);
  50137. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  50138. e.bufferData(n, i.array, r),
  50139. t.version = i.version
  50140. }
  50141. function s(t, i, n) {
  50142. e.bindBuffer(n, t.__webglBuffer),
  50143. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  50144. i.updateRange.count = 0),
  50145. t.version = i.version
  50146. }
  50147. function l(e) {
  50148. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50149. }
  50150. function c(i) {
  50151. var r = t.get(i);
  50152. if (void 0 !== r.wireframe)
  50153. return r.wireframe;
  50154. var a = []
  50155. , s = i.index
  50156. , l = i.attributes
  50157. , c = l.position;
  50158. if (null !== s)
  50159. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  50160. var g = d[p + 0]
  50161. , m = d[p + 1]
  50162. , v = d[p + 2];
  50163. h(u, g, m) && a.push(g, m),
  50164. h(u, m, v) && a.push(m, v),
  50165. h(u, v, g) && a.push(v, g)
  50166. }
  50167. else
  50168. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  50169. var g = p + 0
  50170. , m = p + 1
  50171. , v = p + 2;
  50172. a.push(g, m, m, v, v, g)
  50173. }
  50174. var A = c.count > 65535 ? Uint32Array : Uint16Array
  50175. , y = new n.BufferAttribute(new A(a),1);
  50176. return o(y, e.ELEMENT_ARRAY_BUFFER),
  50177. r.wireframe = y,
  50178. y
  50179. }
  50180. function h(e, t, i) {
  50181. if (t > i) {
  50182. var n = t;
  50183. t = i,
  50184. i = n
  50185. }
  50186. var r = e[t];
  50187. return void 0 === r ? (e[t] = [i],
  50188. !0) : r.indexOf(i) === -1 && (r.push(i),
  50189. !0)
  50190. }
  50191. var u = new n.WebGLGeometries(e,t,i);
  50192. this.getAttributeBuffer = l,
  50193. this.getWireframeAttribute = c,
  50194. this.update = r
  50195. }
  50196. ,
  50197. n.WebGLProgram = function() {
  50198. function e(e) {
  50199. switch (e) {
  50200. case n.LinearEncoding:
  50201. return ["Linear", "( value )"];
  50202. case n.sRGBEncoding:
  50203. return ["sRGB", "( value )"];
  50204. case n.RGBEEncoding:
  50205. return ["RGBE", "( value )"];
  50206. case n.RGBM7Encoding:
  50207. return ["RGBM", "( value, 7.0 )"];
  50208. case n.RGBM16Encoding:
  50209. return ["RGBM", "( value, 16.0 )"];
  50210. case n.RGBDEncoding:
  50211. return ["RGBD", "( value, 256.0 )"];
  50212. case n.GammaEncoding:
  50213. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  50214. default:
  50215. throw new Error("unsupported encoding: " + e)
  50216. }
  50217. }
  50218. function t(t, i) {
  50219. var n = e(i);
  50220. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  50221. }
  50222. function i(t, i) {
  50223. var n = e(i);
  50224. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  50225. }
  50226. function r(e, t) {
  50227. var i;
  50228. switch (t) {
  50229. case n.LinearToneMapping:
  50230. i = "Linear";
  50231. break;
  50232. case n.ReinhardToneMapping:
  50233. i = "Reinhard";
  50234. break;
  50235. case n.Uncharted2ToneMapping:
  50236. i = "Uncharted2";
  50237. break;
  50238. case n.CineonToneMapping:
  50239. i = "OptimizedCineon";
  50240. break;
  50241. default:
  50242. throw new Error("unsupported toneMapping: " + t)
  50243. }
  50244. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50245. }
  50246. function o(e, t, i) {
  50247. e = e || {};
  50248. var n = [e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""];
  50249. return n.filter(c).join("\n")
  50250. }
  50251. function a(e) {
  50252. var t = [];
  50253. for (var i in e) {
  50254. var n = e[i];
  50255. n !== !1 && t.push("#define " + i + " " + n)
  50256. }
  50257. return t.join("\n")
  50258. }
  50259. function s(e, t, i) {
  50260. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  50261. var a = e.getActiveUniform(t, o)
  50262. , s = a.name
  50263. , l = e.getUniformLocation(t, s)
  50264. , c = f.exec(s);
  50265. if (c) {
  50266. var h = c[1]
  50267. , u = c[2]
  50268. , d = n[h];
  50269. d || (d = n[h] = {}),
  50270. d[u] = l
  50271. } else if (c = g.exec(s)) {
  50272. var p = c[1]
  50273. , v = c[2]
  50274. , A = c[3]
  50275. , y = n[p];
  50276. y || (y = n[p] = []);
  50277. var C = y[v];
  50278. C || (C = y[v] = {}),
  50279. C[A] = l
  50280. } else if (c = m.exec(s)) {
  50281. var p = c[1];
  50282. n[p] = l
  50283. } else
  50284. n[s] = l
  50285. }
  50286. return n
  50287. }
  50288. function l(e, t, i) {
  50289. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  50290. var a = e.getActiveAttrib(t, o)
  50291. , s = a.name;
  50292. n[s] = e.getAttribLocation(t, s)
  50293. }
  50294. return n
  50295. }
  50296. function c(e) {
  50297. return "" !== e
  50298. }
  50299. function h(e, t) {
  50300. 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)
  50301. }
  50302. function u(e) {
  50303. function t(e, t) {
  50304. var i = n.ShaderChunk[t];
  50305. if (void 0 === i)
  50306. throw new Error("Can not resolve #include <" + t + ">");
  50307. return u(i)
  50308. }
  50309. var i = /#include +<([\w\d.]+)>/g;
  50310. return e.replace(i, t)
  50311. }
  50312. function d(e) {
  50313. function t(e, t, i, n) {
  50314. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  50315. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  50316. return r
  50317. }
  50318. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  50319. return e.replace(i, t)
  50320. }
  50321. var p = 0
  50322. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  50323. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  50324. , m = /^([\w\d_]+)\[0\]$/;
  50325. return function(e, f, g, m) {
  50326. var v = e.context
  50327. , A = g.extensions
  50328. , y = g.defines
  50329. , C = g.__webglShader.vertexShader
  50330. , I = g.__webglShader.fragmentShader
  50331. , E = "SHADOWMAP_TYPE_BASIC";
  50332. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  50333. var b = "ENVMAP_TYPE_CUBE"
  50334. , w = "ENVMAP_MODE_REFLECTION"
  50335. , _ = "ENVMAP_BLENDING_MULTIPLY";
  50336. if (m.envMap) {
  50337. switch (g.envMap.mapping) {
  50338. case n.CubeReflectionMapping:
  50339. case n.CubeRefractionMapping:
  50340. b = "ENVMAP_TYPE_CUBE";
  50341. break;
  50342. case n.CubeUVReflectionMapping:
  50343. case n.CubeUVRefractionMapping:
  50344. b = "ENVMAP_TYPE_CUBE_UV";
  50345. break;
  50346. case n.EquirectangularReflectionMapping:
  50347. case n.EquirectangularRefractionMapping:
  50348. b = "ENVMAP_TYPE_EQUIREC";
  50349. break;
  50350. case n.SphericalReflectionMapping:
  50351. b = "ENVMAP_TYPE_SPHERE"
  50352. }
  50353. switch (g.envMap.mapping) {
  50354. case n.CubeRefractionMapping:
  50355. case n.EquirectangularRefractionMapping:
  50356. w = "ENVMAP_MODE_REFRACTION"
  50357. }
  50358. switch (g.combine) {
  50359. case n.MultiplyOperation:
  50360. _ = "ENVMAP_BLENDING_MULTIPLY";
  50361. break;
  50362. case n.MixOperation:
  50363. _ = "ENVMAP_BLENDING_MIX";
  50364. break;
  50365. case n.AddOperation:
  50366. _ = "ENVMAP_BLENDING_ADD"
  50367. }
  50368. }
  50369. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  50370. g instanceof n.RawShaderMaterial ? (T = "",
  50371. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(c).join("\n"),
  50372. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  50373. C = u(C, m),
  50374. C = h(C, m),
  50375. I = u(I, m),
  50376. I = h(I, m),
  50377. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  50378. I = d(I));
  50379. var O = T + C
  50380. , L = x + I
  50381. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  50382. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  50383. v.attachShader(P, D),
  50384. v.attachShader(P, N),
  50385. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  50386. v.linkProgram(P);
  50387. var B = v.getProgramInfoLog(P)
  50388. , F = v.getShaderInfoLog(D)
  50389. , V = v.getShaderInfoLog(N)
  50390. , U = !0
  50391. , k = !0;
  50392. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  50393. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  50394. k && (this.diagnostics = {
  50395. runnable: U,
  50396. material: g,
  50397. programLog: B,
  50398. vertexShader: {
  50399. log: F,
  50400. prefix: T
  50401. },
  50402. fragmentShader: {
  50403. log: V,
  50404. prefix: x
  50405. }
  50406. }),
  50407. v.deleteShader(D),
  50408. v.deleteShader(N);
  50409. var H;
  50410. this.getUniforms = function() {
  50411. return void 0 === H && (H = s(v, P)),
  50412. H
  50413. }
  50414. ;
  50415. var G;
  50416. return this.getAttributes = function() {
  50417. return void 0 === G && (G = l(v, P)),
  50418. G
  50419. }
  50420. ,
  50421. this.destroy = function() {
  50422. v.deleteProgram(P),
  50423. this.program = void 0
  50424. }
  50425. ,
  50426. Object.defineProperties(this, {
  50427. uniforms: {
  50428. get: function() {
  50429. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50430. this.getUniforms()
  50431. }
  50432. },
  50433. attributes: {
  50434. get: function() {
  50435. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50436. this.getAttributes()
  50437. }
  50438. }
  50439. }),
  50440. this.id = p++,
  50441. this.code = f,
  50442. this.usedTimes = 1,
  50443. this.program = P,
  50444. this.vertexShader = D,
  50445. this.fragmentShader = N,
  50446. this
  50447. }
  50448. }(),
  50449. n.WebGLPrograms = function(e, t) {
  50450. function i(e) {
  50451. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50452. return 1024;
  50453. var i = t.maxVertexUniforms
  50454. , r = Math.floor((i - 20) / 4)
  50455. , o = r;
  50456. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  50457. o < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + o + " (try OpenGL instead of ANGLE)")),
  50458. o
  50459. }
  50460. function r(e, t) {
  50461. var i;
  50462. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  50463. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  50464. i
  50465. }
  50466. var o = []
  50467. , a = {
  50468. MeshDepthMaterial: "depth",
  50469. MeshNormalMaterial: "normal",
  50470. MeshBasicMaterial: "basic",
  50471. MeshLambertMaterial: "lambert",
  50472. MeshPhongMaterial: "phong",
  50473. MeshStandardMaterial: "standard",
  50474. LineBasicMaterial: "basic",
  50475. LineDashedMaterial: "dashed",
  50476. PointsMaterial: "points"
  50477. }
  50478. , s = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  50479. this.getParameters = function(o, s, l, c) {
  50480. var h = a[o.type]
  50481. , u = i(c)
  50482. , d = e.getPrecision();
  50483. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  50484. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  50485. var p = {
  50486. shaderID: h,
  50487. precision: d,
  50488. supportsVertexTextures: t.vertexTextures,
  50489. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  50490. map: !!o.map,
  50491. mapEncoding: r(o.map, e.gammaInput),
  50492. envMap: !!o.envMap,
  50493. envMapMode: o.envMap && o.envMap.mapping,
  50494. envMapEncoding: r(o.envMap, e.gammaInput),
  50495. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  50496. lightMap: !!o.lightMap,
  50497. aoMap: !!o.aoMap,
  50498. emissiveMap: !!o.emissiveMap,
  50499. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  50500. bumpMap: !!o.bumpMap,
  50501. normalMap: !!o.normalMap,
  50502. displacementMap: !!o.displacementMap,
  50503. roughnessMap: !!o.roughnessMap,
  50504. metalnessMap: !!o.metalnessMap,
  50505. specularMap: !!o.specularMap,
  50506. alphaMap: !!o.alphaMap,
  50507. combine: o.combine,
  50508. vertexColors: o.vertexColors,
  50509. fog: l,
  50510. useFog: o.fog,
  50511. fogExp: l instanceof n.FogExp2,
  50512. flatShading: o.shading === n.FlatShading,
  50513. sizeAttenuation: o.sizeAttenuation,
  50514. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  50515. skinning: o.skinning,
  50516. maxBones: u,
  50517. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  50518. morphTargets: o.morphTargets,
  50519. morphNormals: o.morphNormals,
  50520. maxMorphTargets: e.maxMorphTargets,
  50521. maxMorphNormals: e.maxMorphNormals,
  50522. numDirLights: s.directional.length,
  50523. numPointLights: s.point.length,
  50524. numSpotLights: s.spot.length,
  50525. numHemiLights: s.hemi.length,
  50526. pointLightShadows: s.shadowsPointLight,
  50527. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  50528. shadowMapType: e.shadowMap.type,
  50529. toneMapping: e.toneMapping,
  50530. physicallyCorrectLights: e.physicallyCorrectLights,
  50531. premultipliedAlpha: o.premultipliedAlpha,
  50532. alphaTest: o.alphaTest,
  50533. doubleSided: o.side === n.DoubleSide,
  50534. flipSided: o.side === n.BackSide
  50535. };
  50536. return p
  50537. }
  50538. ,
  50539. this.getProgramCode = function(e, t) {
  50540. var i = [];
  50541. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50542. i.push(e.vertexShader)),
  50543. void 0 !== e.defines)
  50544. for (var n in e.defines)
  50545. i.push(n),
  50546. i.push(e.defines[n]);
  50547. for (var r = 0; r < s.length; r++) {
  50548. var o = s[r];
  50549. i.push(o),
  50550. i.push(t[o])
  50551. }
  50552. return i.join()
  50553. }
  50554. ,
  50555. this.acquireProgram = function(t, i, r) {
  50556. for (var a, s = 0, l = o.length; s < l; s++) {
  50557. var c = o[s];
  50558. if (c.code === r) {
  50559. a = c,
  50560. ++a.usedTimes;
  50561. break
  50562. }
  50563. }
  50564. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  50565. o.push(a)),
  50566. a
  50567. }
  50568. ,
  50569. this.releaseProgram = function(e) {
  50570. if (0 === --e.usedTimes) {
  50571. var t = o.indexOf(e);
  50572. o[t] = o[o.length - 1],
  50573. o.pop(),
  50574. e.destroy()
  50575. }
  50576. }
  50577. ,
  50578. this.programs = o
  50579. }
  50580. ,
  50581. n.WebGLProperties = function() {
  50582. var e = {};
  50583. this.get = function(t) {
  50584. var i = t.uuid
  50585. , n = e[i];
  50586. return void 0 === n && (n = {},
  50587. e[i] = n),
  50588. n
  50589. }
  50590. ,
  50591. this.delete = function(t) {
  50592. delete e[t.uuid]
  50593. }
  50594. ,
  50595. this.clear = function() {
  50596. e = {}
  50597. }
  50598. }
  50599. ,
  50600. n.WebGLShader = function() {
  50601. function e(e) {
  50602. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50603. t[i] = i + 1 + ": " + t[i];
  50604. return t.join("\n")
  50605. }
  50606. return function(t, i, n) {
  50607. var r = t.createShader(i);
  50608. return t.shaderSource(r, n),
  50609. t.compileShader(r),
  50610. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50611. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  50612. r
  50613. }
  50614. }(),
  50615. n.WebGLShadowMap = function(e, t, i) {
  50616. function r(e, t, i, r) {
  50617. var o = e.geometry
  50618. , a = null
  50619. , s = v
  50620. , l = e.customDepthMaterial;
  50621. if (i && (s = A,
  50622. l = e.customDistanceMaterial),
  50623. l)
  50624. a = l;
  50625. else {
  50626. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  50627. , h = e instanceof n.SkinnedMesh && t.skinning
  50628. , u = 0;
  50629. c && (u |= f),
  50630. h && (u |= g),
  50631. a = s[u]
  50632. }
  50633. return a.visible = t.visible,
  50634. a.wireframe = t.wireframe,
  50635. a.wireframeLinewidth = t.wireframeLinewidth,
  50636. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  50637. a
  50638. }
  50639. function o(e, t, i) {
  50640. if (e.visible !== !1) {
  50641. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  50642. var r = e.material;
  50643. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50644. p.push(e))
  50645. }
  50646. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  50647. o(a[s], t, i)
  50648. }
  50649. }
  50650. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  50651. var x = 0 !== (T & f)
  50652. , S = 0 !== (T & g)
  50653. , M = new n.ShaderMaterial({
  50654. uniforms: b,
  50655. vertexShader: E.vertexShader,
  50656. fragmentShader: E.fragmentShader,
  50657. morphTargets: x,
  50658. skinning: S
  50659. });
  50660. v[T] = M;
  50661. var R = new n.ShaderMaterial({
  50662. defines: {
  50663. USE_SHADOWMAP: ""
  50664. },
  50665. uniforms: _,
  50666. vertexShader: w.vertexShader,
  50667. fragmentShader: w.fragmentShader,
  50668. morphTargets: x,
  50669. skinning: S
  50670. });
  50671. A[T] = R
  50672. }
  50673. var P = this;
  50674. this.enabled = !1,
  50675. this.autoUpdate = !0,
  50676. this.needsUpdate = !1,
  50677. this.type = n.PCFShadowMap,
  50678. this.cullFace = n.CullFaceFront,
  50679. this.render = function(f, g) {
  50680. var m, v, A = t.shadows;
  50681. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  50682. s.clearColor(1, 1, 1, 1),
  50683. s.disable(a.BLEND),
  50684. s.enable(a.CULL_FACE),
  50685. a.frontFace(a.CCW),
  50686. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  50687. s.setDepthTest(!0),
  50688. s.setScissorTest(!1);
  50689. for (var E = 0, b = A.length; E < b; E++) {
  50690. var w = A[E]
  50691. , _ = w.shadow
  50692. , T = _.camera;
  50693. if (h.copy(_.mapSize),
  50694. w instanceof n.PointLight) {
  50695. m = 6,
  50696. v = !0;
  50697. var x = h.x
  50698. , S = h.y;
  50699. I[0].set(2 * x, S, x, S),
  50700. I[1].set(0, S, x, S),
  50701. I[2].set(3 * x, S, x, S),
  50702. I[3].set(x, S, x, S),
  50703. I[4].set(3 * x, 0, x, S),
  50704. I[5].set(x, 0, x, S),
  50705. h.x *= 4,
  50706. h.y *= 2
  50707. } else
  50708. m = 1,
  50709. v = !1;
  50710. if (null === _.map) {
  50711. var M = {
  50712. minFilter: n.NearestFilter,
  50713. magFilter: n.NearestFilter,
  50714. format: n.RGBAFormat
  50715. };
  50716. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  50717. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  50718. T.updateProjectionMatrix()
  50719. }
  50720. var R = _.map
  50721. , O = _.matrix;
  50722. d.setFromMatrixPosition(w.matrixWorld),
  50723. T.position.copy(d),
  50724. e.setRenderTarget(R),
  50725. e.clear();
  50726. for (var L = 0; L < m; L++) {
  50727. if (v) {
  50728. u.copy(T.position),
  50729. u.add(y[L]),
  50730. T.up.copy(C[L]),
  50731. T.lookAt(u);
  50732. var D = I[L];
  50733. s.viewport(D)
  50734. } else
  50735. u.setFromMatrixPosition(w.target.matrixWorld),
  50736. T.lookAt(u);
  50737. T.updateMatrixWorld(),
  50738. T.matrixWorldInverse.getInverse(T.matrixWorld),
  50739. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50740. O.multiply(T.projectionMatrix),
  50741. O.multiply(T.matrixWorldInverse),
  50742. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  50743. l.setFromMatrix(c),
  50744. p.length = 0,
  50745. o(f, g, T);
  50746. for (var N = 0, B = p.length; N < B; N++) {
  50747. var F = p[N]
  50748. , V = i.update(F)
  50749. , U = F.material;
  50750. if (U instanceof n.MultiMaterial)
  50751. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  50752. var W = k[G]
  50753. , j = H[W.materialIndex];
  50754. if (j.visible === !0) {
  50755. var Y = r(F, j, v, d);
  50756. e.renderBufferDirect(T, null, V, Y, F, W)
  50757. }
  50758. }
  50759. else {
  50760. var Y = r(F, U, v, d);
  50761. e.renderBufferDirect(T, null, V, Y, F, null)
  50762. }
  50763. }
  50764. }
  50765. }
  50766. var X = e.getClearColor()
  50767. , Z = e.getClearAlpha();
  50768. e.setClearColor(X, Z),
  50769. s.enable(a.BLEND),
  50770. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  50771. P.needsUpdate = !1
  50772. }
  50773. }
  50774. }
  50775. ,
  50776. n.WebGLState = function(e, t, i) {
  50777. var r = this
  50778. , o = new n.Vector4
  50779. , a = new Uint8Array(16)
  50780. , s = new Uint8Array(16)
  50781. , l = new Uint8Array(16)
  50782. , c = {}
  50783. , h = null
  50784. , u = null
  50785. , d = null
  50786. , p = null
  50787. , f = null
  50788. , g = null
  50789. , m = null
  50790. , v = null
  50791. , A = !1
  50792. , y = null
  50793. , C = null
  50794. , I = null
  50795. , E = null
  50796. , b = null
  50797. , w = null
  50798. , _ = null
  50799. , T = null
  50800. , x = null
  50801. , S = null
  50802. , M = null
  50803. , R = null
  50804. , P = null
  50805. , O = null
  50806. , L = null
  50807. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  50808. , N = void 0
  50809. , B = {}
  50810. , F = new n.Vector4
  50811. , V = null
  50812. , U = null
  50813. , k = new n.Vector4
  50814. , H = new n.Vector4
  50815. , G = e.createTexture();
  50816. e.bindTexture(e.TEXTURE_2D, G),
  50817. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  50818. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  50819. this.init = function() {
  50820. this.clearColor(0, 0, 0, 1),
  50821. this.clearDepth(1),
  50822. this.clearStencil(0),
  50823. this.enable(e.DEPTH_TEST),
  50824. e.depthFunc(e.LEQUAL),
  50825. e.frontFace(e.CCW),
  50826. e.cullFace(e.BACK),
  50827. this.enable(e.CULL_FACE),
  50828. this.enable(e.BLEND),
  50829. e.blendEquation(e.FUNC_ADD),
  50830. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  50831. }
  50832. ,
  50833. this.initAttributes = function() {
  50834. for (var e = 0, t = a.length; e < t; e++)
  50835. a[e] = 0
  50836. }
  50837. ,
  50838. this.enableAttribute = function(i) {
  50839. if (a[i] = 1,
  50840. 0 === s[i] && (e.enableVertexAttribArray(i),
  50841. s[i] = 1),
  50842. 0 !== l[i]) {
  50843. var n = t.get("ANGLE_instanced_arrays");
  50844. n.vertexAttribDivisorANGLE(i, 0),
  50845. l[i] = 0
  50846. }
  50847. }
  50848. ,
  50849. this.enableAttributeAndDivisor = function(t, i, n) {
  50850. a[t] = 1,
  50851. 0 === s[t] && (e.enableVertexAttribArray(t),
  50852. s[t] = 1),
  50853. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  50854. l[t] = i)
  50855. }
  50856. ,
  50857. this.disableUnusedAttributes = function() {
  50858. for (var t = 0, i = s.length; t < i; t++)
  50859. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  50860. s[t] = 0)
  50861. }
  50862. ,
  50863. this.enable = function(t) {
  50864. c[t] !== !0 && (e.enable(t),
  50865. c[t] = !0)
  50866. }
  50867. ,
  50868. this.disable = function(t) {
  50869. c[t] !== !1 && (e.disable(t),
  50870. c[t] = !1)
  50871. }
  50872. ,
  50873. this.getCompressedTextureFormats = function() {
  50874. if (null === h && (h = [],
  50875. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  50876. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  50877. h.push(i[n]);
  50878. return h
  50879. }
  50880. ,
  50881. this.setBlending = function(t, r, o, a, s, l, c, h) {
  50882. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  50883. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  50884. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  50885. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  50886. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  50887. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  50888. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  50889. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  50890. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  50891. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  50892. u = t,
  50893. A = h),
  50894. t === n.CustomBlending ? (s = s || r,
  50895. l = l || o,
  50896. c = c || a,
  50897. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  50898. d = r,
  50899. g = s),
  50900. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  50901. p = o,
  50902. f = a,
  50903. m = l,
  50904. v = c)) : (d = null,
  50905. p = null,
  50906. f = null,
  50907. g = null,
  50908. m = null,
  50909. v = null)
  50910. }
  50911. ,
  50912. this.setDepthFunc = function(t) {
  50913. if (y !== t) {
  50914. if (t)
  50915. switch (t) {
  50916. case n.NeverDepth:
  50917. e.depthFunc(e.NEVER);
  50918. break;
  50919. case n.AlwaysDepth:
  50920. e.depthFunc(e.ALWAYS);
  50921. break;
  50922. case n.LessDepth:
  50923. e.depthFunc(e.LESS);
  50924. break;
  50925. case n.LessEqualDepth:
  50926. e.depthFunc(e.LEQUAL);
  50927. break;
  50928. case n.EqualDepth:
  50929. e.depthFunc(e.EQUAL);
  50930. break;
  50931. case n.GreaterEqualDepth:
  50932. e.depthFunc(e.GEQUAL);
  50933. break;
  50934. case n.GreaterDepth:
  50935. e.depthFunc(e.GREATER);
  50936. break;
  50937. case n.NotEqualDepth:
  50938. e.depthFunc(e.NOTEQUAL);
  50939. break;
  50940. default:
  50941. e.depthFunc(e.LEQUAL)
  50942. }
  50943. else
  50944. e.depthFunc(e.LEQUAL);
  50945. y = t
  50946. }
  50947. }
  50948. ,
  50949. this.setDepthTest = function(t) {
  50950. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  50951. }
  50952. ,
  50953. this.setDepthWrite = function(t) {
  50954. C !== t && (e.depthMask(t),
  50955. C = t)
  50956. }
  50957. ,
  50958. this.setColorWrite = function(t) {
  50959. I !== t && (e.colorMask(t, t, t, t),
  50960. I = t)
  50961. }
  50962. ,
  50963. this.setStencilFunc = function(t, i, n) {
  50964. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  50965. b = t,
  50966. w = i,
  50967. _ = n)
  50968. }
  50969. ,
  50970. this.setStencilOp = function(t, i, n) {
  50971. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  50972. T = t,
  50973. x = i,
  50974. S = n)
  50975. }
  50976. ,
  50977. this.setStencilTest = function(t) {
  50978. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  50979. }
  50980. ,
  50981. this.setStencilWrite = function(t) {
  50982. E !== t && (e.stencilMask(t),
  50983. E = t)
  50984. }
  50985. ,
  50986. this.setFlipSided = function(t) {
  50987. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  50988. M = t)
  50989. }
  50990. ,
  50991. this.setLineWidth = function(t) {
  50992. t !== R && (e.lineWidth(t),
  50993. R = t)
  50994. }
  50995. ,
  50996. this.setPolygonOffset = function(t, i, n) {
  50997. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  50998. !t || P === i && O === n || (e.polygonOffset(i, n),
  50999. P = i,
  51000. O = n)
  51001. }
  51002. ,
  51003. this.getScissorTest = function() {
  51004. return L
  51005. }
  51006. ,
  51007. this.setScissorTest = function(t) {
  51008. L = t,
  51009. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  51010. }
  51011. ,
  51012. this.activeTexture = function(t) {
  51013. void 0 === t && (t = e.TEXTURE0 + D - 1),
  51014. N !== t && (e.activeTexture(t),
  51015. N = t)
  51016. }
  51017. ,
  51018. this.bindTexture = function(t, i) {
  51019. void 0 === N && r.activeTexture();
  51020. var n = B[N];
  51021. void 0 === n && (n = {
  51022. type: void 0,
  51023. texture: void 0
  51024. },
  51025. B[N] = n),
  51026. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  51027. n.type = t,
  51028. n.texture = i)
  51029. }
  51030. ,
  51031. this.compressedTexImage2D = function() {
  51032. try {
  51033. e.compressedTexImage2D.apply(e, arguments)
  51034. } catch (e) {
  51035. console.error(e)
  51036. }
  51037. }
  51038. ,
  51039. this.texImage2D = function() {
  51040. try {
  51041. e.texImage2D.apply(e, arguments)
  51042. } catch (e) {
  51043. console.error(e)
  51044. }
  51045. }
  51046. ,
  51047. this.clearColor = function(t, i, n, r) {
  51048. o.set(t, i, n, r),
  51049. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  51050. F.copy(o))
  51051. }
  51052. ,
  51053. this.clearDepth = function(t) {
  51054. V !== t && (e.clearDepth(t),
  51055. V = t)
  51056. }
  51057. ,
  51058. this.clearStencil = function(t) {
  51059. U !== t && (e.clearStencil(t),
  51060. U = t)
  51061. }
  51062. ,
  51063. this.scissor = function(t) {
  51064. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  51065. k.copy(t))
  51066. }
  51067. ,
  51068. this.viewport = function(t) {
  51069. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  51070. H.copy(t))
  51071. }
  51072. ,
  51073. this.reset = function() {
  51074. for (var t = 0; t < s.length; t++)
  51075. 1 === s[t] && (e.disableVertexAttribArray(t),
  51076. s[t] = 0);
  51077. c = {},
  51078. h = null,
  51079. N = void 0,
  51080. B = {},
  51081. u = null,
  51082. I = null,
  51083. C = null,
  51084. E = null,
  51085. M = null
  51086. }
  51087. }
  51088. ,
  51089. n.LensFlarePlugin = function(e, t) {
  51090. function i() {
  51091. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  51092. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51093. o = p.createBuffer(),
  51094. a = p.createBuffer(),
  51095. p.bindBuffer(p.ARRAY_BUFFER, o),
  51096. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  51097. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51098. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  51099. u = p.createTexture(),
  51100. d = p.createTexture(),
  51101. f.bindTexture(p.TEXTURE_2D, u),
  51102. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  51103. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51104. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51105. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51106. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51107. f.bindTexture(p.TEXTURE_2D, d),
  51108. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  51109. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51110. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51111. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51112. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51113. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  51114. var i;
  51115. i = h ? {
  51116. 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"),
  51117. 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")
  51118. } : {
  51119. 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"),
  51120. 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")
  51121. },
  51122. s = r(i),
  51123. l = {
  51124. vertex: p.getAttribLocation(s, "position"),
  51125. uv: p.getAttribLocation(s, "uv")
  51126. },
  51127. c = {
  51128. renderType: p.getUniformLocation(s, "renderType"),
  51129. map: p.getUniformLocation(s, "map"),
  51130. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  51131. opacity: p.getUniformLocation(s, "opacity"),
  51132. color: p.getUniformLocation(s, "color"),
  51133. scale: p.getUniformLocation(s, "scale"),
  51134. rotation: p.getUniformLocation(s, "rotation"),
  51135. screenPosition: p.getUniformLocation(s, "screenPosition")
  51136. }
  51137. }
  51138. function r(t) {
  51139. var i = p.createProgram()
  51140. , n = p.createShader(p.FRAGMENT_SHADER)
  51141. , r = p.createShader(p.VERTEX_SHADER)
  51142. , o = "precision " + e.getPrecision() + " float;\n";
  51143. return p.shaderSource(n, o + t.fragmentShader),
  51144. p.shaderSource(r, o + t.vertexShader),
  51145. p.compileShader(n),
  51146. p.compileShader(r),
  51147. p.attachShader(i, n),
  51148. p.attachShader(i, r),
  51149. p.linkProgram(i),
  51150. i
  51151. }
  51152. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  51153. this.render = function(r, g, m) {
  51154. if (0 !== t.length) {
  51155. var v = new n.Vector3
  51156. , A = m.w / m.z
  51157. , y = .5 * m.z
  51158. , C = .5 * m.w
  51159. , I = 16 / m.w
  51160. , E = new n.Vector2(I * A,I)
  51161. , b = new n.Vector3(1,1,0)
  51162. , w = new n.Vector2(1,1);
  51163. void 0 === s && i(),
  51164. p.useProgram(s),
  51165. f.initAttributes(),
  51166. f.enableAttribute(l.vertex),
  51167. f.enableAttribute(l.uv),
  51168. f.disableUnusedAttributes(),
  51169. p.uniform1i(c.occlusionMap, 0),
  51170. p.uniform1i(c.map, 1),
  51171. p.bindBuffer(p.ARRAY_BUFFER, o),
  51172. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  51173. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  51174. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51175. f.disable(p.CULL_FACE),
  51176. f.setDepthWrite(!1);
  51177. for (var _ = 0, T = t.length; _ < T; _++) {
  51178. I = 16 / m.w,
  51179. E.set(I * A, I);
  51180. var x = t[_];
  51181. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  51182. v.applyMatrix4(g.matrixWorldInverse),
  51183. v.applyProjection(g.projectionMatrix),
  51184. b.copy(v),
  51185. w.x = b.x * y + y,
  51186. w.y = b.y * C + C,
  51187. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  51188. f.activeTexture(p.TEXTURE0),
  51189. f.bindTexture(p.TEXTURE_2D, null),
  51190. f.activeTexture(p.TEXTURE1),
  51191. f.bindTexture(p.TEXTURE_2D, u),
  51192. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51193. p.uniform1i(c.renderType, 0),
  51194. p.uniform2f(c.scale, E.x, E.y),
  51195. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51196. f.disable(p.BLEND),
  51197. f.enable(p.DEPTH_TEST),
  51198. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51199. f.activeTexture(p.TEXTURE0),
  51200. f.bindTexture(p.TEXTURE_2D, d),
  51201. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51202. p.uniform1i(c.renderType, 1),
  51203. f.disable(p.DEPTH_TEST),
  51204. f.activeTexture(p.TEXTURE1),
  51205. f.bindTexture(p.TEXTURE_2D, u),
  51206. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51207. x.positionScreen.copy(b),
  51208. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  51209. p.uniform1i(c.renderType, 2),
  51210. f.enable(p.BLEND);
  51211. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  51212. var R = x.lensFlares[S];
  51213. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  51214. b.y = R.y,
  51215. b.z = R.z,
  51216. I = R.size * R.scale / m.w,
  51217. E.x = I * A,
  51218. E.y = I,
  51219. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51220. p.uniform2f(c.scale, E.x, E.y),
  51221. p.uniform1f(c.rotation, R.rotation),
  51222. p.uniform1f(c.opacity, R.opacity),
  51223. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  51224. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  51225. e.setTexture(R.texture, 1),
  51226. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  51227. }
  51228. }
  51229. }
  51230. f.enable(p.CULL_FACE),
  51231. f.enable(p.DEPTH_TEST),
  51232. f.setDepthWrite(!0),
  51233. e.resetGLState()
  51234. }
  51235. }
  51236. }
  51237. ,
  51238. n.SpritePlugin = function(e, t) {
  51239. function i() {
  51240. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51241. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51242. a = d.createBuffer(),
  51243. s = d.createBuffer(),
  51244. d.bindBuffer(d.ARRAY_BUFFER, a),
  51245. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  51246. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51247. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  51248. l = r(),
  51249. c = {
  51250. position: d.getAttribLocation(l, "position"),
  51251. uv: d.getAttribLocation(l, "uv")
  51252. },
  51253. h = {
  51254. uvOffset: d.getUniformLocation(l, "uvOffset"),
  51255. uvScale: d.getUniformLocation(l, "uvScale"),
  51256. rotation: d.getUniformLocation(l, "rotation"),
  51257. scale: d.getUniformLocation(l, "scale"),
  51258. color: d.getUniformLocation(l, "color"),
  51259. map: d.getUniformLocation(l, "map"),
  51260. opacity: d.getUniformLocation(l, "opacity"),
  51261. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  51262. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  51263. fogType: d.getUniformLocation(l, "fogType"),
  51264. fogDensity: d.getUniformLocation(l, "fogDensity"),
  51265. fogNear: d.getUniformLocation(l, "fogNear"),
  51266. fogFar: d.getUniformLocation(l, "fogFar"),
  51267. fogColor: d.getUniformLocation(l, "fogColor"),
  51268. alphaTest: d.getUniformLocation(l, "alphaTest")
  51269. };
  51270. var i = document.createElement("canvas");
  51271. i.width = 8,
  51272. i.height = 8;
  51273. var o = i.getContext("2d");
  51274. o.fillStyle = "white",
  51275. o.fillRect(0, 0, 8, 8),
  51276. u = new n.Texture(i),
  51277. u.needsUpdate = !0
  51278. }
  51279. function r() {
  51280. var t = d.createProgram()
  51281. , i = d.createShader(d.VERTEX_SHADER)
  51282. , n = d.createShader(d.FRAGMENT_SHADER);
  51283. return d.shaderSource(i, ["precision " + e.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  51284. d.shaderSource(n, ["precision " + e.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  51285. d.compileShader(i),
  51286. d.compileShader(n),
  51287. d.attachShader(t, i),
  51288. d.attachShader(t, n),
  51289. d.linkProgram(t),
  51290. t
  51291. }
  51292. function o(e, t) {
  51293. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51294. }
  51295. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  51296. this.render = function(r, v) {
  51297. if (0 !== t.length) {
  51298. void 0 === l && i(),
  51299. d.useProgram(l),
  51300. p.initAttributes(),
  51301. p.enableAttribute(c.position),
  51302. p.enableAttribute(c.uv),
  51303. p.disableUnusedAttributes(),
  51304. p.disable(d.CULL_FACE),
  51305. p.enable(d.BLEND),
  51306. d.bindBuffer(d.ARRAY_BUFFER, a),
  51307. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  51308. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  51309. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51310. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  51311. p.activeTexture(d.TEXTURE0),
  51312. d.uniform1i(h.map, 0);
  51313. var A = 0
  51314. , y = 0
  51315. , C = r.fog;
  51316. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  51317. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  51318. d.uniform1f(h.fogFar, C.far),
  51319. d.uniform1i(h.fogType, 1),
  51320. A = 1,
  51321. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  51322. d.uniform1i(h.fogType, 2),
  51323. A = 2,
  51324. y = 2)) : (d.uniform1i(h.fogType, 0),
  51325. A = 0,
  51326. y = 0);
  51327. for (var I = 0, E = t.length; I < E; I++) {
  51328. var b = t[I];
  51329. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  51330. b.z = -b.modelViewMatrix.elements[14]
  51331. }
  51332. t.sort(o);
  51333. for (var w = [], I = 0, E = t.length; I < E; I++) {
  51334. var b = t[I]
  51335. , _ = b.material;
  51336. d.uniform1f(h.alphaTest, _.alphaTest),
  51337. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  51338. b.matrixWorld.decompose(f, g, m),
  51339. w[0] = m.x,
  51340. w[1] = m.y;
  51341. var T = 0;
  51342. r.fog && _.fog && (T = y),
  51343. A !== T && (d.uniform1i(h.fogType, T),
  51344. A = T),
  51345. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  51346. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  51347. d.uniform2f(h.uvScale, 1, 1)),
  51348. d.uniform1f(h.opacity, _.opacity),
  51349. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  51350. d.uniform1f(h.rotation, _.rotation),
  51351. d.uniform2fv(h.scale, w),
  51352. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  51353. p.setDepthTest(_.depthTest),
  51354. p.setDepthWrite(_.depthWrite),
  51355. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  51356. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  51357. }
  51358. p.enable(d.CULL_FACE),
  51359. e.resetGLState()
  51360. }
  51361. }
  51362. }
  51363. ,
  51364. Object.defineProperties(n.Box2.prototype, {
  51365. empty: {
  51366. value: function() {
  51367. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51368. this.isEmpty()
  51369. }
  51370. },
  51371. isIntersectionBox: {
  51372. value: function(e) {
  51373. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51374. this.intersectsBox(e)
  51375. }
  51376. }
  51377. }),
  51378. Object.defineProperties(n.Box3.prototype, {
  51379. empty: {
  51380. value: function() {
  51381. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51382. this.isEmpty()
  51383. }
  51384. },
  51385. isIntersectionBox: {
  51386. value: function(e) {
  51387. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51388. this.intersectsBox(e)
  51389. }
  51390. },
  51391. isIntersectionSphere: {
  51392. value: function(e) {
  51393. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51394. this.intersectsSphere(e)
  51395. }
  51396. }
  51397. }),
  51398. Object.defineProperties(n.Matrix3.prototype, {
  51399. multiplyVector3: {
  51400. value: function(e) {
  51401. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51402. e.applyMatrix3(this)
  51403. }
  51404. },
  51405. multiplyVector3Array: {
  51406. value: function(e) {
  51407. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51408. this.applyToVector3Array(e)
  51409. }
  51410. }
  51411. }),
  51412. Object.defineProperties(n.Matrix4.prototype, {
  51413. extractPosition: {
  51414. value: function(e) {
  51415. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51416. this.copyPosition(e)
  51417. }
  51418. },
  51419. setRotationFromQuaternion: {
  51420. value: function(e) {
  51421. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51422. this.makeRotationFromQuaternion(e)
  51423. }
  51424. },
  51425. multiplyVector3: {
  51426. value: function(e) {
  51427. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51428. e.applyProjection(this)
  51429. }
  51430. },
  51431. multiplyVector4: {
  51432. value: function(e) {
  51433. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51434. e.applyMatrix4(this)
  51435. }
  51436. },
  51437. multiplyVector3Array: {
  51438. value: function(e) {
  51439. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51440. this.applyToVector3Array(e)
  51441. }
  51442. },
  51443. rotateAxis: {
  51444. value: function(e) {
  51445. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51446. e.transformDirection(this)
  51447. }
  51448. },
  51449. crossVector: {
  51450. value: function(e) {
  51451. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51452. e.applyMatrix4(this)
  51453. }
  51454. },
  51455. translate: {
  51456. value: function(e) {
  51457. console.error("THREE.Matrix4: .translate() has been removed.")
  51458. }
  51459. },
  51460. rotateX: {
  51461. value: function(e) {
  51462. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51463. }
  51464. },
  51465. rotateY: {
  51466. value: function(e) {
  51467. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51468. }
  51469. },
  51470. rotateZ: {
  51471. value: function(e) {
  51472. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51473. }
  51474. },
  51475. rotateByAxis: {
  51476. value: function(e, t) {
  51477. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51478. }
  51479. }
  51480. }),
  51481. Object.defineProperties(n.Plane.prototype, {
  51482. isIntersectionLine: {
  51483. value: function(e) {
  51484. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51485. this.intersectsLine(e)
  51486. }
  51487. }
  51488. }),
  51489. Object.defineProperties(n.Quaternion.prototype, {
  51490. multiplyVector3: {
  51491. value: function(e) {
  51492. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51493. e.applyQuaternion(this)
  51494. }
  51495. }
  51496. }),
  51497. Object.defineProperties(n.Ray.prototype, {
  51498. isIntersectionBox: {
  51499. value: function(e) {
  51500. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51501. this.intersectsBox(e)
  51502. }
  51503. },
  51504. isIntersectionPlane: {
  51505. value: function(e) {
  51506. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51507. this.intersectsPlane(e)
  51508. }
  51509. },
  51510. isIntersectionSphere: {
  51511. value: function(e) {
  51512. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51513. this.intersectsSphere(e)
  51514. }
  51515. }
  51516. }),
  51517. Object.defineProperties(n.Vector3.prototype, {
  51518. setEulerFromRotationMatrix: {
  51519. value: function() {
  51520. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51521. }
  51522. },
  51523. setEulerFromQuaternion: {
  51524. value: function() {
  51525. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51526. }
  51527. },
  51528. getPositionFromMatrix: {
  51529. value: function(e) {
  51530. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51531. this.setFromMatrixPosition(e)
  51532. }
  51533. },
  51534. getScaleFromMatrix: {
  51535. value: function(e) {
  51536. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51537. this.setFromMatrixScale(e)
  51538. }
  51539. },
  51540. getColumnFromMatrix: {
  51541. value: function(e, t) {
  51542. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51543. this.setFromMatrixColumn(e, t)
  51544. }
  51545. }
  51546. }),
  51547. n.Face4 = function(e, t, i, r, o, a, s) {
  51548. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51549. new n.Face3(e,t,i,o,a,s)
  51550. }
  51551. ,
  51552. n.Vertex = function(e, t, i) {
  51553. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51554. new n.Vector3(e,t,i)
  51555. }
  51556. ,
  51557. Object.defineProperties(n.Object3D.prototype, {
  51558. eulerOrder: {
  51559. get: function() {
  51560. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51561. this.rotation.order
  51562. },
  51563. set: function(e) {
  51564. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51565. this.rotation.order = e
  51566. }
  51567. },
  51568. getChildByName: {
  51569. value: function(e) {
  51570. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51571. this.getObjectByName(e)
  51572. }
  51573. },
  51574. renderDepth: {
  51575. set: function(e) {
  51576. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51577. }
  51578. },
  51579. translate: {
  51580. value: function(e, t) {
  51581. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51582. this.translateOnAxis(t, e)
  51583. }
  51584. },
  51585. useQuaternion: {
  51586. get: function() {
  51587. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51588. },
  51589. set: function(e) {
  51590. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51591. }
  51592. }
  51593. }),
  51594. Object.defineProperties(n, {
  51595. PointCloud: {
  51596. value: function(e, t) {
  51597. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51598. new n.Points(e,t)
  51599. }
  51600. },
  51601. ParticleSystem: {
  51602. value: function(e, t) {
  51603. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51604. new n.Points(e,t)
  51605. }
  51606. }
  51607. }),
  51608. Object.defineProperties(n.Light.prototype, {
  51609. onlyShadow: {
  51610. set: function(e) {
  51611. console.warn("THREE.Light: .onlyShadow has been removed.")
  51612. }
  51613. },
  51614. shadowCameraFov: {
  51615. set: function(e) {
  51616. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51617. this.shadow.camera.fov = e
  51618. }
  51619. },
  51620. shadowCameraLeft: {
  51621. set: function(e) {
  51622. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51623. this.shadow.camera.left = e
  51624. }
  51625. },
  51626. shadowCameraRight: {
  51627. set: function(e) {
  51628. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51629. this.shadow.camera.right = e
  51630. }
  51631. },
  51632. shadowCameraTop: {
  51633. set: function(e) {
  51634. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51635. this.shadow.camera.top = e
  51636. }
  51637. },
  51638. shadowCameraBottom: {
  51639. set: function(e) {
  51640. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51641. this.shadow.camera.bottom = e
  51642. }
  51643. },
  51644. shadowCameraNear: {
  51645. set: function(e) {
  51646. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51647. this.shadow.camera.near = e
  51648. }
  51649. },
  51650. shadowCameraFar: {
  51651. set: function(e) {
  51652. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51653. this.shadow.camera.far = e
  51654. }
  51655. },
  51656. shadowCameraVisible: {
  51657. set: function(e) {
  51658. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51659. }
  51660. },
  51661. shadowBias: {
  51662. set: function(e) {
  51663. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51664. this.shadow.bias = e
  51665. }
  51666. },
  51667. shadowDarkness: {
  51668. set: function(e) {
  51669. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51670. }
  51671. },
  51672. shadowMapWidth: {
  51673. set: function(e) {
  51674. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51675. this.shadow.mapSize.width = e
  51676. }
  51677. },
  51678. shadowMapHeight: {
  51679. set: function(e) {
  51680. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51681. this.shadow.mapSize.height = e
  51682. }
  51683. }
  51684. }),
  51685. Object.defineProperties(n.BufferAttribute.prototype, {
  51686. length: {
  51687. get: function() {
  51688. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51689. this.array.length
  51690. }
  51691. }
  51692. }),
  51693. Object.defineProperties(n.BufferGeometry.prototype, {
  51694. drawcalls: {
  51695. get: function() {
  51696. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51697. this.groups
  51698. }
  51699. },
  51700. offsets: {
  51701. get: function() {
  51702. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51703. this.groups
  51704. }
  51705. },
  51706. addIndex: {
  51707. value: function(e) {
  51708. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51709. this.setIndex(e)
  51710. }
  51711. },
  51712. addDrawCall: {
  51713. value: function(e, t, i) {
  51714. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51715. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51716. this.addGroup(e, t)
  51717. }
  51718. },
  51719. clearDrawCalls: {
  51720. value: function() {
  51721. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51722. this.clearGroups()
  51723. }
  51724. },
  51725. computeTangents: {
  51726. value: function() {
  51727. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51728. }
  51729. },
  51730. computeOffsets: {
  51731. value: function() {
  51732. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51733. }
  51734. }
  51735. }),
  51736. Object.defineProperties(n.Material.prototype, {
  51737. wrapAround: {
  51738. get: function() {
  51739. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51740. },
  51741. set: function(e) {
  51742. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51743. }
  51744. },
  51745. wrapRGB: {
  51746. get: function() {
  51747. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51748. new n.Color
  51749. }
  51750. }
  51751. }),
  51752. Object.defineProperties(n, {
  51753. PointCloudMaterial: {
  51754. value: function(e) {
  51755. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51756. new n.PointsMaterial(e)
  51757. }
  51758. },
  51759. ParticleBasicMaterial: {
  51760. value: function(e) {
  51761. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51762. new n.PointsMaterial(e)
  51763. }
  51764. },
  51765. ParticleSystemMaterial: {
  51766. value: function(e) {
  51767. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51768. new n.PointsMaterial(e)
  51769. }
  51770. }
  51771. }),
  51772. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  51773. metal: {
  51774. get: function() {
  51775. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51776. !1
  51777. },
  51778. set: function(e) {
  51779. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51780. }
  51781. }
  51782. }),
  51783. Object.defineProperties(n.ShaderMaterial.prototype, {
  51784. derivatives: {
  51785. get: function() {
  51786. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51787. this.extensions.derivatives
  51788. },
  51789. set: function(e) {
  51790. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51791. this.extensions.derivatives = e
  51792. }
  51793. }
  51794. }),
  51795. Object.defineProperties(n.WebGLRenderer.prototype, {
  51796. supportsFloatTextures: {
  51797. value: function() {
  51798. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51799. this.extensions.get("OES_texture_float")
  51800. }
  51801. },
  51802. supportsHalfFloatTextures: {
  51803. value: function() {
  51804. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51805. this.extensions.get("OES_texture_half_float")
  51806. }
  51807. },
  51808. supportsStandardDerivatives: {
  51809. value: function() {
  51810. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51811. this.extensions.get("OES_standard_derivatives")
  51812. }
  51813. },
  51814. supportsCompressedTextureS3TC: {
  51815. value: function() {
  51816. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51817. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51818. }
  51819. },
  51820. supportsCompressedTexturePVRTC: {
  51821. value: function() {
  51822. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51823. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51824. }
  51825. },
  51826. supportsBlendMinMax: {
  51827. value: function() {
  51828. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51829. this.extensions.get("EXT_blend_minmax")
  51830. }
  51831. },
  51832. supportsVertexTextures: {
  51833. value: function() {
  51834. return this.capabilities.vertexTextures
  51835. }
  51836. },
  51837. supportsInstancedArrays: {
  51838. value: function() {
  51839. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51840. this.extensions.get("ANGLE_instanced_arrays")
  51841. }
  51842. },
  51843. enableScissorTest: {
  51844. value: function(e) {
  51845. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51846. this.setScissorTest(e)
  51847. }
  51848. },
  51849. initMaterial: {
  51850. value: function() {
  51851. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51852. }
  51853. },
  51854. addPrePlugin: {
  51855. value: function() {
  51856. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51857. }
  51858. },
  51859. addPostPlugin: {
  51860. value: function() {
  51861. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51862. }
  51863. },
  51864. updateShadowMap: {
  51865. value: function() {
  51866. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51867. }
  51868. },
  51869. shadowMapEnabled: {
  51870. get: function() {
  51871. return this.shadowMap.enabled
  51872. },
  51873. set: function(e) {
  51874. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51875. this.shadowMap.enabled = e
  51876. }
  51877. },
  51878. shadowMapType: {
  51879. get: function() {
  51880. return this.shadowMap.type
  51881. },
  51882. set: function(e) {
  51883. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51884. this.shadowMap.type = e
  51885. }
  51886. },
  51887. shadowMapCullFace: {
  51888. get: function() {
  51889. return this.shadowMap.cullFace
  51890. },
  51891. set: function(e) {
  51892. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51893. this.shadowMap.cullFace = e
  51894. }
  51895. }
  51896. }),
  51897. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  51898. wrapS: {
  51899. get: function() {
  51900. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51901. this.texture.wrapS
  51902. },
  51903. set: function(e) {
  51904. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51905. this.texture.wrapS = e
  51906. }
  51907. },
  51908. wrapT: {
  51909. get: function() {
  51910. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51911. this.texture.wrapT
  51912. },
  51913. set: function(e) {
  51914. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51915. this.texture.wrapT = e
  51916. }
  51917. },
  51918. magFilter: {
  51919. get: function() {
  51920. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51921. this.texture.magFilter
  51922. },
  51923. set: function(e) {
  51924. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51925. this.texture.magFilter = e
  51926. }
  51927. },
  51928. minFilter: {
  51929. get: function() {
  51930. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51931. this.texture.minFilter
  51932. },
  51933. set: function(e) {
  51934. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51935. this.texture.minFilter = e
  51936. }
  51937. },
  51938. anisotropy: {
  51939. get: function() {
  51940. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51941. this.texture.anisotropy
  51942. },
  51943. set: function(e) {
  51944. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51945. this.texture.anisotropy = e
  51946. }
  51947. },
  51948. offset: {
  51949. get: function() {
  51950. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51951. this.texture.offset
  51952. },
  51953. set: function(e) {
  51954. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51955. this.texture.offset = e
  51956. }
  51957. },
  51958. repeat: {
  51959. get: function() {
  51960. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51961. this.texture.repeat
  51962. },
  51963. set: function(e) {
  51964. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51965. this.texture.repeat = e
  51966. }
  51967. },
  51968. format: {
  51969. get: function() {
  51970. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51971. this.texture.format
  51972. },
  51973. set: function(e) {
  51974. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51975. this.texture.format = e
  51976. }
  51977. },
  51978. type: {
  51979. get: function() {
  51980. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51981. this.texture.type
  51982. },
  51983. set: function(e) {
  51984. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51985. this.texture.type = e
  51986. }
  51987. },
  51988. generateMipmaps: {
  51989. get: function() {
  51990. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51991. this.texture.generateMipmaps
  51992. },
  51993. set: function(e) {
  51994. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51995. this.texture.generateMipmaps = e
  51996. }
  51997. }
  51998. }),
  51999. n.GeometryUtils = {
  52000. merge: function(e, t, i) {
  52001. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  52002. var r;
  52003. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52004. r = t.matrix,
  52005. t = t.geometry),
  52006. e.merge(t, r, i)
  52007. },
  52008. center: function(e) {
  52009. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52010. e.center()
  52011. }
  52012. },
  52013. n.ImageUtils = {
  52014. crossOrigin: void 0,
  52015. loadTexture: function(e, t, i, r) {
  52016. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52017. var o = new n.TextureLoader;
  52018. o.setCrossOrigin(this.crossOrigin);
  52019. var a = o.load(e, i, void 0, r);
  52020. return t && (a.mapping = t),
  52021. a
  52022. },
  52023. loadTextureCube: function(e, t, i, r) {
  52024. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52025. var o = new n.CubeTextureLoader;
  52026. o.setCrossOrigin(this.crossOrigin);
  52027. var a = o.load(e, i, void 0, r);
  52028. return t && (a.mapping = t),
  52029. a
  52030. },
  52031. loadCompressedTexture: function() {
  52032. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52033. },
  52034. loadCompressedTextureCube: function() {
  52035. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52036. }
  52037. },
  52038. n.Projector = function() {
  52039. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52040. this.projectVector = function(e, t) {
  52041. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52042. e.project(t)
  52043. }
  52044. ,
  52045. this.unprojectVector = function(e, t) {
  52046. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52047. e.unproject(t)
  52048. }
  52049. ,
  52050. this.pickingRay = function(e, t) {
  52051. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52052. }
  52053. }
  52054. ,
  52055. n.CanvasRenderer = function() {
  52056. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52057. this.domElement = document.createElement("canvas"),
  52058. this.clear = function() {}
  52059. ,
  52060. this.render = function() {}
  52061. ,
  52062. this.setClearColor = function() {}
  52063. ,
  52064. this.setSize = function() {}
  52065. }
  52066. ,
  52067. n.MeshFaceMaterial = n.MultiMaterial,
  52068. n.CurveUtils = {
  52069. tangentQuadraticBezier: function(e, t, i, n) {
  52070. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52071. },
  52072. tangentCubicBezier: function(e, t, i, n, r) {
  52073. 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
  52074. },
  52075. tangentSpline: function(e, t, i, n, r) {
  52076. var o = 6 * e * e - 6 * e
  52077. , a = 3 * e * e - 4 * e + 1
  52078. , s = -6 * e * e + 6 * e
  52079. , l = 3 * e * e - 2 * e;
  52080. return o + a + s + l
  52081. },
  52082. interpolate: function(e, t, i, n, r) {
  52083. var o = .5 * (i - e)
  52084. , a = .5 * (n - t)
  52085. , s = r * r
  52086. , l = r * s;
  52087. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52088. }
  52089. },
  52090. n.SceneUtils = {
  52091. createMultiMaterialObject: function(e, t) {
  52092. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  52093. i.add(new n.Mesh(e,t[r]));
  52094. return i
  52095. },
  52096. detach: function(e, t, i) {
  52097. e.applyMatrix(t.matrixWorld),
  52098. t.remove(e),
  52099. i.add(e)
  52100. },
  52101. attach: function(e, t, i) {
  52102. var r = new n.Matrix4;
  52103. r.getInverse(i.matrixWorld),
  52104. e.applyMatrix(r),
  52105. t.remove(e),
  52106. i.add(e)
  52107. }
  52108. },
  52109. n.ShapeUtils = {
  52110. area: function(e) {
  52111. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52112. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52113. return .5 * i
  52114. },
  52115. triangulate: function() {
  52116. function e(e, t, i, n, r, o) {
  52117. var a, s, l, c, h, u, d, p, f;
  52118. if (s = e[o[t]].x,
  52119. l = e[o[t]].y,
  52120. c = e[o[i]].x,
  52121. h = e[o[i]].y,
  52122. u = e[o[n]].x,
  52123. d = e[o[n]].y,
  52124. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  52125. return !1;
  52126. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  52127. for (g = u - c,
  52128. m = d - h,
  52129. v = s - u,
  52130. A = l - d,
  52131. y = c - s,
  52132. C = h - l,
  52133. a = 0; a < r; a++)
  52134. if (p = e[o[a]].x,
  52135. f = e[o[a]].y,
  52136. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  52137. E = f - l,
  52138. b = p - c,
  52139. w = f - h,
  52140. _ = p - u,
  52141. T = f - d,
  52142. M = g * w - m * b,
  52143. x = y * E - C * I,
  52144. S = v * T - A * _,
  52145. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  52146. return !1;
  52147. return !0
  52148. }
  52149. return function(t, i) {
  52150. var r = t.length;
  52151. if (r < 3)
  52152. return null;
  52153. var o, a, s, l = [], c = [], h = [];
  52154. if (n.ShapeUtils.area(t) > 0)
  52155. for (a = 0; a < r; a++)
  52156. c[a] = a;
  52157. else
  52158. for (a = 0; a < r; a++)
  52159. c[a] = r - 1 - a;
  52160. var u = r
  52161. , d = 2 * u;
  52162. for (a = u - 1; u > 2; ) {
  52163. if (d-- <= 0)
  52164. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52165. i ? h : l;
  52166. if (o = a,
  52167. u <= o && (o = 0),
  52168. a = o + 1,
  52169. u <= a && (a = 0),
  52170. s = a + 1,
  52171. u <= s && (s = 0),
  52172. e(t, o, a, s, u, c)) {
  52173. var p, f, g, m, v;
  52174. for (p = c[o],
  52175. f = c[a],
  52176. g = c[s],
  52177. l.push([t[p], t[f], t[g]]),
  52178. h.push([c[o], c[a], c[s]]),
  52179. m = a,
  52180. v = a + 1; v < u; m++,
  52181. v++)
  52182. c[m] = c[v];
  52183. u--,
  52184. d = 2 * u
  52185. }
  52186. }
  52187. return i ? h : l
  52188. }
  52189. }(),
  52190. triangulateShape: function(e, t) {
  52191. function i(e, t, i) {
  52192. 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
  52193. }
  52194. function r(e, t, n, r, o) {
  52195. var a = t.x - e.x
  52196. , s = t.y - e.y
  52197. , l = r.x - n.x
  52198. , c = r.y - n.y
  52199. , h = e.x - n.x
  52200. , u = e.y - n.y
  52201. , d = s * l - a * c
  52202. , p = s * h - a * u;
  52203. if (Math.abs(d) > Number.EPSILON) {
  52204. var f;
  52205. if (d > 0) {
  52206. if (p < 0 || p > d)
  52207. return [];
  52208. if (f = c * h - l * u,
  52209. f < 0 || f > d)
  52210. return []
  52211. } else {
  52212. if (p > 0 || p < d)
  52213. return [];
  52214. if (f = c * h - l * u,
  52215. f > 0 || f < d)
  52216. return []
  52217. }
  52218. if (0 === f)
  52219. return !o || 0 !== p && p !== d ? [e] : [];
  52220. if (f === d)
  52221. return !o || 0 !== p && p !== d ? [t] : [];
  52222. if (0 === p)
  52223. return [n];
  52224. if (p === d)
  52225. return [r];
  52226. var g = f / d;
  52227. return [{
  52228. x: e.x + g * a,
  52229. y: e.y + g * s
  52230. }]
  52231. }
  52232. if (0 !== p || c * h !== l * u)
  52233. return [];
  52234. var m = 0 === a && 0 === s
  52235. , v = 0 === l && 0 === c;
  52236. if (m && v)
  52237. return e.x !== n.x || e.y !== n.y ? [] : [e];
  52238. if (m)
  52239. return i(n, r, e) ? [e] : [];
  52240. if (v)
  52241. return i(e, t, n) ? [n] : [];
  52242. var A, y, C, I, E, b, w, _;
  52243. return 0 !== a ? (e.x < t.x ? (A = e,
  52244. C = e.x,
  52245. y = t,
  52246. I = t.x) : (A = t,
  52247. C = t.x,
  52248. y = e,
  52249. I = e.x),
  52250. n.x < r.x ? (E = n,
  52251. w = n.x,
  52252. b = r,
  52253. _ = r.x) : (E = r,
  52254. w = r.x,
  52255. b = n,
  52256. _ = n.x)) : (e.y < t.y ? (A = e,
  52257. C = e.y,
  52258. y = t,
  52259. I = t.y) : (A = t,
  52260. C = t.y,
  52261. y = e,
  52262. I = e.y),
  52263. n.y < r.y ? (E = n,
  52264. w = n.y,
  52265. b = r,
  52266. _ = r.y) : (E = r,
  52267. w = r.y,
  52268. b = n,
  52269. _ = n.y)),
  52270. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  52271. }
  52272. function o(e, t, i, n) {
  52273. var r = t.x - e.x
  52274. , o = t.y - e.y
  52275. , a = i.x - e.x
  52276. , s = i.y - e.y
  52277. , l = n.x - e.x
  52278. , c = n.y - e.y
  52279. , h = r * s - o * a
  52280. , u = r * c - o * l;
  52281. if (Math.abs(h) > Number.EPSILON) {
  52282. var d = l * s - c * a;
  52283. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  52284. }
  52285. return u > 0
  52286. }
  52287. function a(e, t) {
  52288. function i(e, t) {
  52289. var i = A.length - 1
  52290. , n = e - 1;
  52291. n < 0 && (n = i);
  52292. var r = e + 1;
  52293. r > i && (r = 0);
  52294. var a = o(A[e], A[n], A[r], s[t]);
  52295. if (!a)
  52296. return !1;
  52297. var l = s.length - 1
  52298. , c = t - 1;
  52299. c < 0 && (c = l);
  52300. var h = t + 1;
  52301. return h > l && (h = 0),
  52302. a = o(s[t], s[c], s[h], A[e]),
  52303. !!a
  52304. }
  52305. function n(e, t) {
  52306. var i, n, o;
  52307. for (i = 0; i < A.length; i++)
  52308. if (n = i + 1,
  52309. n %= A.length,
  52310. o = r(e, t, A[i], A[n], !0),
  52311. o.length > 0)
  52312. return !0;
  52313. return !1
  52314. }
  52315. function a(e, i) {
  52316. var n, o, a, s, l;
  52317. for (n = 0; n < y.length; n++)
  52318. for (o = t[y[n]],
  52319. a = 0; a < o.length; a++)
  52320. if (s = a + 1,
  52321. s %= o.length,
  52322. l = r(e, i, o[a], o[s], !0),
  52323. l.length > 0)
  52324. return !0;
  52325. return !1
  52326. }
  52327. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++)
  52328. y.push(I);
  52329. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  52330. if (w--,
  52331. w < 0) {
  52332. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  52333. break
  52334. }
  52335. for (c = b; c < A.length; c++) {
  52336. h = A[c],
  52337. l = -1;
  52338. for (var I = 0; I < y.length; I++)
  52339. if (d = y[I],
  52340. p = h.x + ":" + h.y + ":" + d,
  52341. void 0 === C[p]) {
  52342. s = t[d];
  52343. for (var _ = 0; _ < s.length; _++)
  52344. if (u = s[_],
  52345. i(c, _) && !n(h, u) && !a(h, u)) {
  52346. l = _,
  52347. y.splice(I, 1),
  52348. f = A.slice(0, c + 1),
  52349. g = A.slice(c),
  52350. m = s.slice(l),
  52351. v = s.slice(0, l + 1),
  52352. A = f.concat(m).concat(v).concat(g),
  52353. b = c;
  52354. break
  52355. }
  52356. if (l >= 0)
  52357. break;
  52358. C[p] = !0
  52359. }
  52360. if (l >= 0)
  52361. break
  52362. }
  52363. }
  52364. return A
  52365. }
  52366. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  52367. Array.prototype.push.apply(f, t[g]);
  52368. for (s = 0,
  52369. l = f.length; s < l; s++)
  52370. u = f[s].x + ":" + f[s].y,
  52371. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  52372. p[u] = s;
  52373. var v = a(e, t)
  52374. , A = n.ShapeUtils.triangulate(v, !1);
  52375. for (s = 0,
  52376. l = A.length; s < l; s++)
  52377. for (h = A[s],
  52378. c = 0; c < 3; c++)
  52379. u = h[c].x + ":" + h[c].y,
  52380. d = p[u],
  52381. void 0 !== d && (h[c] = d);
  52382. return A.concat()
  52383. },
  52384. isClockWise: function(e) {
  52385. return n.ShapeUtils.area(e) < 0
  52386. },
  52387. b2: function() {
  52388. function e(e, t) {
  52389. var i = 1 - e;
  52390. return i * i * t
  52391. }
  52392. function t(e, t) {
  52393. return 2 * (1 - e) * e * t
  52394. }
  52395. function i(e, t) {
  52396. return e * e * t
  52397. }
  52398. return function(n, r, o, a) {
  52399. return e(n, r) + t(n, o) + i(n, a)
  52400. }
  52401. }(),
  52402. b3: function() {
  52403. function e(e, t) {
  52404. var i = 1 - e;
  52405. return i * i * i * t
  52406. }
  52407. function t(e, t) {
  52408. var i = 1 - e;
  52409. return 3 * i * i * e * t
  52410. }
  52411. function i(e, t) {
  52412. var i = 1 - e;
  52413. return 3 * i * e * e * t
  52414. }
  52415. function n(e, t) {
  52416. return e * e * e * t
  52417. }
  52418. return function(r, o, a, s, l) {
  52419. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  52420. }
  52421. }()
  52422. },
  52423. n.Curve = function() {}
  52424. ,
  52425. n.Curve.prototype = {
  52426. constructor: n.Curve,
  52427. getPoint: function(e) {
  52428. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52429. null
  52430. },
  52431. getPointAt: function(e) {
  52432. var t = this.getUtoTmapping(e);
  52433. return this.getPoint(t)
  52434. },
  52435. getPoints: function(e) {
  52436. e || (e = 5);
  52437. var t, i = [];
  52438. for (t = 0; t <= e; t++)
  52439. i.push(this.getPoint(t / e));
  52440. return i
  52441. },
  52442. getSpacedPoints: function(e) {
  52443. e || (e = 5);
  52444. var t, i = [];
  52445. for (t = 0; t <= e; t++)
  52446. i.push(this.getPointAt(t / e));
  52447. return i
  52448. },
  52449. getLength: function() {
  52450. var e = this.getLengths();
  52451. return e[e.length - 1]
  52452. },
  52453. getLengths: function(e) {
  52454. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52455. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52456. return this.cacheArcLengths;
  52457. this.needsUpdate = !1;
  52458. var t, i, n = [], r = this.getPoint(0), o = 0;
  52459. for (n.push(0),
  52460. i = 1; i <= e; i++)
  52461. t = this.getPoint(i / e),
  52462. o += t.distanceTo(r),
  52463. n.push(o),
  52464. r = t;
  52465. return this.cacheArcLengths = n,
  52466. n
  52467. },
  52468. updateArcLengths: function() {
  52469. this.needsUpdate = !0,
  52470. this.getLengths()
  52471. },
  52472. getUtoTmapping: function(e, t) {
  52473. var i, n = this.getLengths(), r = 0, o = n.length;
  52474. i = t ? t : e * n[o - 1];
  52475. for (var a, s = 0, l = o - 1; s <= l; )
  52476. if (r = Math.floor(s + (l - s) / 2),
  52477. a = n[r] - i,
  52478. a < 0)
  52479. s = r + 1;
  52480. else {
  52481. if (!(a > 0)) {
  52482. l = r;
  52483. break
  52484. }
  52485. l = r - 1
  52486. }
  52487. if (r = l,
  52488. n[r] === i) {
  52489. var c = r / (o - 1);
  52490. return c
  52491. }
  52492. var h = n[r]
  52493. , u = n[r + 1]
  52494. , d = u - h
  52495. , p = (i - h) / d
  52496. , c = (r + p) / (o - 1);
  52497. return c
  52498. },
  52499. getTangent: function(e) {
  52500. var t = 1e-4
  52501. , i = e - t
  52502. , n = e + t;
  52503. i < 0 && (i = 0),
  52504. n > 1 && (n = 1);
  52505. var r = this.getPoint(i)
  52506. , o = this.getPoint(n)
  52507. , a = o.clone().sub(r);
  52508. return a.normalize()
  52509. },
  52510. getTangentAt: function(e) {
  52511. var t = this.getUtoTmapping(e);
  52512. return this.getTangent(t)
  52513. }
  52514. },
  52515. n.Curve.create = function(e, t) {
  52516. return e.prototype = Object.create(n.Curve.prototype),
  52517. e.prototype.constructor = e,
  52518. e.prototype.getPoint = t,
  52519. e
  52520. }
  52521. ,
  52522. n.CurvePath = function() {
  52523. this.curves = [],
  52524. this.autoClose = !1
  52525. }
  52526. ,
  52527. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  52528. n.CurvePath.prototype.constructor = n.CurvePath,
  52529. n.CurvePath.prototype.add = function(e) {
  52530. this.curves.push(e)
  52531. }
  52532. ,
  52533. n.CurvePath.prototype.closePath = function() {
  52534. var e = this.curves[0].getPoint(0)
  52535. , t = this.curves[this.curves.length - 1].getPoint(1);
  52536. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  52537. }
  52538. ,
  52539. n.CurvePath.prototype.getPoint = function(e) {
  52540. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52541. if (i[n] >= t) {
  52542. var r = i[n] - t
  52543. , o = this.curves[n]
  52544. , a = 1 - r / o.getLength();
  52545. return o.getPointAt(a)
  52546. }
  52547. n++
  52548. }
  52549. return null
  52550. }
  52551. ,
  52552. n.CurvePath.prototype.getLength = function() {
  52553. var e = this.getCurveLengths();
  52554. return e[e.length - 1]
  52555. }
  52556. ,
  52557. n.CurvePath.prototype.getCurveLengths = function() {
  52558. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52559. return this.cacheLengths;
  52560. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52561. t += this.curves[i].getLength(),
  52562. e.push(t);
  52563. return this.cacheLengths = e,
  52564. e
  52565. }
  52566. ,
  52567. n.CurvePath.prototype.createPointsGeometry = function(e) {
  52568. var t = this.getPoints(e);
  52569. return this.createGeometry(t)
  52570. }
  52571. ,
  52572. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52573. var t = this.getSpacedPoints(e);
  52574. return this.createGeometry(t)
  52575. }
  52576. ,
  52577. n.CurvePath.prototype.createGeometry = function(e) {
  52578. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  52579. var o = e[i];
  52580. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  52581. }
  52582. return t
  52583. }
  52584. ,
  52585. n.Font = function(e) {
  52586. this.data = e
  52587. }
  52588. ,
  52589. n.Font.prototype = {
  52590. constructor: n.Font,
  52591. generateShapes: function(e, t, i) {
  52592. function r(e) {
  52593. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  52594. var c = o(i[l], n, r);
  52595. r += c.offset,
  52596. s.push(c.path)
  52597. }
  52598. return s
  52599. }
  52600. function o(e, t, r) {
  52601. var o = a.glyphs[e] || a.glyphs["?"];
  52602. if (o) {
  52603. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  52604. if (o.o)
  52605. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  52606. var _ = E[b++];
  52607. switch (_) {
  52608. case "m":
  52609. s = E[b++] * t + r,
  52610. l = E[b++] * t,
  52611. A.moveTo(s, l);
  52612. break;
  52613. case "l":
  52614. s = E[b++] * t + r,
  52615. l = E[b++] * t,
  52616. A.lineTo(s, l);
  52617. break;
  52618. case "q":
  52619. if (c = E[b++] * t + r,
  52620. h = E[b++] * t,
  52621. p = E[b++] * t + r,
  52622. f = E[b++] * t,
  52623. A.quadraticCurveTo(p, f, c, h),
  52624. v = y[y.length - 1]) {
  52625. u = v.x,
  52626. d = v.y;
  52627. for (var T = 1; T <= i; T++) {
  52628. var x = T / i;
  52629. C(x, u, p, c),
  52630. C(x, d, f, h)
  52631. }
  52632. }
  52633. break;
  52634. case "b":
  52635. if (c = E[b++] * t + r,
  52636. h = E[b++] * t,
  52637. p = E[b++] * t + r,
  52638. f = E[b++] * t,
  52639. g = E[b++] * t + r,
  52640. m = E[b++] * t,
  52641. A.bezierCurveTo(p, f, g, m, c, h),
  52642. v = y[y.length - 1]) {
  52643. u = v.x,
  52644. d = v.y;
  52645. for (var T = 1; T <= i; T++) {
  52646. var x = T / i;
  52647. I(x, u, p, g, c),
  52648. I(x, d, f, m, h)
  52649. }
  52650. }
  52651. }
  52652. }
  52653. return {
  52654. offset: o.ha * t,
  52655. path: A
  52656. }
  52657. }
  52658. }
  52659. void 0 === t && (t = 100),
  52660. void 0 === i && (i = 4);
  52661. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  52662. Array.prototype.push.apply(l, s[c].toShapes());
  52663. return l
  52664. }
  52665. },
  52666. n.Path = function(e) {
  52667. n.CurvePath.call(this),
  52668. this.actions = [],
  52669. e && this.fromPoints(e)
  52670. }
  52671. ,
  52672. n.Path.prototype = Object.create(n.CurvePath.prototype),
  52673. n.Path.prototype.constructor = n.Path,
  52674. n.Path.prototype.fromPoints = function(e) {
  52675. this.moveTo(e[0].x, e[0].y);
  52676. for (var t = 1, i = e.length; t < i; t++)
  52677. this.lineTo(e[t].x, e[t].y)
  52678. }
  52679. ,
  52680. n.Path.prototype.moveTo = function(e, t) {
  52681. this.actions.push({
  52682. action: "moveTo",
  52683. args: [e, t]
  52684. })
  52685. }
  52686. ,
  52687. n.Path.prototype.lineTo = function(e, t) {
  52688. var i = this.actions[this.actions.length - 1].args
  52689. , r = i[i.length - 2]
  52690. , o = i[i.length - 1]
  52691. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  52692. this.curves.push(a),
  52693. this.actions.push({
  52694. action: "lineTo",
  52695. args: [e, t]
  52696. })
  52697. }
  52698. ,
  52699. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  52700. var o = this.actions[this.actions.length - 1].args
  52701. , a = o[o.length - 2]
  52702. , s = o[o.length - 1]
  52703. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  52704. this.curves.push(l),
  52705. this.actions.push({
  52706. action: "quadraticCurveTo",
  52707. args: [e, t, i, r]
  52708. })
  52709. }
  52710. ,
  52711. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  52712. var s = this.actions[this.actions.length - 1].args
  52713. , l = s[s.length - 2]
  52714. , c = s[s.length - 1]
  52715. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  52716. this.curves.push(h),
  52717. this.actions.push({
  52718. action: "bezierCurveTo",
  52719. args: [e, t, i, r, o, a]
  52720. })
  52721. }
  52722. ,
  52723. n.Path.prototype.splineThru = function(e) {
  52724. var t = Array.prototype.slice.call(arguments)
  52725. , i = this.actions[this.actions.length - 1].args
  52726. , r = i[i.length - 2]
  52727. , o = i[i.length - 1]
  52728. , a = [new n.Vector2(r,o)];
  52729. Array.prototype.push.apply(a, e);
  52730. var s = new n.SplineCurve(a);
  52731. this.curves.push(s),
  52732. this.actions.push({
  52733. action: "splineThru",
  52734. args: t
  52735. })
  52736. }
  52737. ,
  52738. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  52739. var a = this.actions[this.actions.length - 1].args
  52740. , s = a[a.length - 2]
  52741. , l = a[a.length - 1];
  52742. this.absarc(e + s, t + l, i, n, r, o)
  52743. }
  52744. ,
  52745. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52746. this.absellipse(e, t, i, i, n, r, o)
  52747. }
  52748. ,
  52749. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52750. var l = this.actions[this.actions.length - 1].args
  52751. , c = l[l.length - 2]
  52752. , h = l[l.length - 1];
  52753. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52754. }
  52755. ,
  52756. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  52757. var c = [e, t, i, r, o, a, s, l || 0]
  52758. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  52759. this.curves.push(h);
  52760. var u = h.getPoint(1);
  52761. c.push(u.x),
  52762. c.push(u.y),
  52763. this.actions.push({
  52764. action: "ellipse",
  52765. args: c
  52766. })
  52767. }
  52768. ,
  52769. n.Path.prototype.getSpacedPoints = function(e) {
  52770. e || (e = 40);
  52771. for (var t = [], i = 0; i < e; i++)
  52772. t.push(this.getPoint(i / e));
  52773. return this.autoClose && t.push(t[0]),
  52774. t
  52775. }
  52776. ,
  52777. n.Path.prototype.getPoints = function(e) {
  52778. e = e || 12;
  52779. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  52780. var A = this.actions[m]
  52781. , y = A.action
  52782. , C = A.args;
  52783. switch (y) {
  52784. case "moveTo":
  52785. g.push(new n.Vector2(C[0],C[1]));
  52786. break;
  52787. case "lineTo":
  52788. g.push(new n.Vector2(C[0],C[1]));
  52789. break;
  52790. case "quadraticCurveTo":
  52791. t = C[2],
  52792. i = C[3],
  52793. a = C[0],
  52794. s = C[1],
  52795. g.length > 0 ? (h = g[g.length - 1],
  52796. l = h.x,
  52797. c = h.y) : (h = this.actions[m - 1].args,
  52798. l = h[h.length - 2],
  52799. c = h[h.length - 1]);
  52800. for (var I = 1; I <= e; I++) {
  52801. var E = I / e;
  52802. u = p(E, l, a, t),
  52803. d = p(E, c, s, i),
  52804. g.push(new n.Vector2(u,d))
  52805. }
  52806. break;
  52807. case "bezierCurveTo":
  52808. t = C[4],
  52809. i = C[5],
  52810. a = C[0],
  52811. s = C[1],
  52812. r = C[2],
  52813. o = C[3],
  52814. g.length > 0 ? (h = g[g.length - 1],
  52815. l = h.x,
  52816. c = h.y) : (h = this.actions[m - 1].args,
  52817. l = h[h.length - 2],
  52818. c = h[h.length - 1]);
  52819. for (var I = 1; I <= e; I++) {
  52820. var E = I / e;
  52821. u = f(E, l, a, r, t),
  52822. d = f(E, c, s, o, i),
  52823. g.push(new n.Vector2(u,d))
  52824. }
  52825. break;
  52826. case "splineThru":
  52827. h = this.actions[m - 1].args;
  52828. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  52829. , w = [b]
  52830. , _ = e * C[0].length;
  52831. w = w.concat(C[0]);
  52832. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  52833. g.push(T.getPointAt(I / _));
  52834. break;
  52835. case "arc":
  52836. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  52837. var E = I / N;
  52838. L || (E = 1 - E),
  52839. x = P + E * D,
  52840. u = S + R * Math.cos(x),
  52841. d = M + R * Math.sin(x),
  52842. g.push(new n.Vector2(u,d))
  52843. }
  52844. break;
  52845. case "ellipse":
  52846. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  52847. 0 !== k && (B = Math.cos(k),
  52848. F = Math.sin(k));
  52849. for (var I = 1; I <= N; I++) {
  52850. var E = I / N;
  52851. if (L || (E = 1 - E),
  52852. x = P + E * D,
  52853. u = S + V * Math.cos(x),
  52854. d = M + U * Math.sin(x),
  52855. 0 !== k) {
  52856. var H = u
  52857. , G = d;
  52858. u = (H - S) * B - (G - M) * F + S,
  52859. d = (H - S) * F + (G - M) * B + M
  52860. }
  52861. g.push(new n.Vector2(u,d))
  52862. }
  52863. }
  52864. }
  52865. var z = g[g.length - 1];
  52866. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1),
  52867. this.autoClose && g.push(g[0]),
  52868. g
  52869. }
  52870. ,
  52871. n.Path.prototype.toShapes = function(e, t) {
  52872. function i(e) {
  52873. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  52874. var a = e[r]
  52875. , s = a.args
  52876. , l = a.action;
  52877. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  52878. i = new n.Path),
  52879. i[l].apply(i, s)
  52880. }
  52881. return 0 !== i.actions.length && t.push(i),
  52882. t
  52883. }
  52884. function r(e) {
  52885. for (var t = [], i = 0, r = e.length; i < r; i++) {
  52886. var o = e[i]
  52887. , a = new n.Shape;
  52888. a.actions = o.actions,
  52889. a.curves = o.curves,
  52890. t.push(a)
  52891. }
  52892. return t
  52893. }
  52894. function o(e, t) {
  52895. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52896. var a = t[r]
  52897. , s = t[o]
  52898. , l = s.x - a.x
  52899. , c = s.y - a.y;
  52900. if (Math.abs(c) > Number.EPSILON) {
  52901. if (c < 0 && (a = t[o],
  52902. l = -l,
  52903. s = t[r],
  52904. c = -c),
  52905. e.y < a.y || e.y > s.y)
  52906. continue;
  52907. if (e.y === a.y) {
  52908. if (e.x === a.x)
  52909. return !0
  52910. } else {
  52911. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52912. if (0 === h)
  52913. return !0;
  52914. if (h < 0)
  52915. continue;
  52916. n = !n
  52917. }
  52918. } else {
  52919. if (e.y !== a.y)
  52920. continue;
  52921. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52922. return !0
  52923. }
  52924. }
  52925. return n
  52926. }
  52927. var a = n.ShapeUtils.isClockWise
  52928. , s = i(this.actions);
  52929. if (0 === s.length)
  52930. return [];
  52931. if (t === !0)
  52932. return r(s);
  52933. var l, c, h, u = [];
  52934. if (1 === s.length)
  52935. return c = s[0],
  52936. h = new n.Shape,
  52937. h.actions = c.actions,
  52938. h.curves = c.curves,
  52939. u.push(h),
  52940. u;
  52941. var d = !a(s[0].getPoints());
  52942. d = e ? !d : d;
  52943. var p, f = [], g = [], m = [], v = 0;
  52944. g[v] = void 0,
  52945. m[v] = [];
  52946. for (var A = 0, y = s.length; A < y; A++)
  52947. c = s[A],
  52948. p = c.getPoints(),
  52949. l = a(p),
  52950. l = e ? !l : l,
  52951. l ? (!d && g[v] && v++,
  52952. g[v] = {
  52953. s: new n.Shape,
  52954. p: p
  52955. },
  52956. g[v].s.actions = c.actions,
  52957. g[v].s.curves = c.curves,
  52958. d && v++,
  52959. m[v] = []) : m[v].push({
  52960. h: c,
  52961. p: p[0]
  52962. });
  52963. if (!g[0])
  52964. return r(s);
  52965. if (g.length > 1) {
  52966. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  52967. f[E] = [];
  52968. for (var E = 0, b = g.length; E < b; E++)
  52969. for (var w = m[E], _ = 0; _ < w.length; _++) {
  52970. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  52971. o(T.p, g[S].p) && (E !== S && I.push({
  52972. froms: E,
  52973. tos: S,
  52974. hole: _
  52975. }),
  52976. x ? (x = !1,
  52977. f[S].push(T)) : C = !0);
  52978. x && f[E].push(T)
  52979. }
  52980. I.length > 0 && (C || (m = f))
  52981. }
  52982. for (var M, A = 0, R = g.length; A < R; A++) {
  52983. h = g[A].s,
  52984. u.push(h),
  52985. M = m[A];
  52986. for (var P = 0, O = M.length; P < O; P++)
  52987. h.holes.push(M[P].h)
  52988. }
  52989. return u
  52990. }
  52991. ,
  52992. n.Shape = function() {
  52993. n.Path.apply(this, arguments),
  52994. this.holes = []
  52995. }
  52996. ,
  52997. n.Shape.prototype = Object.create(n.Path.prototype),
  52998. n.Shape.prototype.constructor = n.Shape,
  52999. n.Shape.prototype.extrude = function(e) {
  53000. return new n.ExtrudeGeometry(this,e)
  53001. }
  53002. ,
  53003. n.Shape.prototype.makeGeometry = function(e) {
  53004. return new n.ShapeGeometry(this,e)
  53005. }
  53006. ,
  53007. n.Shape.prototype.getPointsHoles = function(e) {
  53008. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53009. t[i] = this.holes[i].getPoints(e);
  53010. return t
  53011. }
  53012. ,
  53013. n.Shape.prototype.extractAllPoints = function(e) {
  53014. return {
  53015. shape: this.getPoints(e),
  53016. holes: this.getPointsHoles(e)
  53017. }
  53018. }
  53019. ,
  53020. n.Shape.prototype.extractPoints = function(e) {
  53021. return this.extractAllPoints(e)
  53022. }
  53023. ,
  53024. n.LineCurve = function(e, t) {
  53025. this.v1 = e,
  53026. this.v2 = t
  53027. }
  53028. ,
  53029. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  53030. n.LineCurve.prototype.constructor = n.LineCurve,
  53031. n.LineCurve.prototype.getPoint = function(e) {
  53032. var t = this.v2.clone().sub(this.v1);
  53033. return t.multiplyScalar(e).add(this.v1),
  53034. t
  53035. }
  53036. ,
  53037. n.LineCurve.prototype.getPointAt = function(e) {
  53038. return this.getPoint(e)
  53039. }
  53040. ,
  53041. n.LineCurve.prototype.getTangent = function(e) {
  53042. var t = this.v2.clone().sub(this.v1);
  53043. return t.normalize()
  53044. }
  53045. ,
  53046. n.QuadraticBezierCurve = function(e, t, i) {
  53047. this.v0 = e,
  53048. this.v1 = t,
  53049. this.v2 = i
  53050. }
  53051. ,
  53052. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  53053. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  53054. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53055. var t = n.ShapeUtils.b2;
  53056. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  53057. }
  53058. ,
  53059. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53060. var t = n.CurveUtils.tangentQuadraticBezier;
  53061. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  53062. }
  53063. ,
  53064. n.CubicBezierCurve = function(e, t, i, n) {
  53065. this.v0 = e,
  53066. this.v1 = t,
  53067. this.v2 = i,
  53068. this.v3 = n
  53069. }
  53070. ,
  53071. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  53072. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  53073. n.CubicBezierCurve.prototype.getPoint = function(e) {
  53074. var t = n.ShapeUtils.b3;
  53075. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  53076. }
  53077. ,
  53078. n.CubicBezierCurve.prototype.getTangent = function(e) {
  53079. var t = n.CurveUtils.tangentCubicBezier;
  53080. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  53081. }
  53082. ,
  53083. n.SplineCurve = function(e) {
  53084. this.points = void 0 == e ? [] : e
  53085. }
  53086. ,
  53087. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  53088. n.SplineCurve.prototype.constructor = n.SplineCurve,
  53089. n.SplineCurve.prototype.getPoint = function(e) {
  53090. var t = this.points
  53091. , i = (t.length - 1) * e
  53092. , r = Math.floor(i)
  53093. , o = i - r
  53094. , a = t[0 === r ? r : r - 1]
  53095. , s = t[r]
  53096. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53097. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53098. , h = n.CurveUtils.interpolate;
  53099. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  53100. }
  53101. ,
  53102. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53103. this.aX = e,
  53104. this.aY = t,
  53105. this.xRadius = i,
  53106. this.yRadius = n,
  53107. this.aStartAngle = r,
  53108. this.aEndAngle = o,
  53109. this.aClockwise = a,
  53110. this.aRotation = s || 0
  53111. }
  53112. ,
  53113. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  53114. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  53115. n.EllipseCurve.prototype.getPoint = function(e) {
  53116. var t = this.aEndAngle - this.aStartAngle;
  53117. t < 0 && (t += 2 * Math.PI),
  53118. t > 2 * Math.PI && (t -= 2 * Math.PI);
  53119. var i;
  53120. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  53121. var r = this.aX + this.xRadius * Math.cos(i)
  53122. , o = this.aY + this.yRadius * Math.sin(i);
  53123. if (0 !== this.aRotation) {
  53124. var a = Math.cos(this.aRotation)
  53125. , s = Math.sin(this.aRotation)
  53126. , l = r
  53127. , c = o;
  53128. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  53129. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  53130. }
  53131. return new n.Vector2(r,o)
  53132. }
  53133. ,
  53134. n.ArcCurve = function(e, t, i, r, o, a) {
  53135. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  53136. }
  53137. ,
  53138. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  53139. n.ArcCurve.prototype.constructor = n.ArcCurve,
  53140. n.LineCurve3 = n.Curve.create(function(e, t) {
  53141. this.v1 = e,
  53142. this.v2 = t
  53143. }, function(e) {
  53144. var t = new n.Vector3;
  53145. return t.subVectors(this.v2, this.v1),
  53146. t.multiplyScalar(e),
  53147. t.add(this.v1),
  53148. t
  53149. }),
  53150. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  53151. this.v0 = e,
  53152. this.v1 = t,
  53153. this.v2 = i
  53154. }, function(e) {
  53155. var t = n.ShapeUtils.b2;
  53156. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  53157. }),
  53158. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  53159. this.v0 = e,
  53160. this.v1 = t,
  53161. this.v2 = i,
  53162. this.v3 = n
  53163. }, function(e) {
  53164. var t = n.ShapeUtils.b3;
  53165. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  53166. }),
  53167. n.SplineCurve3 = n.Curve.create(function(e) {
  53168. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53169. this.points = void 0 == e ? [] : e
  53170. }, function(e) {
  53171. var t = this.points
  53172. , i = (t.length - 1) * e
  53173. , r = Math.floor(i)
  53174. , o = i - r
  53175. , a = t[0 == r ? r : r - 1]
  53176. , s = t[r]
  53177. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53178. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53179. , h = n.CurveUtils.interpolate;
  53180. return new n.Vector3(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o),h(a.z, s.z, l.z, c.z, o))
  53181. }),
  53182. n.CatmullRomCurve3 = function() {
  53183. function e() {}
  53184. var t = new n.Vector3
  53185. , i = new e
  53186. , r = new e
  53187. , o = new e;
  53188. return e.prototype.init = function(e, t, i, n) {
  53189. this.c0 = e,
  53190. this.c1 = i,
  53191. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53192. this.c3 = 2 * e - 2 * t + i + n
  53193. }
  53194. ,
  53195. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53196. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53197. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53198. s *= o,
  53199. l *= o,
  53200. this.init(t, i, s, l)
  53201. }
  53202. ,
  53203. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  53204. this.init(t, i, r * (i - e), r * (n - t))
  53205. }
  53206. ,
  53207. e.prototype.calc = function(e) {
  53208. var t = e * e
  53209. , i = t * e;
  53210. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53211. }
  53212. ,
  53213. n.Curve.create(function(e) {
  53214. this.points = e || [],
  53215. this.closed = !1
  53216. }, function(e) {
  53217. var a, s, l, c, h = this.points;
  53218. c = h.length,
  53219. c < 2 && console.log("duh, you need at least 2 points"),
  53220. a = (c - (this.closed ? 0 : 1)) * e,
  53221. s = Math.floor(a),
  53222. l = a - s,
  53223. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  53224. l = 1);
  53225. var u, d, p, f;
  53226. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  53227. u = t),
  53228. d = h[s % c],
  53229. p = h[(s + 1) % c],
  53230. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  53231. f = t),
  53232. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53233. var g = "chordal" === this.type ? .5 : .25
  53234. , m = Math.pow(u.distanceToSquared(d), g)
  53235. , v = Math.pow(d.distanceToSquared(p), g)
  53236. , A = Math.pow(p.distanceToSquared(f), g);
  53237. v < 1e-4 && (v = 1),
  53238. m < 1e-4 && (m = v),
  53239. A < 1e-4 && (A = v),
  53240. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  53241. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  53242. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  53243. } else if ("catmullrom" === this.type) {
  53244. var y = void 0 !== this.tension ? this.tension : .5;
  53245. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  53246. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  53247. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  53248. }
  53249. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  53250. return C
  53251. })
  53252. }(),
  53253. n.ClosedSplineCurve3 = function(e) {
  53254. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53255. n.CatmullRomCurve3.call(this, e),
  53256. this.type = "catmullrom",
  53257. this.closed = !0
  53258. }
  53259. ,
  53260. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  53261. n.BoxGeometry = function(e, t, i, r, o, a) {
  53262. n.Geometry.call(this),
  53263. this.type = "BoxGeometry",
  53264. this.parameters = {
  53265. width: e,
  53266. height: t,
  53267. depth: i,
  53268. widthSegments: r,
  53269. heightSegments: o,
  53270. depthSegments: a
  53271. },
  53272. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  53273. this.mergeVertices()
  53274. }
  53275. ,
  53276. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  53277. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  53278. n.CubeGeometry = n.BoxGeometry,
  53279. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  53280. function s(e, t, i) {
  53281. var n = 0;
  53282. return n += e * t * 2,
  53283. n += e * i * 2,
  53284. n += i * t * 2,
  53285. 4 * n
  53286. }
  53287. function l(e, t, i, r, o, a, s, l, h, u, I) {
  53288. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3, O = 0; O < S; O++)
  53289. for (var L = O * b - _, D = 0; D < x; D++) {
  53290. var N = D * E - w;
  53291. P[e] = N * r,
  53292. P[t] = L * o,
  53293. P[i] = T,
  53294. p[m] = P.x,
  53295. p[m + 1] = P.y,
  53296. p[m + 2] = P.z,
  53297. P[e] = 0,
  53298. P[t] = 0,
  53299. P[i] = l > 0 ? 1 : -1,
  53300. f[m] = P.x,
  53301. f[m + 1] = P.y,
  53302. f[m + 2] = P.z,
  53303. g[v] = D / h,
  53304. g[v + 1] = 1 - O / u,
  53305. m += 3,
  53306. v += 2,
  53307. M += 1
  53308. }
  53309. for (O = 0; O < u; O++)
  53310. for (D = 0; D < h; D++) {
  53311. var B = y + D + x * O
  53312. , F = y + D + x * (O + 1)
  53313. , V = y + (D + 1) + x * (O + 1)
  53314. , U = y + (D + 1) + x * O;
  53315. d[A] = B,
  53316. d[A + 1] = F,
  53317. d[A + 2] = U,
  53318. d[A + 3] = F,
  53319. d[A + 4] = V,
  53320. d[A + 5] = U,
  53321. A += 6,
  53322. R += 6
  53323. }
  53324. c.addGroup(C, R, I),
  53325. C += R,
  53326. y += M
  53327. }
  53328. n.BufferGeometry.call(this),
  53329. this.type = "BoxBufferGeometry",
  53330. this.parameters = {
  53331. width: e,
  53332. height: t,
  53333. depth: i,
  53334. widthSegments: r,
  53335. heightSegments: o,
  53336. depthSegments: a
  53337. };
  53338. var c = this;
  53339. r = Math.floor(r) || 1,
  53340. o = Math.floor(o) || 1,
  53341. a = Math.floor(a) || 1;
  53342. var h = s(r, o, a)
  53343. , u = h / 4 * 6
  53344. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  53345. , p = new Float32Array(3 * h)
  53346. , f = new Float32Array(3 * h)
  53347. , g = new Float32Array(2 * h)
  53348. , m = 0
  53349. , v = 0
  53350. , A = 0
  53351. , y = 0
  53352. , C = 0;
  53353. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  53354. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  53355. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  53356. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  53357. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  53358. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  53359. this.setIndex(new n.BufferAttribute(d,1)),
  53360. this.addAttribute("position", new n.BufferAttribute(p,3)),
  53361. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  53362. this.addAttribute("uv", new n.BufferAttribute(g,2))
  53363. }
  53364. ,
  53365. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53366. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  53367. n.CircleGeometry = function(e, t, i, r) {
  53368. n.Geometry.call(this),
  53369. this.type = "CircleGeometry",
  53370. this.parameters = {
  53371. radius: e,
  53372. segments: t,
  53373. thetaStart: i,
  53374. thetaLength: r
  53375. },
  53376. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  53377. }
  53378. ,
  53379. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  53380. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  53381. n.CircleBufferGeometry = function(e, t, i, r) {
  53382. n.BufferGeometry.call(this),
  53383. this.type = "CircleBufferGeometry",
  53384. this.parameters = {
  53385. radius: e,
  53386. segments: t,
  53387. thetaStart: i,
  53388. thetaLength: r
  53389. },
  53390. e = e || 50,
  53391. t = void 0 !== t ? Math.max(3, t) : 8,
  53392. i = void 0 !== i ? i : 0,
  53393. r = void 0 !== r ? r : 2 * Math.PI;
  53394. var o = t + 2
  53395. , a = new Float32Array(3 * o)
  53396. , s = new Float32Array(3 * o)
  53397. , l = new Float32Array(2 * o);
  53398. s[2] = 1,
  53399. l[0] = .5,
  53400. l[1] = .5;
  53401. for (var c = 0, h = 3, u = 2; c <= t; c++,
  53402. h += 3,
  53403. u += 2) {
  53404. var d = i + c / t * r;
  53405. a[h] = e * Math.cos(d),
  53406. a[h + 1] = e * Math.sin(d),
  53407. s[h + 2] = 1,
  53408. l[u] = (a[h] / e + 1) / 2,
  53409. l[u + 1] = (a[h + 1] / e + 1) / 2
  53410. }
  53411. for (var p = [], h = 1; h <= t; h++)
  53412. p.push(h, h + 1, 0);
  53413. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  53414. this.addAttribute("position", new n.BufferAttribute(a,3)),
  53415. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  53416. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  53417. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  53418. }
  53419. ,
  53420. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53421. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  53422. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  53423. function c() {
  53424. var e = (r + 1) * (o + 1);
  53425. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  53426. e
  53427. }
  53428. function h() {
  53429. var e = r * o * 2 * 3;
  53430. return a === !1 && (e += 2 * r * 3),
  53431. e
  53432. }
  53433. function u() {
  53434. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  53435. for (c = 0; c <= o; c++) {
  53436. var p = []
  53437. , f = c / o
  53438. , b = f * (t - e) + e;
  53439. for (a = 0; a <= r; a++) {
  53440. var w = a / r;
  53441. u.x = b * Math.sin(w * l + s),
  53442. u.y = -f * i + E,
  53443. u.z = b * Math.cos(w * l + s),
  53444. m.setXYZ(y, u.x, u.y, u.z),
  53445. h.copy(u),
  53446. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  53447. h.z = Math.cos(w * l + s)),
  53448. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  53449. v.setXYZ(y, h.x, h.y, h.z),
  53450. A.setXY(y, w, 1 - f),
  53451. p.push(y),
  53452. y++
  53453. }
  53454. I.push(p)
  53455. }
  53456. for (a = 0; a < r; a++)
  53457. for (c = 0; c < o; c++) {
  53458. var _ = I[c][a]
  53459. , T = I[c + 1][a]
  53460. , x = I[c + 1][a + 1]
  53461. , S = I[c][a + 1];
  53462. g.setX(C, _),
  53463. C++,
  53464. g.setX(C, T),
  53465. C++,
  53466. g.setX(C, S),
  53467. C++,
  53468. g.setX(C, T),
  53469. C++,
  53470. g.setX(C, x),
  53471. C++,
  53472. g.setX(C, S),
  53473. C++
  53474. }
  53475. }
  53476. function d(i) {
  53477. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  53478. for (a = y,
  53479. o = 1; o <= r; o++)
  53480. m.setXYZ(y, 0, E * p, 0),
  53481. v.setXYZ(y, 0, p, 0),
  53482. i === !0 ? (h.x = o / r,
  53483. h.y = 0) : (h.x = (o - 1) / r,
  53484. h.y = 1),
  53485. A.setXY(y, h.x, h.y),
  53486. y++;
  53487. for (c = y,
  53488. o = 0; o <= r; o++) {
  53489. var f = o / r;
  53490. u.x = d * Math.sin(f * l + s),
  53491. u.y = E * p,
  53492. u.z = d * Math.cos(f * l + s),
  53493. m.setXYZ(y, u.x, u.y, u.z),
  53494. v.setXYZ(y, 0, p, 0),
  53495. A.setXY(y, f, i === !0 ? 1 : 0),
  53496. y++
  53497. }
  53498. for (o = 0; o < r; o++) {
  53499. var I = a + o
  53500. , b = c + o;
  53501. i === !0 ? (g.setX(C, b),
  53502. C++,
  53503. g.setX(C, b + 1),
  53504. C++,
  53505. g.setX(C, I),
  53506. C++) : (g.setX(C, b + 1),
  53507. C++,
  53508. g.setX(C, b),
  53509. C++,
  53510. g.setX(C, I),
  53511. C++)
  53512. }
  53513. }
  53514. n.BufferGeometry.call(this),
  53515. this.type = "CylinderBufferGeometry",
  53516. this.parameters = {
  53517. radiusTop: e,
  53518. radiusBottom: t,
  53519. height: i,
  53520. radialSegments: r,
  53521. heightSegments: o,
  53522. openEnded: a,
  53523. thetaStart: s,
  53524. thetaLength: l
  53525. },
  53526. e = void 0 !== e ? e : 20,
  53527. t = void 0 !== t ? t : 20,
  53528. i = void 0 !== i ? i : 100,
  53529. r = Math.floor(r) || 8,
  53530. o = Math.floor(o) || 1,
  53531. a = void 0 !== a && a,
  53532. s = void 0 !== s ? s : 0,
  53533. l = void 0 !== l ? l : 2 * Math.PI;
  53534. var p = c()
  53535. , f = h()
  53536. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  53537. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  53538. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  53539. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  53540. , y = 0
  53541. , C = 0
  53542. , I = []
  53543. , E = i / 2;
  53544. u(),
  53545. a === !1 && (e > 0 && d(!0),
  53546. t > 0 && d(!1)),
  53547. this.setIndex(g),
  53548. this.addAttribute("position", m),
  53549. this.addAttribute("normal", v),
  53550. this.addAttribute("uv", A)
  53551. }
  53552. ,
  53553. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53554. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  53555. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  53556. n.Geometry.call(this),
  53557. this.type = "CylinderGeometry",
  53558. this.parameters = {
  53559. radiusTop: e,
  53560. radiusBottom: t,
  53561. height: i,
  53562. radialSegments: r,
  53563. heightSegments: o,
  53564. openEnded: a,
  53565. thetaStart: s,
  53566. thetaLength: l
  53567. },
  53568. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  53569. this.mergeVertices()
  53570. }
  53571. ,
  53572. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  53573. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  53574. n.EdgesGeometry = function(e, t) {
  53575. function i(e, t) {
  53576. return e - t
  53577. }
  53578. n.BufferGeometry.call(this),
  53579. t = void 0 !== t ? t : 1;
  53580. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  53581. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  53582. r.fromBufferGeometry(e)) : r = e.clone(),
  53583. r.mergeVertices(),
  53584. r.computeFaceNormals();
  53585. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  53586. for (var p = h[u], f = 0; f < 3; f++) {
  53587. a[0] = p[l[f]],
  53588. a[1] = p[l[(f + 1) % 3]],
  53589. a.sort(i);
  53590. var g = a.toString();
  53591. void 0 === s[g] ? s[g] = {
  53592. vert1: a[0],
  53593. vert2: a[1],
  53594. face1: u,
  53595. face2: void 0
  53596. } : s[g].face2 = u
  53597. }
  53598. var m = [];
  53599. for (var g in s) {
  53600. var v = s[g];
  53601. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  53602. var A = c[v.vert1];
  53603. m.push(A.x),
  53604. m.push(A.y),
  53605. m.push(A.z),
  53606. A = c[v.vert2],
  53607. m.push(A.x),
  53608. m.push(A.y),
  53609. m.push(A.z)
  53610. }
  53611. }
  53612. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  53613. }
  53614. ,
  53615. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53616. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  53617. n.ExtrudeGeometry = function(e, t) {
  53618. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  53619. this.type = "ExtrudeGeometry",
  53620. e = Array.isArray(e) ? e : [e],
  53621. this.addShapeList(e, t),
  53622. void this.computeFaceNormals())
  53623. }
  53624. ;
  53625. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  53626. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  53627. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53628. for (var i = e.length, n = 0; n < i; n++) {
  53629. var r = e[n];
  53630. this.addShape(r, t)
  53631. }
  53632. }
  53633. ,
  53634. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53635. function i(e, t, i) {
  53636. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53637. t.clone().multiplyScalar(i).add(e)
  53638. }
  53639. function r(e, t, i) {
  53640. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  53641. if (Math.abs(d) > Number.EPSILON) {
  53642. var p = Math.sqrt(u)
  53643. , f = Math.sqrt(c * c + h * h)
  53644. , g = t.x - l / p
  53645. , m = t.y + s / p
  53646. , v = i.x - h / f
  53647. , A = i.y + c / f
  53648. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  53649. r = g + s * y - e.x,
  53650. o = m + l * y - e.y;
  53651. var C = r * r + o * o;
  53652. if (C <= 2)
  53653. return new n.Vector2(r,o);
  53654. a = Math.sqrt(C / 2)
  53655. } else {
  53656. var I = !1;
  53657. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  53658. I ? (r = -l,
  53659. o = s,
  53660. a = Math.sqrt(u)) : (r = s,
  53661. o = l,
  53662. a = Math.sqrt(u / 2))
  53663. }
  53664. return new n.Vector2(r / a,o / a)
  53665. }
  53666. function o() {
  53667. if (C) {
  53668. var e = 0
  53669. , t = z * e;
  53670. for (Y = 0; Y < W; Y++)
  53671. G = N[Y],
  53672. c(G[2] + t, G[1] + t, G[0] + t);
  53673. for (e = E + 2 * y,
  53674. t = z * e,
  53675. Y = 0; Y < W; Y++)
  53676. G = N[Y],
  53677. c(G[0] + t, G[1] + t, G[2] + t)
  53678. } else {
  53679. for (Y = 0; Y < W; Y++)
  53680. G = N[Y],
  53681. c(G[2], G[1], G[0]);
  53682. for (Y = 0; Y < W; Y++)
  53683. G = N[Y],
  53684. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  53685. }
  53686. }
  53687. function a() {
  53688. var e = 0;
  53689. for (s(B, e),
  53690. e += B.length,
  53691. x = 0,
  53692. S = L.length; x < S; x++)
  53693. T = L[x],
  53694. s(T, e),
  53695. e += T.length
  53696. }
  53697. function s(e, t) {
  53698. var i, n;
  53699. for (Y = e.length; --Y >= 0; ) {
  53700. i = Y,
  53701. n = Y - 1,
  53702. n < 0 && (n = e.length - 1);
  53703. var r = 0
  53704. , o = E + 2 * y;
  53705. for (r = 0; r < o; r++) {
  53706. var a = z * r
  53707. , s = z * (r + 1)
  53708. , l = t + i + a
  53709. , c = t + n + a
  53710. , u = t + n + s
  53711. , d = t + i + s;
  53712. h(l, c, u, d, e, r, o, i, n)
  53713. }
  53714. }
  53715. }
  53716. function l(e, t, i) {
  53717. M.vertices.push(new n.Vector3(e,t,i))
  53718. }
  53719. function c(e, t, i) {
  53720. e += R,
  53721. t += R,
  53722. i += R,
  53723. M.faces.push(new n.Face3(e,t,i,null,null,0));
  53724. var r = _.generateTopUV(M, e, t, i);
  53725. M.faceVertexUvs[0].push(r)
  53726. }
  53727. function h(e, t, i, r, o, a, s, l, c) {
  53728. e += R,
  53729. t += R,
  53730. i += R,
  53731. r += R,
  53732. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  53733. M.faces.push(new n.Face3(t,i,r,null,null,1));
  53734. var h = _.generateSideWallUV(M, e, t, i, r);
  53735. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  53736. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  53737. }
  53738. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  53739. b && (u = b.getSpacedPoints(E),
  53740. w = !0,
  53741. C = !1,
  53742. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  53743. p = new n.Vector3,
  53744. f = new n.Vector3,
  53745. g = new n.Vector3),
  53746. C || (y = 0,
  53747. v = 0,
  53748. A = 0);
  53749. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  53750. if (D) {
  53751. for (O = O.reverse(),
  53752. x = 0,
  53753. S = L.length; x < S; x++)
  53754. T = L[x],
  53755. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  53756. D = !1
  53757. }
  53758. var N = n.ShapeUtils.triangulateShape(O, L)
  53759. , B = O;
  53760. for (x = 0,
  53761. S = L.length; x < S; x++)
  53762. T = L[x],
  53763. O = O.concat(T);
  53764. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++,
  53765. Z++,
  53766. q++)
  53767. Z === X && (Z = 0),
  53768. q === X && (q = 0),
  53769. j[Y] = r(B[Y], B[Z], B[q]);
  53770. var K, Q = [], J = j.concat();
  53771. for (x = 0,
  53772. S = L.length; x < S; x++) {
  53773. for (T = L[x],
  53774. K = [],
  53775. Y = 0,
  53776. X = T.length,
  53777. Z = X - 1,
  53778. q = Y + 1; Y < X; Y++,
  53779. Z++,
  53780. q++)
  53781. Z === X && (Z = 0),
  53782. q === X && (q = 0),
  53783. K[Y] = r(T[Y], T[Z], T[q]);
  53784. Q.push(K),
  53785. J = J.concat(K)
  53786. }
  53787. for (F = 0; F < y; F++) {
  53788. for (U = F / y,
  53789. k = v * (1 - U),
  53790. V = A * Math.sin(U * Math.PI / 2),
  53791. Y = 0,
  53792. X = B.length; Y < X; Y++)
  53793. H = i(B[Y], j[Y], V),
  53794. l(H.x, H.y, -k);
  53795. for (x = 0,
  53796. S = L.length; x < S; x++)
  53797. for (T = L[x],
  53798. K = Q[x],
  53799. Y = 0,
  53800. X = T.length; Y < X; Y++)
  53801. H = i(T[Y], K[Y], V),
  53802. l(H.x, H.y, -k)
  53803. }
  53804. for (V = A,
  53805. Y = 0; Y < z; Y++)
  53806. H = C ? i(O[Y], J[Y], V) : O[Y],
  53807. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  53808. p.copy(d.binormals[0]).multiplyScalar(H.y),
  53809. g.copy(u[0]).add(f).add(p),
  53810. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  53811. var $;
  53812. for ($ = 1; $ <= E; $++)
  53813. for (Y = 0; Y < z; Y++)
  53814. H = C ? i(O[Y], J[Y], V) : O[Y],
  53815. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  53816. p.copy(d.binormals[$]).multiplyScalar(H.y),
  53817. g.copy(u[$]).add(f).add(p),
  53818. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  53819. for (F = y - 1; F >= 0; F--) {
  53820. for (U = F / y,
  53821. k = v * (1 - U),
  53822. V = A * Math.sin(U * Math.PI / 2),
  53823. Y = 0,
  53824. X = B.length; Y < X; Y++)
  53825. H = i(B[Y], j[Y], V),
  53826. l(H.x, H.y, m + k);
  53827. for (x = 0,
  53828. S = L.length; x < S; x++)
  53829. for (T = L[x],
  53830. K = Q[x],
  53831. Y = 0,
  53832. X = T.length; Y < X; Y++)
  53833. H = i(T[Y], K[Y], V),
  53834. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  53835. }
  53836. o(),
  53837. a()
  53838. }
  53839. ,
  53840. n.ExtrudeGeometry.WorldUVGenerator = {
  53841. generateTopUV: function(e, t, i, r) {
  53842. var o = e.vertices
  53843. , a = o[t]
  53844. , s = o[i]
  53845. , l = o[r];
  53846. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  53847. },
  53848. generateSideWallUV: function(e, t, i, r, o) {
  53849. var a = e.vertices
  53850. , s = a[t]
  53851. , l = a[i]
  53852. , c = a[r]
  53853. , h = a[o];
  53854. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  53855. }
  53856. },
  53857. n.ShapeGeometry = function(e, t) {
  53858. n.Geometry.call(this),
  53859. this.type = "ShapeGeometry",
  53860. Array.isArray(e) === !1 && (e = [e]),
  53861. this.addShapeList(e, t),
  53862. this.computeFaceNormals()
  53863. }
  53864. ,
  53865. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  53866. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  53867. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53868. for (var i = 0, n = e.length; i < n; i++)
  53869. this.addShape(e[i], t);
  53870. return this
  53871. }
  53872. ,
  53873. n.ShapeGeometry.prototype.addShape = function(e, t) {
  53874. void 0 === t && (t = {});
  53875. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  53876. if (p) {
  53877. for (u = u.reverse(),
  53878. i = 0,
  53879. r = d.length; i < r; i++)
  53880. o = d[i],
  53881. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  53882. p = !1
  53883. }
  53884. var f = n.ShapeUtils.triangulateShape(u, d);
  53885. for (i = 0,
  53886. r = d.length; i < r; i++)
  53887. o = d[i],
  53888. u = u.concat(o);
  53889. var g, m, v = u.length, A = f.length;
  53890. for (i = 0; i < v; i++)
  53891. g = u[i],
  53892. this.vertices.push(new n.Vector3(g.x,g.y,0));
  53893. for (i = 0; i < A; i++) {
  53894. m = f[i];
  53895. var y = m[0] + c
  53896. , C = m[1] + c
  53897. , I = m[2] + c;
  53898. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  53899. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  53900. }
  53901. }
  53902. ,
  53903. n.LatheBufferGeometry = function(e, t, i, r) {
  53904. n.BufferGeometry.call(this),
  53905. this.type = "LatheBufferGeometry",
  53906. this.parameters = {
  53907. points: e,
  53908. segments: t,
  53909. phiStart: i,
  53910. phiLength: r
  53911. },
  53912. t = Math.floor(t) || 12,
  53913. i = i || 0,
  53914. r = r || 2 * Math.PI,
  53915. r = n.Math.clamp(r, 0, 2 * Math.PI);
  53916. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  53917. 1 / t), m = new n.Vector3, v = new n.Vector2;
  53918. for (a = 0; a <= t; a++) {
  53919. var A = i + a * g * r
  53920. , y = Math.sin(A)
  53921. , C = Math.cos(A);
  53922. for (s = 0; s <= e.length - 1; s++)
  53923. m.x = e[s].x * y,
  53924. m.y = e[s].y,
  53925. m.z = e[s].x * C,
  53926. u.setXYZ(p, m.x, m.y, m.z),
  53927. v.x = a / t,
  53928. v.y = s / (e.length - 1),
  53929. d.setXY(p, v.x, v.y),
  53930. p++
  53931. }
  53932. for (a = 0; a < t; a++)
  53933. for (s = 0; s < e.length - 1; s++) {
  53934. o = s + a * e.length;
  53935. var I = o
  53936. , E = o + e.length
  53937. , b = o + e.length + 1
  53938. , w = o + 1;
  53939. h.setX(f, I),
  53940. f++,
  53941. h.setX(f, E),
  53942. f++,
  53943. h.setX(f, w),
  53944. f++,
  53945. h.setX(f, E),
  53946. f++,
  53947. h.setX(f, b),
  53948. f++,
  53949. h.setX(f, w),
  53950. f++
  53951. }
  53952. if (this.setIndex(h),
  53953. this.addAttribute("position", u),
  53954. this.addAttribute("uv", d),
  53955. this.computeVertexNormals(),
  53956. r === 2 * Math.PI) {
  53957. var _ = this.attributes.normal.array
  53958. , T = new n.Vector3
  53959. , x = new n.Vector3
  53960. , S = new n.Vector3;
  53961. for (o = t * e.length * 3,
  53962. a = 0,
  53963. s = 0; a < e.length; a++,
  53964. s += 3)
  53965. T.x = _[s + 0],
  53966. T.y = _[s + 1],
  53967. T.z = _[s + 2],
  53968. x.x = _[o + s + 0],
  53969. x.y = _[o + s + 1],
  53970. x.z = _[o + s + 2],
  53971. S.addVectors(T, x).normalize(),
  53972. _[s + 0] = _[o + s + 0] = S.x,
  53973. _[s + 1] = _[o + s + 1] = S.y,
  53974. _[s + 2] = _[o + s + 2] = S.z
  53975. }
  53976. }
  53977. ,
  53978. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53979. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  53980. n.LatheGeometry = function(e, t, i, r) {
  53981. n.Geometry.call(this),
  53982. this.type = "LatheGeometry",
  53983. this.parameters = {
  53984. points: e,
  53985. segments: t,
  53986. phiStart: i,
  53987. phiLength: r
  53988. },
  53989. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  53990. this.mergeVertices()
  53991. }
  53992. ,
  53993. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  53994. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  53995. n.PlaneGeometry = function(e, t, i, r) {
  53996. n.Geometry.call(this),
  53997. this.type = "PlaneGeometry",
  53998. this.parameters = {
  53999. width: e,
  54000. height: t,
  54001. widthSegments: i,
  54002. heightSegments: r
  54003. },
  54004. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  54005. }
  54006. ,
  54007. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  54008. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  54009. n.PlaneBufferGeometry = function(e, t, i, r) {
  54010. n.BufferGeometry.call(this),
  54011. this.type = "PlaneBufferGeometry",
  54012. this.parameters = {
  54013. width: e,
  54014. height: t,
  54015. widthSegments: i,
  54016. heightSegments: r
  54017. };
  54018. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  54019. for (var y = A * d - a, C = 0; C < c; C++) {
  54020. var I = C * u - o;
  54021. p[m] = I,
  54022. p[m + 1] = -y,
  54023. f[m + 2] = 1,
  54024. g[v] = C / s,
  54025. g[v + 1] = 1 - A / l,
  54026. m += 3,
  54027. v += 2
  54028. }
  54029. m = 0;
  54030. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  54031. for (var C = 0; C < s; C++) {
  54032. var b = C + c * A
  54033. , w = C + c * (A + 1)
  54034. , _ = C + 1 + c * (A + 1)
  54035. , T = C + 1 + c * A;
  54036. E[m] = b,
  54037. E[m + 1] = w,
  54038. E[m + 2] = T,
  54039. E[m + 3] = w,
  54040. E[m + 4] = _,
  54041. E[m + 5] = T,
  54042. m += 6
  54043. }
  54044. this.setIndex(new n.BufferAttribute(E,1)),
  54045. this.addAttribute("position", new n.BufferAttribute(p,3)),
  54046. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  54047. this.addAttribute("uv", new n.BufferAttribute(g,2))
  54048. }
  54049. ,
  54050. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54051. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  54052. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  54053. n.BufferGeometry.call(this),
  54054. this.type = "RingBufferGeometry",
  54055. this.parameters = {
  54056. innerRadius: e,
  54057. outerRadius: t,
  54058. thetaSegments: i,
  54059. phiSegments: r,
  54060. thetaStart: o,
  54061. thetaLength: a
  54062. },
  54063. e = e || 20,
  54064. t = t || 50,
  54065. o = void 0 !== o ? o : 0,
  54066. a = void 0 !== a ? a : 2 * Math.PI,
  54067. i = void 0 !== i ? Math.max(3, i) : 8,
  54068. r = void 0 !== r ? Math.max(1, r) : 1;
  54069. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  54070. for (l = 0; l <= r; l++) {
  54071. for (c = 0; c <= i; c++)
  54072. s = o + c / i * a,
  54073. C.x = A * Math.cos(s),
  54074. C.y = A * Math.sin(s),
  54075. p.setXYZ(m, C.x, C.y, C.z),
  54076. f.setXYZ(m, 0, 0, 1),
  54077. I.x = (C.x / t + 1) / 2,
  54078. I.y = (C.y / t + 1) / 2,
  54079. g.setXY(m, I.x, I.y),
  54080. m++;
  54081. A += y
  54082. }
  54083. for (l = 0; l < r; l++) {
  54084. var E = l * (i + 1);
  54085. for (c = 0; c < i; c++) {
  54086. s = c + E;
  54087. var b = s
  54088. , w = s + i + 1
  54089. , _ = s + i + 2
  54090. , T = s + 1;
  54091. d.setX(v, b),
  54092. v++,
  54093. d.setX(v, w),
  54094. v++,
  54095. d.setX(v, _),
  54096. v++,
  54097. d.setX(v, b),
  54098. v++,
  54099. d.setX(v, _),
  54100. v++,
  54101. d.setX(v, T),
  54102. v++
  54103. }
  54104. }
  54105. this.setIndex(d),
  54106. this.addAttribute("position", p),
  54107. this.addAttribute("normal", f),
  54108. this.addAttribute("uv", g)
  54109. }
  54110. ,
  54111. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54112. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  54113. n.RingGeometry = function(e, t, i, r, o, a) {
  54114. n.Geometry.call(this),
  54115. this.type = "RingGeometry",
  54116. this.parameters = {
  54117. innerRadius: e,
  54118. outerRadius: t,
  54119. thetaSegments: i,
  54120. phiSegments: r,
  54121. thetaStart: o,
  54122. thetaLength: a
  54123. },
  54124. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  54125. }
  54126. ,
  54127. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  54128. n.RingGeometry.prototype.constructor = n.RingGeometry,
  54129. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  54130. n.Geometry.call(this),
  54131. this.type = "SphereGeometry",
  54132. this.parameters = {
  54133. radius: e,
  54134. widthSegments: t,
  54135. heightSegments: i,
  54136. phiStart: r,
  54137. phiLength: o,
  54138. thetaStart: a,
  54139. thetaLength: s
  54140. },
  54141. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  54142. }
  54143. ,
  54144. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  54145. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  54146. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  54147. n.BufferGeometry.call(this),
  54148. this.type = "SphereBufferGeometry",
  54149. this.parameters = {
  54150. radius: e,
  54151. widthSegments: t,
  54152. heightSegments: i,
  54153. phiStart: r,
  54154. phiLength: o,
  54155. thetaStart: a,
  54156. thetaLength: s
  54157. },
  54158. e = e || 50,
  54159. t = Math.max(3, Math.floor(t) || 8),
  54160. i = Math.max(2, Math.floor(i) || 6),
  54161. r = void 0 !== r ? r : 0,
  54162. o = void 0 !== o ? o : 2 * Math.PI,
  54163. a = void 0 !== a ? a : 0,
  54164. s = void 0 !== s ? s : Math.PI;
  54165. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  54166. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  54167. var C = y / t
  54168. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  54169. , E = e * Math.cos(a + A * s)
  54170. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  54171. g.set(I, E, b).normalize(),
  54172. h.setXYZ(p, I, E, b),
  54173. u.setXYZ(p, g.x, g.y, g.z),
  54174. d.setXY(p, C, 1 - A),
  54175. v.push(p),
  54176. p++
  54177. }
  54178. f.push(v)
  54179. }
  54180. for (var w = [], m = 0; m < i; m++)
  54181. for (var y = 0; y < t; y++) {
  54182. var _ = f[m][y + 1]
  54183. , T = f[m][y]
  54184. , x = f[m + 1][y]
  54185. , S = f[m + 1][y + 1];
  54186. (0 !== m || a > 0) && w.push(_, T, S),
  54187. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  54188. }
  54189. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  54190. this.addAttribute("position", h),
  54191. this.addAttribute("normal", u),
  54192. this.addAttribute("uv", d),
  54193. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  54194. }
  54195. ,
  54196. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54197. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  54198. n.TextGeometry = function(e, t) {
  54199. t = t || {};
  54200. var i = t.font;
  54201. if (i instanceof n.Font == !1)
  54202. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54203. new n.Geometry;
  54204. var r = i.generateShapes(e, t.size, t.curveSegments);
  54205. t.amount = void 0 !== t.height ? t.height : 50,
  54206. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54207. void 0 === t.bevelSize && (t.bevelSize = 8),
  54208. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54209. n.ExtrudeGeometry.call(this, r, t),
  54210. this.type = "TextGeometry"
  54211. }
  54212. ,
  54213. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  54214. n.TextGeometry.prototype.constructor = n.TextGeometry,
  54215. n.TorusBufferGeometry = function(e, t, i, r, o) {
  54216. n.BufferGeometry.call(this),
  54217. this.type = "TorusBufferGeometry",
  54218. this.parameters = {
  54219. radius: e,
  54220. tube: t,
  54221. radialSegments: i,
  54222. tubularSegments: r,
  54223. arc: o
  54224. },
  54225. e = e || 100,
  54226. t = t || 40,
  54227. i = Math.floor(i) || 8,
  54228. r = Math.floor(r) || 6,
  54229. o = o || 2 * Math.PI;
  54230. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  54231. for (a = 0; a <= i; a++)
  54232. for (s = 0; s <= r; s++) {
  54233. var C = s / r * o
  54234. , I = a / i * Math.PI * 2;
  54235. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  54236. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  54237. A.z = t * Math.sin(I),
  54238. u[f] = A.x,
  54239. u[f + 1] = A.y,
  54240. u[f + 2] = A.z,
  54241. v.x = e * Math.cos(C),
  54242. v.y = e * Math.sin(C),
  54243. y.subVectors(A, v).normalize(),
  54244. d[f] = y.x,
  54245. d[f + 1] = y.y,
  54246. d[f + 2] = y.z,
  54247. p[g] = s / r,
  54248. p[g + 1] = a / i,
  54249. f += 3,
  54250. g += 2
  54251. }
  54252. for (a = 1; a <= i; a++)
  54253. for (s = 1; s <= r; s++) {
  54254. var E = (r + 1) * a + s - 1
  54255. , b = (r + 1) * (a - 1) + s - 1
  54256. , w = (r + 1) * (a - 1) + s
  54257. , _ = (r + 1) * a + s;
  54258. h[m] = E,
  54259. h[m + 1] = b,
  54260. h[m + 2] = _,
  54261. h[m + 3] = b,
  54262. h[m + 4] = w,
  54263. h[m + 5] = _,
  54264. m += 6
  54265. }
  54266. this.setIndex(new n.BufferAttribute(h,1)),
  54267. this.addAttribute("position", new n.BufferAttribute(u,3)),
  54268. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  54269. this.addAttribute("uv", new n.BufferAttribute(p,2))
  54270. }
  54271. ,
  54272. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54273. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  54274. n.TorusGeometry = function(e, t, i, r, o) {
  54275. n.Geometry.call(this),
  54276. this.type = "TorusGeometry",
  54277. this.parameters = {
  54278. radius: e,
  54279. tube: t,
  54280. radialSegments: i,
  54281. tubularSegments: r,
  54282. arc: o
  54283. },
  54284. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  54285. }
  54286. ,
  54287. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  54288. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  54289. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  54290. function s(e, t, i, n, r) {
  54291. var o = Math.cos(e)
  54292. , a = Math.sin(e)
  54293. , s = i / t * e
  54294. , l = Math.cos(s);
  54295. r.x = n * (2 + l) * .5 * o,
  54296. r.y = n * (2 + l) * a * .5,
  54297. r.z = n * Math.sin(s) * .5
  54298. }
  54299. n.BufferGeometry.call(this),
  54300. this.type = "TorusKnotBufferGeometry",
  54301. this.parameters = {
  54302. radius: e,
  54303. tube: t,
  54304. tubularSegments: i,
  54305. radialSegments: r,
  54306. p: o,
  54307. q: a
  54308. },
  54309. e = e || 100,
  54310. t = t || 40,
  54311. i = Math.floor(i) || 64,
  54312. r = Math.floor(r) || 8,
  54313. o = o || 2,
  54314. a = a || 3;
  54315. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  54316. for (l = 0; l <= i; ++l) {
  54317. var T = l / i * o * Math.PI * 2;
  54318. for (s(T, o, a, e, I),
  54319. s(T + .01, o, a, e, E),
  54320. w.subVectors(E, I),
  54321. _.addVectors(E, I),
  54322. b.crossVectors(w, _),
  54323. _.crossVectors(b, w),
  54324. b.normalize(),
  54325. _.normalize(),
  54326. c = 0; c <= r; ++c) {
  54327. var x = c / r * Math.PI * 2
  54328. , S = -t * Math.cos(x)
  54329. , M = t * Math.sin(x);
  54330. A.x = I.x + (S * _.x + M * b.x),
  54331. A.y = I.y + (S * _.y + M * b.y),
  54332. A.z = I.z + (S * _.z + M * b.z),
  54333. p.setXYZ(m, A.x, A.y, A.z),
  54334. y.subVectors(A, I).normalize(),
  54335. f.setXYZ(m, y.x, y.y, y.z),
  54336. C.x = l / i,
  54337. C.y = c / r,
  54338. g.setXY(m, C.x, C.y),
  54339. m++
  54340. }
  54341. }
  54342. for (c = 1; c <= i; c++)
  54343. for (l = 1; l <= r; l++) {
  54344. var R = (r + 1) * (c - 1) + (l - 1)
  54345. , P = (r + 1) * c + (l - 1)
  54346. , O = (r + 1) * c + l
  54347. , L = (r + 1) * (c - 1) + l;
  54348. d.setX(v, R),
  54349. v++,
  54350. d.setX(v, P),
  54351. v++,
  54352. d.setX(v, L),
  54353. v++,
  54354. d.setX(v, P),
  54355. v++,
  54356. d.setX(v, O),
  54357. v++,
  54358. d.setX(v, L),
  54359. v++
  54360. }
  54361. this.setIndex(d),
  54362. this.addAttribute("position", p),
  54363. this.addAttribute("normal", f),
  54364. this.addAttribute("uv", g)
  54365. }
  54366. ,
  54367. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54368. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  54369. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  54370. n.Geometry.call(this),
  54371. this.type = "TorusKnotGeometry",
  54372. this.parameters = {
  54373. radius: e,
  54374. tube: t,
  54375. tubularSegments: i,
  54376. radialSegments: r,
  54377. p: o,
  54378. q: a
  54379. },
  54380. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54381. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  54382. this.mergeVertices()
  54383. }
  54384. ,
  54385. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  54386. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  54387. n.TubeGeometry = function(e, t, i, r, o, a) {
  54388. function s(e, t, i) {
  54389. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  54390. }
  54391. n.Geometry.call(this),
  54392. this.type = "TubeGeometry",
  54393. this.parameters = {
  54394. path: e,
  54395. segments: t,
  54396. radius: i,
  54397. radialSegments: r,
  54398. closed: o,
  54399. taper: a
  54400. },
  54401. t = t || 64,
  54402. i = i || 1,
  54403. r = r || 8,
  54404. o = o || !1,
  54405. a = a || n.TubeGeometry.NoTaper;
  54406. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  54407. for (this.tangents = D,
  54408. this.normals = N,
  54409. this.binormals = B,
  54410. v = 0; v < P; v++)
  54411. for (M[v] = [],
  54412. u = v / (P - 1),
  54413. m = e.getPointAt(u),
  54414. l = D[v],
  54415. c = N[v],
  54416. h = B[v],
  54417. p = i * a(u),
  54418. A = 0; A < r; A++)
  54419. d = A / r * 2 * Math.PI,
  54420. f = -p * Math.cos(d),
  54421. g = p * Math.sin(d),
  54422. O.copy(m),
  54423. O.x += f * c.x + g * h.x,
  54424. O.y += f * c.y + g * h.y,
  54425. O.z += f * c.z + g * h.z,
  54426. M[v][A] = s(O.x, O.y, O.z);
  54427. for (v = 0; v < t; v++)
  54428. for (A = 0; A < r; A++)
  54429. y = o ? (v + 1) % t : v + 1,
  54430. C = (A + 1) % r,
  54431. I = M[v][A],
  54432. E = M[y][A],
  54433. b = M[y][C],
  54434. w = M[v][C],
  54435. _ = new n.Vector2(v / t,A / r),
  54436. T = new n.Vector2((v + 1) / t,A / r),
  54437. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  54438. S = new n.Vector2(v / t,(A + 1) / r),
  54439. this.faces.push(new n.Face3(I,E,w)),
  54440. this.faceVertexUvs[0].push([_, T, S]),
  54441. this.faces.push(new n.Face3(E,b,w)),
  54442. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  54443. this.computeFaceNormals(),
  54444. this.computeVertexNormals()
  54445. }
  54446. ,
  54447. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  54448. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  54449. n.TubeGeometry.NoTaper = function(e) {
  54450. return 1
  54451. }
  54452. ,
  54453. n.TubeGeometry.SinusoidalTaper = function(e) {
  54454. return Math.sin(Math.PI * e)
  54455. }
  54456. ,
  54457. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  54458. function r() {
  54459. f[0] = new n.Vector3,
  54460. g[0] = new n.Vector3,
  54461. a = Number.MAX_VALUE,
  54462. s = Math.abs(p[0].x),
  54463. l = Math.abs(p[0].y),
  54464. c = Math.abs(p[0].z),
  54465. s <= a && (a = s,
  54466. d.set(1, 0, 0)),
  54467. l <= a && (a = l,
  54468. d.set(0, 1, 0)),
  54469. c <= a && d.set(0, 0, 1),
  54470. m.crossVectors(p[0], d).normalize(),
  54471. f[0].crossVectors(p[0], m),
  54472. g[0].crossVectors(p[0], f[0])
  54473. }
  54474. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  54475. for (this.tangents = p,
  54476. this.normals = f,
  54477. this.binormals = g,
  54478. h = 0; h < A; h++)
  54479. u = h / (A - 1),
  54480. p[h] = e.getTangentAt(u),
  54481. p[h].normalize();
  54482. for (r(),
  54483. h = 1; h < A; h++)
  54484. f[h] = f[h - 1].clone(),
  54485. g[h] = g[h - 1].clone(),
  54486. m.crossVectors(p[h - 1], p[h]),
  54487. m.length() > Number.EPSILON && (m.normalize(),
  54488. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  54489. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  54490. g[h].crossVectors(p[h], f[h]);
  54491. if (i)
  54492. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  54493. o /= A - 1,
  54494. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  54495. h = 1; h < A; h++)
  54496. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  54497. g[h].crossVectors(p[h], f[h])
  54498. }
  54499. ,
  54500. n.PolyhedronGeometry = function(e, t, i, r) {
  54501. function o(e) {
  54502. var t = e.normalize().clone();
  54503. t.index = u.vertices.push(t) - 1;
  54504. var i = l(e) / 2 / Math.PI + .5
  54505. , r = c(e) / Math.PI + .5;
  54506. return t.uv = new n.Vector2(i,1 - r),
  54507. t
  54508. }
  54509. function a(e, t, i, r) {
  54510. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  54511. u.faces.push(o),
  54512. C.copy(e).add(t).add(i).divideScalar(3);
  54513. var a = l(C);
  54514. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  54515. }
  54516. function s(e, t) {
  54517. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  54518. l[h] = [];
  54519. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++)
  54520. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  54521. }
  54522. for (var h = 0; h < i; h++)
  54523. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  54524. var m = Math.floor(g / 2);
  54525. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  54526. }
  54527. }
  54528. function l(e) {
  54529. return Math.atan2(e.z, -e.x)
  54530. }
  54531. function c(e) {
  54532. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54533. }
  54534. function h(e, t, i) {
  54535. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  54536. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  54537. e.clone()
  54538. }
  54539. n.Geometry.call(this),
  54540. this.type = "PolyhedronGeometry",
  54541. this.parameters = {
  54542. vertices: e,
  54543. indices: t,
  54544. radius: i,
  54545. detail: r
  54546. },
  54547. i = i || 1,
  54548. r = r || 0;
  54549. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  54550. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  54551. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  54552. m++) {
  54553. var v = f[t[d]]
  54554. , A = f[t[d + 1]]
  54555. , y = f[t[d + 2]];
  54556. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  54557. }
  54558. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  54559. s(g[d], r);
  54560. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  54561. var I = this.faceVertexUvs[0][d]
  54562. , E = I[0].x
  54563. , b = I[1].x
  54564. , w = I[2].x
  54565. , _ = Math.max(E, b, w)
  54566. , T = Math.min(E, b, w);
  54567. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  54568. b < .2 && (I[1].x += 1),
  54569. w < .2 && (I[2].x += 1))
  54570. }
  54571. for (var d = 0, p = this.vertices.length; d < p; d++)
  54572. this.vertices[d].multiplyScalar(i);
  54573. this.mergeVertices(),
  54574. this.computeFaceNormals(),
  54575. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  54576. }
  54577. ,
  54578. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  54579. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  54580. n.DodecahedronGeometry = function(e, t) {
  54581. var i = (1 + Math.sqrt(5)) / 2
  54582. , r = 1 / i
  54583. , o = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  54584. , a = [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9];
  54585. n.PolyhedronGeometry.call(this, o, a, e, t),
  54586. this.type = "DodecahedronGeometry",
  54587. this.parameters = {
  54588. radius: e,
  54589. detail: t
  54590. }
  54591. }
  54592. ,
  54593. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54594. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  54595. n.IcosahedronGeometry = function(e, t) {
  54596. var i = (1 + Math.sqrt(5)) / 2
  54597. , r = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1]
  54598. , o = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1];
  54599. n.PolyhedronGeometry.call(this, r, o, e, t),
  54600. this.type = "IcosahedronGeometry",
  54601. this.parameters = {
  54602. radius: e,
  54603. detail: t
  54604. }
  54605. }
  54606. ,
  54607. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54608. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  54609. n.OctahedronGeometry = function(e, t) {
  54610. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  54611. , r = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];
  54612. n.PolyhedronGeometry.call(this, i, r, e, t),
  54613. this.type = "OctahedronGeometry",
  54614. this.parameters = {
  54615. radius: e,
  54616. detail: t
  54617. }
  54618. }
  54619. ,
  54620. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54621. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  54622. n.TetrahedronGeometry = function(e, t) {
  54623. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  54624. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  54625. n.PolyhedronGeometry.call(this, i, r, e, t),
  54626. this.type = "TetrahedronGeometry",
  54627. this.parameters = {
  54628. radius: e,
  54629. detail: t
  54630. }
  54631. }
  54632. ,
  54633. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54634. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  54635. n.ParametricGeometry = function(e, t, i) {
  54636. n.Geometry.call(this),
  54637. this.type = "ParametricGeometry",
  54638. this.parameters = {
  54639. func: e,
  54640. slices: t,
  54641. stacks: i
  54642. };
  54643. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  54644. for (r = 0; r <= i; r++)
  54645. for (l = r / i,
  54646. o = 0; o <= t; o++)
  54647. s = o / t,
  54648. a = e(s, l),
  54649. c.push(a);
  54650. var p, f, g, m, v, A, y, C;
  54651. for (r = 0; r < i; r++)
  54652. for (o = 0; o < t; o++)
  54653. p = r * d + o,
  54654. f = r * d + o + 1,
  54655. g = (r + 1) * d + o + 1,
  54656. m = (r + 1) * d + o,
  54657. v = new n.Vector2(o / t,r / i),
  54658. A = new n.Vector2((o + 1) / t,r / i),
  54659. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  54660. C = new n.Vector2(o / t,(r + 1) / i),
  54661. h.push(new n.Face3(p,f,m)),
  54662. u.push([v, A, C]),
  54663. h.push(new n.Face3(f,g,m)),
  54664. u.push([A.clone(), y, C.clone()]);
  54665. this.computeFaceNormals(),
  54666. this.computeVertexNormals()
  54667. }
  54668. ,
  54669. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  54670. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  54671. n.WireframeGeometry = function(e) {
  54672. function t(e, t) {
  54673. return e - t
  54674. }
  54675. n.BufferGeometry.call(this);
  54676. var i = [0, 0]
  54677. , r = {}
  54678. , o = ["a", "b", "c"];
  54679. if (e instanceof n.Geometry) {
  54680. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  54681. for (var d = s[h], p = 0; p < 3; p++) {
  54682. i[0] = d[o[p]],
  54683. i[1] = d[o[(p + 1) % 3]],
  54684. i.sort(t);
  54685. var f = i.toString();
  54686. void 0 === r[f] && (c[2 * l] = i[0],
  54687. c[2 * l + 1] = i[1],
  54688. r[f] = !0,
  54689. l++)
  54690. }
  54691. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  54692. for (var p = 0; p < 2; p++) {
  54693. var m = a[c[2 * h + p]]
  54694. , v = 6 * h + 3 * p;
  54695. g[v + 0] = m.x,
  54696. g[v + 1] = m.y,
  54697. g[v + 2] = m.z
  54698. }
  54699. this.addAttribute("position", new n.BufferAttribute(g,3))
  54700. } else if (e instanceof n.BufferGeometry)
  54701. if (null !== e.index) {
  54702. var A = e.index.array
  54703. , a = e.attributes.position
  54704. , y = e.groups
  54705. , l = 0;
  54706. 0 === y.length && e.addGroup(0, A.length);
  54707. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  54708. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  54709. for (var p = 0; p < 3; p++) {
  54710. i[0] = A[h + p],
  54711. i[1] = A[h + (p + 1) % 3],
  54712. i.sort(t);
  54713. var f = i.toString();
  54714. void 0 === r[f] && (c[2 * l] = i[0],
  54715. c[2 * l + 1] = i[1],
  54716. r[f] = !0,
  54717. l++)
  54718. }
  54719. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  54720. for (var p = 0; p < 2; p++) {
  54721. var v = 6 * h + 3 * p
  54722. , T = c[2 * h + p];
  54723. g[v + 0] = a.getX(T),
  54724. g[v + 1] = a.getY(T),
  54725. g[v + 2] = a.getZ(T)
  54726. }
  54727. this.addAttribute("position", new n.BufferAttribute(g,3))
  54728. } else {
  54729. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  54730. for (var p = 0; p < 3; p++) {
  54731. var v = 18 * h + 6 * p
  54732. , S = 9 * h + 3 * p;
  54733. g[v + 0] = a[S],
  54734. g[v + 1] = a[S + 1],
  54735. g[v + 2] = a[S + 2];
  54736. var T = 9 * h + 3 * ((p + 1) % 3);
  54737. g[v + 3] = a[T],
  54738. g[v + 4] = a[T + 1],
  54739. g[v + 5] = a[T + 2]
  54740. }
  54741. this.addAttribute("position", new n.BufferAttribute(g,3))
  54742. }
  54743. }
  54744. ,
  54745. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54746. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  54747. n.AxisHelper = function(e) {
  54748. e = e || 1;
  54749. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54750. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54751. , r = new n.BufferGeometry;
  54752. r.addAttribute("position", new n.BufferAttribute(t,3)),
  54753. r.addAttribute("color", new n.BufferAttribute(i,3));
  54754. var o = new n.LineBasicMaterial({
  54755. vertexColors: n.VertexColors
  54756. });
  54757. n.LineSegments.call(this, r, o)
  54758. }
  54759. ,
  54760. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  54761. n.AxisHelper.prototype.constructor = n.AxisHelper,
  54762. n.ArrowHelper = function() {
  54763. var e = new n.Geometry;
  54764. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  54765. var t = new n.CylinderGeometry(0,.5,1,5,1);
  54766. return t.translate(0, -.5, 0),
  54767. function(i, r, o, a, s, l) {
  54768. n.Object3D.call(this),
  54769. void 0 === a && (a = 16776960),
  54770. void 0 === o && (o = 1),
  54771. void 0 === s && (s = .2 * o),
  54772. void 0 === l && (l = .2 * s),
  54773. this.position.copy(r),
  54774. this.line = new n.Line(e,new n.LineBasicMaterial({
  54775. color: a
  54776. })),
  54777. this.line.matrixAutoUpdate = !1,
  54778. this.add(this.line),
  54779. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  54780. color: a
  54781. })),
  54782. this.cone.matrixAutoUpdate = !1,
  54783. this.add(this.cone),
  54784. this.setDirection(i),
  54785. this.setLength(o, s, l)
  54786. }
  54787. }(),
  54788. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  54789. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  54790. n.ArrowHelper.prototype.setDirection = function() {
  54791. var e, t = new n.Vector3;
  54792. return function(i) {
  54793. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  54794. e = Math.acos(i.y),
  54795. this.quaternion.setFromAxisAngle(t, e))
  54796. }
  54797. }(),
  54798. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  54799. void 0 === t && (t = .2 * e),
  54800. void 0 === i && (i = .2 * t),
  54801. this.line.scale.set(1, Math.max(0, e - t), 1),
  54802. this.line.updateMatrix(),
  54803. this.cone.scale.set(i, t, i),
  54804. this.cone.position.y = e,
  54805. this.cone.updateMatrix()
  54806. }
  54807. ,
  54808. n.ArrowHelper.prototype.setColor = function(e) {
  54809. this.line.material.color.set(e),
  54810. this.cone.material.color.set(e)
  54811. }
  54812. ,
  54813. n.BoxHelper = function(e) {
  54814. 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])
  54815. , i = new Float32Array(24)
  54816. , r = new n.BufferGeometry;
  54817. r.setIndex(new n.BufferAttribute(t,1)),
  54818. r.addAttribute("position", new n.BufferAttribute(i,3)),
  54819. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  54820. color: 16776960
  54821. })),
  54822. void 0 !== e && this.update(e)
  54823. }
  54824. ,
  54825. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  54826. n.BoxHelper.prototype.constructor = n.BoxHelper,
  54827. n.BoxHelper.prototype.update = function() {
  54828. var e = new n.Box3;
  54829. return function(t) {
  54830. if (e.setFromObject(t),
  54831. !e.isEmpty()) {
  54832. var i = e.min
  54833. , n = e.max
  54834. , r = this.geometry.attributes.position
  54835. , o = r.array;
  54836. o[0] = n.x,
  54837. o[1] = n.y,
  54838. o[2] = n.z,
  54839. o[3] = i.x,
  54840. o[4] = n.y,
  54841. o[5] = n.z,
  54842. o[6] = i.x,
  54843. o[7] = i.y,
  54844. o[8] = n.z,
  54845. o[9] = n.x,
  54846. o[10] = i.y,
  54847. o[11] = n.z,
  54848. o[12] = n.x,
  54849. o[13] = n.y,
  54850. o[14] = i.z,
  54851. o[15] = i.x,
  54852. o[16] = n.y,
  54853. o[17] = i.z,
  54854. o[18] = i.x,
  54855. o[19] = i.y,
  54856. o[20] = i.z,
  54857. o[21] = n.x,
  54858. o[22] = i.y,
  54859. o[23] = i.z,
  54860. r.needsUpdate = !0,
  54861. this.geometry.computeBoundingSphere()
  54862. }
  54863. }
  54864. }(),
  54865. n.BoundingBoxHelper = function(e, t) {
  54866. var i = void 0 !== t ? t : 8947848;
  54867. this.object = e,
  54868. this.box = new n.Box3,
  54869. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  54870. color: i,
  54871. wireframe: !0
  54872. }))
  54873. }
  54874. ,
  54875. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  54876. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  54877. n.BoundingBoxHelper.prototype.update = function() {
  54878. this.box.setFromObject(this.object),
  54879. this.box.size(this.scale),
  54880. this.box.center(this.position)
  54881. }
  54882. ,
  54883. n.CameraHelper = function(e) {
  54884. function t(e, t, n) {
  54885. i(e, n),
  54886. i(t, n)
  54887. }
  54888. function i(e, t) {
  54889. r.vertices.push(new n.Vector3),
  54890. r.colors.push(new n.Color(t)),
  54891. void 0 === a[e] && (a[e] = []),
  54892. a[e].push(r.vertices.length - 1)
  54893. }
  54894. var r = new n.Geometry
  54895. , o = new n.LineBasicMaterial({
  54896. color: 16777215,
  54897. vertexColors: n.FaceColors
  54898. })
  54899. , a = {}
  54900. , s = 16755200
  54901. , l = 16711680
  54902. , c = 43775
  54903. , h = 16777215
  54904. , u = 3355443;
  54905. t("n1", "n2", s),
  54906. t("n2", "n4", s),
  54907. t("n4", "n3", s),
  54908. t("n3", "n1", s),
  54909. t("f1", "f2", s),
  54910. t("f2", "f4", s),
  54911. t("f4", "f3", s),
  54912. t("f3", "f1", s),
  54913. t("n1", "f1", s),
  54914. t("n2", "f2", s),
  54915. t("n3", "f3", s),
  54916. t("n4", "f4", s),
  54917. t("p", "n1", l),
  54918. t("p", "n2", l),
  54919. t("p", "n3", l),
  54920. t("p", "n4", l),
  54921. t("u1", "u2", c),
  54922. t("u2", "u3", c),
  54923. t("u3", "u1", c),
  54924. t("c", "t", h),
  54925. t("p", "c", u),
  54926. t("cn1", "cn2", u),
  54927. t("cn3", "cn4", u),
  54928. t("cf1", "cf2", u),
  54929. t("cf3", "cf4", u),
  54930. n.LineSegments.call(this, r, o),
  54931. this.camera = e,
  54932. this.camera.updateProjectionMatrix(),
  54933. this.matrix = e.matrixWorld,
  54934. this.matrixAutoUpdate = !1,
  54935. this.pointMap = a,
  54936. this.update()
  54937. }
  54938. ,
  54939. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  54940. n.CameraHelper.prototype.constructor = n.CameraHelper,
  54941. n.CameraHelper.prototype.update = function() {
  54942. function e(e, n, a, s) {
  54943. r.set(n, a, s).unproject(o);
  54944. var l = i[e];
  54945. if (void 0 !== l)
  54946. for (var c = 0, h = l.length; c < h; c++)
  54947. t.vertices[l[c]].copy(r)
  54948. }
  54949. var t, i, r = new n.Vector3, o = new n.Camera;
  54950. return function() {
  54951. t = this.geometry,
  54952. i = this.pointMap;
  54953. var n = 1
  54954. , r = 1;
  54955. o.projectionMatrix.copy(this.camera.projectionMatrix),
  54956. e("c", 0, 0, -1),
  54957. e("t", 0, 0, 1),
  54958. e("n1", -n, -r, -1),
  54959. e("n2", n, -r, -1),
  54960. e("n3", -n, r, -1),
  54961. e("n4", n, r, -1),
  54962. e("f1", -n, -r, 1),
  54963. e("f2", n, -r, 1),
  54964. e("f3", -n, r, 1),
  54965. e("f4", n, r, 1),
  54966. e("u1", .7 * n, 1.1 * r, -1),
  54967. e("u2", .7 * -n, 1.1 * r, -1),
  54968. e("u3", 0, 2 * r, -1),
  54969. e("cf1", -n, 0, 1),
  54970. e("cf2", n, 0, 1),
  54971. e("cf3", 0, -r, 1),
  54972. e("cf4", 0, r, 1),
  54973. e("cn1", -n, 0, -1),
  54974. e("cn2", n, 0, -1),
  54975. e("cn3", 0, -r, -1),
  54976. e("cn4", 0, r, -1),
  54977. t.verticesNeedUpdate = !0
  54978. }
  54979. }(),
  54980. n.DirectionalLightHelper = function(e, t) {
  54981. n.Object3D.call(this),
  54982. this.light = e,
  54983. this.light.updateMatrixWorld(),
  54984. this.matrix = e.matrixWorld,
  54985. this.matrixAutoUpdate = !1,
  54986. t = t || 1;
  54987. var i = new n.Geometry;
  54988. i.vertices.push(new n.Vector3(-t,t,0), new n.Vector3(t,t,0), new n.Vector3(t,-t,0), new n.Vector3(-t,-t,0), new n.Vector3(-t,t,0));
  54989. var r = new n.LineBasicMaterial({
  54990. fog: !1
  54991. });
  54992. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54993. this.lightPlane = new n.Line(i,r),
  54994. this.add(this.lightPlane),
  54995. i = new n.Geometry,
  54996. i.vertices.push(new n.Vector3, new n.Vector3),
  54997. r = new n.LineBasicMaterial({
  54998. fog: !1
  54999. }),
  55000. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55001. this.targetLine = new n.Line(i,r),
  55002. this.add(this.targetLine),
  55003. this.update()
  55004. }
  55005. ,
  55006. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  55007. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  55008. n.DirectionalLightHelper.prototype.dispose = function() {
  55009. this.lightPlane.geometry.dispose(),
  55010. this.lightPlane.material.dispose(),
  55011. this.targetLine.geometry.dispose(),
  55012. this.targetLine.material.dispose()
  55013. }
  55014. ,
  55015. n.DirectionalLightHelper.prototype.update = function() {
  55016. var e = new n.Vector3
  55017. , t = new n.Vector3
  55018. , i = new n.Vector3;
  55019. return function() {
  55020. e.setFromMatrixPosition(this.light.matrixWorld),
  55021. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55022. i.subVectors(t, e),
  55023. this.lightPlane.lookAt(i),
  55024. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55025. this.targetLine.geometry.vertices[1].copy(i),
  55026. this.targetLine.geometry.verticesNeedUpdate = !0,
  55027. this.targetLine.material.color.copy(this.lightPlane.material.color)
  55028. }
  55029. }(),
  55030. n.EdgesHelper = function(e, t, i) {
  55031. var r = void 0 !== t ? t : 16777215;
  55032. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  55033. color: r
  55034. })),
  55035. this.matrix = e.matrixWorld,
  55036. this.matrixAutoUpdate = !1
  55037. }
  55038. ,
  55039. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  55040. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  55041. n.FaceNormalsHelper = function(e, t, i, r) {
  55042. this.object = e,
  55043. this.size = void 0 !== t ? t : 1;
  55044. var o = void 0 !== i ? i : 16776960
  55045. , a = void 0 !== r ? r : 1
  55046. , s = 0
  55047. , l = this.object.geometry;
  55048. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55049. var c = new n.BufferGeometry
  55050. , h = new n.Float32Attribute(2 * s * 3,3);
  55051. c.addAttribute("position", h),
  55052. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55053. color: o,
  55054. linewidth: a
  55055. })),
  55056. this.matrixAutoUpdate = !1,
  55057. this.update()
  55058. }
  55059. ,
  55060. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55061. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  55062. n.FaceNormalsHelper.prototype.update = function() {
  55063. var e = new n.Vector3
  55064. , t = new n.Vector3
  55065. , i = new n.Matrix3;
  55066. return function() {
  55067. this.object.updateMatrixWorld(!0),
  55068. i.getNormalMatrix(this.object.matrixWorld);
  55069. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  55070. var u = s[c]
  55071. , d = u.normal;
  55072. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  55073. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55074. r.setXYZ(l, e.x, e.y, e.z),
  55075. l += 1,
  55076. r.setXYZ(l, t.x, t.y, t.z),
  55077. l += 1
  55078. }
  55079. return r.needsUpdate = !0,
  55080. this
  55081. }
  55082. }(),
  55083. n.GridHelper = function(e, t) {
  55084. var i = new n.Geometry
  55085. , r = new n.LineBasicMaterial({
  55086. vertexColors: n.VertexColors
  55087. });
  55088. this.color1 = new n.Color(4473924),
  55089. this.color2 = new n.Color(8947848);
  55090. for (var o = -e; o <= e; o += t) {
  55091. i.vertices.push(new n.Vector3(-e,0,o), new n.Vector3(e,0,o), new n.Vector3(o,0,-e), new n.Vector3(o,0,e));
  55092. var a = 0 === o ? this.color1 : this.color2;
  55093. i.colors.push(a, a, a, a)
  55094. }
  55095. n.LineSegments.call(this, i, r)
  55096. }
  55097. ,
  55098. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  55099. n.GridHelper.prototype.constructor = n.GridHelper,
  55100. n.GridHelper.prototype.setColors = function(e, t) {
  55101. this.color1.set(e),
  55102. this.color2.set(t),
  55103. this.geometry.colorsNeedUpdate = !0
  55104. }
  55105. ,
  55106. n.HemisphereLightHelper = function(e, t) {
  55107. n.Object3D.call(this),
  55108. this.light = e,
  55109. this.light.updateMatrixWorld(),
  55110. this.matrix = e.matrixWorld,
  55111. this.matrixAutoUpdate = !1,
  55112. this.colors = [new n.Color, new n.Color];
  55113. var i = new n.SphereGeometry(t,4,2);
  55114. i.rotateX(-Math.PI / 2);
  55115. for (var r = 0, o = 8; r < o; r++)
  55116. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  55117. var a = new n.MeshBasicMaterial({
  55118. vertexColors: n.FaceColors,
  55119. wireframe: !0
  55120. });
  55121. this.lightSphere = new n.Mesh(i,a),
  55122. this.add(this.lightSphere),
  55123. this.update()
  55124. }
  55125. ,
  55126. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  55127. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  55128. n.HemisphereLightHelper.prototype.dispose = function() {
  55129. this.lightSphere.geometry.dispose(),
  55130. this.lightSphere.material.dispose()
  55131. }
  55132. ,
  55133. n.HemisphereLightHelper.prototype.update = function() {
  55134. var e = new n.Vector3;
  55135. return function() {
  55136. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55137. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55138. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55139. this.lightSphere.geometry.colorsNeedUpdate = !0
  55140. }
  55141. }(),
  55142. n.PointLightHelper = function(e, t) {
  55143. this.light = e,
  55144. this.light.updateMatrixWorld();
  55145. var i = new n.SphereGeometry(t,4,2)
  55146. , r = new n.MeshBasicMaterial({
  55147. wireframe: !0,
  55148. fog: !1
  55149. });
  55150. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55151. n.Mesh.call(this, i, r),
  55152. this.matrix = this.light.matrixWorld,
  55153. this.matrixAutoUpdate = !1
  55154. }
  55155. ,
  55156. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  55157. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  55158. n.PointLightHelper.prototype.dispose = function() {
  55159. this.geometry.dispose(),
  55160. this.material.dispose()
  55161. }
  55162. ,
  55163. n.PointLightHelper.prototype.update = function() {
  55164. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55165. }
  55166. ,
  55167. n.SkeletonHelper = function(e) {
  55168. this.bones = this.getBoneList(e);
  55169. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  55170. var r = this.bones[i];
  55171. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  55172. t.vertices.push(new n.Vector3),
  55173. t.colors.push(new n.Color(0,0,1)),
  55174. t.colors.push(new n.Color(0,1,0)))
  55175. }
  55176. t.dynamic = !0;
  55177. var o = new n.LineBasicMaterial({
  55178. vertexColors: n.VertexColors,
  55179. depthTest: !1,
  55180. depthWrite: !1,
  55181. transparent: !0
  55182. });
  55183. n.LineSegments.call(this, t, o),
  55184. this.root = e,
  55185. this.matrix = e.matrixWorld,
  55186. this.matrixAutoUpdate = !1,
  55187. this.update()
  55188. }
  55189. ,
  55190. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  55191. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  55192. n.SkeletonHelper.prototype.getBoneList = function(e) {
  55193. var t = [];
  55194. e instanceof n.Bone && t.push(e);
  55195. for (var i = 0; i < e.children.length; i++)
  55196. t.push.apply(t, this.getBoneList(e.children[i]));
  55197. return t
  55198. }
  55199. ,
  55200. n.SkeletonHelper.prototype.update = function() {
  55201. for (var e = this.geometry, t = (new n.Matrix4).getInverse(this.root.matrixWorld), i = new n.Matrix4, r = 0, o = 0; o < this.bones.length; o++) {
  55202. var a = this.bones[o];
  55203. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  55204. e.vertices[r].setFromMatrixPosition(i),
  55205. i.multiplyMatrices(t, a.parent.matrixWorld),
  55206. e.vertices[r + 1].setFromMatrixPosition(i),
  55207. r += 2)
  55208. }
  55209. e.verticesNeedUpdate = !0,
  55210. e.computeBoundingSphere()
  55211. }
  55212. ,
  55213. n.SpotLightHelper = function(e) {
  55214. n.Object3D.call(this),
  55215. this.light = e,
  55216. this.light.updateMatrixWorld(),
  55217. this.matrix = e.matrixWorld,
  55218. this.matrixAutoUpdate = !1;
  55219. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  55220. t.translate(0, -.5, 0),
  55221. t.rotateX(-Math.PI / 2);
  55222. var i = new n.MeshBasicMaterial({
  55223. wireframe: !0,
  55224. fog: !1
  55225. });
  55226. this.cone = new n.Mesh(t,i),
  55227. this.add(this.cone),
  55228. this.update()
  55229. }
  55230. ,
  55231. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  55232. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  55233. n.SpotLightHelper.prototype.dispose = function() {
  55234. this.cone.geometry.dispose(),
  55235. this.cone.material.dispose()
  55236. }
  55237. ,
  55238. n.SpotLightHelper.prototype.update = function() {
  55239. var e = new n.Vector3
  55240. , t = new n.Vector3;
  55241. return function() {
  55242. var i = this.light.distance ? this.light.distance : 1e4
  55243. , n = i * Math.tan(this.light.angle);
  55244. this.cone.scale.set(n, n, i),
  55245. e.setFromMatrixPosition(this.light.matrixWorld),
  55246. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55247. this.cone.lookAt(t.sub(e)),
  55248. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55249. }
  55250. }(),
  55251. n.VertexNormalsHelper = function(e, t, i, r) {
  55252. this.object = e,
  55253. this.size = void 0 !== t ? t : 1;
  55254. var o = void 0 !== i ? i : 16711680
  55255. , a = void 0 !== r ? r : 1
  55256. , s = 0
  55257. , l = this.object.geometry;
  55258. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  55259. var c = new n.BufferGeometry
  55260. , h = new n.Float32Attribute(2 * s * 3,3);
  55261. c.addAttribute("position", h),
  55262. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55263. color: o,
  55264. linewidth: a
  55265. })),
  55266. this.matrixAutoUpdate = !1,
  55267. this.update()
  55268. }
  55269. ,
  55270. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55271. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  55272. n.VertexNormalsHelper.prototype.update = function() {
  55273. var e = new n.Vector3
  55274. , t = new n.Vector3
  55275. , i = new n.Matrix3;
  55276. return function() {
  55277. var r = ["a", "b", "c"];
  55278. this.object.updateMatrixWorld(!0),
  55279. i.getNormalMatrix(this.object.matrixWorld);
  55280. var o = this.object.matrixWorld
  55281. , a = this.geometry.attributes.position
  55282. , s = this.object.geometry;
  55283. if (s instanceof n.Geometry)
  55284. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  55285. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  55286. var m = l[p[r[f]]]
  55287. , v = p.vertexNormals[f];
  55288. e.copy(m).applyMatrix4(o),
  55289. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55290. a.setXYZ(h, e.x, e.y, e.z),
  55291. h += 1,
  55292. a.setXYZ(h, t.x, t.y, t.z),
  55293. h += 1
  55294. }
  55295. else if (s instanceof n.BufferGeometry)
  55296. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  55297. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  55298. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  55299. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55300. a.setXYZ(h, e.x, e.y, e.z),
  55301. h += 1,
  55302. a.setXYZ(h, t.x, t.y, t.z),
  55303. h += 1;
  55304. return a.needsUpdate = !0,
  55305. this
  55306. }
  55307. }(),
  55308. n.WireframeHelper = function(e, t) {
  55309. var i = void 0 !== t ? t : 16777215;
  55310. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  55311. color: i
  55312. })),
  55313. this.matrix = e.matrixWorld,
  55314. this.matrixAutoUpdate = !1
  55315. }
  55316. ,
  55317. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  55318. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  55319. n.ImmediateRenderObject = function(e) {
  55320. n.Object3D.call(this),
  55321. this.material = e,
  55322. this.render = function(e) {}
  55323. }
  55324. ,
  55325. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  55326. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  55327. n.MorphBlendMesh = function(e, t) {
  55328. n.Mesh.call(this, e, t),
  55329. this.animationsMap = {},
  55330. this.animationsList = [];
  55331. var i = this.geometry.morphTargets.length
  55332. , r = "__default"
  55333. , o = 0
  55334. , a = i - 1
  55335. , s = i / 1;
  55336. this.createAnimation(r, o, a, s),
  55337. this.setAnimationWeight(r, 1)
  55338. }
  55339. ,
  55340. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  55341. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  55342. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55343. var r = {
  55344. start: t,
  55345. end: i,
  55346. length: i - t + 1,
  55347. fps: n,
  55348. duration: (i - t) / n,
  55349. lastFrame: 0,
  55350. currentFrame: 0,
  55351. active: !1,
  55352. time: 0,
  55353. direction: 1,
  55354. weight: 1,
  55355. directionBackwards: !1,
  55356. mirroredLoop: !1
  55357. };
  55358. this.animationsMap[e] = r,
  55359. this.animationsList.push(r)
  55360. }
  55361. ,
  55362. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55363. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55364. var s = r.morphTargets[o]
  55365. , l = s.name.match(i);
  55366. if (l && l.length > 1) {
  55367. var c = l[1];
  55368. n[c] || (n[c] = {
  55369. start: 1 / 0,
  55370. end: -(1 / 0)
  55371. });
  55372. var h = n[c];
  55373. o < h.start && (h.start = o),
  55374. o > h.end && (h.end = o),
  55375. t || (t = c)
  55376. }
  55377. }
  55378. for (var c in n) {
  55379. var h = n[c];
  55380. this.createAnimation(c, h.start, h.end, e)
  55381. }
  55382. this.firstAnimation = t
  55383. }
  55384. ,
  55385. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55386. var t = this.animationsMap[e];
  55387. t && (t.direction = 1,
  55388. t.directionBackwards = !1)
  55389. }
  55390. ,
  55391. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55392. var t = this.animationsMap[e];
  55393. t && (t.direction = -1,
  55394. t.directionBackwards = !0)
  55395. }
  55396. ,
  55397. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55398. var i = this.animationsMap[e];
  55399. i && (i.fps = t,
  55400. i.duration = (i.end - i.start) / i.fps)
  55401. }
  55402. ,
  55403. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55404. var i = this.animationsMap[e];
  55405. i && (i.duration = t,
  55406. i.fps = (i.end - i.start) / i.duration)
  55407. }
  55408. ,
  55409. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55410. var i = this.animationsMap[e];
  55411. i && (i.weight = t)
  55412. }
  55413. ,
  55414. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55415. var i = this.animationsMap[e];
  55416. i && (i.time = t)
  55417. }
  55418. ,
  55419. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55420. var t = 0
  55421. , i = this.animationsMap[e];
  55422. return i && (t = i.time),
  55423. t
  55424. }
  55425. ,
  55426. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55427. var t = -1
  55428. , i = this.animationsMap[e];
  55429. return i && (t = i.duration),
  55430. t
  55431. }
  55432. ,
  55433. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  55434. var t = this.animationsMap[e];
  55435. t ? (t.time = 0,
  55436. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55437. }
  55438. ,
  55439. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55440. var t = this.animationsMap[e];
  55441. t && (t.active = !1)
  55442. }
  55443. ,
  55444. n.MorphBlendMesh.prototype.update = function(e) {
  55445. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55446. var r = this.animationsList[t];
  55447. if (r.active) {
  55448. var o = r.duration / r.length;
  55449. r.time += r.direction * e,
  55450. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  55451. r.time > r.duration && (r.time = r.duration,
  55452. r.directionBackwards = !0),
  55453. r.time < 0 && (r.time = 0,
  55454. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  55455. r.time < 0 && (r.time += r.duration));
  55456. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  55457. , s = r.weight;
  55458. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  55459. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  55460. this.morphTargetInfluences[a] = 0,
  55461. r.lastFrame = r.currentFrame,
  55462. r.currentFrame = a);
  55463. var l = r.time % o / o;
  55464. r.directionBackwards && (l = 1 - l),
  55465. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  55466. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  55467. }
  55468. }
  55469. }
  55470. ,
  55471. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  55472. i.THREE = n) : this.THREE = n
  55473. }
  55474. , {}]
  55475. }, {}, [116]);