mainEdit.js 2.6 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689
  1. /* 许钟文修改的 标记 xzw 有的加了”改“字
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. 几乎所有window.innerWidth、innerHeight都变成 $('#player').width()、 height() 原因:1编辑页面canvas显示区域非全屏 2为了放大显示时不会模糊
  4. */
  5. !function() {
  6. "use strict";
  7. function t(t, i) {
  8. return typeof t === i
  9. }
  10. function i(t, i) {
  11. return t instanceof i
  12. }
  13. function n(t) {
  14. return t && t.nodeType
  15. }
  16. function e(t) {
  17. return n(t) ? t : i(t, g) ? t[0] : void 0
  18. }
  19. function o(t, i, n) {
  20. return g.each(t, function(t, e) {
  21. n = i.call(e, n, t, e)
  22. }),
  23. n
  24. }
  25. function r(t, i, n) {
  26. var e, o, r;
  27. if (t === i)
  28. return !0;
  29. if (!t || !i || t.constructor !== i.constructor)
  30. return !1;
  31. for (e = 0,
  32. o = n.length; o > e; e += 1) {
  33. if (r = n[e],
  34. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  35. return !1;
  36. if (t[r] !== i[r])
  37. return !1
  38. }
  39. return !0
  40. }
  41. function s(t, i, n, e) {
  42. this.left = E(t),
  43. this.top = E(i),
  44. this.width = E(n),
  45. this.height = E(e),
  46. this.right = this.left + this.width,
  47. this.bottom = this.top + this.height
  48. }
  49. function h(t, i, n, e) {
  50. this.visible = t || 0,
  51. this.viewport = i || 0,
  52. this.possible = n || 0,
  53. this.rects = e && T({}, e) || null
  54. }
  55. function l(t, i) {
  56. this.els = t,
  57. this.viewport = i
  58. }
  59. function c(t, i, n) {
  60. var e;
  61. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  62. e ? e[n] : 0
  63. }
  64. function u(t, i) {
  65. return t.val - i.val
  66. }
  67. function a(t, i) {
  68. return i.val - t.val
  69. }
  70. function f(t) {
  71. var i = s.ofContent(t, !0)
  72. , n = s.ofViewport(t, !0)
  73. , e = i.width - n.width
  74. , o = i.height - n.height;
  75. this.content = i,
  76. this.viewport = n,
  77. this.width = 0 >= e ? null : n.left / e,
  78. this.height = 0 >= o ? null : n.top / o,
  79. this.left = n.left,
  80. this.top = n.top,
  81. this.right = i.right - n.right,
  82. this.bottom = i.bottom - n.bottom
  83. }
  84. function p(t) {
  85. this.el = t || window
  86. }
  87. function d(t, i) {
  88. this.context = t,
  89. this.viewport = i,
  90. this.init()
  91. }
  92. function v(t, i, n, e) {
  93. this.context = new l(t,i),
  94. this.property = n,
  95. this.descending = e,
  96. this.init()
  97. }
  98. function w(t) {
  99. t && t !== window && t !== document ? (this.context = t,
  100. this.$autoTarget = g(t)) : this.context = window,
  101. this.init()
  102. }
  103. var g = jQuery
  104. , m = g(window)
  105. , b = g(document)
  106. , T = g.extend
  107. , y = g.isFunction
  108. , k = Math.max
  109. , V = Math.min
  110. , E = Math.round
  111. , x = function() {
  112. var t = {}
  113. , i = 1;
  114. return function(n) {
  115. return n ? (t[n] || (t[n] = i,
  116. i += 1),
  117. t[n]) : 0
  118. }
  119. }();
  120. T(s.prototype, {
  121. equals: function(t) {
  122. return r(this, t, ["left", "top", "width", "height"])
  123. },
  124. area: function() {
  125. return this.width * this.height
  126. },
  127. relativeTo: function(t) {
  128. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  129. },
  130. intersection: function(t) {
  131. if (!i(t, s))
  132. return null;
  133. var n = k(this.left, t.left)
  134. , e = V(this.right, t.right)
  135. , o = k(this.top, t.top)
  136. , r = V(this.bottom, t.bottom)
  137. , h = e - n
  138. , l = r - o;
  139. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  140. },
  141. envelope: function(t) {
  142. if (!i(t, s))
  143. return this;
  144. var n = V(this.left, t.left)
  145. , e = k(this.right, t.right)
  146. , o = V(this.top, t.top)
  147. , r = k(this.bottom, t.bottom)
  148. , h = e - n
  149. , l = r - o;
  150. return new s(n,o,h,l)
  151. }
  152. }),
  153. T(s, {
  154. ofContent: function(t, i) {
  155. 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())
  156. },
  157. ofViewport: function(t, i) {
  158. 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())
  159. },
  160. ofElement: function(t) {
  161. var i = g(t);
  162. if (!i.is(":visible"))
  163. return null;
  164. var n = i.offset();
  165. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  166. }
  167. }),
  168. T(h.prototype, {
  169. equals: function(t) {
  170. return this.fracsEqual(t) && this.rectsEqual(t)
  171. },
  172. fracsEqual: function(t) {
  173. return r(this, t, ["visible", "viewport", "possible"])
  174. },
  175. rectsEqual: function(t) {
  176. return r(this.rects, t.rects, ["document", "element", "viewport"])
  177. }
  178. }),
  179. T(h, {
  180. of: function(t, i) {
  181. var e, o, r;
  182. return t = n(t) && s.ofElement(t) || t,
  183. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  184. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  185. r = V(t.width, i.width) * V(t.height, i.height),
  186. new h(o / t.area(),o / i.area(),o / r,{
  187. document: e,
  188. element: e.relativeTo(t),
  189. viewport: e.relativeTo(i)
  190. })) : new h
  191. }
  192. });
  193. var q = ["width", "height", "left", "right", "top", "bottom"]
  194. , S = ["possible", "visible", "viewport"];
  195. T(l.prototype, {
  196. sorted: function(t, i) {
  197. var n = this.viewport;
  198. return g.map(this.els, function(i) {
  199. return {
  200. el: i,
  201. val: c(i, n, t)
  202. }
  203. }).sort(i ? a : u)
  204. },
  205. best: function(t, i) {
  206. return this.els.length ? this.sorted(t, i)[0] : null
  207. }
  208. }),
  209. T(f.prototype, {
  210. equals: function(t) {
  211. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  212. }
  213. }),
  214. T(p.prototype, {
  215. equals: function(t) {
  216. return r(this, t, ["el"])
  217. },
  218. scrollState: function() {
  219. return new f(this.el)
  220. },
  221. scrollTo: function(t, i, n) {
  222. var e = g(this.el === window ? "html,body" : this.el);
  223. t = t || 0,
  224. i = i || 0,
  225. n = isNaN(n) ? 1e3 : n,
  226. e.stop(!0).animate({
  227. scrollLeft: t,
  228. scrollTop: i
  229. }, n)
  230. },
  231. scroll: function(t, i, n) {
  232. var e = this.el === window ? m : g(this.el);
  233. t = t || 0,
  234. i = i || 0,
  235. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  236. },
  237. scrollToRect: function(t, i, n, e) {
  238. i = i || 0,
  239. n = n || 0,
  240. this.scrollTo(t.left - i, t.top - n, e)
  241. },
  242. scrollToElement: function(t, i, n, e) {
  243. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  244. this.scrollToRect(o, i, n, e)
  245. }
  246. });
  247. var C = {
  248. init: function() {
  249. this.callbacks = g.Callbacks("memory unique"),
  250. this.currVal = null,
  251. this.prevVal = null,
  252. this.checkProxy = g.proxy(this.check, this),
  253. this.autoCheck()
  254. },
  255. bind: function(t) {
  256. this.callbacks.add(t)
  257. },
  258. unbind: function(t) {
  259. t ? this.callbacks.remove(t) : this.callbacks.empty()
  260. },
  261. trigger: function() {
  262. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  263. },
  264. check: function(t) {
  265. var i = this.updatedValue(t);
  266. return void 0 !== i && (this.prevVal = this.currVal,
  267. this.currVal = i,
  268. this.trigger(),
  269. !0)
  270. },
  271. $autoTarget: m,
  272. autoEvents: "load resize scroll",
  273. autoCheck: function(t) {
  274. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  275. }
  276. };
  277. T(d.prototype, C, {
  278. updatedValue: function() {
  279. var t = h.of(this.context, this.viewport);
  280. return this.currVal && this.currVal.equals(t) ? void 0 : t
  281. }
  282. }),
  283. T(v.prototype, C, {
  284. updatedValue: function() {
  285. var t = this.context.best(this.property, this.descending);
  286. return t && (t = t.val > 0 ? t.el : null,
  287. this.currVal !== t) ? t : void 0
  288. }
  289. }),
  290. T(w.prototype, C, {
  291. updatedValue: function() {
  292. var t = new f(this.context);
  293. return this.currVal && this.currVal.equals(t) ? void 0 : t
  294. }
  295. });
  296. var L = function(t, i) {
  297. var n = [].slice
  298. , e = jQuery
  299. , o = e.extend
  300. , r = e.isFunction
  301. , s = o({}, i)
  302. , h = function(i, n, o, s) {
  303. return o = r(o) ? o.apply(i, n) : o,
  304. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  305. }
  306. , l = function() {
  307. return h(this, n.call(arguments), s.defaultStatic, l)
  308. }
  309. , c = function(t) {
  310. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  311. }
  312. , u = function(t) {
  313. t && (o(l, t.statics),
  314. o(c, t.methods)),
  315. l.modplug = u
  316. };
  317. u.prev = {
  318. statics: e[t],
  319. methods: e.fn[t]
  320. },
  321. u(i),
  322. e[t] = l,
  323. e.fn[t] = c
  324. }
  325. , M = "fracs";
  326. L(M, {
  327. statics: {
  328. version: "0.15.0",
  329. Rect: s,
  330. Fractions: h,
  331. Group: l,
  332. ScrollState: f,
  333. Viewport: p,
  334. FracsCallbacks: d,
  335. GroupCallbacks: v,
  336. ScrollStateCallbacks: w,
  337. fracs: function(t, i) {
  338. return h.of(t, i)
  339. }
  340. },
  341. methods: {
  342. content: function(t) {
  343. return this.length ? s.ofContent(this[0], t) : null
  344. },
  345. envelope: function() {
  346. return o(this, function(t) {
  347. var i = s.ofElement(this);
  348. return t ? t.envelope(i) : i
  349. })
  350. },
  351. fracs: function(i, n, o) {
  352. t(i, "string") || (o = n,
  353. n = i,
  354. i = null),
  355. y(n) || (o = n,
  356. n = null),
  357. o = e(o);
  358. var r = M + ".fracs." + x(o);
  359. return "unbind" === i ? this.each(function() {
  360. var t = g(this).data(r);
  361. t && t.unbind(n)
  362. }) : "check" === i ? this.each(function() {
  363. var t = g(this).data(r);
  364. t && t.check()
  365. }) : y(n) ? this.each(function() {
  366. var t = g(this)
  367. , i = t.data(r);
  368. i || (i = new d(this,o),
  369. t.data(r, i)),
  370. i.bind(n)
  371. }) : this.length ? h.of(this[0], o) : null
  372. },
  373. intersection: function() {
  374. return o(this, function(t) {
  375. var i = s.ofElement(this);
  376. return t ? t.intersection(i) : i
  377. })
  378. },
  379. max: function(t, i, n) {
  380. return y(i) || (n = i,
  381. i = null),
  382. n = e(n),
  383. i ? (new v(this,n,t,!0).bind(i),
  384. this) : this.pushStack(new l(this,n).best(t, !0).el)
  385. },
  386. min: function(t, i, n) {
  387. return y(i) || (n = i,
  388. i = null),
  389. n = e(n),
  390. i ? (new v(this,n,t).bind(i),
  391. this) : this.pushStack(new l(this,n).best(t).el)
  392. },
  393. rect: function() {
  394. return this.length ? s.ofElement(this[0]) : null
  395. },
  396. scrollState: function(i, n) {
  397. var e = M + ".scrollState";
  398. return t(i, "string") || (n = i,
  399. i = null),
  400. "unbind" === i ? this.each(function() {
  401. var t = g(this).data(e);
  402. t && t.unbind(n)
  403. }) : "check" === i ? this.each(function() {
  404. var t = g(this).data(e);
  405. t && t.check()
  406. }) : y(n) ? this.each(function() {
  407. var t = g(this)
  408. , i = t.data(e);
  409. i || (i = new w(this),
  410. t.data(e, i)),
  411. i.bind(n)
  412. }) : this.length ? new f(this[0]) : null
  413. },
  414. scroll: function(t, i, n) {
  415. return this.each(function() {
  416. new p(this).scroll(t, i, n)
  417. })
  418. },
  419. scrollTo: function(t, i, n, o) {
  420. return g.isNumeric(t) && (o = n,
  421. n = i,
  422. i = t,
  423. t = null),
  424. t = e(t),
  425. this.each(function() {
  426. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  427. })
  428. },
  429. scrollToThis: function(t, i, n, o) {
  430. return o = new p(e(o)),
  431. o.scrollToElement(this[0], t, i, n),
  432. this
  433. },
  434. softLink: function(t, i, n, o) {
  435. return o = new p(e(o)),
  436. this.filter("a[href^=#]").each(function() {
  437. var e = g(this);
  438. e.on("click", function() {
  439. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  440. })
  441. })
  442. },
  443. sort: function(i, n, o) {
  444. return t(n, "boolean") || (o = n,
  445. n = null),
  446. o = e(o),
  447. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  448. return t.el
  449. }))
  450. },
  451. viewport: function(t) {
  452. return this.length ? s.ofViewport(this[0], t) : null
  453. }
  454. },
  455. defaultStatic: "fracs",
  456. defaultMethod: "fracs"
  457. })
  458. }();
  459. if ("undefined" == typeof jQuery)
  460. throw new Error("Bootstrap's JavaScript requires jQuery");
  461. +function(t) {
  462. "use strict";
  463. function e(e) {
  464. return this.each(function() {
  465. var o = t(this)
  466. , s = o.data("bs.tooltip")
  467. , n = "object" == typeof e && e;
  468. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  469. "string" == typeof e && s[e]())
  470. })
  471. }
  472. var i = function(t, e) {
  473. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  474. this.init("tooltip", t, e)
  475. };
  476. i.VERSION = "3.2.0",
  477. i.DEFAULTS = {
  478. animation: !0,
  479. placement: "top",
  480. selector: !1,
  481. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  482. trigger: "hover focus",
  483. title: "",
  484. delay: 0,
  485. html: !1,
  486. container: !1,
  487. viewport: {
  488. selector: "body",
  489. padding: 0
  490. }
  491. },
  492. i.prototype.init = function(e, i, o) {
  493. this.enabled = !0,
  494. this.type = e,
  495. this.$element = t(i),
  496. this.options = this.getOptions(o),
  497. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  498. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  499. var r = s[n];
  500. if ("click" == r)
  501. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  502. else if ("manual" != r) {
  503. var a = "hover" == r ? "mouseenter" : "focusin"
  504. , l = "hover" == r ? "mouseleave" : "focusout";
  505. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  506. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  507. }
  508. }
  509. this.options.selector ? this._options = t.extend({}, this.options, {
  510. trigger: "manual",
  511. selector: ""
  512. }) : this.fixTitle()
  513. }
  514. ,
  515. i.prototype.getDefaults = function() {
  516. return i.DEFAULTS
  517. }
  518. ,
  519. i.prototype.getOptions = function(e) {
  520. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  521. e.delay && "number" == typeof e.delay && (e.delay = {
  522. show: e.delay,
  523. hide: e.delay
  524. }),
  525. e
  526. }
  527. ,
  528. i.prototype.getDelegateOptions = function() {
  529. var e = {}
  530. , i = this.getDefaults();
  531. return this._options && t.each(this._options, function(t, o) {
  532. i[t] != o && (e[t] = o)
  533. }),
  534. e
  535. }
  536. ,
  537. i.prototype.enter = function(e) {
  538. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  539. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  540. t(e.currentTarget).data("bs." + this.type, i)),
  541. clearTimeout(i.timeout),
  542. i.hoverState = "in",
  543. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  544. "in" == i.hoverState && i.show()
  545. }, i.options.delay.show)) : i.show()
  546. }
  547. ,
  548. i.prototype.leave = function(e) {
  549. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  550. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  551. t(e.currentTarget).data("bs." + this.type, i)),
  552. clearTimeout(i.timeout),
  553. i.hoverState = "out",
  554. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  555. "out" == i.hoverState && i.hide()
  556. }, i.options.delay.hide)) : i.hide()
  557. }
  558. ,
  559. i.prototype.show = function() {
  560. var e = t.Event("show.bs." + this.type);
  561. if (this.hasContent() && this.enabled) {
  562. this.$element.trigger(e);
  563. var i = t.contains(document.documentElement, this.$element[0]);
  564. if (e.isDefaultPrevented() || !i)
  565. return;
  566. var o = this
  567. , s = this.tip()
  568. , n = this.getUID(this.type);
  569. this.setContent(),
  570. s.attr("id", n),
  571. this.$element.attr("aria-describedby", n),
  572. this.options.animation && s.addClass("fade");
  573. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  574. , a = /\s?auto?\s?/i
  575. , l = a.test(r);
  576. l && (r = r.replace(a, "") || "top"),
  577. s.detach().css({
  578. top: 0,
  579. left: 0,
  580. display: "block"
  581. }).addClass(r).data("bs." + this.type, this),
  582. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  583. var p = this.getPosition()
  584. , h = s[0].offsetWidth
  585. , f = s[0].offsetHeight;
  586. if (l) {
  587. var u = r
  588. , c = this.$element.parent()
  589. , d = this.getPosition(c);
  590. 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,
  591. s.removeClass(u).addClass(r)
  592. }
  593. var g = this.getCalculatedOffset(r, p, h, f);
  594. this.applyPlacement(g, r);
  595. var y = function() {
  596. o.$element.trigger("shown.bs." + o.type),
  597. o.hoverState = null
  598. };
  599. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  600. }
  601. }
  602. ,
  603. i.prototype.applyPlacement = function(e, i) {
  604. var o = this.tip()
  605. , s = o[0].offsetWidth
  606. , n = o[0].offsetHeight
  607. , r = parseInt(o.css("margin-top"), 10)
  608. , a = parseInt(o.css("margin-left"), 10);
  609. isNaN(r) && (r = 0),
  610. isNaN(a) && (a = 0),
  611. e.top = e.top + r,
  612. e.left = e.left + a,
  613. t.offset.setOffset(o[0], t.extend({
  614. using: function(t) {
  615. o.css({
  616. top: Math.round(t.top),
  617. left: Math.round(t.left)
  618. })
  619. }
  620. }, e), 0),
  621. o.addClass("in");
  622. var l = o[0].offsetWidth
  623. , p = o[0].offsetHeight;
  624. "top" == i && p != n && (e.top = e.top + n - p);
  625. var h = this.getViewportAdjustedDelta(i, e, l, p);
  626. h.left ? e.left += h.left : e.top += h.top;
  627. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  628. , u = h.left ? "left" : "top"
  629. , c = h.left ? "offsetWidth" : "offsetHeight";
  630. o.offset(e),
  631. this.replaceArrow(f, o[0][c], u)
  632. }
  633. ,
  634. i.prototype.replaceArrow = function(t, e, i) {
  635. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  636. }
  637. ,
  638. i.prototype.setContent = function() {
  639. var t = this.tip()
  640. , e = this.getTitle();
  641. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  642. t.removeClass("fade in top bottom left right")
  643. }
  644. ,
  645. i.prototype.hide = function() {
  646. function e() {
  647. "in" != i.hoverState && o.detach(),
  648. i.$element.trigger("hidden.bs." + i.type)
  649. }
  650. var i = this
  651. , o = this.tip()
  652. , s = t.Event("hide.bs." + this.type);
  653. if (this.$element.removeAttr("aria-describedby"),
  654. this.$element.trigger(s),
  655. !s.isDefaultPrevented())
  656. return o.removeClass("in"),
  657. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  658. this.hoverState = null,
  659. this
  660. }
  661. ,
  662. i.prototype.fixTitle = function() {
  663. var t = this.$element;
  664. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  665. }
  666. ,
  667. i.prototype.hasContent = function() {
  668. return this.getTitle()
  669. }
  670. ,
  671. i.prototype.getPosition = function(e) {
  672. e = e || this.$element;
  673. var i = e[0]
  674. , o = "BODY" == i.tagName;
  675. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  676. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  677. width: o ? t(window).width() : e.outerWidth(),
  678. height: o ? t(window).height() : e.outerHeight()
  679. }, o ? {
  680. top: 0,
  681. left: 0
  682. } : e.offset())
  683. }
  684. ,
  685. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  686. return "bottom" == t ? {
  687. top: e.top + e.height,
  688. left: e.left + e.width / 2 - i / 2
  689. } : "top" == t ? {
  690. top: e.top - o,
  691. left: e.left + e.width / 2 - i / 2
  692. } : "left" == t ? {
  693. top: e.top + e.height / 2 - o / 2,
  694. left: e.left - i
  695. } : {
  696. top: e.top + e.height / 2 - o / 2,
  697. left: e.left + e.width
  698. }
  699. }
  700. ,
  701. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  702. var s = {
  703. top: 0,
  704. left: 0
  705. };
  706. if (!this.$viewport)
  707. return s;
  708. var n = this.options.viewport && this.options.viewport.padding || 0
  709. , r = this.getPosition(this.$viewport);
  710. if (/right|left/.test(t)) {
  711. var a = e.top - n - r.scroll
  712. , l = e.top + n - r.scroll + o;
  713. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  714. } else {
  715. var p = e.left - n
  716. , h = e.left + n + i;
  717. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  718. }
  719. return s
  720. }
  721. ,
  722. i.prototype.getTitle = function() {
  723. var t, e = this.$element, i = this.options;
  724. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  725. }
  726. ,
  727. i.prototype.getUID = function(t) {
  728. do
  729. t += ~~(1e6 * Math.random());
  730. while (document.getElementById(t));return t
  731. }
  732. ,
  733. i.prototype.tip = function() {
  734. return this.$tip = this.$tip || t(this.options.template)
  735. }
  736. ,
  737. i.prototype.arrow = function() {
  738. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  739. }
  740. ,
  741. i.prototype.validate = function() {
  742. this.$element[0].parentNode || (this.hide(),
  743. this.$element = null,
  744. this.options = null)
  745. }
  746. ,
  747. i.prototype.enable = function() {
  748. this.enabled = !0
  749. }
  750. ,
  751. i.prototype.disable = function() {
  752. this.enabled = !1
  753. }
  754. ,
  755. i.prototype.toggleEnabled = function() {
  756. this.enabled = !this.enabled
  757. }
  758. ,
  759. i.prototype.toggle = function(e) {
  760. var i = this;
  761. e && (i = t(e.currentTarget).data("bs." + this.type),
  762. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  763. t(e.currentTarget).data("bs." + this.type, i))),
  764. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  765. }
  766. ,
  767. i.prototype.destroy = function() {
  768. clearTimeout(this.timeout),
  769. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  770. }
  771. ;
  772. var o = t.fn.tooltip;
  773. t.fn.tooltip = e,
  774. t.fn.tooltip.Constructor = i,
  775. t.fn.tooltip.noConflict = function() {
  776. return t.fn.tooltip = o,
  777. this
  778. }
  779. }(jQuery);
  780. !function(e, t, n) {
  781. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  782. }("Keen", this, function() {
  783. "use strict";
  784. function Keen() {
  785. return _init.apply(this, arguments)
  786. }
  787. function _init(e) {
  788. if (_isUndefined(e))
  789. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  790. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  791. throw new Error("Please provide a projectId");
  792. this.configure(e)
  793. }
  794. function _extend(e) {
  795. for (var t = 1; t < arguments.length; t++)
  796. for (var n in arguments[t])
  797. e[n] = arguments[t][n];
  798. return e
  799. }
  800. function _isUndefined(e) {
  801. return void 0 === e
  802. }
  803. function _type(e) {
  804. var t = e && e.constructor ? e.constructor.toString() : void 0;
  805. return t ? t.match(/function (.*)\(/)[1] : "Null"
  806. }
  807. function _each(e, t, n) {
  808. var r;
  809. if (!e)
  810. return 0;
  811. if (n = n ? n : e,
  812. "array" === _type(e)) {
  813. for (r = 0; r < e.length; r++)
  814. if (t.call(n, e[r], r, e) === !1)
  815. return 0
  816. } else
  817. for (r in e)
  818. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  819. return 0;
  820. return 1
  821. }
  822. function _parse_params(e) {
  823. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  824. return decodeURIComponent(e.replace(r, " "))
  825. }, a = e.split("?")[1]; t = i.exec(a); )
  826. n[o(t[1])] = o(t[2]);
  827. return n
  828. }
  829. function _set_protocol(e) {
  830. switch (e) {
  831. case "http":
  832. return "http";
  833. case "auto":
  834. return location.protocol.replace(/:/g, "");
  835. case "https":
  836. case void 0:
  837. default:
  838. return "https"
  839. }
  840. }
  841. function _set_request_type(e) {
  842. var t = e || "jsonp"
  843. , n = !1;
  844. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  845. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  846. }
  847. function _build_url(e) {
  848. return this.client.endpoint + "/projects/" + this.client.projectId + e
  849. }
  850. function _uploadEvent(e, t, n, r, i) {
  851. var o = _build_url.apply(this, ["/events/" + e])
  852. , a = {};
  853. n = n !== !1,
  854. this.client.globalProperties && (a = this.client.globalProperties(e));
  855. for (var c in t)
  856. t.hasOwnProperty(c) && (a[c] = t[c]);
  857. switch (this.client.requestType) {
  858. case "xhr":
  859. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  860. break;
  861. case "jsonp":
  862. var s = JSON.stringify(a)
  863. , l = Keen.Base64.encode(s);
  864. o = o + "?api_key=" + this.client.writeKey,
  865. o = o + "&data=" + l,
  866. o = o + "&modified=" + (new Date).getTime(),
  867. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  868. break;
  869. case "beacon":
  870. var s = JSON.stringify(a)
  871. , l = Keen.Base64.encode(s);
  872. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  873. o = o + "&data=" + encodeURIComponent(l),
  874. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  875. o += "&c=clv1",
  876. _request.beacon.apply(this, [o, null, r, i])
  877. }
  878. }
  879. Keen.prototype.configure = function(e) {
  880. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  881. e.protocol = _set_protocol(e.protocol),
  882. e.requestType = _set_request_type(e.requestType),
  883. this.client = {
  884. projectId: e.projectId,
  885. writeKey: e.writeKey,
  886. readKey: e.readKey,
  887. globalProperties: null,
  888. endpoint: e.protocol + "://" + e.host,
  889. requestType: e.requestType
  890. },
  891. Keen.trigger("client", this, e),
  892. this.trigger("ready"),
  893. this
  894. }
  895. ;
  896. var _request = {
  897. xhr: function(e, t, n, r, i, o, a, c) {
  898. if (!i)
  899. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  900. var s = new XMLHttpRequest;
  901. if (s.onreadystatechange = function() {
  902. if (4 == s.readyState)
  903. if (s.status >= 200 && s.status < 300) {
  904. var e;
  905. try {
  906. e = JSON.parse(s.responseText)
  907. } catch (e) {
  908. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  909. c && c(s, e)
  910. }
  911. a && e && a(e)
  912. } else
  913. Keen.log("HTTP request failed."),
  914. c && c(s, null)
  915. }
  916. ,
  917. s.open(e, t, o),
  918. i && s.setRequestHeader("Authorization", i),
  919. r && s.setRequestHeader("Content-Type", "application/json"),
  920. n)
  921. for (var l in n)
  922. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  923. var u = r ? JSON.stringify(r) : null;
  924. s.send(u)
  925. },
  926. jsonp: function(e, t, n, r) {
  927. if (!t)
  928. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  929. if (t && e.indexOf("api_key") < 0) {
  930. var i = e.indexOf("?") > 0 ? "&" : "?";
  931. e = e + i + "api_key=" + t
  932. }
  933. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  934. o += "a";
  935. var a = !1;
  936. window[o] = function(e) {
  937. a = !0,
  938. n && e && n(e),
  939. window[o] = void 0
  940. }
  941. ,
  942. e = e + "&jsonp=" + o;
  943. var c = document.createElement("script");
  944. c.id = "keen-jsonp",
  945. c.src = e,
  946. document.getElementsByTagName("head")[0].appendChild(c),
  947. c.onreadystatechange = function() {
  948. a === !1 && "loaded" === this.readyState && (a = !0,
  949. r && r())
  950. }
  951. ,
  952. c.onerror = function() {
  953. a === !1 && (a = !0,
  954. r && r())
  955. }
  956. },
  957. beacon: function(e, t, n, r) {
  958. if (t && e.indexOf("api_key") < 0) {
  959. var i = e.indexOf("?") > 0 ? "&" : "?";
  960. e = e + i + "api_key=" + t
  961. }
  962. var o = !1
  963. , a = document.createElement("img");
  964. a.onload = function() {
  965. if (o = !0,
  966. "naturalHeight"in this) {
  967. if (this.naturalHeight + this.naturalWidth === 0)
  968. return void this.onerror()
  969. } else if (this.width + this.height === 0)
  970. return void this.onerror();
  971. n && n({
  972. created: !0
  973. })
  974. }
  975. ,
  976. a.onerror = function() {
  977. o = !0,
  978. r && r()
  979. }
  980. ,
  981. a.src = e
  982. }
  983. }
  984. , Events = Keen.Events = {
  985. on: function(e, t) {
  986. this.listeners || (this.listeners = {});
  987. var n = this.listeners[e] || (this.listeners[e] = []);
  988. return n.push({
  989. callback: t
  990. }),
  991. this
  992. },
  993. off: function(e, t) {
  994. if (!e && !t)
  995. return this.listeners = void 0,
  996. delete this.listeners,
  997. this;
  998. for (var n = this.listeners[e] || [], r = n.length; r--; )
  999. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1000. t && 0 != n.length || (this.listeners[e] = void 0,
  1001. delete this.listeners[e]);
  1002. return this
  1003. },
  1004. trigger: function(e) {
  1005. if (!this.listeners)
  1006. return this;
  1007. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1008. n[r].callback.apply(this, t);
  1009. return this
  1010. }
  1011. };
  1012. _extend(Keen.prototype, Events),
  1013. _extend(Keen, Events),
  1014. Keen.loaded = !0,
  1015. Keen.utils = {
  1016. each: _each,
  1017. extend: _extend,
  1018. parseParams: _parse_params
  1019. },
  1020. Keen.ready = function(e) {
  1021. Keen.loaded ? e() : Keen.on("ready", e)
  1022. }
  1023. ,
  1024. Keen.log = function(e) {
  1025. "object" == typeof console && console.log("[Keen IO]", e)
  1026. }
  1027. ;
  1028. var Plugins = Keen.Plugins = {};
  1029. Keen.prototype.addEvent = function() {
  1030. _uploadEvent.apply(this, arguments)
  1031. }
  1032. ,
  1033. Keen.prototype.addEventSync = function(e, t, n, r) {
  1034. _uploadEvent.apply(this, [e, t, !1, n, r])
  1035. }
  1036. ,
  1037. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1038. var o = e
  1039. , a = o.metaKey
  1040. , c = o.target
  1041. , s = !1
  1042. , l = function() {};
  1043. return void 0 === r && (r = 500),
  1044. "A" === c.nodeName ? l = function() {
  1045. a || s || (s = !0,
  1046. window.location = c.href)
  1047. }
  1048. : "FORM" === c.nodeName && (l = function() {
  1049. s || (s = !0,
  1050. c.submit())
  1051. }
  1052. ),
  1053. i && (l = function() {
  1054. s || (s = !0,
  1055. i())
  1056. }
  1057. ),
  1058. _uploadEvent.call(this, t, n, l, l),
  1059. setTimeout(function() {
  1060. l()
  1061. }, r),
  1062. !!a && void 0
  1063. }
  1064. ,
  1065. Keen.prototype.setGlobalProperties = function(e) {
  1066. if (!this.client)
  1067. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1068. if (!e || "function" != typeof e)
  1069. throw new Error("Invalid value for global properties: " + e);
  1070. this.client.globalProperties = e
  1071. }
  1072. ,
  1073. Keen.Base64 = {
  1074. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1075. encode: function(e) {
  1076. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1077. for (e = this.utf8.encode(e); l < e.length; )
  1078. t = e.charCodeAt(l++),
  1079. n = e.charCodeAt(l++),
  1080. r = e.charCodeAt(l++),
  1081. i = t >> 2,
  1082. o = (3 & t) << 4 | n >> 4,
  1083. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1084. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1085. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1086. return s
  1087. },
  1088. decode: function(e) {
  1089. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1090. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1091. t = u.indexOf(e.charAt(l++)),
  1092. n = u.indexOf(e.charAt(l++)),
  1093. r = u.indexOf(e.charAt(l++)),
  1094. i = u.indexOf(e.charAt(l++)),
  1095. o = t << 2 | n >> 4,
  1096. a = (15 & n) << 4 | r >> 2,
  1097. c = (3 & r) << 6 | i,
  1098. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1099. return this.utf8.decode(s)
  1100. },
  1101. utf8: {
  1102. encode: function(e) {
  1103. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1104. t = e.charCodeAt(r++),
  1105. 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);
  1106. return n
  1107. },
  1108. decode: function(e) {
  1109. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1110. n = e.charCodeAt(i),
  1111. 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];
  1112. return r
  1113. }
  1114. }
  1115. },
  1116. "object" != typeof JSON && (JSON = {}),
  1117. function() {
  1118. function f(e) {
  1119. return 10 > e ? "0" + e : e
  1120. }
  1121. function quote(e) {
  1122. return escapable.lastIndex = 0,
  1123. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1124. var t = meta[e];
  1125. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1126. }) + '"' : '"' + e + '"'
  1127. }
  1128. function str(e, t) {
  1129. var n, r, i, o, a, c = gap, s = t[e];
  1130. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1131. "function" == typeof rep && (s = rep.call(t, e, s)),
  1132. typeof s) {
  1133. case "string":
  1134. return quote(s);
  1135. case "number":
  1136. return isFinite(s) ? String(s) : "null";
  1137. case "boolean":
  1138. case "null":
  1139. return String(s);
  1140. case "object":
  1141. if (!s)
  1142. return "null";
  1143. if (gap += indent,
  1144. a = [],
  1145. "[object Array]" === Object.prototype.toString.apply(s)) {
  1146. for (o = s.length,
  1147. n = 0; o > n; n += 1)
  1148. a[n] = str(n, s) || "null";
  1149. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1150. gap = c,
  1151. i
  1152. }
  1153. if (rep && "object" == typeof rep)
  1154. for (o = rep.length,
  1155. n = 0; o > n; n += 1)
  1156. "string" == typeof rep[n] && (r = rep[n],
  1157. i = str(r, s),
  1158. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1159. else
  1160. for (r in s)
  1161. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1162. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1163. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1164. gap = c,
  1165. i
  1166. }
  1167. }
  1168. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1169. 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
  1170. }
  1171. ,
  1172. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1173. return this.valueOf()
  1174. }
  1175. );
  1176. 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 = {
  1177. "\b": "\\b",
  1178. "\t": "\\t",
  1179. "\n": "\\n",
  1180. "\f": "\\f",
  1181. "\r": "\\r",
  1182. '"': '\\"',
  1183. "\\": "\\\\"
  1184. }, rep;
  1185. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1186. var r;
  1187. if (gap = "",
  1188. indent = "",
  1189. "number" == typeof n)
  1190. for (r = 0; n > r; r += 1)
  1191. indent += " ";
  1192. else
  1193. "string" == typeof n && (indent = n);
  1194. if (rep = t,
  1195. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1196. throw new Error("JSON.stringify");
  1197. return str("", {
  1198. "": e
  1199. })
  1200. }
  1201. ),
  1202. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1203. function walk(e, t) {
  1204. var n, r, i = e[t];
  1205. if (i && "object" == typeof i)
  1206. for (n in i)
  1207. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1208. void 0 !== r ? i[n] = r : delete i[n]);
  1209. return reviver.call(e, t, i)
  1210. }
  1211. var j;
  1212. if (text = String(text),
  1213. cx.lastIndex = 0,
  1214. cx.test(text) && (text = text.replace(cx, function(e) {
  1215. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1216. })),
  1217. /^[\],:{}\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, "")))
  1218. return j = eval("(" + text + ")"),
  1219. "function" == typeof reviver ? walk({
  1220. "": j
  1221. }, "") : j;
  1222. throw new SyntaxError("JSON.parse")
  1223. }
  1224. )
  1225. }(),
  1226. !function(e, t, n) {
  1227. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1228. }("domready", Keen.utils, function(e) {
  1229. function t(e) {
  1230. for (d = 1; e = r.shift(); )
  1231. e()
  1232. }
  1233. 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]);
  1234. return o[l] && o[l](s, n = function() {
  1235. o.removeEventListener(s, n, i),
  1236. t()
  1237. }
  1238. , i),
  1239. c && o.attachEvent(u, n = function() {
  1240. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1241. t())
  1242. }
  1243. ),
  1244. e = c ? function(t) {
  1245. self != top ? d ? t() : r.push(t) : function() {
  1246. try {
  1247. a.doScroll("left")
  1248. } catch (n) {
  1249. return setTimeout(function() {
  1250. e(t)
  1251. }, 50)
  1252. }
  1253. t()
  1254. }()
  1255. }
  1256. : function(e) {
  1257. d ? e() : r.push(e)
  1258. }
  1259. });
  1260. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1261. if (loaded && cached) {
  1262. clients = cached.clients || {},
  1263. ready = cached.ready || [];
  1264. for (var instance in clients)
  1265. if (clients.hasOwnProperty(instance)) {
  1266. var client = clients[instance];
  1267. for (var method in Keen.prototype)
  1268. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1269. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1270. ,
  1271. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1272. ,
  1273. client._config && (client.configure.call(client, client._config),
  1274. delete client._config),
  1275. client._setGlobalProperties) {
  1276. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1277. client.setGlobalProperties.apply(client, globals[i]);
  1278. delete client._setGlobalProperties
  1279. }
  1280. if (client._addEvent) {
  1281. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1282. client.addEvent.apply(client, queue[i]);
  1283. delete client._addEvent
  1284. }
  1285. var callback = client._on || [];
  1286. if (client._on) {
  1287. for (var i = 0; i < callback.length; i++)
  1288. client.on.apply(client, callback[i]);
  1289. client.trigger("ready"),
  1290. delete client._on
  1291. }
  1292. }
  1293. for (var i = 0; i < ready.length; i++) {
  1294. var callback = ready[i];
  1295. Keen.on("ready", function() {
  1296. callback()
  1297. })
  1298. }
  1299. }
  1300. return Keen.loaded && setTimeout(function() {
  1301. Keen.utils.domready(function() {
  1302. Keen.trigger("ready")
  1303. })
  1304. }, 0),
  1305. Keen
  1306. });
  1307. !function() {
  1308. var t = window.analytics = window.analytics || [];
  1309. if (!t.initialize) {
  1310. if (t.invoked)
  1311. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1312. t.invoked = !0,
  1313. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1314. t.factory = function(e) {
  1315. return function() {
  1316. var n = Array.prototype.slice.call(arguments);
  1317. return n.unshift(e),
  1318. t.push(n),
  1319. t
  1320. }
  1321. }
  1322. ;
  1323. for (var e = 0; e < t.methods.length; e++) {
  1324. var n = t.methods[e];
  1325. t[n] = t.factory(n)
  1326. }
  1327. t.load = function(t) {
  1328. var e = document.createElement("script");
  1329. e.type = "text/javascript",
  1330. e.async = !0,
  1331. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1332. var n = document.getElementsByTagName("script")[0];
  1333. n.parentNode.insertBefore(e, n)
  1334. }
  1335. ,
  1336. t.SNIPPET_VERSION = "4.0.0"
  1337. }
  1338. }();
  1339. !function(i, e) {
  1340. "use strict";
  1341. var s = ""
  1342. , r = "?"
  1343. , o = "function"
  1344. , a = "undefined"
  1345. , n = "object"
  1346. , t = "major"
  1347. , d = "model"
  1348. , w = "name"
  1349. , l = "type"
  1350. , p = "vendor"
  1351. , m = "version"
  1352. , c = "architecture"
  1353. , u = "console"
  1354. , g = "mobile"
  1355. , f = "tablet"
  1356. , h = "smarttv"
  1357. , b = {
  1358. has: function(i, e) {
  1359. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1360. },
  1361. lowerize: function(i) {
  1362. return i.toLowerCase()
  1363. }
  1364. }
  1365. , y = {
  1366. rgx: function() {
  1367. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1368. var c = m[p]
  1369. , u = m[p + 1];
  1370. if (typeof i === a) {
  1371. i = {};
  1372. for (t in u)
  1373. d = u[t],
  1374. typeof d === n ? i[d[0]] = e : i[d] = e
  1375. }
  1376. for (s = r = 0; s < c.length; s++)
  1377. if (w = c[s].exec(this.getUA())) {
  1378. for (t = 0; t < u.length; t++)
  1379. l = w[++r],
  1380. d = u[t],
  1381. 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;
  1382. break
  1383. }
  1384. if (w)
  1385. break
  1386. }
  1387. return i
  1388. },
  1389. str: function(i, s) {
  1390. for (var o in s)
  1391. if (typeof s[o] === n && s[o].length > 0) {
  1392. for (var a = 0; a < s[o].length; a++)
  1393. if (b.has(s[o][a], i))
  1394. return o === r ? e : o
  1395. } else if (b.has(s[o], i))
  1396. return o === r ? e : o;
  1397. return i
  1398. }
  1399. }
  1400. , v = {
  1401. browser: {
  1402. oldsafari: {
  1403. major: {
  1404. 1: ["/8", "/1", "/3"],
  1405. 2: "/4",
  1406. "?": "/"
  1407. },
  1408. version: {
  1409. "1.0": "/8",
  1410. 1.2: "/1",
  1411. 1.3: "/3",
  1412. "2.0": "/412",
  1413. "2.0.2": "/416",
  1414. "2.0.3": "/417",
  1415. "2.0.4": "/419",
  1416. "?": "/"
  1417. }
  1418. }
  1419. },
  1420. device: {
  1421. sprint: {
  1422. model: {
  1423. "Evo Shift 4G": "7373KT"
  1424. },
  1425. vendor: {
  1426. HTC: "APA",
  1427. Sprint: "Sprint"
  1428. }
  1429. }
  1430. },
  1431. os: {
  1432. windows: {
  1433. version: {
  1434. ME: "4.90",
  1435. "NT 3.11": "NT3.51",
  1436. "NT 4.0": "NT4.0",
  1437. 2e3: "NT 5.0",
  1438. XP: ["NT 5.1", "NT 5.2"],
  1439. Vista: "NT 6.0",
  1440. 7: "NT 6.1",
  1441. 8: "NT 6.2",
  1442. 8.1: "NT 6.3",
  1443. RT: "ARM"
  1444. }
  1445. }
  1446. }
  1447. }
  1448. , k = {
  1449. 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]],
  1450. 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]],
  1451. 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]],
  1452. 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]],
  1453. 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]]
  1454. }
  1455. , x = function(e) {
  1456. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1457. return this instanceof x ? (this.getBrowser = function() {
  1458. return y.rgx.apply(this, k.browser)
  1459. }
  1460. ,
  1461. this.getCPU = function() {
  1462. return y.rgx.apply(this, k.cpu)
  1463. }
  1464. ,
  1465. this.getDevice = function() {
  1466. return y.rgx.apply(this, k.device)
  1467. }
  1468. ,
  1469. this.getEngine = function() {
  1470. return y.rgx.apply(this, k.engine)
  1471. }
  1472. ,
  1473. this.getOS = function() {
  1474. return y.rgx.apply(this, k.os)
  1475. }
  1476. ,
  1477. this.getResult = function() {
  1478. return {
  1479. ua: this.getUA(),
  1480. browser: this.getBrowser(),
  1481. engine: this.getEngine(),
  1482. os: this.getOS(),
  1483. device: this.getDevice(),
  1484. cpu: this.getCPU()
  1485. }
  1486. }
  1487. ,
  1488. this.getUA = function() {
  1489. return r
  1490. }
  1491. ,
  1492. this.setUA = function(i) {
  1493. return r = i,
  1494. this
  1495. }
  1496. ,
  1497. void this.setUA(r)) : new x(e).getResult()
  1498. };
  1499. if (typeof exports !== a)
  1500. typeof module !== a && module.exports && (exports = module.exports = x),
  1501. exports.UAParser = x;
  1502. else if (i.UAParser = x,
  1503. typeof define === o && define.amd && define(function() {
  1504. return x
  1505. }),
  1506. typeof i.jQuery !== a) {
  1507. var A = i.jQuery
  1508. , _ = new x;
  1509. A.ua = _.getResult(),
  1510. A.ua.get = function() {
  1511. return _.getUA()
  1512. }
  1513. ,
  1514. A.ua.set = function(i) {
  1515. _.setUA(i);
  1516. var e = _.getResult();
  1517. for (var s in e)
  1518. A.ua[s] = e[s]
  1519. }
  1520. }
  1521. }(this);
  1522. window.Modernizr = function(n, e, t) {
  1523. function o(n) {
  1524. d.cssText = n
  1525. }
  1526. function r(n, e) {
  1527. return typeof n === e
  1528. }
  1529. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1530. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1531. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1532. return e in n && r(n.constructor.prototype[e], "undefined")
  1533. }
  1534. : function(n, e) {
  1535. return v.call(n, e)
  1536. }
  1537. ,
  1538. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1539. var e = this;
  1540. if ("function" != typeof e)
  1541. throw new TypeError;
  1542. var t = b.call(arguments, 1)
  1543. , o = function() {
  1544. if (this instanceof o) {
  1545. var r = function() {};
  1546. r.prototype = e.prototype;
  1547. var i = new r
  1548. , c = e.apply(i, t.concat(b.call(arguments)));
  1549. return Object(c) === c ? c : i
  1550. }
  1551. return e.apply(n, t.concat(b.call(arguments)))
  1552. };
  1553. return o
  1554. }
  1555. ),
  1556. y.webgl = function() {
  1557. return !!n.WebGLRenderingContext
  1558. }
  1559. ;
  1560. for (var h in y)
  1561. u(y, h) && (c = h.toLowerCase(),
  1562. f[c] = y[h](),
  1563. w.push((f[c] ? "" : "no-") + c));
  1564. return f.addTest = function(n, e) {
  1565. if ("object" == typeof n)
  1566. for (var o in n)
  1567. u(n, o) && f.addTest(o, n[o]);
  1568. else {
  1569. if (n = n.toLowerCase(),
  1570. f[n] !== t)
  1571. return f;
  1572. e = "function" == typeof e ? e() : e,
  1573. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1574. f[n] = e
  1575. }
  1576. return f
  1577. }
  1578. ,
  1579. o(""),
  1580. p = i = null,
  1581. f._version = a,
  1582. f
  1583. }(this, this.document);
  1584. !function(e, t, a) {
  1585. "use strict";
  1586. function n(t, h, m) {
  1587. function H(a) {
  1588. var n = 0
  1589. , i = Ee.length;
  1590. if (Ce.old = e.extend({}, Ce),
  1591. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1592. ke = Be[ge.horizontal ? "width" : "height"](),
  1593. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1594. Ee.length = 0,
  1595. Ce.start = 0,
  1596. Ce.end = q(ze - Ie, 0),
  1597. Re) {
  1598. n = Ne.length,
  1599. qe = Pe.children(ge.itemSelector),
  1600. Ne.length = 0;
  1601. 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;
  1602. ze = 0,
  1603. qe.each(function(t, a) {
  1604. var n = e(a)
  1605. , i = a.getBoundingClientRect()
  1606. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1607. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1608. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1609. , h = l + d + p
  1610. , m = !d || !p
  1611. , g = {};
  1612. g.el = a,
  1613. g.size = m ? l : h,
  1614. g.half = g.size / 2,
  1615. g.start = ze + (m ? d : 0),
  1616. g.center = g.start - E(Ie / 2 - g.size / 2),
  1617. g.end = g.start - Ie + g.size,
  1618. t || (ze += s),
  1619. ze += h,
  1620. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1621. t === v && (g.end += o,
  1622. ze += o,
  1623. f = m ? p : 0),
  1624. Ne.push(g),
  1625. r = g
  1626. }),
  1627. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1628. ze -= f,
  1629. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1630. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1631. }
  1632. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1633. Q(),
  1634. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1635. Te = d(Te, ge.minHandleSize, ke),
  1636. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1637. xe.end = ke - Te,
  1638. it || j()),
  1639. !we && Ie > 0) {
  1640. var p = Ce.start
  1641. , h = "";
  1642. if (Re)
  1643. e.each(Ne, function(e, t) {
  1644. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1645. Ee.push(p),
  1646. p += Ie,
  1647. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1648. });
  1649. else
  1650. for (; p - Ie < Ce.end; )
  1651. Ee.push(p),
  1652. p += Ie;
  1653. if (De[0] && i !== Ee.length) {
  1654. for (var m = 0; m < Ee.length; m++)
  1655. h += ge.pageBuilder.call(ye, m);
  1656. Ae = De.html(h).children(),
  1657. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1658. }
  1659. }
  1660. if (Oe.slideeSize = ze,
  1661. Oe.frameSize = Ie,
  1662. Oe.sbSize = ke,
  1663. Oe.handleSize = Te,
  1664. Re) {
  1665. a && null != ge.startAt && (W(ge.startAt),
  1666. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1667. var g = Ne[Oe.activeItem];
  1668. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1669. } else
  1670. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1671. pe("load")
  1672. }
  1673. function X(e, t, a) {
  1674. if (Re && at.released && !a) {
  1675. var n = $(e)
  1676. , i = e > Ce.start && e < Ce.end;
  1677. Le ? (i && (e = Ne[n.centerItem].center),
  1678. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1679. }
  1680. 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),
  1681. et.start = +new Date,
  1682. et.time = 0,
  1683. et.from = Ce.cur,
  1684. et.to = e,
  1685. et.delta = e - Ce.cur,
  1686. et.tweesing = at.tweese || at.init && !at.slidee,
  1687. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1688. at.tweese = 0,
  1689. e !== Ce.dest && (Ce.dest = e,
  1690. pe("change"),
  1691. it || Y()),
  1692. K(),
  1693. Q(),
  1694. Z(),
  1695. F()
  1696. }
  1697. function Y() {
  1698. if (ye.initialized) {
  1699. if (!it)
  1700. return it = w(Y),
  1701. void (at.released && pe("moveStart"));
  1702. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1703. 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),
  1704. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1705. et.to === Ce.cur ? (Ce.cur = et.to,
  1706. at.tweese = it = 0) : it = w(Y),
  1707. pe("move"),
  1708. 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"),
  1709. !it && at.released && pe("moveEnd"),
  1710. j()
  1711. }
  1712. }
  1713. function j() {
  1714. 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,
  1715. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1716. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1717. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1718. }
  1719. function F() {
  1720. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1721. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1722. pe("activePage", _e.page))
  1723. }
  1724. function M() {
  1725. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1726. ot = at.init ? w(M) : 0,
  1727. tt.now = +new Date,
  1728. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1729. X(at.init ? tt.pos : E(tt.pos)),
  1730. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1731. tt.lastTime = tt.now
  1732. }
  1733. function L(e, t, n) {
  1734. if ("boolean" === i(t) && (n = t,
  1735. t = a),
  1736. t === a)
  1737. X(Ce[e], n);
  1738. else {
  1739. if (Le && "center" !== e)
  1740. return;
  1741. var r = ye.getPos(t);
  1742. r && X(r[e], n, !Le)
  1743. }
  1744. }
  1745. function R(e) {
  1746. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1747. }
  1748. function U(e) {
  1749. return R(l(e) && 0 > e ? e + Ne.length : e)
  1750. }
  1751. function W(e, t) {
  1752. var a = R(e);
  1753. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1754. qe.eq(a).addClass(ge.activeClass),
  1755. _e.active = Oe.activeItem = a,
  1756. Z(),
  1757. pe("active", a)),
  1758. a)
  1759. }
  1760. function $(e) {
  1761. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1762. var t = {}
  1763. , a = Me ? 0 : Ie / 2;
  1764. if (!we)
  1765. for (var n = 0, i = Ee.length; i > n; n++) {
  1766. if (e >= Ce.end || n === Ee.length - 1) {
  1767. t.activePage = Ee.length - 1;
  1768. break
  1769. }
  1770. if (e <= Ee[n] + a) {
  1771. t.activePage = n;
  1772. break
  1773. }
  1774. }
  1775. if (Re) {
  1776. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1777. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1778. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1779. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1780. s = c;
  1781. break
  1782. }
  1783. t.firstItem = l(r) ? r : 0,
  1784. t.centerItem = l(o) ? o : t.firstItem,
  1785. t.lastItem = l(s) ? s : t.centerItem
  1786. }
  1787. return t
  1788. }
  1789. function Q(t) {
  1790. e.extend(Oe, $(t))
  1791. }
  1792. function Z() {
  1793. var e = Ce.dest <= Ce.start
  1794. , t = Ce.dest >= Ce.end
  1795. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1796. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1797. Je.is("button,input") && Je.prop("disabled", e),
  1798. Ke.is("button,input") && Ke.prop("disabled", t),
  1799. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1800. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1801. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1802. Qe.is("button,input") && Qe.prop("disabled", e),
  1803. $e.is("button,input") && $e.prop("disabled", t)),
  1804. Re && null != Oe.activeItem) {
  1805. var n = 0 === Oe.activeItem
  1806. , i = Oe.activeItem >= Ne.length - 1
  1807. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1808. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1809. Ze.is("button,input") && Ze.prop("disabled", n),
  1810. Ge.is("button,input") && Ge.prop("disabled", i),
  1811. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1812. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1813. }
  1814. }
  1815. function G(e, t, a) {
  1816. if (e = U(e),
  1817. t = U(t),
  1818. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1819. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1820. var n = t > e ? e : a ? t : t - 1
  1821. , i = e > t ? e : a ? t + 1 : t
  1822. , r = e > t;
  1823. 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)),
  1824. H()
  1825. }
  1826. }
  1827. function J(e, t) {
  1828. for (var a = 0, n = Ve[e].length; n > a; a++)
  1829. if (Ve[e][a] === t)
  1830. return a;
  1831. return -1
  1832. }
  1833. function K() {
  1834. at.released && !ye.isPaused && ye.resume()
  1835. }
  1836. function V(e) {
  1837. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1838. }
  1839. function _() {
  1840. at.history[0] = at.history[1],
  1841. at.history[1] = at.history[2],
  1842. at.history[2] = at.history[3],
  1843. at.history[3] = at.delta
  1844. }
  1845. function ee(e) {
  1846. at.released = 0,
  1847. at.source = e,
  1848. at.slidee = "slidee" === e
  1849. }
  1850. function te(t) {
  1851. var a = "touchstart" === t.type
  1852. , n = t.data.source
  1853. , i = "slidee" === n;
  1854. 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),
  1855. ee(n),
  1856. at.init = 0,
  1857. at.$source = e(t.target),
  1858. at.touch = a,
  1859. at.pointer = a ? t.originalEvent.touches[0] : t,
  1860. at.initX = at.pointer.pageX,
  1861. at.initY = at.pointer.pageY,
  1862. at.initPos = i ? Ce.cur : xe.cur,
  1863. at.start = +new Date,
  1864. at.time = 0,
  1865. at.path = 0,
  1866. at.delta = 0,
  1867. at.locked = 0,
  1868. at.history = [0, 0, 0, 0],
  1869. at.pathToLock = i ? a ? 30 : 10 : 0,
  1870. b.on(a ? z : I, ae),
  1871. ye.pause(1),
  1872. (i ? Pe : Se).addClass(ge.draggedClass),
  1873. pe("moveStart"),
  1874. i && (rt = setInterval(_, 10)))
  1875. }
  1876. function ae(e) {
  1877. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1878. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1879. at.pathX = at.pointer.pageX - at.initX,
  1880. at.pathY = at.pointer.pageY - at.initY,
  1881. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1882. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1883. at.released || !(at.path < 1)) {
  1884. if (!at.init) {
  1885. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1886. return ne();
  1887. at.init = 1
  1888. }
  1889. r(e),
  1890. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1891. at.$source.on(B, s)),
  1892. at.released && (ne(),
  1893. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1894. at.delta += at.swing,
  1895. at.tweese = x(at.swing) > 10)),
  1896. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1897. }
  1898. }
  1899. function ne() {
  1900. clearInterval(rt),
  1901. at.released = !0,
  1902. b.off(at.touch ? z : I, ae),
  1903. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1904. setTimeout(function() {
  1905. at.$source.off(B, s)
  1906. }),
  1907. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1908. ye.resume(1),
  1909. at.init = 0
  1910. }
  1911. function ie(t) {
  1912. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1913. }
  1914. function re() {
  1915. ye.stop(),
  1916. b.off("mouseup", re)
  1917. }
  1918. function se(e) {
  1919. switch (r(e),
  1920. this) {
  1921. case $e[0]:
  1922. case Qe[0]:
  1923. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1924. b.on("mouseup", re);
  1925. break;
  1926. case Ze[0]:
  1927. ye.prev();
  1928. break;
  1929. case Ge[0]:
  1930. ye.next();
  1931. break;
  1932. case Je[0]:
  1933. ye.prevPage();
  1934. break;
  1935. case Ke[0]:
  1936. ye.nextPage()
  1937. }
  1938. }
  1939. function oe(e) {
  1940. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1941. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1942. Re ? (p = +new Date,
  1943. nt.last < p - nt.resetTime && (nt.delta = 0),
  1944. nt.last = p,
  1945. nt.delta += nt.curDelta,
  1946. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1947. nt.delta %= 1),
  1948. nt.finalDelta) : nt.curDelta
  1949. }
  1950. function le(e) {
  1951. e.originalEvent[g] = ye;
  1952. var t = +new Date;
  1953. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1954. return void (O = t);
  1955. if (ge.scrollBy && Ce.start !== Ce.end) {
  1956. var a = oe(e.originalEvent);
  1957. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1958. ye.slideBy(ge.scrollBy * a)
  1959. }
  1960. }
  1961. function ce(e) {
  1962. ge.clickBar && e.target === Be[0] && (r(e),
  1963. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1964. }
  1965. function de(e) {
  1966. if (ge.keyboardNavBy)
  1967. switch (e.which) {
  1968. case ge.horizontal ? 37 : 38:
  1969. r(e),
  1970. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1971. break;
  1972. case ge.horizontal ? 39 : 40:
  1973. r(e),
  1974. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1975. }
  1976. }
  1977. function ue(e) {
  1978. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1979. }
  1980. function fe() {
  1981. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1982. }
  1983. function ve(e) {
  1984. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1985. }
  1986. function pe(e, t) {
  1987. if (Ve[e]) {
  1988. for (me = Ve[e].length,
  1989. T.length = 0,
  1990. he = 0; me > he; he++)
  1991. T.push(Ve[e][he]);
  1992. for (he = 0; me > he; he++)
  1993. T[he].call(ye, e, t)
  1994. }
  1995. }
  1996. 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 = {
  1997. start: 0,
  1998. center: 0,
  1999. end: 0,
  2000. cur: 0,
  2001. dest: 0
  2002. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2003. start: 0,
  2004. end: 0,
  2005. cur: 0
  2006. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2007. firstItem: 0,
  2008. lastItem: 0,
  2009. centerItem: 0,
  2010. activeItem: null,
  2011. activePage: 0
  2012. }, 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 = {
  2013. released: 1
  2014. }, nt = {
  2015. last: 0,
  2016. delta: 0,
  2017. resetTime: 200
  2018. }, it = 0, rt = 0, st = 0, ot = 0;
  2019. we || (t = be[0]),
  2020. ye.initialized = 0,
  2021. ye.frame = t,
  2022. ye.slidee = Pe[0],
  2023. ye.pos = Ce,
  2024. ye.rel = Oe,
  2025. ye.items = Ne,
  2026. ye.pages = Ee,
  2027. ye.isPaused = 0,
  2028. ye.options = ge,
  2029. ye.dragging = at,
  2030. ye.reload = function() {
  2031. H()
  2032. }
  2033. ,
  2034. ye.getPos = function(e) {
  2035. if (Re) {
  2036. var t = R(e);
  2037. return -1 !== t && Ne[t]
  2038. }
  2039. var a = Pe.find(e).eq(0);
  2040. if (a[0]) {
  2041. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2042. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2043. return {
  2044. start: n,
  2045. center: n - Ie / 2 + i / 2,
  2046. end: n - Ie + i,
  2047. size: i
  2048. }
  2049. }
  2050. return !1
  2051. }
  2052. ,
  2053. ye.moveBy = function(e) {
  2054. tt.speed = e,
  2055. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2056. tt.startPos = Ce.cur,
  2057. ee("button"),
  2058. at.init = 1,
  2059. pe("moveStart"),
  2060. y(ot),
  2061. M())
  2062. }
  2063. ,
  2064. ye.stop = function() {
  2065. "button" === at.source && (at.init = 0,
  2066. at.released = 1)
  2067. }
  2068. ,
  2069. ye.prev = function() {
  2070. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2071. }
  2072. ,
  2073. ye.next = function() {
  2074. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2075. }
  2076. ,
  2077. ye.prevPage = function() {
  2078. ye.activatePage(Oe.activePage - 1)
  2079. }
  2080. ,
  2081. ye.nextPage = function() {
  2082. ye.activatePage(Oe.activePage + 1)
  2083. }
  2084. ,
  2085. ye.slideBy = function(e, t) {
  2086. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2087. }
  2088. ,
  2089. ye.slideTo = function(e, t) {
  2090. X(e, t)
  2091. }
  2092. ,
  2093. ye.toStart = function(e, t) {
  2094. L("start", e, t)
  2095. }
  2096. ,
  2097. ye.toEnd = function(e, t) {
  2098. L("end", e, t)
  2099. }
  2100. ,
  2101. ye.toCenter = function(e, t) {
  2102. L("center", e, t)
  2103. }
  2104. ,
  2105. ye.getIndex = R,
  2106. ye.activate = function(e, t) {
  2107. var a = W(e);
  2108. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2109. }
  2110. ,
  2111. ye.activatePage = function(e, t) {
  2112. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2113. }
  2114. ,
  2115. ye.resume = function(e) {
  2116. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2117. st ? st = clearTimeout(st) : pe("resume"),
  2118. st = setTimeout(function() {
  2119. switch (pe("cycle"),
  2120. ge.cycleBy) {
  2121. case "items":
  2122. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2123. break;
  2124. case "pages":
  2125. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2126. }
  2127. }, ge.cycleInterval))
  2128. }
  2129. ,
  2130. ye.pause = function(e) {
  2131. e < ye.isPaused || (ye.isPaused = e || 100,
  2132. st && (st = clearTimeout(st),
  2133. pe("pause")))
  2134. }
  2135. ,
  2136. ye.toggle = function() {
  2137. ye[st ? "pause" : "resume"]()
  2138. }
  2139. ,
  2140. ye.set = function(t, a) {
  2141. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2142. }
  2143. ,
  2144. ye.add = function(t, a) {
  2145. var n = e(t);
  2146. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2147. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2148. H()
  2149. }
  2150. ,
  2151. ye.remove = function(t) {
  2152. if (Re) {
  2153. var a = U(t);
  2154. if (a > -1) {
  2155. qe.eq(a).remove();
  2156. var n = a === Oe.activeItem;
  2157. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2158. H(),
  2159. n && (_e.active = null,
  2160. ye.activate(Oe.activeItem))
  2161. }
  2162. } else
  2163. e(t).remove(),
  2164. H()
  2165. }
  2166. ,
  2167. ye.moveAfter = function(e, t) {
  2168. G(e, t, 1)
  2169. }
  2170. ,
  2171. ye.moveBefore = function(e, t) {
  2172. G(e, t)
  2173. }
  2174. ,
  2175. ye.on = function(e, t) {
  2176. if ("object" === i(e))
  2177. for (var a in e)
  2178. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2179. else if ("function" === i(t))
  2180. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2181. Ve[n[r]] = Ve[n[r]] || [],
  2182. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2183. else if ("array" === i(t))
  2184. for (var o = 0, l = t.length; l > o; o++)
  2185. ye.on(e, t[o])
  2186. }
  2187. ,
  2188. ye.one = function(e, t) {
  2189. function a() {
  2190. t.apply(ye, arguments),
  2191. ye.off(e, a)
  2192. }
  2193. ye.on(e, a)
  2194. }
  2195. ,
  2196. ye.off = function(e, t) {
  2197. if (t instanceof Array)
  2198. for (var a = 0, n = t.length; n > a; a++)
  2199. ye.off(e, t[a]);
  2200. else
  2201. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2202. if (Ve[i[r]] = Ve[i[r]] || [],
  2203. null == t)
  2204. Ve[i[r]].length = 0;
  2205. else {
  2206. var o = J(i[r], t);
  2207. -1 !== o && Ve[i[r]].splice(o, 1)
  2208. }
  2209. }
  2210. ,
  2211. ye.destroy = function() {
  2212. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2213. b.off("keydown", de),
  2214. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2215. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2216. De.empty(),
  2217. we || (be.off("." + g),
  2218. He.restore(),
  2219. Xe.restore(),
  2220. Ye.restore(),
  2221. je.restore(),
  2222. e.removeData(t, g)),
  2223. Ne.length = Ee.length = 0,
  2224. _e = {},
  2225. ye.initialized = 0,
  2226. ye
  2227. }
  2228. ,
  2229. ye.init = function() {
  2230. if (!ye.initialized) {
  2231. ye.on(m);
  2232. var e = ["overflow", "position"]
  2233. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2234. He.save.apply(He, e),
  2235. Ye.save.apply(Ye, e),
  2236. Xe.save.apply(Xe, t),
  2237. je.save.apply(je, t);
  2238. var a = Se;
  2239. return we || (a = a.add(Pe),
  2240. be.css("overflow", "hidden"),
  2241. f || "static" !== be.css("position") || be.css("position", "relative")),
  2242. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2243. a.css({
  2244. position: "absolute"
  2245. })),
  2246. ge.forward && $e.on(S, se),
  2247. ge.backward && Qe.on(S, se),
  2248. ge.prev && Ze.on(B, se),
  2249. ge.next && Ge.on(B, se),
  2250. ge.prevPage && Je.on(B, se),
  2251. ge.nextPage && Ke.on(B, se),
  2252. Ue.on(C, le),
  2253. Be[0] && Be.on(B, ce),
  2254. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2255. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2256. We.on(P, {
  2257. source: "slidee"
  2258. }, te),
  2259. Se && Se.on(P, {
  2260. source: "handle"
  2261. }, te),
  2262. b.on("keydown", de),
  2263. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2264. be.on("scroll." + g, o)),
  2265. ye.initialized = 1,
  2266. H(!0),
  2267. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2268. ye
  2269. }
  2270. }
  2271. }
  2272. function i(e) {
  2273. 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
  2274. }
  2275. function r(e, t) {
  2276. e.preventDefault(),
  2277. t && e.stopPropagation()
  2278. }
  2279. function s(t) {
  2280. r(t, 1),
  2281. e(this).off(t.type, s)
  2282. }
  2283. function o() {
  2284. this.scrollLeft = 0,
  2285. this.scrollTop = 0
  2286. }
  2287. function l(e) {
  2288. return !isNaN(parseFloat(e)) && isFinite(e)
  2289. }
  2290. function c(e, t) {
  2291. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2292. }
  2293. function d(e, t, a) {
  2294. return t > e ? t : e > a ? a : e
  2295. }
  2296. function u(e) {
  2297. var t = {};
  2298. return t.style = {},
  2299. t.save = function() {
  2300. if (e && e.nodeType) {
  2301. for (var a = 0; a < arguments.length; a++)
  2302. t.style[arguments[a]] = e.style[arguments[a]];
  2303. return t
  2304. }
  2305. }
  2306. ,
  2307. t.restore = function() {
  2308. if (e && e.nodeType) {
  2309. for (var a in t.style)
  2310. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2311. return t
  2312. }
  2313. }
  2314. ,
  2315. t
  2316. }
  2317. 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;
  2318. b.on(C, function(e) {
  2319. var t = e.originalEvent[g]
  2320. , a = +new Date;
  2321. (!t || t.options.scrollHijack < a - O) && (O = a)
  2322. }),
  2323. function(e) {
  2324. function t(e) {
  2325. var t = (new Date).getTime()
  2326. , n = Math.max(0, 16 - (t - a))
  2327. , i = setTimeout(e, n);
  2328. return a = t,
  2329. i
  2330. }
  2331. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2332. var a = (new Date).getTime()
  2333. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2334. y = function(t) {
  2335. n.call(e, t)
  2336. }
  2337. }(window),
  2338. function() {
  2339. function e(e) {
  2340. for (var n = 0, i = t.length; i > n; n++) {
  2341. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2342. if (null != a.style[r])
  2343. return r
  2344. }
  2345. }
  2346. var t = ["", "webkit", "moz", "ms", "o"]
  2347. , a = document.createElement("div");
  2348. f = e("transform"),
  2349. v = e("perspective") ? "translateZ(0) " : ""
  2350. }(),
  2351. t[m] = n,
  2352. e.fn[h] = function(t, a) {
  2353. var r, s;
  2354. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2355. s = Array.prototype.slice.call(arguments, 1)),
  2356. t = {}),
  2357. this.each(function(i, o) {
  2358. var l = e.data(o, g);
  2359. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2360. })
  2361. }
  2362. ,
  2363. n.defaults = {
  2364. slidee: null,
  2365. horizontal: !1,
  2366. itemNav: null,
  2367. itemSelector: null,
  2368. smart: !1,
  2369. activateOn: null,
  2370. activateMiddle: !1,
  2371. scrollSource: null,
  2372. scrollBy: 0,
  2373. scrollHijack: 300,
  2374. scrollTrap: !1,
  2375. dragSource: null,
  2376. mouseDragging: !1,
  2377. touchDragging: !1,
  2378. releaseSwing: !1,
  2379. swingSpeed: .2,
  2380. elasticBounds: !1,
  2381. interactive: null,
  2382. scrollBar: null,
  2383. dragHandle: !1,
  2384. dynamicHandle: !1,
  2385. minHandleSize: 50,
  2386. clickBar: !1,
  2387. syncSpeed: .5,
  2388. pagesBar: null,
  2389. activatePageOn: null,
  2390. pageBuilder: function(e) {
  2391. return "<li>" + (e + 1) + "</li>"
  2392. },
  2393. forward: null,
  2394. backward: null,
  2395. prev: null,
  2396. next: null,
  2397. prevPage: null,
  2398. nextPage: null,
  2399. cycleBy: null,
  2400. cycleInterval: 5e3,
  2401. pauseOnHover: !1,
  2402. startPaused: !1,
  2403. moveBy: 300,
  2404. speed: 0,
  2405. easing: "swing",
  2406. startAt: null,
  2407. keyboardNavBy: null,
  2408. draggedClass: "dragged",
  2409. activeClass: "active",
  2410. disabledClass: "disabled"
  2411. }
  2412. }(jQuery, window);
  2413. !function e(t, i, n) {
  2414. function r(a, s) {
  2415. if (!i[a]) {
  2416. if (!t[a]) {
  2417. var l = "function" == typeof require && require;
  2418. if (!s && l)
  2419. return l(a, !0);
  2420. if (o)
  2421. return o(a, !0);
  2422. var c = new Error("Cannot find module '" + a + "'");
  2423. throw c.code = "MODULE_NOT_FOUND",
  2424. c
  2425. }
  2426. var h = i[a] = {
  2427. exports: {}
  2428. };
  2429. t[a][0].call(h.exports, function(e) {
  2430. var i = t[a][1][e];
  2431. return r(i ? i : e)
  2432. }, h, h.exports, e, t, i, n)
  2433. }
  2434. return i[a].exports
  2435. }
  2436. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2437. r(n[a]);
  2438. return r
  2439. }({
  2440. 1: [function(e, t, i) {///js/DisplayController.js
  2441. (function(i) {
  2442. "use strict";
  2443. function n(e) {
  2444. this.player = null,
  2445. this.director = null,
  2446. this.modelManager = null,
  2447. this.container = null,
  2448. this.tagManager = null,
  2449. this.fadeInSpeed = e,
  2450. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2451. }
  2452. var r = e("three")
  2453. , o = e("./util/logger")
  2454. , a = (e("./util/common"),
  2455. e("./enum/PlayerEvents"))
  2456. , s = e("./enum/DirectorEvents")
  2457. , l = e("./settings")
  2458. , c = e("./enum/Viewmode")
  2459. , h = (e("./enum/WarpStyle"),
  2460. e("./enum/BlackoutStyle"),
  2461. e("./enum/ModelManagerEvents"))
  2462. , u = e("./enum/tagEvents")
  2463. , d = e("./util/transitions")
  2464. , p = e("./util/lerp")
  2465. , f = new o(i);
  2466. n.prototype.init = function(e, t, i, n, r) {
  2467. this.player = t,
  2468. this.director = e,
  2469. this.modelManager = i,
  2470. this.tagManager = n,
  2471. this.container = r,
  2472. this.updateModel(),
  2473. this.bindEvents()
  2474. }
  2475. ,
  2476. n.prototype.bindEvents = function() {
  2477. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2478. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2479. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2480. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2481. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2482. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2483. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2484. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2485. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2486. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2487. }
  2488. ,
  2489. n.prototype.updateModel = function() {
  2490. this.model = this.modelManager.getActiveModel()
  2491. }
  2492. ,
  2493. n.prototype.handleWarpStarted = function() {
  2494. this.hidePlayerReticule()
  2495. }
  2496. ,
  2497. n.prototype.ontagActivated = function() {
  2498. this.hidePlayerReticule()
  2499. }
  2500. ,
  2501. n.prototype.onNavigationTotag = function() {
  2502. this.hidePlayerReticule()
  2503. }
  2504. ,
  2505. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2506. var n = this.modelManager.getActiveModel()
  2507. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2508. //n.fadePanoMarkers(r),//MP
  2509. n.fadePanoMarkers(r,null,{player:this.player}),//xzw改
  2510. n.setMode(t)
  2511. }
  2512. ,
  2513. n.prototype.handlePlayerModeChanged = function(e, t) {
  2514. var i = this.modelManager.getActiveModel()
  2515. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2516. i.setSide(n),
  2517. i.setMode(t)
  2518. }
  2519. ,
  2520. /* n.prototype.handleClosestPanoChanging = function(e, t, i) {//MP
  2521. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2522. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2523. }
  2524. ,*/
  2525. n.prototype.handleClosestPanoChanging = function(e, t, player, posget1,posget2) {//xzw 改 e是closestPano,t是新的closestPano
  2526. if(player.mode !== h.TRANSITIONING) {
  2527. if(e && player.currentPano && !this.director.tourIsPlaying ){
  2528. var off;
  2529. if(posget1){
  2530. off = player.disablePanos.indexOf(e)==-1;
  2531. }else if(posget2){
  2532. off = player.posGets.list.indexOf(e.id)>-1;
  2533. }else{
  2534. off = player.currentPano.seeMarkers.indexOf(e.id)>-1
  2535. }
  2536. if(off)e.hoverOff(player.mode);
  2537. }
  2538. t && !this.director.tourIsPlaying && player.currentPano && (posget1 ? 1 : player.currentPano.seeMarkers.indexOf(t.id)>-1) && t.hoverOn(player.mode);
  2539. }
  2540. }
  2541. ,
  2542. n.prototype.handleActionInterruption = function() {}
  2543. ,
  2544. n.prototype.handleStartInside = function(e) {
  2545. var t = l[this.player.mode]
  2546. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2547. this.fadeIn(this.fadeInSpeed),
  2548. this.model.alpha = 0,
  2549. this.model.skybox.material.uniforms.opacity.value = 1,
  2550. //this.model.fadePanoMarkers(e ? 0 : t.markerOpacity); //MP
  2551. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity,null,{player:this.player}); //xzw改
  2552. var n = this.player.reticule;
  2553. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2554. }
  2555. ,
  2556. n.prototype.handleStartOutside = function(e) {
  2557. this.fadeIn(e)
  2558. }
  2559. ,
  2560. n.prototype.fadeIn = function(e) {
  2561. null !== e && void 0 !== e || (e = 2e3,
  2562. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2563. $(this.container).fadeIn(e)
  2564. }
  2565. ,
  2566. n.prototype.hidePlayerReticule = function() {
  2567. this.player.reticule.hide()
  2568. }
  2569. ,
  2570. t.exports = n
  2571. }
  2572. ).call(this, "/js/DisplayController.js")
  2573. }
  2574. , {
  2575. "./enum/BlackoutStyle": 18,
  2576. "./enum/DirectorEvents": 23,
  2577. "./enum/tagEvents": 32,
  2578. "./enum/ModelManagerEvents": 33,
  2579. "./enum/PlayerEvents": 40,
  2580. "./enum/Viewmode": 51,
  2581. "./enum/WarpStyle": 52,
  2582. "./settings": 166,
  2583. "./util/common": 185,
  2584. "./util/lerp": 188,
  2585. "./util/logger": 189,
  2586. "./util/transitions": 195,
  2587. three: 217
  2588. }],
  2589. 2: [function(e, t, i) {//"./TimingData"
  2590. "use strict";
  2591. function n() {
  2592. this.baseStartTime = performance.timing.navigationStart,
  2593. this.loadingStartTime = null,
  2594. this.waitingStartTime = null,
  2595. this.appReadyTime = null
  2596. }
  2597. n.prototype.setBaseStartTime = function(e) {
  2598. this.baseStartTime = e || Date.now()
  2599. }
  2600. ,
  2601. n.prototype.setWaitingStartTime = function(e) {
  2602. this.waitingStartTime = e || Date.now()
  2603. }
  2604. ,
  2605. n.prototype.setLoadingStartTime = function(e) {
  2606. this.loadingStartTime = e || Date.now()
  2607. }
  2608. ,
  2609. n.prototype.setAppReadyTime = function(e) {
  2610. this.appReadyTime = e || Date.now()
  2611. }
  2612. ,
  2613. n.prototype.calcFullLoadingTime = function() {
  2614. var e = this.appReadyTime - this.baseStartTime;
  2615. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2616. e
  2617. }
  2618. ,
  2619. t.exports = n
  2620. }
  2621. , {}],
  2622. 3: [function(e, t, i) {///js/ab.js
  2623. (function(i) {
  2624. "use strict";
  2625. function n() {
  2626. return 100 * Math.random()
  2627. }
  2628. var r = e("./util/logger")
  2629. , o = e("./util/browser")
  2630. , a = new r(i)
  2631. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2632. initialized: !1,
  2633. init: function(e, t) {
  2634. if (t = t || {},
  2635. !this.initialized) {
  2636. this.initialized = !0,
  2637. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2638. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2639. for (var i in e) {
  2640. var r = i.match("^sc_tilegen_([0-9]+)$");
  2641. r && (s.tilegen = n() < parseInt(r[1]));
  2642. var l = i.match("^sc_imgopt_([0-9]+)$");
  2643. l && (s.imgopt = n() < parseInt(l[1]))
  2644. }
  2645. for (var c in t)
  2646. s[c] = t[c],
  2647. a.debug("A/B override:", c, s[c])
  2648. }
  2649. },
  2650. changeIfTileGenerating: function(e) {
  2651. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2652. e += "imgopt=1"),
  2653. e
  2654. },
  2655. changeIfImageOptimzing: function(e) {
  2656. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2657. e += "imgopt=1"),
  2658. e
  2659. },
  2660. tilegen: !1,
  2661. imgopt: !1
  2662. };
  2663. t.exports = s
  2664. }
  2665. ).call(this, "/js/ab.js")
  2666. }
  2667. , {
  2668. "./util/browser": 182,
  2669. "./util/logger": 189
  2670. }],
  2671. 4: [function(e, t, i) {///js/analytics.js
  2672. (function(i) {
  2673. "use strict";
  2674. function n() {
  2675. return {
  2676. addons: [{
  2677. name: "keen:ua_parser",
  2678. input: {
  2679. ua_string: "user_agent"
  2680. },
  2681. output: "parsed_user_agent"
  2682. }]
  2683. }
  2684. }
  2685. function r(e, t, i, n) {
  2686. function r(t) {
  2687. l[t.sid] = !0;
  2688. var i = t.billboard.media && t.billboard.media.type
  2689. , n = {
  2690. tag_id: t.sid,
  2691. tags_visited: Object.keys(l).length,
  2692. tag_count: Object.keys(e.tags).length,
  2693. tag_view_count: ++E,
  2694. has_media: !!i
  2695. };
  2696. i && (n.media_type = i),
  2697. u("tag_opened", n)
  2698. }
  2699. var l = {}
  2700. , h = Date.now() - N
  2701. , f = null;
  2702. n && (f = Date.now() - window.navigationStart);
  2703. var g;
  2704. try {
  2705. g = e.data.player_options.highlight_reel && e.heroLocations.length > 1
  2706. } catch (e) {
  2707. g = !1
  2708. }
  2709. var v, A = e.supportsVR;
  2710. A || (v = "VR disabled at the model/account level",
  2711. 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"))),
  2712. u("model_loaded", {
  2713. duration: h,
  2714. duration_from_navigation_start: f,
  2715. has_hlr: g,
  2716. has_vr: A,
  2717. vr_reason: v
  2718. });
  2719. var I = 0;
  2720. e.panos.forEach(function(e) {
  2721. e.on("enter", function() {
  2722. c("pano_viewed", {
  2723. pano_id: e.id,
  2724. pano_view_count: ++I,
  2725. alignment_type: e.alignmentType,
  2726. interaction_source: O,
  2727. navigation_source: p
  2728. })
  2729. })
  2730. });
  2731. var E = 0;
  2732. for (var T in e.tags)
  2733. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2734. t.on("tour_auto", function(e) {
  2735. p = "tour_" + e
  2736. }),
  2737. t.on("tour_manual", function(e) {
  2738. O = "gui-" + e,
  2739. p = "tour_manual"
  2740. }),
  2741. i.on(C.InteractionKey, function() {
  2742. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2743. }),
  2744. i.on(C.InteractionDirect, function() {
  2745. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2746. }),
  2747. o(t),
  2748. a(),
  2749. s()
  2750. }
  2751. function o(e) {
  2752. I.on(T.OPENED, function() {
  2753. c("showcase_share_intent", {
  2754. pano_id: e.currentPano && e.currentPano.id
  2755. })
  2756. }),
  2757. I.on(T.LINK_CLICKED, function(t) {
  2758. c("showcase_share_action", {
  2759. channel: t.channel,
  2760. pano_id: e.currentPano && e.currentPano.id
  2761. })
  2762. }),
  2763. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2764. c("showcase_share_origin_link_clicked")
  2765. })
  2766. }
  2767. function a() {}
  2768. function s() {
  2769. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2770. gui_action: "click_vr_button"
  2771. })),
  2772. b.on(S.LAUNCH, function(e) {
  2773. c("showcase_gui", {
  2774. gui_action: "launch_vr",
  2775. vr_platform: e.vr_platform,
  2776. vr_app: e.vr_app
  2777. })
  2778. }),
  2779. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2780. gui_action: "vr_modal_prev"
  2781. })),
  2782. b.on(S.NEXT, function(e) {
  2783. c("showcase_gui", {
  2784. gui_action: e.nextAction
  2785. })
  2786. }),
  2787. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2788. gui_action: "vr_modal_close"
  2789. })),
  2790. b.on(S.falseICECHOSEN, function(e) {
  2791. c("showcase_gui", {
  2792. gui_action: e.name + " "
  2793. })
  2794. }),
  2795. b.on(S.STORE, function(e) {
  2796. c("showcase_gui", {
  2797. gui_action: "launch_store",
  2798. store: e
  2799. })
  2800. })
  2801. }
  2802. function l(e, t) {
  2803. if (f)
  2804. try {
  2805. f.addEvent(e, v.extendObject({
  2806. host: window.location.host,
  2807. keen: n(),
  2808. user_agent: "${keen.user_agent}",
  2809. referrer: {
  2810. url: v.normalizeUrl(document.referrer),
  2811. domain: v.domainFromUrl(document.referrer),
  2812. url_original: document.referrer
  2813. },
  2814. embedded: m.inIframe(),
  2815. is_mobile: m.isMobile(),
  2816. version: "2.25.6-0-gd87e5b1"
  2817. }, t))
  2818. } catch (e) {
  2819. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2820. }
  2821. }
  2822. function c(e, t) {
  2823. if (t = t || {},
  2824. L)
  2825. try {
  2826. window.analytics.track(e, v.extendObject(t, B), {
  2827. context: {
  2828. app: {
  2829. name: "showcase",
  2830. version: "2.25.6-0-gd87e5b1"
  2831. },
  2832. screen: {
  2833. width: window.screen.width,
  2834. height: window.screen.height,
  2835. density: window.devicePixelRatio
  2836. }
  2837. }
  2838. })
  2839. } catch (t) {
  2840. console.warn("Failed to send data to segment for " + e)
  2841. }
  2842. }
  2843. function h(e, t) {
  2844. if (t = t || {},
  2845. navigator.sendBeacon && L)
  2846. try {
  2847. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2848. event: e,
  2849. anonymousId: window.analytics.user().anonymousId(),
  2850. properties: v.extendObject(t, B),
  2851. writeKey: L,
  2852. sentAt: Date.now(),
  2853. type: "track",
  2854. context: {
  2855. userAgent: m.userAgent(),
  2856. library: {
  2857. name: "showcase-beacon",
  2858. version: "2.25.6-0-gd87e5b1"
  2859. },
  2860. app: {
  2861. name: "showcase",
  2862. version: "2.25.6-0-gd87e5b1"
  2863. }
  2864. }
  2865. }))
  2866. } catch (e) {
  2867. console.warn("Failed to send async segment request")
  2868. }
  2869. }
  2870. function u(e, t) {
  2871. t = t || {},
  2872. c(e, t)
  2873. }
  2874. function d(e, t) {
  2875. O = e === C.InteractionGui ? "gui-" + t : e,
  2876. p = "self_guided"
  2877. }
  2878. var p, f, g = (e("three"),
  2879. e("./util/ajax"),
  2880. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2881. 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"),
  2882. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2883. t.exports = {
  2884. report: function(e, t, i, n) {
  2885. l("Session starts", {
  2886. model: e,
  2887. status: t,
  2888. loadtime: Date.now() - (N || Date.now()),
  2889. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2890. autoplay: i,
  2891. quickstart: n,
  2892. ab_tilegen: g.tilegen,
  2893. ab_imgopt: g.imgopt
  2894. })
  2895. },
  2896. impression: function(e) {
  2897. e = e || {};
  2898. var t = void 0 === e.isVisible || e.isVisible
  2899. , i = (void 0 !== e.immediate && e.immediate,
  2900. window.location.search.substr(1).split("&"));
  2901. u("impression", {
  2902. visible: t,
  2903. url_params: i
  2904. })
  2905. },
  2906. initKeen: function(e) {
  2907. return e.token && e.appId ? void (f = new Keen({
  2908. projectId: e.appId,
  2909. writeKey: e.token,
  2910. readKey: "",
  2911. requestType: "xhr"
  2912. })) : void P.warn("no keen token/appId")
  2913. },
  2914. initSegment: function(e) {
  2915. return e.token ? (L = e.token,
  2916. window.analytics.load(e.token),
  2917. B = {
  2918. model_id: e.model,
  2919. start_source: e.startSource,
  2920. autoplay: e.autoplay,
  2921. quickstart: e.quickstart,
  2922. language_tag: A.languageTag,
  2923. is_mobile: m.isMobile(),
  2924. iframe: m.inIframe(),
  2925. aspect_ratio: m.aspectRatio(),
  2926. session_id: F,
  2927. window: {
  2928. width: $('#player').width(),
  2929. height: $('#player').height()
  2930. },
  2931. platform: {
  2932. browser: {
  2933. name: $.ua.browser.name,
  2934. major: $.ua.browser.major,
  2935. version: $.ua.browser.version
  2936. },
  2937. os: {
  2938. name: $.ua.os.name,
  2939. version: $.ua.os.version
  2940. },
  2941. device: {
  2942. vendor: $.ua.device.vendor,
  2943. model: $.ua.device.model,
  2944. type: $.ua.device.type
  2945. }
  2946. }
  2947. },
  2948. D = Math.random() < A.analytics.sessionTrackingRate,
  2949. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2950. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2951. },
  2952. sessionStart: function(e) {
  2953. P.debug("analytics user_session_start"),
  2954. c("session_started"),
  2955. N = Date.now(),
  2956. window.addEventListener("unload", function() {
  2957. h("session_ended", {
  2958. duration: Date.now() - N
  2959. })
  2960. })
  2961. },
  2962. modelLoaded: function(e, t, i, n) {
  2963. r(e, t, i, n)
  2964. },
  2965. loadComplete: function(e) {
  2966. var t = {
  2967. time_to_app_start: e
  2968. };
  2969. c("load_times", t)
  2970. },
  2971. track: function(e, t) {
  2972. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2973. c(e, t))
  2974. },
  2975. trackAlways: function(e, t) {
  2976. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2977. c(e, t)
  2978. },
  2979. getSessionId: function() {
  2980. return F
  2981. },
  2982. updateInteraction: d
  2983. }
  2984. }
  2985. ).call(this, "/js/analytics.js")
  2986. }
  2987. , {
  2988. "./ab": 3,
  2989. "./enum/ControlEvents": 21,
  2990. "./enum/PlayerEvents": 40,
  2991. "./enum/VROption": 47,
  2992. "./enum/VRPlatforms": 49,
  2993. "./enum/Viewmode": 51,
  2994. "./gui/sharing/ShareEvents": 76,
  2995. "./gui/sharing/modal": 77,
  2996. "./gui/title/TitleEvents": 80,
  2997. "./gui/title/titleBar": 82,
  2998. "./gui/vr/vrEvent": 85,
  2999. "./gui/vr/vrModal": 87,
  3000. "./localization/localize": 108,
  3001. "./tag/Billboard/BillboardEvent": 120,
  3002. "./settings": 166,
  3003. "./util/ajax": 181,
  3004. "./util/browser": 182,
  3005. "./util/common": 185,
  3006. "./util/logger": 189,
  3007. three: 217
  3008. }],
  3009. 5: [function(e, t, i) {//"../cameras/DollhouseCamera"
  3010. "use strict";
  3011. function n() {
  3012. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $('#player').width() / $('#player').height(), o.dollhouseNear, o.dollhouseFar),
  3013. this.controls = null
  3014. }
  3015. var r = e("three")
  3016. , o = e("../constants")
  3017. , a = e("../util/cameraLight");
  3018. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3019. n.prototype.updateAspect = function(e) {
  3020. this.aspect = e,
  3021. this.updateProjectionMatrix()
  3022. }
  3023. ,
  3024. t.exports = n
  3025. }
  3026. , {
  3027. "../constants": 8,
  3028. "../util/cameraLight": 184,
  3029. three: 217
  3030. }],
  3031. 6: [function(e, t, i) {//"../cameras/FloorplanCamera"
  3032. "use strict";
  3033. function n() {
  3034. var e = $('#player').width() / $('#player').height();
  3035. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3036. this.controls = null,
  3037. this.updateAspect(e)
  3038. }
  3039. var r = e("three")
  3040. , o = e("../constants");
  3041. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3042. n.prototype.updateAspect = function(e) {
  3043. this.aspect = e,
  3044. this.top = o.orthoBase / e,
  3045. this.bottom = -o.orthoBase / e,
  3046. this.updateProjectionMatrix()
  3047. }
  3048. ,
  3049. t.exports = n
  3050. }
  3051. , {
  3052. "../constants": 8,
  3053. three: 217
  3054. }],
  3055. 7: [function(e, t, i) {//"./cameras/PanoramaCamera"
  3056. "use strict";
  3057. function n() {
  3058. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $('#player').width() / $('#player').height(), o.insideNear, o.insideFar),
  3059. this.controls = null
  3060. }
  3061. var r = e("three")
  3062. , o = e("../settings")
  3063. , a = e("../util/cameraLight");
  3064. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3065. n.prototype.updateAspect = function(e) {
  3066. this.aspect = e,
  3067. this.updateProjectionMatrix()
  3068. }
  3069. ,
  3070. t.exports = n
  3071. }
  3072. , {
  3073. "../settings": 166,
  3074. "../util/cameraLight": 184,
  3075. three: 217
  3076. }],
  3077. 8: [function(e, t, i) {//"../../constants"
  3078. "use strict";
  3079. t.exports = {
  3080. signedUrlDefaultExpireTime: 24e4,
  3081. signedUrlCheckInterval: 1e4,
  3082. signedUrlRefreshBuffer: 15e3,
  3083. dollhouseFOV: 70,
  3084. dollhouseNear: 1,
  3085. dollhouseFar: 5e3,
  3086. insideFOV: 70,
  3087. insideFOVMax: 120,
  3088. insideNear: .1,
  3089. insideFar: 5e3,
  3090. insideLookSpeed: .12,
  3091. insideLookLimitUp: 40,
  3092. insideLookLimitDown: -40,
  3093. orthoNear: 1,
  3094. orthoFar: 5e3,
  3095. orthoBase: 10,
  3096. narrowLandscapeHeight: 290,
  3097. reallyNarrowLandscapeHeight: 250,
  3098. visionTilingStartDate: new Date("8/26/2016"),
  3099. visionTilingStartVersion: "1.1.407.13667",
  3100. windowHeightHighQualityThreshold: 900,
  3101. tourStepDelayDefault: 3500,
  3102. tourStepDelaySlideShow: 5e3,
  3103. workshopApsect: 9 / 16,
  3104. highQualityMaxZoom: 2,
  3105. ultraHighQualityMaxZoom: 3
  3106. }
  3107. }
  3108. , {}],
  3109. 9: [function(e, t, i) {//"./controls/CameraControls"
  3110. "use strict";
  3111. function n() {
  3112. this.activeControl = null,
  3113. this.controls = {},
  3114. this.cameras = {}
  3115. }
  3116. var r = e("./PanoramaControls")
  3117. , o = e("./DollhouseControls")
  3118. , a = e("./FloorplanControls")
  3119. , s = e("../cameras/PanoramaCamera")
  3120. , l = e("../cameras/DollhouseCamera")
  3121. , c = e("../cameras/FloorplanCamera")
  3122. , h = e("events").EventEmitter
  3123. , u = e("../enum/ControlEvents")
  3124. , d = e("../enum/ModelManagerEvents")
  3125. , p = e("../enum/Viewmode")
  3126. , f = e("../settings");
  3127. n.prototype = Object.create(h.prototype),
  3128. n.prototype.init = function(e, t) {
  3129. this.setUpControls(),
  3130. this.bindEvents(e, t)
  3131. }
  3132. ,
  3133. n.prototype.activateControls = function(e) {
  3134. this.activeControl && (this.activeControl.reset(),
  3135. this.activeControl.enabled = !1),
  3136. this.controls[e] && (this.controls[e].enabled = !0),
  3137. this.activeControl = this.controls[e]
  3138. }
  3139. ,
  3140. n.prototype.setUpControls = function() {
  3141. var e = {}
  3142. , t = {}
  3143. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3144. , n = [s, l, c]
  3145. , h = [r, o, a];
  3146. i.forEach(function(i, r) {
  3147. e[i] = new n[r],
  3148. t[i] = new h[r](e[i]),
  3149. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3150. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3151. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3152. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3153. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3154. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3155. }
  3156. .bind(this)),
  3157. this.controls = t,
  3158. this.cameras = e
  3159. }
  3160. ,
  3161. n.prototype.bindEvents = function(e, t) {
  3162. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3163. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3164. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3165. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3166. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this)),
  3167. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3168. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3169. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3170. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3171. e.addEventListener("contextmenu", function(e) {
  3172. e.preventDefault()
  3173. }),
  3174. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3175. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3176. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3177. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3178. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3179. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3180. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3181. t.on(d.ActiveModelChanged, function(e) {
  3182. this.setModelForControls(e.model)
  3183. }
  3184. .bind(this))
  3185. }
  3186. ,
  3187. n.prototype.setModelForControls = function(e) {
  3188. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3189. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3190. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3191. this.controls[e].setBounds(t)
  3192. }
  3193. .bind(this))
  3194. }
  3195. ,
  3196. n.prototype.onMouseDown = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && this.activeControl.onMouseDown(e)
  3199. }
  3200. ,
  3201. n.prototype.onMouseMove = function(e) {
  3202. e.preventDefault(),
  3203. this.activeControl && this.activeControl.onMouseMove(e)
  3204. }
  3205. ,
  3206. n.prototype.onMouseUp = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onMouseUp(e)
  3209. }
  3210. ,
  3211. n.prototype.onMouseOver = function(e) {
  3212. e.preventDefault(),
  3213. this.activeControl && this.activeControl.onMouseOver(e)
  3214. }
  3215. ,
  3216. n.prototype.onMouseWheel = function(e) {
  3217. e.preventDefault(),
  3218. this.activeControl && this.activeControl.onMouseWheel(e)
  3219. }
  3220. ,
  3221. n.prototype.onTouchStart = function(e) {
  3222. e.preventDefault(),
  3223. this.activeControl && this.activeControl.onTouchStart(e)
  3224. }
  3225. ,
  3226. n.prototype.onTouchMove = function(e) {
  3227. e.preventDefault(),
  3228. this.activeControl && this.activeControl.onTouchMove(e)
  3229. }
  3230. ,
  3231. n.prototype.onTouchEnd = function(e) {
  3232. e.preventDefault(),
  3233. this.activeControl && this.activeControl.onTouchEnd(e)
  3234. }
  3235. ,
  3236. n.prototype.onPointerDown = function(e) {
  3237. if (e.preventDefault(),
  3238. this.activeControl)
  3239. switch (e.pointerType) {
  3240. case "mouse":
  3241. this.activeControl.onMouseDown(e);
  3242. break;
  3243. default:
  3244. this.activeControl.onPointerDown(e)
  3245. }
  3246. }
  3247. ,
  3248. n.prototype.onPointerMove = function(e) {
  3249. if (e.preventDefault(),
  3250. this.activeControl)
  3251. switch (e.pointerType) {
  3252. case "mouse":
  3253. this.activeControl.onMouseMove(e);
  3254. break;
  3255. default:
  3256. this.activeControl.onPointerMove(e)
  3257. }
  3258. }
  3259. ,
  3260. n.prototype.onPointerUp = function(e) {
  3261. if (e.preventDefault(),
  3262. this.activeControl)
  3263. switch (e.pointerType) {
  3264. case "mouse":
  3265. this.activeControl.onMouseUp(e);
  3266. break;
  3267. default:
  3268. this.activeControl.onPointerUp(e)
  3269. }
  3270. }
  3271. ,
  3272. n.prototype.onPointerCancel = function(e) {
  3273. e.preventDefault(),
  3274. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3275. }
  3276. ,
  3277. n.prototype.onKeyDown = function(e) {
  3278. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3279. this.activeControl && this.activeControl.onKeyDown(e))
  3280. }
  3281. ,
  3282. n.prototype.onKeyUp = function(e) {
  3283. e.preventDefault(),
  3284. this.activeControl && this.activeControl.onKeyUp(e)
  3285. }
  3286. ,
  3287. t.exports = n
  3288. }
  3289. , {
  3290. "../cameras/DollhouseCamera": 5,
  3291. "../cameras/FloorplanCamera": 6,
  3292. "../cameras/PanoramaCamera": 7,
  3293. "../enum/ControlEvents": 21,
  3294. "../enum/ModelManagerEvents": 33,
  3295. "../enum/Viewmode": 51,
  3296. "../settings": 166,
  3297. "./DollhouseControls": 10,
  3298. "./FloorplanControls": 11,
  3299. "./PanoramaControls": 13,
  3300. events: 202
  3301. }],
  3302. 10: [function(e, t, i) {//"./DollhouseControls"
  3303. "use strict";
  3304. function n(e) {
  3305. a.call(this, e),
  3306. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3307. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3308. this.minDistance = o.dollhouseDefault.minDistance,
  3309. this.maxDistance = o.dollhouseDefault.maxDistance,
  3310. this.adjustedMinDistance = this.minDistance,
  3311. this.adjustedMaxDistance = this.maxDistance
  3312. }
  3313. var r = e("three")
  3314. , o = e("../settings")
  3315. , a = e("./OutsideControls");
  3316. n.prototype = Object.create(a.prototype),
  3317. n.prototype.pan = function(e, t) {
  3318. this.camera.updateMatrix();
  3319. var i = this.camera.position.clone().sub(this.target).length();
  3320. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3321. this.panLeft(2 * e * i / window.innerHeight),
  3322. this.panUp(-2 * t * i / window.innerHeight)
  3323. }
  3324. ,
  3325. n.prototype.updateZoom = function() {
  3326. var e = this.offset.length();
  3327. return e * this.scale
  3328. }
  3329. ,
  3330. n.prototype.setZoomBounds = function(e) {
  3331. var t = e.min.distanceTo(e.max);
  3332. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3333. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3334. this.minDistance = this.adjustedMinDistance,
  3335. this.maxDistance = this.adjustedMaxDistance
  3336. }
  3337. ,
  3338. n.prototype.resetRanges = function(e, t) {
  3339. e ? (this.minDistance = Math.min(e, this.minDistance),
  3340. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3341. this.maxDistance = this.adjustedMaxDistance),
  3342. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3343. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3344. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3345. }
  3346. ,
  3347. n.prototype.toJSON = function() {
  3348. return a.prototype.toJSON.call(this)
  3349. }
  3350. ,
  3351. t.exports = n
  3352. }
  3353. , {
  3354. "../settings": 166,
  3355. "./OutsideControls": 12,
  3356. three: 217
  3357. }],
  3358. 11: [function(e, t, i) {//"./FloorplanControls"
  3359. "use strict";
  3360. function n(e) {
  3361. a.call(this, e),
  3362. this.minDistance = 15,
  3363. this.maxDistance = 50,
  3364. this.noRotateUpDown = !0,
  3365. this.minPolarAngle = 0,
  3366. this.maxPolarAngle = 0,
  3367. this.mouseActions[l.LEFT] = s.PAN,
  3368. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3369. this.mouseActions[l.RIGHT] = s.ROTATE,
  3370. this.touchActions[1] = s.PAN,
  3371. this.touchActions[2] = s.ROTATE_DOLLY,
  3372. this.absoluteScale = 1,
  3373. this.currentScale = 1
  3374. }
  3375. var r = e("three")
  3376. , o = e("../settings")
  3377. , a = e("./OutsideControls")
  3378. , s = e("../enum/ControlActions")
  3379. , l = e("../enum/MouseButton")
  3380. , c = e("../util/math")
  3381. , h = e("../util/browser");
  3382. n.prototype = Object.create(a.prototype),
  3383. n.prototype.zoomToContain = function(e) {
  3384. var t = Math.max(e.x, e.z)
  3385. , i = Math.min(e.x, e.z)
  3386. , n = Math.max(t, i * this.camera.aspect)
  3387. , r = Math.max(i, t * this.camera.aspect);
  3388. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3389. this.currentScale = this.absoluteScale
  3390. }
  3391. ,
  3392. n.prototype.rotateToView = function(e, t) {
  3393. var i = 0
  3394. , n = h.aspectRatio() < 1
  3395. , r = e.x < e.z;
  3396. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3397. this.rotateLeft(i),
  3398. this.update(0)
  3399. }
  3400. ,
  3401. n.prototype.pan = function(e, t) {
  3402. this.camera.updateMatrix(),
  3403. this.panLeft(e * (this.camera.right - this.camera.left) / $('#player').width()),
  3404. this.panUp(-t * (this.camera.top - this.camera.bottom) / $('#player').height())
  3405. }
  3406. ,
  3407. n.prototype.updateZoom = function() {
  3408. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3409. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3410. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3411. this.camera.left = -o.orthoBase * this.currentScale,
  3412. this.camera.right = o.orthoBase * this.currentScale,
  3413. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3414. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3415. this.camera.updateProjectionMatrix(),
  3416. this.offset.length()
  3417. }
  3418. ,
  3419. n.prototype.toJSON = function() {
  3420. var e = new r.Quaternion
  3421. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3422. , i = new r.Quaternion;
  3423. return function() {
  3424. var n = a.prototype.toJSON.call(this);
  3425. return e.copy(n.camera_quaternion),
  3426. i.copy(t),
  3427. i.multiply(e),
  3428. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3429. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3430. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3431. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3432. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3433. n
  3434. }
  3435. }(),
  3436. t.exports = n
  3437. }
  3438. , {
  3439. "../enum/ControlActions": 20,
  3440. "../enum/MouseButton": 34,
  3441. "../settings": 166,
  3442. "../util/browser": 182,
  3443. "../util/math": 190,
  3444. "./OutsideControls": 12,
  3445. three: 217
  3446. }],
  3447. 12: [function(e, t, i) {//"./OutsideControls"
  3448. "use strict";
  3449. function n(e) {
  3450. this.camera = e,
  3451. this.camera.controls = this,
  3452. this.enabled = !1,
  3453. this.target = new r.Vector3,
  3454. this.targetBounds = new r.Box3,
  3455. this.zoomSpeed = 1,
  3456. this.minDistance = 0,
  3457. this.maxDistance = 1 / 0,
  3458. this.noRotateUpDown = !1,
  3459. this.rotateSpeed = 1,
  3460. this.keyboardZoomSpeed = 0,
  3461. this.keyPanSpeed = 7,
  3462. this.autoRotate = !1,
  3463. this.autoRotateSpeed = 2,
  3464. this.autoPan = !1,
  3465. this.autoPanPosition = new r.Vector3,
  3466. this.minPolarAngle = r.Math.degToRad(25),
  3467. this.maxPolarAngle = r.Math.degToRad(65),
  3468. this.rotationAcceleration = new r.Vector2,
  3469. this.rotationSpeed = new r.Vector2,
  3470. this.panAcceleration = new r.Vector2,
  3471. this.panSpeed = new r.Vector2,
  3472. this.rotateStart = new r.Vector2,
  3473. this.rotateEnd = new r.Vector2,
  3474. this.rotateDelta = new r.Vector2,
  3475. this.panStart = new r.Vector2,
  3476. this.panEnd = new r.Vector2,
  3477. this.panDelta = new r.Vector2,
  3478. this.panOffset = new r.Vector3,
  3479. this.offset = new r.Vector3,
  3480. this.dollyStart = new r.Vector2,
  3481. this.dollyEnd = new r.Vector2,
  3482. this.dollyDelta = new r.Vector2,
  3483. this.phiDelta = 0,
  3484. this.thetaDelta = 0,
  3485. this.scale = 1,
  3486. this.panVector = new r.Vector3,
  3487. this.lastPosition = new r.Vector3,
  3488. this.state = c.NONE,
  3489. this.mouseActions = {},
  3490. this.mouseActions[h.LEFT] = c.ROTATE,
  3491. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3492. this.mouseActions[h.RIGHT] = c.PAN,
  3493. this.touchActions = {},
  3494. this.touchActions[1] = c.ROTATE,
  3495. this.touchActions[2] = c.PAN_DOLLY,
  3496. this.lastMoveTime = 0,
  3497. this.pointersLimit = 2,
  3498. this.pointers = []
  3499. }
  3500. var r = e("three")
  3501. , o = e("../settings")
  3502. , a = e("../util/common")
  3503. , s = e("../util/math")
  3504. , l = e("../enum/Vectors")
  3505. , c = e("../enum/ControlActions")
  3506. , h = e("../enum/MouseButton")
  3507. , u = e("../enum/Keys")
  3508. , d = e("../enum/ControlEvents")
  3509. , p = e("events").EventEmitter
  3510. , f = 1e-6;
  3511. n.prototype = Object.create(p.prototype),
  3512. n.prototype.setBounds = function(e) {
  3513. this.targetBounds = e
  3514. }
  3515. ,
  3516. n.prototype.isEngaged = function() {
  3517. return this.state !== c.NONE
  3518. }
  3519. ,
  3520. n.prototype.rotateLeft = function(e) {
  3521. void 0 === e && (e = this.getAutoRotationAngle()),
  3522. this.thetaDelta -= e
  3523. }
  3524. ,
  3525. n.prototype.rotateUp = function(e) {
  3526. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3527. this.phiDelta -= e)
  3528. }
  3529. ,
  3530. n.prototype.panLeft = function(e) {
  3531. var t = this.camera.matrix.elements;
  3532. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3533. this.panOffset.multiplyScalar(-e),
  3534. this.panVector.add(this.panOffset)
  3535. }
  3536. ,
  3537. n.prototype.panUp = function(e) {
  3538. var t = this.camera.matrix.elements;
  3539. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3540. this.panOffset.multiplyScalar(-e),
  3541. this.panVector.add(this.panOffset)
  3542. }
  3543. ,
  3544. n.prototype.startRotating = function(e, t) {
  3545. e && this.navRotationAcc("x", e),
  3546. t && this.navRotationAcc("y", t)
  3547. }
  3548. ,
  3549. n.prototype.stopRotating = function(e) {
  3550. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3551. this.navRotationAcc("x", 0),
  3552. this.navRotationAcc("y", 0)
  3553. }
  3554. ,
  3555. n.prototype.setAutoPanPosition = function(e, t) {
  3556. var i = new r.Vector3
  3557. , n = new r.Vector3;
  3558. return function(e, t) {
  3559. i.copy(this.camera.position),
  3560. void 0 === e && null === e || i.setX(e),
  3561. void 0 === t && null === t || i.setZ(t);
  3562. var r = this.camera.position.distanceTo(this.target)
  3563. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3564. this.targetClamped = !1,
  3565. n.copy(i).addScaledVector(o, r),
  3566. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3567. i.copy(n).addScaledVector(o, -r),
  3568. this.targetClamped = !0),
  3569. this.autoPanPosition.x = i.x,
  3570. this.autoPanPosition.z = i.z,
  3571. this.autoPan && this.stopAutoPanning()
  3572. }
  3573. }(),
  3574. n.prototype.stopAutoPanning = function() {
  3575. var e = this.autoPan;
  3576. this.autoPan = !1,
  3577. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3578. }
  3579. ,
  3580. n.prototype.dollyIn = function(e) {
  3581. void 0 === e && (e = this.getZoomScale()),
  3582. this.scale /= e
  3583. }
  3584. ,
  3585. n.prototype.dollyOut = function(e) {
  3586. void 0 === e && (e = this.getZoomScale()),
  3587. this.scale *= e
  3588. }
  3589. ,
  3590. n.prototype.updatePan = function(e) {
  3591. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3592. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3593. this.autoPan) {
  3594. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3595. t.setY(0).clampLength(0, 50 * e),
  3596. this.target.add(t),
  3597. this.camera.position.add(t),
  3598. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3599. this.stopAutoPanning())
  3600. }
  3601. }
  3602. ,
  3603. n.prototype.update = function(e) {
  3604. e || (e = 1 / 60),
  3605. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3606. this.rotateLeft(-this.rotationSpeed.x),
  3607. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3608. this.updatePan(e);
  3609. var t = this.camera.position;
  3610. this.offset.copy(t).sub(this.target);
  3611. var i = Math.atan2(this.offset.x, this.offset.z)
  3612. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3613. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3614. i += this.thetaDelta,
  3615. n += this.phiDelta,
  3616. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3617. n = Math.max(f, Math.min(Math.PI - f, n));
  3618. var r = this.updateZoom();
  3619. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3620. this.target.add(this.panVector),
  3621. this.targetBounds.clampPoint(this.target, this.target),
  3622. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3623. this.offset.y = r * Math.cos(n),
  3624. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3625. t.copy(this.target).add(this.offset),
  3626. this.camera.lookAt(this.target),
  3627. this.thetaDelta = 0,
  3628. this.phiDelta = 0,
  3629. this.scale = 1,
  3630. this.panVector.set(0, 0, 0),
  3631. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3632. }
  3633. ,
  3634. n.prototype.getAutoRotationAngle = function() {
  3635. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3636. }
  3637. ,
  3638. n.prototype.getZoomScale = function() {
  3639. return Math.pow(.95, this.zoomSpeed)
  3640. }
  3641. ,
  3642. n.prototype.onMouseDown = function(e) {
  3643. if (this.enabled) {
  3644. switch (e.preventDefault(),
  3645. this.stopAutoPanning(),
  3646. this.mouseDown = !0,
  3647. this.state = this.mouseActions[e.button],
  3648. this.state) {
  3649. case c.ROTATE:
  3650. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3651. this.rotationSpeed.set(0, 0);
  3652. break;
  3653. case c.DOLLY:
  3654. this.dollyStart.set(e.clientX, e.clientY);
  3655. break;
  3656. case c.PAN:
  3657. this.panStart.set(e.clientX, e.clientY)
  3658. }
  3659. this.emit(d.InputStart, "mouse")
  3660. }
  3661. }
  3662. ,
  3663. n.prototype.onMouseMove = function(e) {
  3664. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3665. switch (e.preventDefault(),
  3666. this.state) {
  3667. case c.ROTATE:
  3668. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3669. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3670. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $('#player').width() * this.rotateSpeed),
  3671. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $('#player').height() * this.rotateSpeed),
  3672. this.rotateStart.copy(this.rotateEnd);
  3673. break;
  3674. case c.DOLLY:
  3675. this.dollyEnd.set(e.clientX, e.clientY),
  3676. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3677. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3678. t.call(this),
  3679. this.dollyStart.copy(this.dollyEnd);
  3680. break;
  3681. case c.PAN:
  3682. this.panEnd.set(e.clientX, e.clientY),
  3683. this.panDelta.subVectors(this.panEnd, this.panStart),
  3684. this.pan(this.panDelta.x, this.panDelta.y),
  3685. this.panStart.copy(this.panEnd)
  3686. }
  3687. this.emit(d.Move, "mouse"),
  3688. this.lastMoveTime = e.timeStamp,
  3689. this.update()
  3690. }
  3691. }
  3692. ,
  3693. n.prototype.onMouseUp = function(e) {
  3694. this.enabled && (this.mouseDown = !1,
  3695. this.state = c.NONE,
  3696. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3697. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3698. this.update(),
  3699. this.rotationAcceleration.set(0, 0),
  3700. this.rotateDelta.set(0, 0)))
  3701. }
  3702. ,
  3703. n.prototype.onMouseOver = function(e) {
  3704. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3705. }
  3706. ,
  3707. n.prototype.onMouseWheel = function(e) {
  3708. if (this.enabled && o.useWheel) {
  3709. this.emit(d.Move, "wheel");
  3710. var t = e.wheelDelta || -e.detail
  3711. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3712. i.call(this),
  3713. this.update()
  3714. }
  3715. }
  3716. ,
  3717. n.prototype.onKeyDown = function(e) {
  3718. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3719. this.handleKeyDown(e.which)))
  3720. }
  3721. ,
  3722. n.prototype.navRotationAcc = function(e, t) {
  3723. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3724. }
  3725. ,
  3726. n.prototype.navPanAcc = function(e, t) {
  3727. this.stopAutoPanning(),
  3728. this.panAcceleration[e] = t
  3729. }
  3730. ,
  3731. n.prototype.handleKeyDown = function(e) {
  3732. var t = !0;
  3733. switch (e) {
  3734. case u.UPARROW:
  3735. case u.I:
  3736. this.navRotationAcc("y", 1);
  3737. break;
  3738. case u.DOWNARROW:
  3739. case u.K:
  3740. this.navRotationAcc("y", -1);
  3741. break;
  3742. case u.LEFTARROW:
  3743. case u.J:
  3744. this.navRotationAcc("x", -1);
  3745. break;
  3746. case u.RIGHTARROW:
  3747. case u.L:
  3748. this.navRotationAcc("x", 1);
  3749. break;
  3750. case u.W:
  3751. this.navPanAcc("y", 1);
  3752. break;
  3753. case u.S:
  3754. this.navPanAcc("y", -1);
  3755. break;
  3756. case u.A:
  3757. this.navPanAcc("x", -1);
  3758. break;
  3759. case u.D:
  3760. this.navPanAcc("x", 1);
  3761. break;
  3762. default:
  3763. t = !1
  3764. }
  3765. t && this.emit(d.Move, "key")
  3766. }
  3767. ,
  3768. n.prototype.onKeyUp = function(e) {
  3769. this.enabled && (e.preventDefault(),
  3770. e.stopPropagation(),
  3771. this.handleKeyUp(e.which))
  3772. }
  3773. ,
  3774. n.prototype.handleKeyUp = function(e) {
  3775. switch (e) {
  3776. case u.I:
  3777. case u.K:
  3778. case u.UPARROW:
  3779. case u.DOWNARROW:
  3780. this.keyboardZoomSpeed = 0,
  3781. this.rotationAcceleration.y = 0;
  3782. break;
  3783. case u.J:
  3784. case u.L:
  3785. case u.LEFTARROW:
  3786. case u.RIGHTARROW:
  3787. this.rotationAcceleration.x = 0;
  3788. break;
  3789. case u.S:
  3790. case u.W:
  3791. this.panAcceleration.y = 0;
  3792. break;
  3793. case u.A:
  3794. case u.D:
  3795. this.panAcceleration.x = 0
  3796. }
  3797. }
  3798. ,
  3799. n.prototype.onTouchStart = function(e) {
  3800. if (this.enabled || this.state === c.NONE) {
  3801. e.preventDefault(),
  3802. e.stopPropagation(),
  3803. this.stopAutoPanning();
  3804. var t = function() {
  3805. if (2 === e.touches.length) {
  3806. var t = e.touches[0].pageX - e.touches[1].pageX
  3807. , i = e.touches[0].pageY - e.touches[1].pageY;
  3808. this.dollyStart.set(t, i)
  3809. }
  3810. }
  3811. .bind(this)
  3812. , i = function() {
  3813. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3814. }
  3815. .bind(this)
  3816. , n = function() {
  3817. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3818. }
  3819. .bind(this);
  3820. switch (this.state = this.touchActions[e.touches.length],
  3821. this.state) {
  3822. case c.PAN_DOLLY:
  3823. t();
  3824. case c.PAN:
  3825. i();
  3826. break;
  3827. case c.ROTATE_DOLLY:
  3828. t();
  3829. case c.ROTATE:
  3830. n()
  3831. }
  3832. this.rotationSpeed.set(0, 0),
  3833. this.emit(d.InputStart, "touch")
  3834. }
  3835. }
  3836. ,
  3837. n.prototype.onTouchMove = function(e) {
  3838. if (this.enabled && this.state !== c.NONE) {
  3839. e.preventDefault(),
  3840. e.stopPropagation();
  3841. var t = function() {
  3842. var t = e.touches[0].pageX - e.touches[1].pageX
  3843. , i = e.touches[0].pageY - e.touches[1].pageY;
  3844. this.dollyEnd.set(t, i);
  3845. var n = this.dollyStart.length() - this.dollyEnd.length();
  3846. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3847. this.dollyStart.copy(this.dollyEnd)
  3848. }
  3849. .bind(this)
  3850. , i = function() {
  3851. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3852. this.panDelta.subVectors(this.panEnd, this.panStart),
  3853. this.pan(this.panDelta.x, this.panDelta.y),
  3854. this.panStart.copy(this.panEnd),
  3855. this.rotateDelta.set(0, 0)
  3856. }
  3857. .bind(this)
  3858. , n = function() {
  3859. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3860. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3861. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $('#player').width() * this.rotateSpeed),
  3862. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $('#player').height() * this.rotateSpeed),
  3863. this.rotateStart.copy(this.rotateEnd)
  3864. }
  3865. .bind(this)
  3866. , r = function() {
  3867. if (2 === e.touches.length) {
  3868. var i = window.devicePixelRatio || 1
  3869. , r = e.touches[1].pageX - e.touches[0].pageX
  3870. , s = e.touches[1].pageY - e.touches[0].pageY
  3871. , l = Math.sqrt(r * r + s * s)
  3872. , h = Math.abs(this.dollyStart.length() - l);
  3873. if (h > o.input.touchMoveThreshold * i)
  3874. this.state = c.DOLLY,
  3875. t();
  3876. else {
  3877. var u = a.average(e.touches, "pageX")
  3878. , d = a.average(e.touches, "pageY")
  3879. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3880. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3881. this.rotateStart.set(u, d),
  3882. n())
  3883. }
  3884. }
  3885. }
  3886. .bind(this);
  3887. switch (this.state) {
  3888. case c.PAN_DOLLY:
  3889. t();
  3890. case c.PAN:
  3891. i();
  3892. break;
  3893. case c.ROTATE_DOLLY:
  3894. r();
  3895. break;
  3896. case c.DOLLY:
  3897. t();
  3898. break;
  3899. case c.ROTATE:
  3900. n();
  3901. break;
  3902. default:
  3903. this.state = c.NONE
  3904. }
  3905. this.lastMoveTime = e.timeStamp,
  3906. this.emit(d.Move, "touch")
  3907. }
  3908. }
  3909. ,
  3910. n.prototype.onTouchEnd = function(e) {
  3911. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3912. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3913. this.state = c.NONE,
  3914. this.update(),
  3915. this.rotationAcceleration.set(0, 0),
  3916. this.rotateDelta.set(0, 0))
  3917. }
  3918. ,
  3919. n.prototype.onPointerDown = function(e) {
  3920. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3921. id: e.pointerId,
  3922. pageX: e.pageX,
  3923. pageY: e.pageY
  3924. }),
  3925. e.touches = this.pointers,
  3926. this.onTouchStart(e)),
  3927. this.emit(d.InputStart, "pointer"))
  3928. }
  3929. ,
  3930. n.prototype.onPointerMove = function(e) {
  3931. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3932. e.pointerId === t.id && (t.pageX = e.pageX,
  3933. t.pageY = e.pageY)
  3934. }),
  3935. e.touches = this.pointers,
  3936. this.onTouchMove(e))
  3937. }
  3938. ,
  3939. n.prototype.onPointerUp = function(e) {
  3940. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3941. e.pointerId === t.id && this.pointers.splice(i, 1)
  3942. }
  3943. .bind(this)),
  3944. e.touches = this.pointers,
  3945. this.onTouchEnd(e))
  3946. }
  3947. ,
  3948. n.prototype.reset = function() {
  3949. this.state = c.NONE,
  3950. this.stopAutoPanning(),
  3951. this.rotationSpeed.set(0, 0),
  3952. this.rotationAcceleration.set(0, 0),
  3953. this.panSpeed.set(0, 0),
  3954. this.panAcceleration.set(0, 0)
  3955. }
  3956. ,
  3957. n.prototype.toJSON = function() {
  3958. var e = {
  3959. camera_position: {
  3960. x: s.toPrecision(this.camera.position.x, 4),
  3961. y: s.toPrecision(this.camera.position.y, 4),
  3962. z: s.toPrecision(this.camera.position.z, 4)
  3963. },
  3964. camera_quaternion: {
  3965. x: s.toPrecision(this.camera.quaternion.x, 4),
  3966. y: s.toPrecision(this.camera.quaternion.y, 4),
  3967. z: s.toPrecision(this.camera.quaternion.z, 4),
  3968. w: s.toPrecision(this.camera.quaternion.w, 4)
  3969. }
  3970. };
  3971. return e
  3972. }
  3973. ,
  3974. t.exports = n
  3975. }
  3976. , {
  3977. "../enum/ControlActions": 20,
  3978. "../enum/ControlEvents": 21,
  3979. "../enum/Keys": 30,
  3980. "../enum/MouseButton": 34,
  3981. "../enum/Vectors": 50,
  3982. "../settings": 166,
  3983. "../util/common": 185,
  3984. "../util/math": 190,
  3985. events: 202,
  3986. three: 217
  3987. }],
  3988. 13: [function(e, t, i) {///js/controls/PanoramaControls.js
  3989. (function(i) {
  3990. "use strict";
  3991. function n(e) {
  3992. this.camera = e,
  3993. this.camera.controls = this,
  3994. this.target = new r.Vector3(0,0,0),
  3995. this.lookVector = new r.Vector3,
  3996. this.lookSpeed = .05,
  3997. this.rotationAcc = new r.Vector2,
  3998. this.rotationSpeed = new r.Vector2,
  3999. this.lat = 0,
  4000. this.lon = 0,
  4001. this.phi = 0,
  4002. this.theta = 0,
  4003. this.enabled = !1,
  4004. this.locked = !1,
  4005. this.pointer = new r.Vector2(0,0),
  4006. this.rotationHistory = [],
  4007. this.rotationDifference = new r.Vector2,
  4008. this.pointerDragOn = !1,
  4009. this.pointerDragStart = new r.Vector2(0,0),
  4010. this.pinchDistance = 0,
  4011. this.moveStart = new r.Vector2,
  4012. this.moveTolerance = .01,
  4013. this.pointersLimit = 2,
  4014. this.pointers = []
  4015. }
  4016. var r = e("three")
  4017. , o = e("../util/logger")
  4018. , a = e("../settings")
  4019. , s = e("../util/common")
  4020. , l = e("../util/math")
  4021. , c = (e("../enum/Vectors"),
  4022. e("../enum/MouseButton"))
  4023. , h = e("../enum/Keys")
  4024. , u = e("../enum/ControlEvents")
  4025. , d = e("events").EventEmitter;
  4026. new o(i);
  4027. n.prototype = Object.create(d.prototype),
  4028. n.prototype.usable = function() {
  4029. return this.enabled && !this.locked
  4030. }
  4031. ,
  4032. n.prototype.lookAt = function(e) {
  4033. var t = this.camera.position.clone().sub(e)
  4034. , i = Math.atan(t.z / t.x);
  4035. i += t.x < 0 ? Math.PI : 0,
  4036. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4037. this.lon = r.Math.radToDeg(i) + 180;
  4038. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4039. , o = Math.atan(t.y / n);
  4040. this.lat = -r.Math.radToDeg(o)
  4041. }
  4042. ,
  4043. n.prototype.startLookAt = function(t,m,p,f, cameraPos){//xzw 加 看向热点的markspot
  4044. var e = cameraPos? cameraPos.clone().sub(t) : this.object.position.clone().sub(t)
  4045. , o = Math.atan(e.z / e.x);
  4046. o += e.x < 0 ? Math.PI : 0,
  4047. o += e.x > 0 && e.z < 0 ? 2 * Math.PI : 0;
  4048. var lon = r.Math.radToDeg(o) + 180;
  4049. var n = Math.sqrt(e.x * e.x + e.z * e.z)
  4050. , i = Math.atan(e.y / n);
  4051. var lat = -r.Math.radToDeg(i);
  4052. var add = (lon - this.lon)%360;
  4053. Math.abs(add) > 180 && ( add>0 ? add-=360 : add+=360 );
  4054. lon = this.lon + add;
  4055. var add = (lat - this.lat)%360;
  4056. Math.abs(add) > 180 && ( add>0 ? add-=360 : add+=360 );
  4057. lat = this.lat + add;
  4058. m.start(p.property(this, "lon", lon), 1200, null, 0,f["easeInOutQuad"]);
  4059. m.start(p.property(this, "lat", lat), 1200, null, 0,f["easeInOutQuad"]);
  4060. }
  4061. ,
  4062. n.prototype.startRotationFrom = function(e, t) {
  4063. l.convertScreenPositionToNDC(e, t, this.pointer),
  4064. this.pointerDragOn = !0,
  4065. this.pointerDragStart.copy(this.pointer),
  4066. this.moveStart.copy(this.pointer),
  4067. this.rotationHistory = [],
  4068. this.rotationSpeed.set(0, 0)
  4069. }
  4070. ,
  4071. n.prototype.onMouseOver = function(e) {
  4072. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4073. }
  4074. ,
  4075. n.prototype.onTouchStart = function(e) {
  4076. if (this.usable()) {
  4077. switch (e.preventDefault(),
  4078. e.stopPropagation(),
  4079. e.touches.length) {
  4080. case 1:
  4081. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4082. break;
  4083. case 2:
  4084. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width()
  4085. , i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height();
  4086. this.pinchDistance = Math.sqrt(t * t + i * i)
  4087. }
  4088. this.emit(u.InputStart, "touch")
  4089. }
  4090. }
  4091. ,
  4092. n.prototype.onPointerDown = function(e) {
  4093. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4094. id: e.pointerId,
  4095. clientX: e.clientX,
  4096. clientY: e.clientY
  4097. }),
  4098. e.touches = this.pointers,
  4099. this.onTouchStart(e),
  4100. this.emit(u.InputStart, "pointer"))
  4101. }
  4102. ,
  4103. n.prototype.onMouseDown = function(e) {
  4104. if (this.usable()) {
  4105. switch (e.preventDefault(),
  4106. e.stopPropagation(),
  4107. e.button) {
  4108. case c.LEFT:
  4109. this.startRotationFrom(e.clientX, e.clientY)
  4110. }
  4111. this.emit(u.InputStart, "mouse")
  4112. }
  4113. }
  4114. ,
  4115. n.prototype.updateRotation = function() {
  4116. if (this.usable() && this.pointerDragOn) {
  4117. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4118. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4119. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4120. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4121. , o = Math.atan2(e.y, i)
  4122. , a = Math.atan2(t.y, n);
  4123. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4124. e.y = 0,
  4125. t.y = 0;
  4126. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4127. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4128. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4129. this.pointerDragStart.copy(this.pointer)
  4130. }
  4131. }
  4132. ,
  4133. n.prototype.onMouseMove = function(e) {
  4134. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4135. 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"))
  4136. }
  4137. ,
  4138. n.prototype.onTouchMove = function(e) {
  4139. if (this.usable())
  4140. switch (this.emit(u.Move, "touch"),
  4141. e.touches.length) {
  4142. case 1:
  4143. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4144. break;
  4145. case 2:
  4146. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width()
  4147. , i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
  4148. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4149. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4150. this.emit(u.Pinch, n),
  4151. this.pinchDistance -= n)
  4152. }
  4153. }
  4154. ,
  4155. n.prototype.onPointerMove = function(e) {
  4156. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4157. e.pointerId === t.id && (t.clientX = e.clientX,
  4158. t.clientY = e.clientY)
  4159. }),
  4160. e.touches = this.pointers,
  4161. this.onTouchMove(e))
  4162. }
  4163. ,
  4164. n.prototype.endRotation = function() {
  4165. this.pointerDragOn = !1;
  4166. var e = s.averageVectors(this.rotationHistory);
  4167. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4168. }
  4169. ,
  4170. n.prototype.onTouchEnd = function(e) {
  4171. this.usable() && (e.preventDefault(),
  4172. e.stopPropagation(),
  4173. this.endRotation())
  4174. }
  4175. ,
  4176. n.prototype.onMouseUp = function(e) {
  4177. this.usable() && (e.preventDefault(),
  4178. e.stopPropagation(),
  4179. this.endRotation())
  4180. }
  4181. ,
  4182. n.prototype.onPointerUp = function(e) {
  4183. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4184. e.pointerId === t.id && this.pointers.splice(i, 1)
  4185. }
  4186. .bind(this)),
  4187. e.touches = this.pointers,
  4188. this.onTouchEnd(e))
  4189. }
  4190. ,
  4191. n.prototype.update = function(e) {
  4192. this.lon,
  4193. this.lat;
  4194. for (this.updateRotation(),
  4195. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4196. this.rotationHistory.shift();
  4197. this.lon += this.rotationDifference.x,
  4198. this.lat += this.rotationDifference.y,
  4199. this.rotationDifference.set(0, 0),
  4200. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4201. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4202. this.lon += this.rotationSpeed.x * e,
  4203. this.lat += this.rotationSpeed.y * e,
  4204. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4205. this.phi = r.Math.degToRad(90 - this.lat),
  4206. this.theta = r.Math.degToRad(this.lon),
  4207. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4208. this.lookVector.y = Math.cos(this.phi),
  4209. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4210. this.target.copy(this.lookVector).add(this.camera.position),
  4211. this.camera.lookAt(this.target)
  4212. }
  4213. ,
  4214. n.prototype.onMouseWheel = function(e) {
  4215. if (this.usable()) {
  4216. var t = e.wheelDelta || -e.detail;
  4217. this.emit(u.InteractionDirect),
  4218. this.emit(u.Scroll, t)
  4219. }
  4220. }
  4221. ,
  4222. n.prototype.onKeyDown = function(e) {
  4223. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4224. this.handleKeyDown(e.which)))
  4225. }
  4226. ,
  4227. n.prototype.handleKeyDown = function(e) {
  4228. var t = function(e, t) {
  4229. this.rotationAcc[e] = t
  4230. }
  4231. .bind(this);
  4232. this.emit(u.InteractionKey);
  4233. var i = !0;
  4234. switch (e) {
  4235. case h.LEFTARROW:
  4236. case h.J:
  4237. t("x", -1);
  4238. break;
  4239. case h.RIGHTARROW:
  4240. case h.L:
  4241. t("x", 1);
  4242. break;
  4243. case h.I:
  4244. t("y", 1);
  4245. break;
  4246. case h.K:
  4247. t("y", -1);
  4248. break;
  4249. default:
  4250. i = !1
  4251. }
  4252. i && this.emit(u.Move, "key")
  4253. }
  4254. ,
  4255. n.prototype.onKeyUp = function(e) {
  4256. this.usable() && (e.preventDefault(),
  4257. e.stopPropagation(),
  4258. this.handleKeyUp(e.which))
  4259. }
  4260. ,
  4261. n.prototype.handleKeyUp = function(e) {
  4262. switch (e) {
  4263. case h.LEFTARROW:
  4264. case h.J:
  4265. case h.RIGHTARROW:
  4266. case h.L:
  4267. this.rotationAcc.x = 0;
  4268. break;
  4269. case h.I:
  4270. case h.K:
  4271. this.rotationAcc.y = 0
  4272. }
  4273. }
  4274. ,
  4275. n.prototype.startRotating = function(e, t) {
  4276. e && (this.rotationAcc.x = e),
  4277. t && (this.rotationAcc.y = t)
  4278. }
  4279. ,
  4280. n.prototype.stopRotating = function(e) {
  4281. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4282. this.rotationAcc.set(0, 0)
  4283. }
  4284. ,
  4285. n.prototype.reset = function() {
  4286. this.pointerDragOn = !1,
  4287. this.rotationAcc.set(0, 0),
  4288. this.rotationSpeed.set(0, 0),
  4289. this.pointers = []
  4290. }
  4291. ,
  4292. n.prototype.toJSON = function() {
  4293. var e = {
  4294. camera_position: {
  4295. x: l.toPrecision(this.camera.position.x, 4),
  4296. y: l.toPrecision(this.camera.position.y, 4),
  4297. z: l.toPrecision(this.camera.position.z, 4)
  4298. },
  4299. camera_quaternion: {
  4300. x: l.toPrecision(this.camera.quaternion.x, 4),
  4301. y: l.toPrecision(this.camera.quaternion.y, 4),
  4302. z: l.toPrecision(this.camera.quaternion.z, 4),
  4303. w: l.toPrecision(this.camera.quaternion.w, 4)
  4304. }
  4305. };
  4306. return e
  4307. }
  4308. ,
  4309. n.prototype.setStateFromJSON = function(e) {
  4310. this.camera.position.copy(e.camera_position),
  4311. this.camera.quaternion.copy(e.camera_quaternion)
  4312. }
  4313. ,
  4314. t.exports = n
  4315. }
  4316. ).call(this, "/js/controls/PanoramaControls.js")
  4317. }
  4318. , {
  4319. "../enum/ControlEvents": 21,
  4320. "../enum/Keys": 30,
  4321. "../enum/MouseButton": 34,
  4322. "../enum/Vectors": 50,
  4323. "../settings": 166,
  4324. "../util/common": 185,
  4325. "../util/logger": 189,
  4326. "../util/math": 190,
  4327. events: 202,
  4328. three: 217
  4329. }],
  4330. 14: [function(e, t, i) {///js/controls/serializer.js
  4331. (function(i) {
  4332. "use strict";
  4333. var n = e("three")
  4334. , r = e("../enum/Viewmode")
  4335. , o = e("../util/logger")
  4336. , a = new o(i);
  4337. t.exports = {
  4338. serialize: function(e) {
  4339. return encodeURI(JSON.stringify(e))
  4340. },
  4341. deserialize: function(e) {
  4342. function t(e) {
  4343. function t(e, t) {
  4344. return e && "number" == typeof t && !isNaN(t)
  4345. }
  4346. return e.reduce(t, !0)
  4347. }
  4348. try {
  4349. var i = JSON.parse(decodeURI(e))
  4350. , o = {
  4351. mode: r.fromInt(i.camera_mode),
  4352. panoId: i.scan_id,
  4353. position: (new n.Vector3).copy(i.camera_position),
  4354. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4355. zoom: i.ortho_zoom,
  4356. floorVisibility: i.floor_visibility
  4357. }
  4358. , s = o.position;
  4359. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4360. var l = o.quaternion;
  4361. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4362. o
  4363. } catch (i) {
  4364. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4365. try {
  4366. var c = e.split(",")
  4367. , h = {
  4368. x: parseFloat(c[2]),
  4369. y: parseFloat(c[3]),
  4370. z: parseFloat(c[4])
  4371. }
  4372. , u = {
  4373. x: parseFloat(c[5]),
  4374. y: parseFloat(c[6]),
  4375. z: parseFloat(c[7]),
  4376. w: parseFloat(c[8])
  4377. };
  4378. return t([h.x, h.y, h.z]) || (h.x = 0,
  4379. h.y = 0,
  4380. h.z = 0),
  4381. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4382. u.y = 0,
  4383. u.z = 0,
  4384. u.w = 1),
  4385. {
  4386. mode: r.fromInt(c[0]),
  4387. panoId: c[1],
  4388. position: (new n.Vector3).copy(h),
  4389. quaternion: (new n.Quaternion).copy(u)
  4390. }
  4391. } catch (t) {
  4392. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4393. }
  4394. }
  4395. return null
  4396. }
  4397. }
  4398. }
  4399. ).call(this, "/js/controls/serializer.js")
  4400. }
  4401. , {
  4402. "../enum/Viewmode": 51,
  4403. "../util/logger": 189,
  4404. three: 217
  4405. }],
  4406. 15: [function(e, t, i) {///js/director.js
  4407. (function(i) {
  4408. "use strict";
  4409. function n() {
  4410. this.endlessLoop = a.warp.loop,
  4411. this.clock = new r.Clock(!0),
  4412. this.model = null,
  4413. this.player = null,
  4414. this.currentItem = null,
  4415. this.destinationItem = null,
  4416. this.tourIsPlaying = !1,
  4417. this.transitionStage = y.None,
  4418. this.nextFunc = null,
  4419. this.onTheBus = !1,
  4420. this.tourInProgress = !1,
  4421. this.reachSource = null,
  4422. this.interrupted = !1,
  4423. this.nItems = 0,
  4424. this.walkingSectionPaused = !1
  4425. }
  4426. var r = e("three")
  4427. , o = e("./util/logger")
  4428. , a = e("./settings")
  4429. , s = e("./util/transitions")
  4430. , l = e("events").EventEmitter
  4431. , c = e("./enum/Viewmode")
  4432. , h = e("./analytics")
  4433. , u = e("./enum/WarpStyle")
  4434. , s = e("./util/transitions")
  4435. , d = (e("./model/ModelManager"),
  4436. e("./enum/ModelManagerEvents"))
  4437. , p = e("./enum/DirectorEvents")
  4438. , f = e("./enum/PlayerEvents")
  4439. , g = (e("./enum/ControlEvents"),
  4440. e("./enum/BlackoutStyle"))
  4441. , m = e("./enum/PathDiscardMode")
  4442. , v = e("./enum/PathDisplayMode")
  4443. , editor = e('editor')
  4444. , A = (e("./player"),
  4445. new o(i))
  4446. , y = Object.freeze({
  4447. None: 0,
  4448. Moving: 1,
  4449. Aiming: 2,
  4450. Interlude: 3
  4451. })
  4452. , C = Object.freeze({
  4453. Forward: 1,
  4454. NoChange: 0,
  4455. Backwards: -1
  4456. })
  4457. , I = s.getUniqueId();
  4458. n.prototype = Object.create(l.prototype),
  4459. n.prototype.init = function(e, t) {
  4460. this.player = e,
  4461. this.modelManager = t,
  4462. this.updateModel(),
  4463. this.resetAll(),
  4464. this.bindEvents()
  4465. }
  4466. ,
  4467. n.prototype.resetAll = function() {
  4468. if (this.currentItem = null,
  4469. this.destinationItem = null,
  4470. this.tourIsPlaying = !1,
  4471. this.transitionStage = y.None,
  4472. this.nextFunc = null,
  4473. this.onTheBus = !1,
  4474. this.reachSource = null,
  4475. this.interrupted = !1,
  4476. this.model) {
  4477. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4478. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4479. } else
  4480. this.defaultWarpStyle = u.BLACK,
  4481. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4482. this.resetSpecialTransition()
  4483. }
  4484. ,
  4485. n.prototype.updateModel = function() {
  4486. this.model = this.modelManager.getActiveModel(),
  4487. this.nItems = this.model.heroLocations.length
  4488. }
  4489. ,
  4490. n.prototype.bindEvents = function() {
  4491. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4492. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4493. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4494. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4495. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4496. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4497. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4498. this.player.once(f.Move, function() {
  4499. s.cancelById(I)
  4500. })
  4501. }
  4502. ,
  4503. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4504. return e === u.WALK && (this.interrupt(g.NONE),
  4505. this.pauseWalkingSection(),
  4506. this.player.fastForwardActivePanoFlight(),
  4507. !0)
  4508. }
  4509. ,
  4510. n.prototype.handlePlayerMove = function(e) {
  4511. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4512. this.emit("update.controls")
  4513. }
  4514. ,
  4515. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4516. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4517. this.emit("update.controls"))
  4518. }
  4519. ,
  4520. n.prototype.handlePlayerModeChanged = function(e, t) {
  4521. this.intermediateState() || e === t || (this.onTheBus = !1,
  4522. this.emit("update.controls"))
  4523. }
  4524. ,
  4525. n.prototype.handlePlayerInputStart = function(e) {
  4526. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4527. }
  4528. ,
  4529. n.prototype.handlePlayerFlyingStarted = function() {
  4530. this.clearWalkingSectionPaused()
  4531. }
  4532. ,
  4533. n.prototype.describe = function() {
  4534. return {
  4535. nItems: this.nItems,
  4536. currentItem: this.currentItem,
  4537. destinationItem: this.destinationItem,
  4538. tourIsPlaying: this.tourIsPlaying,
  4539. onTheBus: this.onTheBus,
  4540. endlessLoop: this.endlessLoop,
  4541. viewMode: this.player.mode,
  4542. inTransition: this._inTransition(),
  4543. transitionStage: this.transitionStage,
  4544. tourInProgress: this.tourInProgress
  4545. }
  4546. }
  4547. ,
  4548. n.prototype._inTransition = function() {
  4549. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4550. }
  4551. ,
  4552. n.prototype.bounceable = function() {
  4553. var e = this.clock.getDelta();
  4554. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4555. }
  4556. ,
  4557. n.prototype.currentMoveDirection = function() {
  4558. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4559. }
  4560. ,
  4561. n.prototype.clearPath = function() {
  4562. this._inTransition() || this.player.path.discardPathObject()
  4563. }
  4564. ,
  4565. n.prototype.allFloors = function() {
  4566. this.model.toggleAllFloors()
  4567. }
  4568. ,
  4569. n.prototype.actionComplete = function(e) {
  4570. if (this.interrupted = !1,
  4571. this.transitionStage = y.None,
  4572. this.resetSpecialTransition(),
  4573. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4574. this.tourIsPlaying || (this.player.disablePreRendering(),
  4575. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers(null,null,{player:this.player})),
  4576. this.emit("update.controls"),
  4577. this.nextFunc) {
  4578. var t = this.nextFunc;
  4579. this.nextFunc = null,
  4580. t()
  4581. }
  4582. }
  4583. ,
  4584. n.prototype.awaitCompletion = function(e, t) {
  4585. this.nextFunc = t,
  4586. e()
  4587. }
  4588. ,
  4589. n.prototype.updateSuccessFunction = function(e) {
  4590. this.nextFunc = e
  4591. }
  4592. ,
  4593. n.prototype.interrupt = function(e, t) {
  4594. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4595. this.tourIsPlaying = !1,
  4596. this.interrupted = !0,
  4597. this.nextFunc = null,
  4598. this.emit(p.ActionInterrupted),
  4599. null !== e && void 0 !== e || (e = g.BEGINNING),
  4600. this.player.interruptAndFastForward(e, t),
  4601. !0)
  4602. }
  4603. ,
  4604. n.prototype.wouldInterrupt = function() {
  4605. return this.transitionStage !== y.None
  4606. }
  4607. ,
  4608. n.prototype.intermediateState = function() {
  4609. return this.transitionStage !== y.None
  4610. }
  4611. ,
  4612. n.prototype.isInterrupted = function() {
  4613. return this.interrupted
  4614. }
  4615. ,
  4616. n.prototype.pauseWalkingSection = function() {
  4617. this.walkingSectionPaused = !0
  4618. }
  4619. ,
  4620. n.prototype.clearWalkingSectionPaused = function() {
  4621. this.walkingSectionPaused = !1
  4622. }
  4623. ,
  4624. n.prototype.autoTour = function() {
  4625. var e = Date.now();
  4626. this.model.auxDataPromise.then(function() {
  4627. e = Date.now() - e;
  4628. var t = a.warp.auto
  4629. , i = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4630. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4631. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4632. done: function() {
  4633. this.playTour()
  4634. }
  4635. .bind(this),
  4636. name: "_atr",
  4637. id: I
  4638. })
  4639. }
  4640. .bind(this))
  4641. }
  4642. ,
  4643. n.prototype.atDestinationPano = function() {
  4644. if (!this.player.currentPano || null === this.destinationItem)
  4645. return !1;
  4646. var e = this.player.currentPano.id;
  4647. if (void 0 === e)
  4648. return !1;
  4649. var t = this.model.heroLocations;
  4650. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4651. }
  4652. ,
  4653. n.prototype.redirectToItem = function(e, t) {
  4654. if (null === e || void 0 === e)
  4655. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4656. if (!this.wouldInterrupt())
  4657. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4658. if (this.player.mode === c.TRANSITIONING)
  4659. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4660. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4661. var i = function() {
  4662. s.setTimeout(function() {
  4663. this.setDestinationItem(e),
  4664. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4665. }
  4666. .bind(this), 0)
  4667. }
  4668. .bind(this);
  4669. this.interrupt(g.END, 0),
  4670. this.updateSuccessFunction(i)
  4671. }
  4672. ,
  4673. n.prototype.useSpecialTransition = function(e) {
  4674. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4675. this.nextWarpStyle = u.BLACK
  4676. }
  4677. ,
  4678. n.prototype.resetSpecialTransition = function() {
  4679. this.nextWarpStyle = this.defaultWarpStyle
  4680. }
  4681. ,
  4682. n.prototype.arrivedAtDestination = function(e) {
  4683. if (this.player.flying || this.player.isWarping())
  4684. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4685. else {
  4686. this.transitionStage = y.Aiming;
  4687. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4688. this.player.model.fadePanoMarkers(0),
  4689. this.awaitCompletion(function() {
  4690. this.resetSpecialTransition(),
  4691. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4692. }
  4693. .bind(this), t)
  4694. }
  4695. }
  4696. ,
  4697. n.prototype.goToDestination = function(e, t, i, n) {
  4698. this.onTheBus = !0,
  4699. this.emit("update.controls");
  4700. this.player.updateLastView();
  4701. if (!n && this.atDestinationPano())//已到达 只需要旋转
  4702. return void this.arrivedAtDestination(!0);
  4703. if (this.player.flying || this.player.isWarping())
  4704. A.warn("Cannot go to new destination while player is flying or warping.");
  4705. else {
  4706. var r = this.model.getHeroDescriptorByIndex(this.destinationItem) //只是确保一下 获取heroLocations
  4707. , o = null
  4708. , a = null;
  4709. if (r.isPano()) {
  4710. var s = (0 === this.destinationItem || e ) ? u.BLACK : this.nextWarpStyle;//点击列表时、以及第一个与最后一个切换是黑色渐变 否则是walk
  4711. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, t, i, this.actionComplete.bind(this)),
  4712. o = this.arrivedAtDestination.bind(this, !0)
  4713. } else{
  4714. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4715. o = this.arrivedAtDestination.bind(this, !1);
  4716. }
  4717. this.transitionStage = y.Moving;
  4718. this.model.fadePanoMarkers(0);
  4719. this.awaitCompletion( function() { a() }.bind(this), o);
  4720. this.emit("update.controls")
  4721. }
  4722. }
  4723. ,
  4724. n.prototype.tourInterlude = function() {
  4725. if (h.trackAlways("reach_highlight", {
  4726. reach_source: this.reachSource
  4727. }),
  4728. this.model.fadePanoMarkers(0),
  4729. this.emit("update.controls"),
  4730. this.tourIsPlaying)
  4731. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4732. this.stopTour(),
  4733. this.emit(p.TourEnd),
  4734. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity,null,{player:this}))) : void this.awaitCompletion(function() {//xzw改 fadePanoMarker加了后俩参数
  4735. this.transitionStage = y.Interlude,
  4736. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4737. }
  4738. .bind(this), this.goNext.bind(this))
  4739. }
  4740. ,
  4741. n.prototype.playTour = function() {
  4742. if (!this.bounceable())
  4743. return this.tourIsPlaying ? void A.info("tour is already playing") :
  4744. void (this.wouldInterrupt() ||
  4745. (this.player.emit("tour_auto", this.defaultWarpStyle),
  4746. this.tourInProgress = !0,
  4747. this.reachSource = "play",
  4748. this.tourIsPlaying = !0,
  4749. this.wasZoomEnabled = this.player.zoomEnabled,
  4750. this.player.zoomEnabled = !1,
  4751. this.resetSpecialTransition(),
  4752. this.emit("update.controls"),
  4753. this.emit(p.TourStart),
  4754. this.player.enablePreRendering(),
  4755. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(), this.goToDestination()) : this.goNext()))
  4756. }
  4757. n.prototype.stopTour = function() {
  4758. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4759. this.tourIsPlaying = !1,
  4760. this.interrupt(),
  4761. this.clearWalkingSectionPaused(),
  4762. this.resetSpecialTransition(),
  4763. this.emit("update.controls"))
  4764. }
  4765. ,
  4766. n.prototype.endTourProgress = function() {
  4767. this.tourInProgress = !1,
  4768. this.emit("update.controls"),
  4769. this.emit(p.TourEnd)
  4770. }
  4771. ,
  4772. n.prototype.goToHighlight = function(e) {
  4773. if (this.wouldInterrupt())
  4774. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4775. else {
  4776. if (A.debug("<tour.goto " + e + ">"),
  4777. this.isInterrupted())
  4778. return;
  4779. this.clearWalkingSectionPaused(),
  4780. this.setDestinationItem(e),
  4781. this.useSpecialTransition("Hilight"),
  4782. this.goToDestination(),
  4783. h.trackAlways("reach_highlight", {
  4784. reach_source: "thumb"
  4785. })
  4786. }
  4787. }
  4788. ,
  4789. n.prototype.prevHighlight = function() {
  4790. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4791. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4792. this.reachSource = "prev",
  4793. this.goPrev()))
  4794. }
  4795. ,
  4796. n.prototype.nextHighlight = function() {
  4797. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4798. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4799. this.reachSource = "next",
  4800. this.goNext()))
  4801. }
  4802. ,
  4803. /* n.prototype.op = function(i,option) {//改
  4804. return function(){
  4805. option && option.openPanel && editor.openPanel(option.openPanel);
  4806. i();
  4807. }
  4808. }
  4809. , */
  4810. n.prototype.changeMode = function(e,option) {//模式转换
  4811. var t = $.Deferred()
  4812. , i = t.resolve.bind(t)
  4813. , n = t.reject.bind(t);
  4814. this.emit(p.StartModeChange);
  4815. var r = function() {
  4816. return this.clearWalkingSectionPaused(),
  4817. !!this.wouldInterrupt() && (this.interrupt(),
  4818. !0)
  4819. }
  4820. .bind(this);
  4821. if (!r()) {
  4822. switch (e) {
  4823. case c.PANORAMA:
  4824. this.player.mode === c.PANORAMA ?
  4825. ( this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(this.op(i, option )).fail(n) )
  4826. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4827. break;
  4828. case c.DOLLHOUSE:
  4829. case c.FLOORPLAN:
  4830. this.player.flyToNewMode({
  4831. mode: e
  4832. }).done(i).fail(n);
  4833. break;
  4834. case c.OUTDOOR:
  4835. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA
  4836. && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4837. }
  4838. return t.promise()
  4839. }
  4840. }
  4841. ,
  4842. n.prototype.atEndOfTour = function() {
  4843. var e = this.currentItem >= this.nItems - 1;
  4844. return e
  4845. }
  4846. ,
  4847. n.prototype.firstDestination = function() {
  4848. return this.nItems > 0 ? 0 : null
  4849. }
  4850. ,
  4851. n.prototype.finalDestination = function() {
  4852. return this.nItems > 0 ? this.nItems - 1 : null
  4853. }
  4854. ,
  4855. n.prototype.goPrev = function() {
  4856. this.tourAdvance(-1)
  4857. }
  4858. ,
  4859. n.prototype.goNext = function() {
  4860. this.tourAdvance(1)
  4861. }
  4862. ,
  4863. n.prototype.setDestinationItem = function(e) {
  4864. this.destinationItem = e,
  4865. this.emit("update.controls")
  4866. }
  4867. ,
  4868. n.prototype.setCurrentItem = function(e) {
  4869. this.currentItem = e,
  4870. this.emit("update.controls")
  4871. }
  4872. ,
  4873. n.prototype.nextItem = function(e) {
  4874. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4875. }
  4876. ,
  4877. n.prototype.prevItem = function(e) {
  4878. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4879. }
  4880. ,
  4881. n.prototype.tourAdvance = function(e) {//向前或向后
  4882. A.debug("tourAdvance(" + e + ")");
  4883. /* null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4884. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4885. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4886. this.useSpecialTransition("looping back to start")),
  4887. this.goToDestination() */
  4888. if( this.currentItem === null || void 0 === this.currentItem){//----重构
  4889. this.setDestinationItem(this.firstDestination())
  4890. }else{
  4891. this.setDestinationItem(this.currentItem + e);
  4892. if(this.destinationItem < 0){
  4893. this.setDestinationItem(this.finalDestination());
  4894. this.useSpecialTransition("reverse-looping to end")
  4895. }else{
  4896. if(this.destinationItem >= this.nItems){
  4897. this.setDestinationItem(this.firstDestination());
  4898. this.useSpecialTransition("looping back to start");
  4899. }
  4900. }
  4901. }
  4902. this.goToDestination()
  4903. }
  4904. ,
  4905. t.exports = n
  4906. }
  4907. ).call(this, "/js/director.js")
  4908. }
  4909. , {
  4910. "./analytics": 4,
  4911. "./enum/BlackoutStyle": 18,
  4912. "./enum/ControlEvents": 21,
  4913. "./enum/DirectorEvents": 23,
  4914. "./enum/ModelManagerEvents": 33,
  4915. "./enum/PathDiscardMode": 38,
  4916. "./enum/PathDisplayMode": 39,
  4917. "./enum/PlayerEvents": 40,
  4918. "./enum/Viewmode": 51,
  4919. "./enum/WarpStyle": 52,
  4920. "./model/ModelManager": 140,
  4921. "./player": 155,
  4922. "./settings": 166,
  4923. "./util/logger": 189,
  4924. "./util/transitions": 195,
  4925. events: 202,
  4926. three: 217,
  4927. editor : "Editor"
  4928. }],
  4929. 16: [function(e, t, i) {//"./effects"
  4930. "use strict";
  4931. var n = e("three")
  4932. , r = e("./enum/Viewmode")
  4933. , o = (e("./settings"),
  4934. e("./util/transitions"))
  4935. , a = e("./enum/PlayerEvents")
  4936. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4937. , l = new n.ShaderPass(n.VerticalBlurShader);
  4938. l.renderToScreen = !0;
  4939. var c = $('#player').width() / $('#player').height();
  4940. isNaN(c) && (c = 1);
  4941. var h = {
  4942. currentBlur: 0,
  4943. aspect: c,
  4944. blurStrength: 1,
  4945. hblurPass: s,
  4946. vblurPass: l,
  4947. bindEvents: function(e) {
  4948. e.on(a.ModeChanged, function(e, t) {
  4949. e === r.PANORAMA && (o.cancel(h.blur),
  4950. o.cancel(h.addBlur),
  4951. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4952. })
  4953. },
  4954. blur: function(e) {
  4955. h.currentBlur = e;
  4956. var t = e * h.blurStrength;
  4957. l.uniforms.v.value = t / 512 * h.aspect,
  4958. s.uniforms.h.value = t / 512
  4959. },
  4960. addBlur: function(e) {
  4961. e = Math.max(e, h.currentBlur),
  4962. h.blur(e)
  4963. },
  4964. removeBlur: function(e) {
  4965. e = Math.min(1 - e, h.currentBlur),
  4966. h.blur(e)
  4967. }
  4968. };
  4969. h.blur(0),
  4970. t.exports = h
  4971. }
  4972. , {
  4973. "./enum/PlayerEvents": 40,
  4974. "./enum/Viewmode": 51,
  4975. "./settings": 166,
  4976. "./util/transitions": 195,
  4977. three: 217
  4978. }],
  4979. 17: [function(e, t, i) {//"../enum/AlignmentType
  4980. "use strict";
  4981. t.exports = {
  4982. UNKNOWN: 0,
  4983. ALIGNED: 1,
  4984. UNALIGNED: 2,
  4985. PLACED: 3
  4986. }
  4987. }
  4988. , {}],
  4989. 18: [function(e, t, i) {//"../enum/BlackoutStyle"
  4990. "use strict";
  4991. t.exports = {
  4992. NONE: 0,
  4993. MIDDLE: 1,
  4994. END: 2,
  4995. BEGINNING: 3,
  4996. FADEIN: 4
  4997. }
  4998. }
  4999. , {}],
  5000. 19: [function(e, t, i) {//"../enum/Colors"
  5001. "use strict";
  5002. var n = e("three");
  5003. t.exports = {
  5004. newBlue: new n.Color(4967932),
  5005. altBlue: new n.Color(47355),
  5006. tagDefault: new n.Color(223357),
  5007. classicBlue: new n.Color(53759),
  5008. mpYellow: new n.Color(16502016),
  5009. mpOrange: new n.Color(16428055),
  5010. mpBlue: new n.Color(12096),
  5011. mpLtGrey: new n.Color(13751252),
  5012. mpDkGrey: new n.Color(10000019),
  5013. mpRed: new n.Color(12525854),
  5014. mpOrangeDesat: new n.Color(16764529),
  5015. mpBlueDesat: new n.Color(4034734),
  5016. mpRedDesat: new n.Color(14705505),
  5017. white: new n.Color(16777215),
  5018. black: new n.Color(0),
  5019. _desat: function(e, t) {
  5020. var i = t || .3
  5021. , r = (new n.Color).copy(e).getHSL();
  5022. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5023. },
  5024. _darken: function(e, t) {
  5025. var i = t || .2
  5026. , r = e.getHSL();
  5027. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5028. }
  5029. }
  5030. }
  5031. , {
  5032. three: 217
  5033. }],
  5034. 20: [function(e, t, i) {//"../enum/ControlActions"
  5035. "use strict";
  5036. t.exports = {
  5037. NONE: -1,
  5038. ROTATE: 0,
  5039. DOLLY: 1,
  5040. PAN: 2,
  5041. ROTATE_DOLLY: 3,
  5042. PAN_DOLLY: 4
  5043. }
  5044. }
  5045. , {}],
  5046. 21: [function(e, t, i) {//"./enum/ControlEvents"
  5047. "use strict";
  5048. t.exports = {
  5049. Move: "move",
  5050. InteractionDirect: "interaction.direct",
  5051. InteractionKey: "interaction.key",
  5052. InteractionGui: "interaction.gui",
  5053. FlyInDirection: "fly.direction",
  5054. InputStart: "input.start",
  5055. Pinch: "input.pinch",
  5056. Scroll: "input.scroll",
  5057. AutoPanInterrupt: "autopan.interrupt",
  5058. AutoPanComplete: "autopan.complete",
  5059. AutoPanClamped: "autopan.clamped",
  5060. LongTap: "longtap"
  5061. }
  5062. }
  5063. , {}],
  5064. 22: [function(e, t, i) {//"../enum/Direction"
  5065. "use strict";
  5066. t.exports = Object.freeze({
  5067. FORWARD: "FORWARD",
  5068. LEFT: "LEFT",
  5069. RIGHT: "RIGHT",
  5070. BACK: "BACK",
  5071. UP: "UP",
  5072. DOWN: "DOWN"
  5073. })
  5074. }
  5075. , {}],
  5076. 23: [function(e, t, i) {//"../enum/DirectorEvents"
  5077. "use strict";
  5078. t.exports = {
  5079. ActionInterrupted: "action.interrupted",
  5080. TourStart: "tour.start",
  5081. TourEnd: "tour.end",
  5082. StartModeChange: "mode.startChange"
  5083. }
  5084. }
  5085. , {}],
  5086. 24: [function(e, t, i) {//"../enum/DownloadStatus"
  5087. "use strict";
  5088. t.exports = Object.freeze({
  5089. None: 0,
  5090. Queued: 1,
  5091. ForceQueued: 2,
  5092. Downloading: 3,
  5093. Downloaded: 4,
  5094. DownloadFailed: 5
  5095. })
  5096. }
  5097. , {}],
  5098. 25: [function(e, t, i) {//"../enum/GLCubeFaces"
  5099. "use strict";
  5100. t.exports = {
  5101. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5102. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5103. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5104. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5105. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5106. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5107. }
  5108. }
  5109. , {}],
  5110. 26: [function(e, t, i) {//"../enum/GLTextureType"
  5111. "use strict";
  5112. t.exports = {
  5113. Texture2D: 0,
  5114. TextureCube: 1
  5115. }
  5116. }
  5117. , {}],
  5118. 27: [function(e, t, i) {//"../enum/HelpModalSize
  5119. "use strict";
  5120. t.exports = {
  5121. SMALL: "small",
  5122. LARGE: "large"
  5123. }
  5124. }
  5125. , {}],
  5126. 28: [function(e, t, i) {//"../enum/HelpModalType"
  5127. "use strict";
  5128. var n = e("./Viewmode")
  5129. , r = {
  5130. LANDING: {},
  5131. NAVIGATION: "navigation",
  5132. MORE_HELP: "moreHelp",
  5133. TOUR_INTERACTION: {}
  5134. };
  5135. r.LANDING[n.PANORAMA] = "panorama.landing",
  5136. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5137. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5138. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5139. r.TOUR_INTERACTION.standard = "standard.tour",
  5140. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5141. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5142. t.exports = r
  5143. }
  5144. , {
  5145. "./Viewmode": 51
  5146. }],
  5147. 29: [function(e, t, i) {//"../enum/Joystick"
  5148. "use strict";
  5149. var n = {
  5150. UP: 1,
  5151. DOWN: -1,
  5152. LEFT: "L",
  5153. RIGHT: "R",
  5154. FORWARD: "F",
  5155. BACK: "B",
  5156. reverse: {},
  5157. opposite: function(e) {
  5158. return this.reverse[e.toString()]
  5159. }
  5160. };
  5161. !function() {
  5162. n.reverse[n.UP] = n.DOWN,
  5163. n.reverse[n.DOWN] = n.UP,
  5164. n.reverse[n.LEFT] = n.RIGHT,
  5165. n.reverse[n.RIGHT] = n.LEFT,
  5166. n.reverse[n.FORWARD] = n.BACK,
  5167. n.reverse[n.BACK] = n.FORWARD
  5168. }(),
  5169. t.exports = n
  5170. }
  5171. , {}],
  5172. 30: [function(e, t, i) {//"../enum/Keys"
  5173. "use strict";
  5174. var n = e("../util/browser")
  5175. , r = {
  5176. ZERO: 48,
  5177. ONE: 49,
  5178. TWO: 50,
  5179. THREE: 51,
  5180. FOUR: 52,
  5181. FIVE: 53,
  5182. SIX: 54,
  5183. SEVEN: 55,
  5184. EIGHT: 56,
  5185. NINE: 57,
  5186. LEFTARROW: 37,
  5187. UPARROW: 38,
  5188. RIGHTARROW: 39,
  5189. DOWNARROW: 40,
  5190. A: 65,
  5191. B: 66,
  5192. C: 67,
  5193. D: 68,
  5194. E: 69,
  5195. F: 70,
  5196. G: 71,
  5197. H: 72,
  5198. I: 73,
  5199. J: 74,
  5200. K: 75,
  5201. L: 76,
  5202. M: 77,
  5203. N: 78,
  5204. O: 79,
  5205. P: 80,
  5206. Q: 81,
  5207. R: 82,
  5208. S: 83,
  5209. T: 84,
  5210. U: 85,
  5211. V: 86,
  5212. W: 87,
  5213. X: 88,
  5214. Y: 89,
  5215. Z: 90,
  5216. SPACE: 32,
  5217. RETURN: 13,
  5218. SEMICOLON: 186,
  5219. PLUSEQUALS: 187,
  5220. DASHUNDERSCORE: 189,
  5221. OPENBRACKET: 219
  5222. };
  5223. n.detectFirefox() && (r.SEMICOLON = 59,
  5224. r.PLUSEQUALS = 61,
  5225. r.DASHUNDERSCORE = 173),
  5226. t.exports = r
  5227. }
  5228. , {
  5229. "../util/browser": 182
  5230. }],
  5231. 31: [function(e, t, i) {//"../enum/Locale"
  5232. "use strict";
  5233. t.exports = {
  5234. EN_US: "en-US",
  5235. ES_MX: "es-MX",
  5236. FR_FR: "fr-FR",
  5237. DE_DE: "de-DE",
  5238. RU_RU: "ru-RU",
  5239. CN_CN: "cn-CN",
  5240. JP_JP: "jp-JP"
  5241. }
  5242. }
  5243. , {}],
  5244. 32: [function(e, t, i) {//"../enum/tagEvents"
  5245. "use strict";
  5246. t.exports = {
  5247. TagActivated: "tag.activated",
  5248. TagDismissed: "tag.dismissed",
  5249. TagNavigation: "tag.navigation"
  5250. }
  5251. }
  5252. , {}],
  5253. 33: [function(e, t, i) {//../enum/ModelManagerEvents"
  5254. "use strict";
  5255. t.exports = {
  5256. ModelAdded: "model-added",
  5257. ActiveModelChanged: "active-model-changed"
  5258. }
  5259. }
  5260. , {}],
  5261. 34: [function(e, t, i) {//"../enum/MouseButton"
  5262. "use strict";
  5263. t.exports = {
  5264. LEFT: 0,
  5265. MIDDLE: 1,
  5266. RIGHT: 2
  5267. }
  5268. }
  5269. , {}],
  5270. 35: [function(e, t, i) {//"../enum/PanoRendererEvents"
  5271. "use strict";
  5272. t.exports = {
  5273. PanoRenderComplete: "panorama.render.complete",
  5274. TileRenderFailure: "panorama.tile.render.failed",
  5275. TileRenderSuccess: "panorama.tile.render.success",
  5276. TileUploadAttempted: "panorama.tile.upload.attempted",
  5277. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5278. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5279. }
  5280. }
  5281. , {}],
  5282. 36: [function(e, t, i) {//"./enum/PanoSizeClass"
  5283. "use strict";
  5284. t.exports = {
  5285. BASE: 1,
  5286. STANDARD: 2,
  5287. HIGH: 3,
  5288. ULTRAHIGH: 4
  5289. }
  5290. }
  5291. , {}],
  5292. 37: [function(e, t, i) {//"./enum/PanoramaEvents"
  5293. "use strict";
  5294. t.exports = {
  5295. LoadComplete: "panorama.load.complete",
  5296. LoadFailed: "panorama.load.failed",
  5297. TileLoaded: "panorama.tile.loaded"
  5298. }
  5299. }
  5300. , {}],
  5301. 38: [function(e, t, i) {//"../enum/PathDiscardMode"
  5302. "use strict";
  5303. t.exports = Object.freeze({
  5304. Standard: 0,
  5305. Slow: 1,
  5306. Retain: 2
  5307. })
  5308. }
  5309. , {}],
  5310. 39: [function(e, t, i) {//"../enum/PathDisplayMode
  5311. "use strict";
  5312. t.exports = Object.freeze({
  5313. Show: 0,
  5314. Hide: 1,
  5315. Retain: 2
  5316. })
  5317. }
  5318. , {}],
  5319. 40: [function(e, t, i) {//"./enum/PlayerEvents"
  5320. "use strict";
  5321. t.exports = {
  5322. Move: "move",
  5323. MoveComplete: "move.complete",
  5324. ModeChanged: "mode.changed",
  5325. ModeChanging: "mode.changing",
  5326. PanoChosen: "pano.chosen",
  5327. ClosestPanoChanging: "closest.pano.changing",
  5328. WarpStarted: "warp.started",
  5329. WarpInterrupted: "warp.interrupted",
  5330. WarpEnded: "warp.ended",
  5331. FlyinFinished: "flyin.finished",
  5332. FlyingStarted: "flying.started",
  5333. FlyingInterrupted: "flying.interrupted",
  5334. FlyingEnded: "flying.ended",
  5335. Ready: "ready",
  5336. StartInside: "start.inside",
  5337. StartOutside: "start.outside",
  5338. ViewChanged: "view.changed",
  5339. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5340. InputStart: "input.start"
  5341. }
  5342. }
  5343. , {}],
  5344. 41: [function(e, t, i) {//"./enum/RenderLayers"
  5345. "use strict";
  5346. t.exports = Object.freeze({
  5347. DEFAULT: 0,
  5348. PANOMARKERS: 1,
  5349. RETICULE: 2,
  5350. TAG: 3
  5351. })
  5352. }
  5353. , {}],
  5354. 42: [function(e, t, i) {//"../enum/RenderOrder"
  5355. "use strict";
  5356. t.exports = {
  5357. visibleFloor: 1,
  5358. ghostFloor: 3,
  5359. boundingSkybox: 1,
  5360. panoMarker: 2,
  5361. reticule: 3,
  5362. tagStem: 4,
  5363. tagDisc: 5,
  5364. ribbon: 100
  5365. }
  5366. }
  5367. , {}],
  5368. 43: [function(e, t, i) {//"../enum/SceneRendererEvents"
  5369. "use strict";
  5370. t.exports = {
  5371. ContextCreated: "scene-renderer-context-created",
  5372. AfterRender: "after-render",
  5373. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5374. }
  5375. }
  5376. , {}],
  5377. 44: [function(e, t, i) {//"../enum/TagStates"
  5378. "use strict";
  5379. t.exports = {
  5380. IDLE: "idle",
  5381. BROWSE: "browse",
  5382. EXAMINE: "examine"
  5383. }
  5384. }
  5385. , {}],
  5386. 45: [function(e, t, i) {//"../enum/TileDownloaderEvents"
  5387. "use strict";
  5388. t.exports = {
  5389. TileDownloadSuccess: "tiledownloader.download.success",
  5390. TileDownloadFailure: "tiledownloader.download.failure",
  5391. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5392. }
  5393. }
  5394. , {}],
  5395. 46: [function(e, t, i) {//"../../enum/VRApps"
  5396. "use strict";
  5397. t.exports = {
  5398. CardboardAndroid: "googlevr",
  5399. GearVR: "gearvr",
  5400. CardboardIOS: "googlevrios",
  5401. Cardboard: "googlevr"
  5402. }
  5403. }
  5404. , {}],
  5405. 47: [function(e, t, i) {//"../enum/VROption"
  5406. "use strict";
  5407. t.exports = {
  5408. NONE: 0,
  5409. CONTEXTUAL: 1,
  5410. ANDROID: 2
  5411. }
  5412. }
  5413. , {}],
  5414. 48: [function(e, t, i) {//"../../enum/VRPages"
  5415. "use strict";
  5416. var n = {
  5417. Title: 0,
  5418. Cardboard: 1
  5419. }
  5420. , r = {
  5421. Title: 0,
  5422. Cardboard: 1,
  5423. Gear: 2
  5424. };
  5425. !function() {
  5426. [n, r].forEach(function(e) {
  5427. e.pageCount = Object.keys(e).length
  5428. })
  5429. }(),
  5430. t.exports.ios = n,
  5431. t.exports.standard = r
  5432. }
  5433. , {}],
  5434. 49: [function(e, t, i) {//"../../enum/VRPlatforms"
  5435. "use strict";
  5436. t.exports = {
  5437. Android: "android",
  5438. IOS: "ios",
  5439. Desktop: "desktop",
  5440. UnsupportedAndroid: "android-unsupported"
  5441. }
  5442. }
  5443. , {}],
  5444. 50: [function(e, t, i) {//"../enum/Vectors"
  5445. "use strict";
  5446. var n = e("three");
  5447. t.exports = {
  5448. UP: new n.Vector3(0,1,0),
  5449. DOWN: new n.Vector3(0,-1,0),
  5450. LEFT: new n.Vector3(-1,0,0),
  5451. RIGHT: new n.Vector3(1,0,0),
  5452. FORWARD: new n.Vector3(0,0,-1),
  5453. BACK: new n.Vector3(0,0,1)
  5454. }
  5455. }
  5456. , {
  5457. three: 217
  5458. }],
  5459. 51: [function(e, t, i) {//"./enum/Viewmode"
  5460. "use strict";
  5461. var n = e("../exception/ViewmodeConvertException")
  5462. , r = e("./coreViewmodes")
  5463. , o = e("../util/common")
  5464. , a = {
  5465. MESH: "mesh",
  5466. OUTDOOR: "outdoor",
  5467. TRANSITIONING: "transitioning",
  5468. toInt: function(e) {
  5469. switch (e) {
  5470. case this.PANORAMA:
  5471. return 1;
  5472. case this.DOLLHOUSE:
  5473. return 2;
  5474. case this.FLOORPLAN:
  5475. return 3;
  5476. case this.OUTDOOR:
  5477. return 4;
  5478. case this.TRANSITIONING:
  5479. return -1
  5480. }
  5481. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5482. },
  5483. fromInt: function(e) {
  5484. switch (e) {
  5485. case "1":
  5486. case 1:
  5487. return this.PANORAMA;
  5488. case "2":
  5489. case 2:
  5490. return this.DOLLHOUSE;
  5491. case "3":
  5492. case 3:
  5493. return this.FLOORPLAN;
  5494. case "4":
  5495. case 4:
  5496. return this.OUTDOOR
  5497. }
  5498. throw new n("No known conversion for int to viewmode for int: " + e)
  5499. },
  5500. convertWorkshopModeInt: function(e) {
  5501. switch (e) {
  5502. case "0":
  5503. case 0:
  5504. return this.PANORAMA;
  5505. case "1":
  5506. case 1:
  5507. return this.FLOORPLAN;
  5508. case "2":
  5509. case 2:
  5510. return this.DOLLHOUSE;
  5511. case "3":
  5512. case 3:
  5513. return this.MESH
  5514. }
  5515. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5516. }
  5517. };
  5518. o.extendObject(a, r),
  5519. t.exports = a
  5520. }
  5521. , {
  5522. "../exception/ViewmodeConvertException": 58,
  5523. "../util/common": 185,
  5524. "./coreViewmodes": 54
  5525. }],
  5526. 52: [function(e, t, i) {//"./enum/WarpStyle"
  5527. "use strict";
  5528. t.exports = {
  5529. BLACK: "black",
  5530. STD: "std",
  5531. WALK: "walk"
  5532. }
  5533. }
  5534. , {}],
  5535. 53: [function(e, t, i) {//"../enum/ZoomEvents"
  5536. "use strict";
  5537. t.exports = {
  5538. ZoomIn: "zoom.in",
  5539. ZoomOut: "zoom.out",
  5540. ZoomMax: "zoom.max",
  5541. ZoomMin: "zoom.min"
  5542. }
  5543. }
  5544. , {}],
  5545. 54: [function(e, t, i) {//"./coreViewmodes"
  5546. "use strict";
  5547. t.exports = {
  5548. PANORAMA: "panorama",
  5549. DOLLHOUSE: "dollhouse",
  5550. FLOORPLAN: "floorplan"
  5551. }
  5552. }
  5553. , {}],
  5554. 55: [function(e, t, i) {//"./BasicException"
  5555. "use strict";
  5556. function n(e) {
  5557. this.message = e
  5558. }
  5559. t.exports = n
  5560. }
  5561. , {}],
  5562. 56: [function(e, t, i) {//"../exception/DeviceMismatchException"
  5563. "use strict";
  5564. function n(e) {
  5565. r.call(this, e)
  5566. }
  5567. var r = e("./BasicException");
  5568. n.prototype = Object.create(r.prototype),
  5569. t.exports = n
  5570. }
  5571. , {
  5572. "./BasicException": 55
  5573. }],
  5574. 57: [function(e, t, i) {//"../exception/RendererCreationException"
  5575. "use strict";
  5576. function n(e) {
  5577. r.call(this, e)
  5578. }
  5579. var r = e("./BasicException");
  5580. n.prototype = Object.create(r.prototype),
  5581. t.exports = n
  5582. }
  5583. , {
  5584. "./BasicException": 55
  5585. }],
  5586. 58: [function(e, t, i) {//"../exception/ViewmodeConvertException"
  5587. "use strict";
  5588. function n(e) {
  5589. r.call(this, e)
  5590. }
  5591. var r = e("./BasicException");
  5592. n.prototype = Object.create(r.prototype),
  5593. t.exports = n
  5594. }
  5595. , {
  5596. "./BasicException": 55
  5597. }],
  5598. 59: [function(e, t, i) {///js/featureflags.js
  5599. (function(i) {
  5600. "use strict";
  5601. function n(e) {
  5602. var t = {};
  5603. if (e) {
  5604. var i = e.flags;
  5605. if (i)
  5606. for (var n in i)
  5607. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5608. return t
  5609. }
  5610. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5611. null
  5612. }
  5613. var r = e("./util/ajax")
  5614. , o = e("./util/showcase")
  5615. , a = e("./util/logger")
  5616. //, s = "/api/v1/user/"
  5617. , s = "/data/"
  5618. , l = new a(i)
  5619. , c = {};
  5620. t.exports = {
  5621. loadFeatureFlags: function(e) {
  5622. var t = $.Deferred();
  5623. return r.get(e.urlBase + s, {
  5624. responseType: "json",
  5625. prefetchFrom: "user",
  5626. auth: o.getAuthorizationHeader()
  5627. }).done(function(e) {
  5628. c = n(e),
  5629. c ? t.resolve(c) : t.reject("loading-failed")
  5630. }).fail(function() {
  5631. l.debug("Retrieval of feature flags failed."),
  5632. t.reject("loading-failed")
  5633. }),
  5634. t.promise()
  5635. },
  5636. getFlags: function() {
  5637. return c
  5638. },
  5639. updateDependentSettings: function(e, t) {
  5640. e = e || c,
  5641. e.labels && (t.labels.enabled = !0),
  5642. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5643. e.showcase_sdk && (t.sdkInit = !0),
  5644. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5645. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5646. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5647. e.hide_sc_sharing && (t.share.enabled = !1)
  5648. }
  5649. }
  5650. }
  5651. ).call(this, "/js/featureflags.js")
  5652. }
  5653. , {
  5654. "./util/ajax": 181,
  5655. "./util/logger": 189,
  5656. "./util/showcase": 193
  5657. }],
  5658. 60: [function(e, t, i) {//../util/common
  5659. "use strict";
  5660. var n = (e("../util/common"),
  5661. {
  5662. status: 0,
  5663. set: function(e) {
  5664. var t = e
  5665. , i = $("#bar");
  5666. if (isNaN(t))
  5667. return !1;
  5668. var n = i.attr("r")
  5669. , r = Math.PI * (2 * n);
  5670. t = Math.max(Math.min(t, 100), 0);
  5671. var o = (100 - t) / 100 * r;
  5672. o = Math.max(Math.min(o, 295.3), 0),
  5673. i.css({
  5674. strokeDashoffset: o
  5675. }),
  5676. $("#cont").attr("data-pct", t),
  5677. this.status = e
  5678. },
  5679. done: function(e) {
  5680. return e || this.status ? (this.status = null,
  5681. this.set(100)) : this
  5682. }
  5683. });
  5684. t.exports.circleLoader = n
  5685. }
  5686. , {
  5687. "../util/common": 185
  5688. }],
  5689. 61: [function(e, t, i) {//"./closer/ModalCloserEvent"
  5690. "use strict";
  5691. t.exports = Object.freeze({
  5692. CLOSE: "modal.closer.close"
  5693. })
  5694. }
  5695. , {}],
  5696. 62: [function(e, t, i) {//"./closer/modalCloser"
  5697. "use strict";
  5698. function n(e, t) {
  5699. t && (t.stopPropagation(),
  5700. t.preventDefault()),
  5701. e && this.emit(l.CLOSE, e),
  5702. g.reset()
  5703. }
  5704. function r(e, t) {
  5705. function i() {
  5706. var t = e.offsetHeight >= $('#player').width() && e.offsetWidth >= $('#player').height();
  5707. t !== f && (f = t,
  5708. t ? (e.classList.add("closeByFooter"),
  5709. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5710. h.classList.remove("closeByFooter")))
  5711. }
  5712. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5713. }
  5714. var o = e("../../settings")
  5715. , a = (e("../../tag/Media/MediaEvent"),
  5716. e("../../util/browser"))
  5717. , s = e("../../util/common")
  5718. , l = e("./ModalCloserEvent")
  5719. , c = e("events").EventEmitter
  5720. , h = document.getElementsByClassName("footer")[0]
  5721. , u = h.querySelectorAll(".close")[0]
  5722. , d = null
  5723. , p = null
  5724. , f = null
  5725. , g = (a.isMobile(),
  5726. {
  5727. open: function(e) {
  5728. e && (r(e),
  5729. d && u.removeEventListener("click", d, !0),
  5730. d = n.bind(this, e.id),
  5731. u.addEventListener("click", d, !0),
  5732. p && window.removeEventListener("resize", p, !0),
  5733. p = r.bind(this, e),
  5734. window.addEventListener("resize", p, !0))
  5735. },
  5736. reset: function() {
  5737. h.classList.remove("closeByFooter"),
  5738. u.removeEventListener("click", d, !0),
  5739. window.removeEventListener("resize", p, !0),
  5740. d = p = f = null
  5741. }
  5742. });
  5743. s.extendObject(g, c.prototype),
  5744. t.exports = g
  5745. }
  5746. , {
  5747. "../../tag/Media/MediaEvent": 131,
  5748. "../../settings": 166,
  5749. "../../util/browser": 182,
  5750. "../../util/common": 185,
  5751. "./ModalCloserEvent": 61,
  5752. events: 202
  5753. }],
  5754. 63: [function(e, t, i) {//"./debug"
  5755. "use strict";
  5756. function n(e, t, i) {
  5757. var n = new r.GUI({
  5758. width: 400
  5759. })
  5760. , u = n.addFolder("Flydown from Dollhouse");
  5761. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5762. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5763. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5764. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5765. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5766. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5767. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5768. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5769. var d = n.addFolder("Transition between panos");
  5770. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5771. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5772. h.transition.flyTime = 0,
  5773. d.__controllers.forEach(function(e) {
  5774. e.updateDisplay()
  5775. })
  5776. }),
  5777. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5778. h.transition.flySpeed = 0,
  5779. d.__controllers.forEach(function(e) {
  5780. e.updateDisplay()
  5781. })
  5782. }),
  5783. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5784. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5785. d.add(h.transition, "movementEasing", Object.keys(a));
  5786. var p = n.addFolder("Path Display");
  5787. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5788. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5789. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5790. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5791. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5792. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5793. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5794. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5795. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5796. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5797. h.path.color = l[h.path.color],
  5798. h.path.colorUp = l._desat(h.path.color),
  5799. h.path.colorDown = l.darken(h.path.color)
  5800. }),
  5801. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5802. h.reticuleColor = l[h.reticuleColor]
  5803. });
  5804. var f = n.addFolder("Warping")
  5805. , g = f.addFolder("Warp/Teleport");
  5806. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5807. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5808. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5809. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5810. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5811. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5812. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5813. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5814. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5815. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5816. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5817. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5818. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5819. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5820. h.path.typ = c[h.path.typ]
  5821. }),
  5822. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5823. t.endlessLoop = h.warp.loop
  5824. }),
  5825. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5826. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5827. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5828. var m = f.addFolder("Long Warp Only");
  5829. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5830. h.warp.flySpeed = 0,
  5831. m.__controllers.forEach(function(e) {
  5832. e.updateDisplay()
  5833. })
  5834. }),
  5835. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5836. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5837. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5838. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5839. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5840. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5841. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5842. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5843. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5844. var v = n.addFolder("Warp Esoterica");
  5845. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5846. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5847. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5848. h.warp.minWarpTime = 0,
  5849. v.__controllers.forEach(function(e) {
  5850. e.updateDisplay()
  5851. })
  5852. }),
  5853. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5854. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5855. v.add(h.warp, "movementEasing", Object.keys(a));
  5856. var A = n.addFolder("Misc");
  5857. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5858. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5859. }),
  5860. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5861. i.cameras[s.PANORAMA].fov = h.insideFOV
  5862. }),
  5863. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5864. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5865. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5866. var y = n.addFolder("Navigation");
  5867. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5868. h.navigation.panoScores || e.panos.forEach(function(e) {
  5869. e.floor.remove(e.text3d),
  5870. e.text3d = null
  5871. })
  5872. }),
  5873. y.add(h.navigation, "mouseDirection"),
  5874. y.add(h.navigation, "filterStrictness", 0, 1),
  5875. y.add(h.navigation, "angleFactor", -60, 0),
  5876. y.add(h.navigation, "directionFactor", 1, 20),
  5877. y.add(h.navigation, "distanceFactor", -5, 5),
  5878. y.add(h.navigation, "optionalityFactor", .1, 10);
  5879. var C = n.addFolder("tags")
  5880. , I = C.addFolder("Tag Creation");
  5881. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5882. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5883. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5884. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5885. var E = C.addFolder("Visibility");
  5886. E.add(h.tags.visibility, "anyDistance"),
  5887. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5888. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5889. E.add(h.tags.visibility, "hideViaFloor"),
  5890. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5891. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5892. var b = C.addFolder("Disc Parameters");
  5893. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5894. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5895. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5896. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5897. }),
  5898. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5899. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5900. }),
  5901. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5902. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5903. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5904. var w = C.addFolder("Navigate");
  5905. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5906. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5907. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5908. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5909. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5910. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5911. var _ = n.addFolder("Debug");
  5912. _.add(h, "wireframe").onFinishChange(function() {
  5913. e.chunks.forEach(function(t) {
  5914. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5915. t.wireframeTwin.material.depthWrite = !1,
  5916. t.wireframeTwin.material.depthTest = !1,
  5917. t.wireframeTwin.material.opacity = .5,
  5918. t.wireframeTwin.material.transparent = !0),
  5919. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5920. })
  5921. }),
  5922. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5923. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5924. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5925. e.skybox.wireframe = null)
  5926. }),
  5927. _.add(h, "showSweeps").onFinishChange(function() {
  5928. e.setSweepVisibility(h.showSweeps)
  5929. }),
  5930. _.add(h, "showMesh").onFinishChange(function() {
  5931. e.chunks.forEach(function(e) {
  5932. e.visible = h.showMesh
  5933. })
  5934. }),
  5935. _.add(h, "showFloors").onFinishChange(function() {
  5936. e.floors.forEach(function(e) {
  5937. e.collider.children.forEach(function(e) {
  5938. e.material.visible = h.showFloors
  5939. })
  5940. })
  5941. }),
  5942. _.add(h, "showSkyboxes").onFinishChange(function() {
  5943. e.panos.forEach(function(e) {
  5944. e.skyboxMesh.visible = h.showSkyboxes
  5945. })
  5946. }),
  5947. _.add(h, "showNeighbors").onChange(function() {}),
  5948. _.add(e, "alpha", 0, 1)
  5949. }
  5950. var r = e("../lib/dat.gui")
  5951. , o = e("three")
  5952. , a = e("../util/easing")
  5953. , s = e("../enum/Viewmode")
  5954. , l = e("../enum/Colors")
  5955. , c = e("../enum/WarpStyle")
  5956. , h = e("../settings");
  5957. e("../tag/tag");
  5958. r.GUI.prototype.removeFolder = function(e) {
  5959. var t = this.__folders[e];
  5960. t && (t.close(),
  5961. this.__ul.removeChild(t.domElement.parentNode),
  5962. delete this.__folders[e],
  5963. this.onResize())
  5964. }
  5965. ,
  5966. t.exports.toggle = n
  5967. }
  5968. , {
  5969. "../enum/Colors": 19,
  5970. "../enum/Viewmode": 51,
  5971. "../enum/WarpStyle": 52,
  5972. "../lib/dat.gui": 93,
  5973. "../tag/tag": 123,
  5974. "../settings": 166,
  5975. "../util/easing": 186,
  5976. three: 217
  5977. }],
  5978. 64: [function(e, t, i) {///js/gui/error.js
  5979. (function(i) {
  5980. "use strict";
  5981. function n(e, t, i, n) {
  5982. $(".gui-error .error-problem-text").text(e),
  5983. $(".gui-error .error-solution-text").text(t),
  5984. $(".gui-error .error-explanation").text(i),
  5985. $(".gui-error .error-actions").html(n),
  5986. $(window).resize(),
  5987. $(".gui-error").fadeIn(),
  5988. $("#bottom-logo").fadeIn()
  5989. }
  5990. function r(e) {
  5991. 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("");
  5992. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  5993. s.isMobile() || $("[rel=tiletip]").tooltip({
  5994. placement: "bottom",
  5995. delay: {
  5996. show: 50,
  5997. hide: 0
  5998. },
  5999. trigger: "hover",
  6000. viewport: {
  6001. selector: "body",
  6002. padding: 10
  6003. }
  6004. })
  6005. }
  6006. function o() {
  6007. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6008. , t = [h.ERROR_GENERIC_ACTIONS_1, e, '<a class="link" target="_blank" href=', p, ">" + h.ERROR_GENERIC_ACTIONS_4 + "</a>."].join("");
  6009. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6010. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6011. e.preventDefault(),
  6012. e.stopPropagation(),
  6013. r(" ")
  6014. })
  6015. }
  6016. function a(e) {
  6017. if ($("head title").text(c.pageTitle),
  6018. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6019. $("#gui-loading").fadeOut(250),
  6020. $("#quick-blackout").hide(),
  6021. l.track("showcase_error", {
  6022. error_key: e
  6023. }),
  6024. h.locale || h.init(),
  6025. "webgl-unsupported" === e)
  6026. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6027. else if ("webgl-ios" === e)
  6028. 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>.");
  6029. else if ("webgl-safari" === e)
  6030. 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>.");
  6031. else if ("webgl-generic" === e)
  6032. o();
  6033. else if ("missing-urls" === e)
  6034. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6035. else if ("loading-failed" === e)
  6036. 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>.");
  6037. else {
  6038. if ("loading-failed-maintenance" !== e)
  6039. return void d.error("Unhandled error: " + e);
  6040. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6041. }
  6042. }
  6043. var s = e("./../util/browser")
  6044. , l = e("./../analytics")
  6045. , c = e("./../settings")
  6046. , h = e("../localization/localize")
  6047. , u = e("./../util/logger")
  6048. , d = new u(i)
  6049. , p = '"https://support.port.com/hc/articles/208220058"';
  6050. t.exports.error = a
  6051. }
  6052. ).call(this, "/js/gui/error.js")
  6053. }
  6054. , {
  6055. "../localization/localize": 108,
  6056. "./../analytics": 4,
  6057. "./../settings": 166,
  6058. "./../util/browser": 182,
  6059. "./../util/logger": 189
  6060. }],
  6061. 65: [function(e, t, i) {//"./gui"
  6062. (function(i) {
  6063. "use strict";
  6064. function n() {
  6065. Ue = [],
  6066. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6067. Ue.push(".hideTarget", ".pinTop.right")
  6068. }
  6069. function r() {
  6070. for (var e in je)
  6071. if (je.hasOwnProperty(e)) {
  6072. var t = je[e];
  6073. if (!t.visible)
  6074. for (var i = 0; i < t.elements.length; i++)
  6075. $(t.elements[i]).hide()
  6076. }
  6077. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6078. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6079. n()
  6080. }
  6081. function o(e, t) {
  6082. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6083. $("#gui-zoomin").toggle(i),
  6084. $("#gui-zoomout").toggle(i)
  6085. }
  6086. function a() {
  6087. c(),
  6088. $(".pinBottom").toggleClass("open"),
  6089. $("#drawer").toggleClass("open"),
  6090. $(".footer").toggleClass("open"),
  6091. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6092. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6093. ie.resetDrawer()),
  6094. setTimeout(function() {
  6095. $("#pullTab").toggleClass("opened")
  6096. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6097. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6098. }
  6099. function s(e) {
  6100. var t;
  6101. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6102. t = e.position().top + e.outerHeight(),
  6103. e.attr("style", "display: none"));
  6104. var i = $("#player").outerHeight()
  6105. , n = i - 130;
  6106. return n < t + 25
  6107. }
  6108. function l(e) {
  6109. "touchstart" === e.type && e.preventDefault(),
  6110. e.stopPropagation()
  6111. }
  6112. function c() {
  6113. W && (W.reload(),
  6114. W.init())
  6115. }
  6116. function h(e) {
  6117. ne.show(e),
  6118. r()
  6119. }
  6120. function u(e) {
  6121. ne.progress(e)
  6122. }
  6123. function d(e, t, i) {
  6124. var n = t.player;
  6125. $("#gui-thumb").fadeOut(2500),
  6126. ne.hide(function() {
  6127. Ge = !1
  6128. }),
  6129. me.init(e, i),
  6130. de.finishSetup(Object.keys(e.tags).length),
  6131. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6132. var s = function() {
  6133. i.dismissExaminedTag(),
  6134. i.disableHovering()
  6135. };
  6136. Ae.on(ye.OPENED, s),
  6137. Ce.on(Me.OPENED, s),
  6138. he.on(ue.OPENED, s),
  6139. fe.on(ge.OPENED, s);
  6140. var l = i.enableHovering.bind(i);
  6141. if (Ae.on(ye.CLOSED, l),
  6142. Ce.on(Me.CLOSED, l),
  6143. he.on(ue.CLOSED, l),
  6144. fe.on(ge.CLOSED, l),
  6145. Q.labels.enabled && Object.keys(e.labels).length,
  6146. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6147. C(e.currentFloor, n.mode)),
  6148. r(),
  6149. o(t, t.player),
  6150. $("#gui").fadeIn(1500),
  6151. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6152. a(),
  6153. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6154. }, 2e3),
  6155. !K.isMobile())
  6156. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6157. $(c[h]).addClass("hasHover");
  6158. O(e),
  6159. de.setupToggling()
  6160. }
  6161. function p(e) {
  6162. e || (e = 0),
  6163. We = !1,
  6164. window.setTimeout(function() {
  6165. We || (ze = !0,
  6166. $("#gui-spinner").stop(!0, !0).show())
  6167. }
  6168. .bind(this), e)
  6169. }
  6170. function f() {
  6171. $("#gui-spinner").stop(!0, !0),
  6172. $("#gui-spinner").fadeOut(1e3),
  6173. We = !0,
  6174. ze = !1
  6175. }
  6176. function g(e, t) {
  6177. var i = e.mode
  6178. , n = t || e.currentPano;
  6179. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6180. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6181. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6182. Q.show360Views.enabled && !n.isAligned() ? ($("#gui-modes-inside").removeClass("hidden"),
  6183. $(".gui-floor").addClass("hidden"),
  6184. $("#gui-modes-outside").addClass("desktop-only")) : ($("#gui-modes-inside").addClass("hidden"),
  6185. $(".gui-floor").removeClass("hidden"),
  6186. $("#gui-modes-outside").removeClass("desktop-only")),
  6187. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6188. Be = i,
  6189. $("#gui-modes-outside").addClass("hidden"),
  6190. $("#gui-modes-inside").removeClass("hidden"),
  6191. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6192. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6193. }
  6194. var editor = e("editor")
  6195. /* function m(e, t) { // MP
  6196. var i = t.player;
  6197. $("#gui-modes-inside").find("a").on("click", function(e) {
  6198. l(e),
  6199. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6200. J.track("showcase_gui", {
  6201. gui_action: "click_inside_mode_button"
  6202. }),
  6203. t.changeMode(_e.PANORAMA)
  6204. }),
  6205. $("#gui-modes-outside").find("a").on("click", function(e) {
  6206. l(e),
  6207. J.track("showcase_gui", {
  6208. gui_action: "click_outside_mode_button"
  6209. }),
  6210. t.changeMode(Be)
  6211. }),
  6212. $("#gui-modes-floorplan").on("click", function(e) {
  6213. l(e),
  6214. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6215. gui_action: "click_floorplan_mode_button"
  6216. }),
  6217. t.changeMode(_e.FLOORPLAN))
  6218. }),
  6219. $("#gui-modes-dollhouse").on("click", function(e) {
  6220. l(e),
  6221. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6222. gui_action: "click_dollhouse_mode_button"
  6223. }),
  6224. t.changeMode(_e.DOLLHOUSE))
  6225. })
  6226. }
  6227. */
  6228. function m(e, t) {//模式转换 xzw
  6229. var i = t.player;
  6230. var open = function(option){
  6231. if(i.mode != "transitioning" && option && option.openPanel!=void 0) editor.openPanel(option.openPanel);
  6232. //else console.log(i.mode)
  6233. }
  6234. var inside = function(e, o){
  6235. e && l(e);
  6236. open(o);
  6237. J.updateInteraction(Se.InteractionGui, "inside-button"), //删掉似乎也没影响?
  6238. J.track("showcase_gui", {
  6239. gui_action: "click_inside_mode_button"
  6240. }),
  6241. t.changeMode(_e.PANORAMA, o);
  6242. }
  6243. var floorplan = function(e, o){
  6244. e && l(e),
  6245. open(o),
  6246. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6247. gui_action: "click_floorplan_mode_button"
  6248. }),
  6249. t.changeMode(_e.FLOORPLAN));
  6250. }
  6251. var dollhouse = function(e, o){
  6252. e && l(e),
  6253. open(o),
  6254. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6255. gui_action: "click_dollhouse_mode_button"
  6256. }),
  6257. t.changeMode(_e.DOLLHOUSE, o));
  6258. };
  6259. var outside = function(e ){
  6260. e && l(e);
  6261. if(Be == _e.DOLLHOUSE) open({openPanel:1})
  6262. else open({openPanel:2})
  6263. J.track("showcase_gui", {
  6264. gui_action: "click_outside_mode_button"
  6265. })
  6266. t.changeMode(Be)
  6267. }
  6268. //modes
  6269. $("#gui-modes-inside").find("a").on("click", function(e){ inside(e, {openPanel:3})}),
  6270. $("#gui-modes-outside").find("a").on("click", function(e){ outside(e )}),
  6271. $("#gui-modes-dollhouse").on("click", function(e){ dollhouse(e, {openPanel:1})})
  6272. $("#gui-modes-floorplan").on("click", function(e){ floorplan(e, {openPanel:2})})
  6273. //tabs
  6274. $("#hotPoint").click( function(){ inside(null, {openPanel:0})} )// 和点击 #gui-modes-inside 不同
  6275. $("#myStyleZ").click( function(){ dollhouse(null, {openPanel:1})} )// 相当于点 #gui-modes-dollhouse
  6276. $("#drawWall").click( function(){ floorplan(null, {openPanel:2})} )// 相当于点 #gui-modes-floorplan
  6277. $("#information").click( function(){ inside(null, {openPanel:3})} ) // 相当于点 #gui-modes-inside
  6278. }
  6279. function v(e, t) {
  6280. function i() {
  6281. document.getElementById("vr").classList.remove("hidden"),
  6282. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6283. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6284. $(".improper-embed").toggleClass("hidden", !1),
  6285. r())
  6286. }, function(e) {
  6287. r()
  6288. }) : r()
  6289. }
  6290. function n(i) {
  6291. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6292. Ie.init(e.data, t, i, q),
  6293. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6294. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6295. }
  6296. function r() {
  6297. De.info("WebVR support not found, VR button activates native app VR modal"),
  6298. Ae.init(e.data, q),
  6299. Ae.on(ye.OPENED, function() {
  6300. var e = document.getElementById("vr-modal");
  6301. return function() {
  6302. Ze("vr"),
  6303. le.open(e)
  6304. }
  6305. }()),
  6306. Ae.on(ye.CLOSED, le.reset)
  6307. }
  6308. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0))
  6309. switch (Q.vr.option) {
  6310. case Pe.CONTEXTUAL:
  6311. i();
  6312. break;
  6313. case Pe.ANDROID:
  6314. K.detectAndroid() && i();
  6315. break;
  6316. case Pe.NONE:
  6317. }
  6318. }
  6319. function A(e, t) {
  6320. $("#play").find("a").on("mousedown touchstart", function(e) {
  6321. l(e),
  6322. Ze("tour"),
  6323. ve.play(),
  6324. J.trackAlways("showcase_gui", {
  6325. gui_action: "play_highlights"
  6326. })
  6327. }),
  6328. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6329. l(e),
  6330. ve.pause(),
  6331. J.trackAlways("showcase_gui", {
  6332. gui_action: "pause_highlights"
  6333. })
  6334. }),
  6335. $("#gui-zoomin").find("a").on("click", function(e) {
  6336. l(e),
  6337. t.player.zoomInIncrementally()
  6338. }),
  6339. $("#gui-zoomout").find("a").on("click", function(e) {
  6340. l(e),
  6341. t.player.zoomOutIncrementally()
  6342. })
  6343. }
  6344. function y(e, t) {
  6345. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6346. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6347. $(".gui-floor").find(".container").prepend(r)
  6348. }
  6349. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6350. i.on("click", function(e) {
  6351. l(e),
  6352. Ze("floor"),
  6353. i.toggleClass("open")
  6354. }),
  6355. $(".floorChoice").on("click", function(e) {
  6356. l(e);
  6357. var n = $(this).data("index");
  6358. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6359. t.player.gotoFloor(n),
  6360. J.track("showcase_gui", {
  6361. gui_action: "click_floor_select_button",
  6362. interaction_source: "gui"
  6363. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6364. Ze("move"),
  6365. t.allFloors(),
  6366. J.track("showcase_gui", {
  6367. gui_action: "click_toggle_all_floors_button",
  6368. interaction_source: "gui"
  6369. })),
  6370. i.removeClass("open")
  6371. })
  6372. }
  6373. function C(e, t) {
  6374. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? $(".allFloorBtn").show() : $(".allFloorBtn").hide(),
  6375. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6376. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6377. $(".floorChoice").removeClass("active"),
  6378. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6379. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6380. $(".floorChoice").removeClass("active"),
  6381. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6382. }
  6383. function I(e) {
  6384. return e.describe().inTransition
  6385. }
  6386. function E(e) {
  6387. $("<img/>").attr("src", e).on("load", function() {
  6388. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6389. $(this).remove()
  6390. })
  6391. }
  6392. function b(e, t, i) {
  6393. Fe = e.heroLocations.length;
  6394. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6395. , r = 100 / Fe + "%"
  6396. , o = $("#thumb-container")
  6397. , a = $("#progressBar");
  6398. $("#status").find(".totalSteps").text(Fe);
  6399. for (var s = 0; s < Fe; s++) {
  6400. var c = e.heroLocations[s]
  6401. , h = $(n);
  6402. if (h.attr("data-index", s),
  6403. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6404. c.name) {
  6405. var u = $('<div class="overlay"></div>').text(c.name);
  6406. h.prepend(u)
  6407. }
  6408. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6409. var d = e.panos.get(c.panoId)
  6410. , p = d && !d.isAligned()
  6411. , 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>';
  6412. h.prepend(f)
  6413. }
  6414. o.append(h),
  6415. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6416. }
  6417. j = 144 * Fe,
  6418. Y = 111 * Fe,
  6419. $(".thumbImg").on("mouseover", function() {
  6420. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6421. }),
  6422. $(".thumbImg").on("mouseout", function() {
  6423. t.clearPath()
  6424. }),
  6425. $(".thumbImg").on("click", function(e) {
  6426. l(e);
  6427. var i = $(this);
  6428. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6429. J.trackAlways("showcase_gui", {
  6430. gui_action: "click_highlight"
  6431. }),
  6432. t.goToHighlight(i.data("index"))
  6433. }),
  6434. $(".previous").find("a").on("click", function(e) {
  6435. l(e),
  6436. J.trackAlways("showcase_gui", {
  6437. gui_action: "prev_highlight"
  6438. }),
  6439. t.prevHighlight()
  6440. }),
  6441. $(".next").find("a").on("click", function(e) {
  6442. l(e),
  6443. J.trackAlways("showcase_gui", {
  6444. gui_action: "next_highlight"
  6445. }),
  6446. t.nextHighlight()
  6447. }),
  6448. $("#drawer").on("mouseleave", function(e) {
  6449. l(e);
  6450. var t;
  6451. try {
  6452. t = new MouseEvent("mouseup",{
  6453. clientX: e.clientX,
  6454. clientY: e.clientY,
  6455. screenX: e.screenX,
  6456. screenY: e.screenY
  6457. })
  6458. } catch (i) {
  6459. t = document.createEvent("MouseEvents"),
  6460. 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)
  6461. }
  6462. document.dispatchEvent(t)
  6463. }),
  6464. W = new Sly($("#scrollFrame"),{
  6465. horizontal: !0,
  6466. itemNav: "centered",
  6467. smart: !0,
  6468. scrollTrap: !0,
  6469. scrollBy: 1,
  6470. mouseDragging: !0,
  6471. touchDragging: !0,
  6472. speed: 300,
  6473. dragHandle: !0,
  6474. dynamicHandle: !0,
  6475. clickBar: !0,
  6476. scrollBar: $("#scroller"),
  6477. activateOn: null
  6478. }).init(),
  6479. W.on("active", function(e, t) {
  6480. Ve = t,
  6481. Ze("tour"),
  6482. $(".step").removeClass("active"),
  6483. $("#status").find(".curIdx").text(t + 1);
  6484. for (var i = 0; i <= t; i++)
  6485. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6486. }),
  6487. w()
  6488. }
  6489. function w() {
  6490. var e = $('#player').width() - 20
  6491. , t = $("#scroller")
  6492. , i = $("#drawer")
  6493. , n = $(".pinBottom");
  6494. if ($('#player').width() < 488 || $('#player').height() < 488)
  6495. t.addClass("hidden"),
  6496. i.addClass("noScroll"),
  6497. n.addClass("noScroll");
  6498. else {
  6499. var r = j > e
  6500. , o = !i.hasClass("noScroll")
  6501. , a = r !== o;
  6502. a && (t.toggleClass("hidden"),
  6503. i.toggleClass("noScroll"),
  6504. n.toggleClass("noScroll"))
  6505. }
  6506. }
  6507. function _(e) {
  6508. je.tourControls.visible = e.tour_buttons && K.valueFromHash("gt", 1),
  6509. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6510. je.highlight.visible = e.highlight_reel && 1 !== Q.specialEdition && Q.showHighlights
  6511. }
  6512. function T(e) {
  6513. function t(t, i) {
  6514. return !!e.player_options[t] && e[i || t]
  6515. }
  6516. $(".model-title").text(e.name);
  6517. var i = Q.pageTitle;
  6518. 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6519. document.title = i,
  6520. K.isMobile() ? $("#gui-fullscreen").toggleClass("hidden") : ($("[rel=tooltip]").tooltip({
  6521. delay: {
  6522. show: 50,
  6523. hide: 0
  6524. },
  6525. trigger: "hover",
  6526. html: !1,
  6527. viewport: {
  6528. selector: "body",
  6529. padding: 10
  6530. }
  6531. }),
  6532. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6533. 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"),
  6534. de.populate({
  6535. name: t("model_name", "name"),
  6536. coBrand: t("presented_by"),
  6537. description: t("model_summary", "summary"),
  6538. contactName: t("contact_name"),
  6539. address: t("address"),
  6540. phone: t("contact_phone"),
  6541. formattedPhone: e.formatted_contact_phone,
  6542. email: t("contact_email"),
  6543. url: t("external_url"),
  6544. socialSharing: e.enable_social_sharing && e.is_public
  6545. })
  6546. }
  6547. function x(e, t, i, n, r, o) {
  6548. function a() {
  6549. o.setLoadingStartTime(),
  6550. H(),
  6551. r ? (re.showMessage(t, i, je.coBrand.visible),
  6552. l()) : h(l)
  6553. }
  6554. var s = $.Deferred()
  6555. , l = s.resolve.bind(s);
  6556. return Ge = !0,
  6557. O(e),
  6558. e.data.player_options && _(e.data.player_options),
  6559. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6560. Re.localizeGUI(),
  6561. T(e.data),
  6562. r || $(".quick").addClass("hidden"),
  6563. e.data.image && !r && E(e.data.image),
  6564. n ? (J.impression(),
  6565. a()) : (o.setWaitingStartTime(),
  6566. oe.show(r, a)),
  6567. s
  6568. }
  6569. function S(e, t, i, n, r, a, s) {
  6570. q = s,
  6571. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6572. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6573. ae.init(),
  6574. re.init(e, a),
  6575. Oe.init(e, t, n),
  6576. $(".icon").on("mouseover", function() {
  6577. t.player && t.player.reticule.hide()
  6578. }),
  6579. m(e, t),
  6580. A(e, t),
  6581. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(e.data.name),
  6582. Ce.on(Me.OPENED, function() {
  6583. var e = document.getElementById("share-modal");
  6584. return function() {
  6585. Ze("share"),
  6586. le.open(e)
  6587. }
  6588. }()),
  6589. Ce.on(Me.CLOSED, le.reset)),
  6590. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6591. je.tourControls.visible = !1),
  6592. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6593. z(),
  6594. g(i),
  6595. v(e, r),
  6596. e.on("floor.changed", C),
  6597. e.on("waiting", R.bind(this, e)),
  6598. e.on("waiting-done", P.bind(this, e)),
  6599. i.on(xe.ModeChanged, function(e, n) {
  6600. g(i),
  6601. o(t, i),
  6602. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6603. he.updateMode(n)
  6604. }),
  6605. n.on(Se.Move, Ze.bind(this, "move")),
  6606. i.on(xe.Ready, function() {
  6607. ie.init(n, i, i.tagManager, t),
  6608. i.on(xe.ModeChanged, function(e, t) {
  6609. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6610. })
  6611. }),
  6612. i.on(xe.PanoChosen, function(e, t) {
  6613. g(i, t),
  6614. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6615. }),
  6616. le.on(ce.CLOSE, function(e) {
  6617. switch (e) {
  6618. case "vr-modal":
  6619. Ae.dismiss();
  6620. break;
  6621. case "share-modal":
  6622. Ce.hide();
  6623. break;
  6624. case "terms-modal":
  6625. fe.hide()
  6626. }
  6627. });
  6628. var l = $("#play").eq(0)
  6629. , c = $("#pause").eq(0)
  6630. , h = $(".pinBottom").toArray()
  6631. , u = $("#drawer").eq(0)
  6632. , d = $("#playHead").eq(0)
  6633. , p = $("#progressBar").eq(0)
  6634. , f = $("#thumb-container").eq(0)
  6635. , y = f.children()
  6636. , I = p.children();
  6637. t.on("update.controls", function() {
  6638. var n = t.describe();
  6639. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6640. c.show()),
  6641. n.tourInProgress && (h.forEach(function(e) {
  6642. e.classList.add("playing")
  6643. }),
  6644. u.addClass("playing"),
  6645. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6646. c.hide()),
  6647. n.tourInProgress || (ve.stopTour(),
  6648. h.forEach(function(e) {
  6649. e.classList.remove("playing")
  6650. }),
  6651. u.removeClass("playing"),
  6652. d.removeClass("playing")));
  6653. var r, a, s;
  6654. if (null !== n.currentItem) {
  6655. var p, f;
  6656. $("#status").find(".curIdx").text(n.currentItem + 1),
  6657. n.onTheBus ? (p = "active",
  6658. f = "recent") : (f = "active",
  6659. p = "recent");
  6660. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6661. for (r = 0; r < e.heroLocations.length; r += 1)
  6662. s = y.eq(r),
  6663. a = I.eq(r),
  6664. s.removeClass(f),
  6665. a.removeClass(f),
  6666. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6667. a.addClass(p),
  6668. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6669. a.addClass(p)) : (s.removeClass(p),
  6670. a.removeClass(p))
  6671. } else
  6672. for (r = 0; r < e.heroLocations.length; r += 1)
  6673. s = y.eq(r),
  6674. a = I.eq(r),
  6675. s.removeClass("active recent"),
  6676. a.removeClass("active recent");
  6677. o(t, i)
  6678. }),
  6679. document.addEventListener("keydown", function(n) {
  6680. if(!window.keyCon) return; //xzw add
  6681. switch (J.updateInteraction(Se.InteractionKey),
  6682. n.which) {
  6683. case we.ZERO:
  6684. Q.debug && e.toggleAlpha();
  6685. break;
  6686. case we.NINE:
  6687. Q.debug && se.toggle();
  6688. break;
  6689. case we.ONE:
  6690. i.isInMode(_e.TRANSITIONING) || (editor.openPanel(3), t.changeMode(_e.PANORAMA));//xzw 都加了openPanel 打开编辑面板
  6691. break;
  6692. case we.TWO:
  6693. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && (editor.openPanel(1), t.changeMode(_e.DOLLHOUSE)) ;//xzw
  6694. break;
  6695. case we.THREE:
  6696. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && (editor.openPanel(2), t.changeMode(_e.FLOORPLAN));//xzw
  6697. break;
  6698. case we.FOUR:
  6699. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR) ;
  6700. break;
  6701. case we.SPACE:
  6702. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6703. break;
  6704. case we.RETURN:
  6705. Q.debug && e.toggleExplodeUp();
  6706. break;
  6707. case we.P:
  6708. k();
  6709. break;
  6710. case we.U:
  6711. B();
  6712. break;
  6713. case we.X:
  6714. Q.debug && e.toggleExplode();
  6715. break;
  6716. case we.PLUSEQUALS:
  6717. t.player.activatePersistentZooming(!0),
  6718. ie.hideUi();
  6719. break;
  6720. case we.DASHUNDERSCORE:
  6721. t.player.activatePersistentZooming(!1),
  6722. ie.hideUi();
  6723. break;
  6724. case we.SEVEN:
  6725. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6726. break;
  6727. case we.EIGHT:
  6728. t.player.decreaseZoomSpeed();
  6729. break;
  6730. case we.NINE:
  6731. t.player.increaseZoomSpeed()
  6732. }
  6733. return i && i.reticule.hide(),
  6734. !0
  6735. }
  6736. .bind(this)),
  6737. document.addEventListener("keyup", function(e) {
  6738. switch (e.which) {
  6739. case we.PLUSEQUALS:
  6740. t.player.deactivatePersistentZooming();
  6741. break;
  6742. case we.DASHUNDERSCORE:
  6743. t.player.deactivatePersistentZooming()
  6744. }
  6745. }
  6746. .bind(this)),
  6747. F(e),
  6748. L(e, t.player),
  6749. M(i),
  6750. te.setAutoPlay(e.heroCount()),
  6751. he.init(i, a.mode),
  6752. he.on(ue.OPENED, Ze.bind(this, "help")),
  6753. fe.init(),
  6754. fe.on(ge.OPENED, function() {
  6755. var e = document.getElementById("terms-modal");
  6756. return function() {
  6757. Ze("terms"),
  6758. le.open(e)
  6759. }
  6760. }()),
  6761. fe.on(ge.CLOSED, le.reset),
  6762. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6763. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6764. Q.profiling.enabled && se.show(),
  6765. ve.init(t)
  6766. }
  6767. function M(e) {
  6768. var t = function(e, t) {
  6769. $(e).find("a").each(function(e, i) {
  6770. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6771. i.style.pointerEvents = t ? "auto" : "none"
  6772. })
  6773. }
  6774. , i = function() {
  6775. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6776. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6777. };
  6778. e.on(Ne.ZoomMax, function() {
  6779. t("#gui-zoomin", !1),
  6780. t("#gui-zoomout", !0)
  6781. }),
  6782. e.on(Ne.ZoomMin, function() {
  6783. t("#gui-zoomin", !0),
  6784. t("#gui-zoomout", !1)
  6785. }),
  6786. e.on(Ne.ZoomIn, function() {
  6787. t("#gui-zoomout", !0)
  6788. }),
  6789. e.on(Ne.ZoomOut, function() {
  6790. t("#gui-zoomin", !0)
  6791. }),
  6792. i()
  6793. }
  6794. function R(e) {
  6795. O(e)
  6796. }
  6797. function P(e) {
  6798. O(e)
  6799. }
  6800. function O(e) {
  6801. var t = e.waitQueue.length;
  6802. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6803. }
  6804. function L(e, t) {
  6805. He = {
  6806. gui: null,
  6807. visible: !1,
  6808. model: e,
  6809. player: t
  6810. }
  6811. }
  6812. function D(e, t) {
  6813. function i() {
  6814. var i = t.toJSON();
  6815. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6816. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6817. }
  6818. var n = {}
  6819. , r = new Le.GUI({
  6820. autoPlace: !0,
  6821. width: "60%"
  6822. });
  6823. i(),
  6824. t.on(xe.ViewChanged, i),
  6825. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6826. r.domElement.id = "datLinks";
  6827. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6828. return o.forEach(function(e) {
  6829. if (!K.detectSafari()) {
  6830. var t = document.createElement("button");
  6831. t.classList.add("btn-deep-link"),
  6832. t.innerText = Re.MENU_COPY,
  6833. e.nextSibling.appendChild(t);
  6834. var i = function() {
  6835. alert(Re.LINK_ALERT_COPY),
  6836. t.hide()
  6837. };
  6838. t.addEventListener("click", function(e) {
  6839. try {
  6840. var t = e.target.parentNode.childNodes[0];
  6841. t.select();
  6842. var n = document.execCommand("copy");
  6843. t.blur(),
  6844. n || i()
  6845. } catch (e) {
  6846. i()
  6847. }
  6848. })
  6849. }
  6850. }),
  6851. $(r.__closeButton).hide(),
  6852. r
  6853. }
  6854. function N(e) {
  6855. He.gui || (He.gui = D(He.model, He.player)),
  6856. He.visible = e,
  6857. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6858. }
  6859. function B() {
  6860. N(!He.visible)
  6861. }
  6862. function F(e) {
  6863. ke = {
  6864. gui: null,
  6865. visible: !1,
  6866. model: e
  6867. }
  6868. }
  6869. function V(e) {
  6870. var t = new Le.GUI;
  6871. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6872. e.setSweepVisibility(Q.showSweeps)
  6873. }),
  6874. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6875. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6876. Q.transition.flySpeed = 0,
  6877. t.__controllers.forEach(function(e) {
  6878. e.updateDisplay()
  6879. })
  6880. }),
  6881. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6882. $(t.__closeButton).hide(),
  6883. t
  6884. }
  6885. function U(e) {
  6886. ke.gui || (ke.gui = V(ke.model)),
  6887. ke.visible = e,
  6888. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6889. }
  6890. function k() {
  6891. U(!ke.visible)
  6892. }
  6893. function H() {
  6894. function e(e) {
  6895. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target) || e.preventDefault()
  6896. }
  6897. $("body").css("touch-action", "none"),
  6898. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6899. e.preventDefault()
  6900. });
  6901. var t = document.getElementById("terms-text")
  6902. , i = document.getElementById("more-help-wrapper")
  6903. , n = (document.getElementById("navigation-help-wrapper"),
  6904. document.getElementById("help-dialog"),
  6905. document.getElementById("tag-billboards"));
  6906. Q.useWheel && (document.body.addEventListener("mousewheel", e),
  6907. document.body.addEventListener("DOMMouseScroll", e)),
  6908. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6909. e.stopPropagation()
  6910. })
  6911. }
  6912. function G(e, t) {
  6913. for (var i = []; e; )
  6914. i.push(e),
  6915. e = e.parentNode;
  6916. for (; t && i.indexOf(t) === -1; )
  6917. t = t.parentNode;
  6918. return t
  6919. }
  6920. function z() {
  6921. var e, t = function(t) {
  6922. e = 0 === t.button || 1 === t.which ? t.target : null
  6923. }, i = function(t) {
  6924. e !== t.target && (e = G(e, t.target));
  6925. var i = document.getElementById("gui-parent");
  6926. if (G(i, e) !== i && (e = null),
  6927. e) {
  6928. var n;
  6929. try {
  6930. n = new MouseEvent("click",t)
  6931. } catch (e) {
  6932. n = document.createEvent("MouseEvents"),
  6933. 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)
  6934. }
  6935. n.syntheticClick = !0,
  6936. e.dispatchEvent(n),
  6937. e = null
  6938. }
  6939. };
  6940. document.body.addEventListener("mousedown", t, !0),
  6941. document.body.addEventListener("mouseup", i, !0),
  6942. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6943. e.syntheticClick || (e.stopPropagation(),
  6944. "A" === e.target.nodeName && e.preventDefault())
  6945. }, !0)
  6946. }
  6947. var W, j, Y, X, Z, q, K = (e("three"),
  6948. e("../util/ajax"),
  6949. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6950. e("../util/camera"),
  6951. e("../util/logger")), te = (e("../objects/Snapshot"),
  6952. 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"),
  6953. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6954. e("../enum/PathDisplayMode"),
  6955. e("../enum/DirectorEvents"),
  6956. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6957. e("../enum/WarpStyle"),
  6958. e("../enum/AlignmentType"),
  6959. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6960. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6961. coBrand: {
  6962. visible: !0,
  6963. elements: [".co-brand", "#loaderCoBrand"]
  6964. },
  6965. help: {
  6966. visible: !0,
  6967. elements: [".nav-help", "#nav-help"]
  6968. },
  6969. tourControls: {
  6970. visible: !0,
  6971. elements: [".next", ".previous", "#play"]
  6972. },
  6973. highlight: {
  6974. visible: !0,
  6975. elements: ["#drawer", "#pullTab"]
  6976. },
  6977. share: {
  6978. visible: !0,
  6979. elements: [".socialButton", "#share"]
  6980. },
  6981. fullScreen: {
  6982. visible: !0,
  6983. elements: ["#gui-fullscreen"]
  6984. },
  6985. floors: {
  6986. visible: !0,
  6987. elements: [".gui-floor"]
  6988. }
  6989. }, Ye = function() {
  6990. var e = document.getElementById("drawer");
  6991. return function() {
  6992. window.innerHeight < 400 && e.classList.contains("open") && a()
  6993. }
  6994. }(), Xe = function() {
  6995. var e = document.getElementById("meta-info");
  6996. return function() {
  6997. window.innerHeight < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  6998. }
  6999. }(), Ze = function(e) {
  7000. function t() {
  7001. u.classList.contains("expand") && de.toggleMeta(!0)
  7002. }
  7003. function i() {
  7004. fe.hide()
  7005. }
  7006. function n() {
  7007. he.close()
  7008. }
  7009. function r() {
  7010. Ae.dismiss()
  7011. }
  7012. function o() {
  7013. p.hasClass("open") && a(!0)
  7014. }
  7015. function l() {
  7016. Ce.hide()
  7017. }
  7018. function c() {
  7019. f.hasClass("open") && f.removeClass("open")
  7020. }
  7021. function h() {
  7022. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7023. }
  7024. var u = document.getElementById("meta-info")
  7025. , d = document.getElementById("interaction-modal")
  7026. , p = $("#drawer").eq(0)
  7027. , f = $(".gui-floor").eq(0)
  7028. , g = $(".vr-popup").eq(0);
  7029. return function(e) {
  7030. switch (e) {
  7031. case "info":
  7032. i(),
  7033. n(),
  7034. Ye(),
  7035. l(),
  7036. c(),
  7037. r(),
  7038. h();
  7039. break;
  7040. case "terms":
  7041. t(),
  7042. n(),
  7043. o(),
  7044. l(),
  7045. c(),
  7046. r(),
  7047. h();
  7048. break;
  7049. case "help":
  7050. t(),
  7051. i(),
  7052. l(),
  7053. c(),
  7054. r(),
  7055. h();
  7056. break;
  7057. case "vr":
  7058. t(),
  7059. i(),
  7060. l(),
  7061. c(),
  7062. n(),
  7063. h(),
  7064. s(g) && o();
  7065. break;
  7066. case "highlights":
  7067. Xe(),
  7068. i(),
  7069. l(),
  7070. c();
  7071. break;
  7072. case "share":
  7073. t(),
  7074. i(),
  7075. n(),
  7076. c(),
  7077. r(),
  7078. h();
  7079. break;
  7080. case "floor":
  7081. i(),
  7082. l(),
  7083. r();
  7084. break;
  7085. case "view":
  7086. c(),
  7087. l(),
  7088. i(),
  7089. r();
  7090. break;
  7091. case "tour":
  7092. i(),
  7093. l(),
  7094. c(),
  7095. r();
  7096. break;
  7097. case "move":
  7098. i(),
  7099. l(),
  7100. c(),
  7101. r();
  7102. break;
  7103. case "resize":
  7104. t(),
  7105. Ye(),
  7106. c();
  7107. break;
  7108. case "tag":
  7109. i(),
  7110. n(),
  7111. l(),
  7112. c(),
  7113. r()
  7114. }
  7115. }
  7116. }();
  7117. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7118. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7119. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7120. setTimeout(function() {
  7121. $(".icon:visible").hide().show(0)
  7122. }, 100)
  7123. }),
  7124. $("#gui-fullscreen").find("a").on("click", function(e) {
  7125. l(e),
  7126. K.requestFullscreen($("body")[0]),
  7127. J.track("showcase_gui", {
  7128. gui_action: "click_enter_fullscreen",
  7129. interaction_source: "gui"
  7130. }),
  7131. W.reload()
  7132. }),
  7133. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7134. l(e),
  7135. K.exitFullscreen(),
  7136. J.track("showcase_gui", {
  7137. gui_action: "click_exit_fullscreen",
  7138. interaction_source: "gui"
  7139. })
  7140. }),
  7141. $(window).on("resize", function(e) {
  7142. var t = e.target.innerHeight
  7143. , i = e.target.innerWidth;
  7144. t === X && i === Z || (je.highlight.visible && w(),
  7145. Ze("resize"),
  7146. $(".pinTop.right").removeClass("hideUnderMeta"),
  7147. c(),
  7148. X = t,
  7149. Z = i)
  7150. }).resize(),
  7151. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7152. $("#pullTab").on("click", function(e) {
  7153. l(e),
  7154. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7155. gui_action: "hide_highlight_reel"
  7156. }),
  7157. $(this).addClass("open")) : (J.trackAlways("showcase_gui", {
  7158. gui_action: "show_highlight_reel"
  7159. }),
  7160. $(this).removeClass("open")),
  7161. a()
  7162. }),
  7163. $("#more-menu-button").on("click", function(e) {
  7164. l(e);
  7165. var t = $("#more-menu");
  7166. t.toggleClass("open")
  7167. }),
  7168. t.exports.init = S,
  7169. t.exports.startLoading = x,
  7170. t.exports.endLoading = d,
  7171. t.exports.onProgress = u
  7172. }
  7173. ).call(this, "/js/gui/gui.js")
  7174. }
  7175. , {
  7176. "../analytics": 4,
  7177. "../controls/serializer": 14,
  7178. "../enum/AlignmentType": 17,
  7179. "../enum/BlackoutStyle": 18,
  7180. "../enum/ControlEvents": 21,
  7181. "../enum/DirectorEvents": 23,
  7182. "../enum/Keys": 30,
  7183. "../enum/PathDiscardMode": 38,
  7184. "../enum/PathDisplayMode": 39,
  7185. "../enum/PlayerEvents": 40,
  7186. "../enum/VROption": 47,
  7187. "../enum/Vectors": 50,
  7188. "../enum/Viewmode": 51,
  7189. "../enum/WarpStyle": 52,
  7190. "../enum/ZoomEvents": 53,
  7191. "../lib/dat.gui": 93,
  7192. "../localization/localize": 108,
  7193. "../tag/Media/MediaEvent": 131,
  7194. "../objects/Snapshot": 153,
  7195. "../settings": 166,
  7196. "../util/ajax": 181,
  7197. "../util/browser": 182,
  7198. "../util/camera": 183,
  7199. "../util/logger": 189,
  7200. "../util/showcase": 193,
  7201. "../util/transitions": 195,
  7202. "./closer/ModalCloserEvent": 61,
  7203. "./closer/modalCloser": 62,
  7204. "./help/HelpEvent": 66,
  7205. "./help/help": 67,
  7206. "./helpManager": 68,
  7207. "./immersiveMode": 69,
  7208. "./konami": 70,
  7209. "./landingScreen": 71,
  7210. "./loadingScreen": 72,
  7211. "./memoryUsage": 73,
  7212. "./playButton": 74,
  7213. "./populateModal": 75,
  7214. "./sharing/ShareEvents": 76,
  7215. "./sharing/modal": 77,
  7216. "./terms/TermsEvent": 78,
  7217. "./terms/terms": 79,
  7218. "./title/TitleEvents": 80,
  7219. "./title/tagToggle": 81,
  7220. "./title/titleBar": 82,
  7221. "./tourInteraction": 84,
  7222. "./vr/vrEvent": 85,
  7223. "./vr/vrModal": 87,
  7224. "./webvr/WebVrEvent": 88,
  7225. "./webvr/webVRgui": 89,
  7226. three: 217,
  7227. "editor" : "Editor"
  7228. }],
  7229. 66: [function(e, t, i) {//"./help/HelpEvent"
  7230. "use strict";
  7231. t.exports = Object.freeze({
  7232. OPENED: "help.opened",
  7233. CLOSED: "help.closed"
  7234. })
  7235. }
  7236. , {}],
  7237. 67: [function(e, t, i) {//"./help/help"
  7238. "use strict";
  7239. function n() {
  7240. g.on("click", function(e) {
  7241. if (S && S !== l.TRANSITIONING) {
  7242. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7243. t && !M ? R.close() : r()
  7244. }
  7245. }),
  7246. w.on("click", function(e) {
  7247. R.close()
  7248. }),
  7249. E.on("click", function(e) {
  7250. S && S !== l.TRANSITIONING && (s(),
  7251. o())
  7252. }),
  7253. b.on("click", function(e) {
  7254. s(),
  7255. a()
  7256. })
  7257. }
  7258. function r() {
  7259. S && S !== l.TRANSITIONING && (M = !0,
  7260. setTimeout(function() {
  7261. M = !1
  7262. }, d.help.modalStayDuration),
  7263. R.emit(h.OPENED),
  7264. m.addClass("open " + S),
  7265. g.addClass("open"),
  7266. s(),
  7267. o(),
  7268. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7269. y.classList.add("fadeIn"))
  7270. }
  7271. function o() {
  7272. E.addClass("underline-tab"),
  7273. u.fill(_, c.NAVIGATION, S),
  7274. m.addClass(S)
  7275. }
  7276. function a() {
  7277. b.addClass("underline-tab"),
  7278. u.fill(T, c.MORE_HELP),
  7279. m.addClass("more-help")
  7280. }
  7281. function s(e, t) {
  7282. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7283. I.forEach(function(e) {
  7284. e.classList.remove("underline-tab")
  7285. })
  7286. }
  7287. var l = e("../../enum/Viewmode")
  7288. , c = e("../../enum/HelpModalType")
  7289. , h = e("./HelpEvent")
  7290. , u = (e("../helpManager"),
  7291. e("./../populateModal"))
  7292. , d = e("../../settings")
  7293. , p = e("../../util/common")
  7294. , f = e("events").EventEmitter
  7295. , g = $(".footer-help").eq(0)
  7296. , m = $("#help-dialog").eq(0)
  7297. , v = document.querySelector("#quick-logo")
  7298. , A = document.querySelector("#loaderCoBrand")
  7299. , y = document.querySelector("#help-dialog")
  7300. , C = document.querySelector(".footer")
  7301. , I = $(".help-tabs").children().toArray()
  7302. , E = $(".navigation-tab").eq(0)
  7303. , b = $(".more-help-tab").eq(0)
  7304. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7305. m.find(".close").eq(0))
  7306. , _ = m.find(".interactions").toArray()
  7307. , T = m.find(".ui-instructions").toArray()
  7308. , x = l.PANORAMA
  7309. , S = l.PANORAMA
  7310. , M = !1
  7311. , R = {
  7312. init: function(e, t) {
  7313. S = t,
  7314. x = t,
  7315. [y, A, v, C].forEach(function(e) {
  7316. e.classList.add(u.deviceType)
  7317. }),
  7318. n()
  7319. },
  7320. close: function() {
  7321. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7322. g.removeClass("open"),
  7323. m.removeClass("open"),
  7324. y.classList.contains("fadeIn"))) {
  7325. y.classList.remove("fadeIn");
  7326. var e = S === l.TRANSITIONING ? x : S;
  7327. u.clear(_, c.NAVIGATION, e)
  7328. }
  7329. },
  7330. updateMode: function(e) {
  7331. x = S,
  7332. S = e
  7333. }
  7334. };
  7335. p.extendObject(R, f.prototype),
  7336. t.exports = R
  7337. }
  7338. , {
  7339. "../../enum/HelpModalType": 28,
  7340. "../../enum/Viewmode": 51,
  7341. "../../settings": 166,
  7342. "../../util/common": 185,
  7343. "../helpManager": 68,
  7344. "./../populateModal": 75,
  7345. "./HelpEvent": 66,
  7346. events: 202
  7347. }],
  7348. 68: [function(e, t, i) {///js/gui/helpManager.js
  7349. (function(i) {
  7350. "use strict";
  7351. var n = e("../util/browser")
  7352. , r = e("./../util/logger")
  7353. , o = e("./../settings")
  7354. , a = new r(i)
  7355. , s = function() {
  7356. var e;
  7357. try {
  7358. return e = window.localStorage.getItem("visitCount") || "0",
  7359. e = (parseFloat(e) + 1).toString(),
  7360. window.localStorage.setItem("visitCount", e),
  7361. a.debug("visitCount = " + e),
  7362. e
  7363. } catch (t) {
  7364. e = "1",
  7365. a.debug("couldn't set local storage")
  7366. }
  7367. }()
  7368. , l = !1;
  7369. t.exports = {
  7370. isHelpDisabled: function() {
  7371. return "0" === n.valueFromHash("help", null) || l
  7372. },
  7373. isLargeHelpEnabled: function() {
  7374. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7375. },
  7376. isSmallHelpEnabled: function() {
  7377. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7378. },
  7379. isHelpEnabled: function() {
  7380. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7381. },
  7382. setAutoPlay: function(e) {
  7383. l = o.warp.auto >= 0 && e > 1
  7384. }
  7385. }
  7386. }
  7387. ).call(this, "/js/gui/helpManager.js")
  7388. }
  7389. , {
  7390. "../util/browser": 182,
  7391. "./../settings": 166,
  7392. "./../util/logger": 189
  7393. }],
  7394. 69: [function(e, t, i) {//"./immersiveMode"
  7395. "use strict";
  7396. function n(e, t, i, n) {
  7397. F = n,
  7398. r(e, t, i, F),
  7399. o(),
  7400. N = t.mode
  7401. }
  7402. function r(e, t, i, n) {
  7403. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7404. e.controls[t].on(v.Move, a),
  7405. e.controls[t].on(v.LongTap, c)
  7406. }),
  7407. M.on("mousewheel DOMMouseScroll", a),
  7408. i.on(m.TagActivated, a),
  7409. i.on(m.TagNavigation, a),
  7410. t.on(A.FlyingEnded, s),
  7411. t.on(A.ModeChanging, function(e, t) {
  7412. B = t !== C.PANORAMA && e !== C.PANORAMA
  7413. }),
  7414. t.on(A.ModeChanged, function(e, i) {
  7415. N = t.mode,
  7416. i !== C.TRANSITIONING ? l() : a("modeChange")
  7417. }),
  7418. n.on(y.TourStart, function() {
  7419. L = !0,
  7420. a()
  7421. }),
  7422. n.on(y.TourEnd, function() {
  7423. L = !1,
  7424. l()
  7425. }),
  7426. n.on(y.ActionInterrupted, function() {
  7427. L = !1
  7428. }),
  7429. R.addEventListener("touchend", function() {
  7430. $("#pullTab").hasClass("opened") && !L && l()
  7431. }, !0)
  7432. }
  7433. function o() {
  7434. p.isMobile() ? (b.forEach(function(e) {
  7435. e.classList.add("mobile")
  7436. }),
  7437. w.click(l)) : (b.forEach(function(e) {
  7438. e.addEventListener("mouseleave", function() {
  7439. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7440. }, !0)
  7441. }),
  7442. M.mouseleave(function() {
  7443. b[0].classList.contains("detectHover") && l()
  7444. }))
  7445. }
  7446. function a(e) {
  7447. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7448. P = !0,
  7449. g.close(),
  7450. h(e),
  7451. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) || S.addClass("fadeOut"),
  7452. _.hasClass("playing") || (b.forEach(function(e) {
  7453. e.classList.add("detectHover")
  7454. }),
  7455. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7456. }
  7457. function s() {
  7458. _.hasClass("playing") || (clearTimeout(O),
  7459. O = setTimeout(l, f.immersive.timeToShowAgain))
  7460. }
  7461. function l() {
  7462. clearTimeout(O),
  7463. P = !1,
  7464. I.forEach(function(e) {
  7465. e.classList.remove("fadeOut"),
  7466. e.classList.remove("drawerOpen")
  7467. }),
  7468. L || E.forEach(function(e) {
  7469. e.classList.remove("duringTour")
  7470. }),
  7471. b.forEach(function(e) {
  7472. e.classList.remove("detectHover")
  7473. })
  7474. }
  7475. function c() {
  7476. P ? l() : a(),
  7477. D = !0,
  7478. setTimeout(function() {
  7479. D = !1
  7480. }, f.immersive.uiStayDuration)
  7481. }
  7482. function h(e) {
  7483. !d(e) && L ? E.forEach(function(e) {
  7484. e.classList.remove("drawerOpen"),
  7485. e.classList.add("duringTour")
  7486. }) : _.hasClass("open") ? E.forEach(function(e) {
  7487. e.classList.remove("duringTour"),
  7488. e.classList.add("drawerOpen")
  7489. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7490. e.classList.add("fadeOut")
  7491. })
  7492. }
  7493. function u() {
  7494. T.hasClass("duringTour") || (L = !1,
  7495. a("gui"),
  7496. l())
  7497. }
  7498. function d(e) {
  7499. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7500. }
  7501. var p = e("../util/browser")
  7502. , f = e("../settings")
  7503. , g = e("./help/help")
  7504. , m = e("../enum/tagEvents")
  7505. , v = e("../enum/ControlEvents")
  7506. , A = e("../enum/PlayerEvents")
  7507. , y = e("../enum/DirectorEvents")
  7508. , A = e("../enum/PlayerEvents")
  7509. , C = e("../enum/Viewmode")
  7510. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7511. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7512. , b = $("#hover-bottom, #hover-top").toArray()
  7513. , w = ($("#pullTab").eq(0),
  7514. $("#playHead").eq(0),
  7515. $(".pinBottom-container").eq(0))
  7516. , _ = $("#drawer").eq(0)
  7517. , T = $("#drawer-container").eq(0)
  7518. , x = $("#meta-info").eq(0)
  7519. , S = $(".pinTop.left").eq(0)
  7520. , M = $("#player").eq(0)
  7521. , R = document.getElementById("pullTab")
  7522. , P = !1
  7523. , O = null
  7524. , L = !1
  7525. , D = !1
  7526. , N = null
  7527. , B = !1
  7528. , F = null;
  7529. t.exports.init = n,
  7530. t.exports.hideUi = a,
  7531. t.exports.resetDrawer = u
  7532. }
  7533. , {
  7534. "../enum/ControlEvents": 21,
  7535. "../enum/DirectorEvents": 23,
  7536. "../enum/tagEvents": 32,
  7537. "../enum/PlayerEvents": 40,
  7538. "../enum/Viewmode": 51,
  7539. "../settings": 166,
  7540. "../util/browser": 182,
  7541. "./help/help": 67
  7542. }],
  7543. 70: [function(e, t, i) {///js/gui/konami.js
  7544. (function(i) {
  7545. "use strict";
  7546. function n(e, t, i) {
  7547. l.debug("konami has the modelInstance");
  7548. var n = [];
  7549. $(window).on("keydown", function(e) {
  7550. n.push(e.which),
  7551. n.length > o.secretPanelWord.length && n.shift(),
  7552. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7553. o.debug = !0)
  7554. }),
  7555. $(window).on("keydown", function n(r) {
  7556. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7557. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7558. })
  7559. }
  7560. var r = e("./../util/logger")
  7561. , o = e("./../settings")
  7562. , a = e("./debug")
  7563. , s = e("./../util/common")
  7564. , l = (e("./gui"),
  7565. new r(i));
  7566. o.console && $("body").append('<div id="debug-console"></div>'),
  7567. t.exports.init = n
  7568. }
  7569. ).call(this, "/js/gui/konami.js")
  7570. }
  7571. , {
  7572. "./../settings": 166,
  7573. "./../util/common": 185,
  7574. "./../util/logger": 189,
  7575. "./debug": 63,
  7576. "./gui": 65
  7577. }],
  7578. 71: [function(e, t, i) {//"./landingScreen"
  7579. "use strict";
  7580. function n(e, t) {
  7581. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7582. }
  7583. function r(e) {
  7584. var t = $.Deferred();
  7585. e || t.resolve();
  7586. var i = c.startupFlyinDelay;
  7587. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7588. setTimeout(t.resolve.bind(t), i),
  7589. t
  7590. }
  7591. function o(e, t, i) {
  7592. var n = 0;
  7593. c.quickstart.enabled && (a(i),
  7594. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7595. var r = function() {
  7596. e.once(g.Move, l),
  7597. t.once(f.TourStart, l)
  7598. };
  7599. s(n, r)
  7600. }
  7601. function a(e) {
  7602. return e && (y.addClass("quick-brand"),
  7603. v.before(y),
  7604. A = $(".quick-brand").toArray()),
  7605. m.addClass("fadeOut"),
  7606. setTimeout(function() {
  7607. A.forEach(function(e) {
  7608. e.classList.add("fadeIn")
  7609. })
  7610. }, c.quickstart.showTextDelay),
  7611. setTimeout(function() {
  7612. A.forEach(function(e) {
  7613. e.classList.add("fadeOut")
  7614. })
  7615. }, c.quickstart.fadeOutDelay),
  7616. !0
  7617. }
  7618. function s(e, t) {
  7619. setTimeout(function() {
  7620. if (h.isHelpEnabled()) {
  7621. if (t(),
  7622. u.init(),
  7623. C.addClass("fadeIn landing " + u.deviceType),
  7624. h.isSmallHelpEnabled())
  7625. return void C.addClass("small");
  7626. u.fill(I, d.LANDING[E]),
  7627. C.addClass(E)
  7628. }
  7629. }, e)
  7630. }
  7631. function l() {
  7632. u.clear(I, d.LANDING[E]),
  7633. C.removeClass("fadeIn")
  7634. }
  7635. var c = e("../settings")
  7636. , h = (e("./help/help"),
  7637. e("./helpManager"))
  7638. , u = e("./populateModal")
  7639. , d = e("../enum/HelpModalType")
  7640. , p = e("../enum/Viewmode")
  7641. , f = e("../enum/DirectorEvents")
  7642. , g = e("../enum/PlayerEvents")
  7643. , m = $("#quick-blackout").eq(0)
  7644. , v = $("#quick-logo").eq(0)
  7645. , A = $(".quick-brand").toArray()
  7646. , y = $("#loaderCoBrand").eq(0)
  7647. , C = $("#interaction-modal").eq(0)
  7648. , I = C.find(".interaction").toArray()
  7649. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7650. "");
  7651. t.exports.delayLanding = r,
  7652. t.exports.showMessage = o,
  7653. t.exports.init = n,
  7654. t.exports.dismissModal = l
  7655. }
  7656. , {
  7657. "../enum/DirectorEvents": 23,
  7658. "../enum/HelpModalType": 28,
  7659. "../enum/PlayerEvents": 40,
  7660. "../enum/Viewmode": 51,
  7661. "../settings": 166,
  7662. "./help/help": 67,
  7663. "./helpManager": 68,
  7664. "./populateModal": 75
  7665. }],
  7666. 72: [function(e, t, i) {//"./loadingScreen"
  7667. "use strict";
  7668. var n = e("./circleLoader").circleLoader;
  7669. t.exports = {
  7670. element: $("#gui-loading"),
  7671. hide: function(e) {
  7672. n.done(),
  7673. this.element.fadeOut(2500, e)
  7674. },
  7675. show: function(e) {
  7676. this.element.fadeIn(500, function() {
  7677. this.element.css("display", "table"),
  7678. e && e()
  7679. }
  7680. .bind(this))
  7681. },
  7682. progress: function(e) {
  7683. n.set(e)
  7684. }
  7685. }
  7686. }
  7687. , {
  7688. "./circleLoader": 60
  7689. }],
  7690. 73: [function(e, t, i) {//./memoryUsage
  7691. "use strict";
  7692. var n = e("../settings")
  7693. , r = $("#memory-info")
  7694. , o = r.find("#memory-gpu")
  7695. , a = !1;
  7696. t.exports = {
  7697. show: function() {
  7698. n.profiling.enabled && (r.show(),
  7699. a = !0)
  7700. },
  7701. hide: function() {
  7702. r.hide(),
  7703. a = !1
  7704. },
  7705. toggle: function() {
  7706. a ? this.hide() : this.show()
  7707. },
  7708. update: function(e) {
  7709. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7710. }
  7711. }
  7712. }
  7713. , {
  7714. "../settings": 166
  7715. }],
  7716. 74: [function(e, t, i) {//./playButton
  7717. "use strict";
  7718. var n = e("../util/browser")
  7719. , r = e("../analytics");
  7720. e("../settings");
  7721. t.exports = {
  7722. show: function(e, t) {
  7723. $("#gui-message").fadeIn(250, function() {
  7724. $(this).css("display", "table");
  7725. var e = $("#gui-message").fracs().visible >= .5;
  7726. r.impression({
  7727. visible: e,
  7728. immediate: !0
  7729. })
  7730. }),
  7731. e && $("#quick-blackout").addClass("fadeOut"),
  7732. $("#button-play").on("click", function(i) {
  7733. 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(),
  7734. $("#quick-blackout").removeClass("fadeOut"),
  7735. $("#gui-message").hide(),
  7736. void t()) : void $("#gui-message").fadeOut(500, function() {
  7737. t()
  7738. })
  7739. })
  7740. }
  7741. }
  7742. }
  7743. , {
  7744. "../analytics": 4,
  7745. "../settings": 166,
  7746. "../util/browser": 182
  7747. }],
  7748. 75: [function(e, t, i) {//"./populateModal"
  7749. "use strict";
  7750. function n(e, t, i, n) {
  7751. function r(e) {
  7752. return e.classList.contains(a)
  7753. }
  7754. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7755. for (var a in o) {
  7756. var s = e.find(r);
  7757. for (var l in o[a]) {
  7758. var c = o[a][l];
  7759. if ("top-info" === l || "bottom-info" === l) {
  7760. var h = n ? c : "";
  7761. s.querySelector("." + l).textContent = h
  7762. } else {
  7763. var u = n ? c : ""
  7764. , d = s.querySelector("." + l);
  7765. d.src = u,
  7766. n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7767. }
  7768. }
  7769. }
  7770. var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7771. p.forEach(function(e) {
  7772. n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7773. })
  7774. }
  7775. var r = e("../util/browser")
  7776. , o = e("../localization/localize")
  7777. , a = e("../enum/HelpModalType")
  7778. , s = (e("../enum/HelpModalSize"),
  7779. e("../enum/Viewmode"));
  7780. t.exports = {
  7781. init: function() {
  7782. if (!this.hasInitialized) {
  7783. this.hasInitialized = !0,
  7784. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7785. this.assets = {},
  7786. this.assets[a.LANDING[s.PANORAMA]] = {
  7787. desktop: {
  7788. left: {
  7789. "top-info": o.ROTATE,
  7790. "big-image": "images/nav_help_mouse_drag_left.png",
  7791. keyboard: "images/nav_help_keyboard_left_right.png"
  7792. },
  7793. middle: {
  7794. "top-info": o.MOVE,
  7795. "big-image": "images/nav_help_mouse_click.png",
  7796. keyboard: "images/nav_help_keyboard_up_down.png"
  7797. },
  7798. right: {
  7799. "top-info": o.ZOOM,
  7800. "big-image": "images/nav_help_mouse_zoom.png",
  7801. keyboard: "images/nav_help_zoom_keys.png"
  7802. }
  7803. },
  7804. mobile: {
  7805. left: {
  7806. "top-info": o.ROTATE,
  7807. "big-image": "images/nav_help_gesture_drag.png"
  7808. },
  7809. middle: {
  7810. "top-info": o.MOVE,
  7811. "big-image": "images/nav_help_gesture_tap.png"
  7812. },
  7813. right: {
  7814. "top-info": o.ZOOM,
  7815. "big-image": "images/nav_help_gesture_pinch.png"
  7816. }
  7817. }
  7818. },
  7819. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7820. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7821. desktop: {
  7822. left: {
  7823. "top-info": o.ROTATE,
  7824. "big-image": "images/nav_help_mouse_drag_left.png",
  7825. keyboard: "images/nav_help_keyboard_left_right.png"
  7826. },
  7827. middle: {
  7828. "top-info": o.MOVE,
  7829. "big-image": "images/nav_help_mouse_position_right.png"
  7830. }
  7831. },
  7832. mobile: {
  7833. left: {
  7834. "top-info": o.ROTATE,
  7835. "big-image": "images/nav_help_gesture_drag.png"
  7836. },
  7837. middle: {
  7838. "top-info": o.MOVE,
  7839. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7840. }
  7841. }
  7842. },
  7843. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7844. desktop: {
  7845. left: {
  7846. "top-info": o.MOVE,
  7847. "big-image": "images/nav_help_mouse_position_left.png"
  7848. },
  7849. middle: {
  7850. "top-info": o.ROTATE,
  7851. "big-image": "images/nav_help_mouse_drag_right.png",
  7852. keyboard: "images/nav_help_keyboard_left_right.png"
  7853. }
  7854. },
  7855. mobile: {
  7856. left: {
  7857. "top-info": o.MOVE,
  7858. "big-image": "images/nav_help_gesture_position.png"
  7859. },
  7860. middle: {
  7861. "top-info": o.ROTATE,
  7862. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7863. }
  7864. }
  7865. };
  7866. var e = {
  7867. "top-info": o.INSIDE,
  7868. "big-image": "images/nav_help_click_inside.png",
  7869. keyboard: "images/nav_help_inside_key.png"
  7870. };
  7871. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7872. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7873. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7874. var t = {
  7875. "top-info": o.INSIDE,
  7876. "big-image": "images/nav_help_tap_inside.png"
  7877. };
  7878. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7879. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7880. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7881. this.assets[a.NAVIGATION] = {},
  7882. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7883. desktop: {
  7884. left: {
  7885. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7886. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7887. "big-image": "images/nav_help_mouse_drag_left.png",
  7888. keyboard: "images/nav_help_keyboard_left_right.png"
  7889. },
  7890. middle: {
  7891. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7892. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7893. "big-image": "images/nav_help_mouse_click.png",
  7894. keyboard: "images/nav_help_keyboard_up_down.png"
  7895. },
  7896. right: {
  7897. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7898. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7899. "big-image": "images/nav_help_mouse_zoom.png",
  7900. keyboard: "images/nav_help_zoom_keys.png"
  7901. }
  7902. },
  7903. mobile: {
  7904. left: {
  7905. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7906. "big-image": "images/nav_help_gesture_drag.png"
  7907. },
  7908. middle: {
  7909. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7910. "big-image": "images/nav_help_gesture_tap.png"
  7911. },
  7912. right: {
  7913. "top-info": o.HELP_MOBILE_3,
  7914. "big-image": "images/nav_help_gesture_pinch.png"
  7915. }
  7916. }
  7917. },
  7918. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7919. desktop: {
  7920. left: {
  7921. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7922. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7923. "big-image": "images/nav_help_mouse_drag_left.png",
  7924. keyboard: "images/nav_help_keyboard_all.png"
  7925. },
  7926. middle: {
  7927. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7928. "big-image": "images/nav_help_mouse_position_right.png"
  7929. },
  7930. right: {
  7931. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7932. "big-image": "images/nav_help_mouse_zoom.png"
  7933. }
  7934. },
  7935. mobile: {
  7936. left: {
  7937. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7938. "big-image": "images/nav_help_gesture_drag.png"
  7939. },
  7940. middle: {
  7941. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7942. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7943. },
  7944. right: {
  7945. "top-info": o.HELP_MOBILE_3,
  7946. "big-image": "images/nav_help_gesture_pinch.png"
  7947. }
  7948. }
  7949. },
  7950. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7951. desktop: {
  7952. left: {
  7953. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7954. "big-image": "images/nav_help_mouse_position_left.png"
  7955. },
  7956. middle: {
  7957. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7958. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7959. "big-image": "images/nav_help_mouse_drag_right.png",
  7960. keyboard: "images/nav_help_keyboard_left_right.png"
  7961. },
  7962. right: {
  7963. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7964. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7965. "big-image": "images/nav_help_mouse_zoom.png",
  7966. keyboard: "images/nav_help_keyboard_up_down.png"
  7967. }
  7968. },
  7969. mobile: {
  7970. left: {
  7971. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7972. "big-image": "images/nav_help_gesture_position.png"
  7973. },
  7974. middle: {
  7975. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7976. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7977. },
  7978. right: {
  7979. "top-info": o.HELP_MOBILE_3,
  7980. "big-image": "images/nav_help_gesture_pinch.png"
  7981. }
  7982. }
  7983. },
  7984. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7985. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7986. "top-info": o.HELP_DESKTOP_360_2A,
  7987. "bottom-info": o.HELP_DESKTOP_360_2B,
  7988. "big-image": "images/nav_help_click_inside.png",
  7989. keyboard: "images/nav_help_inside_key.png"
  7990. },
  7991. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7992. "top-info": o.HELP_MOBILE_360_2,
  7993. "big-image": "images/nav_help_tap_inside.png"
  7994. },
  7995. this.assets[a.MORE_HELP] = {
  7996. desktop: {
  7997. "more-help-hlr": {
  7998. "top-info": o.HELP_MORE_HLR_A,
  7999. "big-image": "images/nav_help_expand.svg",
  8000. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8001. },
  8002. "more-help-dollhouse": {
  8003. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8004. "big-image": "images/nav_help_dollhouse.svg",
  8005. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8006. },
  8007. "more-help-floors": {
  8008. "top-info": o.HELP_MORE_FLOORS_A,
  8009. "big-image": "images/nav_help_floor picker.svg",
  8010. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8011. },
  8012. "more-help-tag": {
  8013. "top-info": o.HELP_MORE_TAG_A,
  8014. "big-image": "images/nav_help_tag.svg",
  8015. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8016. },
  8017. "more-help-zoom": {
  8018. "top-info": o.HELP_MORE_ZOOM_A,
  8019. "big-image": "images/nav_help_zoom.svg",
  8020. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8021. },
  8022. "more-help-tour": {
  8023. "top-info": o.HELP_MORE_TOUR_A,
  8024. "big-image": "images/nav_help_play.png",
  8025. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8026. },
  8027. "more-help-inside": {
  8028. "top-info": o.HELP_MORE_INSIDE_A,
  8029. "big-image": "images/nav_help_inside.svg",
  8030. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8031. },
  8032. "more-help-vr": {
  8033. "top-info": o.HELP_MORE_VR_A,
  8034. "big-image": "images/nav_help_vr.svg",
  8035. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8036. },
  8037. "more-help-360": {
  8038. "top-info": o.HELP_MORE_360_A,
  8039. "big-image": "images/nav_help_360.svg",
  8040. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8041. },
  8042. "more-help-fullscreen": {
  8043. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8044. "big-image": "images/nav_help_fullscreen.svg",
  8045. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8046. }
  8047. },
  8048. mobile: {
  8049. "more-help-hlr": {
  8050. "top-info": o.HELP_MORE_HLR_A,
  8051. "big-image": "images/nav_help_expand.svg",
  8052. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8053. },
  8054. "more-help-dollhouse": {
  8055. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8056. "big-image": "images/nav_help_dollhouse.svg",
  8057. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8058. },
  8059. "more-help-floors": {
  8060. "top-info": o.HELP_MORE_FLOORS_A,
  8061. "big-image": "images/nav_help_floor picker.svg",
  8062. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8063. },
  8064. "more-help-tag": {
  8065. "top-info": o.HELP_MORE_TAG_A,
  8066. "big-image": "images/nav_help_tag.svg",
  8067. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8068. },
  8069. "more-help-tour": {
  8070. "top-info": o.HELP_MORE_TOUR_A,
  8071. "big-image": "images/nav_help_play.png",
  8072. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8073. },
  8074. "more-help-inside": {
  8075. "top-info": o.HELP_MORE_INSIDE_A,
  8076. "big-image": "images/nav_help_inside.svg",
  8077. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8078. },
  8079. "more-help-vr": {
  8080. "top-info": o.HELP_MORE_VR_A,
  8081. "big-image": "images/webvr.svg",
  8082. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8083. },
  8084. "more-help-360": {
  8085. "top-info": o.HELP_MORE_360_A,
  8086. "big-image": "images/nav_help_360.svg",
  8087. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8088. }
  8089. }
  8090. },
  8091. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8092. desktop: {
  8093. left: {
  8094. "top-info": o.ROTATE,
  8095. "big-image": "images/nav_help_mouse_drag_left.png",
  8096. keyboard: "images/nav_help_keyboard_left_right.png"
  8097. },
  8098. middle: {
  8099. "top-info": o.MOVE,
  8100. "big-image": "images/nav_help_mouse_click.png",
  8101. keyboard: "images/nav_help_keyboard_up_down.png"
  8102. },
  8103. right: {
  8104. "top-info": o.PLAY,
  8105. "big-image": "images/Desktop-help-play-button.svg",
  8106. keyboard: "images/Desktop-help-spacebar-2.svg"
  8107. }
  8108. },
  8109. mobile: {
  8110. left: {
  8111. "top-info": o.ROTATE,
  8112. "big-image": "images/nav_help_gesture_drag.png"
  8113. },
  8114. middle: {
  8115. "top-info": o.MOVE,
  8116. "big-image": "images/nav_help_gesture_tap.png"
  8117. },
  8118. right: {
  8119. "top-info": o.PLAY,
  8120. "big-image": "images/mobile-help-play-button.svg"
  8121. }
  8122. }
  8123. },
  8124. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8125. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8126. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8127. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8128. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8129. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8130. }
  8131. },
  8132. fill: function(e, t, i) {
  8133. n.call(this, e, t, i, !0)
  8134. },
  8135. clear: function(e, t, i) {
  8136. n.call(this, e, t, i, !1)
  8137. }
  8138. }
  8139. }
  8140. , {
  8141. "../enum/HelpModalSize": 27,
  8142. "../enum/HelpModalType": 28,
  8143. "../enum/Viewmode": 51,
  8144. "../localization/localize": 108,
  8145. "../util/browser": 182
  8146. }],
  8147. 76: [function(e, t, i) {//"./gui/sharing/ShareEvents"
  8148. "use strict";
  8149. t.exports = Object.freeze({
  8150. OPENED: "share.open",
  8151. CLOSED: "share.closed",
  8152. LINK_CLICKED: "share.linked"
  8153. })
  8154. }
  8155. , {}],
  8156. 77: [function(e, t, i) {//"./gui/sharing/modal"
  8157. "use strict";
  8158. function n(e) { //?
  8159. function t(t, i) {
  8160. var n = window.screenY + (window.innerHeight - i) / 2
  8161. , r = window.screenX + (window.innerWidth - t) / 2
  8162. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8163. I.emit(l.LINK_CLICKED, {
  8164. channel: e
  8165. }),
  8166. window.open(C[e], "shareWindow", o)
  8167. }
  8168. switch (e) {
  8169. case y.FACEBOOK:
  8170. t(580, 420);
  8171. break;
  8172. case y.TWITTER:
  8173. t(550, 440);
  8174. break;
  8175. case y.MAIL:
  8176. I.emit(l.LINK_CLICKED, {
  8177. channel: "email"
  8178. }),
  8179. window.open(C[e], "_blank");
  8180. break;
  8181. case y.LINKEDIN:
  8182. }
  8183. }
  8184. function r(e) {
  8185. I.emit(l.LINK_CLICKED, {
  8186. channel: "copylink"
  8187. });
  8188. var t = document.createRange();
  8189. t.selectNodeContents(v);
  8190. var i = window.getSelection();
  8191. i.removeAllRanges(),
  8192. i.addRange(t),
  8193. document.execCommand("copy"),
  8194. A.classList.remove("hidden"),
  8195. v.classList.add("highlighted")
  8196. }
  8197. function o(e) {
  8198. e && (e.stopPropagation(),
  8199. e.target === v) || (window.getSelection().removeAllRanges(),
  8200. v.classList.remove("highlighted"),
  8201. A.classList.add("hidden"))
  8202. }
  8203. var a = e("../../util/browser")
  8204. , s = e("../../localization/localize")
  8205. , l = e("./ShareEvents")
  8206. , c = e("../../util/common")
  8207. , h = e("events").EventEmitter
  8208. , u = document.getElementById("sharing")
  8209. , d = document.getElementById("share-modal")
  8210. , p = document.getElementById("share-close")
  8211. , f = document.getElementById("facebook-share")
  8212. , g = document.getElementById("twitter-share")
  8213. , m = document.getElementById("mail-share")
  8214. , v = document.getElementById("share-url-text")
  8215. , A = document.getElementById("copy-success")
  8216. , y = Object.freeze({
  8217. FACEBOOK: "facebook",
  8218. TWITTER: "twitter",
  8219. MAIL: "mail",
  8220. LINKEDIN: "linkedin"
  8221. })
  8222. , C = {};
  8223. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8224. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8225. C[y.MAIL] = "mailto:?subject=";
  8226. var I = {
  8227. init: function(e) {
  8228. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8229. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8230. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8231. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8232. u.addEventListener("click", this.toggle.bind(this)),
  8233. p.addEventListener("click", this.hide.bind(this)),
  8234. v.addEventListener("click", r),
  8235. d.addEventListener("click", o),
  8236. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8237. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8238. m.addEventListener("click", n.bind(this, y.MAIL)),
  8239. v.textContent = window.location.href + "&utm_source=4",
  8240. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8241. u.classList.remove("hidden")
  8242. },
  8243. show: function() {
  8244. this.emit(l.OPENED),
  8245. d.classList.add("fadeIn")
  8246. },
  8247. hide: function() {
  8248. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8249. document.selection && document.selection.empty(),
  8250. window.getSelection().removeAllRanges(),
  8251. o(),
  8252. d.classList.remove("fadeIn"))
  8253. },
  8254. toggle: function() {
  8255. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8256. }
  8257. };
  8258. c.extendObject(I, h.prototype),
  8259. t.exports = I
  8260. }
  8261. , {
  8262. "../../localization/localize": 108,
  8263. "../../util/browser": 182,
  8264. "../../util/common": 185,
  8265. "./ShareEvents": 76,
  8266. events: 202
  8267. }],
  8268. 78: [function(e, t, i) {//"./terms/TermsEvent"
  8269. "use strict";
  8270. t.exports = Object.freeze({
  8271. OPENED: "terms.opened",
  8272. CLOSED: "terms.closed"
  8273. })
  8274. }
  8275. , {}],
  8276. 79: [function(e, t, i) {///"./terms/terms"
  8277. "use strict";
  8278. var n = e("./TermsEvent")
  8279. , r = e("../../localization/localize")
  8280. , o = e("../../analytics")
  8281. , a = e("../../util/ajax")
  8282. , s = e("../../util/common")
  8283. , l = e("events").EventEmitter
  8284. , c = document.getElementById("terms-modal")
  8285. , h = {
  8286. init: function() {
  8287. $(".footer-terms").on("click", function(e) {
  8288. e.preventDefault(),
  8289. this.show()
  8290. }
  8291. .bind(this)),
  8292. $("#terms-modal .close").on("click", this.hide.bind(this))
  8293. },
  8294. show: function() {
  8295. this.emit(n.OPENED),
  8296. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8297. var t = $("#terms-text").html(e);
  8298. o.track("showcase_gui", {
  8299. gui_action: "click_terms_button",
  8300. interaction_source: "gui"
  8301. }),
  8302. t.find("a").attr("target", "_blank")
  8303. }).fail(function() {
  8304. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8305. }),
  8306. c.classList.add("fadeIn")
  8307. },
  8308. hide: function(e) {
  8309. e && e.preventDefault(),
  8310. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8311. c.classList.remove("fadeIn")
  8312. }
  8313. };
  8314. s.extendObject(h, l.prototype),
  8315. t.exports = h
  8316. }
  8317. , {
  8318. "../../analytics": 4,
  8319. "../../localization/localize": 108,
  8320. "../../util/ajax": 181,
  8321. "../../util/common": 185,
  8322. "./TermsEvent": 78,
  8323. events: 202
  8324. }],
  8325. 80: [function(e, t, i) {//"./title/TitleEvents"
  8326. "use strict";
  8327. t.exports = Object.freeze({
  8328. OPEN_INFO: "title.open.info",
  8329. CLOSE_INFO: "title.close.info",
  8330. SHOW_INFO: "title.show.info",
  8331. HIDE_INFO: "title.hide.info",
  8332. LINK_CLICKED: "title.link.click",
  8333. CONTACT_LINK_CLICKED: "title.contact.click",
  8334. ORIGIN_LINK_CLICKED: "title.origin.click"
  8335. })
  8336. }
  8337. , {}],
  8338. 81: [function(e, t, i) {//"./title/tagToggle"
  8339. "use strict";
  8340. function n(e, t) {
  8341. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8342. }
  8343. function r(e, t) {
  8344. function i(i) {
  8345. e.shouldShowtags = "show" === this.value,
  8346. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8347. }
  8348. document.getElementById("tag-toggles").classList.remove("hidden"),
  8349. document.getElementById("radio-tag-show").checked = !0;
  8350. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8351. n[r].addEventListener("change", i)
  8352. }
  8353. var o = e("../../settings");
  8354. t.exports.init = n
  8355. }
  8356. , {
  8357. "../../settings": 166
  8358. }],
  8359. 82: [function(e, t, i) {//"./gui/title/titleBar"
  8360. (function(i) {
  8361. "use strict";
  8362. function n(e, t) {
  8363. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8364. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8365. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8366. document.getElementById("gui-name").classList.add("noCoBrand"),
  8367. document.getElementById("cobrandTitle").classList.add("hidden")),
  8368. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8369. !1)
  8370. }
  8371. function r(e) {
  8372. return e ? (L = !0,
  8373. void (_.innerText = e)) : void _.classList.add("hidden")
  8374. }
  8375. function o(e, t, i, n) {
  8376. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8377. return void T.classList.add("hidden");
  8378. L = !0;
  8379. var r = []
  8380. , o = c(r, "<br>");
  8381. if (e && o('<span id="contactName">' + e + "</span>"),
  8382. t) {
  8383. var a = n || t
  8384. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8385. o(s)
  8386. }
  8387. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8388. r[0] = "",
  8389. x.innerHTML = r.join("")
  8390. }
  8391. function a(e) {
  8392. if ("string" == typeof e)
  8393. try {
  8394. e = JSON.parse(e)
  8395. } catch (e) {
  8396. return y.warn("Unable to parse address data"),
  8397. void S.parentElement.classList.add("hidden")
  8398. }
  8399. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8400. return void S.parentElement.classList.add("hidden");
  8401. L = !0;
  8402. var t = []
  8403. , i = c(t, " ");
  8404. e.address_1 && i(e.address_1),
  8405. e.address_2 && i(e.address_2),
  8406. e.city && i(e.city, ", "),
  8407. e.state && i(e.state, ", "),
  8408. e.zip && i(e.zip, e.state ? " " : ", "),
  8409. t[0] = "",
  8410. S.innerText = t.join("")
  8411. }
  8412. function s(e) {
  8413. var t = document.createElement("a");
  8414. return t.id = "url",
  8415. t.target = "_blank",
  8416. t.href = e,
  8417. t.innerText = e,
  8418. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8419. t
  8420. }
  8421. function l(e) {
  8422. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8423. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8424. P.appendChild(s(e)),
  8425. O.forEach(function(e) {
  8426. e.classList.add("share-link")
  8427. }),
  8428. !0)
  8429. }
  8430. function c(e, t) {
  8431. var i = e
  8432. , n = t;
  8433. return function(e, t) {
  8434. i.push(t || n, e)
  8435. }
  8436. }
  8437. function h() {
  8438. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8439. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8440. var e = [].slice.call(_.querySelectorAll("a"));
  8441. e.forEach(function(e) {
  8442. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8443. });
  8444. var t = [].slice.call(T.querySelectorAll("a"));
  8445. t.forEach(function(e) {
  8446. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8447. contact_type: e.getAttribute("id")
  8448. }))
  8449. })
  8450. }
  8451. var u = e("../../util/browser")
  8452. , d = e("../../util/common")
  8453. , p = e("../../util/logger")
  8454. , f = e("../../localization/localize")
  8455. , g = e("./titleBarSettings")
  8456. , m = e("../../settings")
  8457. , v = e("./TitleEvents")
  8458. , A = e("events").EventEmitter
  8459. , y = new p(i)
  8460. , C = document.querySelector(".pinTop.left")
  8461. , I = document.getElementsByClassName("title-container")[0]
  8462. , E = document.getElementById("title-toggle").querySelector("i")
  8463. , b = document.getElementById("meta-info-wrapper")
  8464. , w = document.getElementById("meta-info")
  8465. , _ = document.getElementById("meta-description")
  8466. , T = document.getElementsByClassName("contact-info")[0]
  8467. , x = document.getElementById("contact-data")
  8468. , S = document.getElementById("addressTxt")
  8469. , M = document.getElementById("tag-toggles")
  8470. , R = document.getElementById("share-origin")
  8471. , P = document.getElementById("share-link-wrapper")
  8472. , O = [w, b, I]
  8473. , L = !1
  8474. , D = !1
  8475. , N = {
  8476. populate: function(e) {
  8477. if (n(e.name, e.coBrand)) {
  8478. if (r(e.description),
  8479. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8480. a(e.address),
  8481. L) {
  8482. var t = document.createElement("br");
  8483. M.insertBefore(t, M.firstElementChild)
  8484. }
  8485. e.socialSharing && m.share.enabled && (D = l(e.url))
  8486. }
  8487. },
  8488. finishSetup: function(e) {
  8489. L = L || !!e,
  8490. h(),
  8491. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8492. },
  8493. toggleMeta: function(e, t) {
  8494. t && t.preventDefault();
  8495. var i = w.classList.contains("expand");
  8496. e && !i || (i ? (O.forEach(function(e) {
  8497. e.classList.remove("expand")
  8498. }),
  8499. this.emit(v.CLOSE_INFO)) : (O.forEach(function(e) {
  8500. e.classList.add("expand")
  8501. }),
  8502. this.emit(v.OPEN_INFO)))
  8503. },
  8504. setupToggling: function() {
  8505. b.style.height = w.offsetHeight + "px",
  8506. w.addEventListener("transitionend", function() {
  8507. b.style.height = w.offsetHeight + "px"
  8508. })
  8509. },
  8510. toggleTitle: function(e) {
  8511. e && e.preventDefault(),
  8512. C.classList.contains("closed") ? (C.classList.add("open"),
  8513. E.classList.remove("icon-dpad-right"),
  8514. E.classList.add("icon-dpad-left"),
  8515. this.emit(v.SHOW_INFO),
  8516. setTimeout(function() {
  8517. C.classList.remove("closed"),
  8518. C.classList.remove("open")
  8519. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8520. E.classList.remove("icon-dpad-left"),
  8521. E.classList.add("icon-dpad-right"),
  8522. this.emit(v.HIDE_INFO))
  8523. }
  8524. };
  8525. d.extendObject(N, A.prototype),
  8526. t.exports = N
  8527. }
  8528. ).call(this, "/js/gui/title/titleBar.js")
  8529. }
  8530. , {
  8531. "../../localization/localize": 108,
  8532. "../../settings": 166,
  8533. "../../util/browser": 182,
  8534. "../../util/common": 185,
  8535. "../../util/logger": 189,
  8536. "./TitleEvents": 80,
  8537. "./titleBarSettings": 83,
  8538. events: 202
  8539. }],
  8540. 83: [function(e, t, i) {//"./titleBarSettings"
  8541. "use strict";
  8542. t.exports = Object.freeze({
  8543. minTooltipCharacters: 19,
  8544. removeAnimationClasses: 500
  8545. })
  8546. }
  8547. , {}],
  8548. 84: [function(e, t, i) {//"./tourInteraction"
  8549. "use strict";
  8550. function n(e) {
  8551. C = e,
  8552. P.forEach(function(e) {
  8553. b.addEventListener(e, u.bind(this, !1), !0),
  8554. w.addEventListener(e, u.bind(this, !0), !0),
  8555. E.addEventListener(e, o, !0),
  8556. S.forEach(function(t) {
  8557. t.addEventListener(e, a, !0)
  8558. }),
  8559. $("#drawer img").on(e, a)
  8560. }),
  8561. //document.addEventListener("keydown", u.bind(this, !1), !0), //----MP
  8562. document.addEventListener("keydown", function(e){ //xzw 为了判断keyCon
  8563. if(window.keyCon == false)return;
  8564. u(!1,e);
  8565. }.bind(this), !0),
  8566. C.on(v.TourStart, function() {
  8567. E.classList.add("playing")
  8568. })
  8569. }
  8570. function r() {
  8571. C.playTour(),
  8572. I && clearTimeout(I),
  8573. d(),
  8574. _.removeClass("fadeIn")
  8575. }
  8576. function o() {
  8577. E.classList.contains("playing") && (C.stopTour(),
  8578. _.addClass("fadeIn"),
  8579. setTimeout(function() {
  8580. _.removeClass("fadeIn")
  8581. }, p.tourInteraction.showPauseButton),
  8582. O || (clearTimeout(I),
  8583. I = setTimeout(h, p.tourInteraction.showModal)),
  8584. setTimeout(function() {
  8585. E.classList.remove("playing")
  8586. }, p.tourInteraction.allowNextClick))
  8587. }
  8588. function a() {
  8589. C.tourInProgress && (C.stopTour(),
  8590. C.endTourProgress(),
  8591. E.classList.remove("playing"))
  8592. }
  8593. function s() {
  8594. T.is(":visible") ? r() : o()
  8595. }
  8596. function l() {
  8597. x.hasClass("playing") && (clearTimeout(I),
  8598. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8599. }
  8600. function c() {
  8601. E.classList.remove("playing"),
  8602. h()
  8603. }
  8604. function h() {
  8605. if (!p.tourInteraction.disabled) {
  8606. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8607. M.addClass("fadeIn tour " + m.deviceType);
  8608. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8609. if (!p.tourInteraction.smallModal) {
  8610. var t;
  8611. 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,
  8612. m.fill(R, A.TOUR_INTERACTION[t]),
  8613. M.addClass(t)
  8614. }
  8615. M.addClass(e)
  8616. }
  8617. }
  8618. function u(e, t) { //自动播放相关
  8619. if (t) {
  8620. var i = "keydown" === t.type
  8621. , n = t.which === f.SPACE || C.tourIsPlaying;
  8622. i && n || e || (O = !0),
  8623. C.atEndOfTour() && d(),
  8624. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8625. d(),
  8626. t.which !== f.SPACE && a()),
  8627. i && n && s()
  8628. }
  8629. }
  8630. function d() {
  8631. M.removeClass("fadeIn")
  8632. }
  8633. var p = (e("../util/browser"),
  8634. e("../settings"))
  8635. , f = e("../enum/Keys")
  8636. , g = e("../enum/Viewmode")
  8637. , m = (e("./helpManager"),
  8638. e("./populateModal"))
  8639. , v = e("../enum/DirectorEvents")
  8640. , A = e("../enum/HelpModalType")
  8641. , y = e("../enum/HelpModalSize")
  8642. , C = null
  8643. , I = null
  8644. , E = document.getElementById("pause-overlay")
  8645. , b = document.getElementById("player")
  8646. , w = document.getElementById("gui")
  8647. , _ = $("#pause-icon").eq(0)
  8648. , T = $("#play").eq(0)
  8649. , x = $("#playHead").eq(0)
  8650. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8651. , M = $("#interaction-modal").eq(0)
  8652. , R = $("#interaction-modal .interaction").toArray()
  8653. , P = ["touchstart", "mousedown", "pointerdown"]
  8654. , O = !1;
  8655. t.exports.init = n,
  8656. t.exports.play = r,
  8657. t.exports.pause = o,
  8658. t.exports.pauseWithoutCTA = a,
  8659. t.exports.togglePlay = s,
  8660. t.exports.stopTour = l,
  8661. t.exports.dismissModal = d
  8662. }
  8663. , {
  8664. "../enum/DirectorEvents": 23,
  8665. "../enum/HelpModalSize": 27,
  8666. "../enum/HelpModalType": 28,
  8667. "../enum/Keys": 30,
  8668. "../enum/Viewmode": 51,
  8669. "../settings": 166,
  8670. "../util/browser": 182,
  8671. "./helpManager": 68,
  8672. "./populateModal": 75
  8673. }],
  8674. 85: [function(e, t, i) {//"./gui/vr/vrEvent"
  8675. "use strict";
  8676. t.exports = Object.freeze({
  8677. OPENED: "vr.modal.opened",
  8678. LAUNCH: "vr.modal.launch",
  8679. CLOSED: "vr.modal.closed",
  8680. NEXT: "vr.modal.next",
  8681. PREV: "vr.modal.prev",
  8682. STORE: "vr.modal.store",
  8683. falseICECHOSEN: "vr.modal.device"
  8684. })
  8685. }
  8686. , {}],
  8687. 86: [function(e, t, i) {//"./../vr/vrLink"
  8688. "use strict";
  8689. function n(e, t, i) {
  8690. function n(e, t, n, r) {
  8691. function o() {
  8692. return p + "&m=" + t + "&display=" + e
  8693. }
  8694. function s() {
  8695. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8696. , t = "&utm_source=" + u
  8697. , n = "&utm_showcase_session_id=" + i;
  8698. return e + t + n
  8699. }
  8700. function l() {
  8701. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8702. }
  8703. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8704. }
  8705. function r(e, t, i, r) {
  8706. var o = "https://api.branch.io/v1/url"
  8707. , a = n(e, t, i, r)
  8708. , s = {
  8709. responseType: "json",
  8710. data: {
  8711. branch_key: h.appConfig.branch_key,
  8712. data: {
  8713. m: t,
  8714. full_url: a,
  8715. $desktop_url: m,
  8716. $og_app_id: "331853976762864119",
  8717. $og_title: i,
  8718. $og_description: r,
  8719. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8720. $canonical_url: window.location.href
  8721. }
  8722. }
  8723. };
  8724. c.post(o, s).done(function(t) {
  8725. f[e] = t.url
  8726. }).fail(function(t) {
  8727. f[e] = t
  8728. }
  8729. .bind(this, a))
  8730. }
  8731. function o(e, t, i) {
  8732. for (var r in s) {
  8733. var o = s[r]
  8734. , a = n(o, e, t, i);
  8735. f[o] = a
  8736. }
  8737. }
  8738. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8739. , d = g + "/vr/dlist/?ret=" + u
  8740. , p = g + "/vr/show/?ret=" + u
  8741. , m = "https://support.port.com/hc/en-us/articles/224728887-What-do-I-need-for-Virtual-Reality";
  8742. switch (e) {
  8743. case l.IOS:
  8744. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8745. break;
  8746. default:
  8747. o(t.sid, t.name, t.summary)
  8748. }
  8749. }
  8750. function r(e) {
  8751. var t = f[e];
  8752. window.open(t, "_blank")
  8753. }
  8754. function o(e) {
  8755. var t = u[e];
  8756. window.open(t, "_blank")
  8757. }
  8758. var a = e("../../util/browser")
  8759. , s = e("../../enum/VRApps")
  8760. , l = e("../../enum/VRPlatforms")
  8761. , c = e("../../util/ajax")
  8762. , h = e("../../settings")
  8763. , u = {};
  8764. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8765. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8766. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8767. for (var d in s) {
  8768. var p = s[d];
  8769. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8770. }
  8771. var f = {}
  8772. , g = function() {
  8773. var e = window.location.host;
  8774. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8775. "https://" + e
  8776. }();
  8777. t.exports.init = n,
  8778. t.exports.launch = r,
  8779. t.exports.launchStore = o
  8780. }
  8781. , {
  8782. "../../enum/VRApps": 46,
  8783. "../../enum/VRPlatforms": 49,
  8784. "../../settings": 166,
  8785. "../../util/ajax": 181,
  8786. "../../util/browser": 182
  8787. }],
  8788. 87: [function(e, t, i) {//"./vr/vrModal"
  8789. "use strict";
  8790. function n(e) {
  8791. var t;
  8792. switch (e) {
  8793. case m.IOS:
  8794. return t = p.iosVersion(),
  8795. t.major > 9 || 9 === t.major && t.minor >= 1;
  8796. case m.Android:
  8797. return t = p.androidVersion(),
  8798. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8799. }
  8800. return !1
  8801. }
  8802. function r(e, t) {
  8803. function i(e) {
  8804. K.emit(A.STORE, {
  8805. type: e
  8806. }),
  8807. f.launchStore(e)
  8808. }
  8809. function r(e) {
  8810. switch (e !== _.pageCount && (a(e),
  8811. N.text(e + 1 + " / " + _.pageCount)),
  8812. e) {
  8813. case _.Title:
  8814. O.css("display", "none"),
  8815. L.text(u[e]),
  8816. o(s);
  8817. break;
  8818. case _.Cardboard:
  8819. O.css("display", "block"),
  8820. L.text(u[e]),
  8821. M.filter(".cardboard").off(),
  8822. M.filter(".gearvr").off(),
  8823. c(e, s),
  8824. h(H, X, Z);
  8825. break;
  8826. case _.Gear:
  8827. L.text(u[e]),
  8828. c(e, s),
  8829. T.addClass("lastPage"),
  8830. h(G, X, Z);
  8831. break;
  8832. case _.pageCount:
  8833. T.removeClass("fadeIn"),
  8834. K.emit(A.CLOSED)
  8835. }
  8836. B.filter("[src='']").hide()
  8837. }
  8838. var s = function() {
  8839. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8840. w = ".show-supported",
  8841. m.Android) : (T.addClass("unsupported"),
  8842. w = ".show-unsupported",
  8843. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8844. w = ".show-ios",
  8845. _ = v.ios,
  8846. m.IOS) : (T.addClass("desktop"),
  8847. w = ".show-desktop",
  8848. m.Desktop)
  8849. }();
  8850. f.init(s, e, t),
  8851. s !== m.Desktop && T.addClass("mobile");
  8852. var l = function(e) {
  8853. K.emit(A.LAUNCH, {
  8854. vr_platform: s,
  8855. vr_app: e
  8856. }),
  8857. f.launch(e)
  8858. };
  8859. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8860. q.gear = l.bind(this, g.GearVR),
  8861. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8862. d(),
  8863. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8864. $(w).show();
  8865. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8866. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8867. s === m.IOS && (u.splice(1, 1),
  8868. y.splice(1, 1)),
  8869. $("#vr").on("click", function(e) {
  8870. e.preventDefault(),
  8871. T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8872. r(b),
  8873. T.addClass("fadeIn"),
  8874. K.emit(A.OPENED))
  8875. });
  8876. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8877. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8878. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8879. $("span.modelLink").text(I),
  8880. O.on("click", function(e) {
  8881. K.emit(A.PREV),
  8882. b--,
  8883. r(b)
  8884. }),
  8885. L.on("click", function(e) {
  8886. L.text();
  8887. K.emit(A.NEXT, {
  8888. nextAction: y[b]
  8889. }),
  8890. b++,
  8891. r(b)
  8892. }),
  8893. T.find(".close").on("click", K.dismiss)
  8894. }
  8895. function o(e) {
  8896. switch (e) {
  8897. case m.Android:
  8898. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8899. M.filter(".gearvr").off().on("click", q.gear),
  8900. s(H, G, "logo-button", "same-line");
  8901. break;
  8902. case m.UnsupportedAndroid:
  8903. s("", z, "", "");
  8904. break;
  8905. case m.IOS:
  8906. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8907. s(H, "", "logo-button", "");
  8908. break;
  8909. case m.Desktop:
  8910. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8911. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8912. s(H, G, "logo-button", "same-line"),
  8913. Q.cardboard()
  8914. }
  8915. }
  8916. function a(e) {
  8917. $(".p1, .p2, .p3").hide(),
  8918. x.insertAfter(S),
  8919. T.removeClass("front-page"),
  8920. T.removeClass("details-page"),
  8921. T.removeClass("lastPage"),
  8922. M.removeClass("logo-button"),
  8923. M.removeClass("same-line"),
  8924. S.removeClass("headsetOptions"),
  8925. R.attr("src", ""),
  8926. R.filter(".second").removeClass("gear"),
  8927. R.css("display", "inline-block"),
  8928. R.off(),
  8929. P.filter(".second").css("display", ""),
  8930. D.css("display", "none"),
  8931. $(".p" + (e + 1) + w).show(),
  8932. R.filter(".third").insertBefore(P.filter(".third"))
  8933. }
  8934. function s(e, t, i, n) {
  8935. T.addClass("front-page"),
  8936. R.filter(".first").attr("src", e),
  8937. R.filter(".second").attr("src", t),
  8938. M.filter(".first").addClass(i),
  8939. M.filter(".second").addClass(i),
  8940. M.addClass(n),
  8941. ".show-desktop" === w && S.insertAfter(x)
  8942. }
  8943. function l(e, t, i) {
  8944. S.addClass("headsetOptions"),
  8945. M.off(),
  8946. R.filter(".second").attr("src", t),
  8947. D.css("display", "block"),
  8948. P.filter(".second").css("display", "none"),
  8949. D.on("click", function() {
  8950. a(_.Title),
  8951. o(m.Desktop)
  8952. }),
  8953. e && (K.emit(A.falseICECHOSEN, {
  8954. name: g.GearVR
  8955. }),
  8956. R.filter(".first").attr("src", e),
  8957. R.filter(".second").addClass("gear"),
  8958. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8959. Q.gearvr()),
  8960. i && (K.emit(A.falseICECHOSEN, {
  8961. name: g.Cardboard
  8962. }),
  8963. R.filter(".third").attr("src", i),
  8964. R.filter(".third").show(),
  8965. R.filter(".third").insertAfter(R.filter(".second")),
  8966. R.filter(".third").addClass("link"),
  8967. R.filter(".second").addClass("link"),
  8968. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8969. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  8970. Q.cardboard())
  8971. }
  8972. function c(e, t) {
  8973. switch (t) {
  8974. case m.IOS:
  8975. X = Y,
  8976. Z = j;
  8977. break;
  8978. case m.Desktop:
  8979. e === _.Cardboard ? (X = F,
  8980. Z = U,
  8981. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8982. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  8983. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8984. Z = "");
  8985. break;
  8986. default:
  8987. e === _.Cardboard ? (X = z,
  8988. Z = j) : (X = k,
  8989. Z = W)
  8990. }
  8991. }
  8992. function h(e, t, i) {
  8993. T.find(".inner").addClass("details-page"),
  8994. T.addClass("details-page"),
  8995. R.filter(".first").attr("src", e),
  8996. R.filter(".second").attr("src", t),
  8997. R.filter(".third").attr("src", i)
  8998. }
  8999. function u() {
  9000. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9001. K.emit(A.CLOSED))
  9002. }
  9003. function d() {
  9004. var e = p.aspectRatio() > 1 && p.isMobile();
  9005. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9006. T.toggleClass("tiny", window.innerHeight <= y.narrowLandscapeHeight),
  9007. T.toggleClass("tinier", window.innerHeight <= y.reallyNarrowLandscapeHeight)
  9008. }
  9009. var p = e("../../util/browser")
  9010. , f = e("./vrLink")
  9011. , g = e("../../enum/VRApps")
  9012. , m = e("../../enum/VRPlatforms")
  9013. , v = e("../../enum/VRPages")
  9014. , A = e("./vrEvent")
  9015. , y = (e("../../settings"),
  9016. e("../../constants"))
  9017. , C = e("../../localization/localize")
  9018. , I = e("../../util/common")
  9019. , E = e("events").EventEmitter
  9020. , b = 0
  9021. , w = null
  9022. , _ = v.standard
  9023. , T = $(".vr-popup")
  9024. , x = T.find(".vr-popup-body")
  9025. , S = T.find(".vr-images")
  9026. , M = T.find(".img-container")
  9027. , R = T.find(".vr-sm-image")
  9028. , P = M.find(".vr-img-caption")
  9029. , O = $(".vr-buttons").find(".prev-button")
  9030. , L = $(".vr-buttons").find(".next-button")
  9031. , D = S.find(".front-close")
  9032. , N = $(".vr-page")
  9033. , B = T.find("img")
  9034. , F = "images/apple-store.png"
  9035. , V = "images/badge-oculus.png"
  9036. , U = "images/badge-cardboard.png"
  9037. , k = "images/logo-samsung.png"
  9038. , H = "images/headset-cardboard.png"
  9039. , G = "images/headset-gearvr.png"
  9040. , z = "images/ico-android-robot.png"
  9041. , W = "images/ico-gearvr.png"
  9042. , j = "images/ico-vr.png"
  9043. , Y = "images/apple-logo-white.svg"
  9044. , X = null
  9045. , Z = null
  9046. , q = {}
  9047. , K = {
  9048. init: r,
  9049. dismiss: u,
  9050. isDeviceSupported: n
  9051. };
  9052. I.extendObject(K, E.prototype),
  9053. $(window).resize(d);
  9054. var Q = function() {
  9055. var e = P.filter(".first").find(".cardboard")
  9056. , t = P.filter(".first").find(".gearvr");
  9057. return {
  9058. cardboard: function() {
  9059. t.addClass("hidden"),
  9060. e.removeClass("hidden")
  9061. },
  9062. gearvr: function() {
  9063. e.addClass("hidden"),
  9064. t.removeClass("hidden")
  9065. }
  9066. }
  9067. }();
  9068. t.exports = K
  9069. }
  9070. , {
  9071. "../../constants": 8,
  9072. "../../enum/VRApps": 46,
  9073. "../../enum/VRPages": 48,
  9074. "../../enum/VRPlatforms": 49,
  9075. "../../localization/localize": 108,
  9076. "../../settings": 166,
  9077. "../../util/browser": 182,
  9078. "../../util/common": 185,
  9079. "./vrEvent": 85,
  9080. "./vrLink": 86,
  9081. events: 202
  9082. }],
  9083. 88: [function(e, t, i) {//"./webvr/WebVrEvent"
  9084. "use strict";
  9085. t.exports = Object.freeze({
  9086. OPENED: "webvr.modal.opened",
  9087. SHOW_TERMS: "webvr.footer.show.terms"
  9088. })
  9089. }
  9090. , {}],
  9091. 89: [function(e, t, i) {///js/gui/webvr/webVRgui.js
  9092. (function(i) {
  9093. "use strict";
  9094. function n(e, t, i, n) {
  9095. function r(e) {
  9096. e.preventDefault(),
  9097. a(e.currentTarget.id)
  9098. }
  9099. function a(e) {
  9100. ne[e](),
  9101. Object.keys(ne).map(function(t, i) {
  9102. $("#" + t).toggleClass("tabs-underlined", t === e)
  9103. })
  9104. }
  9105. y = i,
  9106. v = t,
  9107. w.init(E.Android, e, n),
  9108. m();
  9109. var l = new RegExp("daydream","i")
  9110. , c = l.test(y.displayName);
  9111. c ? (a("tabdaydream"),
  9112. B.filter(".device-headset-side").attr("src", H),
  9113. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9114. B.filter(".device-headset-side").attr("src", Y),
  9115. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9116. $("#vr").on("click", function(e) {
  9117. e.preventDefault(),
  9118. g("click_webvr_button"),
  9119. L.is(":hidden") && (ie.emit(_.OPENED),
  9120. o())
  9121. }),
  9122. $(".webvr-popup .close").on("click", function(e) {
  9123. e.preventDefault(),
  9124. D.hasClass("hidden") ? (g("webvr_help_close"),
  9125. p()) : s()
  9126. }),
  9127. $("#tabcardboard").on("click", r),
  9128. $("#tabdaydream").on("click", r),
  9129. $("#tabnative").on("click", r),
  9130. $(".webvr-popup .open-with-app").on("click", function(e) {
  9131. e.preventDefault(),
  9132. g("webvr_learn_more"),
  9133. a("tabnative"),
  9134. p()
  9135. }),
  9136. $(".webvr-popup .help").on("click", function(e) {
  9137. e.preventDefault(),
  9138. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9139. p()
  9140. }),
  9141. $(".webvr-popup .terms").on("click", function(e) {
  9142. e.preventDefault(),
  9143. g("webvr_click_terms"),
  9144. s(),
  9145. ie.emit(_.SHOW_TERMS)
  9146. }),
  9147. F.on("click", function(e) {
  9148. e.preventDefault(),
  9149. g(ee),
  9150. window.open(J, "_blank")
  9151. }),
  9152. V.on("click", function(e) {
  9153. e.preventDefault(),
  9154. g("webvr_phone_link"),
  9155. window.open(te, "_blank")
  9156. }),
  9157. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9158. e.preventDefault(),
  9159. g("webvr_cardboard_link"),
  9160. w.launch(b.CardboardAndroid)
  9161. }),
  9162. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9163. e.preventDefault(),
  9164. g("webvr_oculus_link"),
  9165. w.launch(b.GearVR)
  9166. })
  9167. }
  9168. function r() {
  9169. function e() {
  9170. y.isPresenting || (f(),
  9171. window.removeEventListener("vrdisplaypresentchange", e))
  9172. }
  9173. R.info("Headset mounted"),
  9174. v.suspend();
  9175. var t = document.createElement("canvas");
  9176. for (t.getContext("webgl"),
  9177. t.className = "webvr-canvas",
  9178. document.bgColor = "#000",
  9179. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9180. document.body.removeChild(document.body.firstChild);
  9181. document.body.appendChild(t),
  9182. g("webvr_enter_app"),
  9183. y.requestPresent([{
  9184. source: t,
  9185. predistorted: !0
  9186. }]).catch(function(t) {
  9187. R.error("Failed to present: " + t),
  9188. g("webvr_exit_calibrate"),
  9189. e()
  9190. }),
  9191. A.then(function() {
  9192. window.dispatchEvent(new Event("vrapp-start"))
  9193. }),
  9194. window.addEventListener("vrdisplaypresentchange", e)
  9195. }
  9196. function o() {
  9197. O.fadeOut(I.guiAnimationSpeed),
  9198. L.fadeIn(I.guiAnimationSpeed),
  9199. a()
  9200. }
  9201. function a() {
  9202. if (!A) {
  9203. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9204. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9205. A = new Promise(function(e, i) {
  9206. var n = document.createElement("script");
  9207. n.type = "text/javascript",
  9208. n.src = t,
  9209. n.onload = e,
  9210. document.head.appendChild(n)
  9211. }
  9212. )
  9213. }
  9214. D.find(".enter-button").on("click", r)
  9215. }
  9216. function s() {
  9217. g("webvr_modal_close"),
  9218. D.find(".enter-button").off("click", r),
  9219. L.fadeOut(I.guiAnimationSpeed, function() {
  9220. D.toggleClass("hidden", !1),
  9221. N.toggleClass("hidden", !0),
  9222. C.exitFullscreen()
  9223. }),
  9224. O.fadeIn(I.guiAnimationSpeed)
  9225. }
  9226. function l() {
  9227. k.toggleClass("hidden", !1),
  9228. U.toggleClass("hidden", !0)
  9229. }
  9230. function c() {
  9231. k.toggleClass("hidden", !0),
  9232. U.toggleClass("hidden", !1)
  9233. }
  9234. function h() {
  9235. B.filter(".device-headset").attr("src", G),
  9236. B.filter(".device-phone").attr("src", z),
  9237. J = Z,
  9238. ee = K,
  9239. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9240. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9241. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9242. c()
  9243. }
  9244. function u() {
  9245. B.filter(".badge-cardboard").attr("src", j),
  9246. B.filter(".badge-oculus").attr("src", X),
  9247. l()
  9248. }
  9249. function d() {
  9250. B.filter(".device-headset").attr("src", Y),
  9251. B.filter(".device-phone").attr("src", W),
  9252. J = q,
  9253. ee = Q,
  9254. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9255. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9256. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9257. c()
  9258. }
  9259. function p() {
  9260. D.toggleClass("hidden"),
  9261. N.toggleClass("hidden")
  9262. }
  9263. function f() {
  9264. R.info("exiting webVR"),
  9265. g("webvr_exit_app"),
  9266. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9267. }
  9268. function g(e) {
  9269. var t = C.isLandscape() ? "landscape" : "portrait";
  9270. T.trackAlways("showcase_gui", {
  9271. gui_action: e,
  9272. orientation: t
  9273. })
  9274. }
  9275. function m() {
  9276. var e = C.isLandscape();
  9277. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9278. }
  9279. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9280. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9281. 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 = {
  9282. init: n
  9283. }, ne = {
  9284. tabcardboard: d,
  9285. tabdaydream: h,
  9286. tabnative: u
  9287. };
  9288. S.extendObject(ie, P.prototype),
  9289. $(window).resize(m),
  9290. t.exports = ie
  9291. }
  9292. ).call(this, "/js/gui/webvr/webVRgui.js")
  9293. }
  9294. , {
  9295. "../../analytics": 4,
  9296. "../../constants": 8,
  9297. "../../enum/VRApps": 46,
  9298. "../../enum/VRPlatforms": 49,
  9299. "../../localization/localize": 108,
  9300. "../../settings": 166,
  9301. "../../util/browser": 182,
  9302. "../../util/common": 185,
  9303. "../../util/logger": 189,
  9304. "./../gui": 65,
  9305. "./../vr/vrLink": 86,
  9306. "./WebVrEvent": 88,
  9307. events: 202
  9308. }],
  9309. 90: [function(e, t, i) {//"../label/Label"
  9310. "use strict";
  9311. function n(e, t, i, n, o) {
  9312. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9313. this.roomId = o || "",
  9314. this.labelId = e,
  9315. this.position = (new r.Vector3).copy(t),
  9316. this.text = i
  9317. }
  9318. var r = e("three")
  9319. , o = e("../util/browser");
  9320. n.prototype.build = function() {
  9321. var e = window.document.createElement("div");
  9322. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9323. var t = window.document.createElement("div");
  9324. t.setAttribute("class", "gui-floorplan-label-text");
  9325. var i = window.document.createTextNode(this.text);
  9326. t.appendChild(i),
  9327. e.appendChild(t),
  9328. window.document.body.appendChild(e),
  9329. this.labelGui = e,
  9330. this.textBlock = t,
  9331. $(this.labelGui).hide();
  9332. var n = window.getComputedStyle(this.labelGui);
  9333. this.initialTransform = n.transform || n.webkitTransform
  9334. }
  9335. ,
  9336. t.exports = n
  9337. }
  9338. , {
  9339. "../util/browser": 182,
  9340. three: 217
  9341. }],
  9342. 91: [function(e, t, i) {//"./label/LabelDisplayController"
  9343. "use strict";
  9344. function n() {
  9345. this.player = null,
  9346. this.modelManager = null,
  9347. this.container = null
  9348. }
  9349. var r = e("three")
  9350. , o = (e("../util/common"),
  9351. e("../enum/PlayerEvents"))
  9352. , a = (e("../enum/DirectorEvents"),
  9353. e("../enum/ModelManagerEvents"))
  9354. , s = e("../settings")
  9355. , l = e("../enum/Viewmode")
  9356. , c = (e("../enum/WarpStyle"),
  9357. e("../util/transitions"),
  9358. e("../util/lerp"),
  9359. e("../util/browser"));
  9360. n.prototype.init = function(e, t, i) {
  9361. this.player = e,
  9362. this.modelManager = t,
  9363. this.container = i,
  9364. this.updateModel(),
  9365. this.bindEvents()
  9366. }
  9367. ,
  9368. n.prototype.bindEvents = function() {
  9369. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9370. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9371. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9372. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9373. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9374. }
  9375. ,
  9376. n.prototype.updateModel = function() {
  9377. this.model = this.modelManager.getActiveModel()
  9378. }
  9379. ,
  9380. n.prototype.handlePlayerViewChanged = function() {
  9381. this.updateLabelVisibility(),
  9382. this.updateLabelDisplay()
  9383. }
  9384. ,
  9385. n.prototype.getLabelsForFloor = function(e, t) {
  9386. return t = t || [],
  9387. t.length = 0,
  9388. this.model.labels.forEach(function(i) {
  9389. this.labelVisibleForFloor(i, e) && t.push(i)
  9390. }
  9391. .bind(this)),
  9392. t
  9393. }
  9394. ,
  9395. n.prototype.getLabelsForCurrentFloor = function(e) {
  9396. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9397. }
  9398. ,
  9399. n.prototype.labelVisibleForFloor = function(e, t) {
  9400. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9401. if (!this.model.showingLabels || !e.labelGui || !i)
  9402. return !1;
  9403. var n = e.floorId === this.model.floors.size() - 1;
  9404. return this.model.allFloorsVisible ? n : e.floorId === t
  9405. }
  9406. ,
  9407. n.prototype.updateLabelVisibility = function(e) {
  9408. this.model.labels.forEach(function(e) {
  9409. 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)
  9410. }
  9411. .bind(this))
  9412. }
  9413. ,
  9414. n.prototype.showAllLabels = function(e, t) {
  9415. this.model.labels.forEach(function(i) {
  9416. this.showLabel(i, e, t)
  9417. }
  9418. .bind(this))
  9419. }
  9420. ,
  9421. n.prototype.hideAllLabels = function(e, t) {
  9422. this.model.labels.forEach(function(i) {
  9423. this.hideLabel(i, e, t)
  9424. }
  9425. .bind(this))
  9426. }
  9427. ,
  9428. n.prototype.showLabel = function(e, t, i) {
  9429. this.model.showingLabels && (e.visible || (e.visible = !0,
  9430. e.labelGui.style.display = "block",
  9431. e.labelGui.style.opacity = 0,
  9432. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9433. }
  9434. ,
  9435. n.prototype.hideLabel = function(e, t, i) {
  9436. e.visible && (e.visible = !1,
  9437. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9438. }
  9439. ,
  9440. n.prototype.supportedMode = function() {
  9441. return this.player.mode === l.FLOORPLAN
  9442. }
  9443. ,
  9444. n.prototype.updateLabelDisplay = function() {
  9445. var e = (new r.Vector3,
  9446. new r.Vector3,
  9447. []);
  9448. return function() {
  9449. var t = this.player.getLabelScaleFactor()
  9450. , i = .6
  9451. , n = 1.2
  9452. , r = (1 - t) * n + i
  9453. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9454. this.getLabelsForCurrentFloor(e);
  9455. for (var a = 0; a < e.length; a++) {
  9456. var l = e[a];
  9457. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9458. 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)
  9459. }
  9460. }
  9461. }(),
  9462. n.prototype.updateProjectedGuiElement = function() {
  9463. var e = new r.Vector3;
  9464. new r.Vector3;
  9465. return function(t, i, n, r, o) {
  9466. i.style.fontSize = 100 * o + "%";
  9467. var a = $('#player').width()
  9468. , s = $('#player').height()
  9469. , l = .5 * a
  9470. , c = .5 * s;
  9471. e.copy(n),
  9472. e.project(this.player.camera);
  9473. var h = e.x * l + l
  9474. , u = -(e.y * c) + c;
  9475. h -= t.offsetWidth / 2,
  9476. u -= t.offsetHeight / 2,
  9477. t.style.left = h + "px",
  9478. t.style.top = u + "px"
  9479. }
  9480. }(),
  9481. n.prototype.handleStartInside = function(e) {
  9482. this.updateLabelVisibility()
  9483. }
  9484. ,
  9485. n.prototype.handleStartOutside = function() {
  9486. this.updateLabelVisibility()
  9487. }
  9488. ,
  9489. t.exports = n
  9490. }
  9491. , {
  9492. "../enum/DirectorEvents": 23,
  9493. "../enum/ModelManagerEvents": 33,
  9494. "../enum/PlayerEvents": 40,
  9495. "../enum/Viewmode": 51,
  9496. "../enum/WarpStyle": 52,
  9497. "../settings": 166,
  9498. "../util/browser": 182,
  9499. "../util/common": 185,
  9500. "../util/lerp": 188,
  9501. "../util/transitions": 195,
  9502. three: 217
  9503. }],
  9504. 92: [function(e, t, i) {//"./lib/array-polyfill"
  9505. "use strict";
  9506. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9507. if (null == this)
  9508. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9509. if ("function" != typeof e)
  9510. throw new TypeError("predicate must be a function");
  9511. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9512. if (t = i[o],
  9513. e.call(r, t, o, i))
  9514. return o;
  9515. return -1
  9516. }
  9517. ),
  9518. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9519. value: function(e) {
  9520. if (null == this)
  9521. throw new TypeError('"this" is null or not defined');
  9522. var t = Object(this)
  9523. , i = t.length >>> 0;
  9524. if ("function" != typeof e)
  9525. throw new TypeError("predicate must be a function");
  9526. for (var n = arguments[1], r = 0; r < i; ) {
  9527. var o = t[r];
  9528. if (e.call(n, o, r, t))
  9529. return o;
  9530. r++
  9531. }
  9532. }
  9533. })
  9534. }
  9535. , {}],
  9536. 93: [function(e, t, i) {//"../lib/dat.gui"
  9537. "use strict";
  9538. var n = n || {};
  9539. t.exports = n,
  9540. n.gui = n.gui || {},
  9541. n.utils = n.utils || {},
  9542. n.controllers = n.controllers || {},
  9543. n.dom = n.dom || {},
  9544. n.color = n.color || {},
  9545. n.utils.css = function() {
  9546. return {
  9547. load: function(e, t) {
  9548. t = t || document;
  9549. var i = t.createElement("link");
  9550. i.type = "text/css",
  9551. i.rel = "stylesheet",
  9552. i.href = e,
  9553. t.getElementsByTagName("head")[0].appendChild(i)
  9554. },
  9555. inject: function(e, t) {
  9556. t = t || document;
  9557. var i = document.createElement("style");
  9558. i.type = "text/css",
  9559. i.innerHTML = e,
  9560. t.getElementsByTagName("head")[0].appendChild(i)
  9561. }
  9562. }
  9563. }(),
  9564. n.utils.common = function() {
  9565. var e = Array.prototype.forEach
  9566. , t = Array.prototype.slice;
  9567. return {
  9568. BREAK: {},
  9569. extend: function(e) {
  9570. return this.each(t.call(arguments, 1), function(t) {
  9571. for (var i in t)
  9572. this.isUndefined(t[i]) || (e[i] = t[i])
  9573. }, this),
  9574. e
  9575. },
  9576. defaults: function(e) {
  9577. return this.each(t.call(arguments, 1), function(t) {
  9578. for (var i in t)
  9579. this.isUndefined(e[i]) && (e[i] = t[i])
  9580. }, this),
  9581. e
  9582. },
  9583. compose: function() {
  9584. var e = t.call(arguments);
  9585. return function() {
  9586. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9587. i = [e[n].apply(this, i)];
  9588. return i[0]
  9589. }
  9590. },
  9591. each: function(t, i, n) {
  9592. if (t)
  9593. if (e && t.forEach && t.forEach === e)
  9594. t.forEach(i, n);
  9595. else if (t.length === t.length + 0) {
  9596. for (var r = 0, o = t.length; r < o; r++)
  9597. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9598. return
  9599. } else
  9600. for (var r in t)
  9601. if (i.call(n, t[r], r) === this.BREAK)
  9602. return
  9603. },
  9604. defer: function(e) {
  9605. setTimeout(e, 0)
  9606. },
  9607. toArray: function(e) {
  9608. return e.toArray ? e.toArray() : t.call(e)
  9609. },
  9610. isUndefined: function(e) {
  9611. return void 0 === e
  9612. },
  9613. isNull: function(e) {
  9614. return null === e
  9615. },
  9616. isNaN: function(e) {
  9617. return e !== e
  9618. },
  9619. isArray: Array.isArray || function(e) {
  9620. return e.constructor === Array
  9621. }
  9622. ,
  9623. isObject: function(e) {
  9624. return e === Object(e)
  9625. },
  9626. isNumber: function(e) {
  9627. return e === e + 0
  9628. },
  9629. isString: function(e) {
  9630. return e === e + ""
  9631. },
  9632. isBoolean: function(e) {
  9633. return e === !1 || e === !0
  9634. },
  9635. isFunction: function(e) {
  9636. return "[object Function]" === Object.prototype.toString.call(e)
  9637. }
  9638. }
  9639. }(),
  9640. n.controllers.Controller = function(e) {
  9641. var t = function(e, t) {
  9642. this.initialValue = e[t],
  9643. this.domElement = document.createElement("div"),
  9644. this.object = e,
  9645. this.property = t,
  9646. this.__onChange = void 0,
  9647. this.__onFinishChange = void 0
  9648. };
  9649. return e.extend(t.prototype, {
  9650. onChange: function(e) {
  9651. return this.__onChange = e,
  9652. this
  9653. },
  9654. onFinishChange: function(e) {
  9655. return this.__onFinishChange = e,
  9656. this
  9657. },
  9658. setValue: function(e) {
  9659. return this.object[this.property] = e,
  9660. this.__onChange && this.__onChange.call(this, e),
  9661. this.updateDisplay(),
  9662. this
  9663. },
  9664. getValue: function() {
  9665. return this.object[this.property]
  9666. },
  9667. updateDisplay: function() {
  9668. return this
  9669. },
  9670. isModified: function() {
  9671. return this.initialValue !== this.getValue()
  9672. }
  9673. }),
  9674. t
  9675. }(n.utils.common),
  9676. n.dom.dom = function(e) {
  9677. function t(t) {
  9678. if ("0" === t || e.isUndefined(t))
  9679. return 0;
  9680. var i = t.match(r);
  9681. return e.isNull(i) ? 0 : parseFloat(i[1])
  9682. }
  9683. var i = {
  9684. HTMLEvents: ["change"],
  9685. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9686. KeyboardEvents: ["keydown"]
  9687. }
  9688. , n = {};
  9689. e.each(i, function(t, i) {
  9690. e.each(t, function(e) {
  9691. n[e] = i
  9692. })
  9693. });
  9694. var r = /(\d+(\.\d+)?)px/
  9695. , o = {
  9696. makeSelectable: function(e, t) {
  9697. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9698. return !1
  9699. }
  9700. : function() {}
  9701. ,
  9702. e.style.MozUserSelect = t ? "auto" : "none",
  9703. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9704. e.unselectable = t ? "on" : "off")
  9705. },
  9706. makeFullscreen: function(t, i, n) {
  9707. e.isUndefined(i) && (i = !0),
  9708. e.isUndefined(n) && (n = !0),
  9709. t.style.position = "absolute",
  9710. i && (t.style.left = 0,
  9711. t.style.right = 0),
  9712. n && (t.style.top = 0,
  9713. t.style.bottom = 0)
  9714. },
  9715. fakeEvent: function(t, i, r, o) {
  9716. r = r || {};
  9717. var a = n[i];
  9718. if (!a)
  9719. throw new Error("Event type " + i + " not supported.");
  9720. var s = document.createEvent(a);
  9721. switch (a) {
  9722. case "MouseEvents":
  9723. var l = r.x || r.clientX || 0
  9724. , c = r.y || r.clientY || 0;
  9725. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9726. break;
  9727. case "KeyboardEvents":
  9728. var h = s.initKeyboardEvent || s.initKeyEvent;
  9729. e.defaults(r, {
  9730. cancelable: !0,
  9731. ctrlKey: !1,
  9732. altKey: !1,
  9733. shiftKey: !1,
  9734. metaKey: !1,
  9735. keyCode: void 0,
  9736. charCode: void 0
  9737. }),
  9738. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9739. break;
  9740. default:
  9741. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9742. }
  9743. e.defaults(s, o),
  9744. t.dispatchEvent(s)
  9745. },
  9746. bind: function(e, t, i, n) {
  9747. return n = n || !1,
  9748. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9749. o
  9750. },
  9751. unbind: function(e, t, i, n) {
  9752. return n = n || !1,
  9753. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9754. o
  9755. },
  9756. addClass: function(e, t) {
  9757. if (void 0 === e.className)
  9758. e.className = t;
  9759. else if (e.className !== t) {
  9760. var i = e.className.split(/ +/);
  9761. i.indexOf(t) == -1 && (i.push(t),
  9762. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9763. }
  9764. return o
  9765. },
  9766. removeClass: function(e, t) {
  9767. if (t)
  9768. if (void 0 === e.className)
  9769. ;
  9770. else if (e.className === t)
  9771. e.removeAttribute("class");
  9772. else {
  9773. var i = e.className.split(/ +/)
  9774. , n = i.indexOf(t);
  9775. n != -1 && (i.splice(n, 1),
  9776. e.className = i.join(" "))
  9777. }
  9778. else
  9779. e.className = void 0;
  9780. return o
  9781. },
  9782. hasClass: function(e, t) {
  9783. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9784. },
  9785. getWidth: function(e) {
  9786. var i = getComputedStyle(e);
  9787. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9788. },
  9789. getHeight: function(e) {
  9790. var i = getComputedStyle(e);
  9791. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9792. },
  9793. getOffset: function(e) {
  9794. var t = {
  9795. left: 0,
  9796. top: 0
  9797. };
  9798. if (e.offsetParent)
  9799. do
  9800. t.left += e.offsetLeft,
  9801. t.top += e.offsetTop;
  9802. while (e = e.offsetParent);return t
  9803. },
  9804. isActive: function(e) {
  9805. return e === document.activeElement && (e.type || e.href)
  9806. }
  9807. };
  9808. return o
  9809. }(n.utils.common),
  9810. n.controllers.OptionController = function(e, t, i) {
  9811. var n = function(e, r, o) {
  9812. n.superclass.call(this, e, r);
  9813. var a = this;
  9814. if (this.__select = document.createElement("select"),
  9815. i.isArray(o)) {
  9816. var s = {};
  9817. i.each(o, function(e) {
  9818. s[e] = e
  9819. }),
  9820. o = s
  9821. }
  9822. i.each(o, function(e, t) {
  9823. var i = document.createElement("option");
  9824. i.innerHTML = t,
  9825. i.setAttribute("value", e),
  9826. a.__select.appendChild(i)
  9827. }),
  9828. this.updateDisplay(),
  9829. t.bind(this.__select, "change", function() {
  9830. var e = this.options[this.selectedIndex].value;
  9831. a.setValue(e)
  9832. }),
  9833. this.domElement.appendChild(this.__select)
  9834. };
  9835. return n.superclass = e,
  9836. i.extend(n.prototype, e.prototype, {
  9837. setValue: function(e) {
  9838. var t = n.superclass.prototype.setValue.call(this, e);
  9839. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9840. t
  9841. },
  9842. updateDisplay: function() {
  9843. return this.__select.value = this.getValue(),
  9844. n.superclass.prototype.updateDisplay.call(this)
  9845. }
  9846. }),
  9847. n
  9848. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9849. n.controllers.NumberController = function(e, t) {
  9850. function i(e) {
  9851. return e = e.toString(),
  9852. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9853. }
  9854. var n = function(e, r, o) {
  9855. n.superclass.call(this, e, r),
  9856. o = o || {},
  9857. this.__min = o.min,
  9858. this.__max = o.max,
  9859. this.__step = o.step,
  9860. 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,
  9861. this.__precision = i(this.__impliedStep)
  9862. };
  9863. return n.superclass = e,
  9864. t.extend(n.prototype, e.prototype, {
  9865. setValue: function(e) {
  9866. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9867. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9868. n.superclass.prototype.setValue.call(this, e)
  9869. },
  9870. min: function(e) {
  9871. return this.__min = e,
  9872. this
  9873. },
  9874. max: function(e) {
  9875. return this.__max = e,
  9876. this
  9877. },
  9878. step: function(e) {
  9879. return this.__step = e,
  9880. this.__impliedStep = e,
  9881. this.__precision = i(e),
  9882. this
  9883. }
  9884. }),
  9885. n
  9886. }(n.controllers.Controller, n.utils.common),
  9887. n.controllers.NumberControllerBox = function(e, t, i) {
  9888. function n(e, t) {
  9889. var i = Math.pow(10, t);
  9890. return Math.round(e * i) / i
  9891. }
  9892. var r = function(e, n, o) {
  9893. function a() {
  9894. var e = parseFloat(d.__input.value);
  9895. i.isNaN(e) || d.setValue(e)
  9896. }
  9897. function s() {
  9898. a(),
  9899. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9900. }
  9901. function l(e) {
  9902. t.bind(window, "mousemove", c),
  9903. t.bind(window, "mouseup", h),
  9904. u = e.clientY
  9905. }
  9906. function c(e) {
  9907. var t = u - e.clientY;
  9908. d.setValue(d.getValue() + t * d.__impliedStep),
  9909. u = e.clientY
  9910. }
  9911. function h() {
  9912. t.unbind(window, "mousemove", c),
  9913. t.unbind(window, "mouseup", h)
  9914. }
  9915. this.__truncationSuspended = !1,
  9916. r.superclass.call(this, e, n, o);
  9917. var u, d = this;
  9918. this.__input = document.createElement("input"),
  9919. this.__input.setAttribute("type", "text"),
  9920. t.bind(this.__input, "change", a),
  9921. t.bind(this.__input, "blur", s),
  9922. t.bind(this.__input, "mousedown", l),
  9923. t.bind(this.__input, "keydown", function(e) {
  9924. 13 === e.keyCode && (d.__truncationSuspended = !0,
  9925. this.blur(),
  9926. d.__truncationSuspended = !1)
  9927. }),
  9928. this.updateDisplay(),
  9929. this.domElement.appendChild(this.__input)
  9930. };
  9931. return r.superclass = e,
  9932. i.extend(r.prototype, e.prototype, {
  9933. updateDisplay: function() {
  9934. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  9935. r.superclass.prototype.updateDisplay.call(this)
  9936. }
  9937. }),
  9938. r
  9939. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  9940. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  9941. function o(e, t, i, n, r) {
  9942. return n + (r - n) * ((e - t) / (i - t))
  9943. }
  9944. var a = function(e, i, n, r, s) {
  9945. function l(e) {
  9946. t.bind(window, "mousemove", c),
  9947. t.bind(window, "mouseup", h),
  9948. c(e)
  9949. }
  9950. function c(e) {
  9951. e.preventDefault();
  9952. var i = t.getOffset(u.__background)
  9953. , n = t.getWidth(u.__background);
  9954. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  9955. !1
  9956. }
  9957. function h() {
  9958. t.unbind(window, "mousemove", c),
  9959. t.unbind(window, "mouseup", h),
  9960. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  9961. }
  9962. a.superclass.call(this, e, i, {
  9963. min: n,
  9964. max: r,
  9965. step: s
  9966. });
  9967. var u = this;
  9968. this.__background = document.createElement("div"),
  9969. this.__foreground = document.createElement("div"),
  9970. t.bind(this.__background, "mousedown", l),
  9971. t.addClass(this.__background, "slider"),
  9972. t.addClass(this.__foreground, "slider-fg"),
  9973. this.updateDisplay(),
  9974. this.__background.appendChild(this.__foreground),
  9975. this.domElement.appendChild(this.__background)
  9976. };
  9977. return a.superclass = e,
  9978. a.useDefaultStyles = function() {
  9979. i.inject(r)
  9980. }
  9981. ,
  9982. n.extend(a.prototype, e.prototype, {
  9983. updateDisplay: function() {
  9984. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9985. return this.__foreground.style.width = 100 * e + "%",
  9986. a.superclass.prototype.updateDisplay.call(this)
  9987. }
  9988. }),
  9989. a
  9990. }(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}"),
  9991. n.controllers.FunctionController = function(e, t, i) {
  9992. var n = function(e, i, r) {
  9993. n.superclass.call(this, e, i);
  9994. var o = this;
  9995. this.__button = document.createElement("div"),
  9996. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  9997. t.bind(this.__button, "click", function(e) {
  9998. return e.preventDefault(),
  9999. o.fire(),
  10000. !1
  10001. }),
  10002. t.addClass(this.__button, "button"),
  10003. this.domElement.appendChild(this.__button)
  10004. };
  10005. return n.superclass = e,
  10006. i.extend(n.prototype, e.prototype, {
  10007. fire: function() {
  10008. this.__onChange && this.__onChange.call(this),
  10009. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10010. this.getValue().call(this.object)
  10011. }
  10012. }),
  10013. n
  10014. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10015. n.controllers.BooleanController = function(e, t, i) {
  10016. var n = function(e, i) {
  10017. function r() {
  10018. o.setValue(!o.__prev)
  10019. }
  10020. n.superclass.call(this, e, i);
  10021. var o = this;
  10022. this.__prev = this.getValue(),
  10023. this.__checkbox = document.createElement("input"),
  10024. this.__checkbox.setAttribute("type", "checkbox"),
  10025. t.bind(this.__checkbox, "change", r, !1),
  10026. this.domElement.appendChild(this.__checkbox),
  10027. this.updateDisplay()
  10028. };
  10029. return n.superclass = e,
  10030. i.extend(n.prototype, e.prototype, {
  10031. setValue: function(e) {
  10032. var t = n.superclass.prototype.setValue.call(this, e);
  10033. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10034. this.__prev = this.getValue(),
  10035. t
  10036. },
  10037. updateDisplay: function() {
  10038. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10039. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10040. n.superclass.prototype.updateDisplay.call(this)
  10041. }
  10042. }),
  10043. n
  10044. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10045. n.color.toString = function(e) {
  10046. return function(t) {
  10047. if (1 == t.a || e.isUndefined(t.a)) {
  10048. for (var i = t.hex.toString(16); i.length < 6; )
  10049. i = "0" + i;
  10050. return "#" + i
  10051. }
  10052. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10053. }
  10054. }(n.utils.common),
  10055. n.color.interpret = function(e, t) {
  10056. var i, n, r = function() {
  10057. n = !1;
  10058. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10059. return t.each(o, function(r) {
  10060. if (r.litmus(e))
  10061. return t.each(r.conversions, function(r, o) {
  10062. if (i = r.read(e),
  10063. n === !1 && i !== !1)
  10064. return n = i,
  10065. i.conversionName = o,
  10066. i.conversion = r,
  10067. t.BREAK
  10068. }),
  10069. t.BREAK
  10070. }),
  10071. n
  10072. }, o = [{
  10073. litmus: t.isString,
  10074. conversions: {
  10075. THREE_CHAR_HEX: {
  10076. read: function(e) {
  10077. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10078. return null !== t && {
  10079. space: "HEX",
  10080. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10081. }
  10082. },
  10083. write: e
  10084. },
  10085. SIX_CHAR_HEX: {
  10086. read: function(e) {
  10087. var t = e.match(/^#([A-F0-9]{6})$/i);
  10088. return null !== t && {
  10089. space: "HEX",
  10090. hex: parseInt("0x" + t[1].toString())
  10091. }
  10092. },
  10093. write: e
  10094. },
  10095. CSS_RGB: {
  10096. read: function(e) {
  10097. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10098. return null !== t && {
  10099. space: "RGB",
  10100. r: parseFloat(t[1]),
  10101. g: parseFloat(t[2]),
  10102. b: parseFloat(t[3])
  10103. }
  10104. },
  10105. write: e
  10106. },
  10107. CSS_RGBA: {
  10108. read: function(e) {
  10109. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10110. return null !== t && {
  10111. space: "RGB",
  10112. r: parseFloat(t[1]),
  10113. g: parseFloat(t[2]),
  10114. b: parseFloat(t[3]),
  10115. a: parseFloat(t[4])
  10116. }
  10117. },
  10118. write: e
  10119. }
  10120. }
  10121. }, {
  10122. litmus: t.isNumber,
  10123. conversions: {
  10124. HEX: {
  10125. read: function(e) {
  10126. return {
  10127. space: "HEX",
  10128. hex: e,
  10129. conversionName: "HEX"
  10130. }
  10131. },
  10132. write: function(e) {
  10133. return e.hex
  10134. }
  10135. }
  10136. }
  10137. }, {
  10138. litmus: t.isArray,
  10139. conversions: {
  10140. RGB_ARRAY: {
  10141. read: function(e) {
  10142. return 3 == e.length && {
  10143. space: "RGB",
  10144. r: e[0],
  10145. g: e[1],
  10146. b: e[2]
  10147. }
  10148. },
  10149. write: function(e) {
  10150. return [e.r, e.g, e.b]
  10151. }
  10152. },
  10153. RGBA_ARRAY: {
  10154. read: function(e) {
  10155. return 4 == e.length && {
  10156. space: "RGB",
  10157. r: e[0],
  10158. g: e[1],
  10159. b: e[2],
  10160. a: e[3]
  10161. }
  10162. },
  10163. write: function(e) {
  10164. return [e.r, e.g, e.b, e.a]
  10165. }
  10166. }
  10167. }
  10168. }, {
  10169. litmus: t.isObject,
  10170. conversions: {
  10171. RGBA_OBJ: {
  10172. read: function(e) {
  10173. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10174. space: "RGB",
  10175. r: e.r,
  10176. g: e.g,
  10177. b: e.b,
  10178. a: e.a
  10179. }
  10180. },
  10181. write: function(e) {
  10182. return {
  10183. r: e.r,
  10184. g: e.g,
  10185. b: e.b,
  10186. a: e.a
  10187. }
  10188. }
  10189. },
  10190. RGB_OBJ: {
  10191. read: function(e) {
  10192. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10193. space: "RGB",
  10194. r: e.r,
  10195. g: e.g,
  10196. b: e.b
  10197. }
  10198. },
  10199. write: function(e) {
  10200. return {
  10201. r: e.r,
  10202. g: e.g,
  10203. b: e.b
  10204. }
  10205. }
  10206. },
  10207. HSVA_OBJ: {
  10208. read: function(e) {
  10209. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10210. space: "HSV",
  10211. h: e.h,
  10212. s: e.s,
  10213. v: e.v,
  10214. a: e.a
  10215. }
  10216. },
  10217. write: function(e) {
  10218. return {
  10219. h: e.h,
  10220. s: e.s,
  10221. v: e.v,
  10222. a: e.a
  10223. }
  10224. }
  10225. },
  10226. HSV_OBJ: {
  10227. read: function(e) {
  10228. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10229. space: "HSV",
  10230. h: e.h,
  10231. s: e.s,
  10232. v: e.v
  10233. }
  10234. },
  10235. write: function(e) {
  10236. return {
  10237. h: e.h,
  10238. s: e.s,
  10239. v: e.v
  10240. }
  10241. }
  10242. }
  10243. }
  10244. }];
  10245. return r
  10246. }(n.color.toString, n.utils.common),
  10247. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10248. function g(e, t, i, o) {
  10249. if (void 0 === t[i])
  10250. throw new Error("Object " + t + ' has no property "' + i + '"');
  10251. var a;
  10252. if (o.color)
  10253. a = new h(t,i);
  10254. else {
  10255. var s = [t, i].concat(o.factoryArgs);
  10256. a = n.apply(e, s)
  10257. }
  10258. o.before instanceof r && (o.before = o.before.__li),
  10259. A(e, a),
  10260. p.addClass(a.domElement, "c");
  10261. var l = document.createElement("span");
  10262. p.addClass(l, "property-name"),
  10263. l.innerHTML = a.property;
  10264. var c = document.createElement("div");
  10265. c.appendChild(l),
  10266. c.appendChild(a.domElement);
  10267. var u = m(e, c, o.before);
  10268. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10269. p.addClass(u, typeof a.getValue()),
  10270. v(e, u, a),
  10271. e.__controllers.push(a),
  10272. a
  10273. }
  10274. function m(e, t, i) {
  10275. var n = document.createElement("li");
  10276. return t && n.appendChild(t),
  10277. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10278. e.onResize(),
  10279. n
  10280. }
  10281. function v(e, t, i) {
  10282. if (i.__li = t,
  10283. i.__gui = e,
  10284. f.extend(i, {
  10285. options: function(t) {
  10286. return arguments.length > 1 ? (i.remove(),
  10287. g(e, i.object, i.property, {
  10288. before: i.__li.nextElementSibling,
  10289. factoryArgs: [f.toArray(arguments)]
  10290. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10291. g(e, i.object, i.property, {
  10292. before: i.__li.nextElementSibling,
  10293. factoryArgs: [t]
  10294. })) : void 0
  10295. },
  10296. name: function(e) {
  10297. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10298. i
  10299. },
  10300. listen: function() {
  10301. return i.__gui.listen(i),
  10302. i
  10303. },
  10304. remove: function() {
  10305. return i.__gui.remove(i),
  10306. i
  10307. }
  10308. }),
  10309. i instanceof l) {
  10310. var n = new s(i.object,i.property,{
  10311. min: i.__min,
  10312. max: i.__max,
  10313. step: i.__step
  10314. });
  10315. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10316. var t = i[e]
  10317. , r = n[e];
  10318. i[e] = n[e] = function() {
  10319. var e = Array.prototype.slice.call(arguments);
  10320. return t.apply(i, e),
  10321. r.apply(n, e)
  10322. }
  10323. }),
  10324. p.addClass(t, "has-slider"),
  10325. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10326. } else if (i instanceof s) {
  10327. var r = function(t) {
  10328. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10329. g(e, i.object, i.property, {
  10330. before: i.__li.nextElementSibling,
  10331. factoryArgs: [i.__min, i.__max, i.__step]
  10332. })) : t
  10333. };
  10334. i.min = f.compose(r, i.min),
  10335. i.max = f.compose(r, i.max)
  10336. } else
  10337. i instanceof o ? (p.bind(t, "click", function() {
  10338. p.fakeEvent(i.__checkbox, "click")
  10339. }),
  10340. p.bind(i.__checkbox, "click", function(e) {
  10341. e.stopPropagation()
  10342. })) : i instanceof a ? (p.bind(t, "click", function() {
  10343. p.fakeEvent(i.__button, "click")
  10344. }),
  10345. p.bind(t, "mouseover", function() {
  10346. p.addClass(i.__button, "hover")
  10347. }),
  10348. p.bind(t, "mouseout", function() {
  10349. p.removeClass(i.__button, "hover")
  10350. })) : i instanceof h && (p.addClass(t, "color"),
  10351. i.updateDisplay = f.compose(function(e) {
  10352. return t.style.borderLeftColor = i.__color.toString(),
  10353. e
  10354. }, i.updateDisplay),
  10355. i.updateDisplay());
  10356. i.setValue = f.compose(function(t) {
  10357. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10358. t
  10359. }, i.setValue)
  10360. }
  10361. function A(e, t) {
  10362. var i = e.getRoot()
  10363. , n = i.__rememberedObjects.indexOf(t.object);
  10364. if (n != -1) {
  10365. var r = i.__rememberedObjectIndecesToControllers[n];
  10366. if (void 0 === r && (r = {},
  10367. i.__rememberedObjectIndecesToControllers[n] = r),
  10368. r[t.property] = t,
  10369. i.load && i.load.remembered) {
  10370. var o, a = i.load.remembered;
  10371. if (a[e.preset])
  10372. o = a[e.preset];
  10373. else {
  10374. if (!a[L])
  10375. return;
  10376. o = a[L]
  10377. }
  10378. if (o[n] && void 0 !== o[n][t.property]) {
  10379. var s = o[n][t.property];
  10380. t.initialValue = s,
  10381. t.setValue(s)
  10382. }
  10383. }
  10384. }
  10385. }
  10386. function y(e, t) {
  10387. return document.location.href + "." + t
  10388. }
  10389. function C(e) {
  10390. var t = e.__save_row = document.createElement("li");
  10391. p.addClass(e.domElement, "has-save"),
  10392. e.__ul.insertBefore(t, e.__ul.firstChild),
  10393. p.addClass(t, "save-row");
  10394. var i = document.createElement("span");
  10395. i.innerHTML = "&nbsp;",
  10396. p.addClass(i, "button gears");
  10397. var n = document.createElement("span");
  10398. n.innerHTML = "Save",
  10399. p.addClass(n, "button"),
  10400. p.addClass(n, "save");
  10401. var r = document.createElement("span");
  10402. r.innerHTML = "New",
  10403. p.addClass(r, "button"),
  10404. p.addClass(r, "save-as");
  10405. var o = document.createElement("span");
  10406. o.innerHTML = "Revert",
  10407. p.addClass(o, "button"),
  10408. p.addClass(o, "revert");
  10409. var a = e.__preset_select = document.createElement("select");
  10410. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10411. w(e, i, i == e.preset)
  10412. }) : w(e, L, !1),
  10413. p.bind(a, "change", function() {
  10414. for (var t = 0; t < e.__preset_select.length; t++)
  10415. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10416. e.preset = this.value
  10417. }),
  10418. t.appendChild(a),
  10419. t.appendChild(i),
  10420. t.appendChild(n),
  10421. t.appendChild(r),
  10422. t.appendChild(o),
  10423. D) {
  10424. var s = document.getElementById("dg-save-locally")
  10425. , l = document.getElementById("dg-local-explain");
  10426. s.style.display = "block";
  10427. var c = document.getElementById("dg-local-storage");
  10428. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10429. var h = function() {
  10430. l.style.display = e.useLocalStorage ? "block" : "none"
  10431. };
  10432. h(),
  10433. p.bind(c, "change", function() {
  10434. e.useLocalStorage = !e.useLocalStorage,
  10435. h()
  10436. })
  10437. }
  10438. var u = document.getElementById("dg-new-constructor");
  10439. p.bind(u, "keydown", function(e) {
  10440. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10441. }),
  10442. p.bind(i, "click", function() {
  10443. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10444. S.show(),
  10445. u.focus(),
  10446. u.select()
  10447. }),
  10448. p.bind(n, "click", function() {
  10449. e.save()
  10450. }),
  10451. p.bind(r, "click", function() {
  10452. var t = prompt("Enter a new preset name.");
  10453. t && e.saveAs(t)
  10454. }),
  10455. p.bind(o, "click", function() {
  10456. e.revert()
  10457. })
  10458. }
  10459. function I(e) {
  10460. function t(t) {
  10461. return t.preventDefault(),
  10462. r = t.clientX,
  10463. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10464. p.bind(window, "mousemove", i),
  10465. p.bind(window, "mouseup", n),
  10466. !1
  10467. }
  10468. function i(t) {
  10469. return t.preventDefault(),
  10470. e.width += r - t.clientX,
  10471. e.onResize(),
  10472. r = t.clientX,
  10473. !1
  10474. }
  10475. function n() {
  10476. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10477. p.unbind(window, "mousemove", i),
  10478. p.unbind(window, "mouseup", n)
  10479. }
  10480. e.__resize_handle = document.createElement("div"),
  10481. f.extend(e.__resize_handle.style, {
  10482. width: "6px",
  10483. marginLeft: "-3px",
  10484. height: "200px",
  10485. cursor: "ew-resize",
  10486. position: "absolute"
  10487. });
  10488. var r;
  10489. p.bind(e.__resize_handle, "mousedown", t),
  10490. p.bind(e.__closeButton, "mousedown", t),
  10491. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10492. }
  10493. function E(e, t) {
  10494. e.domElement.style.width = t + "px",
  10495. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10496. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10497. }
  10498. function b(e, t) {
  10499. var i = {};
  10500. return f.each(e.__rememberedObjects, function(n, r) {
  10501. var o = {}
  10502. , a = e.__rememberedObjectIndecesToControllers[r];
  10503. f.each(a, function(e, i) {
  10504. o[i] = t ? e.initialValue : e.getValue()
  10505. }),
  10506. i[r] = o
  10507. }),
  10508. i
  10509. }
  10510. function w(e, t, i) {
  10511. var n = document.createElement("option");
  10512. n.innerHTML = t,
  10513. n.value = t,
  10514. e.__preset_select.appendChild(n),
  10515. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10516. }
  10517. function _(e) {
  10518. for (var t = 0; t < e.__preset_select.length; t++)
  10519. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10520. }
  10521. function T(e, t) {
  10522. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10523. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10524. }
  10525. function x(e) {
  10526. 0 != e.length && u(function() {
  10527. x(e)
  10528. }),
  10529. f.each(e, function(e) {
  10530. e.updateDisplay()
  10531. })
  10532. }
  10533. e.inject(i);
  10534. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10535. try {
  10536. return "localStorage"in window && null !== window.localStorage
  10537. } catch (e) {
  10538. return !1
  10539. }
  10540. }(), N = !0, B = !1, F = [], V = function(e) {
  10541. function t() {
  10542. var e = i.getRoot();
  10543. e.width += 1,
  10544. f.defer(function() {
  10545. e.width -= 1
  10546. })
  10547. }
  10548. var i = this;
  10549. this.domElement = document.createElement("div"),
  10550. this.__ul = document.createElement("ul"),
  10551. this.domElement.appendChild(this.__ul),
  10552. p.addClass(this.domElement, R),
  10553. this.__folders = {},
  10554. this.__controllers = [],
  10555. this.__rememberedObjects = [],
  10556. this.__rememberedObjectIndecesToControllers = [],
  10557. this.__listening = [],
  10558. e = e || {},
  10559. e = f.defaults(e, {
  10560. autoPlace: !0,
  10561. width: V.DEFAULT_WIDTH
  10562. }),
  10563. e = f.defaults(e, {
  10564. resizable: e.autoPlace,
  10565. hideable: e.autoPlace
  10566. }),
  10567. f.isUndefined(e.load) ? e.load = {
  10568. preset: L
  10569. } : e.preset && (e.load.preset = e.preset),
  10570. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10571. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10572. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10573. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10574. if (Object.defineProperties(this, {
  10575. parent: {
  10576. get: function() {
  10577. return e.parent
  10578. }
  10579. },
  10580. scrollable: {
  10581. get: function() {
  10582. return e.scrollable
  10583. }
  10584. },
  10585. autoPlace: {
  10586. get: function() {
  10587. return e.autoPlace
  10588. }
  10589. },
  10590. preset: {
  10591. get: function() {
  10592. return i.parent ? i.getRoot().preset : e.load.preset
  10593. },
  10594. set: function(t) {
  10595. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10596. _(this),
  10597. i.revert()
  10598. }
  10599. },
  10600. width: {
  10601. get: function() {
  10602. return e.width
  10603. },
  10604. set: function(t) {
  10605. e.width = t,
  10606. E(i, t)
  10607. }
  10608. },
  10609. name: {
  10610. get: function() {
  10611. return e.name
  10612. },
  10613. set: function(t) {
  10614. e.name = t,
  10615. a && (a.innerHTML = e.name)
  10616. }
  10617. },
  10618. closed: {
  10619. get: function() {
  10620. return e.closed
  10621. },
  10622. set: function(t) {
  10623. e.closed = t,
  10624. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10625. this.onResize(),
  10626. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10627. }
  10628. },
  10629. load: {
  10630. get: function() {
  10631. return e.load
  10632. }
  10633. },
  10634. useLocalStorage: {
  10635. get: function() {
  10636. return r
  10637. },
  10638. set: function(e) {
  10639. D && (r = e,
  10640. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10641. localStorage.setItem(y(i, "isLocal"), e))
  10642. }
  10643. }
  10644. }),
  10645. f.isUndefined(e.parent)) {
  10646. if (e.closed = !1,
  10647. p.addClass(this.domElement, V.CLASS_MAIN),
  10648. p.makeSelectable(this.domElement, !1),
  10649. D && r) {
  10650. i.useLocalStorage = !0;
  10651. var o = localStorage.getItem(y(this, "gui"));
  10652. o && (e.load = JSON.parse(o))
  10653. }
  10654. this.__closeButton = document.createElement("div"),
  10655. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10656. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10657. this.domElement.appendChild(this.__closeButton),
  10658. p.bind(this.__closeButton, "click", function() {
  10659. i.closed = !i.closed
  10660. })
  10661. } else {
  10662. void 0 === e.closed && (e.closed = !0);
  10663. var a = document.createTextNode(e.name);
  10664. p.addClass(a, "controller-name");
  10665. var s = m(i, a)
  10666. , l = function(e) {
  10667. return e.preventDefault(),
  10668. i.closed = !i.closed,
  10669. !1
  10670. };
  10671. p.addClass(this.__ul, V.CLASS_CLOSED),
  10672. p.addClass(s, "title"),
  10673. p.bind(s, "click", l),
  10674. e.closed || (this.closed = !1)
  10675. }
  10676. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10677. p.addClass(M, R),
  10678. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10679. document.body.appendChild(M),
  10680. N = !1),
  10681. M.appendChild(this.domElement),
  10682. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10683. this.parent || E(i, e.width)),
  10684. p.bind(window, "resize", function() {
  10685. i.onResize()
  10686. }),
  10687. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10688. i.onResize()
  10689. }),
  10690. p.bind(this.__ul, "transitionend", function() {
  10691. i.onResize()
  10692. }),
  10693. p.bind(this.__ul, "oTransitionEnd", function() {
  10694. i.onResize()
  10695. }),
  10696. this.onResize(),
  10697. e.resizable && I(this),
  10698. n = function() {
  10699. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10700. }
  10701. ,
  10702. this.saveToLocalStorageIfPossible = n;
  10703. i.getRoot();
  10704. e.parent || t()
  10705. };
  10706. return V.toggleHide = function() {
  10707. B = !B,
  10708. f.each(F, function(e) {
  10709. e.domElement.style.zIndex = B ? -999 : 999,
  10710. e.domElement.style.opacity = B ? 0 : 1
  10711. })
  10712. }
  10713. ,
  10714. V.CLASS_AUTO_PLACE = "a",
  10715. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10716. V.CLASS_MAIN = "main",
  10717. V.CLASS_CONTROLLER_ROW = "cr",
  10718. V.CLASS_TOO_TALL = "taller-than-window",
  10719. V.CLASS_CLOSED = "closed",
  10720. V.CLASS_CLOSE_BUTTON = "close-button",
  10721. V.CLASS_DRAG = "drag",
  10722. V.DEFAULT_WIDTH = 245,
  10723. V.TEXT_CLOSED = "Close Controls",
  10724. V.TEXT_OPEN = "Open Controls",
  10725. p.bind(window, "keydown", function(e) {
  10726. if(window.keyCon == false)return;
  10727. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10728. }, !1),
  10729. f.extend(V.prototype, {
  10730. add: function(e, t) {
  10731. return g(this, e, t, {
  10732. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10733. })
  10734. },
  10735. addColor: function(e, t) {
  10736. return g(this, e, t, {
  10737. color: !0
  10738. })
  10739. },
  10740. remove: function(e) {
  10741. this.__ul.removeChild(e.__li),
  10742. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10743. var t = this;
  10744. f.defer(function() {
  10745. t.onResize()
  10746. })
  10747. },
  10748. destroy: function() {
  10749. this.autoPlace && M.removeChild(this.domElement)
  10750. },
  10751. addFolder: function(e) {
  10752. if (void 0 !== this.__folders[e])
  10753. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10754. var t = {
  10755. name: e,
  10756. parent: this
  10757. };
  10758. t.autoPlace = this.autoPlace,
  10759. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10760. t.load = this.load.folders[e]);
  10761. var i = new V(t);
  10762. this.__folders[e] = i;
  10763. var n = m(this, i.domElement);
  10764. return p.addClass(n, "folder"),
  10765. i
  10766. },
  10767. open: function() {
  10768. this.closed = !1
  10769. },
  10770. close: function() {
  10771. this.closed = !0
  10772. },
  10773. onResize: function() {
  10774. var e = this.getRoot();
  10775. if (e.scrollable) {
  10776. var t = p.getOffset(e.__ul).top
  10777. , i = 0;
  10778. f.each(e.__ul.childNodes, function(t) {
  10779. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10780. }),
  10781. window.innerHeight - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10782. e.__ul.style.height = window.innerHeight - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10783. e.__ul.style.height = "auto")
  10784. }
  10785. e.__resize_handle && f.defer(function() {
  10786. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10787. }),
  10788. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10789. },
  10790. remember: function() {
  10791. if (f.isUndefined(S) && (S = new d,
  10792. S.domElement.innerHTML = t),
  10793. this.parent)
  10794. throw new Error("You can only call remember on a top level GUI.");
  10795. var e = this;
  10796. f.each(Array.prototype.slice.call(arguments), function(t) {
  10797. 0 == e.__rememberedObjects.length && C(e),
  10798. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10799. }),
  10800. this.autoPlace && E(this, this.width)
  10801. },
  10802. getRoot: function() {
  10803. for (var e = this; e.parent; )
  10804. e = e.parent;
  10805. return e
  10806. },
  10807. getSaveObject: function() {
  10808. var e = this.load;
  10809. return e.closed = this.closed,
  10810. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10811. e.remembered || (e.remembered = {}),
  10812. e.remembered[this.preset] = b(this)),
  10813. e.folders = {},
  10814. f.each(this.__folders, function(t, i) {
  10815. e.folders[i] = t.getSaveObject()
  10816. }),
  10817. e
  10818. },
  10819. save: function() {
  10820. this.load.remembered || (this.load.remembered = {}),
  10821. this.load.remembered[this.preset] = b(this),
  10822. T(this, !1),
  10823. this.saveToLocalStorageIfPossible()
  10824. },
  10825. saveAs: function(e) {
  10826. this.load.remembered || (this.load.remembered = {},
  10827. this.load.remembered[L] = b(this, !0)),
  10828. this.load.remembered[e] = b(this),
  10829. this.preset = e,
  10830. w(this, e, !0),
  10831. this.saveToLocalStorageIfPossible()
  10832. },
  10833. revert: function(e) {
  10834. f.each(this.__controllers, function(t) {
  10835. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10836. }, this),
  10837. f.each(this.__folders, function(e) {
  10838. e.revert(e)
  10839. }),
  10840. e || T(this.getRoot(), !1)
  10841. },
  10842. listen: function(e) {
  10843. var t = 0 == this.__listening.length;
  10844. this.__listening.push(e),
  10845. t && x(this.__listening)
  10846. }
  10847. }),
  10848. V //xzw 下面debug样式改了点
  10849. }(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: 1000; }\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: left;\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) {
  10850. return function(s, l) {
  10851. var c = s[l];
  10852. 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,{
  10853. min: arguments[2],
  10854. max: arguments[3]
  10855. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10856. }
  10857. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10858. var n = function(e, i) {
  10859. function r() {
  10860. a.setValue(a.__input.value)
  10861. }
  10862. function o() {
  10863. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10864. }
  10865. n.superclass.call(this, e, i);
  10866. var a = this;
  10867. this.__input = document.createElement("input"),
  10868. this.__input.setAttribute("type", "text"),
  10869. t.bind(this.__input, "keyup", r),
  10870. t.bind(this.__input, "change", r),
  10871. t.bind(this.__input, "blur", o),
  10872. t.bind(this.__input, "keydown", function(e) {
  10873. 13 === e.keyCode && this.blur()
  10874. }),
  10875. this.updateDisplay(),
  10876. this.domElement.appendChild(this.__input)
  10877. };
  10878. return n.superclass = e,
  10879. i.extend(n.prototype, e.prototype, {
  10880. updateDisplay: function() {
  10881. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10882. n.superclass.prototype.updateDisplay.call(this)
  10883. }
  10884. }),
  10885. n
  10886. }(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) {
  10887. function o(e, t, i, n) {
  10888. e.style.background = "",
  10889. r.each(l, function(r) {
  10890. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10891. })
  10892. }
  10893. function a(e) {
  10894. e.style.background = "",
  10895. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10896. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10897. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10898. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10899. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10900. }
  10901. var s = function(e, l) {
  10902. function c(e) {
  10903. p(e),
  10904. t.bind(window, "mousemove", p),
  10905. t.bind(window, "mouseup", h)
  10906. }
  10907. function h() {
  10908. t.unbind(window, "mousemove", p),
  10909. t.unbind(window, "mouseup", h)
  10910. }
  10911. function u() {
  10912. var e = n(this.value);
  10913. e !== !1 ? (g.__color.__state = e,
  10914. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  10915. }
  10916. function d() {
  10917. t.unbind(window, "mousemove", f),
  10918. t.unbind(window, "mouseup", d)
  10919. }
  10920. function p(e) {
  10921. e.preventDefault();
  10922. var i = t.getWidth(g.__saturation_field)
  10923. , n = t.getOffset(g.__saturation_field)
  10924. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  10925. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10926. return o > 1 ? o = 1 : o < 0 && (o = 0),
  10927. r > 1 ? r = 1 : r < 0 && (r = 0),
  10928. g.__color.v = o,
  10929. g.__color.s = r,
  10930. g.setValue(g.__color.toOriginal()),
  10931. !1
  10932. }
  10933. function f(e) {
  10934. e.preventDefault();
  10935. var i = t.getHeight(g.__hue_field)
  10936. , n = t.getOffset(g.__hue_field)
  10937. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10938. return r > 1 ? r = 1 : r < 0 && (r = 0),
  10939. g.__color.h = 360 * r,
  10940. g.setValue(g.__color.toOriginal()),
  10941. !1
  10942. }
  10943. s.superclass.call(this, e, l),
  10944. this.__color = new i(this.getValue()),
  10945. this.__temp = new i(0);
  10946. var g = this;
  10947. this.domElement = document.createElement("div"),
  10948. t.makeSelectable(this.domElement, !1),
  10949. this.__selector = document.createElement("div"),
  10950. this.__selector.className = "selector",
  10951. this.__saturation_field = document.createElement("div"),
  10952. this.__saturation_field.className = "saturation-field",
  10953. this.__field_knob = document.createElement("div"),
  10954. this.__field_knob.className = "field-knob",
  10955. this.__field_knob_border = "2px solid ",
  10956. this.__hue_knob = document.createElement("div"),
  10957. this.__hue_knob.className = "hue-knob",
  10958. this.__hue_field = document.createElement("div"),
  10959. this.__hue_field.className = "hue-field",
  10960. this.__input = document.createElement("input"),
  10961. this.__input.type = "text",
  10962. this.__input_textShadow = "0 1px 1px ",
  10963. t.bind(this.__input, "keydown", function(e) {
  10964. 13 === e.keyCode && u.call(this)
  10965. }),
  10966. t.bind(this.__input, "blur", u),
  10967. t.bind(this.__selector, "mousedown", function(e) {
  10968. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10969. t.removeClass(g.__selector, "drag")
  10970. })
  10971. });
  10972. var m = document.createElement("div");
  10973. r.extend(this.__selector.style, {
  10974. width: "122px",
  10975. height: "102px",
  10976. padding: "3px",
  10977. backgroundColor: "#222",
  10978. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10979. }),
  10980. r.extend(this.__field_knob.style, {
  10981. position: "absolute",
  10982. width: "12px",
  10983. height: "12px",
  10984. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10985. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10986. borderRadius: "12px",
  10987. zIndex: 1
  10988. }),
  10989. r.extend(this.__hue_knob.style, {
  10990. position: "absolute",
  10991. width: "15px",
  10992. height: "2px",
  10993. borderRight: "4px solid #fff",
  10994. zIndex: 1
  10995. }),
  10996. r.extend(this.__saturation_field.style, {
  10997. width: "100px",
  10998. height: "100px",
  10999. border: "1px solid #555",
  11000. marginRight: "3px",
  11001. display: "inline-block",
  11002. cursor: "pointer"
  11003. }),
  11004. r.extend(m.style, {
  11005. width: "100%",
  11006. height: "100%",
  11007. background: "none"
  11008. }),
  11009. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11010. r.extend(this.__hue_field.style, {
  11011. width: "15px",
  11012. height: "100px",
  11013. display: "inline-block",
  11014. border: "1px solid #555",
  11015. cursor: "ns-resize"
  11016. }),
  11017. a(this.__hue_field),
  11018. r.extend(this.__input.style, {
  11019. outline: "none",
  11020. textAlign: "center",
  11021. color: "#fff",
  11022. border: 0,
  11023. fontWeight: "bold",
  11024. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11025. }),
  11026. t.bind(this.__saturation_field, "mousedown", c),
  11027. t.bind(this.__field_knob, "mousedown", c),
  11028. t.bind(this.__hue_field, "mousedown", function(e) {
  11029. f(e),
  11030. t.bind(window, "mousemove", f),
  11031. t.bind(window, "mouseup", d)
  11032. }),
  11033. this.__saturation_field.appendChild(m),
  11034. this.__selector.appendChild(this.__field_knob),
  11035. this.__selector.appendChild(this.__saturation_field),
  11036. this.__selector.appendChild(this.__hue_field),
  11037. this.__hue_field.appendChild(this.__hue_knob),
  11038. this.domElement.appendChild(this.__input),
  11039. this.domElement.appendChild(this.__selector),
  11040. this.updateDisplay()
  11041. };
  11042. s.superclass = e,
  11043. r.extend(s.prototype, e.prototype, {
  11044. updateDisplay: function() {
  11045. var e = n(this.getValue());
  11046. if (e !== !1) {
  11047. var t = !1;
  11048. r.each(i.COMPONENTS, function(i) {
  11049. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11050. return t = !0,
  11051. {}
  11052. }, this),
  11053. t && r.extend(this.__color.__state, e)
  11054. }
  11055. r.extend(this.__temp.__state, this.__color.__state),
  11056. this.__temp.a = 1;
  11057. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11058. , s = 255 - a;
  11059. r.extend(this.__field_knob.style, {
  11060. marginLeft: 100 * this.__color.s - 7 + "px",
  11061. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11062. backgroundColor: this.__temp.toString(),
  11063. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11064. }),
  11065. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11066. this.__temp.s = 1,
  11067. this.__temp.v = 1,
  11068. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11069. r.extend(this.__input.style, {
  11070. backgroundColor: this.__input.value = this.__color.toString(),
  11071. color: "rgb(" + a + "," + a + "," + a + ")",
  11072. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11073. })
  11074. }
  11075. });
  11076. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11077. return s
  11078. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11079. function r(e, t, i) {
  11080. Object.defineProperty(e, t, {
  11081. get: function() {
  11082. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11083. this.__state[t])
  11084. },
  11085. set: function(e) {
  11086. "RGB" !== this.__state.space && (a(this, t, i),
  11087. this.__state.space = "RGB"),
  11088. this.__state[t] = e
  11089. }
  11090. })
  11091. }
  11092. function o(e, t) {
  11093. Object.defineProperty(e, t, {
  11094. get: function() {
  11095. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11096. this.__state[t])
  11097. },
  11098. set: function(e) {
  11099. "HSV" !== this.__state.space && (s(this),
  11100. this.__state.space = "HSV"),
  11101. this.__state[t] = e
  11102. }
  11103. })
  11104. }
  11105. function a(e, i, r) {
  11106. if ("HEX" === e.__state.space)
  11107. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11108. else {
  11109. if ("HSV" !== e.__state.space)
  11110. throw "Corrupted color state";
  11111. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11112. }
  11113. }
  11114. function s(e) {
  11115. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11116. n.extend(e.__state, {
  11117. s: i.s,
  11118. v: i.v
  11119. }),
  11120. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11121. }
  11122. var l = function() {
  11123. if (this.__state = e.apply(this, arguments),
  11124. this.__state === !1)
  11125. throw "Failed to interpret color arguments";
  11126. this.__state.a = this.__state.a || 1
  11127. };
  11128. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11129. n.extend(l.prototype, {
  11130. toString: function() {
  11131. return i(this)
  11132. },
  11133. toOriginal: function() {
  11134. return this.__state.conversion.write(this)
  11135. }
  11136. }),
  11137. r(l.prototype, "r", 2),
  11138. r(l.prototype, "g", 1),
  11139. r(l.prototype, "b", 0),
  11140. o(l.prototype, "h"),
  11141. o(l.prototype, "s"),
  11142. o(l.prototype, "v"),
  11143. Object.defineProperty(l.prototype, "a", {
  11144. get: function() {
  11145. return this.__state.a
  11146. },
  11147. set: function(e) {
  11148. this.__state.a = e
  11149. }
  11150. }),
  11151. Object.defineProperty(l.prototype, "hex", {
  11152. get: function() {
  11153. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11154. this.__state.hex
  11155. },
  11156. set: function(e) {
  11157. this.__state.space = "HEX",
  11158. this.__state.hex = e
  11159. }
  11160. }),
  11161. l
  11162. }(n.color.interpret, n.color.math = function() {
  11163. var e;
  11164. return {
  11165. hsv_to_rgb: function(e, t, i) {
  11166. var n = Math.floor(e / 60) % 6
  11167. , r = e / 60 - Math.floor(e / 60)
  11168. , o = i * (1 - t)
  11169. , a = i * (1 - r * t)
  11170. , s = i * (1 - (1 - r) * t)
  11171. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11172. return {
  11173. r: 255 * l[0],
  11174. g: 255 * l[1],
  11175. b: 255 * l[2]
  11176. }
  11177. },
  11178. rgb_to_hsv: function(e, t, i) {
  11179. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11180. return 0 == a ? {
  11181. h: NaN,
  11182. s: 0,
  11183. v: 0
  11184. } : (r = s / a,
  11185. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11186. n /= 6,
  11187. n < 0 && (n += 1),
  11188. {
  11189. h: 360 * n,
  11190. s: r,
  11191. v: a / 255
  11192. })
  11193. },
  11194. rgb_to_hex: function(e, t, i) {
  11195. var n = this.hex_with_component(0, 2, e);
  11196. return n = this.hex_with_component(n, 1, t),
  11197. n = this.hex_with_component(n, 0, i)
  11198. },
  11199. component_from_hex: function(e, t) {
  11200. return e >> 8 * t & 255
  11201. },
  11202. hex_with_component: function(t, i, n) {
  11203. return n << (e = 8 * i) | t & ~(255 << e)
  11204. }
  11205. }
  11206. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11207. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11208. window.setTimeout(e, 1e3 / 60)
  11209. }
  11210. }(), n.dom.CenteredDiv = function(e, t) {
  11211. var i = function() {
  11212. this.backgroundElement = document.createElement("div"),
  11213. t.extend(this.backgroundElement.style, {
  11214. backgroundColor: "rgba(0,0,0,0.8)",
  11215. top: 0,
  11216. left: 0,
  11217. display: "none",
  11218. zIndex: "1000",
  11219. opacity: 0,
  11220. WebkitTransition: "opacity 0.2s linear"
  11221. }),
  11222. e.makeFullscreen(this.backgroundElement),
  11223. this.backgroundElement.style.position = "fixed",
  11224. this.domElement = document.createElement("div"),
  11225. t.extend(this.domElement.style, {
  11226. position: "fixed",
  11227. display: "none",
  11228. zIndex: "1001",
  11229. opacity: 0,
  11230. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11231. }),
  11232. document.body.appendChild(this.backgroundElement),
  11233. document.body.appendChild(this.domElement);
  11234. var i = this;
  11235. e.bind(this.backgroundElement, "click", function() {
  11236. i.hide()
  11237. })
  11238. };
  11239. return i.prototype.show = function() {
  11240. var e = this;
  11241. this.backgroundElement.style.display = "block",
  11242. this.domElement.style.display = "block",
  11243. this.domElement.style.opacity = 0,
  11244. this.domElement.style.webkitTransform = "scale(1.1)",
  11245. this.layout(),
  11246. t.defer(function() {
  11247. e.backgroundElement.style.opacity = 1,
  11248. e.domElement.style.opacity = 1,
  11249. e.domElement.style.webkitTransform = "scale(1)"
  11250. })
  11251. }
  11252. ,
  11253. i.prototype.hide = function() {
  11254. var t = this
  11255. , i = function() {
  11256. t.domElement.style.display = "none",
  11257. t.backgroundElement.style.display = "none",
  11258. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11259. e.unbind(t.domElement, "transitionend", i),
  11260. e.unbind(t.domElement, "oTransitionEnd", i)
  11261. };
  11262. e.bind(this.domElement, "webkitTransitionEnd", i),
  11263. e.bind(this.domElement, "transitionend", i),
  11264. e.bind(this.domElement, "oTransitionEnd", i),
  11265. this.backgroundElement.style.opacity = 0,
  11266. this.domElement.style.opacity = 0,
  11267. this.domElement.style.webkitTransform = "scale(1.1)"
  11268. }
  11269. ,
  11270. i.prototype.layout = function() {
  11271. this.domElement.style.left = $('#player').width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11272. this.domElement.style.top = $('#player').height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11273. }
  11274. ,
  11275. i
  11276. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11277. }
  11278. , {}],
  11279. 94: [function(e, t, i) {//"../lib/jpeg_encoder"
  11280. (function(e) {
  11281. "use strict";
  11282. function i(t) {
  11283. function i(e) {
  11284. 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++) {
  11285. var n = _((t[i] * e + 50) / 100);
  11286. n < 1 ? n = 1 : n > 255 && (n = 255),
  11287. T[G[i]] = n
  11288. }
  11289. 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++) {
  11290. var a = _((r[o] * e + 50) / 100);
  11291. a < 1 ? a = 1 : a > 255 && (a = 255),
  11292. x[G[o]] = a
  11293. }
  11294. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11295. for (var h = 0; h < 8; h++)
  11296. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11297. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11298. l++
  11299. }
  11300. function n(e, t) {
  11301. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11302. for (var a = 1; a <= e[o]; a++)
  11303. r[t[n]] = [],
  11304. r[t[n]][0] = i,
  11305. r[t[n]][1] = o,
  11306. n++,
  11307. i++;
  11308. i *= 2
  11309. }
  11310. return r
  11311. }
  11312. function r() {
  11313. C = n(z, W),
  11314. I = n(X, Z),
  11315. E = n(j, Y),
  11316. b = n(q, K)
  11317. }
  11318. function o() {
  11319. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11320. for (var n = e; n < t; n++)
  11321. P[32767 + n] = i,
  11322. R[32767 + n] = [],
  11323. R[32767 + n][1] = i,
  11324. R[32767 + n][0] = n;
  11325. for (var r = -(t - 1); r <= -e; r++)
  11326. P[32767 + r] = i,
  11327. R[32767 + r] = [],
  11328. R[32767 + r][1] = i,
  11329. R[32767 + r][0] = t - 1 + r;
  11330. e <<= 1,
  11331. t <<= 1
  11332. }
  11333. }
  11334. function a() {
  11335. for (var e = 0; e < 256; e++)
  11336. H[e] = 19595 * e,
  11337. H[e + 256 >> 0] = 38470 * e,
  11338. H[e + 512 >> 0] = 7471 * e + 32768,
  11339. H[e + 768 >> 0] = -11059 * e,
  11340. H[e + 1024 >> 0] = -21709 * e,
  11341. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11342. H[e + 1536 >> 0] = -27439 * e,
  11343. H[e + 1792 >> 0] = -5329 * e
  11344. }
  11345. function s(e) {
  11346. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11347. t & 1 << i && (N |= 1 << B),
  11348. i--,
  11349. B--,
  11350. B < 0 && (255 == N ? (l(255),
  11351. l(0)) : l(N),
  11352. B = 7,
  11353. N = 0)
  11354. }
  11355. function l(e) {
  11356. D.push(e)
  11357. }
  11358. function c(e) {
  11359. l(e >> 8 & 255),
  11360. l(255 & e)
  11361. }
  11362. function h(e, t) {
  11363. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11364. for (h = 0; h < d; ++h) {
  11365. i = e[u],
  11366. n = e[u + 1],
  11367. r = e[u + 2],
  11368. o = e[u + 3],
  11369. a = e[u + 4],
  11370. s = e[u + 5],
  11371. l = e[u + 6],
  11372. c = e[u + 7];
  11373. var f = i + c
  11374. , g = i - c
  11375. , m = n + l
  11376. , v = n - l
  11377. , A = r + s
  11378. , y = r - s
  11379. , C = o + a
  11380. , I = o - a
  11381. , E = f + C
  11382. , b = f - C
  11383. , w = m + A
  11384. , _ = m - A;
  11385. e[u] = E + w,
  11386. e[u + 4] = E - w;
  11387. var T = .707106781 * (_ + b);
  11388. e[u + 2] = b + T,
  11389. e[u + 6] = b - T,
  11390. E = I + y,
  11391. w = y + v,
  11392. _ = v + g;
  11393. var x = .382683433 * (E - _)
  11394. , S = .5411961 * E + x
  11395. , M = 1.306562965 * _ + x
  11396. , R = .707106781 * w
  11397. , P = g + R
  11398. , L = g - R;
  11399. e[u + 5] = L + S,
  11400. e[u + 3] = L - S,
  11401. e[u + 1] = P + M,
  11402. e[u + 7] = P - M,
  11403. u += 8
  11404. }
  11405. for (u = 0,
  11406. h = 0; h < d; ++h) {
  11407. i = e[u],
  11408. n = e[u + 8],
  11409. r = e[u + 16],
  11410. o = e[u + 24],
  11411. a = e[u + 32],
  11412. s = e[u + 40],
  11413. l = e[u + 48],
  11414. c = e[u + 56];
  11415. var D = i + c
  11416. , N = i - c
  11417. , B = n + l
  11418. , F = n - l
  11419. , V = r + s
  11420. , U = r - s
  11421. , k = o + a
  11422. , H = o - a
  11423. , G = D + k
  11424. , z = D - k
  11425. , W = B + V
  11426. , j = B - V;
  11427. e[u] = G + W,
  11428. e[u + 32] = G - W;
  11429. var Y = .707106781 * (j + z);
  11430. e[u + 16] = z + Y,
  11431. e[u + 48] = z - Y,
  11432. G = H + U,
  11433. W = U + F,
  11434. j = F + N;
  11435. var X = .382683433 * (G - j)
  11436. , Z = .5411961 * G + X
  11437. , q = 1.306562965 * j + X
  11438. , K = .707106781 * W
  11439. , Q = N + K
  11440. , J = N - K;
  11441. e[u + 40] = J + Z,
  11442. e[u + 24] = J - Z,
  11443. e[u + 8] = Q + q,
  11444. e[u + 56] = Q - q,
  11445. u++
  11446. }
  11447. var $;
  11448. for (h = 0; h < p; ++h)
  11449. $ = e[h] * t[h],
  11450. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11451. return O
  11452. }
  11453. function u() {
  11454. c(65504),
  11455. c(16),
  11456. l(74),
  11457. l(70),
  11458. l(73),
  11459. l(70),
  11460. l(0),
  11461. l(1),
  11462. l(1),
  11463. l(0),
  11464. c(1),
  11465. c(1),
  11466. l(0),
  11467. l(0)
  11468. }
  11469. function d(e, t) {
  11470. c(65472),
  11471. c(17),
  11472. l(8),
  11473. c(t),
  11474. c(e),
  11475. l(3),
  11476. l(1),
  11477. l(17),
  11478. l(0),
  11479. l(2),
  11480. l(17),
  11481. l(1),
  11482. l(3),
  11483. l(17),
  11484. l(1)
  11485. }
  11486. function p() {
  11487. c(65499),
  11488. c(132),
  11489. l(0);
  11490. for (var e = 0; e < 64; e++)
  11491. l(T[e]);
  11492. l(1);
  11493. for (var t = 0; t < 64; t++)
  11494. l(x[t])
  11495. }
  11496. function f() {
  11497. c(65476),
  11498. c(418),
  11499. l(0);
  11500. for (var e = 0; e < 16; e++)
  11501. l(z[e + 1]);
  11502. for (var t = 0; t <= 11; t++)
  11503. l(W[t]);
  11504. l(16);
  11505. for (var i = 0; i < 16; i++)
  11506. l(j[i + 1]);
  11507. for (var n = 0; n <= 161; n++)
  11508. l(Y[n]);
  11509. l(1);
  11510. for (var r = 0; r < 16; r++)
  11511. l(X[r + 1]);
  11512. for (var o = 0; o <= 11; o++)
  11513. l(Z[o]);
  11514. l(17);
  11515. for (var a = 0; a < 16; a++)
  11516. l(q[a + 1]);
  11517. for (var s = 0; s <= 161; s++)
  11518. l(K[s])
  11519. }
  11520. function g() {
  11521. c(65498),
  11522. c(12),
  11523. l(3),
  11524. l(1),
  11525. l(0),
  11526. l(2),
  11527. l(17),
  11528. l(3),
  11529. l(17),
  11530. l(0),
  11531. l(63),
  11532. l(0)
  11533. }
  11534. function m(e, t, i, n, r) {
  11535. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11536. L[G[f]] = p[f];
  11537. var g = L[0] - i;
  11538. i = L[0],
  11539. 0 == g ? s(n[0]) : (o = 32767 + g,
  11540. s(n[P[o]]),
  11541. s(R[o]));
  11542. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11543. ;
  11544. if (0 == m)
  11545. return s(a),
  11546. i;
  11547. for (var v, A = 1; A <= m; ) {
  11548. for (var y = A; 0 == L[A] && A <= m; ++A)
  11549. ;
  11550. var C = A - y;
  11551. if (C >= c) {
  11552. v = C >> 4;
  11553. for (var I = 1; I <= v; ++I)
  11554. s(l);
  11555. C &= 15
  11556. }
  11557. o = 32767 + L[A],
  11558. s(r[(C << 4) + P[o]]),
  11559. s(R[o]),
  11560. A++
  11561. }
  11562. return m != u && s(a),
  11563. i
  11564. }
  11565. function v() {
  11566. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11567. k[t] = e(t)
  11568. }
  11569. function A(e) {
  11570. if (e <= 0 && (e = 1),
  11571. e > 100 && (e = 100),
  11572. w != e) {
  11573. var t = 0;
  11574. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11575. i(t),
  11576. w = e
  11577. }
  11578. }
  11579. function y() {
  11580. var e = (new Date).getTime();
  11581. t || (t = 50),
  11582. v(),
  11583. r(),
  11584. o(),
  11585. a(),
  11586. A(t);
  11587. (new Date).getTime() - e
  11588. }
  11589. var C, I, E, b, w, _ = (Math.round,
  11590. 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];
  11591. this.encode = function(t, i) {
  11592. var n = ((new Date).getTime(),
  11593. i.quality);
  11594. n && A(n),
  11595. D = new Array,
  11596. N = 0,
  11597. B = 7,
  11598. c(65496),
  11599. u(),
  11600. p(),
  11601. d(t.width, t.height),
  11602. f(),
  11603. g();
  11604. var r = 0
  11605. , o = 0
  11606. , a = 0;
  11607. N = 0,
  11608. B = 7,
  11609. this.encode.displayName = "_encode_";
  11610. 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; ) {
  11611. for (l = 0; l < G; ) {
  11612. for (w = G * z + l,
  11613. _ = w,
  11614. T = -1,
  11615. x = 0,
  11616. R = 0; R < 64; R++)
  11617. x = (k ? 63 - R : R) >> 3,
  11618. T = 4 * (7 & R),
  11619. _ = w + x * G + T,
  11620. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11621. l + T >= G && (_ -= l + T - G + 4),
  11622. h = P[_++],
  11623. v = P[_++],
  11624. y = P[_++],
  11625. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11626. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11627. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11628. r = m(F, S, r, C, E),
  11629. o = m(V, M, o, I, b),
  11630. a = m(U, M, a, I, b),
  11631. l += 32
  11632. }
  11633. z += W
  11634. }
  11635. if (B >= 0) {
  11636. var j = [];
  11637. j[1] = B + 1,
  11638. j[0] = (1 << B + 1) - 1,
  11639. s(j)
  11640. }
  11641. return c(65497),
  11642. new e(D)
  11643. }
  11644. ,
  11645. y()
  11646. }
  11647. function n(e, t) {
  11648. t = t || {},
  11649. t.quality = t.quality || 50;
  11650. var n = t.quality
  11651. , r = new i(n)
  11652. , o = r.encode(e, t);
  11653. return {
  11654. data: o,
  11655. width: e.width,
  11656. height: e.height
  11657. }
  11658. }
  11659. t.exports.encode = n
  11660. }
  11661. ).call(this, e("buffer").Buffer)
  11662. }
  11663. , {
  11664. buffer: 198
  11665. }],
  11666. 95: [function(e, t, i) {//"./lib/performance-polyfill"
  11667. "use strict";
  11668. !function() {
  11669. if ("performance"in window == !1 && (window.performance = {}),
  11670. Date.now = Date.now || function() {
  11671. return (new Date).getTime()
  11672. }
  11673. ,
  11674. "now"in window.performance == !1) {
  11675. var e = Date.now();
  11676. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11677. window.performance.now = function() {
  11678. return Date.now() - e
  11679. }
  11680. }
  11681. }()
  11682. }
  11683. , {}],
  11684. 96: [function(e, t, i) {//"./lib/postprocessing/EffectComposer.js"
  11685. "use strict";
  11686. var n = e("three");
  11687. n.EffectComposer = function(e, t) {
  11688. if (this.renderer = e,
  11689. void 0 === t) {
  11690. var i = {
  11691. minFilter: n.LinearFilter,
  11692. magFilter: n.LinearFilter,
  11693. format: n.RGBAFormat,
  11694. stencilBuffer: !1
  11695. }
  11696. , r = e.getSize();
  11697. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11698. }
  11699. this.renderTarget1 = t,
  11700. this.renderTarget2 = t.clone(),
  11701. this.writeBuffer = this.renderTarget1,
  11702. this.readBuffer = this.renderTarget2,
  11703. this.passes = [],
  11704. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11705. this.copyPass = new n.ShaderPass(n.CopyShader)
  11706. }
  11707. ,
  11708. n.EffectComposer.prototype = {
  11709. swapBuffers: function() {
  11710. var e = this.readBuffer;
  11711. this.readBuffer = this.writeBuffer,
  11712. this.writeBuffer = e
  11713. },
  11714. addPass: function(e) {
  11715. this.passes.push(e)
  11716. },
  11717. insertPass: function(e, t) {
  11718. this.passes.splice(t, 0, e)
  11719. },
  11720. render: function(e) {
  11721. this.writeBuffer = this.renderTarget1,
  11722. this.readBuffer = this.renderTarget2;
  11723. var t, i, r = !1, o = this.passes.length;
  11724. for (i = 0; i < o; i++)
  11725. if (t = this.passes[i],
  11726. t.enabled) {
  11727. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11728. t.needsSwap) {
  11729. if (r) {
  11730. var a = this.renderer.context;
  11731. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11732. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11733. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11734. }
  11735. this.swapBuffers()
  11736. }
  11737. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11738. }
  11739. },
  11740. reset: function(e) {
  11741. if (void 0 === e) {
  11742. var t = this.renderer.getSize();
  11743. e = this.renderTarget1.clone(),
  11744. e.setSize(t.width, t.height)
  11745. }
  11746. this.renderTarget1.dispose(),
  11747. this.renderTarget2.dispose(),
  11748. this.renderTarget1 = e,
  11749. this.renderTarget2 = e.clone(),
  11750. this.writeBuffer = this.renderTarget1,
  11751. this.readBuffer = this.renderTarget2
  11752. },
  11753. setSize: function(e, t) {
  11754. this.renderTarget1.setSize(e, t),
  11755. this.renderTarget2.setSize(e, t)
  11756. }
  11757. }
  11758. }
  11759. , {
  11760. three: 217
  11761. }],
  11762. 97: [function(e, t, i) {//"./lib/postprocessing/MaskPass.js"
  11763. "use strict";
  11764. var n = e("three");
  11765. n.MaskPass = function(e, t) {
  11766. this.scene = e,
  11767. this.camera = t,
  11768. this.enabled = !0,
  11769. this.clear = !0,
  11770. this.needsSwap = !1,
  11771. this.inverse = !1
  11772. }
  11773. ,
  11774. n.MaskPass.prototype = {
  11775. render: function(e, t, i, n) {
  11776. var r = e.context;
  11777. r.colorMask(!1, !1, !1, !1),
  11778. r.depthMask(!1);
  11779. var o, a;
  11780. this.inverse ? (o = 0,
  11781. a = 1) : (o = 1,
  11782. a = 0),
  11783. r.enable(r.STENCIL_TEST),
  11784. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11785. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11786. r.clearStencil(a),
  11787. e.render(this.scene, this.camera, i, this.clear),
  11788. e.render(this.scene, this.camera, t, this.clear),
  11789. r.colorMask(!0, !0, !0, !0),
  11790. r.depthMask(!0),
  11791. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11792. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11793. }
  11794. },
  11795. n.ClearMaskPass = function() {
  11796. this.enabled = !0
  11797. }
  11798. ,
  11799. n.ClearMaskPass.prototype = {
  11800. render: function(e, t, i, n) {
  11801. var r = e.context;
  11802. r.disable(r.STENCIL_TEST)
  11803. }
  11804. }
  11805. }
  11806. , {
  11807. three: 217
  11808. }],
  11809. 98: [function(e, t, i) {//"./lib/postprocessing/RenderPass.js"
  11810. "use strict";
  11811. var n = e("three");
  11812. n.RenderPass = function(e, t, i, r, o) {
  11813. this.scene = e,
  11814. this.camera = t,
  11815. this.overrideMaterial = i,
  11816. this.clearColor = r,
  11817. this.clearAlpha = void 0 !== o ? o : 1,
  11818. this.oldClearColor = new n.Color,
  11819. this.oldClearAlpha = 1,
  11820. this.enabled = !0,
  11821. this.clear = !0,
  11822. this.needsSwap = !1
  11823. }
  11824. ,
  11825. n.RenderPass.prototype = {
  11826. render: function(e, t, i, n) {
  11827. this.scene.overrideMaterial = this.overrideMaterial,
  11828. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11829. this.oldClearAlpha = e.getClearAlpha(),
  11830. e.setClearColor(this.clearColor, this.clearAlpha)),
  11831. e.render(this.scene, this.camera, i, this.clear),
  11832. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11833. this.scene.overrideMaterial = null
  11834. }
  11835. }
  11836. }
  11837. , {
  11838. three: 217
  11839. }],
  11840. 99: [function(e, t, i) {//"./lib/postprocessing/ShaderPass.js"
  11841. "use strict";
  11842. var n = e("three");
  11843. n.ShaderPass = function(e, t) {
  11844. this.textureID = void 0 !== t ? t : "tDiffuse",
  11845. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11846. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11847. this.material = new n.ShaderMaterial({
  11848. defines: e.defines || {},
  11849. uniforms: this.uniforms,
  11850. vertexShader: e.vertexShader,
  11851. fragmentShader: e.fragmentShader
  11852. })),
  11853. this.renderToScreen = !1,
  11854. this.enabled = !0,
  11855. this.needsSwap = !0,
  11856. this.clear = !1,
  11857. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11858. this.scene = new n.Scene,
  11859. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11860. this.scene.add(this.quad)
  11861. }
  11862. ,
  11863. n.ShaderPass.prototype = {
  11864. render: function(e, t, i, n) {
  11865. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11866. this.quad.material = this.material,
  11867. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11868. }
  11869. }
  11870. }
  11871. , {
  11872. three: 217
  11873. }],
  11874. 100: [function(e, t, i) {//"./lib/shaders/CopyShader.js"
  11875. "use strict";
  11876. var n = e("three");
  11877. n.CopyShader = {
  11878. uniforms: {
  11879. tDiffuse: {
  11880. type: "t",
  11881. value: null
  11882. },
  11883. opacity: {
  11884. type: "f",
  11885. value: 1
  11886. }
  11887. },
  11888. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11889. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11890. }
  11891. }
  11892. , {
  11893. three: 217
  11894. }],
  11895. 101: [function(e, t, i) {//"./lib/shaders/HorizontalBlurShader.js"
  11896. "use strict";
  11897. var n = e("three");
  11898. n.HorizontalBlurShader = {
  11899. uniforms: {
  11900. tDiffuse: {
  11901. type: "t",
  11902. value: null
  11903. },
  11904. h: {
  11905. type: "f",
  11906. value: 1 / 512
  11907. }
  11908. },
  11909. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11910. 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")
  11911. }
  11912. }
  11913. , {
  11914. three: 217
  11915. }],
  11916. 102: [function(e, t, i) {//"./lib/shaders/VerticalBlurShader.js"
  11917. "use strict";
  11918. var n = e("three");
  11919. n.VerticalBlurShader = {
  11920. uniforms: {
  11921. tDiffuse: {
  11922. type: "t",
  11923. value: null
  11924. },
  11925. v: {
  11926. type: "f",
  11927. value: 1 / 512
  11928. }
  11929. },
  11930. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11931. 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")
  11932. }
  11933. }
  11934. , {
  11935. three: 217
  11936. }],
  11937. 103: [function(e, t, i) {//"./lib/three75-shim"
  11938. "use strict";
  11939. var n = e("three");
  11940. !function() {
  11941. if ("performance"in window == 0 && (window.performance = {}),
  11942. "now"in window.performance == 0) {
  11943. var e = Date.now();
  11944. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11945. window.performance.now = function() {
  11946. return Date.now() - e
  11947. }
  11948. }
  11949. }(),
  11950. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11951. var t, i = this.extensions, r = this.context;
  11952. if (e === n.RepeatWrapping)
  11953. return r.REPEAT;
  11954. if (e === n.ClampToEdgeWrapping)
  11955. return r.CLAMP_TO_EDGE;
  11956. if (e === n.MirroredRepeatWrapping)
  11957. return r.MIRRORED_REPEAT;
  11958. if (e === n.NearestFilter)
  11959. return r.NEAREST;
  11960. if (e === n.NearestMipMapNearestFilter)
  11961. return r.NEAREST_MIPMAP_NEAREST;
  11962. if (e === n.NearestMipMapLinearFilter)
  11963. return r.NEAREST_MIPMAP_LINEAR;
  11964. if (e === n.LinearFilter)
  11965. return r.LINEAR;
  11966. if (e === n.LinearMipMapNearestFilter)
  11967. return r.LINEAR_MIPMAP_NEAREST;
  11968. if (e === n.LinearMipMapLinearFilter)
  11969. return r.LINEAR_MIPMAP_LINEAR;
  11970. if (e === n.UnsignedByteType)
  11971. return r.UNSIGNED_BYTE;
  11972. if (e === n.UnsignedShort4444Type)
  11973. return r.UNSIGNED_SHORT_4_4_4_4;
  11974. if (e === n.UnsignedShort5551Type)
  11975. return r.UNSIGNED_SHORT_5_5_5_1;
  11976. if (e === n.UnsignedShort565Type)
  11977. return r.UNSIGNED_SHORT_5_6_5;
  11978. if (e === n.ByteType)
  11979. return r.BYTE;
  11980. if (e === n.ShortType)
  11981. return r.SHORT;
  11982. if (e === n.UnsignedShortType)
  11983. return r.UNSIGNED_SHORT;
  11984. if (e === n.IntType)
  11985. return r.INT;
  11986. if (e === n.UnsignedIntType)
  11987. return r.UNSIGNED_INT;
  11988. if (e === n.FloatType)
  11989. return r.FLOAT;
  11990. if (t = i.get("OES_texture_half_float"),
  11991. null !== t && e === n.HalfFloatType)
  11992. return t.HALF_FLOAT_OES;
  11993. if (e === n.AlphaFormat)
  11994. return r.ALPHA;
  11995. if (e === n.RGBFormat)
  11996. return r.RGB;
  11997. if (e === n.RGBAFormat)
  11998. return r.RGBA;
  11999. if (e === n.LuminanceFormat)
  12000. return r.LUMINANCE;
  12001. if (e === n.LuminanceAlphaFormat)
  12002. return r.LUMINANCE_ALPHA;
  12003. if (e === n.AddEquation)
  12004. return r.FUNC_ADD;
  12005. if (e === n.SubtractEquation)
  12006. return r.FUNC_SUBTRACT;
  12007. if (e === n.ReverseSubtractEquation)
  12008. return r.FUNC_REVERSE_SUBTRACT;
  12009. if (e === n.ZeroFactor)
  12010. return r.ZERO;
  12011. if (e === n.OneFactor)
  12012. return r.ONE;
  12013. if (e === n.SrcColorFactor)
  12014. return r.SRC_COLOR;
  12015. if (e === n.OneMinusSrcColorFactor)
  12016. return r.ONE_MINUS_SRC_COLOR;
  12017. if (e === n.SrcAlphaFactor)
  12018. return r.SRC_ALPHA;
  12019. if (e === n.OneMinusSrcAlphaFactor)
  12020. return r.ONE_MINUS_SRC_ALPHA;
  12021. if (e === n.DstAlphaFactor)
  12022. return r.DST_ALPHA;
  12023. if (e === n.OneMinusDstAlphaFactor)
  12024. return r.ONE_MINUS_DST_ALPHA;
  12025. if (e === n.DstColorFactor)
  12026. return r.DST_COLOR;
  12027. if (e === n.OneMinusDstColorFactor)
  12028. return r.ONE_MINUS_DST_COLOR;
  12029. if (e === n.SrcAlphaSaturateFactor)
  12030. return r.SRC_ALPHA_SATURATE;
  12031. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12032. null !== t) {
  12033. if (e === n.RGB_S3TC_DXT1_Format)
  12034. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12035. if (e === n.RGBA_S3TC_DXT1_Format)
  12036. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12037. if (e === n.RGBA_S3TC_DXT3_Format)
  12038. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12039. if (e === n.RGBA_S3TC_DXT5_Format)
  12040. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12041. }
  12042. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12043. null !== t) {
  12044. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12045. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12046. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12047. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12048. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12049. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12050. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12051. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12052. }
  12053. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12054. null !== t && e === n.RGB_ETC1_Format)
  12055. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12056. if (t = i.get("EXT_blend_minmax"),
  12057. null !== t) {
  12058. if (e === n.MinEquation)
  12059. return t.MIN_EXT;
  12060. if (e === n.MaxEquation)
  12061. return t.MAX_EXT
  12062. }
  12063. return 0
  12064. }
  12065. ,
  12066. n.WebGLState = function(e, t, i) {
  12067. var r = this
  12068. , o = new n.Vector4
  12069. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12070. , s = new Uint8Array(a)
  12071. , l = new Uint8Array(a)
  12072. , c = new Uint8Array(a)
  12073. , h = {}
  12074. , u = null
  12075. , d = null
  12076. , p = null
  12077. , f = null
  12078. , g = null
  12079. , m = null
  12080. , v = null
  12081. , A = null
  12082. , y = !1
  12083. , C = null
  12084. , I = null
  12085. , E = null
  12086. , b = null
  12087. , w = null
  12088. , _ = null
  12089. , T = null
  12090. , x = null
  12091. , S = null
  12092. , M = null
  12093. , R = null
  12094. , P = null
  12095. , O = null
  12096. , L = null
  12097. , D = null
  12098. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12099. , B = void 0
  12100. , F = {}
  12101. , V = new n.Vector4
  12102. , U = null
  12103. , k = null
  12104. , H = new n.Vector4
  12105. , G = new n.Vector4;
  12106. this.init = function() {
  12107. this.clearColor(0, 0, 0, 1),
  12108. this.clearDepth(1),
  12109. this.clearStencil(0),
  12110. this.enable(e.DEPTH_TEST),
  12111. e.depthFunc(e.LEQUAL),
  12112. e.frontFace(e.CCW),
  12113. e.cullFace(e.BACK),
  12114. this.enable(e.CULL_FACE),
  12115. this.enable(e.BLEND),
  12116. e.blendEquation(e.FUNC_ADD),
  12117. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12118. }
  12119. ,
  12120. this.initAttributes = function() {
  12121. for (var e = 0, t = s.length; e < t; e++)
  12122. s[e] = 0
  12123. }
  12124. ,
  12125. this.enableAttribute = function(i) {
  12126. if (s[i] = 1,
  12127. 0 === l[i] && (e.enableVertexAttribArray(i),
  12128. l[i] = 1),
  12129. 0 !== c[i]) {
  12130. var n = t.get("ANGLE_instanced_arrays");
  12131. n.vertexAttribDivisorANGLE(i, 0),
  12132. c[i] = 0
  12133. }
  12134. }
  12135. ,
  12136. this.enableAttributeAndDivisor = function(t, i, n) {
  12137. s[t] = 1,
  12138. 0 === l[t] && (e.enableVertexAttribArray(t),
  12139. l[t] = 1),
  12140. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12141. c[t] = i)
  12142. }
  12143. ,
  12144. this.disableUnusedAttributes = function() {
  12145. for (var t = 0, i = l.length; t < i; t++)
  12146. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12147. l[t] = 0)
  12148. }
  12149. ,
  12150. this.enable = function(t) {
  12151. h[t] !== !0 && (e.enable(t),
  12152. h[t] = !0)
  12153. }
  12154. ,
  12155. this.disable = function(t) {
  12156. h[t] !== !1 && (e.disable(t),
  12157. h[t] = !1)
  12158. }
  12159. ,
  12160. this.getCompressedTextureFormats = function() {
  12161. if (null === u && (u = [],
  12162. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12163. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12164. u.push(i[n]);
  12165. return u
  12166. }
  12167. ,
  12168. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12169. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12170. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12171. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12172. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12173. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12174. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12175. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12176. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12177. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12178. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12179. d = t,
  12180. y = h),
  12181. t === n.CustomBlending ? (s = s || r,
  12182. l = l || o,
  12183. c = c || a,
  12184. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12185. p = r,
  12186. m = s),
  12187. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12188. f = o,
  12189. g = a,
  12190. v = l,
  12191. A = c)) : (p = null,
  12192. f = null,
  12193. g = null,
  12194. m = null,
  12195. v = null,
  12196. A = null)
  12197. }
  12198. ,
  12199. this.setDepthFunc = function(t) {
  12200. if (C !== t) {
  12201. if (t)
  12202. switch (t) {
  12203. case n.NeverDepth:
  12204. e.depthFunc(e.NEVER);
  12205. break;
  12206. case n.AlwaysDepth:
  12207. e.depthFunc(e.ALWAYS);
  12208. break;
  12209. case n.LessDepth:
  12210. e.depthFunc(e.LESS);
  12211. break;
  12212. case n.LessEqualDepth:
  12213. e.depthFunc(e.LEQUAL);
  12214. break;
  12215. case n.EqualDepth:
  12216. e.depthFunc(e.EQUAL);
  12217. break;
  12218. case n.GreaterEqualDepth:
  12219. e.depthFunc(e.GEQUAL);
  12220. break;
  12221. case n.GreaterDepth:
  12222. e.depthFunc(e.GREATER);
  12223. break;
  12224. case n.NotEqualDepth:
  12225. e.depthFunc(e.NOTEQUAL);
  12226. break;
  12227. default:
  12228. e.depthFunc(e.LEQUAL)
  12229. }
  12230. else
  12231. e.depthFunc(e.LEQUAL);
  12232. C = t
  12233. }
  12234. }
  12235. ,
  12236. this.setDepthTest = function(t) {
  12237. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12238. }
  12239. ,
  12240. this.setDepthWrite = function(t) {
  12241. I !== t && (e.depthMask(t),
  12242. I = t)
  12243. }
  12244. ,
  12245. this.setColorWrite = function(t) {
  12246. E !== t && (e.colorMask(t, t, t, t),
  12247. E = t)
  12248. }
  12249. ,
  12250. this.setStencilFunc = function(t, i, n) {
  12251. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12252. w = t,
  12253. _ = i,
  12254. T = n)
  12255. }
  12256. ,
  12257. this.setStencilOp = function(t, i, n) {
  12258. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12259. x = t,
  12260. S = i,
  12261. M = n)
  12262. }
  12263. ,
  12264. this.setStencilTest = function(t) {
  12265. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12266. }
  12267. ,
  12268. this.setStencilWrite = function(t) {
  12269. b !== t && (e.stencilMask(t),
  12270. b = t)
  12271. }
  12272. ,
  12273. this.setFlipSided = function(t) {
  12274. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12275. R = t)
  12276. }
  12277. ,
  12278. this.setLineWidth = function(t) {
  12279. t !== P && (e.lineWidth(t),
  12280. P = t)
  12281. }
  12282. ,
  12283. this.setPolygonOffset = function(t, i, n) {
  12284. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12285. !t || O === i && L === n || (e.polygonOffset(i, n),
  12286. O = i,
  12287. L = n)
  12288. }
  12289. ,
  12290. this.getScissorTest = function() {
  12291. return D
  12292. }
  12293. ,
  12294. this.setScissorTest = function(t) {
  12295. D = t,
  12296. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12297. }
  12298. ,
  12299. this.activeTexture = function(t) {
  12300. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12301. B !== t && (e.activeTexture(t),
  12302. B = t)
  12303. }
  12304. ,
  12305. this.bindTexture = function(t, i) {
  12306. void 0 === B && r.activeTexture();
  12307. var n = F[B];
  12308. void 0 === n && (n = {
  12309. type: void 0,
  12310. texture: void 0
  12311. },
  12312. F[B] = n),
  12313. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12314. n.type = t,
  12315. n.texture = i)
  12316. }
  12317. ,
  12318. this.compressedTexImage2D = function() {
  12319. try {
  12320. e.compressedTexImage2D.apply(e, arguments)
  12321. } catch (e) {
  12322. console.error(e)
  12323. }
  12324. }
  12325. ,
  12326. this.texImage2D = function() {
  12327. try {
  12328. e.texImage2D.apply(e, arguments)
  12329. } catch (e) {
  12330. console.error(e)
  12331. }
  12332. }
  12333. ,
  12334. this.clearColor = function(t, i, n, r) {
  12335. o.set(t, i, n, r),
  12336. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12337. V.copy(o))
  12338. }
  12339. ,
  12340. this.clearDepth = function(t) {
  12341. U !== t && (e.clearDepth(t),
  12342. U = t)
  12343. }
  12344. ,
  12345. this.clearStencil = function(t) {
  12346. k !== t && (e.clearStencil(t),
  12347. k = t)
  12348. }
  12349. ,
  12350. this.scissor = function(t) {
  12351. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12352. H.copy(t))
  12353. }
  12354. ,
  12355. this.viewport = function(t) {
  12356. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12357. G.copy(t))
  12358. }
  12359. ,
  12360. this.reset = function() {
  12361. for (var t = 0; t < l.length; t++)
  12362. 1 === l[t] && (e.disableVertexAttribArray(t),
  12363. l[t] = 0);
  12364. h = {},
  12365. u = null,
  12366. B = void 0,
  12367. F = {},
  12368. d = null,
  12369. E = null,
  12370. I = null,
  12371. b = null,
  12372. R = null
  12373. }
  12374. }
  12375. }
  12376. , {
  12377. three: 217
  12378. }],
  12379. 104: [function(e, t, i) {///js/loaders/DamLoader.js
  12380. (function(i, n) {
  12381. "use strict";
  12382. function r(e) {
  12383. this.urls = e;
  12384. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12385. this.builder = a.loadProto(t),
  12386. this.decoder = this.builder.build("binary_mesh")
  12387. }
  12388. var o = e("three")
  12389. , a = e("protobufjs")
  12390. , s = e("../util/logger")
  12391. , l = (e("../util/common"),
  12392. e("../util/ajax"))
  12393. , c = e("../objects/Chunk")
  12394. , h = new s(n);
  12395. r.prototype = {
  12396. constructor: r,
  12397. load: function(e, t, i, n) {
  12398. return h.time("download"),
  12399. l.get(e, {
  12400. responseType: "arraybuffer"
  12401. }).done(function(r) {
  12402. h.timeEnd("download"),
  12403. this.parse(r, e, t, i, n)
  12404. }
  12405. .bind(this)).fail(n)
  12406. },
  12407. parse: function(e, t, i, n, r) {
  12408. var o = this.readProtobuf(e);
  12409. if (!o)
  12410. return r();
  12411. try {
  12412. h.time("convert to webgl"),
  12413. this.convertProtobufToSceneObject(o, t, i, n, r),
  12414. h.timeEnd("convert to webgl")
  12415. } catch (e) {
  12416. return h.error("failed parsing .dam"),
  12417. h.error(e.message),
  12418. r()
  12419. }
  12420. },
  12421. readProtobuf: function(e) {
  12422. var t;
  12423. try {
  12424. h.time("parse proto"),
  12425. t = this.decoder.decode(e),
  12426. h.timeEnd("parse proto")
  12427. } catch (e) {
  12428. return h.error("failed parsing proto for .dam"),
  12429. h.error(e.message),
  12430. null
  12431. }
  12432. return t
  12433. },
  12434. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12435. function a(e) {
  12436. var i = new o.BufferGeometry;
  12437. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12438. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12439. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12440. i.applyMatrix(s),
  12441. i.computeBoundingBox(),
  12442. new c({
  12443. geometry: i,
  12444. textureName: e.material_name,
  12445. name: e.chunk_name,
  12446. meshUrl: t
  12447. })
  12448. }
  12449. if (0 === e.chunk.length)
  12450. return h.warn("No chunks in damfile..."),
  12451. i([]);
  12452. var s = new o.Matrix4;
  12453. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12454. var l = e.chunk.map(a);
  12455. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12456. r())
  12457. }
  12458. },
  12459. t.exports = r
  12460. }
  12461. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12462. }
  12463. , {
  12464. "../objects/Chunk": 144,
  12465. "../util/ajax": 181,
  12466. "../util/common": 185,
  12467. "../util/logger": 189,
  12468. buffer: 198,
  12469. protobufjs: 214,
  12470. three: 217
  12471. }],
  12472. 105: [function(e, t, i) {///js/loaders/ModelLoader.js
  12473. (function(i) {
  12474. "use strict";
  12475. var n = (e("three"),
  12476. e("../settings"),
  12477. e("../util/browser"),
  12478. e("./DamLoader"))
  12479. , r = e("../util/logger")
  12480. , o = (e("../ab"),
  12481. new r(i));
  12482. t.exports = {
  12483. getLoaders: function() {
  12484. return [["_50k", ".dam", n], ["", ".dam", n]]
  12485. },
  12486. load: function(e, t, i, n, r, a) {
  12487. var s = this.getLoaders();
  12488. a = a || 0;
  12489. var l = s[a];
  12490. if (!l)
  12491. return void (r && r("No suitable model file found..."));
  12492. var c = l[0]
  12493. , h = l[1]
  12494. , u = new l[2](t)
  12495. , d = t.get(e + c + h);
  12496. d ? (o.debug("Trying " + c + h),
  12497. u.load(d, i, n, function() {
  12498. this.load(e, t, i, n, r, ++a)
  12499. }
  12500. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12501. this.load(e, t, i, n, r, ++a))
  12502. }
  12503. }
  12504. }
  12505. ).call(this, "/js/loaders/ModelLoader.js")
  12506. }
  12507. , {
  12508. "../ab": 3,
  12509. "../settings": 166,
  12510. "../util/browser": 182,
  12511. "../util/logger": 189,
  12512. "./DamLoader": 104,
  12513. three: 217
  12514. }],
  12515. 106: [function(e, t, i) {///js/loaders/ModelTextureLoader.js
  12516. (function(i) {
  12517. "use strict";
  12518. var n = e("../util/common")
  12519. , r = e("../util/texture")
  12520. , o = e("../util/browser")
  12521. , a = e("../util/logger")
  12522. , s = e("../settings")
  12523. , l = new a(i);
  12524. t.exports = {
  12525. load: function(e, t) {
  12526. function i(e, i) {
  12527. e || (t.push(i),
  12528. p++,
  12529. d.notify(p, a),
  12530. p === a && d.resolve())
  12531. }
  12532. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12533. return $.when();
  12534. var a = n.countUnique(e.chunks.map(function(e) {
  12535. return e.textureName
  12536. }))
  12537. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12538. , h = "_50k" === c ? "high" : "low";
  12539. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12540. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12541. h = "low"));
  12542. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12543. , d = $.Deferred()
  12544. , p = 0;
  12545. return e.chunks.forEach(function(t) {
  12546. if (!t.material.map && t.textureName) {
  12547. var n = e.urls.get(u + t.textureName);
  12548. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12549. }
  12550. }),
  12551. d.promise()
  12552. }
  12553. }
  12554. }
  12555. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12556. }
  12557. , {
  12558. "../settings": 166,
  12559. "../util/browser": 182,
  12560. "../util/common": 185,
  12561. "../util/logger": 189,
  12562. "../util/texture": 194
  12563. }],
  12564. 107: [function(e, t, i) {///js/loaders/SweepDataLoader.js
  12565. (function(i, n) {
  12566. "use strict";
  12567. function r(e) {
  12568. this.model = e,
  12569. this.modelDataPath = this.model.urls.get("vision.modeldata"),
  12570. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12571. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12572. , n = o.loadProto(t);
  12573. this.decoder = n.build("VisionModeldata")
  12574. }
  12575. var o = e("protobufjs")
  12576. , a = e("../util/ajax")
  12577. , s = (e("../util/common"),
  12578. e("../util/math"))
  12579. , l = e("../util/logger")
  12580. , c = new l(n);
  12581. r.prototype.load = function() {
  12582. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12583. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12584. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12585. $.when([]))
  12586. }
  12587. ,
  12588. r.prototype.loadVisionModelData = function() {
  12589. return a.get(this.modelDataPath, {
  12590. responseType: "arraybuffer"
  12591. }).then(function(e) {
  12592. var t;
  12593. try {
  12594. t = this.decoder.decode(e)
  12595. } catch (e) {
  12596. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12597. this.loadSweepLocationsCSV()
  12598. }
  12599. var i = t.sweepLocations.map(function(e) {
  12600. return {
  12601. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12602. position: {
  12603. x: e.pose.translation.x,
  12604. y: e.pose.translation.y,
  12605. z: e.pose.translation.z
  12606. },
  12607. quaternion: {
  12608. x: e.pose.rotation.x,
  12609. y: e.pose.rotation.y,
  12610. z: e.pose.rotation.z,
  12611. w: e.pose.rotation.w
  12612. },
  12613. puck: {
  12614. x: e.puck.x,
  12615. y: e.puck.y,
  12616. z: e.puck.z
  12617. },
  12618. floor: e.group,
  12619. neighbours: isSpecialScene ? e.visibles : (e.visibles3 || e.visibles),//可以通行的点
  12620. noBlocks: e.visibles2,// 过渡时出模型的点
  12621. seeMarkers : e.visibles //可以看见marker及热点的点
  12622. }
  12623. }).map(function(e) {
  12624. return e.position = s.convertVisionVector(e.position),
  12625. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12626. e.puck = s.convertVisionVector(e.puck),
  12627. e
  12628. });
  12629. return i.forEach(function(e) {
  12630. e.neighbours = e.neighbours.map(function(e) {
  12631. return i[e].uuid
  12632. })
  12633. }),
  12634. i.forEach(function(t) {//xzw
  12635. if(t.noBlocks)
  12636. t.noBlocks = t.noBlocks.map(function(t) {
  12637. return i[t].uuid
  12638. })
  12639. }),
  12640. i.forEach(function(t) {//xzw
  12641. if(t.seeMarkers)
  12642. t.seeMarkers = t.seeMarkers.map(function(t) {
  12643. return i[t].uuid
  12644. })
  12645. }),
  12646. i
  12647. }
  12648. .bind(this), function() {
  12649. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12650. this.loadSweepLocationsCSV()
  12651. }
  12652. .bind(this))
  12653. }
  12654. ,
  12655. r.prototype.loadSweepLocationsCSV = function() {
  12656. return a.get(this.sweepLocationsPath).then(function(e) {
  12657. var t = e.split("\n").map(function(e) {
  12658. return e.split(", ")
  12659. }).filter(function(e) {
  12660. return e.length > 1
  12661. }).map(function(e) {
  12662. return {
  12663. uuid: e[0],
  12664. position: {
  12665. x: parseFloat(e[1]),
  12666. y: parseFloat(e[2]),
  12667. z: parseFloat(e[3])
  12668. },
  12669. quaternion: {
  12670. x: parseFloat(e[4]),
  12671. y: parseFloat(e[5]),
  12672. z: parseFloat(e[6]),
  12673. w: parseFloat(e[7])
  12674. }
  12675. }
  12676. }).map(function(e) {
  12677. return e.position = s.convertVisionVector(e.position),
  12678. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12679. e
  12680. });
  12681. return t
  12682. }).fail(function() {
  12683. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12684. })
  12685. }
  12686. ,
  12687. t.exports = r
  12688. }
  12689. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12690. }
  12691. , {
  12692. "../util/ajax": 181,
  12693. "../util/common": 185,
  12694. "../util/logger": 189,
  12695. "../util/math": 190,
  12696. buffer: 198,
  12697. protobufjs: 214
  12698. }],
  12699. 108: [function(e, t, i) {////js/localization/localize.js
  12700. (function(i) {
  12701. "use strict";
  12702. function n() {
  12703. this.locale = null
  12704. }
  12705. var r = e("../settings")
  12706. , o = e("../util/common")
  12707. , a = e("../util/logger")
  12708. , s = e("../enum/Locale")
  12709. , l = new a(i);
  12710. n.prototype.init = function() {
  12711. var t;
  12712. switch (r.languageTag) {
  12713. case null:
  12714. case "en":
  12715. case s.EN_US:
  12716. this.locale = s.EN_US,
  12717. t = e("./strings-en-US");
  12718. break;
  12719. case "es":
  12720. case s.ES_MX:
  12721. this.locale = s.ES_MX,
  12722. t = e("./strings-es-MX");
  12723. break;
  12724. case "fr":
  12725. case s.FR_FR:
  12726. this.locale = s.FR_FR,
  12727. t = e("./strings-fr-FR");
  12728. break;
  12729. case "de":
  12730. case s.DE_DE:
  12731. this.locale = s.DE_DE,
  12732. t = e("./strings-de-DE");
  12733. break;
  12734. case "ru":
  12735. case s.RU_RU:
  12736. this.locale = s.RU_RU,
  12737. t = e("./strings-ru-RU");
  12738. break;
  12739. case "cn":
  12740. case s.CN_CN:
  12741. this.locale = s.CN_CN,
  12742. t = e("./strings-cn-CN");
  12743. break;
  12744. case "jp":
  12745. case s.JP_JP:
  12746. this.locale = s.JP_JP,
  12747. t = e("./strings-jp-JP");
  12748. break;
  12749. default:
  12750. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12751. this.locale = s.EN_US,
  12752. t = e("./strings-en-US")
  12753. }
  12754. l.info("Using locale '" + this.locale + "'"),
  12755. o.extendObject(this, t)
  12756. }
  12757. ,
  12758. n.prototype.localizeGUI = function() {
  12759. var e = document.querySelector("#gui-parent");
  12760. this.localizeTree(e),
  12761. this.localizeLoadingText()
  12762. }
  12763. ,
  12764. n.prototype.localizeLoadingText = function() {
  12765. var e = document.querySelector("#loader-cont")
  12766. , t = e.getAttribute("title");
  12767. e.removeAttribute("title"),
  12768. e.setAttribute("data-status", t),
  12769. e.classList.add(this.locale),
  12770. document.querySelector("#help-dialog").classList.add(this.locale),
  12771. document.querySelector("#interaction-modal").classList.add(this.locale),
  12772. document.querySelector("#gui").classList.add(this.locale)
  12773. }
  12774. ,
  12775. n.prototype.localizeTree = function(e) {
  12776. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12777. if (e.nodeType === Node.TEXT_NODE)
  12778. t = e.data.match(n),
  12779. t && (i = t[1],
  12780. e.data = this.localizeText(i) || i);
  12781. else if (e.nodeType === Node.ELEMENT_NODE) {
  12782. var r = e.getAttribute("title");
  12783. r && (t = r.match(n),
  12784. t && (i = t[1],
  12785. e.setAttribute("title", this.localizeText(i) || i)))
  12786. }
  12787. for (e = e.firstChild; e; )
  12788. this.localizeTree(e),
  12789. e = e.nextSibling
  12790. }
  12791. ,
  12792. n.prototype.localizeText = function(t) {
  12793. var i = this[t];
  12794. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12795. i = e("./strings-en-US")[t]),
  12796. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12797. i
  12798. }
  12799. ,
  12800. t.exports = new n
  12801. }
  12802. ).call(this, "/js/localization/localize.js")
  12803. }
  12804. , {
  12805. "../enum/Locale": 31,
  12806. "../settings": 166,
  12807. "../util/common": 185,
  12808. "../util/logger": 189,
  12809. "./strings-cn-CN": 109,
  12810. "./strings-de-DE": 110,
  12811. "./strings-en-US": 111,
  12812. "./strings-es-MX": 112,
  12813. "./strings-fr-FR": 113,
  12814. "./strings-jp-JP": 114,
  12815. "./strings-ru-RU": 115
  12816. }],
  12817. 109: [function(e, t, i) {//"./strings-cn-CN"
  12818. "use strict";
  12819. t.exports = {
  12820. PAGE_TITLE: "port 3D Showcase",
  12821. LOADING: "正在加载",
  12822. PRESENTED_BY_CAPS: "呈现者:",
  12823. POWERED_BY: "技术支持:",
  12824. POWERED_BY_CAPS: "技术支持:",
  12825. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12826. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12827. PRESENTED_BY: "呈现者:",
  12828. MORE: "更多 ",
  12829. LESS: "更少 ",
  12830. TAG_CONTENT: "tag™ 内容",
  12831. SHOW: "显示",
  12832. HIDE: "隐藏",
  12833. DOLLHOUSE: "场景屋",
  12834. FLOOR_PLAN: "楼层平面图",
  12835. OPEN_HIGHLIGHTS: "打开精彩片段",
  12836. CLOSE_HIGHLIGHTS: "关闭",
  12837. PREVIOUS: "上一个",
  12838. PLAY: "播放",
  12839. PAUSE: "暂停",
  12840. NEXT: "下一个",
  12841. EXPLORE_3D_SPACE: "探索 3D 空间",
  12842. VIEW_DOLLHOUSE: "观看场景屋",
  12843. SOCIAL_SHARING: "分享这个空间",
  12844. VIEW_IN_VR: "以 VR 观看",
  12845. VIEW_FULLSCREEN: "全屏观看",
  12846. EXIT_FULLSCREEN: " 退出全屏",
  12847. ZOOM_IN: "放大",
  12848. ZOOM_OUT: "缩小",
  12849. FLOOR_NAME: "楼层",
  12850. FLOOR_ALL: "全部",
  12851. TERMS: "条款",
  12852. PORT_TERMS: "port 条款",
  12853. TERMS_OF_USE: "使用条款",
  12854. CLOSE_TERMS: "关闭",
  12855. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12856. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12857. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12858. WEBVR_ENTER_WEBVR: "进入 VR",
  12859. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12860. WEBVR_LEARN_MORE: "了解更多",
  12861. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12862. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12863. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12864. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12865. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12866. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12867. VR_LEARN_MORE_CAPS: "了解更多",
  12868. VR_PREVIOUS_CAPS: "上一个’,",
  12869. VR_NEXT_CAPS: "下一个",
  12870. VR_GOT_IT_CAPS: "明白了",
  12871. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12872. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12873. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12874. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12875. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12876. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12877. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12878. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12879. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12880. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12881. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12882. VR_APP: "port VR 应用程序",
  12883. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12884. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12885. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12886. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12887. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12888. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12889. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12890. VR_ANDROID_DVICES: "Android 设备",
  12891. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12892. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12893. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12894. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12895. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12896. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12897. VR_DOWNLOAD_HERE: "在此下载",
  12898. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12899. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12900. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12901. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12902. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12903. SHARE_TO: "分享到",
  12904. SHARE_LINK: "直接链接",
  12905. SHARE_EXPLORE: "探索",
  12906. SHARE_AT: "在",
  12907. SHARE_WITH: "使用",
  12908. SHARE_3D: "以 3D",
  12909. SHARE_COPIED: "已复制!",
  12910. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12911. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12912. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12913. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12914. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12915. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12916. ERROR_GENERIC_ACTIONS_3: " 或",
  12917. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12918. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12919. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12920. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12921. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12922. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12923. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12924. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12925. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12926. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12927. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12928. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12929. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12930. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12931. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12932. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12933. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12934. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12935. LINK_TO_LOCATION: "地点链接",
  12936. MENU_COPY: "复制",
  12937. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12938. ROTATE: "旋转",
  12939. MOVE: "移动",
  12940. INSIDE: "内部",
  12941. ZOOM: "缩放",
  12942. HELP: "小帮手",
  12943. HELP_NAVIGATION_TAB: "导航",
  12944. HELP_MORE_HELP_TAB: "更多帮助",
  12945. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12946. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12947. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12948. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12949. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12950. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12951. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12952. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12953. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12954. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12955. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12956. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12957. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12958. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12959. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12960. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12961. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12962. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12963. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12964. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12965. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12966. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12967. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12968. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12969. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12970. HELP_MORE_HLR_A: "精彩片段集锦",
  12971. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12972. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12973. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12974. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12975. HELP_MORE_FLOORS_A: "楼层选择器",
  12976. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12977. HELP_MORE_TAG_A: "tag™ 贴文",
  12978. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12979. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12980. HELP_MORE_ZOOM_A: "缩放控件",
  12981. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12982. HELP_MORE_TOUR_A: "导览控件",
  12983. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12984. HELP_MORE_INSIDE_A: "内部视图",
  12985. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12986. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12987. HELP_MORE_VR_A: "VR 模式",
  12988. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12989. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12990. HELP_MORE_360_A: "360° 视图",
  12991. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12992. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12993. HELP_MORE_FULLSCREEN_A: "全屏",
  12994. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12995. CLOSE: "关闭"
  12996. }
  12997. }
  12998. , {}],
  12999. 110: [function(e, t, i) {//"./strings-de-DE"
  13000. "use strict";
  13001. t.exports = {
  13002. PAGE_TITLE: "port 3D Showcase",
  13003. LOADING: "Lädt",
  13004. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13005. POWERED_BY: "Angetrieben von",
  13006. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13007. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13008. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13009. PRESENTED_BY: "Präsentiert von ",
  13010. MORE: "Mehr ",
  13011. LESS: "Weniger ",
  13012. TAG_CONTENT: "tag™ Inhalt",
  13013. SHOW: "Anzeigen",
  13014. HIDE: "Verbergen",
  13015. DOLLHOUSE: "Puppenhaus",
  13016. FLOOR_PLAN: "Grundriss",
  13017. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13018. CLOSE_HIGHLIGHTS: "Schließen",
  13019. PREVIOUS: "Vorheriges",
  13020. PLAY: "Abspielen",
  13021. PAUSE: "Pausieren",
  13022. NEXT: "Nächstes",
  13023. EXPLORE_3D_SPACE: "Innenraum betreten",
  13024. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13025. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13026. VIEW_IN_VR: "In VR ansehen",
  13027. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13028. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13029. ZOOM_IN: "Vergrößern",
  13030. ZOOM_OUT: "Verkleinern",
  13031. FLOOR_NAME: "Etage ",
  13032. FLOOR_ALL: "Alle",
  13033. TERMS: "Bedingungen",
  13034. PORT_TERMS: "port Bedingungen",
  13035. TERMS_OF_USE: "Nutzungsbedingungen",
  13036. TERMS_TEXT_FILE: "terms-de-DE.html",
  13037. CLOSE_TERMS: "Schließen",
  13038. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13039. HELP: "Hilfe",
  13040. HELP_NAVIGATION_TAB: "Navigation",
  13041. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13042. CLOSE: "Schließen",
  13043. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13044. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13045. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13046. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13047. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13048. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13049. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13050. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13051. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13052. 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.",
  13053. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13054. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13055. 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.",
  13056. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13057. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13058. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13059. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13060. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13061. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13062. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13063. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13064. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13065. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13066. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13067. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13068. HELP_MORE_HLR_A: "Liste das Highlight",
  13069. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13070. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13071. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13072. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13073. HELP_MORE_FLOORS_A: "Etage auswählen",
  13074. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13075. HELP_MORE_TAG_A: "tag™ Posts",
  13076. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13077. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13078. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13079. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13080. HELP_MORE_TOUR_A: "Tour Steuerung",
  13081. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13082. HELP_MORE_INSIDE_A: "Innenansicht",
  13083. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13084. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13085. HELP_MORE_VR_A: "VR Modus",
  13086. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13087. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13088. HELP_MORE_360_A: "360° Views Ansicht ",
  13089. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13090. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13091. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13092. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13093. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13094. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13095. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13096. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13097. WEBVR_LEARN_MORE: "Mehr Infos",
  13098. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13099. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13100. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13101. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13102. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13103. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13104. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13105. VR_APP: "port VR App",
  13106. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13107. 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",
  13108. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13109. VR_APP_FOR_ANDROID: "port VR app für Android",
  13110. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13111. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13112. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13113. VR_PREVIOUS_CAPS: "ZURÜCK",
  13114. VR_NEXT_CAPS: "WEITER",
  13115. VR_GOT_IT_CAPS: "VERSTANDEN",
  13116. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13117. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13118. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13119. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13120. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13121. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13122. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13123. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13124. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13125. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13126. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13127. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13128. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13129. VR_ANDROID_DVICES: "Android Geräte",
  13130. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13131. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13132. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13133. VR_DOWNLOAD_HERE: "Hier runterladen",
  13134. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13135. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13136. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13137. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13138. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13139. SHARE_TO: "Teilen auf",
  13140. SHARE_LINK: "Direkter Link",
  13141. SHARE_EXPLORE: "Umsehen",
  13142. SHARE_AT: "auf",
  13143. SHARE_WITH: "mit",
  13144. SHARE_3D: "in 3D",
  13145. SHARE_COPIED: "Kopiert!",
  13146. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13147. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13148. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13149. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13150. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13151. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13152. ERROR_GENERIC_ACTIONS_3: " oder ",
  13153. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13154. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13155. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13156. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13157. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13158. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13159. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13160. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13161. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13162. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13163. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13164. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13165. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13166. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13167. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13168. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13169. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13170. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13171. LINK_TO_LOCATION: "Link zu",
  13172. MENU_COPY: "Kopieren",
  13173. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13174. ROTATE: "Drehen",
  13175. INSIDE: "Drinnen",
  13176. MOVE: "Bewegen",
  13177. ZOOM: "Vergrößern"
  13178. }
  13179. }
  13180. , {}],
  13181. 111: [function(e, t, i) {//"./strings-en-US"
  13182. "use strict";
  13183. t.exports = {
  13184. PAGE_TITLE: "port 3D Showcase",
  13185. LOADING: "Loading",
  13186. PRESENTED_BY_CAPS: "PRESENTED BY",
  13187. POWERED_BY: "powered by ",
  13188. POWERED_BY_CAPS: "POWERED BY",
  13189. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13190. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13191. PRESENTED_BY: "Presented by ",
  13192. MORE: "More ",
  13193. LESS: "Less ",
  13194. TAG_CONTENT: "tag™ Content",
  13195. SHOW: "Show",
  13196. HIDE: "Hide",
  13197. DOLLHOUSE: "Dollhouse",
  13198. FLOOR_PLAN: "Floor plan",
  13199. OPEN_HIGHLIGHTS: "Open Highlights",
  13200. CLOSE_HIGHLIGHTS: "Close",
  13201. PREVIOUS: "Previous",
  13202. PLAY: "Play",
  13203. PAUSE: "Pause",
  13204. NEXT: "Next",
  13205. EXPLORE_3D_SPACE: "Explore 3D Space",
  13206. VIEW_DOLLHOUSE: "View dollhouse",
  13207. SOCIAL_SHARING: "Share this Space",
  13208. VIEW_IN_VR: "View in VR",
  13209. VIEW_FULLSCREEN: "View Fullscreen",
  13210. EXIT_FULLSCREEN: "Exit Fullscreen",
  13211. ZOOM_IN: "Zoom in",
  13212. ZOOM_OUT: "Zoom out",
  13213. FLOOR_NAME: "Floor ",
  13214. FLOOR_ALL: "All",
  13215. TERMS: "Terms",
  13216. PORT_TERMS: "4dage terms",
  13217. TERMS_OF_USE: "Terms of Use",
  13218. TERMS_TEXT_FILE: "terms-en-US.html",
  13219. CLOSE_TERMS: "Close",
  13220. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13221. HELP: "Help",
  13222. HELP_NAVIGATION_TAB: "Navigation",
  13223. HELP_MORE_HELP_TAB: "More Help",
  13224. CLOSE: "Close",
  13225. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13226. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13227. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13228. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13229. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13230. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13231. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13232. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13233. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13234. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13235. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13236. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13237. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13238. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13239. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13240. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13241. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13242. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13243. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13244. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13245. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13246. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13247. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13248. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13249. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13250. HELP_MORE_HLR_A: "Highlight Reel",
  13251. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13252. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13253. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13254. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13255. HELP_MORE_FLOORS_A: "Floor Selector",
  13256. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13257. HELP_MORE_TAG_A: "tag™ Posts",
  13258. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13259. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13260. HELP_MORE_ZOOM_A: "Zoom Controls",
  13261. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13262. HELP_MORE_TOUR_A: "Tour Controls",
  13263. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13264. HELP_MORE_INSIDE_A: "Inside View",
  13265. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13266. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13267. HELP_MORE_VR_A: "VR Mode",
  13268. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13269. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13270. HELP_MORE_360_A: "360° Views",
  13271. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13272. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13273. HELP_MORE_FULLSCREEN_A: "Full screen",
  13274. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13275. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13276. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13277. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13278. WEBVR_ENTER_WEBVR: "ENTER VR",
  13279. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13280. WEBVR_LEARN_MORE: "Learn more",
  13281. WEBVR_VIEW_SPACE: "View Space in VR",
  13282. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13283. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13284. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13285. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13286. VR_PREVIOUS_CAPS: "PREVIOUS",
  13287. VR_NEXT_CAPS: "NEXT",
  13288. VR_GOT_IT_CAPS: "GOT IT",
  13289. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13290. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13291. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13292. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13293. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13294. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13295. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13296. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13297. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13298. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13299. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13300. VR_APP: "port VR App",
  13301. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13302. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13303. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13304. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13305. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13306. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13307. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13308. VR_ANDROID_DVICES: "Android Devices",
  13309. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13310. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13311. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13312. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13313. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13314. VR_APP_OPEN: "Open with the port VR app instead",
  13315. VR_DOWNLOAD_HERE: "Download here",
  13316. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13317. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13318. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13319. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13320. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13321. SHARE_TO: "Share to",
  13322. SHARE_LINK: "Direct Link",
  13323. SHARE_EXPLORE: "Explore ",
  13324. SHARE_AT: "at",
  13325. SHARE_WITH: "with",
  13326. SHARE_3D: " in 3D",
  13327. SHARE_COPIED: "Copied!",
  13328. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13329. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13330. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13331. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13332. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13333. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13334. ERROR_GENERIC_ACTIONS_3: " or ",
  13335. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13336. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13337. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13338. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13339. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13340. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13341. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13342. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13343. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13344. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13345. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13346. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13347. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13348. ERROR_LOADING_FAILED_PROBLEM: "Oops, model not available.",
  13349. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13350. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13351. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13352. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13353. LINK_TO_LOCATION: "Link to location",
  13354. MENU_COPY: "Copy",
  13355. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13356. ROTATE: "Rotate",
  13357. INSIDE: "Inside",
  13358. MOVE: "Move",
  13359. ZOOM: "Zoom"
  13360. }
  13361. }
  13362. , {}],
  13363. 112: [function(e, t, i) {//"./strings-es-MX"
  13364. "use strict";
  13365. t.exports = {
  13366. PAGE_TITLE: "port 3D Showcase",
  13367. LOADING: "Cargando",
  13368. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13369. POWERED_BY: "potenciando por ",
  13370. POWERED_BY_CAPS: "POTENCIADO POR ",
  13371. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13372. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13373. PRESENTED_BY: "Presentado por ",
  13374. MORE: "Más ",
  13375. LESS: "Menos ",
  13376. TAG_CONTENT: "Contenido de tag™",
  13377. SHOW: "Mostrar",
  13378. HIDE: "Ocultar",
  13379. DOLLHOUSE: "Dollhouse",
  13380. FLOOR_PLAN: "Planos",
  13381. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13382. CLOSE_HIGHLIGHTS: "Cerrar",
  13383. PREVIOUS: "Anterior",
  13384. PLAY: "Play",
  13385. PAUSE: "Pausa",
  13386. NEXT: "Siguiente",
  13387. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13388. VIEW_DOLLHOUSE: "Ver dollhouse",
  13389. SOCIAL_SHARING: "Compartir este espacio",
  13390. VIEW_IN_VR: "Ver en realidad virtual",
  13391. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13392. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13393. ZOOM_IN: "Acercar",
  13394. ZOOM_OUT: "Alejar",
  13395. FLOOR_NAME: "Piso ",
  13396. FLOOR_ALL: "Todas",
  13397. TERMS: "Condiciones",
  13398. PORT_TERMS: "port términos de uso",
  13399. TERMS_OF_USE: "Términos de uso",
  13400. TERMS_TEXT_FILE: "terms-es-MX.html",
  13401. CLOSE_TERMS: "Cerrar",
  13402. 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.",
  13403. HELP: "Ayuda",
  13404. HELP_NAVIGATION_TAB: "Navegación",
  13405. HELP_MORE_HELP_TAB: "Más Ayuda",
  13406. CLOSE: "Cerrar",
  13407. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13408. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13409. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13410. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13411. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13412. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13413. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13414. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13415. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13416. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13417. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13418. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13419. 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.",
  13420. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13421. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13422. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13423. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13424. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13425. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13426. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13427. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13428. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13429. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13430. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13431. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13432. HELP_MORE_HLR_A: "Galería destacada",
  13433. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13434. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13435. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13436. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13437. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13438. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13439. HELP_MORE_TAG_A: "tag™ Posts",
  13440. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13441. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13442. HELP_MORE_ZOOM_A: "Controles de zoom",
  13443. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13444. HELP_MORE_TOUR_A: "Controles de recorrido",
  13445. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13446. HELP_MORE_INSIDE_A: "Vista interior",
  13447. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13448. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13449. HELP_MORE_VR_A: "Modo de realidad virtual",
  13450. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13451. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13452. HELP_MORE_360_A: "360° Views",
  13453. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13454. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13455. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13456. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13457. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13458. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13459. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13460. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13461. WEBVR_LEARN_MORE: "Más información",
  13462. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13463. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13464. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13465. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13466. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13467. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13468. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13469. VR_APP: "port VR App",
  13470. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13471. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13472. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13473. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13474. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13475. VR_PREVIOUS_CAPS: "ANTERIOR",
  13476. VR_NEXT_CAPS: "SIGUIENTE",
  13477. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13478. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13479. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13480. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13481. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13482. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13483. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13484. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13485. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13486. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13487. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13488. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13489. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13490. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13491. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13492. VR_ANDROID_DVICES: "Dispositivos Android",
  13493. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13494. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13495. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13496. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13497. VR_DOWNLOAD_HERE: "Descargar aquí",
  13498. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13499. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13500. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13501. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13502. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13503. SHARE_TO: "Compartir en",
  13504. SHARE_LINK: "Enlace directo",
  13505. SHARE_EXPLORE: "Explorar ",
  13506. SHARE_AT: "en",
  13507. SHARE_WITH: "con",
  13508. SHARE_3D: " en 3D",
  13509. SHARE_COPIED: "¡Copiado!",
  13510. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13511. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13512. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13513. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13514. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13515. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13516. ERROR_GENERIC_ACTIONS_3: " o ",
  13517. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13518. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13519. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13520. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13521. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13522. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13523. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13524. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13525. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13526. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13527. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13528. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13529. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13530. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13531. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13532. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13533. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13534. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13535. LINK_TO_LOCATION: "Enlace a la ubicación",
  13536. MENU_COPY: "Copiar",
  13537. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13538. ROTATE: "Girar",
  13539. INSIDE: "Interior",
  13540. MOVE: "Moverse",
  13541. ZOOM: "Acercar o alejar"
  13542. }
  13543. }
  13544. , {}],
  13545. 113: [function(e, t, i) {//"./strings-fr-FR"
  13546. "use strict";
  13547. t.exports = {
  13548. PAGE_TITLE: "port 3D Showcase",
  13549. LOADING: "Chargement",
  13550. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13551. POWERED_BY: "alimenté par ",
  13552. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13553. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13554. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13555. PRESENTED_BY: "Présenté par ",
  13556. MORE: "Plus ",
  13557. LESS: "Moins ",
  13558. TAG_CONTENT: "Contenu tag™",
  13559. SHOW: "Montrer",
  13560. HIDE: "Cacher",
  13561. DOLLHOUSE: "Dollhouse",
  13562. FLOOR_PLAN: "Plan de sol",
  13563. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13564. CLOSE_HIGHLIGHTS: "Fermer",
  13565. PREVIOUS: "Précédent",
  13566. PLAY: "Lecture",
  13567. PAUSE: "Pause",
  13568. NEXT: "Suivant",
  13569. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13570. VIEW_DOLLHOUSE: "Voir dollhouse",
  13571. SOCIAL_SHARING: "Partager cet espace",
  13572. VIEW_IN_VR: "Voir en VR",
  13573. VIEW_FULLSCREEN: "Plein écran",
  13574. EXIT_FULLSCREEN: "Fermer plein écran",
  13575. ZOOM_IN: "Zoom avant",
  13576. ZOOM_OUT: "Zoom arrière",
  13577. FLOOR_NAME: "Étage ",
  13578. FLOOR_ALL: "Tous",
  13579. TERMS: "Mentions légales",
  13580. PORT_TERMS: "port mentions légales",
  13581. TERMS_OF_USE: "Conditions d'utilisation",
  13582. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13583. CLOSE_TERMS: "Fermer",
  13584. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13585. HELP: "Aide",
  13586. HELP_NAVIGATION_TAB: "Navigation",
  13587. HELP_MORE_HELP_TAB: "Aide",
  13588. CLOSE: "Fermer",
  13589. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13590. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13591. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13592. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13593. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13594. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13595. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13596. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13597. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13598. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13599. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13600. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13601. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13602. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13603. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13604. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13605. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13606. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13607. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13608. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13609. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13610. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13611. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13612. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13613. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13614. HELP_MORE_HLR_A: "Carrousel",
  13615. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13616. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13617. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13618. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13619. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13620. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13621. HELP_MORE_TAG_A: "tag™ Posts",
  13622. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13623. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13624. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13625. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13626. HELP_MORE_TOUR_A: "Commandes de la visite",
  13627. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13628. HELP_MORE_INSIDE_A: "Vue intérieure",
  13629. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13630. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13631. HELP_MORE_VR_A: "Mode RV",
  13632. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13633. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13634. HELP_MORE_360_A: "Vues 360°",
  13635. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13636. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13637. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13638. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13639. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13640. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13641. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13642. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13643. WEBVR_LEARN_MORE: "En savoir plus",
  13644. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13645. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13646. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13647. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13648. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13649. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13650. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13651. VR_NEXT_CAPS: "SUIVANT",
  13652. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13653. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13654. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13655. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13656. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13657. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13658. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13659. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13660. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13661. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13662. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13663. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13664. VR_APP: "port VR App",
  13665. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13666. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13667. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13668. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13669. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13670. 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",
  13671. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13672. VR_ANDROID_DVICES: "Appareils Android",
  13673. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13674. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13675. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13676. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13677. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13678. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13679. VR_DOWNLOAD_HERE: "Télécharger ici",
  13680. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13681. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13682. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13683. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13684. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13685. SHARE_TO: "Partager sur",
  13686. SHARE_LINK: "Lien direct",
  13687. SHARE_EXPLORE: "Explorer ",
  13688. SHARE_AT: "à",
  13689. SHARE_WITH: "avec",
  13690. SHARE_3D: " en 3D",
  13691. SHARE_COPIED: "Copié!",
  13692. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13693. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13694. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13695. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13696. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13697. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13698. ERROR_GENERIC_ACTIONS_3: " ou ",
  13699. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13700. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13701. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13702. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13703. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13704. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13705. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13706. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13707. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13708. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13709. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13710. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13711. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13712. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13713. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13714. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13715. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13716. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13717. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13718. MENU_COPY: "Copie",
  13719. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13720. ROTATE: "Faire pivoter",
  13721. INSIDE: "Intérieure",
  13722. MOVE: "Se déplacer",
  13723. ZOOM: "Zoom"
  13724. }
  13725. }
  13726. , {}],
  13727. 114: [function(e, t, i) {//"./strings-jp-JP"
  13728. "use strict";
  13729. t.exports = {
  13730. PAGE_TITLE: "port 3D Showcase",
  13731. LOADING: "読み込み中",
  13732. PRESENTED_BY_CAPS: "PRESENTED BY",
  13733. POWERED_BY: "powered by",
  13734. POWERED_BY_CAPS: "POWERED BY",
  13735. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13736. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13737. PRESENTED_BY: "Presented by ",
  13738. MORE: "全て表示 ",
  13739. LESS: "閉じる ",
  13740. TAG_CONTENT: "tag™コンテンツ ",
  13741. SHOW: "表示",
  13742. HIDE: "非表示",
  13743. DOLLHOUSE: "ドールハウス",
  13744. FLOOR_PLAN: "フロアプラン",
  13745. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13746. CLOSE_HIGHLIGHTS: "閉じる",
  13747. PREVIOUS: "前へ",
  13748. PLAY: "再生",
  13749. PAUSE: "一時停止",
  13750. NEXT: "次へ",
  13751. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13752. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13753. SOCIAL_SHARING: "このSpaceを共有する",
  13754. VIEW_IN_VR: "VRで表示",
  13755. VIEW_FULLSCREEN: "フルスクリーン表示",
  13756. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13757. ZOOM_IN: "ズームイン",
  13758. ZOOM_OUT: "ズームアウト",
  13759. FLOOR_NAME: "フロア ",
  13760. FLOOR_ALL: "すべて",
  13761. TERMS: "規約",
  13762. PORT_TERMS: "port規約",
  13763. TERMS_OF_USE: "利用規約",
  13764. CLOSE_TERMS: "閉じる",
  13765. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13766. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13767. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13768. WEBVR_ENTER_WEBVR: "VRに入る",
  13769. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13770. WEBVR_LEARN_MORE: "もっと詳しく",
  13771. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13772. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13773. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13774. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13775. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13776. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13777. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13778. VR_PREVIOUS_CAPS: "前へ",
  13779. VR_NEXT_CAPS: "次へ",
  13780. VR_GOT_IT_CAPS: "了解",
  13781. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13782. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13783. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13784. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13785. VR_WHAT_YOU_NEED: "必要なもの",
  13786. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13787. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13788. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13789. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13790. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13791. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13792. VR_APP: "port VRアプリ",
  13793. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13794. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13795. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13796. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13797. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13798. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13799. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13800. VR_ANDROID_DVICES: "Androidデバイス",
  13801. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13802. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13803. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13804. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13805. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13806. VR_APP_OPEN: "port VRアプリで開く",
  13807. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13808. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13809. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13810. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13811. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13812. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13813. SHARE_TO: "共有先",
  13814. SHARE_LINK: "ダイレクトリンク",
  13815. SHARE_EXPLORE: "探索",
  13816. SHARE_AT: "場所",
  13817. SHARE_WITH: "使用アプリ",
  13818. SHARE_3D: "3Dで",
  13819. SHARE_COPIED: "コピーされました!",
  13820. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13821. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13822. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13823. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13824. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13825. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13826. ERROR_GENERIC_ACTIONS_3: "または",
  13827. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13828. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13829. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13830. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13831. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13832. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13833. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13834. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13835. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13836. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13837. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13838. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13839. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13840. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13841. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13842. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13843. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13844. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13845. LINK_TO_LOCATION: "ロケーションへのリンク",
  13846. MENU_COPY: "コピー",
  13847. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13848. ROTATE: "回転",
  13849. MOVE: "移動",
  13850. INSIDE: "内側",
  13851. ZOOM: "ズーム",
  13852. HELP: "ヘルプ",
  13853. HELP_NAVIGATION_TAB: "ナビゲーション",
  13854. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13855. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13856. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13857. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13858. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13859. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13860. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13861. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13862. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13863. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13864. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13865. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13866. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13867. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13868. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13869. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13870. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13871. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13872. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13873. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13874. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13875. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13876. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13877. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13878. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13879. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13880. HELP_MORE_HLR_A: "ハイライト",
  13881. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13882. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13883. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13884. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13885. HELP_MORE_FLOORS_A: "フロアセレクター",
  13886. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13887. HELP_MORE_TAG_A: "tag™ Posts",
  13888. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13889. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13890. HELP_MORE_ZOOM_A: "ズームコントロール",
  13891. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13892. HELP_MORE_TOUR_A: "ツアーコントロール",
  13893. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13894. HELP_MORE_INSIDE_A: "内側ビュー",
  13895. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13896. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13897. HELP_MORE_VR_A: "VRモード",
  13898. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13899. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13900. HELP_MORE_360_A: "360° Views",
  13901. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13902. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13903. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13904. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13905. CLOSE: "閉じる"
  13906. }
  13907. }
  13908. , {}],
  13909. 115: [function(e, t, i) {//"./strings-ru-RU"
  13910. "use strict";
  13911. t.exports = {
  13912. PAGE_TITLE: "port 3D Showcase",
  13913. LOADING: "Загрузка",
  13914. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13915. POWERED_BY: "разработано на платформе ",
  13916. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13917. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13918. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13919. PRESENTED_BY: "Представлено ",
  13920. MORE: "Больше ",
  13921. LESS: "Меньше ",
  13922. TAG_CONTENT: "tag™ Контент",
  13923. SHOW: "Показать",
  13924. HIDE: "Скрыть",
  13925. DOLLHOUSE: "Dollhouse",
  13926. FLOOR_PLAN: "Планировка",
  13927. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13928. CLOSE_HIGHLIGHTS: "Закрыть",
  13929. PREVIOUS: "Предыдущий",
  13930. PLAY: "Воспроизвести",
  13931. PAUSE: "Пауза",
  13932. NEXT: "Следующий",
  13933. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13934. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13935. SOCIAL_SHARING: "Поделиться этой моделью",
  13936. VIEW_IN_VR: "Посмотреть в VR",
  13937. VIEW_FULLSCREEN: "Полный экран",
  13938. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13939. ZOOM_IN: "Увеличить",
  13940. ZOOM_OUT: "Уменьшить",
  13941. FLOOR_NAME: "Этаж ",
  13942. FLOOR_ALL: "Все",
  13943. TERMS: "Условия",
  13944. PORT_TERMS: "Правила пользования",
  13945. TERMS_OF_USE: "Условия использования",
  13946. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13947. CLOSE_TERMS: "Закрыть",
  13948. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13949. HELP: "Помощь",
  13950. HELP_NAVIGATION_TAB: "Навигация",
  13951. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13952. CLOSE: "Закрыть",
  13953. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13954. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13955. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13956. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13957. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13958. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13959. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13960. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13961. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13962. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13963. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13964. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13965. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13966. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13967. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13968. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13969. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13970. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13971. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13972. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13973. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13974. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13975. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13976. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13977. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13978. HELP_MORE_HLR_A: "Фотоколлаж",
  13979. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13980. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13981. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13982. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13983. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13984. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13985. HELP_MORE_TAG_A: "tag™ Posts",
  13986. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13987. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13988. HELP_MORE_ZOOM_A: "Масштаб",
  13989. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13990. HELP_MORE_TOUR_A: "Управление Туром",
  13991. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13992. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13993. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13994. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13995. HELP_MORE_VR_A: "Режим VR",
  13996. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13997. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13998. HELP_MORE_360_A: "360° Views",
  13999. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14000. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14001. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14002. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14003. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14004. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14005. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14006. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14007. WEBVR_LEARN_MORE: "Узнать больше",
  14008. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14009. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14010. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14011. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14012. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14013. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14014. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14015. VR_APP: "port VR App",
  14016. VR_APP_OPEN: "Или открыть через приложение port VR",
  14017. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14018. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14019. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14020. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14021. VR_VIEW_SPACE: "Запустить модель в VR",
  14022. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14023. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14024. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14025. VR_GOT_IT_CAPS: "ЯСНО",
  14026. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14027. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14028. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14029. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14030. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14031. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14032. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14033. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14034. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14035. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14036. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14037. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14038. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14039. VR_ANDROID_DVICES: "Android устройства",
  14040. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14041. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14042. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14043. VR_DOWNLOAD_HERE: "Скачать здесь",
  14044. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14045. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14046. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14047. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14048. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14049. SHARE_TO: "Поделиться",
  14050. SHARE_LINK: "Прямая ссылка",
  14051. SHARE_EXPLORE: "просмотреть",
  14052. SHARE_AT: "на",
  14053. SHARE_WITH: "с",
  14054. SHARE_3D: "в 3D",
  14055. SHARE_COPIED: "Скопировано!",
  14056. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14057. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14058. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14059. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14060. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14061. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14062. ERROR_GENERIC_ACTIONS_3: " или ",
  14063. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14064. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14065. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14066. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14067. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14068. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14069. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14070. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14071. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14072. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14073. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14074. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14075. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14076. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14077. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14078. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14079. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14080. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14081. LINK_TO_LOCATION: "Ссылка на местоположение",
  14082. MENU_COPY: "Копировать",
  14083. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14084. ROTATE: "Вращать",
  14085. MOVE: "Передвигаться",
  14086. INSIDE: "Вид изнутри",
  14087. ZOOM: "Масштаб"
  14088. }
  14089. }
  14090. , {}],
  14091. "dom":[function(t, e){//改 xzw
  14092. e.exports = {
  14093. 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+$/,'');}}}
  14094. ,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;}}
  14095. ,hasClass:function(elem,className){return new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)').test(elem.className)||false;}
  14096. ,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);}
  14097. ,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);}
  14098. ,id:function(id,elem){elem=elem||document;var result=elem.getElementById&&elem.getElementById(id);return result||document.getElementById(id);}
  14099. ,Tag:function(name,elem){elem=elem||document;return elem.getElementsByTagName(name);}
  14100. ,cla:function(name,elem){elem=elem||document;return elem.getElementsByClassName(name);}
  14101. ,ifVoid:function(v,b){if(v==void 0){return b;}else{return v;}}
  14102. ,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));}
  14103. ,getIndex:function(elem,index){index=index||'index';return elem.getAttributeNode(index)&&elem.getAttributeNode(index).nodeValue;}
  14104. ,setIndex:function(elem,name){elem.setAttribute('index',name);}
  14105. ,findParent:function(child,parent){ var a = child; do{ if(a == parent)return true; a = a.parentElement; }while(a); return false; }
  14106. ,findParents:function(child,o){var a=child;do{for(var i=0;i<o.length;i++){switch(o[i].type){case"node":if(a==o[i].obj)return true;break; case"class":if(a.className==o[i].obj)return true;break; case"tag":/* if(a.nodeName)console.log(a.nodeName);else console.log(a); */ if(a.nodeName.toUpperCase()==o[i].obj.toUpperCase())return true;}}a=a.parentElement;}while(a);return false;}
  14107. };
  14108. }, {}
  14109. ],
  14110. "scaleImg":[function(t, e){//改 xzw
  14111. var OUTPUT = e;
  14112. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  14113. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  14114. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  14115. return G.getImageData(0,0,s,f)}
  14116. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  14117. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  14118. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  14119. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  14120. else
  14121. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  14122. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  14123. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  14124. for(b=x/ht,R=0|b,q=b-R,N=R*_,M=1>R?N:N-_,w-2>R?(O=N+_,P=(R+2)*_):O=P=R>w-2?N:N+_,y=0;s>y;y++,et+=4)
  14125. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  14126. W=new Float32Array(at);else
  14127. for(W=[],et=0;at>et;++et)
  14128. W[et]=0;for(b=0;w>b;b++)
  14129. for(x=b*ht,A=0|x,D=A*$,U=!!((A-(x+ht|0))*(w-1-b))<<1,U&&(F=A+1-x,L=x+ht-A-1),v=0;m>v;v++,tt+=4)
  14130. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  14131. delete p,h(),J=n(W)}
  14132. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  14133. if("png-src"===i||"jpeg-src"===i)
  14134. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  14135. return B}
  14136. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  14137. OUTPUT.exports = c;
  14138. }, {}
  14139. ],
  14140. "ScrollBar":[function(t, e){//改 xzw
  14141. var dom = t("dom");
  14142. var ScrollBar = function(root,value,min,max,name,unitStr,onchange){//unitStr是单位字符串,比如角度的°。不能是数字
  14143. var scope = this;
  14144. this.name = name;
  14145. this.value = value;
  14146. this.min = min || 0;
  14147. this.max = max || 100;
  14148. var div = document.createElement('div');
  14149. div.innerHTML = '<div class="Main"><div class="scrollBar"><div class="scroll_Track"></div><div class="scroll_Thumb"></div></div><div class="BarTxt"><input class="scrollBarTxt"></div>';
  14150. dom.addClass(div,"slider");
  14151. root.appendChild(div);
  14152. this.line = dom.cla("scrollBar", div)[0];
  14153. this.knot = dom.cla("scroll_Thumb",div)[0];
  14154. this.textArea = dom.cla("scrollBarTxt",div)[0];
  14155. this.track = dom.cla("scroll_Track",div)[0];
  14156. this.unitStr = unitStr;
  14157. this.onchange = onchange;
  14158. this.percent = null;
  14159. this.dragStart = false;
  14160. this.offsetToBody = null;
  14161. this.getOffset();
  14162. this.checkError();
  14163. this.percent = this.getPercent();
  14164. this.displayValue(value);
  14165. this.moveKnot();
  14166. this.knotWidth = 0;
  14167. this.lineWidth = 0;
  14168. dom.bind(this.line,"mousedown",function(event){
  14169. scope.dragStart = true;
  14170. scope.dragChange(event);
  14171. });
  14172. dom.bind(document,"mouseup",function(event){
  14173. if(scope.dragStart){
  14174. scope.dragStart = false;
  14175. //webview.updateView(false,false)//为了抗锯齿
  14176. }
  14177. })
  14178. dom.bind(document,"mousemove",function(event){
  14179. if(scope.dragStart){
  14180. scope.dragChange(event);
  14181. }
  14182. });
  14183. dom.bind(this.line,"touchstart",function(event){
  14184. scope.dragStart = true;
  14185. scope.dragChange(event);
  14186. });
  14187. dom.bind(document,"touchend",function(event){
  14188. if(scope.dragStart){
  14189. scope.dragStart = false;
  14190. //webview.updateView(false,false)//为了抗锯齿
  14191. }
  14192. })
  14193. dom.bind(document,"touchmove",function(event){
  14194. if(scope.dragStart){
  14195. scope.dragChange(event);
  14196. }
  14197. });
  14198. dom.bind(this.textArea,"change",function(){
  14199. var v = parseFloat(scope.textArea.value);
  14200. if(v!=v) return; //NaN
  14201. scope.setValueFromOutside(v);
  14202. });
  14203. }
  14204. ScrollBar.prototype.getOffset = function(){ //用prototype减少了内存近5M
  14205. var left = this.line.offsetLeft;
  14206. var element = this.line;
  14207. while(element = element.offsetParent){
  14208. left += element.offsetLeft;
  14209. }
  14210. this.offsetToBody = (left==0)?(this.offsetToBody||0):left;//如果left为0,很可能是它不可见,那么最好使用旧的offsetToBody
  14211. }
  14212. ScrollBar.prototype.checkError = function(){
  14213. if(this.min>=this.max){
  14214. console.log("scrollbar值有误 "+name);
  14215. return;
  14216. }
  14217. }
  14218. ScrollBar.prototype.getPercent = function(){
  14219. return (this.value-this.min)/(this.max-this.min);
  14220. }
  14221. ScrollBar.prototype.displayValue = function(){
  14222. this.textArea.value = this.value + ( this.unitStr ? " "+this.unitStr : "");
  14223. }
  14224. ScrollBar.prototype.getWidth = function(){//不可见时clientWidth=0
  14225. this.knotWidth ||(this.knotWidth = this.knot.clientWidth);
  14226. this.lineWidth ||(this.lineWidth = this.line.clientWidth - this.knotWidth);
  14227. }
  14228. ScrollBar.prototype.moveKnot = function(){
  14229. this.getWidth();
  14230. var width = this.percent * this.lineWidth;
  14231. this.knot.style.left = width + "px";
  14232. if(this.track) this.track.style.width = width + this.knotWidth/2 + "px";
  14233. };
  14234. ScrollBar.prototype.bind = function(f){
  14235. this.onchange = f;
  14236. }
  14237. ScrollBar.prototype.setValue = function(v){
  14238. //if(this.value==v)return; //因为换选材质需要执行后面onchange才会带动preview的改变,所以这里一样还是执行,而拉动滑动条的部分值不变就不执行
  14239. this.value = Math.round(v);
  14240. this.percent = this.getPercent();
  14241. this.moveKnot();
  14242. if(this.onchange) this.onchange(this.value);
  14243. this.displayValue();
  14244. //webview.drawScene2();
  14245. //webview.updateView(true,false,1);
  14246. }
  14247. ScrollBar.prototype.dragChange = function(event){
  14248. this.getWidth();
  14249. if(!this.offsetToBody)this.getOffset();
  14250. if(event.clientX != void 0){
  14251. this.percent = (event.clientX - this.knotWidth/2 - this.offsetToBody) / this.lineWidth ;
  14252. }
  14253. else{
  14254. this.percent = (event.touches[0].clientX - this.knotWidth/2 - this.offsetToBody) / this.lineWidth ;
  14255. }
  14256. if( this.percent < 0) this.percent = 0;
  14257. else if( this.percent > 1) this.percent = 1;
  14258. //var v = this.percent * this.max;
  14259. var v = Math.round(this.percent * (this.max-this.min) + this.min);
  14260. //var v = Math.round(this.percent * this.max * 10)/10; //精度为0.1
  14261. if(this.value==v)return;
  14262. this.setValue(v);
  14263. }
  14264. ScrollBar.prototype.setValueFromOutside = function(v){ //外面的事件触发的
  14265. if(this.line.clientWidth == 0) return;//不可见就不执行。
  14266. //v = Math.round(v*10)/10;
  14267. v = dom.clamp(v, this.min, this.max);
  14268. this.setValue(v);
  14269. //webview.updateView(false,false);//drawScene4times();
  14270. }
  14271. e.exports = ScrollBar;
  14272. }, {
  14273. "dom": "dom"
  14274. }],
  14275. "List":[function(t, e){//改 xzw
  14276. var dom = t("dom");
  14277. var List = function(list, select, fuc, o){
  14278. var options = dom.Tag("ul",select.parentNode)[0];
  14279. var removeExtraStr = function(str){//针对ie
  14280. return str.replace("\r","").replace("\n","").replace("\t","");
  14281. }
  14282. if(list.length === 0) list.push("空");
  14283. for(var i=0; i<list.length; i++){
  14284. var li = document.createElement("li");
  14285. //getIndex(li) = matList[i];
  14286. li.innerHTML = list[i];
  14287. options.appendChild(li);
  14288. }
  14289. if(o && o.option){
  14290. select.innerHTML = o.option;
  14291. }else if(o && !o.option && o.initOption){
  14292. select.innerHTML = o.initOption;
  14293. }else
  14294. select.innerHTML = list[0];
  14295. var over1 = false;
  14296. var over2 = false;
  14297. var focus = false; //标记标题是否要高亮
  14298. var over3 = false; //标记options的子物体
  14299. var headDown = false; //标记标题是否被按下且未离开标题,准备松开
  14300. //for(var i=0; i<)
  14301. dom.bind(select,"mouseover",function(){
  14302. dom.addClass(select,"focus");
  14303. over1 = true;
  14304. })
  14305. dom.bind(select,"mouseout",function(){
  14306. if(!focus)dom.removeClass(select,"focus");
  14307. over1 = false;
  14308. headDown = false;
  14309. })
  14310. dom.bind(options,"mouseover",function(event){
  14311. over2 = true;
  14312. for(var i=0; i<options.children.length; i++){//不直接用:hover是因为在拖动时不起作用
  14313. dom.removeClass(options.children[i],"hover");
  14314. }
  14315. var elem = event.target;
  14316. over3 = false;
  14317. while(elem.nodeName != "LI"){
  14318. elem = elem.parentElement;
  14319. over3 = true; //标记一下在子元素内
  14320. }
  14321. dom.addClass(elem,"hover");
  14322. })
  14323. dom.bind(options,"mouseout",function(){
  14324. over2 = false;
  14325. over3 = false;
  14326. })
  14327. dom.bind(document,"mousedown",function(event){
  14328. if(over1){ //在标题处
  14329. headDown = true;
  14330. focus = true;
  14331. dom.addClass(select,"focus");
  14332. }
  14333. else if(!over2 && !over3){ //在标题和选项(包括选项子元素)以外的地方 一旦点下即消失
  14334. dom.addClass(options,"hide");
  14335. dom.removeClass(select,"focus");
  14336. focus = false;
  14337. }
  14338. })
  14339. dom.bind(document,"mouseup",function(event){
  14340. if(over1){ //在标题处
  14341. if(dom.hasClass(options,"hide") && headDown){//只有在标题已经按下再松开才能显示子项
  14342. dom.removeClass(options,"hide");
  14343. for(var i=0; i<options.children.length; i++){ //下次打开时高亮选中项
  14344. if(options.children[i].innerText === select.innerText){
  14345. dom.addClass(options.children[i],"hover");
  14346. }else{
  14347. dom.removeClass(options.children[i],"hover");
  14348. }
  14349. }
  14350. }
  14351. else if(!dom.hasClass(options,"hide")){//消失则无headDown限制
  14352. dom.addClass(options,"hide");
  14353. }
  14354. }
  14355. else if( over2 || over3){ //在选项处松开鼠标
  14356. //if(select.innerText !== event.target.innerText){//注释掉的话即使点击的和当前的相同也执行,主要是高亮要执行,其他不用。这样分开两个函数其实也可以
  14357. var elem = event.target;
  14358. while(elem.nodeName != "LI"){
  14359. elem = elem.parentElement;
  14360. }
  14361. if(!fuc || elem.innerText == "空" || (o&&o.noCallback))select.innerText = removeExtraStr(elem.innerText);
  14362. if(elem.innerText !== "空"){
  14363. if(fuc) fuc(removeExtraStr(elem.innerText),dom.getIndex(select),function(){select.innerText = removeExtraStr(elem.innerText);})
  14364. }
  14365. //}
  14366. dom.removeClass(elem,"hover");
  14367. dom.addClass(options,"hide");
  14368. dom.removeClass(select,"focus");
  14369. focus = false;
  14370. }
  14371. else if(!over2 && !over3){ //在标题和选项(包括选项子元素)以外的地方 松开也消失
  14372. dom.addClass(options,"hide");
  14373. dom.removeClass(select,"focus");
  14374. focus = false;
  14375. }
  14376. })
  14377. this.getValue = function(){
  14378. return select.innerHTML;
  14379. }
  14380. this.selectFromOutSide = function(name){//不通过点击,由于其他操作而选择
  14381. select.innerText = name;
  14382. if(fuc) fuc(name);//fuc(o,dom.getIndex(select),function(){select.innerText = name;})
  14383. }
  14384. }
  14385. e.exports = List;
  14386. }, {
  14387. "dom": "dom"
  14388. }],
  14389. "Hotspot":[//改 xzw
  14390. function(t, e){
  14391. function Hotspot(o){
  14392. this.pos3d = o.pos3d;
  14393. this.player = o.player;
  14394. this.state = "static";//即hover时不会展开
  14395. this.clickFuc = false;
  14396. this.elem = document.createElement('div');
  14397. this.title = o.title || "";
  14398. this.content = o.content || "";
  14399. this.type = o.type;
  14400. //this.setElemType(o.type);
  14401. dom.addClass(this.elem, "markspot");
  14402. dom.id('hotspot').appendChild(this.elem);
  14403. this.player.allHotspots.push(this);
  14404. //this.index = o.index;
  14405. //this.hasUpLoadImg = o.hasUpLoadImg || false;
  14406. if(o.imgSrc){this.img = new Image; this.img.src = o.imgSrc; /* this.oldImgsrc = o.imgSrc; */}
  14407. //if(o.posGets) this.setPosGets(o.posGets);
  14408. //this.scale1 = dom.ifVoid(o.scale1, 1);
  14409. //this.scale2 = dom.ifVoid(o.scale2, 1);
  14410. }
  14411. Hotspot.prototype.becomeReal = function(){//变成非markspos 具有real的效果
  14412. this.player.allHotspots = [];
  14413. this.elem.parentElement.removeChild(this.elem);
  14414. this.player.model.spotCreatedNum++;
  14415. var tag = new Tag(this.player.model, this.player.model.spotCreatedNum,{
  14416. label : this.title,
  14417. description : this.content,
  14418. //media :
  14419. posGets:this.player.posGets,
  14420. position: this.pos3d,
  14421. type: this.type
  14422. })
  14423. tag.build();
  14424. tag.bindEvents();
  14425. this.player.model.tags[this.player.model.spotCreatedNum] = tag;
  14426. this.player.tagManager.getTag(tag);
  14427. //this.player.editor.exchangeTagForSave(tag); //反正一定要加标题的就加标题时保存
  14428. return tag;
  14429. }
  14430. Hotspot.prototype.enlarge = function(){
  14431. var img = new Image;
  14432. img.src = this.img ? this.img.src : "images/default.jpg";
  14433. var outLayer = dom.id("spotLarge");
  14434. var imgBox = dom.cla("inner",outLayer)[0];
  14435. imgBox.appendChild(img);
  14436. var oldImg = dom.cla("replaceImg",this.elem)[0];
  14437. var rect = this.player.imgRect = oldImg.getBoundingClientRect();
  14438. dom.removeClass(outLayer,"hide")
  14439. imgBox.style.left = rect.left + "px";
  14440. imgBox.style.top = rect.top - (window.innerHeight - this.player.domElement.clientHeight) + "px";
  14441. imgBox.style.width = rect.width + "px";
  14442. imgBox.style.height = rect.height + "px";
  14443. setTimeout(function(){
  14444. var r1 = imgBox.clientWidth / imgBox.clientHeight;
  14445. var r2 = this.player.domElement.clientWidth/ this.player.domElement.clientHeight;
  14446. var percent = 0.95;
  14447. var naturalScale = 1.5;//不得大于natural的倍数
  14448. if( r1 >= r2 ){
  14449. var w = Math.min( this.player.domElement.clientWidth * percent, img.naturalWidth * naturalScale);
  14450. imgBox.style.width = w + "px";
  14451. imgBox.style.height = w / r1 + "px";
  14452. }else{
  14453. var h = Math.min( this.player.domElement.clientHeight * percent, img.naturalHeight * naturalScale);
  14454. imgBox.style.height = h + "px";
  14455. imgBox.style.width = h * r1 + "px";
  14456. }
  14457. imgBox.style.left = "50%";
  14458. imgBox.style.top = "50%";
  14459. dom.addClass(outLayer,"center");
  14460. }.bind(this),50)
  14461. }
  14462. Hotspot.prototype.setPosGets = function(posGets){
  14463. this.posGets = {list:[],length:2};
  14464. for(var i in posGets){
  14465. this.posGets[i] = new THREE.Vector3().fromArray(posGets[i]);
  14466. this.posGets.list.push(i);
  14467. }
  14468. }
  14469. /* Hotspot.prototype.computeHotPos = function(){//计算真实位置。采集和最终呈现的符合度和 采集的2点的符合度成正比。 原始版本 易于理解
  14470. var p1 = this.player.posGets[this.player.posGets.list[0]]; //得到的热点位置可能在mesh外而且很远,因为可视范围是比盒子要大的。
  14471. var p2 = this.player.posGets[this.player.posGets.list[1]];
  14472. var A = this.player.model.panos.index[this.player.posGets.list[0]].origin;
  14473. var B = this.player.model.panos.index[this.player.posGets.list[1]].origin;
  14474. var Fraction = algebra.Fraction;
  14475. var Expression = algebra.Expression;
  14476. var Equation = algebra.Equation;
  14477. var Num = function(num){if(num>0) return "+"+num; else return num;}
  14478. var a11 = algebra.parse("x" + Num(-A.x) +"=" +(p1.x-A.x)+"a");
  14479. var answer11 = a11.solveFor("x");//得到x的函数1,变量为a
  14480. var a12 = algebra.parse("x" + Num(-B.x) +"=" +(p2.x-B.x)+"b");
  14481. var answer12 = a12.solveFor("x");//得到x的函数2,变量为b
  14482. var eq = new Equation(answer11, answer12); //得到表达式,变量为a和b
  14483. var aOfb1 = eq.solveFor("a");//得到a的函数1,变量为b
  14484. var a21 = algebra.parse("z" + Num(-A.z) +"=" +(p1.z-A.z)+"a");
  14485. var answer21 = a21.solveFor("z");//得到z的函数1,变量为a
  14486. var a22 = algebra.parse("z" + Num(-B.z) +"=" +(p2.z-B.z)+"b");
  14487. var answer22 = a22.solveFor("z");//得到z的函数2,变量为a
  14488. var eq = new Equation(answer21, answer22);//得到表达式,变量为a和b
  14489. var aOfb2 = eq.solveFor("a");//得到a的函数2,变量为b
  14490. var eq2 = new Equation(aOfb1, aOfb2);//得到表达式,变量为b
  14491. var b = eq2.solveFor("b");//得到b
  14492. eq = eq.eval({//b代入表达式
  14493. b: b
  14494. });
  14495. var a = eq.solveFor("a");//得到a
  14496. eq = a11.eval({
  14497. a:a
  14498. });
  14499. var x = eq.solveFor("x").valueOf();
  14500. eq = a21.eval({
  14501. a:a
  14502. });
  14503. var z = eq.solveFor("z").valueOf();
  14504. var y = a * (p1.y-A.y) + A.y;
  14505. this.pos3d = new THREE.Vector3(x, y, z);
  14506. } */
  14507. //二维向量夹角
  14508. /* function angleTo(a,b){ var c = a.dot(b)/(a.length()*b.length()); return Math.acos(THREE.Math.clamp(c,-1,1))}
  14509. Hotspot.prototype.computeHotPos1 = function(){//取最大角度版本 并不是最正确的
  14510. var p1 = this.player.posGets[this.player.posGets.list[0]]; //得到的热点位置可能在mesh外而且很远,因为可视范围是比盒子要大的。
  14511. var p2 = this.player.posGets[this.player.posGets.list[1]];
  14512. var A = this.player.model.panos.index[this.player.posGets.list[0]].origin;
  14513. var B = this.player.model.panos.index[this.player.posGets.list[1]].origin;
  14514. var Fraction = algebra.Fraction;
  14515. var Expression = algebra.Expression;
  14516. var Equation = algebra.Equation;
  14517. var axis = ["x", "y", "z"];
  14518. var angles = [];
  14519. var minAngle;
  14520. for(var i=0;i<3;i++){
  14521. var AxisChosen = [];
  14522. for(var j=0;j<3;j++){
  14523. if(i!=j)AxisChosen.push(axis[j])
  14524. }
  14525. AxisChosen.push(axis[i]);
  14526. var v1 = new THREE.Vector2( p1[AxisChosen[0]] - A[AxisChosen[0]], p1[AxisChosen[1]] - A[AxisChosen[1]]);
  14527. var v2 = new THREE.Vector2( p2[AxisChosen[0]] - B[AxisChosen[0]], p2[AxisChosen[1]] - B[AxisChosen[1]]);
  14528. var angle = angleTo(v1, v2);
  14529. angles.push(angle);
  14530. console.log("角度"+AxisChosen[0] + AxisChosen[1] +": "+ angles[i]/Math.PI*180)
  14531. }
  14532. var mA = 0, index;
  14533. for(var i=0;i<3;i++){
  14534. if(angles[i]>mA) mA = angles[i], index = i;
  14535. }
  14536. if(mA<minAngle) console.log("最大角度为: "+mA/Math.PI*180+ ", 过小")
  14537. var AxisChosen = [];
  14538. for(var j=0;j<3;j++){
  14539. if(index!=j)AxisChosen.push(axis[j]);
  14540. }
  14541. AxisChosen.push(axis[index]);
  14542. console.log('选择面:'+ AxisChosen[0] + AxisChosen[1] +", 最大角度为: "+mA/Math.PI*180)
  14543. var results = [0,0,0];
  14544. var Num = function(num){if(num>0) return "+"+num; else return num;}
  14545. var a11 = algebra.parse("x" + Num(-A[AxisChosen[0]]) +"=" +(p1[AxisChosen[0]]-A[AxisChosen[0]])+"a");
  14546. var answer11 = a11.solveFor("x");//得到x的函数1,变量为a
  14547. var a12 = algebra.parse("x" + Num(-B[AxisChosen[0]]) +"=" +(p2[AxisChosen[0]]-B[AxisChosen[0]])+"b");
  14548. var answer12 = a12.solveFor("x");//得到x的函数2,变量为b
  14549. var eq = new Equation(answer11, answer12); //得到表达式,变量为a和b
  14550. var aOfb1 = eq.solveFor("a");//得到a的函数1,变量为b
  14551. var a21 = algebra.parse("z" + Num(-A[AxisChosen[1]]) +"=" +(p1[AxisChosen[1]]-A[AxisChosen[1]])+"a");
  14552. var answer21 = a21.solveFor("z");//得到z的函数1,变量为a
  14553. var a22 = algebra.parse("z" + Num(-B[AxisChosen[1]]) +"=" +(p2[AxisChosen[1]]-B[AxisChosen[1]])+"b");
  14554. var answer22 = a22.solveFor("z");//得到z的函数2,变量为a
  14555. var eq = new Equation(answer21, answer22);//得到表达式,变量为a和b
  14556. var aOfb2 = eq.solveFor("a");//得到a的函数2,变量为b
  14557. var eq2 = new Equation(aOfb1, aOfb2);//得到表达式,变量为b
  14558. var b = eq2.solveFor("b");//得到b
  14559. eq = eq.eval({//b代入表达式
  14560. b: b
  14561. });
  14562. var a = eq.solveFor("a");//得到a
  14563. eq = a11.eval({
  14564. a:a
  14565. });
  14566. results[0] = eq.solveFor("x").valueOf();
  14567. eq = a21.eval({
  14568. a:a
  14569. });
  14570. results[1] = eq.solveFor("z").valueOf();
  14571. var rest1 = a * (p1[AxisChosen[2]]-A[AxisChosen[2]]) + A[AxisChosen[2]];
  14572. var rest2 = b * (p2[AxisChosen[2]]-B[AxisChosen[2]]) + B[AxisChosen[2]];
  14573. results[2] = (rest1 + rest2) / 2;
  14574. this.pos3d = new THREE.Vector3;
  14575. for(var i=0;i<3;i++){
  14576. this.pos3d[AxisChosen[i]] = results[i];
  14577. }
  14578. console.log(this.pos3d);
  14579. } */
  14580. /* Hotspot.prototype.computeHotPos = function(){//取两线最短线段中心点 有问题
  14581. //this.computeHotPos1();
  14582. var p1 = this.player.posGets[this.player.posGets.list[0]]; //得到的热点位置可能在mesh外而且很远,因为可视范围是比盒子要大的。
  14583. var p2 = this.player.posGets[this.player.posGets.list[1]];
  14584. var A = this.player.model.panos.index[this.player.posGets.list[0]].origin;
  14585. var B = this.player.model.panos.index[this.player.posGets.list[1]].origin;
  14586. var line1 = p1.clone().sub(A);
  14587. var line2 = p2.clone().sub(B);
  14588. var verti = line1.clone().cross(line2);
  14589. var t1 = B.clone().sub(A).cross(line1).dot( verti ) / Math.pow(verti.length(),2);
  14590. var t2 = B.clone().sub(A).cross(line2).dot( verti ) / Math.pow(verti.length(),2);
  14591. var mid1 = line1.clone().multiplyScalar(t1).add(A);
  14592. var mid2 = line2.clone().multiplyScalar(t2).add(B);
  14593. this.pos3d = mid1.clone().add(mid2).multiplyScalar(0.5);
  14594. //此方法借用网上的
  14595. //source:https://blog.csdn.net/zyf_2014/article/details/52863677 }
  14596. //console.log(this.pos3d);
  14597. } */
  14598. var IsEqual = function(d1, d2) {
  14599. return (Math.abs(d1 - d2) < 1e-7)
  14600. }
  14601. var getAngle = function(cos){
  14602. return Math.acos(cos) * 180 / Math.PI
  14603. }
  14604. Hotspot.prototype.computeHotPos = function(){//取两线最短线段中心点 并且不能超出起点
  14605. var p1 = this.player.posGets[this.player.posGets.list[0]]; //得到的热点位置可能在mesh外而且很远,因为可视范围是比盒子要大的。
  14606. var p2 = this.player.posGets[this.player.posGets.list[1]];
  14607. var A = this.player.model.panos.index[this.player.posGets.list[0]].origin;
  14608. var B = this.player.model.panos.index[this.player.posGets.list[1]].origin;
  14609. //调试热点夹角
  14610. /* var line1 = p1.clone().sub(A).normalize();
  14611. var line2 = p2.clone().sub(B).normalize();
  14612. var cos1 = Math.abs( line1.dot(line2) );
  14613. var pano = this.player.model.panos.index[this.player.posGets.list[1]]
  14614. console.log("真实两线夹角: "+getAngle(cos1) +"("+ cos1+")"+""+"旧夹角min: "+getAngle(pano.recentAngleScore)+"("+pano.recentAngleScore+")");
  14615. *///----------
  14616. var ux = p1.x - A.x;
  14617. var uy = p1.y - A.y;
  14618. var uz = p1.z - A.z;
  14619. var vx = p2.x - B.x;
  14620. var vy = p2.y - B.y;
  14621. var vz = p2.z - B.z;
  14622. var wx = A.x - B.x;
  14623. var wy = A.y - B.y;
  14624. var wz = A.z - B.z;
  14625. var a = (ux * ux + uy * uy + uz * uz); //u*u
  14626. var b = (ux * vx + uy * vy + uz * vz); //u*v
  14627. var c = (vx * vx + vy * vy + vz * vz); //v*v
  14628. var d = (ux * wx + uy * wy + uz * wz); //u*w
  14629. var e = (vx * wx + vy * wy + vz * wz); //v*w
  14630. var dt = a * c - b * b;
  14631. var sd = dt;
  14632. var td = dt;
  14633. var sn = 0.0;//sn = be-cd
  14634. var tn = 0.0;//tn = ae-bd
  14635. var behind = function(index){ //在后方交点的话,直接其中一个点 不用两posget点中心点是因为可能从不同方位 距离很大
  14636. this.pos3d = (index==1 ? p1 : p2).clone();
  14637. console.log(this.pos3d+" 在后方交点,使用点"+index);
  14638. }
  14639. if(IsEqual(dt, 0.0))
  14640. {
  14641. //两直线平行
  14642. sn = 0.0; //在s上指定取s0
  14643. sd = 1.00; //防止计算时除0错误
  14644. tn = e; //按(公式3)求tc
  14645. td = c;
  14646. }else{
  14647. sn = (b * e - c * d);
  14648. tn = (a * e - b * d);
  14649. if (sn < 0.0) {
  14650. //最近点在s起点以外,同平行条件
  14651. behind(1); return;
  14652. sn = 0.0;
  14653. tn = e;
  14654. td = c;
  14655. }else if (sn > sd){ //超出终点不限制
  14656. /* //最近点在s终点以外(即sc>1,则取sc=1)
  14657. sn = sd;
  14658. tn = e + b; //按(公式3)计算
  14659. td = c; */
  14660. }
  14661. }
  14662. if (tn < 0.0 ){
  14663. //最近点在t起点以外
  14664. behind(2); return;
  14665. tn = 0.0;
  14666. if (-d < 0.0) sn = 0.0; //按(公式2)计算,如果等号右边小于0,则sc也小于零,取sc=0
  14667. else if (-d > a) sn = sd;//按(公式2)计算,如果sc大于1,取sc=1
  14668. else{
  14669. sn = -d;
  14670. sd = a;
  14671. }
  14672. }
  14673. /* else if (tn > td){ //超出终点不限制
  14674. tn = td;
  14675. if ((-d + b) < 0.0)
  14676. sn = 0.0;
  14677. else if ((-d + b) > a)
  14678. sn = sd;
  14679. else
  14680. {
  14681. sn = (-d + b);
  14682. sd = a;
  14683. }
  14684. } */
  14685. sc = 0.0;
  14686. tc = 0.0;
  14687. if (IsEqual(sn, 0.0)) sc = 0.0;
  14688. else sc = sn / sd;
  14689. if (IsEqual(tn, 0.0)) tc = 0.0;
  14690. else tc = tn / td;
  14691. var mid1 = new THREE.Vector3(A.x + sc * ux, A.y + sc * uy, A.z + sc * uz )
  14692. var mid2 = new THREE.Vector3(B.x + tc * vx, B.y + tc * vy, B.z + tc * vz )
  14693. this.pos3d = mid1.clone().add(mid2).multiplyScalar(0.5);
  14694. //console.log(this.pos3d)
  14695. //https://blog.csdn.net/u011511587/article/details/52063663 三维空间两直线/线段最短距离、线段计算算法
  14696. }
  14697. Hotspot.prototype.updateHotspot2dPos = function(){
  14698. if(!this.pos3d) return;
  14699. if(this.state == "drag") return;
  14700. if(this.elem.style.display == "none") return;
  14701. if(this.elem.parentElement.style.opacity == "0") return;
  14702. var pos3d = this.pos3d.clone().applyMatrix4(this.player.model.matrixWorld);
  14703. var camera = this.player.camera;
  14704. var modelViewMatrix = camera.matrixWorldInverse.clone();
  14705. var distance = this.player.position.distanceTo(pos3d);
  14706. var near = -camera.projectionMatrix.elements[14];//最开始飞入的时候是transitioning 也显示热点 所以还是不访问camera.near了
  14707. var matrix = new THREE.Matrix4().multiplyMatrices(camera.projectionMatrix,modelViewMatrix);
  14708. var pos3d2 = pos3d.applyMatrix4( matrix );
  14709. if(pos3d2.z<-near){//? 有<0但是应该显示的情况,遂改成更小的
  14710. dom.addClass(this.elem, "hide");
  14711. return;//不可被渲染,否则会出现另一个点
  14712. }
  14713. dom.removeClass(this.elem, "hide");
  14714. //floorplan(+2*near)的near:2.008/2 doll的 2.008 pano:0.20004
  14715. if(this.player.mode == "floorplan" || (this.player.mode =="transitioning" &&
  14716. (this.player.modeTran == "floorplan-dollhouse" || this.player.modeTran == "dollhouse-floorplan"))){
  14717. var x = pos3d2.x / (pos3d2.z+2.008);
  14718. var y = pos3d2.y / (pos3d2.z+2.008);
  14719. }else{
  14720. var x = pos3d2.x / (pos3d2.z+near );
  14721. var y = pos3d2.y / (pos3d2.z+near );
  14722. }
  14723. this.transformX = (x + 1)/2 * this.player.domElement.clientWidth;
  14724. //this.transformY = (1-(y + 1)/2) * this.player.domElement.clientHeight + (window.innerHeight - this.player.domElement.clientHeight);
  14725. this.transformY = (1-(y + 1)/2) * this.player.domElement.clientHeight;
  14726. var s;
  14727. /* if(this.state==="real" || this.state==="hover" )
  14728. if(pos3d2.z<=this.player.bound){
  14729. var s = this.player.k * pos3d2.z + this.player.max;
  14730. }else{
  14731. var s = 0.1/(pos3d2.z-this.player.bound+1) + this.player.min;
  14732. } */
  14733. /* if(this.state==="real" || this.state==="hover" ){
  14734. if(distance<=this.player.minD)
  14735. var s = this.player.max;
  14736. else var s = this.player.min + this.player.k * Math.pow(this.player.step, distance);
  14737. } */
  14738. if(this.state === "real"){
  14739. var s = this.scale1 * this.player.k / distance;
  14740. }else if( this.state === "hover" || this.state === "pin"){
  14741. var s = this.scale1 * this.scale2 * this.player.k / distance;
  14742. }
  14743. this.elem.style.transform = "translateX("+this.transformX + "px) translateY("+ this.transformY + "px) translateZ(0px)"
  14744. +((this.state==="real" || ((this.state==="hover"||this.state==="pin")&& s>this.scale1) ) ? (" scale("+s+","+s+")") : "");//如果hover/pin时是放大的继续放大,缩小的不缩小。因为由放大变成不放大会跳跃
  14745. }
  14746. var dom = t("dom");
  14747. var Tag = t('Tag');
  14748. var THREE = t('THREE');
  14749. e.exports = Hotspot;
  14750. },{
  14751. "dom" : "dom",
  14752. "Tag" : "123",
  14753. THREE: 217
  14754. }
  14755. ],
  14756. "Editor":[ //xzw
  14757. function(t, e){
  14758. var dom = t("dom");
  14759. var Hotspot = t("Hotspot");
  14760. var Toolbox = t('toolbox');
  14761. var ScrollBar = t('ScrollBar');
  14762. var List = t('List');
  14763. var editor = {
  14764. elem : dom.id('hotPointBox'),
  14765. //tipElem: dom.id('prompt_box'),
  14766. metaElem : dom.id("hotPoint_input"),
  14767. list: dom.id("list"),
  14768. modes:{},
  14769. scroller:{},
  14770. global:{}, //存储全局使用且名字单一的函数或变量,
  14771. selectList:{},
  14772. inputAreas:{}
  14773. }
  14774. editor.show = function(){
  14775. editor.elem.style.opacity = 1;
  14776. }
  14777. editor.hide = function(){
  14778. editor.elem.style.opacity = 0;
  14779. }
  14780. editor.tipWrite = function(t,type){
  14781. if(type === "warn"){
  14782. var old = this.tipElem.children[0].innerHTML;
  14783. editor.tipElem.children[0].innerHTML = t;
  14784. setTimeout(function(){
  14785. if(editor.tipElem.children[0].innerHTML == t){//如果还是未变
  14786. editor.tipElem.children[0].innerHTML = old;
  14787. }
  14788. },1500);
  14789. }else
  14790. this.tipElem.children[0].innerHTML = t;
  14791. }
  14792. //mode\edit面板按钮
  14793. editor.openPanel = function(index){//改
  14794. for(var i=0; i<4;i++){
  14795. if(i==index)$(".editor").children().eq(i+1).css("display", "block");
  14796. else $(".editor").children().eq(i+1).css("display", "none");
  14797. }
  14798. for(var i=0; i<4;i++){
  14799. if(i==index){
  14800. $(".toolBox_nav input").eq(i).addClass("toolBox-Top-input");
  14801. $(".toolBox_nav").addClass("toolBox_nav-left"+index+"");
  14802. }else{
  14803. $(".toolBox_nav input").eq(i).removeClass("toolBox-Top-input");
  14804. $(".toolBox_nav").removeClass("toolBox_nav-left"+i+"");
  14805. }
  14806. }
  14807. for(var i in editor.scroller){
  14808. editor.scroller[i].getOffset();
  14809. editor.scroller[i].moveKnot();
  14810. }
  14811. }
  14812. editor.cancelToDelSpot = function(e){
  14813. if(!this.player.sureToDel) return;
  14814. //if()
  14815. e && e.stopPropagation();
  14816. var sure = dom.cla("DelConfirm", this.player.sureToDel)[0];
  14817. dom.removeClass(sure,"open");
  14818. this.player.sureToDel = null;
  14819. }.bind(editor)
  14820. editor.msgBoxCount = 0;//用于判断当前是否有信息展示
  14821. editor.msgInfoCount = 0;
  14822. editor.showMsgBox = function(title,msg,o){//目前最多支持两个btn,且一般左边是确定,右边取消
  14823. var overlay = dom.cla("Zprompt-popupBox")[0];
  14824. var box = dom.id("msg",overlay);
  14825. var inner = dom.cla("Zprompt-main-false",overlay)[0];
  14826. var head = dom.cla("Ztitle",overlay)[0];
  14827. var footer = dom.cla("Zprompt-footer",overlay)[0];
  14828. var close = dom.cla("Zclose",overlay)[0];
  14829. var btns = [];
  14830. var funcs = [];
  14831. footer.innerHTML = "";
  14832. //btns[0] = dom.cla("confirm",overlay)[0];
  14833. //btns[1] = dom.cla("cancel",overlay)[0];
  14834. inner.innerHTML = msg;
  14835. head.innerHTML = title;
  14836. dom.removeClass(overlay,"hide");
  14837. dom.removeClass(box,"hide");
  14838. editor.msgBoxCount ++;
  14839. var over = false;
  14840. var hideFun;
  14841. var checkClick = function(e){
  14842. if(e.target == overlay){
  14843. hideFun();//或者cancel函数?
  14844. }
  14845. }
  14846. if(o && o.clickBlankToHide)dom.bind(document,"click",checkClick);
  14847. if(o == void 0 || o.btns == void 0){//如果没有btns,即使有funcs,也默认作什么都没有
  14848. o = {btns:["确定"]}
  14849. }
  14850. for(var i=0; i<o.btns.length; i++){
  14851. var a = document.createElement("a");
  14852. a.innerHTML = "<span>"+ o.btns[i] +"</span>"
  14853. footer.appendChild(a);
  14854. dom.addClass(a,"btn"+i);
  14855. btns[i] = a;
  14856. dom.removeClass(a,"hide");
  14857. funcs[i] = function(i){
  14858. return function(){
  14859. if(o.funcs&&o.funcs[i]) o.funcs[i]();
  14860. hideFun();
  14861. }
  14862. }(i)
  14863. dom.bind(btns[i],"click",funcs[i]);
  14864. }
  14865. hideFun = function(){//就是要放最后赋值
  14866. for(var j=0; j<2; j++){
  14867. if(funcs[j]) dom.unbind(btns[j],"click",funcs[j]);
  14868. }
  14869. dom.unbind(close,"click",hideFun);
  14870. dom.unbind(document,"click",checkClick);
  14871. editor.msgBoxCount --;
  14872. if(editor.msgBoxCount==0)dom.addClass(box,"hide");
  14873. if(editor.msgBoxCount + editor.msgInfoCount == 0)dom.addClass(overlay,"hide");
  14874. }
  14875. dom.bind(close,"click",hideFun);
  14876. }
  14877. editor.showInfo = function(o){ // ({result:true, title:"发布成功"});
  14878. var overlay = dom.cla("Zprompt-popupBox")[0];
  14879. var box = dom.id("Zinfo",overlay);
  14880. var title = dom.cla("Ztitle",overlay)[0];
  14881. title.innerText = o.title;
  14882. dom.removeClass(overlay,"hide");
  14883. dom.removeClass(box,"hide");
  14884. editor.msgInfoCount ++;
  14885. dom.addClass(box,"animate");
  14886. setTimeout(function(){
  14887. dom.removeClass(box,"animate");
  14888. dom.addClass(box,"hide");
  14889. editor.msgInfoCount --;
  14890. if(editor.msgBoxCount + editor.msgInfoCount == 0)dom.addClass(overlay,"hide");
  14891. },1020)
  14892. }
  14893. var checkLen = {
  14894. project_name1:function(val){
  14895. var project_name1 = $("#project-name1");
  14896. var len = $(".project-name input").val().length;
  14897. project_name1.attr("data-size",15 - len);
  14898. return len;
  14899. },
  14900. editor1:function(html){
  14901. var all = 200;
  14902. var len = 0;
  14903. var pFlag = false;
  14904. html.replace(/<p>/ig,function(){
  14905. if(!pFlag){ pFlag = true; }
  14906. else{ len += 8; }
  14907. })
  14908. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  14909. c = c.substring(1,c.length-1);
  14910. len +=c.length;
  14911. if(c != ""){
  14912. c.replace(/&nbsp;/ig,function(){
  14913. len -= 5;
  14914. });
  14915. }
  14916. })
  14917. var span = document.getElementById("project-intro1");
  14918. if(html == ''){all = 200};
  14919. span.setAttribute("data-size",all - len);
  14920. return all - len;
  14921. }
  14922. }//检测内容长度
  14923. //----热点描述-----
  14924. var editor1Enter = true;
  14925. var editor1 = new window.wangEditor('#forEdit1','#edit1');
  14926. editor1.customConfig.menus = ['link'];
  14927. editor1.customConfig.pasteFilterStyle = true;
  14928. editor1.customConfig.pasteIgnoreImg = true;
  14929. editor1.customConfig.pasteTextHandle = function (content) {
  14930. var move = '',bodyFlag = false,timeFlag = true;
  14931. content.replace(/<body([\s\S\r\n\.]*?)<\/body>/ig,function(d){
  14932. bodyFlag = true;
  14933. d = d.replace(/<[^>]+>/gi,function(c){
  14934. var aF = /<a([\s\S\r\n\.]*?)>/.test(c);
  14935. if( aF || c == '</a>'){ c = c }
  14936. else{ c = ''; }
  14937. return c;
  14938. })
  14939. move += d;
  14940. })
  14941. if(!bodyFlag){
  14942. content = content.replace(/<[^>]+>/gi,function(c){
  14943. var aF = /<a([\s\S\r\n\.]*?)>/.test(c);
  14944. if( aF || c == '</a>'){ c = c }
  14945. else{ c = ''; }
  14946. return c;
  14947. })
  14948. move += content;
  14949. }
  14950. move = move.replace(/\s+/g,'');
  14951. return move
  14952. } //修改复制内容
  14953. editor1.customConfig.onchange = function (htmlZ) {
  14954. var html = "";
  14955. var pNum = 0;
  14956. var pFlag = false;
  14957. htmlZ.replace(/<p>([\s\S\r\n\.]*?)<\/p>/gi,function(c){
  14958. if(pNum < 1){
  14959. html += c;
  14960. } else{
  14961. /* html = html.substring(0,html.length-4);
  14962. c = c.substring(3,c.length-4); */
  14963. html += c // + "</p>";
  14964. }
  14965. pNum ++;
  14966. pFlag =true;
  14967. });
  14968. if(!pFlag){
  14969. html = '<p>' + htmlZ + '</p>';
  14970. editor1.txt.html(html);
  14971. }
  14972. /* if(pNum > 1){
  14973. editor1.txt.html(html);
  14974. }
  14975. html = html.replace(/<p><br><\/p>|<br>/ig,'');*/
  14976. html = html.replace(/style="([\s\S\r\n\.]*?)"/ig,'');
  14977. var len = checkLen.editor1(html);
  14978. if(len < 0){
  14979. editor1Enter = false;
  14980. var span = document.getElementById("project-intro1");
  14981. span.setAttribute("data-size","超出字数限制");
  14982. span.classList.add("sizeWaring");
  14983. var now = 0;
  14984. var clear = false;
  14985. var nowHtml = "";
  14986. var pFlag = true;
  14987. html.replace(/<p>/gi,function(){
  14988. if(pFlag){ pFlag =false; }
  14989. else{
  14990. now += 8;
  14991. }
  14992. })
  14993. html = html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  14994. c = c.substring(1,c.length-1);
  14995. if(!clear){
  14996. var cLen = c.length;
  14997. now += cLen;
  14998. if(now < 201){
  14999. c.replace(/&nbsp;/ig,function(){
  15000. now -= 5;
  15001. });
  15002. }
  15003. //判断这一节点是否超过一百
  15004. if(now > 200){
  15005. var spilth = now - 200;
  15006. c = c.substring(0,c.length - spilth);
  15007. }//拼凑的内容大于100时取里面
  15008. }else{
  15009. c = "";
  15010. }
  15011. return '>'+c+'<';
  15012. })
  15013. } else{
  15014. editor1Enter = true;
  15015. var span = document.getElementById("project-intro1");
  15016. span.classList.remove("sizeWaring");
  15017. }
  15018. //document.getElementsByClassName("dsc")[0].innerHTML = html;
  15019. if(html == '<p><br></p>'){
  15020. editor.player.chosenSpot.billboard.changeDesc('');
  15021. }else{
  15022. editor.player.chosenSpot.billboard.changeDesc(html);
  15023. }
  15024. editor.exchangeTagForSave(editor.player.chosenSpot);
  15025. };
  15026. editor1.create();
  15027. $("#edit1").on("keydown",">div",function(ev){
  15028. if(ev.keyCode == 13 && !editor1Enter){
  15029. $(this).blur();
  15030. }
  15031. })
  15032. editor.addList = function(tag){
  15033. var li = document.createElement('li');
  15034. li.innerHTML = '<div class="left"><img class="typeHead" src="images/spots/'+ tag.type +'_small.png" alt="png"><span>' +tag.billboard.label+ '</span></div><div class="delete"></div>';
  15035. this.list.insertBefore(li, this.list.firstChild);
  15036. tag.listElem = li;
  15037. li.tag = tag;
  15038. li.player = this.player;
  15039. dom.bind(dom.cla("delete", li)[0], "click", function(e){//删除li 整个spot
  15040. e.stopPropagation();
  15041. if(this.player.sureToDel) editor.cancelToDelSpot();
  15042. //if(dom.hasClass(e.target, ))
  15043. var sure = dom.cla("DelConfirm",this);//确定删除按钮
  15044. if(!sure.length){
  15045. sure = document.createElement('div');
  15046. sure.innerHTML = '<div class="DelNo">取消</div> <div class="DelYes">删除</div>';
  15047. sure.className = "DelConfirm open";
  15048. this.insertBefore(sure, e.target);
  15049. dom.bind(sure.children[1], "click", function(e){//确定
  15050. e.stopPropagation();
  15051. editor.changePosCancel();
  15052. editor.deleteSpot(li.tag);
  15053. if(li.tag == li.player.needSaveTag) li.player.needSaveTag = null;
  15054. //li.player.spotImgsDelete.push(li.tag.sid);
  15055. li.tag.remove();
  15056. if(li.tag === li.player.chosenSpot){
  15057. li.player.chosenSpot = null;
  15058. }
  15059. $("#hotPoint_input").css({
  15060. "display": "none"
  15061. })
  15062. li.parentElement.removeChild(li); //删除元素前需要把这上面所有事件解除吗???
  15063. li.player.sureToDel = null;
  15064. editor.changeSnapState();
  15065. },true);
  15066. //取消部分见 cancelToDelSpot
  15067. /* var cancelFun = function(e){
  15068. }
  15069. dom.bind(sure.children[0],"click", cancelFun);
  15070. dom.bind(document, "click", function(e){
  15071. cancelFun(e);
  15072. dom.unbind(document, cancelFun);
  15073. }) */
  15074. }else{
  15075. dom.addClass(sure[0], "open");
  15076. }
  15077. this.player.sureToDel = li;
  15078. }.bind(li))
  15079. dom.bind(li,"click",function(e){
  15080. var player = this.player;
  15081. if(player.mode == "transitioning") return;//还未到inside模式 热点不能飞入
  15082. if(dom.hasClass(e.target,"DelNo")) return; //因为取消删除直接在cancelToDelSpot里绑定在更大范围的document了..
  15083. if(player.chosenSpot === this.tag) player.editor.closeList();
  15084. else{
  15085. var canOpen = player.editor.openList(this);
  15086. if(!canOpen) return;
  15087. player.flytoTag(tag,"force");
  15088. }
  15089. }.bind(li));
  15090. }
  15091. editor.closeList = function(){
  15092. var player = editor.player;
  15093. if(player.chosenSpot && player.chosenSpot.billboard.label==''){
  15094. //强调未命名
  15095. dom.addClass(editor.metaTitle.parentElement, "warn");
  15096. this.openPanel(0)
  15097. //console.log('未命名')
  15098. return false;//如果未命名 就无法关上
  15099. }
  15100. this.changePosCancel();
  15101. player.chosenSpot && dom.removeClass(player.chosenSpot.listElem, "open");
  15102. player.chosenSpot = null;
  15103. player.nokeyForSpotMeta = false;
  15104. $("#hotPoint_input").css({
  15105. "overflow":"hidden",
  15106. "max-height": "0",
  15107. "border":"none"
  15108. })
  15109. return true;
  15110. }.bind(editor);
  15111. editor.metaDisplayChange = function(tag){
  15112. dom.Tag("span",this.player.chosenSpot.listElem)[0].innerHTML = this.metaTitle.value || ("未命名");
  15113. editor.changeImgPreview(this.player.chosenSpot);
  15114. }
  15115. editor.changeImgPreview = function(spot){
  15116. var ImgPreview = dom.cla('ImgPreview',editor.metaImgInput.parentElement)[0];
  15117. var media = spot.billboard.media;
  15118. if(media.type == "photo"){
  15119. if(media.src)ImgPreview.style['background-image'] = 'url("'+ media.src +'")';
  15120. else ImgPreview.style['background-image'] = 'url("'+ media.img.src +'")';
  15121. ImgPreview.style.display = "block";
  15122. }else{
  15123. ImgPreview.style.display = "none";
  15124. }
  15125. }
  15126. editor.openList = function(li){
  15127. var player = li.player;
  15128. if(player.markspot || player.startGetPos) return false;
  15129. if(player.flying || player.flyingToTag) return false;
  15130. if(player.chosenSpot && li == player.chosenSpot.listElem){//已经打开
  15131. if(player.chosenSpot.billboard.label==''){
  15132. dom.addClass(editor.metaTitle.parentElement, "warn");
  15133. player.editor.openPanel(0);
  15134. }
  15135. return false;
  15136. }
  15137. var canClose = this.closeList();//如果原本有打开的先关上
  15138. if(!canClose) return false;
  15139. if(player.chosenSpot === li.tag) return;
  15140. player.chosenSpot = li.tag;
  15141. player.nokeyForSpotMeta = true;
  15142. player.editor.metaTitle.value = li.tag.billboard.label;
  15143. if(li.tag.billboard.description != ''){
  15144. editor1.txt.html(li.tag.billboard.description);
  15145. checkLen.editor1(li.tag.billboard.description);
  15146. }
  15147. else{
  15148. if (navigator.userAgent.indexOf('Firefox') >= 0) {
  15149. $('#edit1>div')[0].innerHTML = '';
  15150. }else{
  15151. $('#edit1>div')[0].innerHTML = '<p><br></p>';
  15152. }
  15153. checkLen.editor1('');
  15154. }
  15155. player.editor.metaSelect.find('p').text(li.tag.TypeToChinese());
  15156. dom.setIndex(player.editor.metaSelect.find('p')[0],li.tag.type);
  15157. player.editor.metaSelect.find('img')[0].src = "images/spots/"+li.tag.type + ".png";
  15158. player.editor.metaDisplayChange(li.tag);
  15159. player.editor.metaElem.parentElement.removeChild(player.editor.metaElem);
  15160. $(li).after(player.editor.metaElem);
  15161. dom.addClass(li,"open");
  15162. checkLen.project_name1();
  15163. //476
  15164. /* var maxScrollTop = 48 * $(li).index() + 88;
  15165. var minScrollTop = maxScrollTop + 354 + 48 - $(".editor .scrollBox .hotPointBox").height()
  15166. var scrollTop = dom.clamp($(".editor .scrollBox .hotPointBox")[0].scrollTop, minScrollTop, maxScrollTop)
  15167. */ var maxScrollTop = 48 * $(li).index();
  15168. var minScrollTop = maxScrollTop + 510 - $(".editor .scrollBox .hotPoint_list").height()
  15169. var scrollTop = dom.clamp($(".editor .scrollBox .hotPointBox")[0].scrollTop, minScrollTop, maxScrollTop)
  15170. setTimeout(function(){//延后
  15171. $("#hotPoint_input").css({
  15172. "display": "block",
  15173. "max-height": "800px",
  15174. "overflow":"unset",
  15175. "overflow":"visible",
  15176. //"overflow" : "visible",
  15177. "border":""
  15178. });
  15179. $(".editor .scrollBox .hotPoint_list")[0].scrollTop = scrollTop;
  15180. /* editor.scroller["hotSize1"].getOffset();
  15181. editor.scroller["hotSize1"].moveKnot();
  15182. editor.scroller["hotSize1"].setValueFromOutside(li.tag.scale1 * 100);
  15183. editor.scroller["hotSize2"].getOffset();
  15184. editor.scroller["hotSize2"].moveKnot();
  15185. editor.scroller["hotSize2"].setValueFromOutside(li.tag.scale2 * 100);
  15186. */ },10)
  15187. return true;
  15188. }.bind(editor);
  15189. editor.bind = function(player){
  15190. editor.player = player;
  15191. player.editor = editor;
  15192. this.snap = dom.id("hotPoint_button",editor.elem);
  15193. this.ok = dom.id("ok",editor.elem);
  15194. //this.select = dom.Tag("select",editor.elem)[0];
  15195. this.pointsElem = dom.id('snapPoint',editor.elem).children;
  15196. this.pointsElem2 = dom.id('listPoint',editor.elem).children;
  15197. this.changeBtn = dom.id('change',editor.elem);
  15198. player.k = 3;// 函数y=常数/x 这是最接近普通视觉大小和距离关系的函数了吧
  15199. this.player.hotspotDragBegin = function(e){//当还是markspot时
  15200. if(this.flying) return;
  15201. this.hotspotDrag.mouseinitX = e.clientX;
  15202. this.hotspotDrag.mouseinitY = e.clientY;
  15203. this.hotspotDrag.transformX = this.markspot.transformX;
  15204. this.hotspotDrag.transformY = this.markspot.transformY;
  15205. this.markspot.state = "drag";
  15206. dom.addClass(this.markspot.elem,"drag");
  15207. }.bind(this.player);
  15208. dom.bind(document, "click", this.cancelToDelSpot);
  15209. Data.sceneIndex = Data.sceneIndex || 0;//贴图风格
  15210. dom.addClass($(".styleZBox .styleZ_content ul").children()[Data.sceneIndex],"active");
  15211. this.snap.addEventListener( "click",function(){
  15212. if(player.mode!="panorama")return;
  15213. if(player.posGets.length>0){
  15214. //editor.tipWrite("当前正在定位热点,请先完成此热点的定位采集。","warn");
  15215. return;
  15216. }
  15217. var canClose = editor.closeList(); //热点未命名 无法关闭
  15218. if(!canClose)return;
  15219. //editor.tipWrite("热点位置计算需要得到两个位置中的定位点,现在请点击以进行第一次热点定位。");
  15220. editor.pointsElem[0].parentElement.style.display = "";
  15221. player.startGetPos = true;
  15222. //player.domElement.style.cursor = "crosshair";
  15223. player.domElement.style.cursor = 'url("images/crosshair.cur"), crosshair';
  15224. //this.style.color = "red";
  15225. dom.addClass(this,"unable");
  15226. player.reticule.visible = false;
  15227. })
  15228. this.ok.addEventListener("click",function(){
  15229. if(player.posGets.length == 2 && !player.flying){
  15230. this.style.display = "";
  15231. dom.unbind(player.markspot.elem, "mousedown",player.hotspotDragBegin); //这个热点无法再被拖拽
  15232. player.markspot.computeHotPos();
  15233. var tag = player.markspot.becomeReal();
  15234. //player.markspot.posGets = player.posGets;
  15235. editor.addList(tag);
  15236. editor.finish();
  15237. editor.openList(tag.listElem);
  15238. tag.obj3d.updateMatrixWorld();
  15239. player.flytoTag(tag,"force"); //如果一定fly到最近点 有可能最近点和两个标点不相邻 于是展开了却看不到热点。。。
  15240. }
  15241. })
  15242. var flyToThis2Pano = function(index){
  15243. if(player.posGets.length>index){
  15244. var to = player.model.panos.index[player.posGets.list[index]];
  15245. player.flyToPano({pano:to});
  15246. player.lookAtPos(player.markspot.pos3d, to.position);
  15247. //player.markspot.pos3d = player.posGets[player.posGets.list[index]];
  15248. }
  15249. }
  15250. this.setMarkspotDisplayNum = function(num){//初始为1,因为点击第一下后就是1
  15251. var elem = this.player.markspot.elem;
  15252. dom.removeClass(elem,"zero");
  15253. dom.removeClass(elem,"two");
  15254. if(num==0)dom.addClass(elem,"zero");
  15255. else if(num==2)dom.addClass(elem,"two");
  15256. }.bind(this);
  15257. var posElemClick = function(index, type){
  15258. var snap;
  15259. if(type == "snapPos"){
  15260. var pointsElem = this.pointsElem;
  15261. snap = true;
  15262. }else{
  15263. var pointsElem = this.pointsElem2;
  15264. }
  15265. return function(e){
  15266. if(this.player.mode!=="panorama" || this.player.flying)return;
  15267. if(!snap){//修改位置
  15268. if(this.player.markspot && !this.player.markspot.changePos ) return; //正在采集期间不可修改这个
  15269. if(!this.player.markspot){
  15270. if(this.player.tagManager.activeTag) this.player.tagManager.dismissActiveTag();
  15271. this.player.chosenSpot.disc.visible = false;
  15272. this.player.chosenSpot.state = "rebuildHide";
  15273. this.player.markspot = new Hotspot({pos3d : this.player.chosenSpot.position, player:this.player, type: this.player.chosenSpot.type })
  15274. var markspot = this.player.markspot;
  15275. markspot.changePos = true; //标记这个markspot是由于改位置临时产生的
  15276. for(var m in this.player.chosenSpot.posGets){
  15277. if(m == "list") this.player.posGets.list = this.player.chosenSpot.posGets.list.slice(0);
  15278. else this.player.posGets[m] = this.player.chosenSpot.posGets[m];
  15279. }
  15280. dom.bind(markspot.elem, "mousedown",this.player.hotspotDragBegin);
  15281. this.changeSnapState(false);//dom.addClass(this.snap,"unable");
  15282. this.player.reticule.visible = false;
  15283. this.changeBtn.style.display = "";//flex
  15284. //this.player.updateMarkerDisplay();
  15285. this.player.model.fadeMarkerOpacity(null,null,{player:this});
  15286. }
  15287. }
  15288. if(dom.hasClass(e.target,"delete")){//删除坐标点
  15289. if(this.player.posGets.length == 2){
  15290. pointsElem[1].style.display = "none";
  15291. this.setMarkspotDisplayNum(1);
  15292. snap && (this.ok.style.display = "none");
  15293. }else{
  15294. //this.pointsElem[0].style.display = "none";
  15295. //this.setMarkspotDisplayNum(0);
  15296. if(snap){
  15297. this.clearCollect(); return;//如果删除了仅剩下的一个坐标,就直接取消这轮采集
  15298. }else{
  15299. this.pointsElem[0].style.display = "none";
  15300. this.setMarkspotDisplayNum(0);
  15301. }
  15302. }
  15303. delete this.player.posGets[this.player.posGets.list[index]];
  15304. this.player.posGets.list.splice(index,1);
  15305. this.player.posGets.length -- ;
  15306. if(this.player.posGets.length){ //如果还剩下一个点 那么 pos3d要变成这个点的,否则还是原来真实位置。
  15307. if( this.player.currentPano.id == this.player.posGets.list[0]){
  15308. dom.addClass(pointsElem[0],"chosen");
  15309. }
  15310. else dom.removeClass(pointsElem[0],"chosen");
  15311. this.player.markspot.pos3d = this.player.posGets[ this.player.posGets.list[0] ].clone();
  15312. flyToThis2Pano(0);//飞向剩下的这点
  15313. var origin = this.player.model.panos.index[this.player.posGets.list[0]].position;
  15314. var end = this.player.posGets[ this.player.posGets.list[0] ];
  15315. this.player.disablePanoAtLine(origin,end)
  15316. }
  15317. return;
  15318. }
  15319. flyToThis2Pano(index);
  15320. }.bind(editor)
  15321. }.bind(editor)
  15322. for(var i=0; i<2; i++){//采集时点击坐标
  15323. dom.bind(this.pointsElem[i],"click",posElemClick(i,"snapPos"));
  15324. }
  15325. //============更改坐标操作==========
  15326. for(var i=0; i<2; i++){//点击坐标修改位置
  15327. dom.bind(this.pointsElem2[i],"click", posElemClick(i,"changePos"));
  15328. }
  15329. editor.changePosCancel = function(){
  15330. if(!this.player.markspot || !this.player.markspot.changePos ) return;
  15331. this.clearCollect();
  15332. for(var i=0; i<2; i++){
  15333. dom.removeClass(this.pointsElem2[i], "chosen");
  15334. }
  15335. this.changeBtn.style.display = "none";
  15336. this.pointsElem2[0].style.display = "";
  15337. this.pointsElem2[1].style.display = "";
  15338. this.changeSnapState(true);//dom.removeClass(this.snap,"unable");
  15339. //this.player.chosenSpot && (this.player.chosenSpot.elem.style.display = "");
  15340. this.player.chosenSpot && (this.player.chosenSpot.disc.visible = true, this.player.chosenSpot.state = "");//this.player.chosenSpot.show();
  15341. }
  15342. editor.changePosConfirm = function(){
  15343. if(this.player.posGets.length == 2 && !this.player.flying && !this.player.flyingToTag){
  15344. /* if(window.use1) this.player.markspot.computeHotPos1();
  15345. else */this.player.markspot.computeHotPos();
  15346. this.player.chosenSpot.rePos(this.player.markspot.pos3d);
  15347. this.player.chosenSpot.posGets = this.player.posGets;
  15348. editor.changePosCancel();//复制好坐标后,就和取消一样了
  15349. this.player.chosenSpot.obj3d.updateMatrixWorld();
  15350. this.player.flytoTag(this.player.chosenSpot,"force");
  15351. this.exchangeTagForSave(this.player.chosenSpot);
  15352. //this.changeBtn.style.display = "none";
  15353. //dom.addClass(this.snap,"unable");
  15354. }
  15355. }
  15356. dom.bind(this.changeBtn.children[0],'click', function(){//change pos
  15357. this.changePosConfirm();
  15358. }.bind(editor))
  15359. dom.bind(this.changeBtn.children[1],'click', function(){//cancel
  15360. this.changePosCancel();
  15361. }.bind(editor))
  15362. this.metaSelect = $("#select");
  15363. this.metaTitle = dom.Tag("input",this.metaElem)[0];
  15364. this.metaContain = dom.id("discrib",this.metaElem);
  15365. this.metaImgInput = dom.id("hotPoint_file",this.metaElem);
  15366. this.player.chosenSpot = null;
  15367. //============更改信息==========
  15368. var titleInput = function(e){
  15369. this.chosenSpot.billboard.changeLabel(e.target.value);
  15370. if(this.editor.metaTitle.clientHeight){//改标题
  15371. dom.Tag("span",this.chosenSpot.listElem)[0].innerHTML = e.target.value;
  15372. }
  15373. if(e.target.value != "") this.editor.exchangeTagForSave(this.chosenSpot);
  15374. }.bind(player);
  15375. dom.bind(this.metaTitle,"input",titleInput)
  15376. dom.bind(this.metaTitle,"change",function(e){
  15377. e.target.value = e.target.value.trim();
  15378. titleInput(e);
  15379. })
  15380. $(".hotPoint-titleInput").on("focus",function(){
  15381. $(".project-name").removeClass("warn");
  15382. })
  15383. $("#pjtName").on("focus",function(){
  15384. $(this).removeClass("empty_warn");
  15385. })
  15386. $(".selection").on("click",function(){
  15387. $(this).removeClass("empty_warn");
  15388. })
  15389. //----------信息面板的信息----------
  15390. dom.bind(dom.id("pjtName"),"input",function(e){
  15391. $(".model-title2").text(e.target.value || '四维看看');
  15392. })
  15393. dom.bind(dom.id("pjtName"),"change",function(e){
  15394. e.target.value = e.target.value.trim();//名称不允许前后有空格,但简介应该可以开头有空格?
  15395. $(".model-title2").text(e.target.value || '四维看看');
  15396. })
  15397. //---------地面标志大小======
  15398. this.scroller.floorLogoSize = new ScrollBar(dom.id('floorLogoSize'), dom.ifVoid(Data.floorLogoSize, 100),40,160,"floorLogoSize","%",function(s){
  15399. var s = s / 100;
  15400. editor.player.model.floorLogos[0].scale.set(s,s,s);
  15401. editor.player.model.floorLogos[1].scale.set(s,s,s);
  15402. })
  15403. //---------热点未展开大小======
  15404. /* this.scroller.hotSize1 = new ScrollBar(dom.id('hotSize1'), dom.ifVoid(Data.hotSize1, 100),50,150,"hotSize1","%",function(s){
  15405. var s = s / 100;
  15406. editor.player.chosenSpot.scale1 = s;
  15407. })
  15408. this.scroller.hotSize2 = new ScrollBar(dom.id('hotSize2'), dom.ifVoid(Data.hotSize2, 100),100,150,"hotSize2","%",function(s){
  15409. var s = s / 100;
  15410. editor.player.chosenSpot.scale2 = s;
  15411. })
  15412. */
  15413. var setLenthCheck = function(textArea,small){
  15414. this.textArea = textArea;
  15415. this.small = small;
  15416. this.max = parseInt(small.innerText);
  15417. if(textArea.nodeName.toUpperCase == "INPUT"){
  15418. dom.bind(textArea,"focus",function(){
  15419. dom.removeClass(this.small,"hide");
  15420. });
  15421. dom.bind(textArea,"blur",function(){
  15422. dom.addClass(this.small,"hide");
  15423. });
  15424. }else if(textArea.nodeName.toUpperCase == "DIV"){
  15425. dom.bind(textArea,"click",function(e){//focus
  15426. dom.removeClass(this.small,"hide");
  15427. }.bind(this))
  15428. dom.bind(document,"click",function(e){//blur
  15429. if(e.target == this.textArea) return;
  15430. dom.addClass(this.small,"hide");
  15431. }.bind(this));
  15432. }else console.log('错误的textArea类型');
  15433. dom.bind(textArea,"input",this.check);//Safari5.0以下版本,oninput 不支持 textarea 元素。
  15434. dom.bind(textArea,"propertychange",this.check);// IE9.0以下
  15435. /* dom.bind(textArea,"change",function(){ //结束输入时才将多出的字符删去
  15436. var count = max - textArea.value.length;
  15437. if(count<0){
  15438. textArea.value = textArea.value.slice(0,max);
  15439. count = 0;
  15440. }
  15441. dom.removeClass(small,"red");
  15442. small.innerText = count + "";
  15443. }) */
  15444. }
  15445. setLenthCheck.prototype.check = function(){
  15446. if(textArea.nodeName.toUpperCase == "INPUT"){
  15447. var count = this.max - this.textArea.value.length();
  15448. this.textArea.value = this.textArea.value.slice(0,this.max);
  15449. }else{
  15450. var count = this.max - this.textArea.innerHTML.length;
  15451. this.textArea.innerHTML = this.textArea.innerHTML.slice(0,this.max);
  15452. }
  15453. count = dom.clamp(count,0,this.max);
  15454. /* if(count<0){
  15455. dom.addClass(this.small,"red");
  15456. }else{
  15457. dom.removeClass(this.small,"red");
  15458. } */
  15459. this.small.innerText = count + "";
  15460. }
  15461. var checkLen = {
  15462. project_name1:function(val){
  15463. var project_name1 = $("#project-name1");
  15464. var len = $(".project-name input").val().length;
  15465. project_name1.attr("data-size",15 - len);
  15466. return len;
  15467. },
  15468. project_name2:function(val){
  15469. var project_name2 = $("#project-name2");
  15470. var len = $("#pjtName").val().length;
  15471. project_name2.attr("data-size",15 - len);
  15472. return len;
  15473. },
  15474. editor2:function(html){
  15475. var all = 200;
  15476. var len = 0;
  15477. var pFlag = false;
  15478. html.replace(/<p>/ig,function(){
  15479. if(!pFlag){ pFlag = true; }
  15480. else{ len += 8; }
  15481. })
  15482. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  15483. c = c.substring(1,c.length-1);
  15484. len +=c.length;
  15485. if(c != ""){
  15486. c.replace(/&nbsp;/ig,function(){
  15487. len -= 5;
  15488. });
  15489. }
  15490. })
  15491. var span = document.getElementById("project-intro2");
  15492. if(html == ''){all = 200};
  15493. span.setAttribute("data-size",all - len);
  15494. return all - len;
  15495. },
  15496. editor1:function(html){
  15497. var all = 200;
  15498. var len = 0;
  15499. var pFlag = false;
  15500. html.replace(/<p>/ig,function(){
  15501. if(!pFlag){ pFlag = true; }
  15502. else{ len += 8; }
  15503. })
  15504. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  15505. c = c.substring(1,c.length-1);
  15506. len +=c.length;
  15507. if(c != ""){
  15508. c.replace(/&nbsp;/ig,function(){
  15509. len -= 5;
  15510. });
  15511. }
  15512. })
  15513. var span = document.getElementById("project-intro1");
  15514. if(html == ''){all = 200};
  15515. span.setAttribute("data-size",all - len);
  15516. return all - len;
  15517. }
  15518. }//检测内容长度
  15519. /* $("#edit1").on("keydown",">div",function(ev){
  15520. if(ev.keyCode == 13){
  15521. $(this).blur();
  15522. }
  15523. })
  15524. */
  15525. var editor2Enter = true;
  15526. var editor2 = new window.wangEditor('#forEdit2','#edit2');
  15527. editor2.customConfig.menus = ['link'];
  15528. var editor2_dsc = document.getElementById("edit2").getAttribute("data-more") || "";
  15529. editor2.customConfig.pasteIgnoreImg = true;
  15530. editor2.customConfig.pasteTextHandle = function (content) {
  15531. var move = '',bodyFlag = false,timeFlag = true;
  15532. content.replace(/<body([\s\S\r\n\.]*?)<\/body>/ig,function(d){
  15533. bodyFlag = true;
  15534. d = d.replace(/<[^>]+>/gi,function(c){
  15535. var aF = /<a([\s\S\r\n\.]*?)>/.test(c);
  15536. if( aF || c == '</a>'){ c = c }
  15537. else{ c = ''; }
  15538. return c;
  15539. })
  15540. move += d;
  15541. })
  15542. if(!bodyFlag){
  15543. content = content.replace(/<[^>]+>/gi,function(c){
  15544. var aF = /<a([\s\S\r\n\.]*?)>/.test(c);
  15545. if( aF || c == '</a>'){ c = c }
  15546. else{ c = ''; }
  15547. return c;
  15548. })
  15549. move += content;
  15550. }
  15551. move = move.replace(/\s+/g,'');
  15552. return move
  15553. } //修改复制内容
  15554. editor2.customConfig.onchange = function (html) {
  15555. var pNum = 0;
  15556. var pFlag = false;
  15557. html.replace(/<p>([\s\S\r\n\.]*?)<\/p>/gi,function(c){
  15558. /* var html = ""; if(pNum < 1){
  15559. html += c;
  15560. } else{
  15561. html = html.substring(0,html.length-4);
  15562. c = '<br>' + c.substring(3,c.length-4);
  15563. html += c + "</p>";
  15564. }
  15565. pNum ++;
  15566. if(pNum > 1){
  15567. editor2.txt.html(html);
  15568. } */
  15569. pFlag =true;
  15570. });
  15571. if(!pFlag){
  15572. html = '<p>' + htmlZ + '</p>';
  15573. editor2.txt.html(html);
  15574. }
  15575. html = html.replace(/style="([\s\S\r\n\.]*?)"/ig,'');
  15576. var len = checkLen.editor2(html);
  15577. if(len < 0){
  15578. editor2Enter = false;
  15579. var span = document.getElementById("project-intro2");
  15580. span.setAttribute("data-size","超出字数限制");
  15581. span.classList.add("sizeWaring");
  15582. var now = 0;
  15583. var clear = false;
  15584. var nowHtml = "";
  15585. var pFlag = true;
  15586. html.replace(/<p>/gi,function(){
  15587. if(pFlag){ pFlag =false; }
  15588. else{
  15589. now += 8;
  15590. }
  15591. })
  15592. html = html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  15593. c = c.substring(1,c.length-1);
  15594. if(!clear){
  15595. var cLen = c.length;
  15596. now += cLen;
  15597. if(now < 201){
  15598. c.replace(/&nbsp;/ig,function(){
  15599. now -= 5;
  15600. });
  15601. }
  15602. //判断这一节点是否超过一百
  15603. if(now > 200){
  15604. var spilth = now - 200;
  15605. c = c.substring(0,c.length - spilth);
  15606. }//拼凑的内容大于100时取里面
  15607. }else{
  15608. c = "";
  15609. }
  15610. return '>'+c+'<';
  15611. })
  15612. }else{
  15613. editor2Enter = true;
  15614. var span = document.getElementById("project-intro2");
  15615. span.classList.remove("sizeWaring");
  15616. }
  15617. document.getElementsByClassName("introduce-detail")[0].getElementsByTagName("span")[0].innerHTML = html;
  15618. }; //实时监听
  15619. editor2.create();
  15620. editor2.txt.html(editor2_dsc);
  15621. $("#edit2").on("keydown",">div",function(ev){
  15622. if(ev.keyCode == 13 && !editor2Enter){
  15623. $(this).blur();
  15624. }
  15625. })
  15626. $("#edit1>div").on("focus",function(){
  15627. $("#edit1").css("border","1px solid #09e1c0");
  15628. })
  15629. $("#edit1>div").on("blur",function(){
  15630. $("#edit1").css("border","1px solid white");
  15631. })
  15632. $("#edit2>div").on("focus",function(){
  15633. $("#edit2").css("border","1px solid #09e1c0");
  15634. })
  15635. $("#edit2>div").on("blur",function(){
  15636. $("#edit2").css("border","1px solid white");
  15637. })
  15638. $(".project-name input").on("input",function(){
  15639. checkLen.project_name1();
  15640. });
  15641. $("#pjtName").on("input",function(){
  15642. checkLen.project_name2();
  15643. });
  15644. $("#edit2Box,#edit1Box").on("input",".addLink_input",function(){
  15645. var len = $(this).val().length;
  15646. $("#addLink-maxSize").text( 40 - len);
  15647. })
  15648. //----------输入框的输入时keydown不会触发player移动控制----
  15649. var allInputs = [];
  15650. allInputs.push($('.editor #pjtName')) //项目标题
  15651. allInputs.push($("#edit2>div")) //项目描述
  15652. allInputs.push($(".editor .hotPoint-titleInput")) //热点标题
  15653. allInputs.push($("#edit1>div")) //热点描述
  15654. allInputs.push($("#scenePSD input")) //密钥
  15655. //allInputs.push($('#edit2Box .w-e-panel-container input')) //链接输入写在控件js里
  15656. allInputs.push($(".slider input")) //滑动条输入
  15657. for(var i=0; i<allInputs.length;i++){
  15658. allInputs[i].on("focus", function(){window.keyCon = false;} )
  15659. allInputs[i].on("blur", function(){window.keyCon = true;} )
  15660. allInputs[i].on("keydown", function(e){
  15661. if(e.which == 33||e.which == 34){e.preventDefault();} //pageup pagedown 会页面抬升错乱
  15662. e.stopPropagation();
  15663. })
  15664. }
  15665. //============选择样式==========
  15666. var listBind = function(select ){
  15667. select.find("#styleBtn").click(function (ev) {
  15668. ev.stopPropagation();
  15669. if(select.hasClass("open") ){
  15670. select.removeClass('open');
  15671. }else {
  15672. select.addClass('open');
  15673. }
  15674. });
  15675. $(document).click(function (event) {
  15676. select.removeClass('open');
  15677. });
  15678. var index;
  15679. for (var i = 0; i < $("#select ul li").length; i++) {
  15680. (function (i) {
  15681. select.find("ul li")[i].onclick = function () {
  15682. index = i;
  15683. var text = select.find("ul li").eq(index).text();
  15684. var type = dom.getIndex(select.find("ul li").eq(index)[0]);
  15685. dom.setIndex(select.find("p")[0], type);
  15686. select.find("p").text(text);
  15687. select.find('img')[0].src = "images/spots/"+ type + "_small.png";
  15688. this.chosenSpot.setElemType(type);
  15689. this.editor.exchangeTagForSave(this.chosenSpot);
  15690. dom.cla("typeHead",this.chosenSpot.listElem)[0].src = "images/spots/"+type+"_small.png";
  15691. }.bind(player)
  15692. })(i);
  15693. }
  15694. }
  15695. listBind( this.metaSelect ); //换超链接类型
  15696. //============上传图==========
  15697. function dataURLtoBlob(dataurl) {
  15698. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  15699. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  15700. while(n--){
  15701. u8arr[n] = bstr.charCodeAt(n);
  15702. }
  15703. return new Blob([u8arr], {type:mime});
  15704. }
  15705. dom.bind(this.metaImgInput,"change",function(ev){
  15706. if (!window.FileReader) {
  15707. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>您的浏览器不支持上传图片</span>'); return;
  15708. error_dialog("提示","您的浏览器不支持上传图片");
  15709. return;
  15710. }
  15711. else if (ev.target.files.length===0)return;
  15712. if(ev.target.files[0].size/1024/1024 > 3){ //图片越大,要×的1.024这个值会越偏大一些些,即无法准确得到图是几M的
  15713. //editor.showMsgBox("提示",'图片不得大于3M');
  15714. error_dialog("提示","图片不得大于3M");
  15715. return;
  15716. }
  15717. var reader = new FileReader();
  15718. //reader.name = ev.target.files[0].name;
  15719. var spot = this.chosenSpot.elem;
  15720. reader.onload = function(evt){
  15721. var img = new Image();
  15722. var imgType = evt.target.result.slice(0,17).indexOf("png") ? "png" : "jpeg";
  15723. var blob = dataURLtoBlob(evt.target.result)
  15724. img.src = window.URL.createObjectURL(blob);
  15725. img.base64Src = evt.target.result;
  15726. img.onload = function(e){//这时img才有宽高,才能赋予texture宽高
  15727. if(spot != this.chosenSpot.elem) return; //万一加载太久转到别的spot就不好啦
  15728. var elem = this.chosenSpot.elem;
  15729. this.chosenSpot.imgNeedSave = true;
  15730. //var imgs = dom.cla("replaceImg",elem);
  15731. var png = ResizeImg(e.target, {weight:blob.size, maxWeight: 0.5*1024*1024, oldType:imgType, maxSize:1480});//最大500k
  15732. //this.chosenSpot.img = png;
  15733. //imgs[0].src = png.src;
  15734. //imgs[0].base64Src = png.base64Src;
  15735. this.chosenSpot.billboard.changeImg(png);
  15736. this.chosenSpot.base64Src = png.base64Src;
  15737. this.editor.changeImgPreview( this.chosenSpot );
  15738. this.editor.exchangeTagForSave(this.chosenSpot);
  15739. }.bind(this)
  15740. }.bind(this)
  15741. reader.readAsDataURL(ev.target.files[0]);
  15742. this.editor.metaImgInput.value = "";
  15743. }.bind(player))
  15744. var scaleImg = t("scaleImg");
  15745. var ResizeImg = function(img, option){
  15746. var img2; //不能直接改img 否则可能触发第二次img.onload
  15747. var compress = function(ratio,type){
  15748. var image = img2 || img;
  15749. var c = document.createElement('canvas');
  15750. c.width = image.width; c.height = image.height;
  15751. var ctx = c.getContext('2d');
  15752. ctx.drawImage(image,0,0,image.width,image.height);
  15753. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  15754. }
  15755. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  15756. var image = img2 || img;
  15757. var blob = dataURLtoBlob(image.src);
  15758. if(option.maxWeight && blob.size > option.maxWeight){
  15759. compress(option.maxWeight/blob.size, "jpeg")
  15760. blob = dataURLtoBlob(image.src);
  15761. }
  15762. if(!img2){
  15763. img2 = new Image();
  15764. }
  15765. img2.base64Src = image.src;
  15766. img2.src = window.URL.createObjectURL(blob);
  15767. }
  15768. var oldSize = Math.max(img.width, img.height);
  15769. if(option.toType != "png"){//不是非要png的话
  15770. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  15771. if(oldSize > option.maxSize){
  15772. compress(option.maxSize/oldSize, "jpeg");
  15773. }
  15774. reCom();
  15775. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  15776. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  15777. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  15778. reCom();
  15779. }
  15780. }
  15781. }else{
  15782. //?貌似png会越压缩越大?
  15783. }
  15784. return img2 || img;
  15785. }
  15786. if(Data.thumbImg){//初始化thumbImgPreview
  15787. var preview = $("#setEntry .ImgPreview")[0];
  15788. preview.style.display = "block";
  15789. var src = Data.imgRoot + CONSTANT.THUMBPIC+"?m=" + Data.version;
  15790. preview.style["background-image"] = 'url("'+ src +'")';
  15791. }
  15792. //---------保存初始视角并且截图------------
  15793. if(Data.thumbImg==1&&Data.entry && Data.entry.panoId){//初始化EntryPreview
  15794. var preview = dom.cla("ImgPreview",dom.id("setEntry"))[0];
  15795. preview.style.display = "block";
  15796. var src = Data.imgRoot + CONSTANT.THUMBPIC+"?m=" + Data.version //var src = Data.imgRoot + "entry.jpg?" +"" + Data.version
  15797. preview.style["background-image"] = 'url("'+ src +'")';
  15798. //dom.removeClass(dom.id('useEntry'),"hide");
  15799. }
  15800. player.thumbImg = Data.thumbImg;
  15801. var screenShot = function(o){
  15802. if(player.flying || player.flyingToTag || player.mode != "panorama") return;
  15803. var R = player.sceneRenderer;
  15804. var flash = dom.cla("snapshotFlash",dom.id("player"))[0];
  15805. // dom.addClass(dom.cla("snapshot",fdageUI)[0],"unable");
  15806. dom.addClass(flash,"active");
  15807. R.updateScreenSize(o);
  15808. for(var i in player.model.panos.index){
  15809. player.model.panos.index[i].marker.forceHide = player.model.panos.index[i].marker.visible;
  15810. player.model.panos.index[i].marker.visible = false;
  15811. }
  15812. player.tagManager.hideAlltags();
  15813. player.reticule.visible = false;
  15814. player.reticule.forceUnvisible = true;
  15815. player.model.floorLogos[0].visible = false;
  15816. player.model.floorLogos[1].visible = false;
  15817. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  15818. R.renderer.clear(true,true,true);
  15819. R.renderer.render(R.scene, R.camera);
  15820. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  15821. o.f && o.f(imgData)
  15822. //player.resize();
  15823. R.updateScreenSize({resize:true});
  15824. //player.markerHide = false;
  15825. player.reticule.visible = true;
  15826. player.tagManager.showAlltags();
  15827. player.model.floorLogos[0].visible = true;
  15828. player.model.floorLogos[1].visible = true;
  15829. for(var i in player.model.panos.index){
  15830. player.model.panos.index[i].marker.visible = player.model.panos.index[i].marker.forceHide;
  15831. }
  15832. R.renderer.render(R.scene, R.camera);
  15833. },30) //这个数字不能太小
  15834. setTimeout( function(){
  15835. dom.removeClass(flash,"active");
  15836. },1050)
  15837. }
  15838. var _fixType=function(type) {
  15839. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  15840. var r = type.match(/png|jpeg|bmp|gif/)[0];
  15841. return 'image/' + r;
  15842. };
  15843. var setEntryPreview = function(){
  15844. player.setEntry();
  15845. screenShot({/* width:160*9, height:114*9, */ width:256*10, height:128*10, type:"image/jpeg", f:function(imgData){
  15846. imgData.replace(_fixType("image/jpeg"),'image/octet-stream');
  15847. player.thumbBigImg = imgData;
  15848. var img = new Image();
  15849. img.src = imgData;
  15850. img.onload = function(){
  15851. var png = ResizeImg(this,{maxSize: 256*4, oldType:"jpeg"}); //暂定缩略图大小
  15852. var preview = dom.cla("ImgPreview",dom.id("setEntry"))[0];
  15853. player.thumbSmallImg = png.base64Src;
  15854. preview.style.display = "block";
  15855. preview.style["background-image"] = 'url("'+ png.src +'")';
  15856. player.thumbImg = true;
  15857. }
  15858. }});
  15859. editor.finishSetEntry();
  15860. }
  15861. var setSnapElemDisplay = function(open){
  15862. var snapElem = dom.cla("snapshotGui",dom.id('webgl'))[0];
  15863. if( open != false){
  15864. dom.removeClass(snapElem,"hide");
  15865. setTimeout(function(){snapElem.style.opacity = "1"; },10)
  15866. }else{
  15867. snapElem.style.opacity = "0";
  15868. setTimeout(function(){dom.addClass(snapElem,"hide"); },200)
  15869. }
  15870. }
  15871. var toSetEntry = function(){
  15872. var done;
  15873. if(player.mode != "panorama"){
  15874. var panoramaBtn = dom.id('hotPoint');
  15875. done = editor.global.inside(null,{fuc:setSnapElemDisplay, dontTurnToHot:true})
  15876. }else{
  15877. setSnapElemDisplay(); done = true;
  15878. }
  15879. if(done){
  15880. setEntryBtn.innerHTML = "取消";
  15881. player.thumbNeedSave = true;//player.entryImgNeedSave = true;
  15882. dom.unbind(setEntryBtn,"click",toSetEntry);
  15883. dom.bind(setEntryBtn,"click",editor.finishSetEntry);
  15884. }
  15885. }
  15886. var setEntryBtn = dom.Tag("label",dom.id("setEntry"))[0] ;
  15887. dom.bind(setEntryBtn,"click",toSetEntry)
  15888. var confirmSnap = dom.cla("confirmSnap",dom.id('webgl'))[0];
  15889. dom.bind(confirmSnap,"click",setEntryPreview)
  15890. dom.bind(confirmSnap,"mouseover", function(){
  15891. var snapElem = dom.cla("snapshotGui",dom.id('webgl'))[0];
  15892. dom.addClass(snapElem,"highLight");
  15893. })
  15894. dom.bind(confirmSnap,"mouseout", function(){
  15895. var snapElem = dom.cla("snapshotGui",dom.id('webgl'))[0];
  15896. dom.removeClass(snapElem,"highLight");
  15897. })
  15898. editor.finishSetEntry = function(){
  15899. setSnapElemDisplay(false);
  15900. setEntryBtn.innerHTML = "点击设置";
  15901. dom.unbind(setEntryBtn,"click",editor.finishSetEntry);
  15902. dom.bind(setEntryBtn,"click",toSetEntry);
  15903. //dom.removeClass(dom.id('useEntry'),"hide");
  15904. }
  15905. /* dom.bind(dom.id('useEntry'),"click", function(){
  15906. editor.finishSetEntry();
  15907. player.thumbImg = player.entryImg.slice(0);
  15908. player.thumbUseEntry = true; //就会用它的url entryImg.jpg...
  15909. player.thumbNeedSave = true;
  15910. }) */
  15911. //---------类别======
  15912. var typeIndex = [1,2,3,4,5,0];//0标定为其他 以后若有增加就从6开始,删除的类型继续保留数字
  15913. //var typeName = ["文博","地产","电商","餐饮","家居","其他"];
  15914. var setMetaType = function(){//初始化作品信息的类别
  15915. var select = dom.cla("selection", dom.id("type"))[0];
  15916. var o = {initOption:"请点击选择", option: CONSTANT.SCENETYPE[ typeIndex.indexOf(Data.sceneType) ], noCallback:true};
  15917. //mulChosedlistBind(list,hasOnArray, select,3)//list,onArray, select, max,fuc
  15918. var fuc = function(type){
  15919. $(".introduce-button img")[0].src = "images/type/"+ typeIndex[CONSTANT.SCENETYPE.indexOf(type)] +".svg";
  15920. }
  15921. $(".introduce-button img")[0].src = "images/type/"+ (Data.sceneType || 0) +".svg";
  15922. editor.selectList.type = new List(CONSTANT.SCENETYPE,select,fuc,o);
  15923. }
  15924. setMetaType();
  15925. //---------私密设置======
  15926. //初始化:
  15927. function Mode(ul,funcs,index){ //多选模式按钮的设置 这里主要用于密钥设置
  15928. this.ul = ul;
  15929. this.funcs = funcs;
  15930. if(index!=void 0) this.setMode(index);
  15931. for(var i=0;i<this.ul.children.length;i++){
  15932. dom.bind(this.ul.children[i], "click", (function(i){
  15933. return function(e){
  15934. if(dom.hasClass(e.target,'chosen')) return;
  15935. this.setMode(i);
  15936. this.funcs[i] && this.funcs[i]();
  15937. }.bind(this)
  15938. }.bind(this)(i)))
  15939. }
  15940. }
  15941. Mode.prototype.setMode = function(index){
  15942. for(var i=0;i<this.ul.children.length;i++){
  15943. dom.removeClass(this.ul.children[i],"chosen")
  15944. }
  15945. dom.addClass(this.ul.children[index],"chosen")
  15946. }
  15947. Mode.prototype.getMode = function(){
  15948. for(var i=0;i<this.ul.children.length;i++){
  15949. if(dom.hasClass(this.ul.children[i],"chosen")) return i;
  15950. }
  15951. }
  15952. //var btn = dom.cla("button",dom.id('scenePSD'))[0];
  15953. var initPsd = function(psd){ //密钥初始化
  15954. var ul = dom.cla("MenuOptions",dom.id('scenePSD'))[0];
  15955. var funcs = [function(){
  15956. var word = dom.cla("word",dom.id('scenePSD'))[0];
  15957. dom.addClass(word,"hide");
  15958. //dom.removeClass(btn,"hide");
  15959. },function(){
  15960. var word = dom.cla("word",dom.id('scenePSD'))[0];
  15961. dom.removeClass(word,"hide");
  15962. //checkInput();
  15963. }]
  15964. var mode = new Mode(ul,funcs)
  15965. if(psd && psd!=''){
  15966. dom.Tag("input",dom.id('scenePSD'))[0].value = psd;
  15967. mode.ul.children[1].click();
  15968. }else{//公开
  15969. mode.setMode(0);
  15970. }
  15971. editor.modes.psd = mode;
  15972. }
  15973. /* var getPsd = $.ajax({
  15974. url: "scene/setkey",//??????
  15975. type: 'POST',
  15976. dataType: "json",
  15977. data:{num: window.number},
  15978. success: function(data) {
  15979. initPsd(data)
  15980. },
  15981. error: function(msg) {
  15982. initPsd();
  15983. console.log(msg)
  15984. }
  15985. }); */
  15986. var psdInput = dom.Tag("input",dom.id('scenePSD'))[0]
  15987. var checkInput = function(){
  15988. var reg = /[a-zA-Z0-9]*/g; //抽取字母和数字
  15989. var a = psdInput.value.match(reg);
  15990. psdInput.value = a.join('').slice(0,4);
  15991. /* if(psdInput.value.length == 4){//显示确定按钮
  15992. dom.removeClass(btn,"hide");
  15993. } */
  15994. }
  15995. dom.bind(psdInput, "input", checkInput);
  15996. dom.bind(psdInput, "propertychange", checkInput)// IE9.0以下
  15997. initPsd(Data.scenePsd);
  15998. //---------热点图放大的关闭按钮======
  15999. /* var outLayer = dom.id("spotLarge");
  16000. var imgBox = dom.cla("inner",outLayer)[0];
  16001. //var close = dom.cla("close",outLayer)[0];
  16002. dom.bind(outLayer,"click",rebackSize.bind(this));
  16003. function rebackSize(e){
  16004. //if(e.target == imgBox)return;
  16005. imgBox.style.left = this.player.imgRect.left + this.player.imgRect.width/2 + "px";
  16006. imgBox.style.top = this.player.imgRect.top - (window.innerHeight - this.player.domElement.clientHeight) + "px";
  16007. imgBox.style.width = 1 + "px";
  16008. imgBox.style.height = 1 + "px";
  16009. setTimeout(function(){
  16010. dom.addClass(outLayer,"hide");
  16011. imgBox.innerHTML = "";
  16012. dom.removeClass(outLayer,"center");
  16013. },520)
  16014. }
  16015. */
  16016. //---------还有些别的事件写在toolbox里======
  16017. Toolbox(editor, player);
  16018. //=========保存==========
  16019. //changeDesc的保存不一定对
  16020. editor.exchangeTagForSave = function(needSaveTag){ //在更改热点信息、点保存按钮时会触发
  16021. var t = $.Deferred();
  16022. if(this.player.needSaveTag && this.player.needSaveTag != needSaveTag){
  16023. editor.saveSingleSpot(this.player.needSaveTag,t);
  16024. }else t.resolve();
  16025. this.player.needSaveTag = needSaveTag;
  16026. return t.promise();
  16027. }
  16028. var saveDone = function(tag, t){ //保存完单个热点
  16029. tag.imgNeedSave = false;
  16030. t.resolve();
  16031. }
  16032. editor.saveSingleSpot = function(tag, t){ //保存单个热点
  16033. var spot = {
  16034. "label" : tag.billboard.label,
  16035. "description" : tag.billboard.description,
  16036. "position" : tag.position,
  16037. "type" : tag.type,
  16038. "posGets" : {},
  16039. "sid" : tag.sid
  16040. }
  16041. for(var p in tag.posGets){
  16042. if(p == "length" || p == "list")continue;
  16043. spot.posGets[p] = tag.posGets[p].toArray();
  16044. }
  16045. if(tag.billboard.media.type == "photo"){
  16046. if(tag.imgNeedSave) spot.media = {"base64": tag.billboard.media.img.base64Src, type:"photo"};
  16047. else spot.media = {type:"photo"};
  16048. }
  16049. var form_data = new FormData();
  16050. form_data.append("sceneNum", number);//场景序号
  16051. form_data.append("hotData", JSON.stringify(spot));
  16052. form_data.append("childName", Data.CAMERA_ID);//相机名称
  16053. //console.log(spot);
  16054. $.ajax({
  16055. type: "POST",
  16056. url: "edit/saveHot",
  16057. data: form_data,
  16058. cache: false,
  16059. processData: false,
  16060. contentType: false,
  16061. success: function(data){
  16062. saveDone(tag, t);
  16063. },
  16064. error: function(data){
  16065. t.reject();
  16066. }
  16067. });
  16068. }
  16069. editor.deleteSpot = function(tag){ //删除热点
  16070. var form_data = new FormData();
  16071. form_data.append("sceneNum", number);//场景序号
  16072. form_data.append("index", tag.sid);
  16073. form_data.append("childName", Data.CAMERA_ID);//相机名称
  16074. $.ajax({
  16075. type: "POST",
  16076. url: "edit/deleteHot",
  16077. data: form_data,
  16078. cache: false,
  16079. processData: false,
  16080. contentType: false,
  16081. success: function(data){
  16082. },
  16083. error: function(data){
  16084. }
  16085. });
  16086. }
  16087. //this.save = dom.id("toolTop_save");
  16088. editor.save = function(publishFuc){//保存
  16089. //保存进度条出现 画面变暗禁止操作
  16090. $('.waiting').addClass('showloading');
  16091. var data = {};//没用了
  16092. var data1 = {};
  16093. var sceneDec = document.getElementsByClassName("introduce-detail")[0].getElementsByTagName("span")[0].innerHTML;
  16094. var psd = editor.modes['psd'].getMode() && psdInput.value;
  16095. data1.sceneName = dom.id("pjtName").value;
  16096. data1.sceneDec = sceneDec;
  16097. data1.scenePsd = psd ? psd : "";
  16098. data1.sceneType = typeIndex[ CONSTANT.SCENETYPE.indexOf(dom.cla("selection", dom.id("type"))[0].innerText) ] || 0;
  16099. data1.sceneIndex = $(".styleZBox .styleZ_content ul").find(".active").index();
  16100. if(player.thumbNeedSave){
  16101. data1.thumbBigImg = player.thumbBigImg;
  16102. data1.thumbSmallImg = player.thumbSmallImg;
  16103. }
  16104. if(player.fLogoNeedSave){
  16105. data1.floorLogoImg = player.floorLogoImg;
  16106. }
  16107. data1.designImg = editor.getDesignImg();//wallImg
  16108. data1.floorLogo = (player.floorLogoImg || Data.floorLogo =="1" || Data.floorLogo == 1) ? 1 : 0;
  16109. data1.thumbImg = (player.thumbImg==true ||player.thumbImg =="1" || player.thumbImg == 1) ? 1 : 0;
  16110. data1.floorLogoSize = this.player.model.floorLogos[0].scale.x * 100;
  16111. if(!Data.version)Data.version = 0;
  16112. ++Data.version;
  16113. data1.version = Data.version;
  16114. //data1.version = (new Date()).getTime()+"";//Data.version;
  16115. data1.currentPanoId = player.currentPano.id;
  16116. if(player.EntryInfo){
  16117. data1.entry = { panoId: player.EntryInfo[0],
  16118. quaternion: player.EntryInfo[1].toArray(),
  16119. lon:player.EntryInfo[2],
  16120. lat:player.EntryInfo[3]}
  16121. }else if(Data.entry){
  16122. data1.entry = Data.entry;
  16123. }
  16124. var Done = function(){ //保存成功以后
  16125. //画面恢复
  16126. //记录图片等数据修改的变量归0
  16127. //editor.showMsgBox("保存成功","您的场景保存成功。</span>",{btns:["确定"],funcs:[]});
  16128. $('.waiting').removeClass('showloading');
  16129. for(var i=0; i<player.hotspots.length; i++){
  16130. player.hotspots[i].imgNeedSave = false;
  16131. }
  16132. //player.spotImgsDelete = [];
  16133. player.thumbNeedSave = false;
  16134. player.fLogoNeedSave = false;
  16135. if(publishFuc && (publishFuc instanceof Function)){
  16136. //editor.showMsgBox("确定发布","<span style='text-align:center'>是否确定发布?</span>",{btns:["确定","取消"],funcs:[publishFuc]});
  16137. //success_dialog_double('确定发布','是否确定发布?',publishFuc);
  16138. publishFuc();
  16139. }else{
  16140. editor.showInfo({result:true, title:"保存成功"});
  16141. }
  16142. }
  16143. editor.exchangeTagForSave().then(function(){
  16144. var t = $.Deferred();
  16145. layer.dataUtil.saveEditInfo(data,data1,t);
  16146. return t.promise();
  16147. }).done(Done).fail(
  16148. //function(o){if(o instanceof Function)o(); else editor.showMsgBox("确定发布","<img src='images/prompt-false.png' alt='png'><span>"+o+ "</span>",{btns:["确定"]});}
  16149. function(o){
  16150. if(o instanceof Function)
  16151. o();
  16152. else
  16153. error_dialog("提示",o);
  16154. $('.waiting').removeClass('showloading');
  16155. }
  16156. );
  16157. }
  16158. editor.getDesignImg = function() {//获取保存墙面图
  16159. //this.fullScreen();
  16160. var canvas = document.getElementById('dynamiccanvas2d');
  16161. if(!autodraw)
  16162. {
  16163. return null;
  16164. }
  16165. // 图片导出为 png 格式
  16166. var type = 'png';
  16167. var imgData = canvas.toDataURL(type);
  16168. //上传到服务器
  16169. return imgData;
  16170. };
  16171. //window.location.href = 'show.html?m='+number;
  16172. //不知道提前写会不会防止markspot加载背景图延迟
  16173. var markspotImg = new Image;
  16174. markspotImg.src = "images/markspotAll.png";
  16175. }
  16176. editor.changeSnapState = function(state){//热点采集数量显示变化
  16177. //CONSTANT.MAX_SPOT_COUNT = 2;
  16178. var count = function(){
  16179. if(editor.player.tagManager.tagDiscs.length>=CONSTANT.MAX_SPOT_COUNT){
  16180. editor.snap
  16181. dom.addClass(editor.snap,"unable");
  16182. $(editor.snap).find("span").text("已满"+ CONSTANT.MAX_SPOT_COUNT +"个")
  16183. }else{
  16184. $(editor.snap).find("span").text("新增热点")
  16185. if(state!=false)dom.removeClass(editor.snap,"unable");
  16186. }
  16187. }
  16188. if(state){
  16189. dom.removeClass(editor.snap,"unable");
  16190. count();
  16191. }else if(state == false){
  16192. dom.addClass(editor.snap,"unable");
  16193. //count();
  16194. }else if(state == void 0){
  16195. count();
  16196. }
  16197. }
  16198. editor.finish = function(){//热点采集结束 收尾 归位
  16199. this.setMarkspotDisplayNum(1);
  16200. this.pointsElem[0].style.display = "none";
  16201. this.pointsElem[1].style.display = "none";
  16202. this.player.markspot = null;
  16203. this.player.posGets = {};
  16204. //this.select.style.display = "none";
  16205. //this.snap.style.color = "";
  16206. this.changeSnapState(true);//dom.removeClass(this.snap,"unable");
  16207. this.player.reticule.visible = true;
  16208. //dom.removeClass(this.player.domElement,"grab");
  16209. this.ok.style.display = "";
  16210. this.player.cancelPanoDisable();
  16211. }
  16212. editor.clearCollect = function(){//放弃选点 清除
  16213. if(this.player.startGetPos){
  16214. this.player.startGetPos = false; this.player.domElement.style.cursor = ""; dom.addClass(this.pointsElem[0],'chosen');
  16215. }
  16216. if(!this.player.markspot) return;
  16217. this.player.markspot.elem.parentNode.removeChild(this.player.markspot.elem);
  16218. this.player.allHotspots.pop();
  16219. this.finish();
  16220. }
  16221. editor.global.enablePanel = function(){// 初始飞入后解禁
  16222. dom.removeClass($(".pinBottom.left")[0],"unable");
  16223. /* dom.removeClass($(".hotPointBox")[0],"unable");
  16224. dom.removeClass($(".informationBox")[0],"unable");
  16225. dom.removeClass($(".toolBox")[0],"unable"); */
  16226. dom.removeClass($(".editor")[0],"unable");
  16227. dom.removeClass($(".toolTop")[0],"unable");
  16228. }
  16229. var a = document.getElementsByTagName('input');
  16230. for(var i=0; i<a.length;i++){a.draggable = false;}
  16231. e.exports = editor;
  16232. },{
  16233. "dom": "dom",
  16234. "Hotspot":"Hotspot",
  16235. "toolbox":"toolbox",
  16236. "ScrollBar":"ScrollBar",
  16237. "List":"List"
  16238. }
  16239. ],
  16240. "toolbox":[function(t, e){//改 加 内有保存发布、 图片上传裁剪功能
  16241. e.exports = function(editor, player){
  16242. var dom = t("dom");
  16243. function controlBox() {
  16244. $(".controlBox").css("display", "block");
  16245. setTimeout(function () {
  16246. $(".controlBox").css("opacity", "1");
  16247. }, 0);
  16248. $(".controlBox a").click(function () {
  16249. $(".controlBox").css("opacity", "0");
  16250. setTimeout(function () {
  16251. $(".controlBox").css("display", "none");
  16252. }, 1000);
  16253. })
  16254. } //控件窗口
  16255. var saveFuc = function(publishFuc){
  16256. //要一次性展示
  16257. if($("#pjtName").val() == ""){
  16258. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>请填写 信息 —— 项目名称!</span>',{btns:["返回填写"]})
  16259. error_dialog("提示","请完善项目信息!");
  16260. $("#information").click();
  16261. $("#pjtName").addClass("empty_warn");
  16262. }else if(editor.selectList.type.getValue()=="请点击选择"){
  16263. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>请选择 信息 —— 类别!</span>',{btns:["返回选择"]})
  16264. error_dialog("提示","请完善项目信息!");
  16265. $("#information").click();
  16266. $(".selection").addClass("empty_warn");
  16267. }else if(player.chosenSpot && player.chosenSpot.billboard.label == ""){
  16268. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>请填写 热点 —— 标题!</span>',{btns:["返回填写"],funcs:[]})
  16269. error_dialog("提示","请填写热点标题!");
  16270. $("#hotPoint").click();
  16271. dom.addClass(editor.metaTitle.parentElement, "warn");
  16272. }else if(editor.modes.psd.getMode() == 1 && $("#scenePSD .word input")[0].value.length!=4){
  16273. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>信息 —— 密码要4位字符!</span>',{btns:["设为公开,并保存","返回设置"]
  16274. // ,funcs:[function(){$("#scenePSD .MenuOptions>*")[0].click(); saveFuc(publishFuc); }]})
  16275. error_dialog("提示","场景密码必须4位!");
  16276. $("#information").click();
  16277. }
  16278. //else if(!editor.player.thumbImg && Data.thumbImg){
  16279. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>初始画面未设置。</span>',{btns:["确定"]});
  16280. //}
  16281. else{
  16282. if(publishFuc instanceof Function) window.newOpen_link = window.open('loading.html');
  16283. editor.save(publishFuc);
  16284. }
  16285. }
  16286. var publishFuc = function(){
  16287. $('.waiting').addClass('showloading');
  16288. $.ajax({
  16289. url:"edit/publishScene",
  16290. type: 'POST',
  16291. dataType: "json",
  16292. data : {sceneNum: window.number,childName: Data.CAMERA_ID},
  16293. success: function (data) {
  16294. if(data && (data==1 || data=="1")){
  16295. error_dialog("提示",'发布成功!');
  16296. if(newOpen_link)newOpen_link.location.href = 'show.html?m='+number;
  16297. else console.log('窗口为空,被拦截?')
  16298. }else{
  16299. error_dialog("提示",'发布失败!');
  16300. setTimeout(function(){
  16301. if(newOpen_link)newOpen_link.close();
  16302. },500)
  16303. }
  16304. $('.waiting').removeClass('showloading');
  16305. },
  16306. error: function (msg) {
  16307. console.log('发布失败');
  16308. if(newOpen_link)newOpen_link.close();
  16309. $('.waiting').removeClass('showloading');
  16310. }
  16311. });
  16312. }
  16313. $("#toolTop_save").click(saveFuc);
  16314. $("#toolTop_publish").click(function(){
  16315. //saveFuc(publishFuc);
  16316. success_dialog_double('确定发布','是否确定发布?',function(){saveFuc(publishFuc)});
  16317. });
  16318. $("#toolTop_exit").click(function(){
  16319. //editor.showMsgBox("退出提示","是否保存场景?",{btns:["确定"],funcs:
  16320. success_dialog_double('退出','是否确定退出?',function(){window.location.href = 'index.html'; });
  16321. })
  16322. $(function () {
  16323. $(".function li").click(function(){
  16324. $("#draw_Tools li").find("a").removeClass("draw_Tools-a");
  16325. });
  16326. $("#draw_Tools li").click(function(){
  16327. $("#draw_Tools li").find("a").removeClass("draw_Tools-a");
  16328. $(this).find("a").addClass("draw_Tools-a");//画墙一栏选中状态
  16329. })
  16330. /* $(".function li:eq(0) img,.function li:eq(0) span").click(function () {
  16331. $(".noteBox").css("display", "block");
  16332. setTimeout(function () {
  16333. $(".noteBox").css("opacity", "1");
  16334. }, 0);
  16335. });
  16336. $(".noteBox a").click(function () {
  16337. $(".noteBox").css("opacity", "0");
  16338. setTimeout(function () {
  16339. //$(".noteBox").css("display", "none");
  16340. var textid = $("#noteInput_text")[0].dirName;
  16341. if(textid!=null)
  16342. {
  16343. layer.deleteVector(textid);
  16344. layer.control.refreshCanvas = true;
  16345. }
  16346. }, 1000);
  16347. }) //标签属性框 */
  16348. })
  16349. $(function(){
  16350. /* $(".prompt-popup a").click(function(){
  16351. $(".prompt-popupBox").css("display","none");
  16352. }) */
  16353. var order;
  16354. $('#information_file').click(function(){
  16355. $(".myAccount-cutAvatar-main>div:last").css("display","none");
  16356. $(".myAccount-cutAvatar-main>div:first").removeClass("logo-cutAvatar");
  16357. $(".myAccount-cutAvatar-top>span").text("裁剪缩略图");
  16358. initCropper($('#myAccount-cutAvatar-img'),$('#information_file'),16/8);
  16359. order = 1;
  16360. })
  16361. $('#information_logo_file').click(function(){
  16362. $(".myAccount-cutAvatar-main>div:last").css("display","block");
  16363. $(".myAccount-cutAvatar-main>div:first").addClass("logo-cutAvatar");
  16364. $(".myAccount-cutAvatar-top>span").text("裁剪地面标志");
  16365. initCropper($('#myAccount-cutAvatar-img'),$('#information_logo_file'),1);
  16366. order = 2;
  16367. })
  16368. $('#myAccount-cutAvatar-submit').click(function(){
  16369. if(order == 1){order =1}else if(order == 2){order = 2};
  16370. $('.myAccount-cutAvatar').css("display","none");crop(order);
  16371. })
  16372. //裁剪框
  16373. $(".myAccount-cutAvatar-top a").click(function(){
  16374. $('.myAccount-cutAvatar').css("display","none");
  16375. })
  16376. })
  16377. var initCropper = function (img, input,Ratio){
  16378. var radius;if(Ratio == 1){radius = '50%'} else {radius = '0px'};
  16379. var $image = img;
  16380. var options = {
  16381. aspectRatio: Ratio, // 纵横比
  16382. viewMode: 0,
  16383. preview: '.myAccount-cutAvatar-img-preview' // 预览图的class名
  16384. };
  16385. $image.cropper(options);
  16386. var $inputImage = input;
  16387. var uploadedImageURL;
  16388. if (URL) {
  16389. // 给input添加监听
  16390. $inputImage.change(function () {
  16391. editor.finishSetEntry();
  16392. var files = this.files;
  16393. var file;
  16394. if (!$image.data('cropper')) {
  16395. return;
  16396. }
  16397. if (files && files.length) {
  16398. file = files[0];
  16399. // 判断是否是图像文件
  16400. if (/^image\/\w+$/.test(file.type)) {
  16401. // 如果URL已存在就先释放
  16402. if (uploadedImageURL) {
  16403. URL.revokeObjectURL(uploadedImageURL);
  16404. }
  16405. uploadedImageURL = URL.createObjectURL(file);
  16406. // 销毁cropper后更改src属性再重新创建cropper
  16407. $image.cropper('destroy').attr('src', uploadedImageURL).cropper(options);
  16408. $inputImage.val('');
  16409. $(".myAccount-cutAvatar").css("display","block");
  16410. } else {
  16411. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>请选择一个图像文件!</span>');
  16412. error_dialog("提示","请选择一个图像文件!");
  16413. }
  16414. var T = setInterval(function(){
  16415. var flag = $(".myAccount-cutAvatar-main span:first").hasClass("cropper-view-box");
  16416. if(flag){
  16417. $(".cropper-view-box").css("borderRadius",radius);clearInterval(T);
  16418. }
  16419. },5)
  16420. }
  16421. });
  16422. } else {
  16423. $inputImage.prop('disabled', true).addClass('disabled');
  16424. }
  16425. }
  16426. function dataURLtoBlob(dataurl) {
  16427. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  16428. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  16429. while(n--){
  16430. u8arr[n] = bstr.charCodeAt(n);
  16431. }
  16432. return new Blob([u8arr], {type:mime});
  16433. }
  16434. var scaleImg = t("scaleImg");
  16435. var crop = function(order){
  16436. if(order == 1){id = $('#showInformation')}
  16437. else {id = $('#showInformationLogo')};
  16438. var $image = $('#myAccount-cutAvatar-img');
  16439. var $target = id;
  16440. var canvas = $image.cropper('getCroppedCanvas');
  16441. var size = order==1 ? 160 : 512;
  16442. var png = scaleImg(size/canvas.width, canvas,'jpeg');
  16443. png.base64Src = png.src;
  16444. var blob = dataURLtoBlob(png.src);
  16445. png.src = window.URL.createObjectURL(blob);
  16446. $target.css('background-image', "url('"+png.src+"')");
  16447. $target.css("display","block");
  16448. if(order == 1){
  16449. player.thumbImg = png.base64Src;
  16450. player.thumbNeedSave = true;
  16451. }else{
  16452. player.floorLogoImg = png.base64Src;
  16453. player.fLogoNeedSave = true;
  16454. png.onload = function(){
  16455. player.model.changeFloorLogo({"image":this});
  16456. /* var t = new THREE.Texture(png);
  16457. t.needsUpdate=!0;
  16458. player.model.floorLogo.material.uniforms.map.value = t;
  16459. player.model.floorLogo.material.needsUpdate=!0;
  16460. */
  16461. }
  16462. }
  16463. return png;
  16464. };
  16465. }
  16466. }, {
  16467. "dom": "dom",
  16468. "scaleImg":"scaleImg"
  16469. }
  16470. ],
  16471. 116: [function(e, t, i) {///js/main.js
  16472. (function(t) {
  16473. "use strict";
  16474. var editor = e("Editor");
  16475. var dom = e("dom");
  16476. //layer && (layer.editor = editor);
  16477. window.Data || (window.Data = {})
  16478. Data.imgRoot = "images/images" + number + "/"; //+'/hot/';
  16479. //Data.imgRoot2 = "http://4dkk.4dage.com/FDKKIMG/";
  16480. Data.imgRoot2 = "images/"; //+'/hot/';
  16481. window.ifTest = window.location.href.substring(window.location.href.indexOf("?")+1).indexOf('test')>-1;
  16482. window.keyCon = true;//当编辑输入框被focus时不能keydown控制相机
  16483. //Data.spotImgRoot = prefix + "images/images" + number + "/"; //+'/hot/'; //到底是要读7牛的还是本地的呢 伤脑筋哦
  16484. Data.spotImgRoot = "images/images" + number + "/"; //+'/hot/';
  16485. var checkLen = { //HB
  16486. project_name1:function(val){
  16487. var project_name1 = $("#project-name1");
  16488. var len = $(".project-name input").val().length;
  16489. project_name1.attr("data-size",15 - len);
  16490. return len;
  16491. },
  16492. project_name2:function(val){
  16493. var project_name2 = $("#project-name2");
  16494. var len = $("#pjtName").val().length;
  16495. project_name2.attr("data-size",15 - len);
  16496. return len;
  16497. },
  16498. editor2:function(html){
  16499. var all = 200;
  16500. var len = 0;
  16501. var pFlag = false;
  16502. html.replace(/<p>/ig,function(){
  16503. if(!pFlag){ pFlag = true; }
  16504. else{ len += 8; }
  16505. })
  16506. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  16507. c = c.substring(1,c.length-1);
  16508. len +=c.length;
  16509. if(c != ""){
  16510. c.replace(/&nbsp;/ig,function(){
  16511. len -= 5;
  16512. });
  16513. }
  16514. })
  16515. var span = document.getElementById("project-intro2");
  16516. if(html == ''){all = 200};
  16517. span.setAttribute("data-size",all - len);
  16518. return all - len;
  16519. },
  16520. editor1:function(html){
  16521. var all = 200;
  16522. var len = 0;
  16523. var pFlag = false;
  16524. html.replace(/<p>/ig,function(){
  16525. if(!pFlag){ pFlag = true; }
  16526. else{ len += 8; }
  16527. })
  16528. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  16529. c = c.substring(1,c.length-1);
  16530. len +=c.length;
  16531. if(c != ""){
  16532. c.replace(/&nbsp;/ig,function(){
  16533. len -= 5;
  16534. });
  16535. }
  16536. })
  16537. var span = document.getElementById("project-intro1");
  16538. if(html == ''){all = 200};
  16539. span.setAttribute("data-size",all - len);
  16540. return all - len;
  16541. }
  16542. }//检测内容长度
  16543. function i() {
  16544. var e = Y.getModelIDFromQueryString(); //读取后缀
  16545. if (!e)
  16546. return b(null, "loading-failed");
  16547. var t = Y.parseSidUrl(e)
  16548. , i = l()
  16549. , a = c()
  16550. , s = o()
  16551. , u = V.quickstart.enabled
  16552. , g = null
  16553. , m = null
  16554. , v = null
  16555. , w = null
  16556. , T = null
  16557. , x = null
  16558. , S = null
  16559. , M = null
  16560. , R = null
  16561. , P = null
  16562. , O = null
  16563. , L = null
  16564. , N = new ue;
  16565. r(s);
  16566. /* h({ //MP开头写法
  16567. urlBase: t.urlBase
  16568. }).then...... */
  16569. $.ajax("data/"+window.number+"/someData.json",{dataType: "json"}).done( function(e){ //改
  16570. e.files.templates[0] = e.files.templates[0].replace("{{number}}",window.number);
  16571. window.MP_PREFETCHED_MODELDATA = e;
  16572. h({
  16573. urlBase: t.urlBase
  16574. }) //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  16575. }).then(function(i) {
  16576. return re.init(),
  16577. d(t, e) //getModel and load
  16578. }).then(function(e) {
  16579. return P = e,
  16580. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  16581. startSource: i,
  16582. autoplay: V.autoplay,
  16583. quickstart: u
  16584. }),
  16585. P.urls.init() //加载file,但是不需要了
  16586. }).then(function() {
  16587. return P.loadPanos()
  16588. }).then(function() {
  16589. m = X.getStartCameraOptions(P, P.panos), //设置初始视角
  16590. S = A(P),
  16591. O = y(u, m.mode),
  16592. v = O.controls,
  16593. w = O.player,
  16594. T = O.director,
  16595. x = O.tagManager,
  16596. M = O.tileDownloader,
  16597. R = O.qualityManager,
  16598. L = O.panoRenderer,
  16599. C(P, S, O, s),
  16600. P.supportsTiles && M.start(),
  16601. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  16602. u = !1);
  16603. var e = null;
  16604. if (u) {//qust = 1
  16605. de.warn("Quickstart engaged. Hold on to your knickers.");
  16606. var t = v.controls[D.PANORAMA];
  16607. g = new ie(R,S.scene,S.camera,t,s),
  16608. _(S, s, P),
  16609. e = g.load(m).then(function() {
  16610. S.addComponent(g),
  16611. S.once(le.AfterRender, function() {
  16612. de.warn("First render after quickstart load finished.")
  16613. })
  16614. })
  16615. }
  16616. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  16617. }).then(function() {
  16618. return f(P, U.onProgress, i, !u, a)
  16619. }).then(function() {
  16620. if (m.quickstart = u,
  16621. I(P, S, O, s),
  16622. S.started || _(S, s, P),
  16623. H.modelLoaded(P, w, v, V.autoplay),
  16624. E(w, P, m, V.autoplay).done(function() {
  16625. T.autoTour()
  16626. }),
  16627. !P.supportsTiles) {
  16628. var e = new Z(P,w);
  16629. e.start()
  16630. }
  16631. u && (S.removeComponent(g),
  16632. g.destroy(),
  16633. m.pano.enter()),
  16634. U.init(P, T, w, v, S, m, H.getSessionId()),
  16635. U.endLoading(P, T, x),
  16636. S.once(le.AfterRender, function() {
  16637. N.setAppReadyTime();
  16638. var e = N.calcFullLoadingTime();
  16639. de.warn("Total load time: " + e / 1e3),
  16640. H.loadComplete(e),
  16641. de.warn("First render after model load finished.")
  16642. console.log(O)
  16643. editor.bind(w);
  16644. }),
  16645. S.on(le.MemoryUsageUpdated, n)
  16646. }).fail(b.bind(this, e))
  16647. }
  16648. function loadAllInfo(fuc){ //加 xzw 所有请求按顺序加载
  16649. window.loadInfoTime = window.loadInfoTime ? window.loadInfoTime+1 : 1;
  16650. console.log("第"+window.loadInfoTime+"次加载信息");
  16651. getFirstData().then(checkLogin).then(getData).then( GetThumbImg ).then(fuc).fail(function(){
  16652. if(window.loadInfoTime < 3) loadAllInfo(fuc);
  16653. else {
  16654. y.error("getInfo-failed");
  16655. setTimeout(function(){
  16656. window.location.href = "404.html";
  16657. },8000)
  16658. }
  16659. });
  16660. }
  16661. function checkLogin(){ //加 xzw 是否登陆
  16662. var t = $.Deferred();
  16663. $.ajax({
  16664. url:"camera/isLogin",
  16665. type: 'POST',
  16666. data : {num: window.number},
  16667. success: function (data) {
  16668. if(data && data!="0"){
  16669. Data.CAMERA_ID = data;
  16670. //startLoad();
  16671. t.resolve();
  16672. }else{
  16673. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>您没有登录,请登录后再编辑</span>');
  16674. error_dialog_double('提示','您没有登录,请登录后再编辑',function(){
  16675. window.open(CONSTANT.MAINURL,"blank")
  16676. });
  16677. y.endLoading("forceQuit");//进度条等消失
  16678. //t.reject();
  16679. }
  16680. },
  16681. error: function (msg) {
  16682. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>您没有登录,请登录后再编辑</span>');
  16683. error_dialog_double('提示','您没有登录,请登录后再编辑',function(){
  16684. window.open(CONSTANT.MAINURL,"blank")
  16685. });
  16686. y.endLoading("forceQuit");
  16687. //t.reject();
  16688. }
  16689. });
  16690. return t.promise();
  16691. }
  16692. function getFirstData(){//首次编辑的数据是拍摄时的数据 要比getData前加载 //加 xzw
  16693. var t = $.Deferred();
  16694. $.ajax({
  16695. url:"scene/getInfo",
  16696. type: 'POST',
  16697. dataType: "json",
  16698. data : {num: window.number},
  16699. success: function (data) {
  16700. if(data && data!="0"){
  16701. window.Data = $.extend(Data,data);
  16702. if(parseInt(Data.status) == 0){
  16703. window.location.href = "404.html?m=wait"+"&m="+window.number;//模型正在计算
  16704. return;
  16705. }else if(parseInt(Data.status) == -1) {
  16706. window.location.href = "404.html?m=404";//无
  16707. return;
  16708. }//1 or undefine都继续执行
  16709. Data.version = parseInt(data.version || 0);
  16710. var createTime = Data.createTime;
  16711. $(".model-title").text(Data.sceneName || '四维看看');
  16712. $(".model-title2").text(Data.sceneName || '四维看看');
  16713. $("#pjtName")[0].value = Data.sceneName || '';
  16714. $('.introduce-detail span')[0].innerHTML = Data.sceneDec;//直接text()会得不到<a>这类HTML文字
  16715. $(".show_count").text(Data.shootCount);
  16716. $(".show_data").text(createTime);
  16717. $("#edit2").attr('data-more',Data.sceneDec || '');
  16718. Data.sceneType = parseInt(Data.sceneType);
  16719. if(layer.editor.selectList["type"]){//有的话说明selectList["type"]先于Data.SCENETYPE
  16720. var typeIndex = [1,2,3,4,5,0];//0标定为其他 以后若有增加就从6开始,删除的类型继续保留数字
  16721. //var typeName = ["文博","地产","电商","餐饮","家居","其他"];
  16722. var type = CONSTANT.SCENETYPE[typeIndex.indexOf(Data.sceneType)];
  16723. if(type) layer.editor.selectList["type"].selectFromOutSide(type);
  16724. }
  16725. t.resolve();
  16726. }else{
  16727. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>数据加载失败 错误代码firstData</span>');
  16728. console.log("数据1加载失败");
  16729. t.reject();
  16730. }
  16731. },
  16732. error: function (msg) {
  16733. console.log("数据1加载失败");
  16734. t.reject();
  16735. }
  16736. });
  16737. return t.promise();
  16738. }
  16739. function getData(){//加 xzw 场景名称等数据加载
  16740. var t = $.Deferred();
  16741. $.ajax(ifTest?"data/scene.json?m="+(new Date()).getTime() : "data/data"+number+"/scene.json?m="+(new Date()).getTime(), {
  16742. //return $.ajax(prefix+"data/data"+number+"/floor.json?m="+(new Date()).getTime(), {
  16743. crossDomain: !0,
  16744. dataType: "json",
  16745. beforeSend: function(t) {
  16746. v.token && t.setRequestHeader("Authorization", "Token " + v.token)
  16747. }
  16748. }).done(function(e) {
  16749. this.baseUrl = "images/images"+number+"/{{filename}}";
  16750. window.Data = $.extend(Data,e);
  16751. Data.sceneName = e.sceneName; //覆盖firstData
  16752. Data.sceneDec = e.sceneDec; //覆盖firstData
  16753. Data.sceneType = e.sceneType;
  16754. Data.floorLogo = (e.floorLogo=="1" || e.floorLogo == 1) ? 1 : 0;
  16755. Data.thumbImg = (e.thumbImg=="1" || e.thumbImg == 1) ? 1 : 0;
  16756. Data.entry = e.entry;
  16757. Data.version = parseInt(e.version || 0);
  16758. Data.floorLogoSize = parseInt(Data.floorLogoSize || 100);
  16759. if(Data.sceneName != undefined){
  16760. $(".model-title").text(Data.sceneName || '四维看看');
  16761. $(".model-title2").text(Data.sceneName || '四维看看');
  16762. $("#pjtName")[0].value = Data.sceneName || '';
  16763. }
  16764. $('.introduce-detail span')[0].innerHTML = Data.sceneDec;//直接text()会得不到<a>这类HTML文字
  16765. $("#edit2").attr('data-more',Data.sceneDec || '');
  16766. Data.sceneType = parseInt(Data.sceneType);
  16767. if(layer.editor.selectList["type"]){//有的话说明selectList["type"]先于Data.SCENETYPE
  16768. var typeIndex = [1,2,3,4,5,0];//0标定为其他 以后若有增加就从6开始,删除的类型继续保留数字
  16769. //var typeName = ["文博","地产","电商","餐饮","家居","其他"];
  16770. var type = CONSTANT.SCENETYPE[typeIndex.indexOf(Data.sceneType)];
  16771. if(type) layer.editor.selectList["type"].selectFromOutSide(type);
  16772. }
  16773. if(Data.sceneDec!=null&&typeof(Data.sceneDec)!='undefined')
  16774. {
  16775. checkLen.editor2(Data.sceneDec);
  16776. //checkLen.project_name2();
  16777. if(layer.editor.inputAreas.sceneDec) layer.editor.inputAreas.sceneDec.check();
  16778. }
  16779. t.resolve();
  16780. }.bind(this)).fail(function() {
  16781. (parseInt(Data.version) > 1) && console.log("数据2加载失败");
  16782. t.resolve();
  16783. //getData();
  16784. });
  16785. return t.promise();
  16786. }
  16787. function GetThumbImg(){//加 xzw 缩略图
  16788. var t = $.Deferred();
  16789. var img = new Image;
  16790. checkLen.project_name2();
  16791. $("#gui-loading .bg").css({"display": "none"});
  16792. img.src = Data.thumbImg ? Data.imgRoot +CONSTANT.LOADPIC +"?"+"m="+Data.version : "http://scene3d.4dage.com/loading/pc.jpg";
  16793. img.onload = function(){
  16794. $("#gui-loading .bg").css({"background-image": "url("+img.src+")"});
  16795. $("#gui-loading .bg").fadeIn(120);
  16796. //t.resolve();
  16797. }
  16798. return t.resolve().promise();
  16799. }
  16800. function infoGuiBind(){
  16801. $(".introduce-button").click(function(e){
  16802. if( $(".introduce-detailBox").hasClass("hide")){
  16803. $(".introduce-detailBox").removeClass("hide");
  16804. setTimeout(function(){
  16805. $(".introduce-top").addClass("open");
  16806. },50)
  16807. }else{
  16808. close();
  16809. }
  16810. })
  16811. var close = function(e){
  16812. if(e && ( dom.findParent(e.target,$(".introduce-button")[0]) || dom.findParent(e.target, $(".introduce-detailBox")[0] ))) return;
  16813. if( !$(".introduce-detailBox").hasClass("hide")){
  16814. $(".introduce-top").removeClass("open");
  16815. setTimeout(function(){
  16816. $(".introduce-detailBox").addClass("hide");
  16817. },350)
  16818. }
  16819. }
  16820. $("#player").on("touchstart",close);
  16821. $("#player").on("mousedown",close);
  16822. }
  16823. function n(e) {
  16824. ce.update(e)
  16825. }
  16826. function r(e) {
  16827. de.info("Version", "2.25.6-0-gd87e5b1"),
  16828. q.defaultMaxListeners = 1e3,
  16829. a(e),
  16830. s()
  16831. }
  16832. function o() {
  16833. return document.getElementById("player")
  16834. }
  16835. function a(e) {
  16836. e.addEventListener("dragenter", T, !1),
  16837. e.addEventListener("dragover", T, !1)
  16838. }
  16839. function s() {
  16840. F.valueFromHash("title", !0) || $(document).ready(function() {
  16841. var e = $(".model-title");
  16842. e.hide()
  16843. })
  16844. }
  16845. function l() {
  16846. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  16847. }
  16848. function c() {
  16849. return {
  16850. panoElementsToLoad: 6,
  16851. modelElementsToLoad: 0,
  16852. totalElementsLoaded: 0,
  16853. totalElementsToLoad: 0,
  16854. totalPercentageLoaded: 0,
  16855. progressCallback: null
  16856. }
  16857. }
  16858. function h(e) {
  16859. return K.loadFeatureFlags(e).done(function(e) {
  16860. K.updateDependentSettings(e, V)
  16861. })
  16862. }
  16863. function u(e) {
  16864. return Q.get(e.urlBase + "/api/v1/config/showcase", {
  16865. responseType: "json",
  16866. prefetchFrom: "config"
  16867. }).then(function(e) {
  16868. return e ? void j.extendObject(V.appConfig, e) : {}
  16869. }, function(e) {
  16870. return de.warn("Failed loading runtime config, using defaults."),
  16871. $.when({})
  16872. })
  16873. }
  16874. function d(e, t) {
  16875. var i = B.getModel({
  16876. url: t,
  16877. floors: F.valueFromHash("f", !0),
  16878. autoload: !1
  16879. })
  16880. , n = u({
  16881. urlBase: e.urlBase
  16882. });
  16883. return $.when(i, n).then(null, function(e) {
  16884. return this
  16885. })
  16886. }
  16887. function p(e, t, i, n, r) {
  16888. de.info("Model data loaded"),
  16889. de.debug("UUID: " + e.data.job.uuid),
  16890. J.init(K.getFlags()),
  16891. i && H.initKeen({
  16892. token: i,
  16893. appId: n
  16894. }),
  16895. H.initSegment({
  16896. model: e.sid,
  16897. version: "2.25.6-0-gd87e5b1",
  16898. startSource: r.startSource,
  16899. token: t,
  16900. autoplay: r.autoplay,
  16901. quickstart: r.quickstart
  16902. })
  16903. }
  16904. function f(e, t, i, n, r) {
  16905. return r.progressCallback = t,
  16906. H.sessionStart(),
  16907. e.load(n).progress(g.bind(this, r))
  16908. }
  16909. function g(e, t) {
  16910. e.modelElementsToLoad = t[1],
  16911. v(e),
  16912. m(e)
  16913. }
  16914. function m(e) {
  16915. e.totalElementsLoaded++,
  16916. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  16917. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  16918. }
  16919. function v(e) {
  16920. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  16921. }
  16922. function A(e) {
  16923. var t = new x.PerspectiveCamera;
  16924. t.layers.enable(he.PANOMARKERS),
  16925. t.layers.enable(he.RETICULE),
  16926. t.layers.enable(he.TAG);
  16927. var i = new x.Scene
  16928. , n = new x.AmbientLight(16777215);
  16929. i.add(n),
  16930. i.skybox = new W,
  16931. i.add(i.skybox),
  16932. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  16933. side: x.DoubleSide
  16934. })),
  16935. i.plane.position.y = 0,
  16936. i.plane.rotateX(-Math.PI / 2),
  16937. i.plane.material.visible = !1,
  16938. i.add(i.plane),
  16939. i.updateMatrixWorld(),
  16940. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  16941. if (e.metadata && e.metadata.camera_position) {
  16942. var t = e.metadata.camera_position
  16943. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  16944. n.position = t.clone(),
  16945. i.add(n);
  16946. var r = e.metadata.camera_quaternion
  16947. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  16948. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  16949. }
  16950. }),
  16951. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  16952. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  16953. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  16954. var r = new te(i,t,z);
  16955. return r
  16956. }
  16957. function y(e, t) {
  16958. var i = e ? 1 : 1e3
  16959. , n = J.tilegen || J.imgopt ? 6 : 2;
  16960. n = F.valueFromHash("tileconc", n);
  16961. var r = new ne
  16962. , o = new ae({
  16963. concurrentDownloads: n
  16964. })
  16965. , a = new se
  16966. , s = new P
  16967. , l = new M
  16968. , c = new S(t)
  16969. , h = new R
  16970. , u = new O(i)
  16971. , d = new L
  16972. , p = new oe;
  16973. return {
  16974. qualityManager: r,
  16975. panoRenderer: a,
  16976. tileDownloader: o,
  16977. player: c,
  16978. director: l,
  16979. modelManager: s,
  16980. tagManager: p,
  16981. displayController: u,
  16982. labelDisplayController: d,
  16983. controls: h
  16984. }
  16985. }
  16986. function C(e, t, i, n) {
  16987. var r = i.controls
  16988. , o = i.qualityManager
  16989. , a = i.panoRenderer
  16990. , s = i.tileDownloader
  16991. , l = i.modelManager;
  16992. r.init(n, l),
  16993. ee.init(i.director, r, i.player, l, t),
  16994. o.init(l),
  16995. s.init(o),
  16996. a.init(t, s, o),
  16997. l.init(s, a, o),
  16998. l.addModel(e),
  16999. t.addComponent(G)
  17000. }
  17001. function I(e, t, i, n) {
  17002. var r = i.qualityManager
  17003. , o = i.panoRenderer
  17004. , a = i.tileDownloader
  17005. , s = i.modelManager
  17006. , l = i.player
  17007. , c = i.director
  17008. , h = i.tagManager
  17009. , u = i.displayController
  17010. , d = i.labelDisplayController
  17011. , p = i.controls;
  17012. t.scene.add(e),
  17013. t.qualityManager = r;
  17014. var f = {
  17015. camera: t.camera,
  17016. director: c,
  17017. modelManager: s,
  17018. tileDownloader: a,
  17019. panoRenderer: o,
  17020. qualityManager: r,
  17021. tagManager: h,
  17022. container: n,
  17023. controls: p
  17024. };
  17025. l.init(f),
  17026. l.setScene(t.scene),
  17027. h.init(s, l),
  17028. c.init(l, s),
  17029. u.init(c, l, s, h, n),
  17030. d.init(l, s, n),
  17031. z.bindEvents(l);
  17032. t.addComponent(h);
  17033. t.addComponent(l);
  17034. t.addComponent(o)
  17035. l.sceneRenderer = t; //xzw add 方便resize
  17036. }
  17037. function E(e, t, i, n) {
  17038. return de.info("Starting player in " + i.mode),
  17039. H.report(t.sid, "started-playing", n, i.quickstart),
  17040. e.start(i)
  17041. }
  17042. function b(e, t) {
  17043. de.error(t),
  17044. k.error(t),
  17045. H.report(e, "error-" + t)
  17046. }
  17047. function w(e) {
  17048. var t = F.details();
  17049. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  17050. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  17051. H.report(e, "error-webgl-generic"))
  17052. }
  17053. function _(e, t, i) {
  17054. try {
  17055. e.start(t)
  17056. } catch (e) {
  17057. throw de.warn(e.message),
  17058. w(i.sid),
  17059. e
  17060. }
  17061. }
  17062. function T(e) {
  17063. e.stopPropagation(),
  17064. e.preventDefault()
  17065. }
  17066. e("./lib/three75-shim"),
  17067. e("./lib/array-polyfill"),
  17068. e("./lib/performance-polyfill"),
  17069. e("./lib/shaders/CopyShader.js"),
  17070. e("./lib/shaders/HorizontalBlurShader.js"),
  17071. e("./lib/shaders/VerticalBlurShader.js"),
  17072. e("./lib/postprocessing/EffectComposer.js"),
  17073. e("./lib/postprocessing/RenderPass.js"),
  17074. e("./lib/postprocessing/MaskPass.js"),
  17075. e("./lib/postprocessing/ShaderPass.js"),
  17076. window.Promise || (window.Promise = e("promise-polyfill"));
  17077. var x = e("three")
  17078. , S = (e("./util/sentry"),
  17079. e("./player"))
  17080. , M = e("./director")
  17081. , R = e("./controls/CameraControls")
  17082. , P = e("./model/ModelManager")
  17083. , O = e("./DisplayController")
  17084. , L = e("./label/LabelDisplayController")
  17085. , D = e("./enum/Viewmode")
  17086. , N = e("./util/logger")
  17087. , B = e("./showcase")
  17088. , F = e("./util/browser")
  17089. , V = e("./settings")
  17090. , U = e("./gui/gui")
  17091. , k = e("./gui/error")
  17092. , H = e("./analytics")
  17093. , G = e("./util/transitions")
  17094. , z = e("./effects")
  17095. , W = e("./objects/Skybox")
  17096. , j = e("./util/common")
  17097. , Y = (e("./util/PanoramaCollection"),
  17098. e("./util/math"),
  17099. e("./util/showcase"))
  17100. , X = e("./util/camera")
  17101. , Z = (e("./objects/Panorama"),
  17102. e("./cameras/PanoramaCamera"),
  17103. e("./preloaders"))
  17104. , q = e("events").EventEmitter
  17105. , K = e("./featureflags")
  17106. , Q = (e("./util/lerp"),
  17107. e("./util/ajax"))
  17108. , J = e("./ab")
  17109. , ee = e("./sdk/automation.js")
  17110. , te = e("./scene/SceneRenderer")
  17111. , ie = e("./scene/QuickstartManager")
  17112. , ne = e("./tile/QualityManager.js")
  17113. , re = e("./localization/localize")
  17114. , oe = e("./tag/tagManager")
  17115. , ae = e("./tile/TileDownloader")
  17116. , se = e("./tile/PanoRenderer")
  17117. , le = (e("./enum/PanoSizeClass"),
  17118. e("./enum/PanoramaEvents"),
  17119. e("./enum/SceneRendererEvents"))
  17120. , ce = e("./gui/memoryUsage")
  17121. , he = e("./enum/RenderLayers")
  17122. , ue = e("./TimingData")
  17123. , de = new N(t);
  17124. N.level = V.logLevel,
  17125. N.consoleEnabled = V.console,
  17126. i()
  17127. }
  17128. ).call(this, "/js/main.js")
  17129. }
  17130. , {
  17131. "./DisplayController": 1,
  17132. "./TimingData": 2,
  17133. "./ab": 3,
  17134. "./analytics": 4,
  17135. "./cameras/PanoramaCamera": 7,
  17136. "./controls/CameraControls": 9,
  17137. "./director": 15,
  17138. "./effects": 16,
  17139. "./enum/PanoSizeClass": 36,
  17140. "./enum/PanoramaEvents": 37,
  17141. "./enum/RenderLayers": 41,
  17142. "./enum/SceneRendererEvents": 43,
  17143. "./enum/Viewmode": 51,
  17144. "./featureflags": 59,
  17145. "./gui/error": 64,
  17146. "./gui/gui": 65,
  17147. "./gui/memoryUsage": 73,
  17148. "./label/LabelDisplayController": 91,
  17149. "./lib/array-polyfill": 92,
  17150. "./lib/performance-polyfill": 95,
  17151. "./lib/postprocessing/EffectComposer.js": 96,
  17152. "./lib/postprocessing/MaskPass.js": 97,
  17153. "./lib/postprocessing/RenderPass.js": 98,
  17154. "./lib/postprocessing/ShaderPass.js": 99,
  17155. "./lib/shaders/CopyShader.js": 100,
  17156. "./lib/shaders/HorizontalBlurShader.js": 101,
  17157. "./lib/shaders/VerticalBlurShader.js": 102,
  17158. "./lib/three75-shim": 103,
  17159. "./localization/localize": 108,
  17160. "./tag/tagManager": 124,
  17161. "./model/ModelManager": 140,
  17162. "./objects/Panorama": 148,
  17163. "./objects/Skybox": 152,
  17164. "./player": 155,
  17165. "./preloaders": 156,
  17166. "./scene/QuickstartManager": 157,
  17167. "./scene/SceneRenderer": 158,
  17168. "./sdk/automation.js": 164,
  17169. "./settings": 166,
  17170. "./showcase": 168,
  17171. "./tile/PanoRenderer": 169,
  17172. "./tile/QualityManager.js": 170,
  17173. "./tile/TileDownloader": 171,
  17174. "./util/PanoramaCollection": 178,
  17175. "./util/ajax": 181,
  17176. "./util/browser": 182,
  17177. "./util/camera": 183,
  17178. "./util/common": 185,
  17179. "./util/lerp": 188,
  17180. "./util/logger": 189,
  17181. "./util/math": 190,
  17182. "./util/sentry": 192,
  17183. "./util/showcase": 193,
  17184. "./util/transitions": 195,
  17185. events: 202,
  17186. "promise-polyfill": 213,
  17187. three: 217,
  17188. "Editor" : "Editor",
  17189. "dom" : "dom"
  17190. }],
  17191. 117: [function(e, t, i) {//"../materials/CubemapMaterial"
  17192. "use strict";
  17193. function n(e) {
  17194. e = e || {},
  17195. r.RawShaderMaterial.call(this, a.extendObject({
  17196. fragmentShader: o.cube.fragmentShader,
  17197. vertexShader: o.cube.vertexShader,
  17198. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  17199. name: "CubemapMaterial"
  17200. }, e))
  17201. }
  17202. var r = e("three")
  17203. , o = e("../shaders")
  17204. , a = e("../util/common");
  17205. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  17206. n.prototype.constructor = n,
  17207. t.exports = n
  17208. }
  17209. , {
  17210. "../shaders": 167,
  17211. "../util/common": 185,
  17212. three: 217
  17213. }],
  17214. 118: [function(e, t, i) {//"../materials/ModelTextureMaterial"
  17215. "use strict";
  17216. function n(e) {
  17217. e = e || {},
  17218. r.RawShaderMaterial.call(this, a.extendObject({
  17219. fragmentShader: o.model.fragmentShader,
  17220. vertexShader: o.model.vertexShader,
  17221. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  17222. name: "ModelTextureMaterial"
  17223. }, e))
  17224. }
  17225. var r = e("three")
  17226. , o = e("../shaders")
  17227. , a = e("../util/common");
  17228. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  17229. n.prototype.constructor = n,
  17230. n.prototype.setProjectedPanos = function(e, t, i) {
  17231. i && (this.uniforms.progress.value = 0),
  17232. e.ensureSkyboxReadyForRender(),
  17233. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  17234. this.uniforms.pano0Position.value.copy(e.position),
  17235. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  17236. t.ensureSkyboxReadyForRender(),
  17237. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  17238. this.uniforms.pano1Position.value.copy(t.position),
  17239. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  17240. }
  17241. ,
  17242. t.exports = n
  17243. }
  17244. , {
  17245. "../shaders": 167,
  17246. "../util/common": 185,
  17247. three: 217
  17248. }],
  17249. 119: [function(e, t, i) {///js/tag/Billboard/Billboard.js
  17250. (function(i) {
  17251. "use strict";
  17252. function n(e, t, i, n) {
  17253. this.div = null,
  17254. this.body = null,
  17255. this.label = e,
  17256. this.description = t,
  17257. this.parsedDescription = [],
  17258. this.media = i || {
  17259. type: null
  17260. },
  17261. this.loadingSpinner = null,
  17262. this.parser = new r({
  17263. supportLinks: !u.valueFromHash("mls"),
  17264. keepLinkLabels: !0
  17265. }),
  17266. this.state = I.CLOSED,
  17267. this.orientation = "",
  17268. this.initialTransform = "",
  17269. this.hovering = !1,
  17270. this.openTransition = null,
  17271. this.closeTransition = null,
  17272. this.openPromise = null,
  17273. this.closePromise = null,
  17274. this.animationTransition = null,
  17275. this.animationScale = 0
  17276. }
  17277. var r = e("../Parser/DescriptionParser")
  17278. , o = e("../Media/Link")
  17279. , a = e("../Media/Image")
  17280. , s = e("../Media/EmbedlyPlayer")
  17281. , l = e("../Media/EmbedlyEmbed")
  17282. , c = e("../../util/transitions")
  17283. , h = e("../../util/lerp")
  17284. , u = e("../../util/browser")
  17285. , d = e("./BillboardEvent")
  17286. , p = e("../Media/MediaEvent")
  17287. , f = e("../Parser/DescriptionChunkType")
  17288. , g = e("events").EventEmitter
  17289. , m = e("./billboardSettings")
  17290. , v = e("./overlaySettings")
  17291. , A = e("../../util/logger")
  17292. , y = new A(i)
  17293. , C = document.getElementById("tag-billboards");
  17294. C.addEventListener("touchend", function(e) {
  17295. C.style.pointerEvents = "none"
  17296. }),
  17297. C.addEventListener("touchcancel", function(e) {
  17298. C.style.pointerEvents = "none"
  17299. });
  17300. var I = {
  17301. CLOSED: "closed",
  17302. OPENING: "opening",
  17303. OPEN: "open",
  17304. CLOSING: "closing",
  17305. ACTIVE: "active"
  17306. };
  17307. n.prototype = Object.create(g.prototype),
  17308. n.prototype.build = function(e) {//xzw
  17309. //this.parsedDescription = this.parser.parse(this.description);
  17310. var t = document.createElement("div");
  17311. t.className = "tag-container has-hotzone",
  17312. this.div = t,
  17313. this.body = document.createElement("div"),
  17314. this.body.className = "tag-body";
  17315. var i = document.createElement("div");
  17316. i.classList.add("tag-content");
  17317. var n = document.createElement("div");
  17318. n.classList.add("tag-text-content");
  17319. var r = document.createElement("div");
  17320. r.className = "tag-label",//label
  17321. r.textContent = this.label || "请于右侧编辑您新的热点",//改
  17322. n.appendChild(r);
  17323. var o = document.createElement("div");
  17324. o.className = "tag-desc",//description
  17325. n.appendChild(o),
  17326. i.appendChild(n),
  17327. this.body.appendChild(i),
  17328. //this.appendDescriptionElements(this.parsedDescription, o),
  17329. this.appendMedia(),
  17330. t.appendChild(this.body),
  17331. C.appendChild(t),
  17332. this.changeDesc(this.description);//add
  17333. this.bindEvents(t, this.body)
  17334. }
  17335. ,
  17336. //xzw: add
  17337. n.prototype.changeLabel = function(title){//换标题
  17338. var container = $(this.div).find('.tag-label')[0];
  17339. container.innerHTML = "";
  17340. this.label = title;
  17341. container.textContent = this.label;
  17342. this.applyOrientation(this.orientation)//更新面板位置
  17343. }
  17344. ,
  17345. n.prototype.changeDesc = function(desc){//换摘要
  17346. var container = $(this.div).find('.tag-desc')[0];
  17347. container.innerHTML = "";
  17348. this.description = desc;
  17349. if(desc != "") $(container).addClass("hasText")
  17350. else $(container).removeClass("hasText")
  17351. this.parsedDescription = this.parser.parse(this.description);
  17352. this.appendDescriptionElements(this.parsedDescription, container);
  17353. this.applyOrientation(this.orientation)
  17354. }
  17355. ,
  17356. n.prototype.changeImg = function(img){//暂时只支持换image
  17357. var has;
  17358. if(this.media.type == "photo") has = true;
  17359. this.media = {"img":img,"type":"photo"};
  17360. has ? this.changeMedia() : this.appendMedia()
  17361. this.applyOrientation(this.orientation)
  17362. },
  17363. n.prototype.changeMedia = function() {//暂时只支持image
  17364. if (this.media && this.media.type && "error" !== this.media.type && (/* !u.valueFromHash("mls", 0) || */this.media.type === f.IMAGE)) {
  17365. this.appendLoadingSpinner();
  17366. var e = $(this.body).find(".tag-media-content")[0];
  17367. e.innerHTML = "";
  17368. e.appendChild(this.createImageElement(this.media, this.body));
  17369. }
  17370. }
  17371. //xzw-------end
  17372. n.prototype.bindEvents = function(e, t) {
  17373. var i = function(e) {
  17374. return function(t) {
  17375. if (!this.div.classList.contains("overlay")) {
  17376. var i, n = document.getElementById("player");
  17377. try {
  17378. i = new MouseEvent(e,t)
  17379. } catch (n) {
  17380. i = document.createEvent("MouseEvents"),
  17381. 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)
  17382. }
  17383. n.dispatchEvent(i)
  17384. }
  17385. }
  17386. };
  17387. t.addEventListener("mousedown", function(e) {
  17388. e.stopPropagation()
  17389. }),
  17390. t.addEventListener("mouseup", function(e) {
  17391. e.stopPropagation()
  17392. }),
  17393. e.addEventListener("touchstart", function(e) {
  17394. C.style.pointerEvents = "auto"
  17395. }),
  17396. e.addEventListener("mousedown", i("mousedown").bind(this)),
  17397. e.addEventListener("mouseup", i("mouseup").bind(this)),
  17398. t.addEventListener("mouseover", function(t) {
  17399. this.state === I.OPEN && e.classList.remove("has-hotzone")
  17400. }
  17401. .bind(this)),
  17402. e.addEventListener("mouseenter", function(e) {
  17403. this.state !== I.CLOSING && (this.hovering = !0,
  17404. this.emit(d.ENTER))
  17405. }
  17406. .bind(this)),
  17407. e.addEventListener("mouseleave", function(e) {
  17408. this.hovering = !1,
  17409. this.emit(d.LEAVE)
  17410. }
  17411. .bind(this)),
  17412. e.addEventListener("gesturestart", function(e) {
  17413. e.preventDefault()
  17414. });
  17415. var n = e.querySelector(".tag-text-content")
  17416. , r = 0;
  17417. n.addEventListener("touchstart", function(e) {
  17418. r = e.changedTouches[0].clientY
  17419. }),
  17420. n.addEventListener("touchmove", function(t) {
  17421. function i(e) {
  17422. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  17423. }
  17424. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  17425. }),
  17426. e.addEventListener("touchmove", function(e) {
  17427. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  17428. })
  17429. }
  17430. ,
  17431. n.prototype.appendDescriptionElements = function(e, t) {
  17432. e.length > 0 && this.div.classList.add("has-text"),
  17433. e.forEach(function(e, i) {
  17434. switch (e.type) {
  17435. case f.TEXT:
  17436. //t.appendChild(this.createTextElement(e.text)); //---MP
  17437. t.innerHTML = e.text; //xzw 这样<a>等标签不会变成文字显示
  17438. break;
  17439. case f.LINK:
  17440. t.appendChild(this.createLinkElement(e.link))
  17441. }
  17442. }
  17443. .bind(this))
  17444. }
  17445. ,
  17446. /* n.prototype.appendLoadingSpinner = function() {----MP
  17447. this.loadingSpinner = document.createElement("div"),
  17448. this.loadingSpinner.classList.add("loading-spinner");
  17449. var e = document.createElement("div");
  17450. e.classList.add("gui-spinner-icon"),
  17451. this.loadingSpinner.appendChild(e),
  17452. this.body.appendChild(this.loadingSpinner)
  17453. } */
  17454. n.prototype.appendLoadingSpinner = function() {//---not by xzw
  17455. this.loadingSpinner = document.createElement("div"),
  17456. this.loadingSpinner.classList.add("loading-spinner");
  17457. var e = document.createElement("div");
  17458. e.classList.add("gui-spinner-icon");
  17459. var d = document.createElement("div");
  17460. d.classList.add("loadingPic");
  17461. var z = document.createElement("div");
  17462. z.classList.add("loadingPic-inner");
  17463. d.appendChild(z);
  17464. this.loadingSpinner.appendChild(e),
  17465. this.loadingSpinner.appendChild(d),
  17466. this.body.appendChild(this.loadingSpinner)
  17467. }
  17468. ,
  17469. n.prototype.onMediaLoadFinished = function() {
  17470. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  17471. this.applyOrientation(this.orientation),
  17472. this.loadingSpinner = null)
  17473. }
  17474. ,
  17475. n.prototype.appendMedia = function() {
  17476. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  17477. this.appendLoadingSpinner();
  17478. var e = document.createElement("div");
  17479. e.classList.add("tag-media-content");
  17480. var t = document.createElement("i");
  17481. ["icon", "icon-close-thin", "close"].forEach(function(e) {
  17482. t.classList.add(e)
  17483. }),
  17484. this.body.appendChild(t),
  17485. this.body.appendChild(e);
  17486. switch (this.media.type) {
  17487. case f.IMAGE:
  17488. e.appendChild(this.createImageElement(this.media, this.body));
  17489. break;
  17490. case f.VIDEO:
  17491. e.appendChild(this.createVideoElement(this.media, this.body));
  17492. break;
  17493. case f.RICH:
  17494. e.appendChild(this.createEmbedElement(this.media, this.body))
  17495. }
  17496. }
  17497. }
  17498. ,
  17499. n.prototype.createTextElement = function(e) {
  17500. var t = document.createElement("span");
  17501. return t.textContent = e,
  17502. t
  17503. }
  17504. ;
  17505. n.prototype.createLinkElement = function(e) {
  17506. var t = new o(e);
  17507. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  17508. t.createDomElement()
  17509. }
  17510. ,
  17511. n.prototype.createImageElement = function(e, t) {
  17512. function i() {
  17513. function e() {
  17514. m || (r.classList.remove("view-image"),
  17515. c.classList.add("overlay"),
  17516. i(),
  17517. window.addEventListener("resize", b),
  17518. c.addEventListener("click", a),
  17519. g.addEventListener("click", l),
  17520. f.addEventListener("click", s),
  17521. m = !0,
  17522. o.emit(p.IMAGE_OPENED))
  17523. }
  17524. function i() {
  17525. t.classList.add("show-info"),
  17526. h.classList.remove("collapsible"),
  17527. h.style.height = "";
  17528. /* var e = parseFloat(getComputedStyle(I).lineHeight) -----MP
  17529. , i = y + e
  17530. , r = c.clientWidth - 2 * v.boundaryWidth - C
  17531. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  17532. , s = a
  17533. , l = s * n.aspect;
  17534. l > r && (l = r,
  17535. s = l / n.aspect),
  17536. s > a && (s = a,
  17537. l = s * n.aspect),
  17538. l += C,
  17539. s += C + i,
  17540. t.style.width = l + "px",
  17541. t.style.height = s + "px",
  17542. u.style.paddingTop = e + C + "px",
  17543. o.description.length > 0 && (h.classList.add("collapsible"),
  17544. h.style.height = h.clientHeight + 12 + "px",
  17545. E.style.height = "calc(100% - " + I.clientHeight + "px)") */
  17546. //by ?:
  17547. o.description.length > 0 && (h.classList.add("collapsible"));
  17548. return $.when(this);
  17549. }
  17550. function a(e) {
  17551. e.target === c && s()
  17552. }
  17553. function s() {
  17554. m && (m = !1,
  17555. r.classList.add("view-image"),
  17556. c.classList.remove("overlay"),
  17557. h.style.height = "",
  17558. u.style.paddingTop = "",
  17559. t.style.width = "",
  17560. t.style.height = "",
  17561. window.removeEventListener("resize", b),
  17562. c.removeEventListener("click", a),
  17563. g.removeEventListener("click", l),
  17564. f.removeEventListener("click", s),
  17565. o.emit(p.IMAGE_CLOSED),
  17566. o.close(!0))
  17567. }
  17568. function l(e) {
  17569. t.classList.toggle("show-info")
  17570. }
  17571. var c = o.div
  17572. , h = c.getElementsByClassName("tag-content")[0]
  17573. , u = c.getElementsByClassName("tag-media-content")[0]
  17574. , f = t.getElementsByClassName("close")[0]
  17575. , g = h.getElementsByClassName("tag-label")[0];
  17576. c.classList.add("has-image"),
  17577. r.classList.add("view-image"),
  17578. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  17579. o.applyOrientation(o.orientation);
  17580. var m = !1
  17581. , A = getComputedStyle(h)
  17582. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  17583. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  17584. , I = h.querySelector(".tag-label")
  17585. , E = h.querySelector(".tag-desc")
  17586. , b = function() {
  17587. var e, t, n = 0;
  17588. return function() {
  17589. clearInterval(e),
  17590. clearTimeout(t),
  17591. e = setInterval(function() {
  17592. var e = c.clientHeight;
  17593. n !== e && (i(),
  17594. n = e)
  17595. }, 100),
  17596. t = setTimeout(clearInterval.bind(this, e), 1e3)
  17597. }
  17598. }();
  17599. n.on(p.IMAGE_OPENING, e);
  17600. // o.on(d.ACTIVATE, e),//加了这个再点击热点时就会变大图
  17601. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n));
  17602. // o.on(d.CLOSING, s)
  17603. }
  17604. /* var n = new a -----MP
  17605. , r = n.createDomElement();
  17606. this.once(d.OPENED, function() {
  17607. n.load(e.src).then(i).catch(function(t) {
  17608. y.warn("Failed to load image:", e.src),
  17609. y.warn("with error:", t)
  17610. }).then(this.onMediaLoadFinished.bind(this))
  17611. });
  17612. var o = this; */
  17613. //xzw:
  17614. var n = new a
  17615. ,r = n.createDomElement()
  17616. ,o = this;
  17617. if(e.img){ //如果是编辑页面添加的将是个img
  17618. n.load(e.img, this.div).then(i).fail(function(t) {
  17619. y.warn("Failed to load image:", e.src),
  17620. y.warn("with error:", t)
  17621. }).then(this.onMediaLoadFinished.bind(this))
  17622. }else{
  17623. if(!e.src) e.src = Data.spotImgRoot + "hot" +this.tag.sid + '.jpg?m=' + Data.version;
  17624. this.once(d.OPENED, function() {
  17625. n.load(e.src, this.div).then(i).fail(function(t) {
  17626. y.warn("Failed to load image:", e.src),
  17627. y.warn("with error:", t)
  17628. }).then(this.onMediaLoadFinished.bind(this))
  17629. });
  17630. }
  17631. return r
  17632. }
  17633. ,
  17634. n.prototype.createVideoElement = function(e, t) {
  17635. var i = new s({
  17636. autoPlay: !0,
  17637. autoResume: !0,
  17638. startMuted: !1,
  17639. loop: !1
  17640. })
  17641. , n = i.createDomElement();
  17642. return this.once(d.OPENED, function() {
  17643. i.load(e.src).then(function() {
  17644. this.div.classList.add("has-video"),
  17645. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  17646. i.play()),
  17647. this.on(d.OPENING, i.show.bind(i)),
  17648. this.on(d.OPENED, i.play.bind(i)),
  17649. this.on(d.CLOSING, i.pause.bind(i)),
  17650. this.on(d.CLOSED, i.hide.bind(i))
  17651. }
  17652. .bind(this)).catch(function(t) {
  17653. y.warn("Failed to embed video:", e.src),
  17654. y.warn("with error:", t)
  17655. }).then(this.onMediaLoadFinished.bind(this))
  17656. }
  17657. .bind(this)),
  17658. n
  17659. }
  17660. ,
  17661. n.prototype.createEmbedElement = function(e, t) {
  17662. var i = new l
  17663. , n = i.createDomElement();
  17664. return this.once(d.OPENED, function() {
  17665. i.load(e.src).then(function() {
  17666. this.div.classList.add("has-embed"),
  17667. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  17668. this.applyOrientation(this.orientation),
  17669. this.on(d.OPENING, i.show.bind(i)),
  17670. this.on(d.CLOSED, i.hide.bind(i))
  17671. }
  17672. .bind(this)).catch(function(t) {
  17673. y.warn("Failed to embed:", e.src),
  17674. y.warn("with error:", t)
  17675. }).then(this.onMediaLoadFinished.bind(this))
  17676. }
  17677. .bind(this)),
  17678. n
  17679. }
  17680. ,
  17681. n.prototype.open = function(e) {
  17682. return this.openPromise = $.Deferred(),
  17683. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  17684. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  17685. this.state !== I.OPEN && (this.emit(d.OPENING),
  17686. e && this.emit(d.ACTIVATING),
  17687. this.state = I.OPENING,
  17688. this.animateOpen(function() {
  17689. e && this.setActiveState(),
  17690. this.openPromise.resolve()
  17691. }
  17692. .bind(this)))
  17693. }
  17694. .bind(this), m.animation.openDelay),
  17695. c.cancel(this.closeTransition),
  17696. this.closePromise && this.closePromise.reject(),
  17697. this.closeTransition = void 0,
  17698. this.openPromise.promise())
  17699. }
  17700. ,
  17701. n.prototype.close = function(e) {
  17702. console.log('close')
  17703. return this.closePromise = $.Deferred(),
  17704. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  17705. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  17706. this.state = I.CLOSING,
  17707. this.animateClose())
  17708. }
  17709. .bind(this), m.animation.closeDelay)),
  17710. c.cancel(this.openTransition),
  17711. this.openPromise && this.openPromise.reject(),
  17712. this.openTransition = void 0,
  17713. this.closePromise.resolve(),
  17714. this.closePromise.promise())
  17715. }
  17716. ,
  17717. n.prototype.setActiveState = function() {
  17718. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  17719. this.emit(d.ACTIVATE),
  17720. this.div.classList.remove("has-hotzone"))
  17721. }
  17722. ,
  17723. n.prototype.animateOpen = function(e) {
  17724. if (this.state === I.OPENING) {
  17725. if (c.cancel(this.animationTransition),
  17726. u.detectSamsungNative())
  17727. return this.boardOrientation = null,
  17728. this.div.style.visibility = "visible",
  17729. this.emit(d.OPENED),
  17730. this.state = I.OPEN,
  17731. void (e && e());
  17732. this.div.style.webkitTransform = "scale(0)",
  17733. this.div.style.transform = "scale(0)",
  17734. this.div.style.visibility = "visible",
  17735. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  17736. this.emit(d.OPENED),
  17737. this.state = I.OPEN,
  17738. e && e()
  17739. }
  17740. .bind(this))
  17741. }
  17742. }
  17743. ,
  17744. n.prototype.animateClose = function(e) {
  17745. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  17746. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  17747. this.emit(d.CLOSED),
  17748. this.state = I.CLOSED,
  17749. this.div.style.visibility = "hidden",
  17750. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  17751. e && e()
  17752. }
  17753. .bind(this)))
  17754. }
  17755. ,
  17756. n.prototype.needsUpdate = function() {
  17757. return this.state !== I.CLOSED
  17758. }
  17759. ,
  17760. n.prototype.update = function(e, t) {
  17761. if (this.needsUpdate()) {
  17762. var i = (this.updateOrientation(e),
  17763. this.calcScale(t))
  17764. , n = {
  17765. x: (e.x + 1) * $('#player').width() / 2,
  17766. y: (e.y + 1) * $('#player').height() / 2
  17767. };
  17768. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  17769. this.div.style.webkitTransform = this.div.screenTransform,
  17770. this.div.style.transform = this.div.screenTransform
  17771. }
  17772. }
  17773. ,
  17774. n.prototype.getDimensions = function() {
  17775. return this.div.getBoundingClientRect()
  17776. }
  17777. ,
  17778. n.prototype.ifOutOfScreen = function() {//xzw add
  17779. var t = this.getDimensions();
  17780. var pad = 8;
  17781. return t.left<0-pad || t.right> $("#player").width()+pad || t.top<0-pad || t.bottom>$("#player").height()+pad;
  17782. }
  17783. ,
  17784. n.prototype.calcScale = function(e) {
  17785. return Math.sqrt(e / 40) * m.boardToDiscRatio
  17786. }
  17787. ,
  17788. n.prototype.updateOrientation = function(e) {
  17789. if (this.state !== I.ACTIVE) {
  17790. var t = 1 / 3
  17791. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  17792. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  17793. , r = "";
  17794. r += 0 === n ? "right" : 2 === n ? "left" : "",
  17795. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  17796. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  17797. 1 === i && (r = $('#player').width()>$('#player').height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  17798. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  17799. }
  17800. }
  17801. ,
  17802. n.prototype.applyOrientation = function(e) {
  17803. this.div.style.transform = this.div.style.webkitTransform = "",
  17804. this.div.classList.remove("tag-container-" + this.orientation),
  17805. this.div.classList.add("tag-container-" + e);
  17806. var t = window.getComputedStyle(this.div);
  17807. this.initialTransform = t.transform || t.webkitTransform,
  17808. "none" === this.initialTransform && (this.initialTransform = "");
  17809. var i = t.transform.slice(7, -1).split(",")
  17810. , n = -i[4]
  17811. , r = -i[5];
  17812. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  17813. this.div.style.transformOrigin = n + "px " + r + "px",
  17814. this.orientation = e
  17815. }
  17816. ,
  17817. t.exports = n
  17818. }
  17819. ).call(this, "/js/tag/Billboard/Billboard.js")
  17820. }
  17821. , {
  17822. "../../util/browser": 182,
  17823. "../../util/lerp": 188,
  17824. "../../util/logger": 189,
  17825. "../../util/transitions": 195,
  17826. "../Media/EmbedlyEmbed": 125,
  17827. "../Media/EmbedlyPlayer": 126,
  17828. "../Media/Image": 128,
  17829. "../Media/Link": 129,
  17830. "../Media/MediaEvent": 131,
  17831. "../Parser/DescriptionChunkType": 133,
  17832. "../Parser/DescriptionParser": 134,
  17833. "./BillboardEvent": 120,
  17834. "./billboardSettings": 121,
  17835. "./overlaySettings": 122,
  17836. events: 202
  17837. }],
  17838. 120: [function(e, t, i) {//"./tag/Billboard/BillboardEvent"
  17839. "use strict";
  17840. t.exports = Object.freeze({
  17841. ENTER: "billboard.enter",
  17842. LEAVE: "billboard.leave",
  17843. OPENING: "billboard.opening",
  17844. OPENED: "billboard.open",
  17845. CLOSING: "billboard.closing",
  17846. CLOSED: "billboard.closed",
  17847. ACTIVATING: "billboard.activating",
  17848. ACTIVATE: "billboard.activate"
  17849. })
  17850. }
  17851. , {}],
  17852. 121: [function(e, t, i) {//"./billboardSettings"
  17853. "use strict";
  17854. t.exports = Object.freeze({
  17855. animation: Object.freeze({
  17856. hoverOnClosing: !1,
  17857. openDelay: 100,
  17858. closeDelay: 50,
  17859. openDuration: 200,
  17860. closeDuration: 100
  17861. }),
  17862. boardToDiscRatio: 1.2
  17863. })
  17864. }
  17865. , {}],
  17866. 122: [function(e, t, i) {//"./overlaySettings
  17867. "use strict";
  17868. t.exports = Object.freeze({
  17869. boundaryWidth: 30,
  17870. boundaryHeight: 0
  17871. })
  17872. }
  17873. , {}],
  17874. 123: [function(e, t, i) {//js/tag/tag.js
  17875. (function(i) {
  17876. "use strict";
  17877. function n(e, t, i) {
  17878. var n = i.version || "0";
  17879. "0" !== n && I.info("tag defined using version " + n),
  17880. this.model = e,
  17881. this.sid = t,
  17882. this.color = (new r.Color).set(i.color || l.tagDefault),
  17883. this.hoverColor = l._darken(this.color, .2),
  17884. this.floor = null,
  17885. this.floorIndex = i.floor,
  17886. this.mode = s.PANORAMA,
  17887. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  17888. this.obj3d = null,
  17889. this.disc = null,
  17890. this.materials = {
  17891. disc: null,
  17892. pole: null
  17893. },
  17894. this.position = (new r.Vector3).copy(i.position),
  17895. //this.discPosition = (new r.Vector3).copy(i.stem.direction), //--MP xzw不要需要了
  17896. this.discWorldPosition = null,
  17897. this.discScale = .05,
  17898. //this.poleEnabled = i.stem.enabled,
  17899. this.billboard = new o(i.label,i.description,i.media,this),
  17900. this.visibleTransition = null,
  17901. this.hoveringDisc = !1;
  17902. //xzw:
  17903. if(i.posGets)this.setPosGets(i.posGets);
  17904. this.type = i.type || "note";
  17905. }
  17906. var r = e("three")
  17907. , o = e("./Billboard/Billboard")
  17908. , a = e("../settings")
  17909. , s = e("../enum/Viewmode")
  17910. , l = e("../enum/Colors")
  17911. , c = e("../enum/RenderLayers")
  17912. , h = e("../enum/RenderOrder")
  17913. , u = (e("../util/common"),
  17914. e("../util/math"))
  17915. , d = e("../util/texture")
  17916. , p = e("../objects/Panorama")
  17917. , f = e("../shaders")
  17918. , g = e("../util/transitions")
  17919. , m = e("../util/lerp")
  17920. , v = e("../util/easing")
  17921. , A = e("./Billboard/BillboardEvent")
  17922. , y = e("events").EventEmitter
  17923. , C = e("../util/logger")
  17924. , uu = e('../util/texture')//xzw add
  17925. , I = new C(i)
  17926. , 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==")
  17927. , 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")
  17928. , w = new r.PlaneBufferGeometry(1,1);
  17929. n.prototype = Object.create(y.prototype),
  17930. n.raycaster = new r.Raycaster,
  17931. n.prototype.bindEvents = function() {
  17932. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  17933. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  17934. }
  17935. ,
  17936. n.prototype.unbindEvent = function(){ //add by xzw
  17937. this.billboard.removeListener(A.ENTER, this.setHoverState.bind(this)),
  17938. this.billboard.removeListener(A.LEAVE, this.setFreeState.bind(this))
  17939. }
  17940. ,
  17941. n.prototype.remove = function(){ //add by xzw
  17942. this.unbindEvent();
  17943. this.obj3d.remove(this.disc);
  17944. this.floor.remove(this.obj3d);
  17945. this.billboard.div.parentElement.removeChild(this.billboard.div);
  17946. delete this.model.tags[this.sid];
  17947. this.tagManager.removeTag(this);
  17948. }
  17949. ,
  17950. n.prototype.rePos = function(pos){ //add by xzw 重新定位置
  17951. this.position.copy(pos);
  17952. this.obj3d.position.copy(pos);
  17953. }
  17954. ,
  17955. n.prototype.setPosGets = function(posGets){ //add by xzw 热点采集的两个点
  17956. if(posGets.list){
  17957. this.posGets = posGets;
  17958. return;
  17959. }
  17960. this.posGets = {list:[],length:2};
  17961. for(var i in posGets){
  17962. this.posGets[i] = new THREE.Vector3().fromArray(posGets[i]);
  17963. this.posGets.list.push(i);
  17964. }
  17965. }
  17966. n.prototype.TypeToChinese = function(){ //add by xzw
  17967. switch(this.type){
  17968. case "hotpoint": return "热点"; break;
  17969. case "photo": return "快照"; break;
  17970. case "note": return "注释"; break;
  17971. case "loading": return "加载"; break;
  17972. }
  17973. },
  17974. n.prototype.setElemType = function(type){ //add by xzw
  17975. this.type = type;
  17976. this.disc.material.uniforms.mask.value = uu.load("images/spots/tagFG-"+this.type+".png")
  17977. }
  17978. ,
  17979. n.prototype.build = function() {
  17980. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  17981. this.floor && (this.billboard.build(this.model.sid),
  17982. this.obj3d = this.buildObject3D(),
  17983. this.floor.add(this.obj3d)),
  17984. this
  17985. }
  17986. ,
  17987. n.prototype.buildObject3D = function() {//xzw
  17988. var e = new r.Object3D;
  17989. e.position.copy(this.position);
  17990. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  17991. t.bg.value = b,
  17992. t.mask.value = E,
  17993. t.color.value.copy(this.color),
  17994. this.materials.disc = new r.RawShaderMaterial({
  17995. transparent: !0,
  17996. vertexShader: f.tagDisc.vertexShader,
  17997. fragmentShader: f.tagDisc.fragmentShader,
  17998. uniforms: t
  17999. }),
  18000. this.disc = new r.Mesh(w,this.materials.disc),
  18001. this.disc.layers.set(c.TAG),
  18002. //this.disc.position.copy(this.discPosition),
  18003. this.disc.renderOrder = h.tagDisc,
  18004. this.disc.tag = this;
  18005. /* var i = this.buildPole(); //--MP
  18006. return i.layers.set(c.TAG),
  18007. i.renderOrder = h.tagStem,
  18008. e.add(i),
  18009. e.layers.set(c.TAG),
  18010. e.add(this.disc) */
  18011. e.add(this.disc) //去掉pole
  18012. e.name = "tagGroup";
  18013. return e
  18014. }
  18015. ,
  18016. n.prototype.buildPole = function() {//没用了
  18017. var e = new r.BufferGeometry
  18018. , t = new Float32Array(6);
  18019. return t[0] = t[1] = t[2] = 0,
  18020. t[3] = this.discPosition.x,
  18021. t[4] = this.discPosition.y,
  18022. t[5] = this.discPosition.z,
  18023. e.addAttribute("position", new r.BufferAttribute(t,3)),
  18024. this.materials.pole = new r.LineBasicMaterial({
  18025. linewidth: a.tags.pole.width,
  18026. color: a.tags.pole.color,
  18027. opacity: 0,
  18028. visible: this.poleEnabled,
  18029. transparent: !0,
  18030. depthWrite: !1
  18031. }),
  18032. new r.Line(e,this.materials.pole)
  18033. }
  18034. ,
  18035. n.prototype.setFreeState = function(e) {
  18036. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  18037. this.materials.disc.uniforms.color.value = this.color
  18038. }
  18039. .bind(this))
  18040. }
  18041. ,
  18042. n.prototype.setHoverState = function(e) {
  18043. this.billboard.open(e),
  18044. this.materials.disc.uniforms.color.value = this.hoverColor
  18045. }
  18046. ,
  18047. n.prototype.hide = function(e, t) {//xzw 热点的线pole不需要
  18048. var i = $.Deferred();
  18049. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  18050. return i.resolve().promise();
  18051. e = e || 0,
  18052. t = t || 0,
  18053. g.cancel(this.visibleTransition);
  18054. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  18055. , r = t + e
  18056. , o = t / r;
  18057. return this.visibleTransition = g.start(function(e) {
  18058. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  18059. // , i = m.property(e.materials.pole, "opacity", 0);
  18060. return function(n) {
  18061. t(n)
  18062. // e.materials.pole && i(n)
  18063. }
  18064. }(this), r * n, function() {
  18065. i.resolve()
  18066. }, o, v[a.warp.blendEasing]),
  18067. i.promise()
  18068. }
  18069. ,
  18070. n.prototype.show = function(e, t) {
  18071. var i = $.Deferred();
  18072. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  18073. return i.resolve().promise();
  18074. e = e || 0,
  18075. t = t || 0,
  18076. g.cancel(this.visibleTransition);
  18077. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  18078. , r = t + e
  18079. , o = t / r;
  18080. return this.visibleTransition = g.start(function(e) {
  18081. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  18082. // , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  18083. return function(n) {
  18084. t(n)
  18085. // e.materials.pole && i(n)
  18086. }
  18087. }(this), r * n, function() {
  18088. i.resolve()
  18089. }, o, v[a.warp.blendEasing]),
  18090. i.promise()
  18091. }
  18092. ,
  18093. /* n.prototype.closestPanoTowardTag = function(e, t) {// ---MP
  18094. var i = []
  18095. , o = []
  18096. , l = this.disc.getWorldPosition();
  18097. if (e === s.PANORAMA) {
  18098. var c = .5
  18099. , h = t.position.clone().sub(l).normalize();
  18100. i.push(p.filters.isPanoAligned()),
  18101. i.push(p.filters.inPanoDirection(l, h, c)),
  18102. i.push(p.filters.isNeighbourPanoTo(t)),
  18103. o.push(p.scoreFunctions.direction(l, h))
  18104. }
  18105. var u = new r.Vector3
  18106. , d = function(e) {
  18107. u.copy(l).sub(e.position);
  18108. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  18109. , i = a.tags.navigate.tiltTolerance;
  18110. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  18111. }
  18112. , f = function(e) {
  18113. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  18114. };
  18115. i.push(f, d),
  18116. o.push(p.scoreFunctions.distanceSquared(this, -2));
  18117. var g = this.model.panos.sortByScore(i, o);
  18118. if (a.tags.navigate.lineOfSight) {
  18119. for (var m = 0; m < g.length; m++) {
  18120. var v = g[m].pano
  18121. , A = v.position.distanceTo(l);
  18122. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  18123. return null;
  18124. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  18125. var y = n.raycaster.intersectObjects(this.model.colliders);
  18126. if (0 === y.length || y[0].distance > A)
  18127. return v
  18128. }
  18129. return null
  18130. }
  18131. return g.length > 0 && g[0].pano
  18132. } */
  18133. n.prototype.closestPanoTowardTag = function(e, t, type) {//寻找最接近热点的pano
  18134. var i = []
  18135. , o = []
  18136. , l = this.disc.getWorldPosition();
  18137. if (e === s.PANORAMA) {
  18138. var c = .5
  18139. , h = t.position.clone().sub(l).normalize();
  18140. if(type!="force") i.push(p.filters.inPanoDirection(l, h, c)); // i.push(p.filters.isPanoAligned()),
  18141. var tag = this;
  18142. i.push(function(t){ //是否可见
  18143. return t.neighbourPanos[tag.posGets.list[0]] || t.neighbourPanos[tag.posGets.list[1]];
  18144. }) //}else i.push(p.filters.isNeighbourPanoTo(t))//!force2
  18145. o.push(p.scoreFunctions.direction(l, h))
  18146. }
  18147. var u = new r.Vector3, d = function(e){
  18148. u.copy(l).sub(e.position);
  18149. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  18150. , i = a.tags.navigate.tiltTolerance;
  18151. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  18152. }
  18153. , f = function(e) {
  18154. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  18155. };
  18156. i.push(f, d),//如果force要不要不push??否则会有得到null的风险,于是就在currentPano处展开,而curentPAno处可能disc不可见。
  18157. o.push(p.scoreFunctions.distanceSquared(this, -2));
  18158. var g = this.model.panos.sortByScore(i, o);//var g = this.model.panos.sortByScore(i, o);
  18159. /* if (type!= "force" && g && a.tags.navigate.lineOfSight) {
  18160. for (var m = 0; m < g.length; m++) {
  18161. var v = g[m].pano
  18162. , A = v.position.distanceTo(l);
  18163. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  18164. return null;
  18165. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  18166. var ee = this.model.floorList.reduce(function(t, e) {
  18167. return e.hidden ? t : t.concat(e.collider.children)
  18168. }, []);
  18169. var y = n.raycaster.intersectObjects(ee);
  18170. if (0 === y.length || y[0].distance > A - this.discScale*SIZE/2)//discScale
  18171. return v
  18172. }
  18173. //if(type == "force") return this.closestPanoTowardTag(e, t, "force2");
  18174. return null;
  18175. } */
  18176. return g && g.length > 0 && g[0].pano
  18177. }
  18178. ,
  18179. n.prototype.getAngle = function(player, lookAt){//xzw 加 算视线方向与对准方向的夹角
  18180. var b = player.camera.quaternion.clone()
  18181. , _ = (new r.Matrix4).lookAt(player.currentPano.position, lookAt, new r.Vector3(0,1,0))
  18182. , T = (new r.Quaternion).setFromRotationMatrix(_)
  18183. ,R = new r.Vector3(0,0,-1).clone().applyQuaternion(b)
  18184. , P = new r.Vector3(0,0,-1).clone().applyQuaternion(T)
  18185. , O = R.angleTo(P);
  18186. return O / Math.PI * 180;
  18187. }
  18188. n.prototype.examine = function(e,type) { //校准tag xzw
  18189. var t = e.mode
  18190. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  18191. , n = this.disc.getWorldPosition();
  18192. this.billboard.setActiveState();
  18193. //xzw
  18194. e.flyingToTag = true;
  18195. var done = function(t){ t.billboard.examTimes=0; e.flyingToTag = false; }
  18196. //----end
  18197. var o = function() {
  18198. if(e.mode != "panorama"){//xzw 加
  18199. e.flyingToTag = false;
  18200. return;
  18201. }
  18202. var t = this.billboard.getDimensions()
  18203. , n = new r.Vector3;
  18204. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  18205. n.unproject(e.camera);
  18206. e.flyToPano({
  18207. pano: i,
  18208. lookAtPoint: n,
  18209. constantMoveSpeed: v=="constant" //匀速 xzw
  18210. },function(){ //函数xzw加的 因为有可能校准结束要再校准一次
  18211. if(this.billboard.ifOutOfScreen()){
  18212. this.billboard.state = "open";//为了防止有的billboard在飞过去后靠边被遮住
  18213. setTimeout(function(){
  18214. if(this.billboard.ifOutOfScreen()){
  18215. if(this.billboard.examTimes > 2){
  18216. console.log("exam>2次仍未校准,已放弃"); done(this); return;
  18217. }
  18218. o("constant");
  18219. this.billboard.examTimes++;
  18220. }else done(this);
  18221. }.bind(this),60)
  18222. }else done(this)
  18223. }.bind(this))
  18224. }.bind(this);
  18225. if (t === s.PANORAMA)
  18226. if (i !== e.currentPano || (type === "force"&& this.getAngle(e, n)>60) ) {//在click List时 转动较大的话 会不准确 可能因计算billboard位置不准确
  18227. var l = {
  18228. pano: i,
  18229. lookAtPoint: n,
  18230. duration: null,
  18231. maxDistanceOverride: null,
  18232. skipWarpingCheck: !1,
  18233. force : type == "force"//xzw
  18234. };
  18235. e.flyToPano(l, o)
  18236. } else
  18237. setTimeout(function() {
  18238. //this.billboard.open().then(function() { // ----MP 其实可以去掉 有了反而不准
  18239. o()
  18240. //})
  18241. }
  18242. .bind(this), 300);//原先是0
  18243. else {
  18244. var c = {
  18245. pano: i
  18246. };
  18247. if (n) {
  18248. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  18249. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  18250. }
  18251. c.callback = o,
  18252. c.duration = 1500,
  18253. c.mode = s.PANORAMA,
  18254. e.flyToNewMode(c)//xzw
  18255. }
  18256. }
  18257. ,
  18258. n.prototype.update = function(e, t) {
  18259. var i = new r.Vector3;
  18260. return function(e, t) {
  18261. this.discWorldPosition = this.disc.getWorldPosition(),
  18262. this.updateDisc(e, t);
  18263. /* this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t), ------MP
  18264. i.z < 1 && (i.y *= -1,
  18265. this.billboard.update(i, this.getDiscRadius(i, t)))) */
  18266. if(this.billboard.needsUpdate()){//xzw
  18267. i.copy(this.discWorldPosition).project(t);
  18268. if(i.z < 1 || this.updateBoardOrient){
  18269. i.y *= -1;
  18270. this.updateBoardOrient = false; //由点击列表而exam,更新orientation
  18271. this.billboard.div.style.opacity = "1";//由点击列表而exam, 未达到可见位置不出现 通常在左上方?
  18272. this.billboard.update(i, this.getDiscRadius(i, t))
  18273. }else{
  18274. this.billboard.div.style.opacity = "0";
  18275. }
  18276. }
  18277. }
  18278. }(),
  18279. n.prototype.updateDisc = function(e, t) {
  18280. var i = new r.Vector3
  18281. , o = new r.Vector3
  18282. , l = new r.Vector3
  18283. , c = new r.Vector3
  18284. , h = new r.Vector3;
  18285. return function(e, t) {
  18286. var u = a.tags.visibility
  18287. , d = a.tags.disc.scale
  18288. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  18289. 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)),
  18290. this.obj3d.visible) {
  18291. this.disc.quaternion.copy(t.quaternion);
  18292. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  18293. i.copy(this.discWorldPosition).project(t),
  18294. o.set($('#player').width()/2 , $('#player').height()/2, 1).multiply(i),
  18295. l.set(f / 2, 0, 0).add(o),
  18296. c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
  18297. h.copy(c).unproject(t);
  18298. var g = h.distanceTo(this.discWorldPosition)
  18299. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  18300. this.discScale = g * m,
  18301. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  18302. }
  18303. }
  18304. }(),
  18305. n.prototype.getDiscRadius = function(e, t) {
  18306. var i = new r.Vector3;
  18307. return function(e, t) {
  18308. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  18309. Math.abs(e.x - i.x) * $('#player').width()
  18310. }
  18311. }(),
  18312. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  18313. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  18314. }
  18315. ,
  18316. n.prototype.offScreen = function(e, t) {
  18317. var i = e.getWorldPosition().project(t);
  18318. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  18319. }
  18320. ,
  18321. n.viewportScale = function() {
  18322. return n.viewportWidth === $('#player').width() && n.viewportHeight === $('#player').height() || (n.viewportWidth = $('#player').width(),
  18323. n.viewportHeight = $('#player').height(),
  18324. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  18325. n.currentViewportScale
  18326. }
  18327. ,
  18328. t.exports = n
  18329. }
  18330. ).call(this, "/js/tag/tag.js")
  18331. }
  18332. , {
  18333. "../enum/Colors": 19,
  18334. "../enum/RenderLayers": 41,
  18335. "../enum/RenderOrder": 42,
  18336. "../enum/Viewmode": 51,
  18337. "../objects/Panorama": 148,
  18338. "../settings": 166,
  18339. "../shaders": 167,
  18340. "../util/common": 185,
  18341. "../util/easing": 186,
  18342. "../util/lerp": 188,
  18343. "../util/logger": 189,
  18344. "../util/math": 190,
  18345. "../util/texture": 194,
  18346. "../util/transitions": 195,
  18347. "./Billboard/Billboard": 119,
  18348. "./Billboard/BillboardEvent": 120,
  18349. "../util/texture" :194,
  18350. events: 202,
  18351. three: 217
  18352. }],
  18353. 124: [function(e, t, i) {///js/tag/tagManager.js
  18354. (function(i) {
  18355. "use strict";
  18356. function n() {
  18357. this.tagState = y.IDLE,
  18358. this.intersectTag = null,
  18359. this.hoveredTag = null,
  18360. this.activeTag = null,
  18361. this.tagDiscs = [],
  18362. this.raycaster = new r.Raycaster,
  18363. this.modelManager = null,
  18364. this.player = null,
  18365. this.totaltags = 0,
  18366. this.navigatingViaTag = !1
  18367. // this.enabled = !1
  18368. }
  18369. var r = e("three")
  18370. , o = e("../util/logger")
  18371. , a = e("../util/common")
  18372. , s = e("../controls/serializer")
  18373. , l = e("../objects/Snapshot")
  18374. , c = e("../settings")
  18375. , h = e("./Billboard/BillboardEvent")
  18376. , u = e("./Media/MediaEvent")
  18377. , d = e("./Media/LinkType")
  18378. , p = e("../enum/Viewmode")
  18379. , f = e("../enum/WarpStyle")
  18380. , g = e("../enum/BlackoutStyle")
  18381. , m = e("../enum/ModelManagerEvents")
  18382. , v = e("../enum/tagEvents")
  18383. , A = e("../enum/PlayerEvents")
  18384. , y = (e("../util/lerp"),
  18385. e("../enum/TagStates"))
  18386. , C = e("events").EventEmitter
  18387. , I = new o(i);
  18388. a.extend(n, C),
  18389. n.prototype.init = function(e, t) {
  18390. this.modelManager = e,
  18391. this.player = t,
  18392. this.updateModel(),
  18393. this.bindEvents()
  18394. }
  18395. ,
  18396. n.prototype.update = function(e) {
  18397. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  18398. }
  18399. ,
  18400. n.prototype.updateTags = function(e, t, i, n) {
  18401. for (var r in this.model.tags)
  18402. this.model.tags[r].update(e, t, i, n)
  18403. }
  18404. ,
  18405. n.prototype.updateVisible = function(mode, pano){ //xzw加 根据visibles数据更新热点显示
  18406. if(!(this.player || this.player.model)) return;
  18407. var tags = this.player.model.tags;
  18408. pano = pano || this.player.currentPano;
  18409. for (var r in tags){
  18410. var visible;
  18411. if(mode!="panorama"){
  18412. visible = true;
  18413. tags[r].disc.material.depthTest = true; //要被遮挡?
  18414. }else{
  18415. tags[r].disc.material.depthTest = false;
  18416. visible = tags[r].state != "rebuildHide" && (pano.neighbourPanos[tags[r].posGets.list[0]] || pano.neighbourPanos[tags[r].posGets.list[1]])
  18417. }
  18418. tags[r].disc.visible = visible;
  18419. }
  18420. }
  18421. ,
  18422. /* n.prototype.updateModel = function() {//---MP
  18423. this.model = this.modelManager.getActiveModel(),
  18424. this.gettagsFromModel(),
  18425. this.totaltags = Object.keys(this.model.tags).length
  18426. }
  18427. ,
  18428. n.prototype.gettagsFromModel = function() {
  18429. this.tagDiscs = [];
  18430. for (var e in this.model.tags) {
  18431. var t = this.model.tags[e].disc;
  18432. t && this.tagDiscs.push(t)
  18433. }
  18434. }
  18435. , */
  18436. //xzw: 获取tag的disc 因为编辑页面要一个个添加、一个个删除 所以改
  18437. n.prototype.updateModel = function() {
  18438. this.model = this.modelManager.getActiveModel(),
  18439. this.tagDiscs = [];
  18440. this.totaltags = 0;
  18441. for (var e in this.model.tags) {
  18442. this.getTag(this.model.tags[e])
  18443. }
  18444. }
  18445. ,
  18446. n.prototype.getTag = function(tag) {
  18447. this.tagDiscs.push(tag.disc);
  18448. this.totaltags ++;
  18449. tag.tagManager = this;
  18450. }
  18451. ,
  18452. n.prototype.removeTag = function(tag) {
  18453. var i = this.tagDiscs.indexOf(tag.disc);
  18454. if(i>-1){
  18455. this.tagDiscs.splice(i,1);
  18456. this.totaltags --;
  18457. }
  18458. }
  18459. ////xzw----end
  18460. n.prototype.bindEvents = function() {
  18461. function e() {
  18462. Object.keys(this.model.tags).forEach(function(e) {
  18463. var t = this.model.tags[e];
  18464. t.bindEvents(),
  18465. t.billboard.on(u.LINK_CLICK, function(e) {
  18466. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  18467. }
  18468. .bind(this)),
  18469. t.billboard.on(u.IMAGE_OPENED, function() {
  18470. this.tagState = y.EXAMINE,
  18471. this.emit(u.IMAGE_OPENED)
  18472. }
  18473. .bind(this)),
  18474. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  18475. }
  18476. .bind(this))
  18477. }
  18478. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  18479. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  18480. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  18481. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  18482. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  18483. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  18484. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  18485. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  18486. e.call(this)
  18487. }
  18488. ,
  18489. n.prototype.navigateViaLink = function(e) {
  18490. var t = s.deserialize(e);
  18491. if (t)
  18492. if (t.mode === p.PANORAMA) {
  18493. try {
  18494. this.player.model.panos.get(t.panoId)
  18495. } catch (e) {
  18496. return void I.warn("Unable to find panorama location", t.panoId)
  18497. }
  18498. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  18499. } else {
  18500. var i = {
  18501. cameraMode: t.mode,
  18502. position: t.position,
  18503. quaternion: t.quaternion,
  18504. scanId: t.panoId,
  18505. orthoZoom: t.zoom,
  18506. floorVisibility: t.floorVisibility,
  18507. thumbUrl: null,
  18508. name: null
  18509. };
  18510. this.player.flyToNewMode({
  18511. mode: t.mode,
  18512. duration: c.warp.outsideTime,
  18513. warpDest: new l(i),
  18514. force: !0
  18515. })
  18516. }
  18517. }
  18518. ,
  18519. n.prototype.handleWarpStart = function(e, t, i, n) {
  18520. this.dismissExaminedTag(),
  18521. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  18522. e && (i = g.END),
  18523. this.hideShowTagsForBlackoutStyle(i, n))
  18524. }
  18525. ,
  18526. n.prototype.handleWarpInterruption = function(e, t, i) {
  18527. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  18528. this.hideShowTagsForBlackoutStyle(t, i)
  18529. }
  18530. ,
  18531. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  18532. var i = 0
  18533. , n = 0
  18534. , r = t / 2;
  18535. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  18536. e) {
  18537. case g.END:
  18538. this.hideAlltags(r);
  18539. break;
  18540. case g.BEGINNING:
  18541. this.hideAlltags().done(this.showAlltags.bind(this, r));
  18542. break;
  18543. case g.NONE:
  18544. break;
  18545. case g.MIDDLE:
  18546. i = r,
  18547. n = r,
  18548. this.hideAlltags(n),
  18549. setTimeout(function() {
  18550. this.showAlltags(i)
  18551. }
  18552. .bind(this), n);
  18553. break;
  18554. case g.FADEIN:
  18555. setTimeout(function() {
  18556. this.showAlltags(r)
  18557. }
  18558. .bind(this), r)
  18559. }
  18560. }
  18561. ,
  18562. n.prototype.onPlayerModeChanging = function(e, t) {
  18563. t !== p.PANORAMA && this.dismissExaminedTag(),
  18564. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  18565. var i = t !== p.OUTDOOR;
  18566. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  18567. }
  18568. ,
  18569. n.prototype.onPanoChange = function(e, t) {
  18570. var i = this.navigatingViaTag;
  18571. if (this.navigatingViaTag = !1,
  18572. !i) {
  18573. //this.dismissExaminedTag(); //xzw删 否则会导致热点加上打开又被关闭
  18574. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  18575. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  18576. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  18577. }
  18578. }
  18579. ,
  18580. n.prototype.onPlayerReady = function(e, t, i) {
  18581. this.startAlltags(e, t ? i : null)
  18582. }
  18583. ,
  18584. n.prototype.onPlayerFlyingEnded = function(e, t) {
  18585. this.updateClosestTags(e)
  18586. }
  18587. ,
  18588. n.prototype.dismissExaminedTag = function() {
  18589. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  18590. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  18591. this.hoveredTag = null)
  18592. }
  18593. ,
  18594. n.prototype.startAlltags = function(e, t) {
  18595. this.model.shouldShowtags = c.tags.enabled,
  18596. this.enabled = !0,
  18597. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  18598. t && setTimeout(function() {
  18599. this.activateTag(this.model.getTagBySid(t))
  18600. }
  18601. .bind(this), c.tags.startup.fadeInDuration / 2))
  18602. }
  18603. ,
  18604. n.prototype.showAlltags = function(e, t, i) {
  18605. function n() {
  18606. o++,
  18607. o === this.totaltags && (this.model.tagsShown = !0,
  18608. r.resolve())
  18609. }
  18610. var r = $.Deferred();
  18611. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  18612. return r.resolve().promise();
  18613. var o = 0;
  18614. for (var a in this.model.tags) {
  18615. var s = this.model.tags[a];
  18616. s.show(e, t).done(n.bind(this))
  18617. }
  18618. return r.promise()
  18619. }
  18620. ,
  18621. n.prototype.hideAlltags = function(e, t) {
  18622. function i() {
  18623. r++,
  18624. r === this.totaltags && (this.model.tagsShown = !1,
  18625. n.resolve())
  18626. }
  18627. var n = $.Deferred()
  18628. , r = 0;
  18629. for (var o in this.model.tags) {
  18630. var a = this.model.tags[o];
  18631. a.hide(e, t).done(i.bind(this)),
  18632. a === this.activeTag && this.dismissActiveTag()
  18633. }
  18634. return n.promise()
  18635. }
  18636. ,
  18637. n.prototype.enableHovering = function() {
  18638. this.enabled = !0
  18639. }
  18640. ,
  18641. n.prototype.disableHovering = function() {
  18642. this.enabled = !1
  18643. }
  18644. ,
  18645. n.prototype.activateTag = function(e, t) {
  18646. t = t || y.EXAMINE,
  18647. this.activeTag = e,
  18648. this.activeTag.hoveringDisc = !0,
  18649. this.activeTag.setHoverState(t === y.EXAMINE),
  18650. this.tagState = t,
  18651. this.emit(v.TagActivated, e)
  18652. }
  18653. ,
  18654. n.prototype.dismissActiveTag = function() {
  18655. this.activeTag.hoveringDisc = !1,
  18656. this.activeTag.setFreeState(!0);
  18657. var e = this.activeTag;
  18658. this.activeTag = null,
  18659. this.tagState = y.IDLE,
  18660. this.emit(v.TagDismissed, e)
  18661. }
  18662. ,
  18663. n.prototype.clickedOnTag = function(e) {
  18664. //xzw 打开热点列表
  18665. if(this.player.markspot || this.player.startGetPos) return;
  18666. var canOpen = this.player.editor.openList(this.intersectTag.listElem)
  18667. if(!canOpen && (this.intersectTag!=this.player.chosenSpot || this.intersectTag.billboard.label == "")){ //在无法关闭当前列表时点击其他热点
  18668. return;
  18669. }
  18670. this.player.editor.openPanel(0);
  18671. //end
  18672. var t = function() {
  18673. this.navigatingViaTag = !0,
  18674. this.activeTag.examine(this.player),
  18675. this.emit(v.TagNavigation, this.activeTag)
  18676. }
  18677. .bind(this);
  18678. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  18679. this.activeTag = this.intersectTag,
  18680. t(),
  18681. !0) : (this.dismissActiveTag(),
  18682. !1)
  18683. }
  18684. ,
  18685. n.prototype.intersecttag = function() {//对应旧的findIntersectTag
  18686. var e = new r.Vector3
  18687. , t = new r.Vector3
  18688. , i = new r.Vector3;
  18689. return function(n, r, o) {
  18690. /* if (!this.enabled) //xzw 没必要
  18691. return null; */
  18692. var a = null
  18693. , s = this.tagDiscs.filter(function(e) {
  18694. return e.parent.visible
  18695. });
  18696. if (s.length > 0) {
  18697. /* var l = this.model.floors.reduce(function(e, t) {
  18698. return t.hidden ? e : e.concat(t.collider.children)
  18699. }, s); */
  18700. //xzw: 热点即使被墙挡住,只要显示就要能被hover
  18701. var l;
  18702. if(this.player.mode != "panorama") l = this.model.floors.reduce(function(e, t) {
  18703. return t.hidden ? e : e.concat(t.collider.children)
  18704. }, s);
  18705. else l = s;
  18706. e.set(n.x, n.y, -1).unproject(o),
  18707. t.set(n.x, n.y, 1).unproject(o),
  18708. i.copy(t).sub(e).normalize(),
  18709. this.raycaster.set(e, i);
  18710. var c = this.raycaster.intersectObjects(l);
  18711. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  18712. }
  18713. return this.intersectTag = a,
  18714. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  18715. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  18716. this.hoveredTag = a
  18717. }
  18718. .bind(this)),
  18719. a.billboard.on(h.LEAVE, function() {
  18720. this.hoveredTag = null
  18721. }
  18722. .bind(this))),
  18723. this.activateTag(a, y.BROWSE))),
  18724. a
  18725. }
  18726. }(),
  18727. n.prototype.rankedtagInDirection = function() {
  18728. var e = []
  18729. , t = []
  18730. , i = new r.Vector3
  18731. , n = new r.Vector3
  18732. , o = new r.Vector3;
  18733. return function(r, a, s, l) {
  18734. var c = 0;
  18735. t.length = 0;
  18736. for (var h = 0; h < this.closesttags.length; h++) {
  18737. var u = this.closesttags[h];
  18738. n.copy(u.position),
  18739. n.add(u.discPosition),
  18740. i.copy(a),
  18741. i.sub(n).negate(),
  18742. i.normalize();
  18743. var d = i.dot(l);
  18744. if (d >= 0) {
  18745. o.copy(n),
  18746. o.project(s);
  18747. var p = this.intersecttag(o, !1, s);
  18748. if (p) {
  18749. if (c >= e.length)
  18750. for (var f = 0; f < 64; f++)
  18751. e.push({
  18752. tag: u,
  18753. dot: d
  18754. });
  18755. var g = e[c];
  18756. g.tag = u,
  18757. g.dot = d,
  18758. g.position = math.projectPositionToCanvas(n, s),
  18759. t.push(g),
  18760. c++
  18761. }
  18762. }
  18763. }
  18764. return t.sort(function(e, t) {
  18765. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  18766. }),
  18767. r < t.length ? t[r].tag : null
  18768. }
  18769. }(),
  18770. n.prototype.updateClosestTags = function() {
  18771. var e = new r.Vector3
  18772. , t = 30;
  18773. return function(i) {
  18774. this.closesttags || (this.closesttags = []),
  18775. this.closesttags.length = 0;
  18776. var n = this.model.tags;
  18777. if (n)
  18778. for (var r in n)
  18779. if (n.hasOwnProperty(r)) {
  18780. var o = n[r]
  18781. , a = o.position;
  18782. e.copy(i),
  18783. e.sub(a).negate();
  18784. var s = e.lengthSq();
  18785. s < t && this.closesttags.push(o)
  18786. }
  18787. }
  18788. }(),
  18789. t.exports = n
  18790. }
  18791. ).call(this, "/js/tag/tagManager.js")
  18792. }
  18793. , {
  18794. "../controls/serializer": 14,
  18795. "../enum/BlackoutStyle": 18,
  18796. "../enum/tagEvents": 32,
  18797. "../enum/ModelManagerEvents": 33,
  18798. "../enum/PlayerEvents": 40,
  18799. "../enum/TagStates": 44,
  18800. "../enum/Viewmode": 51,
  18801. "../enum/WarpStyle": 52,
  18802. "../objects/Snapshot": 153,
  18803. "../settings": 166,
  18804. "../util/common": 185,
  18805. "../util/lerp": 188,
  18806. "../util/logger": 189,
  18807. "./Billboard/BillboardEvent": 120,
  18808. "./Media/LinkType": 130,
  18809. "./Media/MediaEvent": 131,
  18810. events: 202,
  18811. three: 217
  18812. }],
  18813. 125: [function(e, t, i) {///js/tag/Media/EmbedlyEmbed.js
  18814. (function(i) {
  18815. "use strict";
  18816. function n() {
  18817. this.embedWrapper = null,
  18818. this.embedElement = null
  18819. }
  18820. var r = e("../../util/ajax")
  18821. , o = e("./mediaSettings")
  18822. , a = e("../../settings")
  18823. , s = e("../../util/logger")
  18824. , l = new s(i);
  18825. n.prototype.createDomElement = function() {
  18826. return this.embedWrapper = document.createElement("div"),
  18827. this.embedWrapper.classList.add("tag-embed"),
  18828. this.embedWrapper.classList.add("hidden"),
  18829. this.embedWrapper
  18830. }
  18831. ,
  18832. n.prototype.load = function(e) {
  18833. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  18834. return new Promise(function(e, i) {
  18835. r.get(t).then(function(t) {
  18836. if (t = JSON.parse(t),
  18837. t.html && t.html.indexOf("<script") === -1) {
  18838. this.embedWrapper.innerHTML = t.html;
  18839. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  18840. if (this.embedWrapper.style.width = n + "px",
  18841. t.height) {
  18842. var r = t.height / t.width;
  18843. this.embedWrapper.style.height = n * r + "px"
  18844. }
  18845. this.embedElement = this.embedWrapper.firstChild;
  18846. var a = [];
  18847. try {
  18848. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  18849. } catch (e) {
  18850. l.debug("Error getting `a` elements for embed; was it an iframe?")
  18851. }
  18852. a.forEach(function(e) {
  18853. e.setAttribute("target", "_blank")
  18854. }),
  18855. this.embedElement.classList.add("hidden"),
  18856. this.embedWrapper.classList.remove("hidden"),
  18857. e()
  18858. } else
  18859. i("Not a valid embed")
  18860. }
  18861. .bind(this), function(e) {
  18862. i(e.response)
  18863. })
  18864. }
  18865. .bind(this))
  18866. }
  18867. ,
  18868. n.prototype.show = function() {
  18869. this.embedElement && this.embedElement.classList.remove("hidden")
  18870. }
  18871. ,
  18872. n.prototype.hide = function() {
  18873. this.embedElement && this.embedElement.classList.add("hidden")
  18874. }
  18875. ,
  18876. t.exports = n
  18877. }
  18878. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  18879. }
  18880. , {
  18881. "../../settings": 166,
  18882. "../../util/ajax": 181,
  18883. "../../util/logger": 189,
  18884. "./mediaSettings": 132
  18885. }],
  18886. 126: [function(e, t, i) {///js/tag/Media/EmbedlyPlayer.js
  18887. (function(i) {
  18888. "use strict";
  18889. function n(e) {
  18890. o.call(this),
  18891. this.options = e,
  18892. this.playerControls = null,
  18893. this.state = s.NOT_READY
  18894. }
  18895. var r = e("../../util/browser")
  18896. , o = e("./EmbedlyEmbed")
  18897. , a = e("../../util/logger")
  18898. , s = (new a(i),
  18899. Object.freeze({
  18900. NOT_READY: "player.not.ready",
  18901. CUED: "player.cued",
  18902. PLAYING: "player.playing",
  18903. PAUSED: "player.paused"
  18904. }));
  18905. n.prototype = Object.create(o.prototype),
  18906. n.prototype.createDomElement = function() {
  18907. return this.embedWrapper = document.createElement("div"),
  18908. this.embedWrapper.classList.add("tag-video"),
  18909. this.embedWrapper.classList.add("hidden"),
  18910. this.embedWrapper
  18911. }
  18912. ,
  18913. n.prototype.load = function(e) {
  18914. var t = function() {
  18915. function e(e) {
  18916. this.playerState = s.CUED,
  18917. this.options.startMuted && this.playerControls.mute()
  18918. }
  18919. function t(e) {
  18920. this.playerState = e
  18921. }
  18922. function i(e) {
  18923. this.playerControls.setCurrentTime(0),
  18924. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  18925. }
  18926. this.playerControls = new playerjs.Player(this.embedElement),
  18927. this.playerControls.on("ready", e.bind(this)),
  18928. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  18929. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  18930. this.playerControls.on("ended", i.bind(this))
  18931. }
  18932. .bind(this);
  18933. return o.prototype.load.call(this, e).then(t.bind(this))
  18934. }
  18935. ,
  18936. n.prototype.play = function() {
  18937. var e = r.isMobile();
  18938. return function() {
  18939. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  18940. }
  18941. }(),
  18942. n.prototype.pause = function() {
  18943. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  18944. }
  18945. ,
  18946. t.exports = n
  18947. }
  18948. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  18949. }
  18950. , {
  18951. "../../util/browser": 182,
  18952. "../../util/logger": 189,
  18953. "./EmbedlyEmbed": 125
  18954. }],
  18955. 127: [function(e, t, i) {///js/tag/Media/EmbedlyQueue.js
  18956. (function(i) {
  18957. "use strict";
  18958. function n(e) {
  18959. function t() {
  18960. return a.debug("requesting file from embedly:", e.href),
  18961. r.get(e.href, {
  18962. responseType: e.responseType
  18963. }).then(function(t) {
  18964. return a.debug("requesting file finished:", e.href),
  18965. t
  18966. })
  18967. }
  18968. function i() {}
  18969. return s = new Promise(function(e, n) {
  18970. s.catch(i).then(function() {
  18971. t().then(e, n)
  18972. })
  18973. }
  18974. )
  18975. }
  18976. var r = e("../../util/ajax")
  18977. , o = (e("./mediaSettings"),
  18978. e("../../util/logger"))
  18979. , a = new o(i)
  18980. , s = Promise.resolve();
  18981. t.exports.enqueue = n
  18982. }
  18983. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  18984. }
  18985. , {
  18986. "../../util/ajax": 181,
  18987. "../../util/logger": 189,
  18988. "./mediaSettings": 132
  18989. }],
  18990. 128: [function(e, t, i) {///js/tag/Media/Image.js
  18991. (function(i) {
  18992. "use strict";
  18993. function n() {
  18994. this.imageWrapper = null,
  18995. this.width = 0,
  18996. this.height = 0,
  18997. this.aspect = 1
  18998. }
  18999. var r = e("./MediaEvent")
  19000. , o = e("./EmbedlyQueue")
  19001. , a = e("events").EventEmitter
  19002. , s = e("../../util/logger")
  19003. , l = e("../../settings");
  19004. new s(i);
  19005. n.prototype = Object.create(a.prototype),
  19006. n.prototype.createDomElement = function() {
  19007. return this.imageWrapper = new Image,//document.createElement("div"), xzw
  19008. this.imageWrapper.classList.add("tag-image"),
  19009. this.imageWrapper.classList.add("hidden"),
  19010. this.imageWrapper.addEventListener("click", function(e) {
  19011. e.stopPropagation(),
  19012. this.emit(r.IMAGE_OPENING),
  19013. this.imageWrapper.style.pointerEvents = "none"
  19014. }
  19015. .bind(this)),
  19016. this.imageWrapper
  19017. }
  19018. ,
  19019. n.prototype.onClosed = function() {
  19020. this.imageWrapper.style.pointerEvents = "auto"
  19021. }
  19022. ,
  19023. /* n.prototype.load = function(e) {
  19024. var t = Math.max(window.screen.height, window.screen.width)
  19025. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  19026. return new Promise(function(e, t) {
  19027. function n(t) {
  19028. var i = t.target;
  19029. this.width = i.naturalWidth,
  19030. this.height = i.naturalHeight,
  19031. this.aspect = this.width / this.height;
  19032. var n = t.target.src;
  19033. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  19034. this.imageWrapper.style.width = this.width + "px",
  19035. this.imageWrapper.style.height = this.height + "px",
  19036. this.imageWrapper.classList.remove("hidden"),
  19037. e()
  19038. }
  19039. o.enqueue({
  19040. href: i,
  19041. responseType: "arraybuffer"
  19042. }).then(function(e) {
  19043. var t = new Uint8Array(e)
  19044. , i = new Blob([t])
  19045. , r = new window.Image;
  19046. r.addEventListener("load", n.bind(this));
  19047. var o = URL.createObjectURL(i);
  19048. r.src = o
  19049. }
  19050. .bind(this), t)
  19051. }
  19052. .bind(this))
  19053. } */ //--------MP_AB_TESTS
  19054. n.prototype.load = function(e, billboard) {//loadImg xzw
  19055. // var t = Math.max(window.screen.height, window.screen.width)
  19056. // , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  19057. var done = function(img,billboard){
  19058. var s = 1,scaleImg,activeClass;
  19059. _this.aspect = img.width / img.height;//naturalWidth可能为0
  19060. var r = Math.max(img.width / maxWidth, img.height / maxHeight);
  19061. if(r > 1) s = r;
  19062. _this.width = img.width / s;
  19063. _this.height = img.height / s;
  19064. if(r > 1) s = r;
  19065. _this.width = img.width / s;
  19066. _this.height = img.height / s;
  19067. //billboard.childNodes[0].style.maxWidth = (_this.width + 20) + "px";
  19068. /* scaleImg = (_this.height *100) / (_this.width*100) * 100 / 2;
  19069. scaleImg = Math.round(scaleImg);
  19070. if(scaleImg%2 != 0){
  19071. scaleImg += 1;
  19072. }
  19073. activeClass = 'per'+scaleImg;
  19074. _this.imageWrapper.classList.add(activeClass);
  19075. _this.imageWrapper.style.backgroundImage = 'url("' + img.src + '")', */
  19076. _this.imageWrapper.src = img.src;
  19077. _this.imageWrapper.style.width = _this.width + "px",
  19078. _this.imageWrapper.style.height = _this.height + "px",
  19079. _this.imageWrapper.classList.remove("hidden"),
  19080. //e()
  19081. //billboard
  19082. u.resolve();
  19083. }
  19084. var maxWidth = 256;
  19085. var maxHeight = 256;
  19086. var u = new $.Deferred();
  19087. var _this = this;
  19088. if(e instanceof Image){
  19089. done(e,billboard)
  19090. }
  19091. else {
  19092. var a = new Image;
  19093. a.src = e;
  19094. a.onload = function(event){
  19095. done(event.target,billboard)
  19096. }
  19097. }
  19098. return u.promise();
  19099. }
  19100. ,
  19101. t.exports = n
  19102. }
  19103. ).call(this, "/js/tag/Media/Image.js")
  19104. }
  19105. , {
  19106. "../../settings": 166,
  19107. "../../util/logger": 189,
  19108. "./EmbedlyQueue": 127,
  19109. "./MediaEvent": 131,
  19110. events: 202
  19111. }],
  19112. 129: [function(e, t, i) {//"../Media/Link"
  19113. "use strict";
  19114. function n(e) {
  19115. this.label = e.label,
  19116. this.href = e.url,
  19117. this.type = this.updateLinkForType(),
  19118. this.domElement = null,
  19119. this.id = c++
  19120. }
  19121. var r = e("./LinkType")
  19122. , o = e("./MediaEvent")
  19123. , a = e("../../util/browser")
  19124. , s = e("../../analytics")
  19125. , l = e("events").EventEmitter
  19126. , c = 0;
  19127. n.prototype = Object.create(l.prototype),
  19128. n.prototype.updateLinkForType = function() {
  19129. function e(e) {
  19130. var t = new RegExp("[#&?]start=([^#&?]*)")
  19131. , i = t.exec(e);
  19132. return i[1]
  19133. }
  19134. function t(e) {
  19135. return e + "&play=1"
  19136. }
  19137. var i = a.valueFromHash("m") || a.valueFromHash("model");
  19138. 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),
  19139. r.NAVIGATION) : (this.href = t(this.href),
  19140. r.MODEL) : r.EXT_LINK
  19141. }
  19142. ;
  19143. var h = {};
  19144. n.prototype.createDomElement = function() {
  19145. function e(e) {
  19146. switch (e.stopPropagation(),
  19147. h[this.id] = !0,
  19148. s.trackAlways("click_tag_link", {
  19149. link_type: this.type,
  19150. link_count: c,
  19151. links_clicked: Object.keys(h).length
  19152. }),
  19153. this.type) {
  19154. case r.MODEL:
  19155. window.location.replace(this.href);
  19156. break;
  19157. case r.EXT_LINK:
  19158. window.open(this.href, "_blank")
  19159. }
  19160. this.emit(o.LINK_CLICK, {
  19161. type: this.type,
  19162. url: this.href
  19163. })
  19164. }
  19165. if (this.domElement = document.createElement("a"),
  19166. this.domElement.classList.add("tag-link"),
  19167. this.domElement.textContent = this.label,
  19168. this.type === r.EXT_LINK) {
  19169. this.domElement.textContent += " ";
  19170. var t = document.createElement("i");
  19171. t.classList.add("icon-ext-link"),
  19172. t.title = "Link to external web site",
  19173. this.domElement.appendChild(t)
  19174. }
  19175. return this.domElement.addEventListener("click", e.bind(this)),
  19176. this.domElement
  19177. }
  19178. ,
  19179. t.exports = n
  19180. }
  19181. , {
  19182. "../../analytics": 4,
  19183. "../../util/browser": 182,
  19184. "./LinkType": 130,
  19185. "./MediaEvent": 131,
  19186. events: 202
  19187. }],
  19188. 130: [function(e, t, i) {//"./Media/LinkType"
  19189. "use strict";
  19190. t.exports = {
  19191. NAVIGATION: "navigation",
  19192. MODEL: "model",
  19193. EXT_LINK: "ext-link"
  19194. }
  19195. }
  19196. , {}],
  19197. 131: [function(e, t, i) {//"./MediaEvent"
  19198. "use strict";
  19199. t.exports = Object.freeze({
  19200. LINK_CLICK: "mtmedia.link",
  19201. IMAGE_LOADED: "mtmedia.image.loaded",
  19202. IMAGE_OPENING: "mtmedia.image.opening",
  19203. IMAGE_OPENED: "mtmedia.image.opened",
  19204. IMAGE_CLOSING: "mtmedia.image.closing",
  19205. IMAGE_CLOSED: "mtmedia.image.closed",
  19206. VIDEO_START: "mtmedia.video.start",
  19207. VIDEO_PAUSE: "mtmedia.video.pause",
  19208. VIDEO_ENDED: "mtmedia.video.end"
  19209. })
  19210. }
  19211. , {}],
  19212. 132: [function(e, t, i) {//"./mediaSettings"
  19213. "use strict";
  19214. t.exports = Object.freeze({
  19215. maxEmbedWidth: 350,
  19216. defaultAspectRatio: .75
  19217. })
  19218. }
  19219. , {}],
  19220. 133: [function(e, t, i) {//"./DescriptionChunkType" or "../Parser/DescriptionChunkType"
  19221. "use strict";
  19222. t.exports = Object.freeze({
  19223. TEXT: "text",
  19224. LINK: "link",
  19225. IMAGE: "photo",
  19226. VIDEO: "video",
  19227. RICH: "rich"
  19228. })
  19229. }
  19230. , {}],
  19231. 134: [function(e, t, i) {//"../Parser/DescriptionParser"
  19232. "use strict";
  19233. function n(e) {
  19234. this.capabilities = {
  19235. links: {
  19236. enable: e.supportLinks,
  19237. keepLabels: e.keepLinkLabels
  19238. }
  19239. }
  19240. }
  19241. var r = e("./DescriptionChunkType");
  19242. n.prototype.parse = function(e, t) {
  19243. var i = []
  19244. , n = e.split("[").map(function(e, t) {
  19245. return 0 === t ? e : "[" + e
  19246. });
  19247. return n.forEach(function(e) {
  19248. var n = this.findMarkdown(e);
  19249. if (n) {
  19250. if (n.url.indexOf("javascript:") !== -1)
  19251. return;
  19252. this.addLinkChunk(i, n, t),
  19253. this.addTextChunk(i, e.slice(n.markdown.length))
  19254. } else
  19255. this.addTextChunk(i, e)
  19256. }
  19257. .bind(this)),
  19258. i
  19259. }
  19260. ,
  19261. n.prototype.findMarkdown = function(e) {
  19262. var t = /\[([^\]]*)\]\((.*)\)/
  19263. , i = e.match(t);
  19264. if (i) {
  19265. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  19266. 0 !== r); )
  19267. o++;
  19268. var a = n.length - o;
  19269. return {
  19270. markdown: i[0].substring(0, i[0].length - a),
  19271. label: i[1],
  19272. url: i[2].substring(0, o)
  19273. }
  19274. }
  19275. }
  19276. ,
  19277. n.prototype.addTextChunk = function(e, t) {
  19278. 0 !== t.length && e.push({
  19279. type: r.TEXT,
  19280. text: t
  19281. })
  19282. }
  19283. ,
  19284. n.prototype.addLinkChunk = function(e, t) {
  19285. if (!this.capabilities.links.enable)
  19286. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  19287. var i = {
  19288. label: t.label,
  19289. url: t.url
  19290. };
  19291. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  19292. e.push({
  19293. type: r.LINK,
  19294. link: i
  19295. })
  19296. }
  19297. ,
  19298. t.exports = n
  19299. }
  19300. , {
  19301. "./DescriptionChunkType": 133
  19302. }],
  19303. 135: [function(e, t, i) {//js/model/Chunks.js
  19304. (function(i) {
  19305. "use strict";
  19306. var n = e("../util/logger")
  19307. , r = new n(i)
  19308. , o = {
  19309. parseIdsFromChunkName: function(e, t) {
  19310. t.floorId = o.parseFloor(e),
  19311. t.roomId = o.parseRoom(e)
  19312. },
  19313. parseFloor: function(e) {
  19314. var t = e.match(/_group([0-9]+)/);
  19315. if (!t)
  19316. return 0;
  19317. try {
  19318. return parseInt(t[1], 10)
  19319. } catch (e) {
  19320. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  19321. 0
  19322. }
  19323. },
  19324. parseRoom: function(e) {
  19325. var t = e.match(/_sub([0-9]+)/);
  19326. if (!t)
  19327. return -1;
  19328. try {
  19329. return parseInt(t[1], 10)
  19330. } catch (e) {
  19331. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  19332. 0
  19333. }
  19334. }
  19335. };
  19336. t.exports = o
  19337. }
  19338. ).call(this, "/js/model/Chunks.js")
  19339. }
  19340. , {
  19341. "../util/logger": 189
  19342. }],
  19343. 136: [function(e, t, i) {///js/model/FloorCollection.js
  19344. (function(i) {
  19345. "use strict";
  19346. function n(e) {
  19347. s.call(this),
  19348. this.model = e,
  19349. this.exploded = !1
  19350. }
  19351. var r = e("../objects/Floor")
  19352. , o = (e("../settings"),
  19353. e("../util/logger"))
  19354. , a = e("../util/transitions")
  19355. , s = e("../util/IndexedCollection")
  19356. , l = e("../util/common")
  19357. , c = e("../util/easing");
  19358. new o(i);
  19359. l.inherit(n, s),
  19360. n.prototype.add = function(e) {
  19361. s.prototype.add.call(this, e),
  19362. this.model.add(e)
  19363. }
  19364. ,
  19365. n.prototype.getIndex = function(e) {
  19366. return e.floorIndex
  19367. }
  19368. ,
  19369. n.prototype.build = function() {
  19370. this.list.forEach(function(e) {
  19371. e.build()
  19372. })
  19373. }
  19374. ,
  19375. n.prototype.size = function() {
  19376. return this.length
  19377. }
  19378. ,
  19379. n.prototype.sort = function() {
  19380. s.prototype.sort.call(this, function(e, t) {
  19381. return e.floorIndex - t.floorIndex
  19382. })
  19383. }
  19384. ,
  19385. n.prototype.nextFloor = function(e, t) {
  19386. return this.index[e.floorIndex + t] || null
  19387. }
  19388. ,
  19389. n.prototype.getFloorAtPoint = function(e) {
  19390. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  19391. var r = this.list[n]
  19392. , o = r.distanceToPoint(e);
  19393. (!t || i > o) && (i = o,
  19394. t = r)
  19395. }
  19396. return t
  19397. }
  19398. ,
  19399. n.prototype.getOrMakeFloor = function(e) {
  19400. var t = this.index[e];
  19401. return t || (t = new r(this.model,e),
  19402. this.add(t)),
  19403. t
  19404. }
  19405. ,
  19406. n.prototype.hide = function() {
  19407. this.list.forEach(function(e) {
  19408. e.hide()
  19409. })
  19410. }
  19411. ,
  19412. n.prototype.show = function() {
  19413. this.list.forEach(function(e) {
  19414. e.show()
  19415. })
  19416. }
  19417. ,
  19418. n.prototype.names = function() {
  19419. return this.list.reduce(function(e, t) {
  19420. return e.concat(t.name)
  19421. }, [])
  19422. }
  19423. ,
  19424. n.prototype.toggleExplodeHorizontal = function() {
  19425. function e(e, t) {
  19426. r.copy(e.position),
  19427. e.position.x = i[e.floorIndex] * t,
  19428. e.position.y = 1 * e.floorIndex * t,
  19429. r.sub(e.position).multiplyScalar(-1),
  19430. e.panos.forEach(function(e) {
  19431. e.translate(r)
  19432. })
  19433. }
  19434. var t, i = [], n = 0;
  19435. this.list.forEach(function(e, r, o) {
  19436. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  19437. n += t,
  19438. i[r] = n
  19439. }),
  19440. i = i.map(function(e) {
  19441. return e - n / 2
  19442. });
  19443. var r = this.list[0].position.clone();
  19444. this.exploded ? this.list.forEach(function(t) {
  19445. a.start(function(i) {
  19446. e(t, 1 - i)
  19447. }, 1500, null, 0, c.easeOutExpo)
  19448. }) : this.list.forEach(function(t) {
  19449. a.start(function(i) {
  19450. e(t, i)
  19451. }, 1500, null, 0, c.easeOutExpo)
  19452. }),
  19453. this.exploded = !this.exploded
  19454. }
  19455. ,
  19456. n.prototype.toggleExplodeVertical = function() {
  19457. function e(e, i) {
  19458. //var n = n.copy(e.position); //有bug
  19459. var n = e.position.clone();
  19460. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  19461. n.sub(e.position).multiplyScalar(-1),
  19462. e.panos.forEach(function(e) {
  19463. e.translate(n)
  19464. })
  19465. }
  19466. var t = this.model.size;
  19467. this.list[0].position.clone();
  19468. this.exploded ? this.list.forEach(function(t) {
  19469. a.start(function(i) {
  19470. e(t, 1 - i)
  19471. }, 1500, null, 0, c.easeOutExpo)
  19472. }) : this.list.forEach(function(t) {
  19473. a.start(function(i) {
  19474. e(t, i)
  19475. }, 1500, null, 0, c.easeOutExpo)
  19476. }),
  19477. this.exploded = !this.exploded
  19478. }
  19479. ,
  19480. t.exports = n
  19481. }
  19482. ).call(this, "/js/model/FloorCollection.js")
  19483. }
  19484. , {
  19485. "../objects/Floor": 146,
  19486. "../settings": 166,
  19487. "../util/IndexedCollection": 175,
  19488. "../util/common": 185,
  19489. "../util/easing": 186,
  19490. "../util/logger": 189,
  19491. "../util/transitions": 195
  19492. }],
  19493. 137: [function(e, t, i) {///js/model/ImageCollection.js
  19494. (function(i) {
  19495. "use strict";
  19496. function n() {
  19497. c.call(this)
  19498. }
  19499. var r = e("../settings")
  19500. , o = e("../util/logger")
  19501. , a = e("../enum/Viewmode")
  19502. , s = e("../objects/Snapshot")
  19503. , l = (e("../util/math"),
  19504. e("../util/common"))
  19505. , c = e("../util/IndexedCollection")
  19506. , h = new o(i);
  19507. l.inherit(n, c),
  19508. n.prototype.getImage = function(e) {
  19509. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  19510. }
  19511. ,
  19512. n.prototype.filterByModesAndReel = function(e, t) {
  19513. for (var i = [], n = 0; n < t.length; n += 1) {
  19514. var r = t[n]
  19515. , o = this.index[r.sid];
  19516. o && i.push(o)
  19517. }
  19518. var s = e[a.DOLLHOUSE]
  19519. , l = e[a.FLOORPLAN];
  19520. i = i.filter(function(e) {
  19521. if (!e.metadata || void 0 === e.metadata.camera_mode)
  19522. return !0;
  19523. var t;
  19524. try {
  19525. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  19526. } catch (e) {
  19527. return h.debug(e.message),
  19528. !1
  19529. }
  19530. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  19531. }),
  19532. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  19533. this.list = i,
  19534. this.reIndex()
  19535. }
  19536. ,
  19537. n.prototype.getHeroLocations = function(e) {
  19538. if (0 === this.list.length)
  19539. return [];
  19540. for (var t = [], i = 0; i < this.list.length; ++i) {
  19541. var o = this.list[i]
  19542. , l = o.thumbnail_signed_src
  19543. , c = o.name;
  19544. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  19545. if (!r.show360Views.enabled && o.metadata.scan_id) {
  19546. var h = e.get(o.metadata.scan_id);
  19547. if (h && !h.isAligned())
  19548. continue
  19549. }
  19550. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  19551. if (u === a.MESH)
  19552. continue;
  19553. var d = {
  19554. cameraMode: u,
  19555. position: o.metadata.camera_position,
  19556. quaternion: o.metadata.camera_quaternion,
  19557. panoId: o.metadata.scan_id,
  19558. orthoZoom: o.metadata.ortho_zoom,
  19559. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  19560. thumbUrl: l,
  19561. name: n.filterImageName(c)
  19562. }
  19563. , p = new s(d);
  19564. t.push(p)
  19565. }
  19566. }
  19567. return t
  19568. }
  19569. ,
  19570. n.prototype.getIndex = function(e) {
  19571. return e.sid
  19572. }
  19573. ,
  19574. n.filterImageName = function(e) {
  19575. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  19576. }
  19577. ,
  19578. t.exports = n
  19579. }
  19580. ).call(this, "/js/model/ImageCollection.js")
  19581. }
  19582. , {
  19583. "../enum/Viewmode": 51,
  19584. "../objects/Snapshot": 153,
  19585. "../settings": 166,
  19586. "../util/IndexedCollection": 175,
  19587. "../util/common": 185,
  19588. "../util/logger": 189,
  19589. "../util/math": 190
  19590. }],
  19591. 138: [function(e, t, i) {///js/model/LabelCollection.js
  19592. (function(i) {
  19593. "use strict";
  19594. function n() {
  19595. u.call(this)
  19596. }
  19597. var r = e("../label/Label")
  19598. , o = e("../settings")
  19599. , a = e("../util/logger")
  19600. , s = e("../util/math")
  19601. , l = e("../util/ajax")
  19602. , c = e("./RoomCollection")
  19603. , h = e("../util/common")
  19604. , u = e("../util/IndexedCollection");
  19605. new a(i);
  19606. h.inherit(n, u),
  19607. n.prototype.getIndex = function(e) {
  19608. return e.labelId
  19609. }
  19610. ,
  19611. n.prototype.associateWithRooms = function(e) {
  19612. this.forEach(function(t) {
  19613. e.forEach(function(e) {
  19614. e.roomId === t.roomId && (t.room = e)
  19615. })
  19616. })
  19617. }
  19618. ,
  19619. n.prototype.createFromLabelData = function(e) {
  19620. e.forEach(function(e) {
  19621. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  19622. t = c.generateRoomId(e.floorId, t);
  19623. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  19624. i.position = s.convertWorkshopVector(i.position),
  19625. this.add(i),
  19626. i.build()
  19627. }
  19628. .bind(this))
  19629. }
  19630. ,
  19631. n.prototype.load = function(e, t) {
  19632. return l.get(e, {
  19633. responseType: "json",
  19634. auth: t ? o.authorizationHeader : null
  19635. }).done(function(e) {
  19636. var t = [];
  19637. for (var i in e) {
  19638. var n = e[i];
  19639. t.push(n)
  19640. }
  19641. this.createFromLabelData(t)
  19642. }
  19643. .bind(this))
  19644. }
  19645. ,
  19646. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  19647. var t = -1;
  19648. if (e) {
  19649. var i = e.split("_");
  19650. t = parseInt(i[0])
  19651. }
  19652. return t
  19653. }
  19654. ,
  19655. t.exports = n
  19656. }
  19657. ).call(this, "/js/model/LabelCollection.js")
  19658. }
  19659. , {
  19660. "../label/Label": 90,
  19661. "../settings": 166,
  19662. "../util/IndexedCollection": 175,
  19663. "../util/ajax": 181,
  19664. "../util/common": 185,
  19665. "../util/logger": 189,
  19666. "../util/math": 190,
  19667. "./RoomCollection": 141
  19668. }],
  19669. 139: [function(e, t, i) {///js/model/Model.js
  19670. (function(i) {
  19671. "use strict";
  19672. function n(e, t) {
  19673. o.Object3D.call(this),
  19674. this.sid = t.sid,
  19675. this.data = t,
  19676. this.options = e,
  19677. this.urls = new s(e.urlFiles),
  19678. this.isPublic = void 0 !== t.is_public && t.is_public,
  19679. this.images = new _(this),
  19680. this.images.extend(t.images),
  19681. this.heroImage = this.images.getImage(t.icon), //封面图和初始视角
  19682. this.heroLocations = [],
  19683. this.outdoorPanoLocations = [],
  19684. this.floors = new d(this),
  19685. this.floorsEnabled = void 0 === e.floors || e.floors,
  19686. this.changingFloor = !1,
  19687. this.chunks = [],
  19688. this.panos = new A,
  19689. this.colliders = [],
  19690. this.loadPanosPromise = null,
  19691. this.loadMeshTexturesPromise = null,
  19692. this.auxDataPromise = null,
  19693. this.meshTexturesLoaded = !1,
  19694. this.meshTextures = [],
  19695. this.tags = {},
  19696. this.tagsShown = !1,
  19697. this.shouldShowtags = !1,
  19698. this.has360Views = !1,
  19699. this.showingLabels = f.labels.enabled && t.player_options.labels,
  19700. this.supportedModes = {},
  19701. this.supportedModes[c.PANORAMA] = !0,
  19702. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  19703. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  19704. this.supportedModes[c.TRANSITIONING] = !0,
  19705. this.supportsTiles = this.configureTiling(),
  19706. this.supportsVR = t.is_vr,
  19707. this.mode = c.DOLLHOUSE,
  19708. this.size = null,
  19709. this.center = null,
  19710. this.boundingBox = new o.Box3,
  19711. this.currentFloor = null,
  19712. this.allFloorsVisible = !0,
  19713. this.projectedPano0 = null,
  19714. this.projectedPano1 = null,
  19715. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  19716. this.addFloor(new u(this,t,e.trim()))
  19717. }
  19718. .bind(this)),
  19719. this.waitQueue = [],
  19720. this.on("load", function(e) {
  19721. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  19722. return !e.isLoadedCallback()
  19723. }),
  19724. 0 === this.waitQueue.length && this.emit("waiting-done"))
  19725. }
  19726. .bind(this)),
  19727. this.setupCustomProperties()
  19728. //xzw:
  19729. this.spotCreatedNum = -1;//记录当前所有的热点sid最大值
  19730. }
  19731. function r() {
  19732. try {
  19733. var e = document.createElement("canvas")
  19734. , t = e.getContext("webgl");
  19735. t || (t = e.getContext("experimental-webgl"));
  19736. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  19737. return i
  19738. } catch (e) {
  19739. return 0
  19740. }
  19741. }
  19742. var o = e("three")
  19743. , a = e("../util/ajax")
  19744. , s = e("../util/ModelUrls")
  19745. , l = e("../objects/BoundingTextureSkybox")
  19746. , c = e("../enum/Viewmode")
  19747. , h = e("../enum/RenderOrder")
  19748. , u = (e("../enum/AlignmentType"),
  19749. e("../objects/Floor"))
  19750. , d = e("./FloorCollection")
  19751. , p = e("../objects/Chunk")
  19752. , f = (e("../objects/Room"),
  19753. e("../objects/Snapshot"),
  19754. e("../label/Label"),
  19755. e("../util/math"),
  19756. e("../settings")),
  19757. ss = e("../shaders") //xzw
  19758. , g = e("../util/logger")
  19759. , m = e("../tag/tag")
  19760. , v = (e("../tag/tagManager"),
  19761. e("../objects/Panorama"))
  19762. , A = e("../util/PanoramaCollection")
  19763. , y = e("../loaders/ModelLoader")
  19764. , C = e("../loaders/ModelTextureLoader")
  19765. , I = e("../loaders/SweepDataLoader")
  19766. , E = e("../util/transitions")
  19767. , b = e("../util/common")
  19768. , le = e("../util/lerp") //xzw
  19769. , es = e("../util/easing") //xzw
  19770. , te = e("../util/texture") //xzw
  19771. , w = e("./../util/browser")
  19772. , _ = e("./ImageCollection")
  19773. , T = e("./RoomCollection")
  19774. , x = e("./LabelCollection")
  19775. , S = e("./Chunks")
  19776. , M = e("./../util/showcase")
  19777. , R = e("../exception/BasicException")
  19778. , P = (e("../constants"),
  19779. e("events").EventEmitter)
  19780. , O = new g(i);
  19781. var editor = e('editor');
  19782. n.prototype = Object.create(o.Object3D.prototype),
  19783. b.extend(n, P),
  19784. n.prototype.setupCustomProperties = function() {
  19785. var e = f.modelAlpha;
  19786. Object.defineProperty(this, "alpha", {
  19787. get: function() {
  19788. return e
  19789. },
  19790. set: function(t) {
  19791. e = t,
  19792. this.chunks.forEach(function(t) {
  19793. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  19794. })
  19795. }
  19796. })
  19797. }
  19798. ,
  19799. n.prototype.configureTiling = function() {
  19800. var e = r();
  19801. if (e < 2048)
  19802. return !1;
  19803. O.warn("Max cube texture size: " + e);
  19804. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  19805. var i = f.tiling.tilingFlagNames[t];
  19806. if ("1" === w.valueFromHash(i, null))
  19807. return !0;
  19808. if ("0" === w.valueFromHash(i, null))
  19809. return !1
  19810. }
  19811. return !!M.modelDataPromisesTiles(this.data)
  19812. }
  19813. ,
  19814. n.prototype.toggleAlpha = function() {
  19815. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  19816. }
  19817. ,
  19818. n.prototype.load = function(e) {
  19819. var t = function() {
  19820. return $.when(this.loadPanos(), this.loadMesh())
  19821. },
  19822. i = this.urls.init().then(t.bind(this));
  19823. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  19824. this.auxDataPromise = $.when(this.loadHighlightReel(), this.loadtags(), this.loadLabels()),
  19825. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  19826. }
  19827. ,
  19828. n.prototype.loadMesh = function() {
  19829. function e(e) {
  19830. O.error(e),
  19831. n.reject("loading-failed")
  19832. }
  19833. function t(e, t) {
  19834. n.notify(e, t)
  19835. }
  19836. function i(e, t) {
  19837. if (0 === e.length) {
  19838. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  19839. r.supportedModes[c.DOLLHOUSE] = !1,
  19840. r.supportedModes[c.FLOORPLAN] = !1;
  19841. var i = new p({
  19842. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  19843. });
  19844. i.material.visible = !1,
  19845. i.rotateX(-Math.PI / 2),
  19846. i.geometry.computeBoundingBox(),
  19847. e = [i]
  19848. }
  19849. e.forEach(function(e) {
  19850. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  19851. r.addChunk(t, e)
  19852. }),
  19853. r.floors.sort(),
  19854. n.resolve(r)
  19855. }
  19856. var n = $.Deferred()
  19857. , r = this;
  19858. return y.load(r.data.job.uuid, r.urls, i, t, e),
  19859. n.promise()
  19860. }
  19861. ,
  19862. n.prototype.loadMeshTextures = function() {
  19863. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  19864. this.meshTexturesLoaded = !0
  19865. }
  19866. .bind(this)),
  19867. this.loadTexturesPromise)
  19868. }
  19869. ,
  19870. n.prototype.loadtags = function() {// ------MP
  19871. var e = $.Deferred();
  19872. if (!f.tags.enabled)
  19873. return e.resolve();
  19874. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  19875. t = "data/" + this.sid + "/tags.json"
  19876. return a.get(t, {
  19877. responseType: "json",
  19878. auth: this.isPublic ? null : f.authorizationHeader
  19879. }).done(function(t) {
  19880. /* var i = 0
  19881. , n = 0;
  19882. for (var r in t) {
  19883. var o = t[r];
  19884. o.enabled && (n++,
  19885. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  19886. i++))
  19887. }
  19888. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  19889. */e.resolve()
  19890. }
  19891. .bind(this)).fail(function() {
  19892. O.warn("Getting tags failed, not displaying tags."),
  19893. e.resolve()
  19894. }),
  19895. e
  19896. }
  19897. /* n.prototype.loadTags = function(){//xzw 加载热点
  19898. this.tags = {};
  19899. var e = $.Deferred();
  19900. //var t = ifTest?"data/tags.json?m="+(new Date()).getTime() : "data/data"+number+"/hot.json?m="+(new Date()).getTime();
  19901. t = "data/" + this.sid + "/tags.json"
  19902. var time = 0;
  19903. var Tag = m;
  19904. var load = function(){
  19905. time ++;
  19906. console.log("第"+time+"次加载tags");
  19907. $.ajax(t).done(function(t) {
  19908. if(t.length) t.sort(function(a,b){return parseInt(a.sid) - parseInt(b.sid)})//升序
  19909. for (var r=0; r<t.length; r++) {
  19910. var o = t[r];
  19911. this.tags[r] = new Tag(this,t[r].sid,o);
  19912. editor.addList(this.tags[r]);
  19913. if(parseInt(t[r].sid) > this.spotCreatedNum) this.spotCreatedNum = parseInt(t[r].sid);
  19914. }
  19915. e.resolve(this)
  19916. }.bind(this)).fail(function() {
  19917. if(time < 3) load();
  19918. else{
  19919. //error_dialog("提示","热点数据加载失败"); //第一次编辑可能就是没热点
  19920. console.log("Getting tags failed, not displaying tags.");//O.warn("Getting tags failed, not displaying tags."),
  19921. e.resolve(this)
  19922. }
  19923. }.bind(this))
  19924. }.bind(this)
  19925. load();
  19926. return e.promise();
  19927. } */
  19928. ,
  19929. n.prototype.loadPanos = function() {
  19930. if (this.loadPanosPromise)
  19931. return this.loadPanosPromise;
  19932. var e = new I(this);
  19933. return this.loadPanosPromise = e.load().then(function(e) {
  19934. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  19935. return this.data.sweeps[e.uuid].enabled
  19936. }
  19937. .bind(this))),
  19938. this.panos.extend(e.map(function(e) {
  19939. return new v(this,e.uuid,e,this.supportsTiles)
  19940. }
  19941. .bind(this))),
  19942. this.panos.forEach(function(e) {
  19943. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  19944. var i = this.panos.get(t);
  19945. i && this.panos.setNeighbour(e, i, !0)
  19946. }
  19947. .bind(this)),
  19948. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  19949. }
  19950. .bind(this)),
  19951. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  19952. this.supportedModes[c.PANORAMA] = !1),
  19953. $.when(this)
  19954. }
  19955. .bind(this)),
  19956. this.loadPanosPromise
  19957. }
  19958. ,
  19959. n.prototype.loadHighlightReel = function() {//加载导览位置
  19960. var e = $.Deferred()
  19961. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  19962. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  19963. return a.get(t, {
  19964. responseType: "json",
  19965. auth: this.isPublic ? null : f.authorizationHeader
  19966. }).done(function(t) {
  19967. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  19968. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  19969. e.resolve()
  19970. }
  19971. .bind(this)).fail(function() {
  19972. O.warn("Getting highlight reel failed, no highlights available"),
  19973. e.resolve()
  19974. }),
  19975. e
  19976. }
  19977. ,
  19978. n.prototype.waitForLoad = function(e, t) {
  19979. t() || (this.waitQueue.push({
  19980. object: e,
  19981. isLoadedCallback: t
  19982. }),
  19983. 1 === this.waitQueue.length && this.emit("waiting"))
  19984. }
  19985. ,
  19986. n.prototype.hide = function() {
  19987. this.floors.hide()
  19988. }
  19989. ,
  19990. n.prototype.show = function() {
  19991. this.floors.show()
  19992. }
  19993. ,
  19994. n.prototype.floorNames = function() {
  19995. return this.floors.names()
  19996. }
  19997. ,
  19998. n.prototype.warpDestFloors = function(e, t) {
  19999. if (!e || this.floors.length !== e.length)
  20000. return void this.toggleAllFloors(!0);
  20001. var i = e.findIndex(function(e) {
  20002. return e
  20003. }
  20004. .bind(this));
  20005. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  20006. }
  20007. ,
  20008. n.prototype.setFloor = function(e, t, i) {
  20009. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  20010. this.allFloorsVisible = !1,
  20011. this._setFloor(e, t, i)
  20012. }
  20013. ,
  20014. n.prototype.toggleAllFloors = function(e) {
  20015. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  20016. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  20017. this._setFloor(this.currentFloor)
  20018. }
  20019. ,
  20020. n.prototype._setFloor = function(e, t, i) {
  20021. t = t || this.mode,
  20022. this.emit("floor.changed", e, t, this.currentFloor),
  20023. this.currentFloor = e;
  20024. var n;
  20025. if (t === c.PANORAMA) {
  20026. if (this.show(),
  20027. this.shouldShowtags && this.tagsShown)
  20028. for (n in this.tags)
  20029. this.tags[n].show(f.showFloorDuration)
  20030. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  20031. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  20032. }
  20033. .bind(this)),
  20034. this.shouldShowtags && this.tagsShown))
  20035. for (n in this.tags) {
  20036. var r = this.tags[n];
  20037. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  20038. }
  20039. var o = this
  20040. , a = e;
  20041. E.start(function() {}, f.showFloorDelay, function() {
  20042. o.floors.forEach(function(e) {
  20043. e.chunks.forEach(function(t) {
  20044. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  20045. })
  20046. })
  20047. }
  20048. .bind(this))
  20049. }
  20050. ,
  20051. n.prototype.toggleExplode = function() {
  20052. this.floors.toggleExplodeHorizontal()
  20053. }
  20054. ,
  20055. n.prototype.toggleExplodeUp = function() {
  20056. this.floors.toggleExplodeVertical()
  20057. }
  20058. ,
  20059. n.prototype.nextFloor = function(e) {
  20060. return this.floors.nextFloor(this.currentFloor, e)
  20061. }
  20062. ,
  20063. n.prototype.addFloor = function(e) {
  20064. this.floors.add(e)
  20065. }
  20066. ,
  20067. n.prototype.getFloorAtPoint = function(e) {
  20068. return this.floors.getFloorAtPoint(e)
  20069. }
  20070. ,
  20071. n.prototype.getTagBySid = function(e) {
  20072. return this.tags[e]
  20073. }
  20074. ,
  20075. n.prototype.addChunk = function(e, t) {
  20076. this.floors.getOrMakeFloor(e).addChunk(t),
  20077. this.chunks.push(t)
  20078. }
  20079. ,
  20080. n.prototype.setMode = function(e) {
  20081. if (!this.supportedModes[e])
  20082. throw new R("Mode not supported for this model: " + e);
  20083. this.mode = e,
  20084. this.chunks.forEach(function(t) {
  20085. t.setMode(e)
  20086. })
  20087. }
  20088. ,
  20089. n.prototype.build = function() {
  20090. this.heroLocations = this.images.getHeroLocations(this.panos);
  20091. var e = function() {
  20092. 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()
  20093. }
  20094. .bind(this)();
  20095. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  20096. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  20097. }
  20098. .bind(this)) || e,
  20099. null === this.heroImage && O.warn("No hero image defined."),
  20100. this.currentFloor = this.floors.last(),
  20101. this.floors.build(),
  20102. this.colliders = this.floors.reduce(function(e, t) {
  20103. return e.concat(t.collider.children)
  20104. }, []),
  20105. this.panos.forEach(function(e) {
  20106. e.build1(),
  20107. e.on("enter", function() {
  20108. e.floor !== this.currentFloor && this.setFloor(e.floor)
  20109. }
  20110. .bind(this))
  20111. }
  20112. .bind(this)),
  20113. this.panos.forEach(function(e) {
  20114. e.build2()
  20115. }),
  20116. this.floors.forEach(function(e) {
  20117. this.boundingBox.union(e.boundingBox)
  20118. }
  20119. .bind(this)),
  20120. this.size = this.boundingBox.size(),
  20121. this.center = this.boundingBox.center(),
  20122. this.floors.forEach(function(e) {
  20123. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  20124. }
  20125. .bind(this)),
  20126. this.panos.populate_path_graph(),
  20127. this.skybox = new l(this.boundingBox),
  20128. this.skybox.matrixWorldNeedsUpdate = !0,
  20129. this.add(this.skybox);
  20130. for (var t in this.tags)
  20131. this.tags[t].build();
  20132. O.debug("Done building model"),
  20133. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  20134. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  20135. this.buildRooms(),
  20136. this.labels.associateWithRooms(this.rooms)
  20137. this.createFloorLogo(); //xzw
  20138. return $.when(this); //it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately. 必须有参数,没有的话无法触发done()
  20139. }
  20140. ,
  20141. n.prototype.createFloorLogo = function(){//xzw 创建地标
  20142. var url = Data.floorLogo ? Data.imgRoot+"floorLogoImg.png"+"?m="+Data.version : Data.imgRoot2 +"floorLogo.png"; //暂定
  20143. var map = te.load(url);//可以追加done
  20144. $("#showInformationLogo").css('background-image', "url('"+url+"')");
  20145. this.floorLogos = [];
  20146. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  20147. var e = o.UniformsUtils.clone(ss.floorLogo.uniforms);
  20148. e.map.value = map;
  20149. var material = new o.ShaderMaterial({
  20150. fragmentShader: ss.floorLogo.fragmentShader,
  20151. vertexShader: ss.floorLogo.vertexShader,
  20152. uniforms: e,
  20153. side: o.DoubleSide,
  20154. transparent: !0,
  20155. depthWrite: !1,
  20156. depthTest:false//改 在chunk\skybox外也可看到
  20157. });
  20158. var logo = new o.Mesh(new o.PlaneGeometry(2.5,2.5,1,1),material);
  20159. var s = (Data.floorLogoSize || 100)/100;
  20160. logo.scale.set(s,s,s);
  20161. logo.position.set(0,-1.49,0);
  20162. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  20163. this.add(logo);
  20164. this.floorLogos.push(logo);
  20165. }
  20166. this.floorLogos[1].visible = false;
  20167. },
  20168. n.prototype.changeFloorLogo = function(n){
  20169. if(!this.floorLogos) return;
  20170. for(var i=0; i<2; i++){
  20171. if(n.url){
  20172. this.floorLogos[i].material.uniforms.map.value = te.load(n.url+"?m="+Data.version);
  20173. }else if(n.image){
  20174. var t = new o.Texture(n.image);
  20175. t.needsUpdate = !0;
  20176. this.floorLogos[i].material.uniforms.map.value = t;
  20177. this.floorLogos[i].material.needsUpdate=!0;
  20178. }
  20179. }
  20180. if(n.initPreview){
  20181. $("#showInformationLogo").css('background-image', "url('"+n.url+"')");
  20182. }
  20183. },
  20184. n.prototype.floorLogoFade = function(i, time, delay){//改
  20185. if(!this.floorLogos) return;
  20186. E.start(le.uniform(this.floorLogos[i], "opacity", 0), time || 250, null,delay,es["easeInQuad"])
  20187. },
  20188. n.prototype.floorLogoShow = function(i, time, delay){//改
  20189. if(!this.floorLogos) return;
  20190. E.start(le.uniform(this.floorLogos[i], "opacity", 1), time || 250, null,delay,es["easeInQuad"])
  20191. },
  20192. n.prototype.updateFloorlogo = function(Q) { //xzw add 更新地标的旋转
  20193. var quaternion;
  20194. for(var i=0;i<2;i++){
  20195. if(!quaternion){
  20196. var a = new o.Vector3(0,0,-1);
  20197. a.applyQuaternion(Q);
  20198. a.setY(0);
  20199. var _ = (new o.Matrix4).lookAt(a,new o.Vector3, new o.Vector3(0,1,0));
  20200. quaternion = (new o.Quaternion).setFromRotationMatrix(_)
  20201. }
  20202. if(this.floorLogos[i].visible){
  20203. this.floorLogos[i].quaternion.copy(quaternion);
  20204. /* k.model.floorLogos[i].rotateOnAxis(new o.Vector3(1,0,0),Math.PI/2) //origin
  20205. k.model.floorLogos[i].rotateOnAxis(new o.Vector3(0,1,0),Math.PI) */
  20206. /*var a = new o.Quaternion;
  20207. a.setFromAxisAngle(new o.Vector3(1,0,0), Math.PI/2);
  20208. var b = new o.Quaternion;
  20209. b.setFromAxisAngle(new o.Vector3(0,1,0), Math.PI);
  20210. a.multiply(b); */
  20211. //var a = new o.Quaternion( 4.329780281177466e-17 , 0.7071067811865476, 0.7071067811865476 , 4.329780281177467e-17)
  20212. var a = new o.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  20213. this.floorLogos[i].quaternion.multiply(a);
  20214. }
  20215. }
  20216. }
  20217. ,
  20218. n.prototype.loadLabels = function() {
  20219. this.labels = new x(this);
  20220. var e = $.Deferred();
  20221. if (!this.showingLabels)
  20222. return e.resolve();
  20223. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  20224. var t = "data/" + this.sid + "/labels.json";
  20225. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  20226. O.warn("Getting labels failed, not displaying labels."),
  20227. e.resolve()
  20228. }),
  20229. e
  20230. }
  20231. ,
  20232. n.prototype.buildRooms = function() {
  20233. this.rooms = new T(this),
  20234. this.rooms.createFromChunks(this.chunks),
  20235. this.rooms.calcRoomBoundaries()
  20236. }
  20237. ,
  20238. n.prototype.updateProjectedPanos = function() {
  20239. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  20240. }
  20241. ,
  20242. n.prototype.setProjectedPanos = function(e, t, i) {
  20243. void 0 !== i && null !== i || (i = !0),
  20244. i = !!i,
  20245. this.projectedPano0 = e,
  20246. this.projectedPano1 = t,
  20247. this.skybox.material.setProjectedPanos(e, t, i),
  20248. this.chunks.forEach(function(n) {
  20249. n.materialInside.setProjectedPanos(e, t, i)
  20250. })
  20251. }
  20252. ,
  20253. n.prototype.setSide = function(e) {
  20254. this.floors.forEach(function(t) {
  20255. t.collider.material.side = e
  20256. })
  20257. }
  20258. ,
  20259. n.prototype.heroCount = function() {
  20260. return this.heroLocations ? this.heroLocations.length : 0
  20261. }
  20262. ,
  20263. n.prototype.getHeroDescriptorByIndex = function(e) {
  20264. if (e < 0)
  20265. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  20266. null;
  20267. var t = this.heroCount();
  20268. if (t < 1)
  20269. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  20270. null;
  20271. var i = this.heroLocations[e];
  20272. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  20273. null) : i
  20274. }
  20275. ,
  20276. n.prototype.findPanoramicHero = function() {
  20277. for (var e in this.heroLocations)
  20278. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  20279. return this.heroLocations[e];
  20280. return null
  20281. }
  20282. ,
  20283. n.prototype.listImagePanos = function() {
  20284. var e = []
  20285. , t = this;
  20286. return this.images.forEach(function(i) {
  20287. if (i.metadata && i.metadata.scan_id) {
  20288. var n = t.panos.get(i.metadata.scan_id);
  20289. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  20290. }
  20291. }),
  20292. e
  20293. }
  20294. ,
  20295. n.prototype.fadePanoMarkers = function(e, t, o) {//xzw
  20296. if(e!=0 && o && o.player.mode == "panorama" && o.player.currentPano){
  20297. var shows = [], hides = [];
  20298. for(var i in o.player.model.panos.index){//是邻近点就显示否则隐藏
  20299. var pano = o.player.model.panos.index[i];
  20300. var ma = pano.marker;
  20301. if(o.player.markspot && o.player.posGets.length == 1){ //正在采集热点 且只有一个位置 只能显示可以走的点
  20302. if(o.player.disablePanos.indexOf(pano)>-1){
  20303. ma.material.depthTest = true;
  20304. hides.push(pano);
  20305. }else{
  20306. ma.material.depthTest = false
  20307. shows.push(pano);
  20308. }
  20309. }else if(o.player.markspot && o.player.posGets.length == 2){ //正在采集热点 且有两个位置 只能显示两个位置
  20310. if(o.player.posGets.list.indexOf(i)>-1){
  20311. ma.material.depthTest = false;
  20312. shows.push(pano);
  20313. }else{
  20314. ma.material.depthTest = true;
  20315. hides.push(pano);
  20316. }
  20317. }else{
  20318. if(o.player.currentPano.seeMarkers.indexOf(i)>-1){
  20319. ma.material.depthTest = false;
  20320. shows.push(pano);
  20321. }else{
  20322. ma.material.depthTest = true;
  20323. hides.push(pano);
  20324. }
  20325. }
  20326. }
  20327. this.panos.fadeMarkerOpacity(e, t, [
  20328. {toOp: f.panorama.markerOpacity, member: shows},
  20329. {toOp: 0, member: hides}
  20330. ])
  20331. }else this.panos.fadeMarkerOpacity(e, t)
  20332. }
  20333. ,
  20334. n.prototype.setSweepVisibility = function(e) {
  20335. this.panos.forEach(function(t) {
  20336. t.marker && (t.marker.visible = e)
  20337. })
  20338. }
  20339. ,
  20340. n.prototype.outsideAllowed = function() {
  20341. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  20342. }
  20343. ,
  20344. t.exports = n
  20345. }
  20346. ).call(this, "/js/model/Model.js")
  20347. }
  20348. , {
  20349. "../constants": 8,
  20350. "../enum/AlignmentType": 17,
  20351. "../enum/RenderOrder": 42,
  20352. "../enum/Viewmode": 51,
  20353. "../exception/BasicException": 55,
  20354. "../label/Label": 90,
  20355. "../loaders/ModelLoader": 105,
  20356. "../loaders/ModelTextureLoader": 106,
  20357. "../loaders/SweepDataLoader": 107,
  20358. "../tag/tag": 123,
  20359. "../tag/tagManager": 124,
  20360. "../objects/BoundingTextureSkybox": 143,
  20361. "../objects/Chunk": 144,
  20362. "../objects/Floor": 146,
  20363. "../objects/Panorama": 148,
  20364. "../objects/Room": 150,
  20365. "../objects/Snapshot": 153,
  20366. "../settings": 166,
  20367. "../shaders": 167,
  20368. "../util/ModelUrls": 177,
  20369. "../util/PanoramaCollection": 178,
  20370. "../util/ajax": 181,
  20371. "../util/common": 185,
  20372. "../util/easing": 186,
  20373. "../util/lerp": 188,
  20374. "../util/logger": 189,
  20375. "../util/math": 190,
  20376. "../util/texture": 194,
  20377. "../util/transitions": 195,
  20378. "./../util/browser": 182,
  20379. "./../util/showcase": 193,
  20380. "./Chunks": 135,
  20381. "./FloorCollection": 136,
  20382. "./ImageCollection": 137,
  20383. "./LabelCollection": 138,
  20384. "./RoomCollection": 141,
  20385. events: 202,
  20386. three: 217,
  20387. editor: "Editor"
  20388. }],
  20389. 140: [function(e, t, i) {//"../model/ModelManager"
  20390. "use strict";
  20391. function n() {
  20392. this.modelMap = {},
  20393. this.activeModel = null,
  20394. this.modelCount = 0,
  20395. this.tileDownloader = null,
  20396. this.panoRenderer = null
  20397. }
  20398. var r = (e("three"),
  20399. e("../util/common"))
  20400. , o = e("../exception/BasicException")
  20401. , a = e("../enum/ModelManagerEvents")
  20402. , s = e("../enum/PanoRendererEvents")
  20403. , l = e("events").EventEmitter;
  20404. n.prototype.init = function(e, t, i) {
  20405. this.tileDownloader = e,
  20406. this.panoRenderer = t,
  20407. this.qualityManager = i,
  20408. this.bindEvents()
  20409. }
  20410. ,
  20411. n.prototype.bindEvents = function() {
  20412. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  20413. }
  20414. ,
  20415. n.prototype.onTileRendered = function(e, t, i, n) {}
  20416. ,
  20417. n.prototype.addModel = function(e) {
  20418. this.modelMap[e.sid] = e,
  20419. 0 === this.modelCount && this.activateModel(e.sid),
  20420. this.modelCount++,
  20421. this.emit(a.ModelAdded)
  20422. }
  20423. ,
  20424. n.prototype.getModel = function(e) {
  20425. return this.modelMap[e]
  20426. }
  20427. ,
  20428. n.prototype.activateModel = function(e) {
  20429. var t = this.modelMap[e];
  20430. if (!t)
  20431. throw new o("Tried to activate invalid model!");
  20432. var i = this.activeModel;
  20433. this.activeModel = t,
  20434. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  20435. this.tileDownloader.setUrls(t.urls),
  20436. t.panos.forEach(function(e) {
  20437. e.attachToPanoRenderer(this.panoRenderer),
  20438. e.tileDownloader = this.tileDownloader,
  20439. e.qualityManager = this.qualityManager
  20440. }
  20441. .bind(this)),
  20442. this.emit(a.ActiveModelChanged, {
  20443. oldModel: i,
  20444. model: t
  20445. })
  20446. }
  20447. ,
  20448. n.prototype.getActiveModel = function() {
  20449. return this.activeModel
  20450. }
  20451. ,
  20452. r.extend(n, l),
  20453. t.exports = n
  20454. }
  20455. , {
  20456. "../enum/ModelManagerEvents": 33,
  20457. "../enum/PanoRendererEvents": 35,
  20458. "../exception/BasicException": 55,
  20459. "../util/common": 185,
  20460. events: 202,
  20461. three: 217
  20462. }],
  20463. 141: [function(e, t, i) {///js/model/RoomCollection.js
  20464. (function(i) {
  20465. "use strict";
  20466. function n() {
  20467. s.call(this)
  20468. }
  20469. var r = e("../objects/Room")
  20470. , o = (e("../settings"),
  20471. e("../util/logger"))
  20472. , a = (e("../util/transitions"),
  20473. e("../util/easing"),
  20474. e("../util/common"))
  20475. , s = e("../util/IndexedCollection")
  20476. , l = e("./Chunks");
  20477. new o(i);
  20478. a.inherit(n, s),
  20479. n.prototype.getIndex = function(e) {
  20480. return e.roomId
  20481. }
  20482. ,
  20483. n.prototype.calcRoomBoundaries = function() {
  20484. this.forEach(function(e) {
  20485. e.calcBoundaries()
  20486. })
  20487. }
  20488. ,
  20489. n.prototype.createFromChunks = function(e) {
  20490. var t = {
  20491. floorId: -1,
  20492. roomId: -1
  20493. }
  20494. , i = {};
  20495. e.forEach(function(e) {
  20496. l.parseIdsFromChunkName(e.name, t);
  20497. var o = i[t.roomId];
  20498. if (!o) {
  20499. var a = n.generateRoomId(t.floorId, t.roomId);
  20500. o = new r(t.floorId,a),
  20501. this.add(o),
  20502. i[t.roomId] = o
  20503. }
  20504. o.addChunk(e)
  20505. }
  20506. .bind(this)),
  20507. this.calcRoomBoundaries()
  20508. }
  20509. ,
  20510. n.generateRoomId = function(e, t) {
  20511. return e + "_" + t
  20512. }
  20513. ,
  20514. t.exports = n
  20515. }
  20516. ).call(this, "/js/model/RoomCollection.js")
  20517. }
  20518. , {
  20519. "../objects/Room": 150,
  20520. "../settings": 166,
  20521. "../util/IndexedCollection": 175,
  20522. "../util/common": 185,
  20523. "../util/easing": 186,
  20524. "../util/logger": 189,
  20525. "../util/transitions": 195,
  20526. "./Chunks": 135
  20527. }],
  20528. 142: [function(e, t, i) {//"./BoundingMesh"
  20529. "use strict";
  20530. function n(e, t, i) {
  20531. e = e.clone();
  20532. var n = e.size()
  20533. , o = new r.BoxGeometry(n.x,n.y,n.z);
  20534. //o.boundingBox = e, //xzw delete 这句加上不对。因为后面算鼠标与skybox交点时 要用到的是boundingbox加上position才是真实skybox真实位置,所以boundingbox要居中的,而不应该是整体模型所在的位置。
  20535. r.Mesh.call(this, o, t),
  20536. this.position.copy(e.center()),
  20537. this.frustumCulled = !1,
  20538. i && this.add(new r.WireframeHelper(this))
  20539. }
  20540. var r = e("three");
  20541. n.prototype = Object.create(r.Mesh.prototype),
  20542. n.prototype.constructor = n,
  20543. t.exports = n
  20544. }
  20545. , {
  20546. three: 217
  20547. }],
  20548. 143: [function(e, t, i) {///js/objects/BoundingTextureSkybox.js
  20549. (function(i) {
  20550. "use strict";
  20551. function n(e) {
  20552. h.time("Computing a nice bounding cubemap");
  20553. var t = new a({
  20554. side: r.BackSide,
  20555. transparent: !0
  20556. });
  20557. t.uniforms.modelAlpha.value = 0,
  20558. t.uniforms.opacity.value = 1 - s.modelAlpha,
  20559. this.renderOrder = l.boundingSkybox,
  20560. o.call(this, e, t),
  20561. h.timeEnd("Computing a nice bounding cubemap")
  20562. }
  20563. var r = e("three")
  20564. , o = (e("../enum/Viewmode"),
  20565. e("../shaders"),
  20566. e("./BoundingMesh"))
  20567. , a = e("../materials/ModelTextureMaterial")
  20568. , s = e("../settings")
  20569. , l = e("../enum/RenderOrder")
  20570. , c = e("../util/logger")
  20571. , h = new c(i);
  20572. n.prototype = Object.create(o.prototype),
  20573. n.prototype.constructor = n,
  20574. t.exports = n
  20575. }
  20576. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  20577. }
  20578. , {
  20579. "../enum/RenderOrder": 42,
  20580. "../enum/Viewmode": 51,
  20581. "../materials/ModelTextureMaterial": 118,
  20582. "../settings": 166,
  20583. "../shaders": 167,
  20584. "../util/logger": 189,
  20585. "./BoundingMesh": 142,
  20586. three: 217
  20587. }],
  20588. 144: [function(e, t, i) {//"./objects/Chunk"
  20589. "use strict";
  20590. function n(e) {
  20591. this.materialInside = new s({
  20592. side: r.DoubleSide
  20593. });
  20594. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  20595. this.materialOutside = new r.RawShaderMaterial({
  20596. fragmentShader: o.modelOutside.fragmentShader,
  20597. vertexShader: o.modelOutside.vertexShader,
  20598. uniforms: t,
  20599. side: r.FrontSide,
  20600. name: "chunkOut"
  20601. }),
  20602. r.Mesh.call(this, e.geometry, this.materialInside),
  20603. this.name = e.name || "",
  20604. this.textureName = e.textureName,
  20605. this.meshUrl = e.meshUrl
  20606. }
  20607. var r = e("three")
  20608. , o = e("../shaders")
  20609. , a = e("../enum/Viewmode")
  20610. , s = e("../materials/ModelTextureMaterial");
  20611. n.prototype = Object.create(r.Mesh.prototype),
  20612. n.prototype.setTextureMap = function(e) {
  20613. this.materialInside.uniforms.map.value = e,
  20614. this.materialOutside.uniforms.map.value = e
  20615. }
  20616. ,
  20617. n.prototype.setMode = function(e) {
  20618. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  20619. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  20620. t.transparent = this.material.transparent,
  20621. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  20622. this.material = t
  20623. }
  20624. ,
  20625. t.exports = n
  20626. }
  20627. , {
  20628. "../enum/Viewmode": 51,
  20629. "../materials/ModelTextureMaterial": 118,
  20630. "../shaders": 167,
  20631. three: 217
  20632. }],
  20633. 145: [function(e, t, i) {//"./ChunkedCollider"
  20634. "use strict";
  20635. function n(e) {
  20636. this.chunksize = e || 10,
  20637. this.chunks = {},
  20638. this.boundingBoxes = {},
  20639. this.children = [],
  20640. this.offset = new r.Vector3(0,.5,0),
  20641. this.material = new r.MeshBasicMaterial({
  20642. color: 16777215 * Math.random(),
  20643. side: r.DoubleSide
  20644. })
  20645. }
  20646. var r = e("three");
  20647. e("../enum/Viewmode");
  20648. n.prototype.add = function(e) {
  20649. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  20650. m ? (t = m.position.array,
  20651. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  20652. n = e.faces);
  20653. var v = new r.Vector3;
  20654. if (i)
  20655. for (o = 0,
  20656. a = i.length; o < a; o += 3) {
  20657. var A = 3 * i[o]
  20658. , y = 3 * i[o + 1]
  20659. , C = 3 * i[o + 2];
  20660. s = (t[A] + t[y] + t[C]) / 3,
  20661. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  20662. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  20663. h = Math.floor(s / this.chunksize),
  20664. u = Math.floor(l / this.chunksize),
  20665. d = Math.floor(c / this.chunksize),
  20666. p = h + "." + u + "." + d,
  20667. p in this.chunks ? (g = this.chunks[p],
  20668. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  20669. f = this.boundingBoxes[p] = new r.Box3),
  20670. 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]),
  20671. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  20672. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  20673. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  20674. }
  20675. else
  20676. for (o = 0,
  20677. a = t.length; o < a; o += 9)
  20678. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  20679. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  20680. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  20681. h = Math.floor(s / this.chunksize),
  20682. u = Math.floor(l / this.chunksize),
  20683. d = Math.floor(c / this.chunksize),
  20684. p = h + "." + u + "." + d,
  20685. p in this.chunks ? (g = this.chunks[p],
  20686. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  20687. f = this.boundingBoxes[p] = new r.Box3),
  20688. 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]),
  20689. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  20690. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  20691. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  20692. }
  20693. ,
  20694. n.prototype.build = function() {
  20695. var e = new r.Object3D;
  20696. e.material = this.material;
  20697. for (var t in this.chunks) {
  20698. var i = this.chunks[t]
  20699. , n = new r.BufferGeometry;
  20700. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  20701. n.boundingBox = this.boundingBoxes[t];
  20702. var o = new r.Mesh(n,this.material);
  20703. o.material.visible = !1,
  20704. e.add(o),
  20705. this.chunks[t] = []
  20706. }
  20707. return e
  20708. }
  20709. ,
  20710. t.exports = n
  20711. }
  20712. , {
  20713. "../enum/Viewmode": 51,
  20714. three: 217
  20715. }],
  20716. 146: [function(e, t, i) {//"./objects/Floor"
  20717. "use strict";
  20718. function n(e, t, i) {
  20719. r.Object3D.call(this),
  20720. this.model = e,
  20721. this.floorIndex = t,
  20722. this.name = i || d.FLOOR_NAME + (t + 1),
  20723. this.panos = [],
  20724. this.chunks = [],
  20725. this.colliderBuilder = new l(3),
  20726. this.collider = null,
  20727. this.center = null,
  20728. this.boundingBox = new r.Box3,
  20729. this.size = null,
  20730. this.hidden = !1,
  20731. this.conservativeBoundingBox = new r.Box3,
  20732. this.debugColor = 16777215 * Math.random(),
  20733. this.transition = null
  20734. }
  20735. var r = e("three")
  20736. , o = e("../settings")
  20737. , a = e("../util/common")
  20738. , s = e("../util/lerp")
  20739. , l = e("./ChunkedCollider")
  20740. , c = e("../util/transitions")
  20741. , h = e("../util/easing")
  20742. , u = (e("../objects/Panorama"),
  20743. e("../enum/RenderOrder"))
  20744. , d = e("../localization/localize");
  20745. n.prototype = Object.create(r.Object3D.prototype),
  20746. n.prototype.enter = function(e) {
  20747. this.model.setFloor(this, e)
  20748. }
  20749. ,
  20750. n.prototype.hide = function(e) {
  20751. if (!this.hidden || this.transition) {
  20752. this.chunks.forEach(function(e) {
  20753. e.material.transparent = !0
  20754. }),
  20755. c.cancel(this.transition);
  20756. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  20757. , i = e ? 0 : o.hideFloorDelay / t;
  20758. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  20759. this.hidden = !0
  20760. }
  20761. .bind(this), i, h.easeInOutQuad)
  20762. }
  20763. }
  20764. ,
  20765. n.prototype.show = function(e) {
  20766. if (this.hidden || this.transition) {
  20767. this.hidden = !1,
  20768. c.cancel(this.transition);
  20769. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  20770. , i = e ? 0 : o.showFloorDelay / t;
  20771. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  20772. this.hidden || this.chunks.forEach(function(e) {
  20773. e.material.transparent = !1
  20774. })
  20775. }
  20776. .bind(this), i, h.easeInOutQuad)
  20777. }
  20778. }
  20779. ,
  20780. n.prototype.toggle = function(e, t) {
  20781. e = void 0 === e ? this.hidden : e,
  20782. e ? this.show(t) : this.hide(t)
  20783. }
  20784. ,
  20785. n.prototype.containsPoint = function(e) {
  20786. return this.collider.children.some(function(t) {
  20787. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  20788. t.geometry.boundingBox.containsPoint(e)
  20789. })
  20790. }
  20791. ,
  20792. n.prototype.distanceToPoint = function(e) {
  20793. var t = null
  20794. , i = 1 / 0;
  20795. return this.collider.children.forEach(function(n) {
  20796. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  20797. var r = n.geometry.boundingBox.distanceToPoint(e);
  20798. (!t || i > r) && (i = r,
  20799. t = n)
  20800. }),
  20801. i
  20802. }
  20803. ,
  20804. n.prototype.addChunk = function(e) {
  20805. e.renderOrder = u.ghostFloor,
  20806. this.add(e),
  20807. this.chunks.push(e),
  20808. this.boundingBox.union(e.geometry.boundingBox),
  20809. this.size = this.boundingBox.size(),
  20810. this.colliderBuilder.add(e.geometry)
  20811. }
  20812. ,
  20813. n.prototype.addPano = function(e) {
  20814. this.panos.push(e),
  20815. this.add(e.skyboxMesh),
  20816. e.marker && this.add(e.marker);
  20817. var t = new r.Vector3(1,1,1)
  20818. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  20819. this.boundingBox.union(i)
  20820. }
  20821. ,
  20822. n.prototype.build = function() {
  20823. this.collider = this.colliderBuilder.build(!0),
  20824. this.add(this.collider),
  20825. this.center = this.boundingBox.center(),
  20826. this.conservativeBoundingBox.copy(this.boundingBox),
  20827. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  20828. return e.geometry.boundingBox.min.y
  20829. }), 5),
  20830. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  20831. return e.geometry.boundingBox.max.y
  20832. }), 5),
  20833. this.colliderBuilder = null
  20834. }
  20835. ,
  20836. n.prototype.toShortString = function() {
  20837. return a.nth(this.floorIndex + 1)
  20838. }
  20839. ,
  20840. n.prototype.toString = function() {
  20841. return this.name
  20842. }
  20843. ,
  20844. t.exports = n
  20845. }
  20846. , {
  20847. "../enum/RenderOrder": 42,
  20848. "../localization/localize": 108,
  20849. "../objects/Panorama": 148,
  20850. "../settings": 166,
  20851. "../util/common": 185,
  20852. "../util/easing": 186,
  20853. "../util/lerp": 188,
  20854. "../util/transitions": 195,
  20855. "./ChunkedCollider": 145,
  20856. three: 217
  20857. }],
  20858. 147: [function(e, t, i) {//"./objects/NSpider"
  20859. "use strict";
  20860. function n(e) {
  20861. this.player = e,
  20862. this.obj3d = null,
  20863. this.UP = new r.Vector3(0,1,0)
  20864. }
  20865. var r = e("three")
  20866. , o = e("../settings");
  20867. n.prototype.prefs = {
  20868. linewidth: 3,
  20869. height: .07,
  20870. opacity: .45,
  20871. endScale: .05
  20872. },
  20873. n.prototype.discard = function() {
  20874. if (this.obj3d) {
  20875. var e = this.obj3d.parent;
  20876. e && e.remove(this.obj3d)
  20877. }
  20878. this.obj3d = null
  20879. }
  20880. ,
  20881. n.prototype.draw = function() {
  20882. if (this.discard(),
  20883. o.showNeighbors) {
  20884. var e = this.player.currentPano.floor;
  20885. this.obj3d = new r.Object3D;
  20886. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  20887. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  20888. i.y += this.prefs.height;
  20889. var n = .1525
  20890. , a = .127
  20891. , s = .0127
  20892. , l = .1
  20893. , c = .19
  20894. , h = .2032
  20895. , u = .2286
  20896. , d = .255
  20897. , p = new r.Matrix4;
  20898. for (var f in t)
  20899. if (t[f]) {
  20900. var g = this.player.model.panos.get(f)
  20901. , m = (g.position.clone().sub(this.player.model.position),
  20902. g.position.clone().sub(g.floorPosition))
  20903. , v = g.floorPosition.clone().sub(this.player.model.position);
  20904. v.y += this.prefs.height;
  20905. var A = new r.Geometry;
  20906. 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)),
  20907. 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)),
  20908. p.identity().setPosition(m),
  20909. A.applyMatrix(p),
  20910. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  20911. 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)),
  20912. p.lookAt(v, i, this.UP).setPosition(v),
  20913. A.applyMatrix(p),
  20914. A.vertices.push(v, i);
  20915. var y = new r.Line(A,new r.LineBasicMaterial({
  20916. color: g.debugColor.getHex(),
  20917. transparent: !0,
  20918. opacity: this.prefs.opacity,
  20919. depthWrite: !1,
  20920. name: "sLine" + f,
  20921. linewidth: this.prefs.linewidth
  20922. }));
  20923. this.obj3d.add(y)
  20924. }
  20925. e.add(this.obj3d)
  20926. }
  20927. }
  20928. ,
  20929. n.prototype.update = function() {
  20930. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  20931. }
  20932. ,
  20933. t.exports = n
  20934. }
  20935. , {
  20936. "../settings": 166,
  20937. three: 217
  20938. }],
  20939. 148: [function(e, t, i) {///js/objects/Panorama.js
  20940. (function(i) {
  20941. "use strict";
  20942. function n(e, t, i, n) {
  20943. this.model = e,
  20944. this.id = t,
  20945. this.alignmentType = i.alignmentType || l.ALIGNED,
  20946. this.neighbourUUIDs = i.neighbours || null,
  20947. this.neighbourPanos = null,
  20948. this.floor = null,
  20949. this.floorIndex = i.floor,
  20950. this.failedLoadingAt = 0,
  20951. this.maxLoadRetries = 4,
  20952. this.origin = i.position.clone(),
  20953. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  20954. this.quaternion = i.quaternion.clone(),
  20955. this.skyboxMesh = new r.Mesh(E),
  20956. this.skyboxMesh.position.copy(this.position),
  20957. this.skyboxMesh.quaternion.copy(this.quaternion),
  20958. this.skyboxMesh.name = "skybox",
  20959. this.skyboxMesh.visible = !1,
  20960. this.skyboxMesh.updateMatrix(),
  20961. this.skyboxMesh.updateMatrixWorld(),
  20962. this.marker = null,
  20963. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  20964. map: w,
  20965. side: r.DoubleSide,
  20966. opacity: 0,
  20967. transparent: !0,
  20968. depthWrite: !1
  20969. })),
  20970. this.marker.renderOrder = s.panoMarker,
  20971. this.marker.name = "marker",
  20972. this.marker.pano = this,
  20973. this.marker.layers.set(v.PANOMARKERS),
  20974. this.marker.updateMatrixWorld(),
  20975. a.colorMarkerOnLoad && this.on("load", function() {
  20976. this.marker.material.color.set(65280)
  20977. })),
  20978. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  20979. this.floorPosition = i.puck ? i.puck.clone() : null,
  20980. this.tiled = n,
  20981. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  20982. this.solidSkybox.flipY = !1,
  20983. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  20984. this.solidSkybox.magFilter = r.LinearFilter,
  20985. this.solidSkybox.generateMipmaps = !1)),
  20986. this.zoomed = !1,
  20987. this.panoRenderer = null,
  20988. this.qualityManager = null,
  20989. this.tileDownloader = null,
  20990. this.tiledPanoRenderTarget = null,
  20991. this.minimumTiledPanoLoaded = !1,
  20992. this.highestPartialTileRenderOpCompleted = 0,
  20993. this.highestFullTileRenderOpCompleted = 0,
  20994. this.shouldRedrawOnBaseLoaded = !1,
  20995. this.lockUntilRenderingComplete = !1,
  20996. a.colorMarkerOnLoad && this.on("load", function() {
  20997. this.marker.material.color.set(65280)
  20998. })
  20999. //xzw
  21000. this.noBlocks = i.noBlocks,
  21001. this.seeMarkers = i.seeMarkers;
  21002. }
  21003. var r = e("three")
  21004. , o = e("../util/logger")
  21005. , a = e("../settings")
  21006. , s = (e("../enum/Viewmode"),
  21007. e("../enum/RenderOrder"))
  21008. , l = e("../enum/AlignmentType")
  21009. , c = (e("../util/common"),
  21010. e("../util/transitions"))
  21011. , h = e("../util/lerp")
  21012. , u = e("../util/ajax")
  21013. , d = e("../util/texture")
  21014. , p = e("../util/panorama")
  21015. , f = (e("../enum/TileDownloaderEvents"),
  21016. e("../enum/PanoramaEvents"))
  21017. , g = e("../enum/PanoRendererEvents")
  21018. , m = e("../enum/PanoSizeClass")
  21019. , v = e("../enum/RenderLayers")
  21020. , A = (e("../scene/SceneRenderer"),
  21021. e("../enum/GLCubeFaces"),
  21022. e("../exception/BasicException"))
  21023. , y = e("../tile/TileUtils")
  21024. , C = e("events").EventEmitter
  21025. , I = new o(i)
  21026. , E = new r.SphereBufferGeometry(.1)
  21027. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  21028. , 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");
  21029. n.prototype = Object.create(C.prototype),
  21030. n.prototype.enter = function() {
  21031. var e = null;
  21032. return function() {
  21033. this.setZoomed(!1),
  21034. this.emit("enter", {
  21035. oldPano: e,
  21036. newPano: this
  21037. }),
  21038. e = this
  21039. }
  21040. }(),
  21041. n.prototype.exit = function() {
  21042. this.tiled ? (this.clearWaitDeferreds(),
  21043. this.minimumTiledPanoLoaded = !1,
  21044. this.tiledPanoRenderTarget = null,
  21045. this.setZoomed(!1),
  21046. this.panoRenderer.deactivateTiledPano(this),
  21047. this.highestPartialTileRenderOpCompleted = 0,
  21048. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  21049. this.solidSkybox.loaded = !1,
  21050. this.solidSkybox.version = 0),
  21051. this.emit("exit")
  21052. }
  21053. ,
  21054. n.prototype.hoverOn = function(e) {
  21055. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  21056. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  21057. }
  21058. ,
  21059. n.prototype.hoverOff = function(e) {
  21060. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  21061. }
  21062. ,
  21063. n.prototype.build1 = function() {
  21064. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  21065. this.floor.addPano(this),
  21066. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  21067. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  21068. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  21069. }
  21070. ,
  21071. n.prototype.build2 = function() {
  21072. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  21073. this.height = this.position.distanceTo(this.floorPosition),
  21074. this.placeMarker()
  21075. }
  21076. ,
  21077. n.prototype.interpolateFloorPosition = function() {
  21078. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  21079. return !!e.floorPosition
  21080. }).sort(function(e, t) {
  21081. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  21082. }
  21083. .bind(this))
  21084. , t = this.position.clone();
  21085. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  21086. t
  21087. }
  21088. ,
  21089. n.prototype.raycastFloorPosition = function() {
  21090. I.warn("Performance warning: Raycasting to find floor position");
  21091. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  21092. , t = e.intersectObjects(this.model.colliders);
  21093. return t.length ? t[0].point : null
  21094. }
  21095. ,
  21096. n.prototype.raycastToFindFloor = function() {
  21097. 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)];
  21098. return function() {
  21099. I.warn("Performance warning: Raycasting to find floor index");
  21100. for (var t = 0; t < e.length; t++) {
  21101. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  21102. , n = i.intersectObjects(this.model.colliders);
  21103. if (n.length)
  21104. return n[0].object.parent.parent
  21105. }
  21106. return null
  21107. }
  21108. }(),
  21109. n.prototype.placeMarker = function() {
  21110. this.marker && (this.marker.position.copy(this.floorPosition),
  21111. this.marker.position.y += .05,
  21112. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  21113. }
  21114. ,
  21115. n.prototype.translate = function(e) {
  21116. this.position.add(e),
  21117. this.floorPosition.add(e)
  21118. }
  21119. ,
  21120. n.prototype.findClosestMidtpointPanoTo = function(e) {
  21121. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  21122. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  21123. }
  21124. ,
  21125. n.prototype.attachToPanoRenderer = function(e) {
  21126. this.panoRenderer = e,
  21127. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  21128. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  21129. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  21130. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  21131. }
  21132. ;
  21133. var _ = {};
  21134. n.prototype.getWaitDeferred = function(e) {
  21135. var t = _[this.id];
  21136. t || (t = {},
  21137. _[this.id] = t);
  21138. var i = t[e];
  21139. return i || (i = {
  21140. deferred: $.Deferred(),
  21141. active: !1
  21142. },
  21143. t[e] = i),
  21144. i
  21145. }
  21146. ,
  21147. n.prototype.resetWaitDeferred = function(e) {
  21148. var t = this.getWaitDeferred(e);
  21149. t.active = !1,
  21150. t.deferred = $.Deferred()
  21151. }
  21152. ,
  21153. n.prototype.clearWaitDeferreds = function() {
  21154. var e = _[this.id];
  21155. e || (e = {},
  21156. _[this.id] = e);
  21157. for (var t in e)
  21158. if (e.hasOwnProperty(t)) {
  21159. var i = e[t];
  21160. i.active = !1,
  21161. i.deferred = $.Deferred()
  21162. }
  21163. }
  21164. ,
  21165. n.prototype.loadTiledPano = function() {
  21166. var e = (new r.Vector3,
  21167. [])
  21168. , t = [];
  21169. return function(i, n, r, o, a, s) {
  21170. null !== o && void 0 !== o || (o = !0),
  21171. null !== a && void 0 !== a || (a = !0);
  21172. var l = this.getWaitDeferred(i)
  21173. , c = l.deferred
  21174. , h = null
  21175. , u = null;
  21176. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  21177. u = r.vFov)),
  21178. !this.isLoaded(i)) {
  21179. if (!l.active) {
  21180. if (l.active = !0,
  21181. r) {
  21182. var d = y.matchingTilesInDirection(this, i, n, h, u);
  21183. e[this.id + ":" + i] = {
  21184. tileCount: 0,
  21185. targetTileCount: d
  21186. },
  21187. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  21188. }
  21189. t[this.id] || (t[this.id] = !0,
  21190. this.on(f.LoadComplete, function(e, t) {
  21191. var i = this.getWaitDeferred(e).deferred;
  21192. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  21193. this.resetWaitDeferred(e))
  21194. }
  21195. .bind(this)),
  21196. this.on(f.LoadFailed, function(e) {
  21197. var t = this.getWaitDeferred(e).deferred;
  21198. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  21199. this.resetWaitDeferred(e))
  21200. }
  21201. .bind(this)),
  21202. this.on(f.TileLoaded, function(t, i, n) {
  21203. var r = this.getWaitDeferred(t).deferred;
  21204. if (r && "pending" === r.state()) {
  21205. r.notify(t, i, n);
  21206. var o = e[this.id + ":" + t];
  21207. o && (o.tileCount++,
  21208. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  21209. r.resolve(t, n),
  21210. this.resetWaitDeferred(t)))
  21211. }
  21212. }
  21213. .bind(this)))
  21214. }
  21215. this.tileDownloader.clearForceQueue(),
  21216. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  21217. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  21218. this.panoRenderer.renderPanoTiles(this.id, n, a)
  21219. }
  21220. return c.promise()
  21221. }
  21222. }(),
  21223. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  21224. if (e === this.id) {
  21225. var n = this.qualityManager.getPanoSize(m.BASE);
  21226. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  21227. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  21228. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  21229. }
  21230. }
  21231. ,
  21232. n.prototype.onTileRendered = function(e, t, i, n) {
  21233. e === this.id && this.emit(f.TileLoaded, t, i, n)
  21234. }
  21235. ,
  21236. n.prototype.onPanoRendered = function(e, t, i, n) {
  21237. e === this.id && (this.minimumTiledPanoLoaded = !0,
  21238. this.updateSkyboxForZoomLevel(),
  21239. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  21240. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  21241. this.emit("load", t),
  21242. this.model.emit("load", this),
  21243. this.emit(f.LoadComplete, t, i))
  21244. }
  21245. ,
  21246. n.prototype.setZoomed = function(e) {
  21247. this.zoomed = e,
  21248. this.updateSkyboxForZoomLevel()
  21249. }
  21250. ,
  21251. n.prototype.ensureSkyboxReadyForRender = function() {
  21252. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  21253. this.solidSkybox.loaded = !0)
  21254. }
  21255. ,
  21256. n.prototype.updateSkyboxForZoomLevel = function() {
  21257. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  21258. }
  21259. ,
  21260. n.prototype.getSkyboxTexture = function() {
  21261. // return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  21262. if(this.tiled){
  21263. if(this.minimumTiledPanoLoaded){
  21264. if(this.zoomed) return this.panoRenderer.zoomRenderTarget.texture;
  21265. else return this.tiledPanoRenderTarget.texture;
  21266. }else{
  21267. return null;
  21268. }
  21269. }else return this.solidSkybox;
  21270. }
  21271. ,
  21272. n.prototype.onTileRenderFail = function(e, t, i) {
  21273. e === this.id && this.emit(f.LoadFailed, t)
  21274. }
  21275. ,
  21276. n.prototype.isLoaded = function(e) {
  21277. if (this.tiled) {
  21278. if (e && "string" == typeof e)
  21279. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  21280. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  21281. }
  21282. if (e && "number" == typeof e)
  21283. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  21284. return !!this.solidSkybox.high || e in this.solidSkybox
  21285. }
  21286. ,
  21287. n.prototype.loadCube = function(e) {
  21288. if (this.isLoaded(e))
  21289. return I.info("Skipping load of pano, already loaded"),
  21290. $.when();
  21291. this.emit("loading", e),
  21292. this.model.emit("loading", this);
  21293. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  21294. , i = t.filter(function(e) {
  21295. return !e
  21296. });
  21297. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  21298. e = "high",
  21299. t = p.getCubemapUrls(this.model.urls, this.id, e));
  21300. var n = 0
  21301. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  21302. return u.getImage(t[i])
  21303. }
  21304. .bind(this));
  21305. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  21306. return this.solidSkybox[e] = [t, i, n, r, o, a],
  21307. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  21308. this.solidSkybox.low = null),
  21309. this.solidSkybox.needsUpdate = !0,
  21310. this.emit("load", e),
  21311. this.model.emit("load", this),
  21312. this
  21313. }
  21314. .bind(this), function() {
  21315. I.error("Downloading cubemap for pano", this.id, "failed"),
  21316. this.failedLoadingAt = Date.now()
  21317. }
  21318. .bind(this), function() {
  21319. return $.when(++n, 6)
  21320. })
  21321. }
  21322. ,
  21323. n.raycastsSkipped = 0,
  21324. n.raycastsDone = 0,
  21325. n.prototype.findNeighourPanos = function() {
  21326. return this.model.panos.setNeighbour(this.id, this.id, !1),
  21327. this.model.panos.forEach(function(e) {
  21328. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  21329. var t = this.position.distanceTo(e.position);
  21330. if (t > a.panoramaNeighbourMaxDistance)
  21331. return this.model.panos.setNeighbour(this, e, !1),
  21332. void n.raycastsSkipped++;
  21333. var i = e.position.clone().sub(this.position).normalize()
  21334. , o = new r.Raycaster(this.position,i.clone(),0,t)
  21335. , s = o.intersectObjects(this.model.colliders);
  21336. n.raycastsDone++,
  21337. this.model.panos.setNeighbour(this, e, 0 === s.length),
  21338. 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)))
  21339. }
  21340. }
  21341. .bind(this)),
  21342. this.model.panos.neighbourMap[this.id]
  21343. }
  21344. ,
  21345. n.prototype.worldPosition = function() {
  21346. return this.position
  21347. }
  21348. ,
  21349. n.prototype.addTextSprite = function(e, t) {
  21350. this.removeTextSprite();
  21351. var i = document.createElement("canvas")
  21352. , n = i.getContext("2d");
  21353. i.width = 256,
  21354. i.height = 256;
  21355. var o = "Arial"
  21356. , a = 60;
  21357. n.font = "bold " + a + "px " + o,
  21358. n.fillStyle = "white";
  21359. var s = n.measureText(e).width;
  21360. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  21361. var l = new r.Texture(i);
  21362. l.needsUpdate = !0;
  21363. var c = new r.SpriteMaterial({
  21364. map: l,
  21365. color: t || 16428055
  21366. });
  21367. this.text3d = new r.Sprite(c),
  21368. this.text3d.position.copy(this.skyboxMesh.position),
  21369. this.floor.add(this.text3d)
  21370. }
  21371. ,
  21372. n.prototype.removeTextSprite = function() {
  21373. this.text3d && (this.floor.remove(this.text3d),
  21374. this.text3d = null)
  21375. }
  21376. ,
  21377. n.prototype.isAligned = function() {
  21378. return this.alignmentType === l.ALIGNED
  21379. }
  21380. ,
  21381. n.filters = {
  21382. inDirection: function(e, t, i) {
  21383. return function(n) {
  21384. var r = n.position.clone().sub(e).normalize();
  21385. return r.dot(t) > i
  21386. }
  21387. },
  21388. inFloorDirection: function(e, t, i) {
  21389. return function(n) {
  21390. var r = n.floorPosition.clone().sub(e).normalize();
  21391. return r.dot(t) > i
  21392. }
  21393. },
  21394. inPanoDirection: function(e, t, i) {
  21395. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  21396. function(n) {
  21397. var r = n.floorPosition.clone().sub(e).normalize()
  21398. , o = n.position.clone().sub(e).normalize();
  21399. return r.dot(t) > i || o.dot(t) > i
  21400. }
  21401. },
  21402. atFloor: function(e) {
  21403. return function(t) {
  21404. return !e || t.floor === e
  21405. }
  21406. },
  21407. not: function(e) {
  21408. return function(t) {
  21409. return t !== e
  21410. }
  21411. },
  21412. notIn: function(e) {
  21413. return function(t) {
  21414. return e.indexOf(t) === -1
  21415. }
  21416. },
  21417. isLoaded: function() {
  21418. return function(e) {
  21419. return e.isLoaded()
  21420. }
  21421. },
  21422. isNotLoaded: function() {
  21423. return function(e) {
  21424. return !e.isLoaded()
  21425. }
  21426. },
  21427. isCloseEnoughTo: function(e, t) {
  21428. return function(i) {
  21429. return e.distanceTo(i.floorPosition) < t
  21430. }
  21431. },
  21432. hasMinimumHeightDifferenceTo: function(e, t) {
  21433. return function(i) {
  21434. return Math.abs(i.position.y - e.y) > t
  21435. }
  21436. },
  21437. isNotBehindNormal: function(e, t) {
  21438. var i = new r.Vector3;
  21439. return t = t.clone(),
  21440. function(n) {
  21441. var r = i.copy(n.position).sub(e).normalize();
  21442. return r.dot(t) > 0
  21443. }
  21444. },
  21445. isNeighbourPanoTo: function(e) {
  21446. return function(t) {
  21447. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  21448. }
  21449. },
  21450. isNeighbourOfNeighbourTo: function(e) {
  21451. return function(t) {
  21452. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  21453. var n = e.model.panos.get(i);
  21454. return !!n && n.neighbourPanos[t.id]
  21455. })
  21456. }
  21457. },
  21458. isNotRecentlyFailed: function(e) {
  21459. return function(t) {
  21460. return Date.now() - t.failedLoadingAt > e
  21461. }
  21462. },
  21463. isOnVisibleFloor: function() {
  21464. return function(e) {
  21465. return !e.floor.hidden
  21466. }
  21467. },
  21468. isPanoAligned: function() {
  21469. return function(e) {
  21470. return e.isAligned()
  21471. }
  21472. }
  21473. },
  21474. n.sortFunctions = {
  21475. distanceToPoint: function(e) {
  21476. return function(t, i) {
  21477. return t.position.distanceTo(e) - i.position.distanceTo(e)
  21478. }
  21479. },
  21480. floorDistanceToPoint: function(e) {
  21481. return function(t, i) {
  21482. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  21483. }
  21484. },
  21485. choose: function(e) {
  21486. return function(t, i) {
  21487. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  21488. }
  21489. }
  21490. },
  21491. n.scoreFunctions = {
  21492. distance: function(e, t) {
  21493. return t = t || a.navigation.distanceFactor,
  21494. function(i) {
  21495. return e ? e.position.distanceTo(i.position) * t : 0
  21496. }
  21497. },
  21498. distanceSquared: function(e, t) {
  21499. return t = t || a.navigation.distanceFactor,
  21500. function(i) {
  21501. return e ? e.position.distanceToSquared(i.position) * t : 0
  21502. }
  21503. },
  21504. direction: function(e, t) {
  21505. return function(i) {
  21506. var n = i.position.clone().sub(e).normalize();
  21507. return n.dot(t) * a.navigation.directionFactor
  21508. }
  21509. },
  21510. angle: function(e, t) {
  21511. return function(i) {
  21512. var n = i.position.clone().sub(e).normalize();
  21513. return n.angleTo(t) * a.navigation.angleFactor
  21514. }
  21515. },
  21516. inFieldOfView: function(e, t) {
  21517. return function(i) {
  21518. var n = i.position.clone().sub(e).normalize();
  21519. return n.dot(t) > .75 ? 10 : -1
  21520. }
  21521. },
  21522. optionality: function(e) {
  21523. return function(t) {
  21524. var i = t.neighbourUUIDs.filter(function(t) {
  21525. return !(t in e.neighbourUUIDs) && t !== e.id
  21526. });
  21527. return i.length * a.navigation.optionalityFactor
  21528. }
  21529. },
  21530. penalizeHeightDifferenceUnder: function(e, t) {
  21531. return function(i) {
  21532. return e.y - i.position.y < t ? -20 : 0
  21533. }
  21534. }
  21535. },
  21536. t.exports = n
  21537. }
  21538. ).call(this, "/js/objects/Panorama.js")
  21539. }
  21540. , {
  21541. "../enum/AlignmentType": 17,
  21542. "../enum/GLCubeFaces": 25,
  21543. "../enum/PanoRendererEvents": 35,
  21544. "../enum/PanoSizeClass": 36,
  21545. "../enum/PanoramaEvents": 37,
  21546. "../enum/RenderLayers": 41,
  21547. "../enum/RenderOrder": 42,
  21548. "../enum/TileDownloaderEvents": 45,
  21549. "../enum/Viewmode": 51,
  21550. "../exception/BasicException": 55,
  21551. "../scene/SceneRenderer": 158,
  21552. "../settings": 166,
  21553. "../tile/TileUtils": 174,
  21554. "../util/ajax": 181,
  21555. "../util/common": 185,
  21556. "../util/lerp": 188,
  21557. "../util/logger": 189,
  21558. "../util/panorama": 191,
  21559. "../util/texture": 194,
  21560. "../util/transitions": 195,
  21561. events: 202,
  21562. three: 217
  21563. }],
  21564. 149: [function(e, t, i) {//"./objects/Reticule"
  21565. "use strict";
  21566. function n(e) {
  21567. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  21568. t.map.value = d,
  21569. t.opacity.value = 0,
  21570. t.color.value.set(o.reticuleColor),
  21571. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  21572. side: r.DoubleSide,
  21573. depthWrite: !1,
  21574. depthTest: !1,
  21575. transparent: !0,
  21576. vertexShader: c.waypoint.vertexShader,
  21577. fragmentShader: c.waypoint.fragmentShader,
  21578. uniforms: t,
  21579. name: "waypoint",
  21580. opacity: 0
  21581. })),
  21582. this.layers.set(h.RETICULE),
  21583. this.renderOrder = u.reticule,
  21584. this.player = e,
  21585. this.direction = new r.Vector3,
  21586. this.hidden = !0,
  21587. this.mouseLastMoveTime = Date.now()
  21588. }
  21589. var r = e("three")
  21590. , o = e("../settings")
  21591. , a = e("../util/transitions")
  21592. , s = e("../util/texture")
  21593. , l = e("../util/lerp")
  21594. , c = e("../shaders")
  21595. , h = e("../enum/RenderLayers")
  21596. , u = e("../enum/RenderOrder")
  21597. , 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=");
  21598. n.prototype = Object.create(r.Mesh.prototype),
  21599. n.prototype.move = function(e, t, i) {
  21600. this.hidden = i,
  21601. this.mouseLastMoveTime = Date.now()
  21602. }
  21603. ,
  21604. n.prototype.hide = function() {
  21605. this.hidden || (this.hidden = !0,
  21606. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  21607. }
  21608. ,
  21609. n.prototype.show = function() {
  21610. this.hidden = !1,
  21611. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  21612. }
  21613. ,
  21614. n.prototype.update = function() {
  21615. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  21616. }
  21617. ,
  21618. n.prototype.updatePosition = function(e, t) {
  21619. if (!this.hidden) {
  21620. if (!t)
  21621. return this.hide();
  21622. var i = t.point
  21623. , n = e.distanceTo(i)
  21624. , r = 1 + .01 * n;
  21625. n < 1 && (r -= 1 - n),
  21626. this.show(),
  21627. this.scale.set(r, r, r),
  21628. this.direction = this.direction.multiplyScalar(.8),
  21629. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  21630. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  21631. this.lookAt(this.position.clone().add(this.direction))
  21632. }
  21633. }
  21634. ,
  21635. n.prototype.writeAstag = function() {
  21636. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  21637. , t = new Date;
  21638. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  21639. var i = {
  21640. enabled: !0,
  21641. version: "0",
  21642. created: t.toISOString(),
  21643. created_by: "APITest",
  21644. position: this.position.clone(),
  21645. stem: {
  21646. enabled: o.tags.pole.enabled,
  21647. direction: this.direction.multiplyScalar(o.tags.pole.height)
  21648. },
  21649. label: "tag " + this.tagCount,
  21650. description: "Description " + e,
  21651. floor: function(e) {
  21652. if (e.currentFloor) {
  21653. var t = e.floors.indexOf(e.currentFloor);
  21654. return t > -1 ? t : void 0
  21655. }
  21656. }(this.player.model),
  21657. type: "info",
  21658. metadata: {
  21659. preferred_camera: {
  21660. mode: this.player.mode
  21661. }
  21662. }
  21663. };
  21664. console.log("--------------------------"),
  21665. console.log(JSON.stringify(i));
  21666. var n = this.player.model.addtag(e, i).build();
  21667. n && (n.disc && this.player.tagDiscs.push(n.disc),
  21668. n.visible || n.show(o.tags.startup.fadeInDuration))
  21669. }
  21670. ,
  21671. t.exports = n
  21672. }
  21673. , {
  21674. "../enum/RenderLayers": 41,
  21675. "../enum/RenderOrder": 42,
  21676. "../settings": 166,
  21677. "../shaders": 167,
  21678. "../util/lerp": 188,
  21679. "../util/texture": 194,
  21680. "../util/transitions": 195,
  21681. three: 217
  21682. }],
  21683. 150: [function(e, t, i) {//"../objects/Room"
  21684. "use strict";
  21685. function n(e, t) {
  21686. this.chunks = [],
  21687. this.floorId = e,
  21688. this.roomId = t,
  21689. this.position = new r.Vector3
  21690. }
  21691. var r = e("three");
  21692. n.prototype.addChunk = function(e) {
  21693. this.chunks.push(e)
  21694. }
  21695. ,
  21696. n.prototype.calcBoundaries = function() {
  21697. 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++) {
  21698. var s = this.chunks[a]
  21699. , l = s.geometry.attributes.position;
  21700. if (l)
  21701. for (var c = 0; c < l.array.length; c += 3)
  21702. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  21703. t.add(e),
  21704. 0 === c ? (i.copy(e),
  21705. n.copy(e)) : (i.max(e),
  21706. n.min(e)),
  21707. o++
  21708. }
  21709. o > 0 ? (t.multiplyScalar(1 / o),
  21710. this.average = t) : this.average = null,
  21711. this.boundsMax = i,
  21712. this.boundsMin = n,
  21713. this.center = new r.Vector3,
  21714. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  21715. }
  21716. ,
  21717. t.exports = n
  21718. }
  21719. , {
  21720. three: 217
  21721. }],
  21722. 151: [function(e, t, i) {///js/objects/ShowPath.js
  21723. (function(i) {
  21724. "use strict";
  21725. function n(e, t, i) {
  21726. this.obj3d = null,
  21727. this.nodes = [],
  21728. this.colorHull = [],
  21729. this.shortPaths = {},
  21730. this.floorHull = null,
  21731. this.cameraHull = null,
  21732. this.floorPathDistance = 0,
  21733. this.floorCurvePoints = null,
  21734. this.floorCurveColors = null,
  21735. this.camCurvePoints = null,
  21736. this.warpDestHeroLoc = null,
  21737. this.warpDestPano = null,
  21738. this.warpPathPoints = null,
  21739. this.warpPathLengths = [0],
  21740. this.warpLength = 0,
  21741. this.closeWarpDistance = 4,
  21742. this.UP = A.UP.clone(),
  21743. this.longestStep = 0,
  21744. this.upcomingTransType = null,
  21745. this.burnsDir = 1,
  21746. this.prevNextDist = 0,
  21747. this.nextI = 0,
  21748. this.activeTransType = null,
  21749. this.lastTransType = null,
  21750. this.bunnyObj = null,
  21751. this.director = e,
  21752. this.player = t,
  21753. this.playerControls = i,
  21754. this.modelManager = t.modelManager,
  21755. this.updateModel(),
  21756. this.updateDefaultsFromModelData(),
  21757. this.bindEvents(),
  21758. this.warping = !1,
  21759. this.waitingToWarp = !1,
  21760. this.warpInterrupted = !1,
  21761. this.warpInterruptionBlackoutStyle = null,
  21762. this.warpInterruptionTravelTime = null
  21763. }
  21764. var r = e("three")
  21765. , o = e("../util/logger")
  21766. , a = e("../enum/Viewmode")
  21767. , s = e("../enum/RenderOrder")
  21768. , l = e("../enum/WarpStyle")
  21769. , c = e("../settings")
  21770. , h = e("../util/math")
  21771. , u = e("../util/lerp")
  21772. , d = e("../util/easing")
  21773. , p = e("../util/transitions")
  21774. , f = e("../objects/Snapshot")
  21775. , g = e("../effects")
  21776. , m = e("../shaders")
  21777. , v = (e("../gui/gui"),
  21778. e("../util/texture"))
  21779. , A = e("../enum/Vectors")
  21780. , y = (e("../model/ModelManager"),
  21781. new o(i))
  21782. , C = e("../enum/PlayerEvents")
  21783. , I = e("../enum/BlackoutStyle")
  21784. , E = e("../enum/ModelManagerEvents")
  21785. , b = e("../constants")
  21786. , w = {
  21787. 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"),
  21788. 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"),
  21789. 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==")
  21790. };
  21791. n.prototype.setScene = function(e) {
  21792. this.createCpm(e),
  21793. this.createBunnyObj(e)
  21794. }
  21795. ,
  21796. n.prototype.updateModel = function() {
  21797. this.model = this.modelManager.getActiveModel()
  21798. }
  21799. ,
  21800. n.prototype.bindEvents = function() {
  21801. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  21802. }
  21803. ,
  21804. n.prototype.updateDefaultsFromModelData = function() {
  21805. this.model.data
  21806. }
  21807. ,
  21808. n.prototype.pointPathDistance = function(e) {
  21809. for (var t = 0, i = 1; i < e.length; i += 1)
  21810. t += e[i - 1].distanceTo(e[i]);
  21811. return t
  21812. }
  21813. ,
  21814. n.prototype.pointPathLengths = function(e) {
  21815. for (var t = [0], i = 1; i < e.length; i += 1)
  21816. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  21817. return t
  21818. }
  21819. ,
  21820. n.prototype.interpAlongPath = function(e, t, i) {
  21821. var n, o = new r.Vector3, a = t[t.length - 1];
  21822. if (i < 1) {
  21823. n = i * a;
  21824. for (var s = 1; s < t.length; s += 1)
  21825. if (t[s] > n) {
  21826. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  21827. return o.copy(e[s]),
  21828. o.sub(e[s - 1]),
  21829. o.multiplyScalar(l),
  21830. o.add(e[s - 1]),
  21831. o
  21832. }
  21833. } else
  21834. o.copy(e[e.length - 1]);
  21835. return o
  21836. }
  21837. ,
  21838. n.prototype.pathHeight = function() {
  21839. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  21840. }
  21841. ,
  21842. n.prototype.createBunnyObj = function(e) {
  21843. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  21844. this.bunnyObj.visible = c.warp.showBunny),
  21845. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  21846. e.add(this.bunnyObj)
  21847. }
  21848. ,
  21849. n.prototype.createCpm = function(e) {
  21850. if (!this.currentPanoMarker) {
  21851. var t = this.makeWaypointObj(w.pathEnd, "Current");
  21852. t.material.uniforms.opacity.value = 0,
  21853. this.currentPanoMarker = {
  21854. mesh: t,
  21855. placed: !1
  21856. }
  21857. }
  21858. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  21859. this.placeCpm(),
  21860. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  21861. }
  21862. ,
  21863. n.prototype.placeCpm = function() {
  21864. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  21865. var e = this.player.currentPano.floor;
  21866. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  21867. e.add(this.currentPanoMarker.mesh)),
  21868. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  21869. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  21870. this.currentPanoMarker.placed = !0
  21871. } else
  21872. this.popOutCpm()
  21873. }
  21874. ,
  21875. n.prototype.fadeInCpm = function(e) {
  21876. 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)
  21877. }
  21878. ,
  21879. n.prototype.fadeOutCpm = function(e) {
  21880. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  21881. }
  21882. ,
  21883. n.prototype.popInCpm = function() {
  21884. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  21885. }
  21886. ,
  21887. n.prototype.popOutCpm = function() {
  21888. this.fadeOutCpm(2)
  21889. }
  21890. ,
  21891. n.prototype.brushPrefs = {
  21892. linewidth: 7,
  21893. strokeWidth: 15,
  21894. cvSegments: 48,
  21895. paveStep: .1,
  21896. paveWidth: .2,
  21897. lookBlendDist: 3,
  21898. maxTurn: r.Math.degToRad(2)
  21899. },
  21900. n.prototype.panoPathDistance = function(e) {
  21901. var t = this.model.panos;
  21902. if (!e || e.length < 2)
  21903. return 0;
  21904. for (var i = [], n = 0; n < e.length; n += 1)
  21905. i.push(t.get(e[n]).floorPosition);
  21906. return this.pointPathDistance(i)
  21907. }
  21908. ,
  21909. n.prototype.loadTileTexture = function(e) {
  21910. var t = v.load(e, function(t) {
  21911. t.wrapS = r.RepeatWrapping,
  21912. t.wrapT = r.RepeatWrapping,
  21913. t.needsUpdate = !0,
  21914. y.debug('path texture "' + e + '" is ready')
  21915. }, function() {
  21916. y.error('path texture "' + e + '" failed')
  21917. });
  21918. return t.mapping = r.UVMapping,
  21919. t
  21920. }
  21921. ,
  21922. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  21923. var a = {
  21924. cameraMode: n,
  21925. position: e,
  21926. quaternion: t,
  21927. panoId: i,
  21928. orthoZoom: o,
  21929. floorVisibility: r,
  21930. thumbUrl: null,
  21931. name: null
  21932. };
  21933. return new f(a)
  21934. }
  21935. ,
  21936. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  21937. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  21938. }
  21939. ,
  21940. n.prototype.setWarpDestination = function(e) {
  21941. this.warpDestHeroLoc = e
  21942. }
  21943. ,
  21944. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  21945. var t = this.getHeroDescriptorByHeroIndex(e);
  21946. return null !== t && (this.setWarpDestination(t),
  21947. !0)
  21948. }
  21949. ,
  21950. n.prototype.setWarpDestinationByPano = function(e, t) {
  21951. var i = this.model.panos.get(e.id);
  21952. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  21953. }
  21954. ,
  21955. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  21956. var i = this.model.panos.get(e);
  21957. if (i) {
  21958. t = t || new r.Quaternion;
  21959. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  21960. return this.setWarpDestination(n),
  21961. !0
  21962. }
  21963. return !1
  21964. }
  21965. ,
  21966. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  21967. var t = this.model.heroCount();
  21968. if (null !== this.warpDestHeroLoc && t < 2)
  21969. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  21970. this.model.getHeroDescriptorByIndex(0);
  21971. var i = this.model.getHeroDescriptorByIndex(e);
  21972. if (i) {
  21973. var n = i.isPano() ? i.panoId : i.cameraMode;
  21974. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  21975. }
  21976. return i
  21977. }
  21978. ,
  21979. n.prototype.getHeroDescriptorByPano = function(e) {
  21980. var t = this.model.panos.get(e.id);
  21981. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  21982. }
  21983. ,
  21984. n.prototype.getHeroDescriptorByPanoId = function(e) {
  21985. var t = this.getHeroIndexFromPanoId(e);
  21986. return this.getHeroDescriptorByHeroIndex(t)
  21987. }
  21988. ,
  21989. n.prototype.getHeroIndexFromPanoId = function(e) {
  21990. for (var t = 0; t < this.model.heroLocations.length; t++) {
  21991. var i = this.model.heroLocations[t]
  21992. , n = this.getHeroId(i);
  21993. if (n && n === e)
  21994. return t
  21995. }
  21996. return -1
  21997. }
  21998. ,
  21999. n.prototype.getHeroPano = function(e) {
  22000. if (null === e)
  22001. return y.warn("getHeroPano(): no destination"),
  22002. null;
  22003. var t = this.getHeroId(e)
  22004. , i = this.model.panos.get(t);
  22005. return void 0 === i && (i = null,
  22006. "" !== t && y.debug('unable to find pano "' + t + '"')),
  22007. i
  22008. }
  22009. ,
  22010. n.prototype.getHeroId = function(e) {
  22011. return e.panoId
  22012. }
  22013. ,
  22014. n.prototype.setWarpDestPano = function() {
  22015. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  22016. this.warpDestPano
  22017. }
  22018. ,
  22019. n.prototype.brushToWarpPano = function(e, t) {
  22020. if (this.discardPathObject(),
  22021. !this.setWarpDestPano())
  22022. return !1;
  22023. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  22024. !this.warpDestPano)
  22025. return y.info("No brush"),
  22026. !1;
  22027. if (!this.player.currentPano)
  22028. return y.debug("No current pano, visibility undefined"),
  22029. !1;
  22030. if (!this.warpDestPano)
  22031. return y.info("No wPano, visibility undefined"),
  22032. !1;
  22033. if (!this.warpDestPano.isAligned())
  22034. return y.debug("Cannot brush to unaligned pano"),
  22035. !1;
  22036. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  22037. , n = !0;
  22038. if (this.player.currentPano.id === this.warpDestPano.id)
  22039. y.debug("Already at destination pano");
  22040. else {
  22041. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  22042. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  22043. this.obj3d = new r.Object3D,
  22044. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  22045. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  22046. e = t) : (this.setPathHulls(this.nodes),
  22047. this.setFloorCurves(),
  22048. 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)))),
  22049. this.player.currentPano.floor.add(this.obj3d);
  22050. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  22051. , s = e === l.STD;
  22052. if (!n && (i || s)) {
  22053. if (o) {
  22054. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  22055. this.obj3d.add(h)
  22056. }
  22057. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  22058. this.obj3d.add(u)
  22059. }
  22060. this.appearSlow()
  22061. }
  22062. return this.upcomingTransType = e,
  22063. !n
  22064. }
  22065. ,
  22066. n.prototype.findShortestPath = function(e, t) {
  22067. if (!e || !t)
  22068. return null;
  22069. var i = c.warp.walkExtraPanosDistance
  22070. , n = e.id + ":" + t.id + ":" + i;
  22071. if (this.shortPaths.hasOwnProperty(n))
  22072. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  22073. var r = t.id + ":" + e.id + ":" + i;
  22074. if (this.shortPaths.hasOwnProperty(r))
  22075. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  22076. var o = this.model.panos.aStarSearch(e, t);
  22077. return this.model.panos.includeNodesNearPath(o, i),
  22078. this.shortPaths[n] = o ? o.slice() : null,
  22079. o
  22080. }
  22081. ,
  22082. n.prototype.makePathHulls = function(e) {
  22083. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  22084. t = u.get(e[0]),
  22085. r = t.floor.floorIndex;
  22086. for (var d = 0; d < e.length; d += 1)
  22087. t = u.get(e[d]),
  22088. i = t.floorPosition.clone().sub(this.model.position),
  22089. i.y += this.pathHeight(),
  22090. s.push(i),
  22091. l.push(t.position.clone()),
  22092. n = t.floor.floorIndex,
  22093. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  22094. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  22095. o > a && (a = o));
  22096. return a > this.longestStep && (this.longestStep = a,
  22097. y.debug("path contains " + a + " meter segment")),
  22098. {
  22099. floor: s,
  22100. camera: l,
  22101. color: h
  22102. }
  22103. }
  22104. ,
  22105. n.prototype.makeFloorCurves = function(e, t, i) {
  22106. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  22107. , o = this.pointPathDistance(e) - 2 * n
  22108. , s = e.slice(0)
  22109. , l = s[1].clone().sub(s[0]);
  22110. l.y = 0,
  22111. l.normalize().multiplyScalar(n),
  22112. s[0] = (new r.Vector3).copy(s[0]).add(l),
  22113. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  22114. l.y = 0,
  22115. l.normalize().multiplyScalar(n),
  22116. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  22117. var h = new r.CatmullRomCurve3(s)
  22118. , u = Math.floor(o / i);
  22119. u = 4 * Math.floor(u / 4),
  22120. u = Math.max(4, u);
  22121. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  22122. f = 0,
  22123. d = g[A].distanceTo(e[0]);
  22124. for (var y = 1; y < e.length; y += 1)
  22125. v.copy(g[A]).sub(e[y]),
  22126. v.y *= 4,
  22127. p = v.length(),
  22128. p < d && (f = y);
  22129. m.push(t[f])
  22130. }
  22131. return {
  22132. distance: o,
  22133. points: g,
  22134. colors: m
  22135. }
  22136. }
  22137. ,
  22138. n.prototype.makeCameraCurvePoints = function(e, t) {
  22139. var i = this.pointPathDistance(e)
  22140. , n = new r.CatmullRomCurve3(e);
  22141. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  22142. }
  22143. ,
  22144. n.prototype.makeCameraCurveTangents = function(e, t) {
  22145. var i = this.pointPathDistance(e)
  22146. , n = new r.CatmullRomCurve3(e)
  22147. , o = Math.max(2, Math.floor(i / t));
  22148. o || (o = 5);
  22149. for (var a = [], s = 0; s <= o; s++)
  22150. a.push(n.getTangentAt(s / o));
  22151. return a
  22152. }
  22153. ,
  22154. n.prototype.setPathHulls = function(e) {
  22155. var t = this.makePathHulls(e);
  22156. this.floorHull = t.floor,
  22157. this.cameraHull = t.camera,
  22158. this.colorHull = t.color
  22159. }
  22160. ,
  22161. n.prototype.setFloorCurves = function() {
  22162. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  22163. this.floorPathDistance = e.distance,
  22164. this.floorCurvePoints = e.points,
  22165. this.floorCurveColors = e.colors
  22166. }
  22167. ,
  22168. n.prototype.setCameraCurvePoints = function() {
  22169. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  22170. }
  22171. ,
  22172. n.prototype.chooseWarpPath = function(e) { //选择导览路径
  22173. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  22174. if (this.player.currentPano === this.warpDestPano || !e)
  22175. return this.warpPathPoints = null,
  22176. this.warpLength = 0,
  22177. !1;
  22178. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano);
  22179. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (
  22180. y.debug("warp path to unreachable node"),
  22181. t = this.warpDestPano.position.clone().sub(o.position),
  22182. i = t.clone().negate(),
  22183. t.multiplyScalar(.15).add(o.position),
  22184. i.multiplyScalar(.15).add(this.warpDestPano.position),
  22185. t.y = o.position.y,
  22186. i.y = this.warpDestPano.position.y,
  22187. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  22188. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)
  22189. )
  22190. : ( y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  22191. this.setCameraCurvePoints(),
  22192. this.warpPathPoints = this.camCurvePoints.slice(0)
  22193. );
  22194. this.warpLength = 0,
  22195. this.warpPathLengths = [0];
  22196. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)),
  22197. u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  22198. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  22199. var p = s.length();
  22200. s.y *= c.warp.climbEffort;
  22201. var f = s.length() / p;
  22202. if (d > 1) {
  22203. s.setY(0).normalize(),
  22204. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  22205. var g = Math.min(1, s.dot(l))
  22206. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  22207. f = Math.max(m, f)
  22208. }
  22209. this.warpLength += p * f,
  22210. this.warpPathLengths[d] = this.warpLength
  22211. }
  22212. return !0
  22213. }
  22214. ,
  22215. n.prototype.drawPathRibbon = function(e, t) {//画路径
  22216. this.bunnyObj.visible = c.warp.showBunny;
  22217. 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) {
  22218. h.copy(e[u]),
  22219. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  22220. h.normalize(),
  22221. n.crossVectors(h, A.UP),
  22222. n.multiplyScalar(i);
  22223. var d = (new r.Vector3).copy(e[u]).add(o);
  22224. d.sub(n),
  22225. l.vertices.push(d),
  22226. d = (new r.Vector3).copy(e[u]).add(o),
  22227. d.add(n),
  22228. l.vertices.push(d)
  22229. }
  22230. var p, f = 0;
  22231. for (u = 0; u < e.length - 1; u += 1) {
  22232. var g = 2 * u
  22233. , v = f;
  22234. f += e[u + 1].distanceTo(e[u]);
  22235. var y = f
  22236. , C = t[u]
  22237. , I = t[u + 1];
  22238. p = new r.Face3(g,g + 1,g + 2),
  22239. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  22240. l.faces.push(p),
  22241. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  22242. p = new r.Face3(g + 2,g + 1,g + 3),
  22243. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  22244. l.faces.push(p),
  22245. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  22246. }
  22247. l.computeFaceNormals(),
  22248. l.computeVertexNormals();
  22249. var E, b;
  22250. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  22251. b.map.value = w.path,
  22252. b.opacity.value = 0,
  22253. b.color.value.set(c.path.color),
  22254. E = new r.RawShaderMaterial({
  22255. side: r.DoubleSide,
  22256. depthWrite: !1,
  22257. transparent: !0,
  22258. vertexShader: m.ribbon.vertexShader,
  22259. fragmentShader: m.ribbon.fragmentShader,
  22260. uniforms: b,
  22261. name: "ribbonT",
  22262. opacity: 0
  22263. })) : E = new r.MeshBasicMaterial({
  22264. color: 16777215,
  22265. side: r.DoubleSide,
  22266. name: "ribbonOut",
  22267. vertexColors: r.VertexColors
  22268. });
  22269. var _ = new r.Mesh(l,E);
  22270. return _.name = "ribbon",
  22271. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  22272. _
  22273. }
  22274. ,
  22275. n.prototype.drawPathPavement = function(e) {//画路径大道
  22276. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  22277. s.copy(e[l]),
  22278. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  22279. s.normalize(),
  22280. n.crossVectors(s, A.UP),
  22281. n.multiplyScalar(this.brushPrefs.paveWidth),
  22282. t = (new r.Vector3).copy(e[l]),
  22283. t.sub(n),
  22284. o.vertices.push(t),
  22285. o.vertices.push((new r.Vector3).copy(e[l])),
  22286. t = (new r.Vector3).copy(e[l]),
  22287. t.add(n),
  22288. o.vertices.push(t);
  22289. var h, u, d;
  22290. for (l = 0; l < e.length - 1; l += 1)
  22291. h = 3 * l + 1,
  22292. u = l * i,
  22293. d = u + i,
  22294. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  22295. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  22296. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  22297. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  22298. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  22299. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  22300. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  22301. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  22302. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  22303. color: c.path.color,
  22304. side: r.DoubleSide,
  22305. transparent: !0,
  22306. depthWrite: !1,
  22307. opacity: 0,
  22308. name: "paveT",
  22309. map: w.path
  22310. }) : new r.MeshBasicMaterial({
  22311. color: c.path.color,
  22312. side: r.DoubleSide,
  22313. transparent: !0,
  22314. depthWrite: !1,
  22315. opacity: 1,
  22316. name: "paveO",
  22317. map: w.path
  22318. });
  22319. return new r.Mesh(o,p)
  22320. }
  22321. ,
  22322. n.prototype.hintPrefs = {
  22323. rad: .18,
  22324. width: .0125,
  22325. depth: .0625,
  22326. setBack: -.04,
  22327. markRad: .25,
  22328. markInnerRad: .16
  22329. },
  22330. n.prototype.makeWaypointObj = function(e, t) {//画路径圈圈
  22331. var i = new r.Geometry
  22332. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  22333. , o = this.pathHeight();
  22334. 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)),
  22335. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  22336. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  22337. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  22338. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  22339. s.map.value = e,
  22340. s.opacity.value = 0,
  22341. s.color.value.set(c.path.color);
  22342. var l = {
  22343. side: r.DoubleSide,
  22344. depthWrite: !1,
  22345. transparent: !0,
  22346. vertexShader: m.waypoint.vertexShader,
  22347. fragmentShader: m.waypoint.fragmentShader,
  22348. uniforms: s,
  22349. name: "waypoint",
  22350. opacity: 0
  22351. };
  22352. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  22353. l.name = "wayPtOut");
  22354. var h = new r.RawShaderMaterial(l)
  22355. , u = new r.Mesh(i,h);
  22356. return u.name = t,
  22357. u
  22358. }
  22359. ,
  22360. n.prototype.makeStartMarker = function(e, t) {
  22361. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  22362. i.y = 0,
  22363. i.normalize();
  22364. var n = Math.acos(i.x)
  22365. , o = this.makeWaypointObj(w.pathStart, "Start");
  22366. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  22367. o.position.copy(e),
  22368. o
  22369. }
  22370. ,
  22371. n.prototype.makeEndMarker = function(e) {
  22372. var t = this.makeWaypointObj(w.pathEnd, "End")
  22373. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  22374. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  22375. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  22376. t.position.copy(e),
  22377. t
  22378. }
  22379. ,
  22380. n.prototype.pathClean = function(e) {
  22381. if (e) {
  22382. for (var t in e.children)
  22383. this.pathClean(e.children[t]);
  22384. e.geometry && e.geometry.dispose(),
  22385. e.material && e.material.dispose()
  22386. }
  22387. }
  22388. ,
  22389. n.prototype.discardPathObject = function() {
  22390. if (this.obj3d) {
  22391. var e = this.obj3d.parent;
  22392. e && e.remove(this.obj3d),
  22393. this.pathClean(this.obj3d)
  22394. }
  22395. this.obj3d = null,
  22396. this.popInCpm()
  22397. }
  22398. ,
  22399. n.prototype.discardSlow = function() {
  22400. if (this.obj3d) {
  22401. if (this.player.mode !== a.PANORAMA)
  22402. return void this.discardPathObject();
  22403. for (var e, t = this, i = 0, n = function() {
  22404. this.discardPathObject()
  22405. }
  22406. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  22407. e = t.obj3d.children[r],
  22408. 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]),
  22409. i += 1,
  22410. n = null);
  22411. 0 === i && this.discardPathObject(),
  22412. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  22413. }
  22414. }
  22415. ,
  22416. n.prototype.appearSlow = function() {
  22417. var e, t = this;
  22418. this.fadeOutCpm(c.path.fadeInTime);
  22419. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  22420. e = t.obj3d.children[n],
  22421. 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]))
  22422. }
  22423. ,
  22424. n.prototype.update = function() {
  22425. this.obj3d && this.obj3d.updateMatrixWorld()
  22426. }
  22427. ,
  22428. n.prototype.calcBurnsAmount = function(e) {
  22429. var t = r.Math.degToRad(c.warp.burnsAngle);
  22430. if (this.player.mode === a.PANORAMA) {
  22431. var i = this.burnsDir * t;
  22432. if (this.upcomingTransType === l.BLACK)
  22433. return i;
  22434. var n = e;
  22435. if (null === n)
  22436. return y.warn("Transition request for non-highlight"),
  22437. i;
  22438. var o = this.getHeroDescriptorByHeroIndex(n);
  22439. if (null === o)
  22440. return i;
  22441. if (!o.isPano())
  22442. return i;
  22443. var s = this.getHeroPano(o)
  22444. , h = this.playerControls.cameras[a.PANORAMA]
  22445. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  22446. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  22447. , p = function(e) {
  22448. var i = Math.acos(Math.min(1, e.dot(u)))
  22449. , n = (new r.Vector3).crossVectors(u, e);
  22450. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  22451. };
  22452. if (s === this.player.currentPano)
  22453. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  22454. var f = this.findShortestPath(this.player.currentPano, s);
  22455. if (void 0 === f || null === f || f.length < 1)
  22456. return y.debug("Empty path ahead..."),
  22457. i;
  22458. var g = this.makePathHulls(f)
  22459. , m = new r.CatmullRomCurve3(g.camera)
  22460. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  22461. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  22462. }
  22463. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  22464. }
  22465. ,
  22466. n.prototype.waitNextStep = function(e, t) {
  22467. var i = c.warp.tourStepDelay;
  22468. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  22469. var n = new r.Euler
  22470. , o = new r.Vector3;
  22471. y.debug("Starting wait: " + (void 0 !== t));
  22472. var s = this.calcBurnsAmount(e)
  22473. , h = function() {
  22474. this.endWarpState(),
  22475. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  22476. t && t()
  22477. }
  22478. .bind(this)
  22479. , u = function(e, t) {
  22480. if (this.warpInterrupted)
  22481. return h(),
  22482. !0;
  22483. var r = t || 1e3 / 60;
  22484. if (c.warp.doBurns)
  22485. if (this.player.mode === a.PANORAMA) {
  22486. var l = this.playerControls.cameras[a.PANORAMA];
  22487. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  22488. var u = r * s / i;
  22489. n.y += u,
  22490. o.set(0, 0, -1),
  22491. o.applyEuler(n),
  22492. o.add(l.position),
  22493. l.controls.lookAt(o),
  22494. l.controls.lookVector.copy(o),
  22495. l.lookAt(o)
  22496. } else
  22497. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  22498. }
  22499. .bind(this);
  22500. this.startWarpState(),
  22501. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  22502. }
  22503. ,
  22504. n.prototype.warpToNonPano = function(e) {
  22505. if (this.discardPathObject(),
  22506. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  22507. var t = function() {
  22508. e && e()
  22509. }
  22510. .bind(this);
  22511. this.player.flyToNewMode({
  22512. mode: this.warpDestHeroLoc.cameraMode,
  22513. duration: c.warp.outsideTime,
  22514. warpDest: this.warpDestHeroLoc,
  22515. callback: t,
  22516. force: !0
  22517. })
  22518. } else
  22519. y.warn("no warp destination!!!"),
  22520. e && e()
  22521. }
  22522. ,
  22523. n.prototype._resetWarpShaderParams = function(e) {
  22524. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  22525. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  22526. }
  22527. ,
  22528. n.prototype._clearWarpShading = function() {
  22529. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  22530. this._resetWarpShaderParams(e[t]),
  22531. e[t].visible = !0;
  22532. this._resetWarpShaderParams(this.model.skybox)
  22533. }
  22534. ,
  22535. n.prototype._warpStopFlying = function() {
  22536. this.activeTransType = null,
  22537. this.placeCpm()
  22538. }
  22539. ,
  22540. n.prototype._wrapupTravelOnlyBits = function() {
  22541. this._warpStopFlying(),
  22542. this.warpPathPoints && (this.player.currentPano.exit(),
  22543. this.warpDestPano.enter(),
  22544. this.player.currentPano = this.warpDestPano),
  22545. this.player.spider.draw(),
  22546. this.placeCpm()
  22547. }
  22548. ,
  22549. n.prototype._wrapupTravel = function(e) {
  22550. this._wrapupTravelOnlyBits(),
  22551. this.warpCameraAim(e)
  22552. }
  22553. ,
  22554. n.prototype._wrapupWarpShading = function(e) {
  22555. this._clearWarpShading(),
  22556. this._wrapupTravel(e)
  22557. }
  22558. ,
  22559. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  22560. t !== I.END && this._clearWarpShading(),
  22561. this._wrapupTravelOnlyBits(),
  22562. this.upcomingTransType = null,
  22563. e && e()
  22564. }
  22565. ,
  22566. n.prototype._warpCameraAim = function(e, t) {
  22567. var i = this.warpDestHeroLoc.quaternion
  22568. , n = this.playerControls.cameras[a.PANORAMA]
  22569. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  22570. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  22571. , l = s.dot(o)
  22572. , u = r.Math.radToDeg(Math.acos(l))
  22573. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  22574. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  22575. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  22576. m.y = h.constrainedTurn(m.y),
  22577. this.burnsDir = Math.sign(m.y);
  22578. var v = new r.Euler(0,0,0,c.warp.eOrder)
  22579. , A = new r.Vector3
  22580. , C = function(e, t) {
  22581. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  22582. v.y = g.y + e * m.y,
  22583. v.z = g.z + e * m.z,
  22584. A.set(0, 0, -1),
  22585. A.applyEuler(v),
  22586. A.add(n.position),
  22587. n.controls.lookAt(A),
  22588. n.controls.lookVector.copy(A),
  22589. void n.lookAt(A))
  22590. }
  22591. .bind(this);
  22592. 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"),
  22593. void (t && t()))
  22594. }
  22595. ,
  22596. n.prototype._warpBendAim = function(e, t, i, n) {
  22597. var o = n || 0
  22598. , s = this.playerControls.cameras[a.PANORAMA]
  22599. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  22600. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  22601. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  22602. f.y = h.constrainedTurn(f.y);
  22603. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  22604. f.x = g * Math.sign(f.x),
  22605. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  22606. this.burnsDir = Math.sign(f.y),
  22607. g *= Math.sign(f.y),
  22608. f.y = g;
  22609. var m = new r.Euler(0,0,0,c.warp.eOrder)
  22610. , v = new r.Vector3
  22611. , A = function(e, t) {
  22612. if (e < .5)
  22613. m.x = u.x + e * f.x,
  22614. m.y = u.y + e * f.y,
  22615. m.z = u.z + e * f.z;
  22616. else {
  22617. var i = (1 - e) * c.warp.softBendEnd;
  22618. m.x = l.x - i * f.x,
  22619. m.y = l.y - i * f.y,
  22620. m.z = l.z - i * f.z
  22621. }
  22622. v.set(0, 0, -1),
  22623. v.applyEuler(m),
  22624. v.add(s.position),
  22625. s.controls.lookAt(v),
  22626. s.controls.lookVector.copy(v),
  22627. s.lookAt(v)
  22628. }
  22629. .bind(this);
  22630. return p.start(A, t, i, o, d[c.warp.movementEasing])
  22631. }
  22632. ,
  22633. n.prototype._warpStepCameraAim = function(e, t, i) {
  22634. var n = this.playerControls.cameras[a.PANORAMA]
  22635. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  22636. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  22637. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  22638. l.y = h.constrainedTurn(l.y),
  22639. this.burnsDir = Math.sign(l.y);
  22640. var u = new r.Euler(0,0,0,c.warp.eOrder)
  22641. , f = new r.Vector3
  22642. , g = function(e, t) {
  22643. e < .5 ? u.copy(s) : u.copy(o),
  22644. f.set(0, 0, -1),
  22645. f.applyEuler(u),
  22646. f.add(n.position),
  22647. n.controls.lookAt(f),
  22648. n.controls.lookVector.copy(f),
  22649. n.lookAt(f)
  22650. }
  22651. .bind(this);
  22652. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  22653. }
  22654. ,
  22655. n.prototype.setBurnsDir = function() {
  22656. var e = this.playerControls.cameras[a.PANORAMA]
  22657. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  22658. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  22659. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  22660. n.y = h.constrainedTurn(n.y),
  22661. this.burnsDir = Math.sign(n.y)
  22662. }
  22663. ,
  22664. n.prototype.stepWarpPath = function(e, t) {
  22665. var i = this.playerControls.cameras[a.PANORAMA];
  22666. if (!this.warpPathPoints)
  22667. return i.position.copy(this.warpDestPano.position),
  22668. !0;
  22669. var n = this.warpPathPoints[0]
  22670. , o = this.warpDestPano.position;
  22671. if (null !== this.nodes && this.cameraHull.length > 1) {
  22672. var s = new r.Vector3;
  22673. 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),
  22674. i.position.copy(s)
  22675. } else
  22676. e < .5 ? i.position.copy(n) : i.position.copy(o)
  22677. }
  22678. ,
  22679. n.prototype.interruptAndFastForward = function(e, t) {
  22680. this.warping && (this.warpInterrupted = !0,
  22681. this.warpInterruptionBlackoutStyle = e,
  22682. this.warpInterruptionTravelTime = t,
  22683. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  22684. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  22685. }
  22686. ,
  22687. n.prototype.warpCameraAim = function(e) {//导览到达下一个pano时可能要重新矫正转向
  22688. var t = c.warp.minWarpTime;
  22689. if (this.upcomingTransType === l.BLACK)
  22690. t = c.warp.teleportTime;
  22691. else {
  22692. var i = this.playerControls.cameras[a.PANORAMA]
  22693. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  22694. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  22695. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  22696. s.y = h.constrainedTurn(s.y);
  22697. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  22698. t = Math.max(t, u)
  22699. }
  22700. var d = function() {
  22701. this._warpStopFlying(),
  22702. this.discardSlow();
  22703. e && e()
  22704. }.bind(this);
  22705. this._warpCameraAim(t, d)
  22706. }
  22707. ,
  22708. n.prototype.warpCommonParameters = function(e, t, i, n) {
  22709. this.model.skybox.material.uniforms.blackout.value = n;
  22710. var r = u.uniform(this.model.skybox, "progress", 1)
  22711. , o = u.allUniforms(this.model.chunks, "progress", 1)
  22712. , a = !1
  22713. , s = function() {
  22714. if (this.warpInterrupted)
  22715. return a = !0,
  22716. !0
  22717. }
  22718. .bind(this)
  22719. , l = function(e, t) {
  22720. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  22721. !0) : void r(e, t)
  22722. }
  22723. .bind(this)
  22724. , h = function(e, t) {
  22725. return i && a ? (o(0),
  22726. !0) : void o(e, t)
  22727. }
  22728. .bind(this);
  22729. p.start(s, e, null, t, null, "safeHaltWatch"),
  22730. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  22731. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  22732. }
  22733. ,
  22734. n.prototype.warpTravel_STD = function(e) {
  22735. 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),
  22736. 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;
  22737. w += this.warpLength * c.warp.timePerMeter,
  22738. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  22739. var _ = !1
  22740. , T = this.warpDestHeroLoc.quaternion
  22741. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  22742. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  22743. , M = S.dot(x)
  22744. , R = r.Math.radToDeg(Math.acos(M))
  22745. , P = function(e) {
  22746. var t = o
  22747. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  22748. return i
  22749. }
  22750. , O = function() {
  22751. return E.lookAt(C, t, A.UP),
  22752. s.setFromRotationMatrix(E, c.warp.eOrder),
  22753. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  22754. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  22755. h.constrainedTurn(b.y)
  22756. }
  22757. .bind(this)
  22758. , L = function(e, t) {
  22759. if (this.warpInterrupted)
  22760. return _ = !0,
  22761. !0
  22762. }
  22763. .bind(this)
  22764. , D = function(e, t) {
  22765. return _ || !this.warpPathPoints ? (g.blur(0),
  22766. !0) : void g.blur(e)
  22767. }
  22768. .bind(this)
  22769. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  22770. , B = function(e, t) {
  22771. return _ || !this.warpPathPoints ? (N(0),
  22772. !0) : void N(e, t)
  22773. }
  22774. .bind(this)
  22775. , F = function(e, t) {
  22776. if (!this.warpPathPoints)
  22777. return n.position.copy(this.warpDestPano.position),
  22778. !0;
  22779. if (_)
  22780. return !0;
  22781. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  22782. n.position.copy(i),
  22783. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  22784. }
  22785. .bind(this)
  22786. , V = function(e, n) {
  22787. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  22788. !0)
  22789. }
  22790. .bind(this)
  22791. , U = function(e, o) {
  22792. if (_)
  22793. return y.debug(">>>> Walkthrough interupted at t=" + e),
  22794. !0;
  22795. if (!this.warpPathPoints)
  22796. return !0;
  22797. var a = this.warpLength * e
  22798. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  22799. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  22800. c.warp.matchCam && (l *= 1 - u),
  22801. E.lookAt(C, t, A.UP),
  22802. s.setFromRotationMatrix(E, c.warp.eOrder),
  22803. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  22804. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  22805. b.y = h.constrainedTurn(b.y),
  22806. s.x = m.x + l * b.x,
  22807. s.y = m.y + l * b.y,
  22808. s.z = m.z + l * b.z,
  22809. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  22810. b.y = h.constrainedTurn(b.y);
  22811. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  22812. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  22813. v.x = v.x + b.x * c.warp.turnFriction,
  22814. v.y = v.y + b.y * c.warp.turnFriction,
  22815. v.z = v.z + b.z * c.warp.turnFriction,
  22816. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  22817. var p = t.clone().sub(C).normalize();
  22818. if (R < c.warp.maxAimRotation && u > 0) {
  22819. var g = 1 - u;
  22820. p.x = p.x * g + u * S.x,
  22821. p.y = p.y * g + u * S.y,
  22822. p.z = p.z * g + u * S.z,
  22823. p.normalize()
  22824. }
  22825. this.bunnyObj.position.copy(n.position).add(p),
  22826. f.set(0, 0, -1).applyEuler(v).normalize(),
  22827. f.multiplyScalar(8),
  22828. f.add(n.position),
  22829. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  22830. n.controls.lookVector.copy(f),
  22831. n.lookAt(f))
  22832. }
  22833. .bind(this)
  22834. , k = function() {
  22835. _ ? (this.discardSlow(),
  22836. this.upcomingTransType = l.BLACK,
  22837. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  22838. }
  22839. .bind(this);
  22840. V(0);
  22841. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  22842. w += H;
  22843. var G = H / w;
  22844. this.warpCommonParameters(w, G, !0, I.NONE),
  22845. p.start(L, w, null, 0, null, "_haltWatcher"),
  22846. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  22847. p.start(D, w, null, G, P, "blurring")),
  22848. p.start(B, w, null, G, P, "modelAlpha"),
  22849. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  22850. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  22851. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  22852. }
  22853. ,
  22854. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  22855. var r = e || 0;
  22856. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  22857. this.warpCommonParameters(t, r, !1, i),
  22858. this.model.chunks.forEach(function(e) {
  22859. e.material.uniforms.blackout.value = i
  22860. }),
  22861. this._warpBendAim(null, t, null, r);
  22862. var o = function() {
  22863. this.wrapupWarpShadingOnly(n, i)
  22864. //xzw 结束时地标变化
  22865. this.player.model.floorLogos[0].position.copy(this.player.model.floorLogos[1].position)
  22866. if(this.player.mode === a.PANORAMA){
  22867. this.player.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22868. this.player.model.floorLogos[1].visible = false;
  22869. }else{
  22870. this.player.model.floorLogos[0].visible = false;
  22871. }
  22872. //-----end
  22873. }
  22874. .bind(this);
  22875. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  22876. }
  22877. ,
  22878. n.prototype.flightStepWalk = function(e, t, i) {
  22879. var n = .001
  22880. , o = 1
  22881. , a = 1.2
  22882. , s = new r.Vector3
  22883. , h = new r.Vector3
  22884. , u = function(e, t) {
  22885. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  22886. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  22887. h.copy(A.FORWARD),
  22888. this.player.getDirection(h),
  22889. s.copy(t).sub(e.position).normalize();
  22890. var l = s.dot(h)
  22891. , u = Math.acos(l)
  22892. , d = u / r;
  22893. return d > n && (r *= d / n,
  22894. u < o && (r *= a)),
  22895. r
  22896. };
  22897. return function(e, t, i) {
  22898. if (this.warpInterrupted)
  22899. i && i();
  22900. else if (this.activeTransType !== l.WALK)
  22901. this._clearWarpShading(),
  22902. this._warpStopFlying(),
  22903. this.player.spider.draw(),
  22904. this.placeCpm(),
  22905. i && i();
  22906. else if (this.player.currentPano !== e) {
  22907. var n = {
  22908. pano: e,
  22909. lookAtPoint: t,
  22910. duration: null,
  22911. maxDistanceOverride: c.warp.walkMaxDist,
  22912. skipWarpingCheck: !1,
  22913. constantMoveSpeed: !0
  22914. };
  22915. n.duration = u.call(this, e, t),
  22916. this.player.nonInterruptingFlyToPano(n, i)
  22917. } else
  22918. i && i()
  22919. }
  22920. }(),
  22921. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  22922. return this.flightStepWalk.bind(this, e, t, i)
  22923. }
  22924. ,
  22925. n.prototype.warpTravel_WALK = function() {
  22926. var e = [];
  22927. return function(t) {
  22928. var i = this.player.model.panos;
  22929. e.length = 0;
  22930. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  22931. var s = this.nodes[a]
  22932. , l = i.get(s);
  22933. a === this.nodes.length - 1;
  22934. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  22935. n && o || (e.push(s),
  22936. n = l)
  22937. }
  22938. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  22939. var h = e.length
  22940. , u = i.get(e[h - 1])
  22941. , d = new Array(h + 1);
  22942. d[d.length - 1] = function() {
  22943. t && t()
  22944. }
  22945. .bind(this);
  22946. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  22947. var g = e[p];
  22948. u = i.get(g);
  22949. var m = new r.Vector3;
  22950. this.getLookAtForWalkingTourNode(e, p, m),
  22951. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  22952. p--
  22953. }
  22954. d[0]()
  22955. }
  22956. }(),
  22957. n.prototype.getLookAtForWalkingTourNode = function() {
  22958. var e = new r.Vector3
  22959. , t = new r.Vector3
  22960. , i = new r.Vector3
  22961. , n = new r.Vector3
  22962. , o = new r.Vector3
  22963. , a = .65
  22964. , s = .75
  22965. , l = .2
  22966. , c = .4
  22967. , h = .2
  22968. , u = 3;
  22969. return function(r, d, p) {
  22970. var f = r.length;
  22971. if (d >= f)
  22972. return !1;
  22973. var g = 1
  22974. , m = 1;
  22975. t.set(0, 0, 0),
  22976. o.set(0, 0, 0);
  22977. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  22978. if (v = this.player.model.panos.get(r[A]),
  22979. this.getOrientationForWalkingTourNode(r, A, i),
  22980. A === d && e.copy(i),
  22981. n.copy(i),
  22982. A > d) {
  22983. var y = n.dot(e) < a;
  22984. g *= y ? l : s,
  22985. m *= y ? h : c
  22986. }
  22987. i.multiplyScalar(g),
  22988. t.add(i),
  22989. o.lerp(v.position, m)
  22990. }
  22991. return t.normalize(),
  22992. p.copy(o),
  22993. p.add(t),
  22994. !0
  22995. }
  22996. }(),
  22997. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  22998. var n = e.length;
  22999. if (t >= n)
  23000. return !1;
  23001. if (t === n - 1)
  23002. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  23003. else {
  23004. var r = this.player.model.panos.get(e[t])
  23005. , o = this.player.model.panos.get(e[t + 1]);
  23006. i.copy(o.position).sub(r.position)
  23007. }
  23008. return i.normalize(),
  23009. !0
  23010. }
  23011. ,
  23012. n.prototype.warpCameraTravel = function(e, t, i, n) {
  23013. if (this.activeTransType = this.upcomingTransType,
  23014. this.lastTransType = this.activeTransType,
  23015. this.upcomingTransType = null,
  23016. !e) {
  23017. var r = function() {
  23018. this._wrapupTravel(n)
  23019. }
  23020. .bind(this)
  23021. , o = {
  23022. pano: this.warpDestPano,
  23023. lookAtPoint: null,
  23024. duration: null,
  23025. maxDistanceOverride: null,
  23026. skipWarpingCheck: !1
  23027. };
  23028. return void this.player.flyToPano(o, r)
  23029. }
  23030. var floorlogoChange = function(){ //xzw add 地标开始变化 因为warpTravel_BLACK将不会是flytopano
  23031. this.player.model.floorLogoFade(0, 450, 0.7);
  23032. this.player.model.floorLogos[1].position.copy(this.warpDestPano.floorPosition.clone().sub(this.player.model.position));
  23033. }.bind(this);
  23034. this.activeTransType === l.BLACK ?( floorlogoChange(), this.warpTravel_BLACK(null, i, t, n) ): this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  23035. this._clearWarpShading(),
  23036. this._warpStopFlying(),
  23037. this.player.spider.draw(),
  23038. this.placeCpm(),
  23039. n && n()
  23040. }
  23041. .bind(this)) : this.warpTravel_STD(n)//warpTravel_STD??
  23042. }
  23043. ,
  23044. n.prototype.startWarpState = function() {
  23045. this.warping = !0,
  23046. this.warpInterrupted = !1,
  23047. this.warpInterruptionBlackoutStyle = null,
  23048. this.warpInterruptionTravelTime = null
  23049. }
  23050. ,
  23051. n.prototype.endWarpState = function() {
  23052. this.warping = !1
  23053. }
  23054. ,
  23055. n.prototype.warpToPano = function(e, t, i, n) {//导览漫游 走到下一个点结束时还会执行一次
  23056. if (this.warping)
  23057. return void y.warn("Cannot warp when already warping");
  23058. if (this.upcomingTransType = e,
  23059. this.activeTransType = null,
  23060. !this.setWarpDestPano())
  23061. return this.upcomingTransType = null,
  23062. void this.warpToNonPano(n);
  23063. if (this.player.mode !== a.PANORAMA)
  23064. return this.upcomingTransType = null,
  23065. this.discardSlow(),
  23066. void this.player.flyToNewMode({
  23067. mode: a.PANORAMA,
  23068. pano: this.warpDestPano,
  23069. duration: c.warp.outsideTime,
  23070. warpDest: this.warpDestHeroLoc,
  23071. callback: n,
  23072. force: !0
  23073. });
  23074. if (!this.warpDestPano)
  23075. return y.warn("no warp destination, callback dropped"),
  23076. void (this.upcomingTransType = null);
  23077. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano)
  23078. && this.warpDestPano !== this.player.currentPano
  23079. && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  23080. , o = this.chooseWarpPath(r);
  23081. if (o && this.upcomingTransType !== l.WALK) {//o为false则可能已经到下一个点
  23082. var s = function() {
  23083. this.waitingToWarp = !1,
  23084. this.warpToPano(e, t, i, n)
  23085. }
  23086. .bind(this);
  23087. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  23088. return void (this.waitingToWarp = !0)
  23089. }
  23090. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  23091. this.player.currentPano = this.warpDestPano,
  23092. this.placeCpm(),
  23093. this.fadeOutCpm(c.path.fadeOutTime),
  23094. this.player.spider.draw()
  23095. );
  23096. y.debug("Warping to pano ", this.warpDestPano.position);
  23097. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano);
  23098. this.startWarpState();
  23099. var h = function() {
  23100. this.endWarpState(),
  23101. n && n()
  23102. }
  23103. .bind(this);
  23104. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h), //this.warpCameraAim(h)是到达后触发
  23105. this.player.smoothZoomToDefault(c.zoom.restoreTime)
  23106. }
  23107. ,
  23108. t.exports = n
  23109. }
  23110. ).call(this, "/js/objects/ShowPath.js")
  23111. }
  23112. , {
  23113. "../constants": 8,
  23114. "../effects": 16,
  23115. "../enum/BlackoutStyle": 18,
  23116. "../enum/ModelManagerEvents": 33,
  23117. "../enum/PlayerEvents": 40,
  23118. "../enum/RenderOrder": 42,
  23119. "../enum/Vectors": 50,
  23120. "../enum/Viewmode": 51,
  23121. "../enum/WarpStyle": 52,
  23122. "../gui/gui": 65,
  23123. "../model/ModelManager": 140,
  23124. "../objects/Snapshot": 153,
  23125. "../settings": 166,
  23126. "../shaders": 167,
  23127. "../util/easing": 186,
  23128. "../util/lerp": 188,
  23129. "../util/logger": 189,
  23130. "../util/math": 190,
  23131. "../util/texture": 194,
  23132. "../util/transitions": 195,
  23133. three: 217
  23134. }],
  23135. 152: [function(e, t, i) {//"./objects/Skybox"
  23136. "use strict";
  23137. function n() {
  23138. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  23139. , t = new r.RawShaderMaterial({
  23140. fragmentShader: o.skysphere.fragmentShader,
  23141. vertexShader: o.skysphere.vertexShader,
  23142. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  23143. side: r.BackSide,
  23144. name: "skysphere"
  23145. });
  23146. t.uniforms.radius.value = e.parameters.radius,
  23147. r.Mesh.call(this, e, t)
  23148. }
  23149. var r = e("three")
  23150. , o = e("../shaders")
  23151. , a = e("../settings");
  23152. n.prototype = Object.create(r.Mesh.prototype),
  23153. n.prototype.constructor = n,
  23154. t.exports = n
  23155. }
  23156. , {
  23157. "../settings": 166,
  23158. "../shaders": 167,
  23159. three: 217
  23160. }],
  23161. 153: [function(e, t, i) {///js/objects/Snapshot.js
  23162. (function(i) {
  23163. "use strict";
  23164. function n(e) {
  23165. o.call(this, e),
  23166. this.panoId = e.panoId,
  23167. this.orthoZoom = e.orthoZoom,
  23168. this.floorVisibility = e.floorVisibility,
  23169. this.thumbUrl = e.thumbUrl,
  23170. this.name = e.name
  23171. }
  23172. var r = (e("three"),
  23173. e("../util/logger"))
  23174. , o = (e("../settings"),
  23175. e("../enum/Viewmode"),
  23176. e("../util/common"),
  23177. e("../util/transitions"),
  23178. e("../util/lerp"),
  23179. e("../util/ajax"),
  23180. e("../util/texture"),
  23181. e("./View"));
  23182. e("events").EventEmitter,
  23183. new r(i);
  23184. n.prototype = Object.create(o.prototype),
  23185. n.prototype.isPano = function() {
  23186. return this.panoId && "" !== this.panoId
  23187. }
  23188. ,
  23189. t.exports = n
  23190. }
  23191. ).call(this, "/js/objects/Snapshot.js")
  23192. }
  23193. , {
  23194. "../enum/Viewmode": 51,
  23195. "../settings": 166,
  23196. "../util/ajax": 181,
  23197. "../util/common": 185,
  23198. "../util/lerp": 188,
  23199. "../util/logger": 189,
  23200. "../util/texture": 194,
  23201. "../util/transitions": 195,
  23202. "./View": 154,
  23203. events: 202,
  23204. three: 217
  23205. }],
  23206. 154: [function(e, t, i) {///js/objects/View.js
  23207. (function(i) {
  23208. "use strict";
  23209. function n(e) {
  23210. e = e || {},
  23211. this.position = new r.Vector3,
  23212. this.quaternion = new r.Quaternion,
  23213. this.update(e)
  23214. }
  23215. var r = e("three")
  23216. , o = e("../util/logger")
  23217. , a = (e("../settings"),
  23218. e("../enum/Viewmode"),
  23219. e("../util/common"),
  23220. e("../util/transitions"),
  23221. e("../util/lerp"),
  23222. e("../util/ajax"),
  23223. e("../util/texture"),
  23224. e("events").EventEmitter);
  23225. new o(i);
  23226. n.prototype = Object.create(a.prototype),
  23227. n.prototype.isValid = function() {
  23228. return !!this.cameraMode
  23229. }
  23230. ,
  23231. n.prototype.update = function(e) {
  23232. return this.cameraMode = e.cameraMode || this.cameraMode,
  23233. this.pano = e.pano || this.pano,
  23234. e.position && this.position.copy(e.position),
  23235. e.quaternion && this.quaternion.copy(e.quaternion),
  23236. this
  23237. }
  23238. ,
  23239. t.exports = n
  23240. }
  23241. ).call(this, "/js/objects/View.js")
  23242. }
  23243. , {
  23244. "../enum/Viewmode": 51,
  23245. "../settings": 166,
  23246. "../util/ajax": 181,
  23247. "../util/common": 185,
  23248. "../util/lerp": 188,
  23249. "../util/logger": 189,
  23250. "../util/texture": 194,
  23251. "../util/transitions": 195,
  23252. events: 202,
  23253. three: 217
  23254. }],
  23255. 155: [function(e, t, i) {///js/player.js
  23256. (function(i) {
  23257. "use strict";
  23258. function n(e) {
  23259. this.currentPano = null,
  23260. this.nextPano = null,
  23261. this.camera = null,
  23262. this.paused = !1,
  23263. this.flying = !1,
  23264. this.sceneIntersectionPlane = null,
  23265. this.target = new r.Vector3,
  23266. this.mouse = new r.Vector3(1.1,1.1,.5),
  23267. this.mouseAtMouseDown = new r.Vector2,
  23268. this.mouseCouldBeClickToMove = !1,
  23269. this.mouseLastMoveTime = Date.now(),
  23270. this.mouseDown = !1,
  23271. this.mouseDownTimer = null,
  23272. this.couldBeLongTap = !1,
  23273. this.containsMouse = !0,
  23274. this.isTouchEvent = !1,
  23275. this.isPanoHover = !1,
  23276. this.reticule = new a(this),
  23277. this.panoMarkers = [],
  23278. this.spider = new h(this),
  23279. this.quaternion = new r.Quaternion,
  23280. this.position = new r.Vector3(15,10,15),
  23281. this.previousState = null,
  23282. this.lastInsideView = new c,
  23283. this.last360View = new c,
  23284. this.raycaster = new r.Raycaster,
  23285. this.intersect = null,
  23286. this.lastChangeTime = Date.now(),
  23287. this.history = new I,
  23288. this.cameraControls = null,
  23289. this.path = null,
  23290. this.model = null,
  23291. this.domElement = null,
  23292. this.cachedPanoCandidates = null,
  23293. this.basePanoSize = 0,
  23294. this.standardPanoSize = 0,
  23295. this.highPanoSize = 0,
  23296. this.ultraHighPanoSize = 0,
  23297. this.zoomLevel = 1,
  23298. this.zooming = 0,
  23299. this.zoomSpeed = .5,
  23300. this.scrollZoomSpeed = .06,
  23301. this.zoomSpeedAdjust = .05,
  23302. this.defaultZoomIncrement = .2,
  23303. this.baseFov = f.insideFOV,
  23304. this.zoomFov = this.baseFov,
  23305. this.zoomEnabled = !0,
  23306. this.preRenderingEnabled = !1,
  23307. this.setupCustomProperties(e),
  23308. this.zoomStats = new L
  23309. //xzw:
  23310. this.hotspotDrag = {};//热点拖拽的信息
  23311. this.allHotspots = [];//包括 正在采集的热点 和 已经生成的热点
  23312. this.posGets = {};//采集的点 需要2处
  23313. this.startGetPos = !1; //是否开始采集
  23314. this.markspot = null; //当前正在采集的热点
  23315. this.disablePanos = []; //收集采集时被禁止走到的第二个位置
  23316. if(window.ifTest) window.player = this;
  23317. }
  23318. var r = e("three")
  23319. , o = e("./util/logger")
  23320. , a = e("./objects/Reticule")
  23321. , s = e("./objects/Panorama")
  23322. , l = e("./objects/ShowPath")
  23323. , c = e("./objects/View")
  23324. , h = (e("./objects/Snapshot"),
  23325. e("./objects/NSpider"))
  23326. , u = e("./enum/Viewmode")
  23327. , d = (e("./enum/TagStates"),
  23328. e("./enum/Vectors"))
  23329. , p = e("./enum/Keys")
  23330. , f = (e("./enum/AlignmentType"),
  23331. e("./settings"))
  23332. , g = e("./util/common")
  23333. , m = (e("./util/browser"),
  23334. e("./util/math"))
  23335. , v = e("./util/lerp")
  23336. , A = e("./util/easing")
  23337. , y = e("./util/transitions")
  23338. , C = e("events").EventEmitter
  23339. , I = (e("./shaders"),
  23340. e("./util/history"))
  23341. , E = (e("./util/camera"),
  23342. e("./model/ModelManager"),
  23343. e("./enum/PathDiscardMode"))
  23344. , b = e("./enum/PathDisplayMode")
  23345. , w = e("./enum/PlayerEvents")
  23346. , _ = e("./enum/ControlEvents")
  23347. , T = e("./enum/ModelManagerEvents")
  23348. , x = e("./enum/WarpStyle")
  23349. , S = e("./enum/BlackoutStyle")
  23350. , M = e("./exception/BasicException")
  23351. , R = e("./enum/PanoSizeClass")
  23352. , P = (e("./tile/TileDownloader"),
  23353. e("./tile/TilePrioritizer"))
  23354. , O = (e("./enum/PanoramaEvents"),
  23355. e("./enum/ZoomEvents"))
  23356. , L = e("./util/ZoomStats")
  23357. , D = e("./constants")
  23358. , N = e("./util/common")
  23359. , B = e("./util/cameraLight")
  23360. , F = new o(i)
  23361. , editor = e("Editor") //改
  23362. , Hotspot = e("Hotspot")
  23363. , dom = e("dom")
  23364. , V = Object.freeze({
  23365. FlyToPano: y.getUniqueId(),
  23366. FlyToNewMode: y.getUniqueId(),
  23367. FlyToSameMode: y.getUniqueId(),
  23368. FlyToViewFloor: y.getUniqueId(),
  23369. LookTransition: y.getUniqueId(),
  23370. ZoomTransition: y.getUniqueId()
  23371. });
  23372. n.prototype = Object.create(C.prototype),
  23373. n.prototype.init = function(e) {
  23374. this.modelManager = e.modelManager,
  23375. this.tileDownloader = e.tileDownloader,
  23376. this.panoRenderer = e.panoRenderer,
  23377. this.qualityManager = e.qualityManager,
  23378. this.domElement = e.container,
  23379. this.camera = e.camera,
  23380. this.tagManager = e.tagManager,
  23381. this.cameraControls = e.controls,
  23382. this.path = new l(e.director,this,e.controls),
  23383. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  23384. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  23385. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  23386. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  23387. this.tileDownloader.processPriorityQueue = !1,
  23388. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  23389. this.bindEvents(e.container),
  23390. this.updateModel()
  23391. }
  23392. ,
  23393. //xzw: 主要是采集热点的函数----------------
  23394. n.prototype.disablePanoAtLine = function(origin, end){//角度过小的位置禁止行走 //问题:在修改位置后有可能变成角度很小
  23395. this.disablePanos = [];
  23396. var atline = function(origin,end){
  23397. var b = origin.clone().sub(end).setY(0).normalize();
  23398. return function(pano){
  23399. var a1 = pano.position.clone().sub(end).normalize(); //真实情况有可能焦点在线段终点之外,角度会更小,现在忽略
  23400. var a2 = pano.position.clone().sub(origin).normalize();
  23401. var cos1 = Math.abs( a1.dot(b) );
  23402. var cos2 = Math.abs( a2.dot(b) );
  23403. var a = Math.max(cos1, cos2);
  23404. //console.log(Math.acos(a) * 180 / Math.PI)
  23405. pano.recentAngleScore = a;//注意 currentPano的recentAngleScore没被刷新
  23406. return a > 0.996;//5° 0.9848 10°
  23407. }
  23408. }
  23409. var sortByAngle = function(origin,end){
  23410. return function(pano){
  23411. return pano.recentAngleScore;
  23412. }
  23413. }
  23414. var o = this.model.panos.sortByScore(
  23415. [s.filters.not(this.currentPano), atline(origin,end) ],
  23416. [sortByAngle(origin,end)]
  23417. );
  23418. if(o){
  23419. if(o.length==this.model.panos.list.length-1) o.pop(); //如果全部pano都被纳入,那么剔除角度最大的
  23420. for(var i=0;i<o.length;i++){
  23421. this.disablePanos.push(o[i].pano)
  23422. }
  23423. }
  23424. //console.log(o)
  23425. //this.updateMarkerDisplay();
  23426. this.model.fadePanoMarkers(null,null,{player:this});
  23427. }
  23428. n.prototype.cancelPanoDisable = function(){
  23429. this.disablePanos = [];
  23430. //this.updateMarkerDisplay();
  23431. this.model.fadePanoMarkers(null,null,{player:this});
  23432. }
  23433. n.prototype.lookAtPos = function(pos,cameraPos){//点击修改热点位置时 看向markspot
  23434. var realPos = pos.clone().applyMatrix4(this.model.matrixWorld);
  23435. this.cameraControls.activeControl.startLookAt(realPos,y,v,f, cameraPos);
  23436. }
  23437. //end-------
  23438. n.prototype.setupCustomProperties = function(e) {
  23439. var t = e || u.PANORAMA;
  23440. Object.defineProperty(this, "mode", {
  23441. get: function() {
  23442. return t
  23443. },
  23444. set: function(e) {
  23445. var i = t;
  23446. t = e,
  23447. this.onModeUpdated(i, t)
  23448. }
  23449. })
  23450. }
  23451. ,
  23452. n.prototype.isInMode = function() {
  23453. for (var e = 0; e < arguments.length; e++)
  23454. if (this.mode === arguments[e])
  23455. return !0;
  23456. return !1
  23457. }
  23458. ,
  23459. n.prototype.isOutsideMode = function(e) {
  23460. return e = e || this.mode,
  23461. e === u.DOLLHOUSE || e === u.FLOORPLAN
  23462. }
  23463. ,
  23464. n.prototype.is360View = function(e, t) {
  23465. return e === u.PANORAMA && t && !t.isAligned()
  23466. }
  23467. ,
  23468. n.prototype.setScene = function(e) {
  23469. this.sceneIntersectionPlane = e.plane,
  23470. this.path.setScene(e),
  23471. this.moveReticuleToScene(e)
  23472. }
  23473. ,
  23474. n.prototype.moveReticuleToScene = function(e) {
  23475. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  23476. e.add(this.reticule)
  23477. }
  23478. ,
  23479. n.prototype.updateModel = function() {
  23480. function e(e, t, n) {
  23481. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  23482. }
  23483. function t(e, t) {
  23484. if (this.mode === u.DOLLHOUSE) {
  23485. var n = e ? this.model.center.y : n = t.center.y;
  23486. i.call(this, n)
  23487. }
  23488. }
  23489. function i(e) {
  23490. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  23491. , i = this.cameraControls.controls[u.DOLLHOUSE]
  23492. , n = t.position.y + (e - i.target.y)
  23493. , r = f.showFloorDuration + f.showFloorDelay;
  23494. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  23495. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  23496. }
  23497. this.model = this.modelManager.getActiveModel(),
  23498. this.model.player = this, //xzw加 方便调用
  23499. this.model.on("floor.changed", e.bind(this)),
  23500. this.model.on("allfloors.toggled", t.bind(this)),
  23501. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  23502. }
  23503. ,
  23504. n.prototype.updateModelDependentData = function() {
  23505. this.cameraControls.setModelForControls(this.model),
  23506. this.getPanoMarkersFromModel(this.model)
  23507. }
  23508. ,
  23509. n.prototype.onModelChanged = function() {
  23510. this.updateModel(),
  23511. this.updateModelDependentData()
  23512. }
  23513. ,
  23514. n.prototype.getPanoMarkersFromModel = function(e) {
  23515. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  23516. return t.marker ? e.concat(t.marker) : e
  23517. }, [])
  23518. }
  23519. ,
  23520. n.prototype.handleControlMove = function(e) {
  23521. this.emit(w.Move, e)
  23522. }
  23523. ,
  23524. n.prototype.handleControlInputStart = function(e) {
  23525. this.emit(w.InputStart, e)
  23526. }
  23527. ,
  23528. n.prototype.onModeUpdated = function(e, t) {
  23529. this.cameraControls.activateControls(t),
  23530. this.emit(w.ModeChanged, e, t)
  23531. }
  23532. ,
  23533. n.prototype.isWarping = function() {
  23534. return this.path.warping
  23535. }
  23536. ,
  23537. n.prototype.isWaitingToWarp = function() {
  23538. return this.path.waitingToWarp
  23539. }
  23540. ,
  23541. n.prototype.getLabelScaleFactor = function() {
  23542. if (this.isOutsideMode()) {
  23543. var e = 10
  23544. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  23545. return t
  23546. }
  23547. return .5
  23548. }
  23549. ,
  23550. n.prototype.bindEvents = function(e) {
  23551. e !== document && e.setAttribute("tabindex", -1),
  23552. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  23553. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  23554. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  23555. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  23556. // e.addEventListener("mouseup", this.onMouseUp.bind(this)), //xzw pointerup也会触发,而有时随后又触发mouseup,造成handleInputend执行两次,热点click执行两次展不开。如果删除有问题以后再改。
  23557. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  23558. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  23559. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  23560. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  23561. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  23562. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  23563. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  23564. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  23565. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  23566. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  23567. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  23568. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  23569. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  23570. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this))
  23571. //热点相关 xzw
  23572. window.addEventListener("mousemove", this.dragSpotMove.bind(this) )
  23573. window.addEventListener("touchmove", this.dragSpotMove.bind(this) )
  23574. window.addEventListener("mouseup", this.dragSpotDone.bind(this) )
  23575. window.addEventListener("touchend", this.dragSpotDone.bind(this) )
  23576. }
  23577. ,
  23578. n.prototype.onMouseDown = function(e) {
  23579. e.currentTarget !== document && e.currentTarget.focus(),
  23580. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  23581. this.updateIntersect())
  23582. //xzw加:
  23583. this.chosenSpot && (this.chosenSpot.billboard.div.style['pointer-events'] = "none",
  23584. $(this.chosenSpot.billboard.div).find("img").css({'pointer-events':"none"})
  23585. );//防止拖动到热点
  23586. }
  23587. ,
  23588. n.prototype.onMouseMove = function(e) {
  23589. this.isTouchEvent = !1,
  23590. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  23591. }
  23592. ,
  23593. n.prototype.onMouseOver = function(e) {
  23594. this.containsMouse = !0,
  23595. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  23596. }
  23597. ,
  23598. n.prototype.onMouseOut = function(e) {
  23599. this.containsMouse = !1
  23600. }
  23601. ,
  23602. n.prototype.onMouseUp = function(e) {
  23603. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  23604. }
  23605. ,
  23606. n.prototype.onTouchStart = function(e) {
  23607. if (e.currentTarget !== document && e.currentTarget.focus(),
  23608. !this.mouseDown) {
  23609. this.couldBeLongTap = !0;
  23610. var t = g.average(e.changedTouches, "clientX")
  23611. , i = g.average(e.changedTouches, "clientY");
  23612. this.handleInputStart.call(this, t, i, !0),
  23613. this.mouseDownTimer = setTimeout(function() {
  23614. this.updateIntersect(),
  23615. this.handleInputEnd.call(this, t, i, !0)
  23616. }
  23617. .bind(this), f.input.longTapThreshold)
  23618. }
  23619. }
  23620. ,
  23621. n.prototype.onTouchMove = function(e) {
  23622. var t = g.average(e.changedTouches, "clientX")
  23623. , i = g.average(e.changedTouches, "clientY");
  23624. this.handleInputMove.call(this, t, i, !0)
  23625. }
  23626. ,
  23627. n.prototype.onTouchEnd = function(e) {
  23628. if (clearTimeout(this.mouseDownTimer),
  23629. this.mouseDown) {
  23630. this.couldBeLongTap = !1,
  23631. this.updateIntersect();
  23632. var t = g.average(e.changedTouches, "clientX")
  23633. , i = g.average(e.changedTouches, "clientY");
  23634. this.handleInputEnd.call(this, t, i, !0)
  23635. }
  23636. }
  23637. ,
  23638. n.prototype.onPointerDown = function(e) {
  23639. return e.currentTarget !== document && e.currentTarget.focus(),
  23640. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  23641. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  23642. void (this.mouseDownTimer = setTimeout(function() {
  23643. this.updateIntersect(),
  23644. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  23645. }
  23646. .bind(this), f.input.longTapThreshold)))
  23647. }
  23648. ,
  23649. n.prototype.onPointerMove = function(e) {
  23650. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  23651. }
  23652. ,
  23653. n.prototype.onPointerUp = function(e) {
  23654. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  23655. this.couldBeLongTap = !1,
  23656. this.updateIntersect(),
  23657. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  23658. }
  23659. ,
  23660. n.prototype.onPointerOut = function(e) {
  23661. this.mouseDown = !1
  23662. }
  23663. ,
  23664. n.prototype.onPointerCancel = function(e) {
  23665. this.mouseDown = !1
  23666. }
  23667. ,
  23668. n.prototype.onKeyDown = function(e) {
  23669. if(!window.keyCon) return; //xzw add
  23670. var t = function() {
  23671. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  23672. }
  23673. .bind(this)
  23674. , i = e.which;
  23675. switch (i) {
  23676. case p.F:
  23677. t(),
  23678. this.changeFloor(-1);
  23679. break;
  23680. case p.R:
  23681. t(),
  23682. this.changeFloor(1)
  23683. }
  23684. if (this.mode === u.PANORAMA)
  23685. switch (i) {
  23686. case p.UPARROW:
  23687. case p.W:
  23688. this.flyLocalDirection(d.FORWARD.clone());
  23689. break;
  23690. case p.DOWNARROW:
  23691. case p.S:
  23692. this.flyLocalDirection(d.BACK.clone());
  23693. break;
  23694. case p.A:
  23695. this.flyLocalDirection(d.LEFT.clone());
  23696. break;
  23697. case p.D:
  23698. this.flyLocalDirection(d.RIGHT.clone())
  23699. }
  23700. }
  23701. ,
  23702. n.prototype.handleScrollPinchZoom = function() {
  23703. return function(e) {
  23704. var t = e
  23705. , i = this.zoomLevel;
  23706. this.zoomBy(t),
  23707. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  23708. }
  23709. }(),
  23710. n.prototype.handleControlPinch = function(e) {
  23711. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  23712. }
  23713. ,
  23714. n.prototype.handleControlScroll = function(e) {
  23715. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  23716. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  23717. }
  23718. ,
  23719. n.prototype.handleInputStart = function(e, t, i) {
  23720. this.isTouchEvent = i,
  23721. m.convertScreenPositionToNDC(e, t, this.mouse),
  23722. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  23723. this.mouseCouldBeClickToMove = !0,
  23724. this.mouseDown = !0
  23725. }
  23726. ,
  23727. n.prototype.handleInputMove = function(e, t, i) {
  23728. if(this.markspot && this.markspot.state == "drag") return;//xzw
  23729. this.isTouchEvent = i,
  23730. m.convertScreenPositionToNDC(e, t, this.mouse),
  23731. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  23732. this.couldBeLongTap = !1,
  23733. clearTimeout(this.mouseDownTimer)),
  23734. this.mouseLastMoveTime = Date.now(),
  23735. this.reticule.move(e, t, i)
  23736. }
  23737. ,
  23738. /* n.prototype.handleInputEnd = function(e, t, i) {// mouseup touchend ----MP
  23739. if (this.isTouchEvent = i,
  23740. this.mouseDown = !1,
  23741. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  23742. !i && this.couldBeLongTap)
  23743. return !0;
  23744. if (this.handleLongTap())
  23745. return !0;
  23746. if (this.mouseCouldBeClickToMove) {
  23747. if (this.flying)
  23748. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  23749. !0;
  23750. if (this.checktagClick())
  23751. return !0;
  23752. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  23753. this.history.invalidate(),
  23754. this.intersect)
  23755. return this.flyToPanoClosestToMouse();
  23756. if (this.mode === u.PANORAMA) {
  23757. var n = this.closestPanoInDirection(this.getMouseDirection());
  23758. return n ? this.flyToPano({
  23759. pano: n
  23760. }) : this.bump(this.getMouseDirection())
  23761. }
  23762. }
  23763. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  23764. }*/
  23765. //xzw: 加点和采集热点相关的东西:
  23766. n.prototype.handleInputEnd = function(e, t, i) {// mouseup touchend
  23767. console.log('handleInputEnd '+i);
  23768. this.isTouchEvent = i,
  23769. this.mouseDown = !1,
  23770. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct");
  23771. this.chosenSpot && (this.chosenSpot.billboard.div.style['pointer-events'] = "",
  23772. $(this.chosenSpot.billboard.div).find("img").css({'pointer-events':""}));
  23773. if (!i && this.couldBeLongTap)
  23774. return !0;
  23775. if (this.handleLongTap())
  23776. return !0;
  23777. if (this.mouseCouldBeClickToMove) {
  23778. if (this.flying)
  23779. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  23780. !0;
  23781. if(this.startGetPos){// 改 开始采集第一个点
  23782. this.updateIntersect({notTag:true});
  23783. if(!this.intersect) return;
  23784. var modelViewMatrix = new r.Matrix4().getInverse(this.model.matrixWorld.clone());//×模型矩阵的逆矩阵,是因为当飞出屋子再飞进去时模型位移了,现在要保证采集的点是模型没有任何变换下的点。在计算2d坐标时会乘以模型矩阵。
  23785. var point = this.intersect.point.clone().applyMatrix4(modelViewMatrix);
  23786. this.markspot = new Hotspot({pos3d : point, player:this, type: dom.getIndex(editor.metaSelect.find('p')[0])});
  23787. this.posGets[this.currentPano.id] = point;
  23788. this.posGets.list = [this.currentPano.id];
  23789. this.posGets.length = 1;
  23790. this.disablePanoAtLine(this.currentPano.position, point);
  23791. dom.bind(this.markspot.elem, "mousedown",this.hotspotDragBegin); //热点拖拽开启
  23792. this.domElement.style.cursor = "";
  23793. editor.pointsElem[0].style.display = "flex";
  23794. dom.addClass(editor.pointsElem[0],'chosen');
  23795. this.startGetPos = false;//第一个点标记结束
  23796. return;
  23797. }
  23798. if (this.checktagClick())
  23799. return !0;
  23800. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  23801. this.history.invalidate(),
  23802. this.intersect)
  23803. return this.flyToPanoClosestToMouse();
  23804. if (this.mode === u.PANORAMA) {
  23805. var n = this.closestPanoInDirection(this.getMouseDirection());
  23806. return n ? this.flyToPano({
  23807. pano: n
  23808. }) : this.bump(this.getMouseDirection())
  23809. }
  23810. }
  23811. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  23812. }
  23813. ,
  23814. n.prototype.dragSpotMove = function(t){//新添加 为了热点拖动
  23815. if(this.markspot && this.markspot.state == "drag"){
  23816. var deltaX = t.clientX - this.hotspotDrag.mouseinitX;
  23817. var deltaY = t.clientY - this.hotspotDrag.mouseinitY;
  23818. this.markspot.transformX = this.hotspotDrag.transformX + deltaX;
  23819. this.markspot.transformY = this.hotspotDrag.transformY + deltaY;
  23820. this.markspot.elem.style.transform = "translateX("+this.markspot.transformX + "px) translateY("+ this.markspot.transformY + "px) translateZ(0px)";
  23821. }
  23822. }
  23823. n.prototype.dragSpotDone = function(t) {//新添加 热点拖动结束
  23824. if(this.markspot && this.markspot.state == "drag"){
  23825. this.markspot.state = "static";
  23826. dom.removeClass(this.markspot.elem,"drag");
  23827. //var offsetTop = window.innerHeight - this.domElement.clientHeight;
  23828. this.mouse.x = ( this.markspot.transformX / this.domElement.clientWidth ) * 2 - 1;
  23829. //this.mouse.y = - ( (this.markspot.transformY-offsetTop) / this.domElement.clientHeight ) * 2 + 1;
  23830. this.mouse.y = - ( this.markspot.transformY/ this.domElement.clientHeight ) * 2 + 1;
  23831. this.updateIntersect({notTag:true});
  23832. if(!this.intersect) return;
  23833. var modelViewMatrix = new r.Matrix4().getInverse(this.model.matrixWorld.clone());
  23834. var point = this.intersect.point.clone().applyMatrix4(modelViewMatrix);
  23835. this.markspot.pos3d = point.clone();
  23836. if(this.posGets.length<2 && this.posGets.list[0]!=this.currentPano.id){
  23837. //editor.pointsElem[1].children[0].innerHTML = this.currentPano.id;
  23838. var index = this.posGets.length; //0是把点删完了重新拖动的结果
  23839. if(!this.markspot.changePos)editor.pointsElem[index].style.display = "flex";
  23840. else editor.pointsElem2[index].style.display = "flex";
  23841. this.posGets.list.push(this.currentPano.id);
  23842. this.posGets.length ++;
  23843. if(!this.markspot.changePos)dom.addClass(editor.pointsElem[index],'chosen');
  23844. else dom.addClass(editor.pointsElem2[index],'chosen');
  23845. //editor.tipWrite("您可以点击“位置1”和“位置2”来在两个位置间切换,并确保热点在这两个位置中的定位相同,然后点击“完成”即可生成最终的热点。");
  23846. //由1变2:
  23847. index && (!this.markspot.changePos) && (editor.ok.style.display = "block") && this.model.fadePanoMarkers(null,null,{player:this});//xzw改 fadePanoMarkers加了参数
  23848. this.editor.setMarkspotDisplayNum(index+1);
  23849. }else if(this.posGets.length==1 && this.posGets.list[0]==this.currentPano.id){
  23850. this.disablePanoAtLine(this.currentPano.position, point);
  23851. }
  23852. this.posGets[this.currentPano.id] = point.clone();
  23853. }
  23854. }
  23855. n.prototype.handleLongTap = function() {
  23856. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  23857. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  23858. !0
  23859. }
  23860. ,
  23861. n.prototype.checktagClick = function() {
  23862. if (this.tagManager.intersectTag) {
  23863. var e = this.isTouchEvent
  23864. , t = this.tagManager.clickedOnTag(e, this);
  23865. return e || t || y.cancelById(V.LookTransition),
  23866. !0
  23867. }
  23868. if (this.tagManager.activeTag)
  23869. return this.tagManager.dismissActiveTag(),
  23870. !1
  23871. }
  23872. ,
  23873. n.prototype.rankedtagInDirection = function(e, t) {
  23874. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  23875. }
  23876. ,
  23877. n.prototype.start = function(e) {
  23878. var t = e.mode
  23879. , i = e.pano
  23880. , n = e.position
  23881. , r = e.quaternion
  23882. , o = e.tag
  23883. , a = e.quickstart
  23884. , s = $.Deferred();
  23885. this.updateModelDependentData(),
  23886. this.updateFromControls(),
  23887. this.findDefaultViews();
  23888. var l = this.is360View(t, i);
  23889. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  23890. s.done(function(e) {
  23891. this.emit(w.Ready, l, e, o)
  23892. }
  23893. .bind(this)),
  23894. s.promise()
  23895. }
  23896. ,
  23897. n.prototype.startOutside = function(e, t) {
  23898. var i = e.mode
  23899. , n = e.pano
  23900. , r = e.position
  23901. , o = e.quaternion
  23902. , a = e.zoom
  23903. , s = e.floorVisibility
  23904. , l = e.tag;
  23905. this.emit(w.StartOutside, f[i].transitionTime),
  23906. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  23907. y.cancelById(V.FlyToViewFloor),
  23908. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  23909. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  23910. }
  23911. ,
  23912. n.prototype.startInside = function(e, t, i, n, r) {
  23913. r = r || $.Deferred(),
  23914. this.currentPano = e;
  23915. var o = e && !e.isAligned();
  23916. if (t = o ? e.position : t || e.position,
  23917. i = i || e.quaternion,
  23918. e) {
  23919. var a = this.startInside.bind(this, e, t, i, n, r);
  23920. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  23921. return
  23922. }
  23923. return this.mode = u.PANORAMA,
  23924. e.floor.enter(this.mode),
  23925. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  23926. this.switchCameraMode(this.mode, i),
  23927. this.emit(w.StartInside, o),
  23928. r.resolve(!0),
  23929. r
  23930. }
  23931. ,
  23932. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  23933. if (r = r || $.Deferred(),
  23934. this.dollhouseMode(),
  23935. !e)
  23936. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  23937. r.resolve(!1),
  23938. r;
  23939. t = t || e.position;
  23940. var o = i || this.cameraControls.activeControl.camera.quaternion
  23941. , a = e.position;
  23942. return this.fitDollhouse(a, t, o),
  23943. setTimeout(function(t) {
  23944. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  23945. var n = {
  23946. mode: u.PANORAMA,
  23947. pano: e,
  23948. quaternion: i,
  23949. callback: function() {
  23950. this.emit(w.FlyinFinished),
  23951. r.resolve(!0)
  23952. }
  23953. .bind(this)
  23954. };
  23955. this.flyToNewMode(n),
  23956. editor.global.enablePanel(); //改 xzw
  23957. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  23958. r
  23959. }
  23960. ,
  23961. n.prototype.checkAndWaitForPanoLoad = function() {
  23962. var e = {}
  23963. , t = {}
  23964. , i = 5e3
  23965. , n = function() {
  23966. for (var n in e)
  23967. if (e.hasOwnProperty(n) && e[n]) {
  23968. var r = performance.now() - t[n];
  23969. if (r < i)
  23970. return !0
  23971. }
  23972. return !1
  23973. };
  23974. return function(r, o, a, s, l, c, h, u, d, p) {
  23975. if (n())
  23976. return !0;
  23977. var f = function(t, i, n) {
  23978. N.delayOneFrame(function() {
  23979. e[t] = !1,
  23980. l && l(i, n)
  23981. }
  23982. .bind(this))
  23983. }
  23984. .bind(this, r.id)
  23985. , g = function(t, i) {
  23986. N.delayOneFrame(function() {
  23987. e[t] = !1,
  23988. c && c(i)
  23989. }
  23990. .bind(this))
  23991. }
  23992. .bind(this, r.id);
  23993. try {
  23994. return null !== u && void 0 !== u || (u = !0),
  23995. 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),
  23996. e[r.id] && (t[r.id] = performance.now()),
  23997. e[r.id]
  23998. } catch (n) {
  23999. throw e[r.id] = !1,
  24000. t[r.id] = performance.now() - i,
  24001. n
  24002. }
  24003. }
  24004. }(),
  24005. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  24006. if (!e)
  24007. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  24008. return r && this.model.waitForLoad(e, function() {
  24009. return e.isLoaded(i)
  24010. }),
  24011. !e.isLoaded(t) && (e.loadCube(t).done(n),
  24012. !0)
  24013. }
  24014. ,
  24015. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  24016. var e = new r.Vector3;
  24017. return function(t, i, n, r, o, a, s, l) {
  24018. if (!t)
  24019. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  24020. return e.copy(d.FORWARD),
  24021. this.getDirection(e),
  24022. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  24023. return t.isLoaded(i)
  24024. }),
  24025. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  24026. n && n(e, t)
  24027. }
  24028. .bind(this)).fail(function(e) {
  24029. r && r(e)
  24030. }
  24031. .bind(this)).progress(function(e, t, i) {
  24032. o && o(e, t, i)
  24033. }
  24034. .bind(this)),
  24035. !0)
  24036. }
  24037. }(),
  24038. n.prototype.switchCameraMode = function(e, t) {
  24039. var i = this.cameraControls.controls[e]
  24040. , n = i.camera;
  24041. switch (e) {
  24042. case u.PANORAMA:
  24043. n.position.copy(this.currentPano.position);
  24044. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  24045. i.lookAt(o.add(n.position));
  24046. break;
  24047. case u.DOLLHOUSE:
  24048. var a = this.position.clone();
  24049. 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),
  24050. n.position.copy(a),
  24051. i.target.copy(this.target.clone().setY(this.model.center.y));
  24052. break;
  24053. case u.FLOORPLAN:
  24054. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  24055. i.target.copy(this.model.center).setY(0),
  24056. i.zoomToContain(this.model.size),
  24057. i.rotateToView(this.model.size, this.getDirection())
  24058. }
  24059. i.update(0)
  24060. }
  24061. ,
  24062. n.prototype.update = function() {//在animat里一直刷新
  24063. var e = (new r.Vector3,
  24064. {})
  24065. , t = [];
  24066. return function(i) {
  24067. this.markspot && this.markspot.updateHotspot2dPos(), //xzw
  24068. this.updatePersistentZooming(i),
  24069. this.updateFromControls(i),
  24070. this.getCurrentNodePanos(t),
  24071. this.hasChanged(e) && (this.lastChangeTime = Date.now(),
  24072. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  24073. this.emit(w.ViewChanged)),
  24074. this.model.supportsTiles && (this.updateTileDownloader(t),
  24075. this.updatePanoRenderer(t)),
  24076. this.updatePreRendering(t),
  24077. this.reticule.update(),
  24078. this.path.update(),
  24079. this.spider.update(),
  24080. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  24081. this.updateControlLocks(),
  24082. this.model.supportsTiles && this.updateZoomPano()
  24083. this.model.updateFloorlogo(this.camera && this.camera.quaternion); // xzw add
  24084. }
  24085. }(),
  24086. n.prototype.updatePersistentZooming = function(e) {
  24087. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  24088. }
  24089. ,
  24090. n.prototype.updateControlLocks = function() {
  24091. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  24092. }
  24093. ,
  24094. n.prototype.updatePanoRenderer = function() {
  24095. var e = new r.Vector3;
  24096. return function(t) {
  24097. var i = this.nextPano || this.currentPano;
  24098. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  24099. this.getDirection(e),
  24100. this.panoRenderer.updateDirection(e))
  24101. }
  24102. }(),
  24103. n.prototype.cleanupInactivePanos = function() {
  24104. var e = []
  24105. , t = [];
  24106. return function() {
  24107. e.length = 0,
  24108. e.push(this.currentPano),
  24109. this.nextPano && e.push(this.nextPano),
  24110. t.length = 0;
  24111. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  24112. t.push(this.panoRenderer.activePanos[i]);
  24113. for (var n = 0; n < t.length; n++) {
  24114. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  24115. r.id === e[a].id && (o = !1);
  24116. o && r.exit()
  24117. }
  24118. }
  24119. }(),
  24120. n.prototype.updatePreRendering = function() {
  24121. var e = {};
  24122. return function(t) {
  24123. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  24124. var i = this.nextPano || this.currentPano;
  24125. if (i && t && t.length > 1) {
  24126. var n = t.findIndex(function(e) {
  24127. if (e.id === i.id)
  24128. return !0
  24129. });
  24130. if (n >= 0 && n + 1 < t.length) {
  24131. var r = t[n + 1];
  24132. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  24133. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  24134. window.setTimeout(function(t) {
  24135. e[t.id] = !1
  24136. }
  24137. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  24138. }
  24139. .bind(this, r), f.tiling.panoPreRenderDelay),
  24140. e[r.id] = !0)
  24141. }
  24142. }
  24143. }
  24144. }
  24145. }(),
  24146. n.prototype.enablePreRendering = function() {
  24147. this.preRenderingEnabled = !0
  24148. }
  24149. ,
  24150. n.prototype.disablePreRendering = function() {
  24151. this.preRenderingEnabled = !1,
  24152. this.cleanupInactivePanos()
  24153. }
  24154. ,
  24155. n.prototype.updateTileDownloader = function() {
  24156. var e = new r.Vector3;
  24157. return function(t) {
  24158. var i = this.nextPano || this.currentPano;
  24159. i && (e.copy(d.FORWARD),
  24160. this.getDirection(e),
  24161. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  24162. this.tileDownloader.processPriorityQueue = !0)
  24163. }
  24164. }(),
  24165. n.prototype.updateFromControls = function(e) {
  24166. null !== e && void 0 !== e || (e = 0),
  24167. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  24168. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  24169. this.position.copy(this.cameraControls.activeControl.camera.position),
  24170. this.target.copy(this.cameraControls.activeControl.target),
  24171. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  24172. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  24173. this.camera.position.copy(this.position),
  24174. this.camera.quaternion.copy(this.quaternion),
  24175. this.camera.updateMatrix(),
  24176. this.camera.updateMatrixWorld()
  24177. }
  24178. ,
  24179. n.prototype.hasChanged = function(e) {
  24180. if (!this.previousState)
  24181. return this.previousState = {
  24182. allFloorsVisible: this.model.allFloorsVisible,
  24183. position: this.position.clone(),
  24184. quaternion: this.quaternion.clone(),
  24185. mouse: this.mouse.clone(),
  24186. labelScaleFactor: this.getLabelScaleFactor(),
  24187. currentFloor: this.model.currentFloor,
  24188. projectionMatrix: this.camera.projectionMatrix.clone(),
  24189. worldMatrix: this.camera.matrixWorld.clone(),
  24190. mode: this.mode,
  24191. modelPosition: this.model.position.clone(),
  24192. modelCenter: this.model.center.clone(),
  24193. zoomLevel: this.zoomLevel
  24194. },
  24195. !0;
  24196. 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;
  24197. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  24198. e.moved = !this.position.equals(this.previousState.position),
  24199. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  24200. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  24201. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  24202. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  24203. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  24204. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  24205. e.modeChanged = this.mode !== this.previousState.mode,
  24206. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  24207. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  24208. e.nextPanoActive = null !== this.nextPano,
  24209. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  24210. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  24211. this.previousState.position.copy(this.position),
  24212. this.previousState.quaternion.copy(this.quaternion),
  24213. this.previousState.mouse.copy(this.mouse),
  24214. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  24215. this.previousState.currentFloor = this.model.currentFloor,
  24216. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  24217. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  24218. this.previousState.mode = this.mode,
  24219. this.previousState.modelPosition.copy(this.model.position),
  24220. this.previousState.modelCenter.copy(this.model.center),
  24221. this.previousState.zoomLevel = this.zoomLevel,
  24222. !t
  24223. }
  24224. ,
  24225. n.prototype.updateIntersect = function(o) {//xzw
  24226. /* if(!o || !o.notTag){ //稍后再改
  24227. var n = !this.flying && this.started && !this.flyingToTag;
  24228. var m = this.tagManager.findIntersectTag(this.mouse, n, this.camera);
  24229. if(m){ this.reticule.visible = false; return;}
  24230. }
  24231. */
  24232. var e = this.flying || this.isWarping()
  24233. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  24234. , i = y.getById(V.LookTransition)
  24235. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  24236. this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),
  24237. this.intersect && this.updateClosestPano(this.intersect),
  24238. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  24239. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide())
  24240. }
  24241. ,
  24242. n.prototype.getMouseDirection = function(e) {
  24243. e = e || this.mouse;
  24244. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  24245. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  24246. return i.sub(t).normalize()
  24247. }
  24248. ,
  24249. n.prototype.getMouseIntersect = function(e, t) {
  24250. e = e || this.mouse.clone(),
  24251. t = t || this.model.floors.reduce(function(e, t) {
  24252. return t.hidden ? e : e.concat(t.collider.children)
  24253. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  24254. if(this.mode === u.PANORAMA)t = t.concat([this.model.skybox]);//xzw add 为了加热点时 没有模型的地方都能加 以及任何地方点击都能走动
  24255. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  24256. this.raycaster.set(i, this.getMouseDirection(e));
  24257. var n = this.raycaster.intersectObjects(t);
  24258. if (0 === n.length){
  24259. return null;
  24260. }
  24261. var o = n[0];
  24262. if (o.face) {
  24263. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  24264. var a = this.position.clone().sub(o.point);
  24265. a.dot(o.normal) < 0 && o.normal.negate(),
  24266. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  24267. o.horizontal = o.normal.y > .8
  24268. }
  24269. return o
  24270. }
  24271. ,
  24272. /* n.prototype.updateClosestPano = function(e) { //--MP
  24273. var t = [s.filters.isPanoAligned()];
  24274. if (this.mode === u.PANORAMA) {
  24275. if (!this.currentPano)
  24276. return;
  24277. t.push(s.filters.not(this.currentPano)),
  24278. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  24279. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  24280. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  24281. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  24282. } else
  24283. t.push(s.filters.isOnVisibleFloor()),
  24284. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  24285. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  24286. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  24287. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  24288. this.closestPano = i) : this.isPanoHover = !1
  24289. } */
  24290. n.prototype.updateClosestPano = function(e) {//xzw 改
  24291. if(!e.normal)return;//有时候天花板没有normal
  24292. var t = [s.filters.isPanoAligned()],fu, posget1, posget2;
  24293. if(this.markspot && this.posGets.length == 1 ){//如果在snap热点的话
  24294. posget1 = true;
  24295. fu = function(o){
  24296. return this.disablePanos.indexOf(o)==-1;
  24297. }.bind(this)
  24298. }else if(this.markspot && this.posGets.length == 2 ){
  24299. posget2 = true;
  24300. fu = function(o){
  24301. return this.posGets.list.indexOf(o.id)>-1;
  24302. }.bind(this)
  24303. }
  24304. else{
  24305. fu = s.filters.isNeighbourPanoTo(this.currentPano)
  24306. }
  24307. if (this.mode === u.PANORAMA) {
  24308. if (!this.currentPano) return;
  24309. t.push(s.filters.not(this.currentPano)),
  24310. t.push(fu),//add
  24311. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  24312. //t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  24313. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  24314. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  24315. } else
  24316. t.push(s.filters.isOnVisibleFloor()),
  24317. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  24318. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  24319. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  24320. this.emit(w.ClosestPanoChanging, this.closestPano, i, this, posget1,posget2),
  24321. this.closestPano = i) : this.isPanoHover = !1
  24322. },
  24323. n.prototype.dollhouseMode = function(e, t) {
  24324. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  24325. this.mode = u.DOLLHOUSE,
  24326. this.cameraControls.controls[u.DOLLHOUSE].reset();
  24327. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  24328. , n = new r.Vector3(15,10,15);
  24329. if (e && t) {
  24330. var o = d.FORWARD.clone().applyQuaternion(t)
  24331. , a = this.model.center.clone().sub(e)
  24332. , s = a.dot(o);
  24333. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  24334. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  24335. }
  24336. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  24337. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  24338. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  24339. this.updateFromControls(),
  24340. this.model.alpha = 1,
  24341. this.model.skybox.material.uniforms.opacity.value = 0
  24342. }
  24343. ,
  24344. n.prototype.insideMode = function(e, t) {
  24345. var i = $.Deferred()
  24346. , n = t || null;
  24347. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  24348. var r = [s.filters.isPanoAligned()];
  24349. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  24350. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  24351. this.flyToNewMode({
  24352. mode: u.PANORAMA,
  24353. pano: e,
  24354. callback: n
  24355. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  24356. } else {
  24357. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  24358. i.reject(o)
  24359. }
  24360. return i.promise()
  24361. }
  24362. ,
  24363. n.prototype.fitDollhouse = function(e, t, i) {
  24364. var n = d.FORWARD.clone().applyQuaternion(i);
  24365. this.cameraControls.activeControl.target.copy(n).add(e);
  24366. var o = d.RIGHT.clone().applyQuaternion(i)
  24367. , a = d.UP.clone()
  24368. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  24369. , l = this.model.boundingBox.max.clone()
  24370. , c = this.model.boundingBox.min.clone()
  24371. , 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)]
  24372. , u = 0
  24373. , p = 0
  24374. , g = 0;
  24375. h.forEach(function(e, t, i) {
  24376. var n = Math.abs(e.dot(o))
  24377. , r = e.dot(s);
  24378. n > u && (u = n,
  24379. p = r),
  24380. r > g && (g = r)
  24381. });
  24382. 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)))
  24383. , v = s.clone().multiplyScalar(p).add(t)
  24384. , A = s.clone().multiplyScalar(g).add(t);
  24385. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180)),
  24386. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180)),
  24387. p = Math.max(p, 10),
  24388. g = Math.max(g, 10);
  24389. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  24390. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  24391. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1,
  24392. 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))
  24393. }
  24394. ,
  24395. n.prototype.floorplanMode = function(e, t, i) {
  24396. this.mode = u.FLOORPLAN;
  24397. var n = this.cameraControls.controls[u.FLOORPLAN];
  24398. n.reset();
  24399. var r = e ? e : this.model.center;
  24400. if (n.target.copy(r).setY(0),
  24401. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  24402. i ? (n.currentScale = i / ($('#player').width()/$('#player').height()),
  24403. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  24404. t) {
  24405. var o = d.LEFT.clone().applyQuaternion(t);
  24406. n.rotateLeft(-Math.atan2(o.x, o.z))
  24407. } else
  24408. n.rotateToView(this.model.size, this.getDirection());
  24409. n.update(0)
  24410. }
  24411. ,
  24412. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  24413. return e.skipWarpingCheck = !0,
  24414. this.flyToPano(e, t)
  24415. }
  24416. ,
  24417. n.prototype.flyToPano = function(e, t) {//xzw大改
  24418. var i = e.pano
  24419. , n = e.lookAtPoint
  24420. , o = e.duration
  24421. , a = e.aimDuration
  24422. , s = e.maxDistanceOverride
  24423. , l = e.skipWarpingCheck
  24424. , c = e.constantMoveSpeed
  24425. , h = null
  24426. , p = null
  24427. , force = e.force; //xzw
  24428. if(this.markspot){ //xzw 加热点中
  24429. if( this.posGets.length==2 && !this.posGets[i.id] ){
  24430. //editor.tipWrite("定位热点期间,只能在已选的两个位置间移动,请直接点击“位置1”和“位置2”来切换位置。","warn");
  24431. return;
  24432. }else{
  24433. for(var j=0; j<this.posGets.length;j++){
  24434. if(this.posGets.list[j] == i.id){
  24435. if(editor.pointsElem[j].clientHeight)dom.addClass(editor.pointsElem[j],"chosen");
  24436. else dom.addClass(editor.pointsElem2[j],"chosen");
  24437. this.markspot.pos3d = this.posGets[i.id];
  24438. }
  24439. else{
  24440. if(editor.pointsElem[j].clientHeight)dom.removeClass(editor.pointsElem[j],"chosen");
  24441. else dom.removeClass(editor.pointsElem2[j],"chosen");
  24442. }
  24443. }
  24444. }
  24445. }
  24446. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  24447. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  24448. t && t(),
  24449. !1;
  24450. if (this.updateLastView(),
  24451. this.mode !== u.PANORAMA) {
  24452. var m;
  24453. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  24454. void this.flyToNewMode({
  24455. mode: u.PANORAMA,
  24456. pano: i,
  24457. duration: o,
  24458. quaternion: m,
  24459. callback: t
  24460. }), editor.openPanel(3);//xzw add
  24461. }
  24462. if (!i || (h = g.deepExtend(e),
  24463. p = function() {
  24464. N.delayOneFrame(function() {
  24465. this.flyToPano(h, t)
  24466. }
  24467. .bind(this))
  24468. }
  24469. .bind(this),
  24470. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  24471. var C = function(e) {
  24472. t && t(e)
  24473. }
  24474. .bind(this);
  24475. this.currentPano || (this.currentPano = i,
  24476. this.path.placeCpm(),
  24477. this.path.fadeOutCpm(f.path.fadeOutTime),
  24478. this.spider.draw());
  24479. var I = o;
  24480. if ("number" != typeof o) {
  24481. var E = s || f.transition.flytimeMaxDistanceThreshold;
  24482. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  24483. }
  24484. if(force)I *= 0.75;//xzw
  24485. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  24486. 1 !== this.zoomLevel)
  24487. switch (f.zoom.transitionStyle) {
  24488. case 1:
  24489. this.smoothZoomToDefault(I / 2);
  24490. break;
  24491. case 2:
  24492. return h = g.deepExtend(e),
  24493. p = this.flyToPano.bind(this, h, t),
  24494. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  24495. }
  24496. if (n) {
  24497. y.cancelById(V.LookTransition);
  24498. I *= f.transition.aimSlowFactor;
  24499. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  24500. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  24501. , T = (new r.Quaternion).setFromRotationMatrix(_)
  24502. , S = b.clone()
  24503. , M = new r.Vector3;
  24504. if (i === this.currentPano) {
  24505. var R = d.FORWARD.clone().applyQuaternion(b)
  24506. , P = d.FORWARD.clone().applyQuaternion(T)
  24507. , O = R.angleTo(P);
  24508. //return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3), //--MP
  24509. var speed = force ? f.tags.navigate.rotateSpeedFactor * 1.5 : f.tags.navigate.rotateSpeedFactor;
  24510. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / speed * 1e3),
  24511. void y.start(function(ee) {//旋转镜头对准billboard
  24512. if(this.mode != u.PANORAMA){//提早结束 xzw
  24513. y.cancelById(V.LookTransition);
  24514. C(e);
  24515. return;
  24516. }
  24517. S.copy(b),
  24518. v.quaternion(S, T)(ee),
  24519. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  24520. this.cameraControls.activeControl.lookAt(M)
  24521. }
  24522. .bind(this), c?a*0.9:a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  24523. }
  24524. }
  24525. if (i === this.currentPano || this.flying)
  24526. return void C();
  24527. this.flying = !0;
  24528. var L = this.position.clone()
  24529. , D = this.currentPano;
  24530. F.debug("Flying to pano ", i.position),
  24531. this.emit(w.PanoChosen, this.currentPano, i),//触发 setProjectedPanos
  24532. this.emit(w.FlyingStarted, i.position, L, i, D);
  24533. n && y.start(function(ee) {//过渡的同时旋转镜头
  24534. if( this.mode != u.PANORAMA){//提早结束 xzw
  24535. y.cancelById(V.LookTransition);
  24536. C(e);
  24537. return;
  24538. }
  24539. S.copy(b),
  24540. v.quaternion(S, T)(ee),
  24541. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  24542. this.cameraControls.activeControl.lookAt(M)
  24543. }.bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  24544. //xzw:
  24545. for(var j in this.model.panos.dict){// 过渡时为false的会滑动
  24546. this.model.panos.dict[j].marker.material.depthTest = true
  24547. }
  24548. //地标变化
  24549. this.model.floorLogoFade(0, I, 0.7);
  24550. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(i.model.position));
  24551. this.model.floorLogos[1].material.uniforms.opacity.value = 0;
  24552. this.model.floorLogos[1].visible = true;
  24553. /* this.modeTran.split("-")[1] == h.PANORAMA && */(this.model.floorLogoShow(1,250));
  24554. //如果有墙 就不显示模型
  24555. if(this.currentPano.noBlocks==void 0 || this.currentPano.noBlocks.indexOf(i.id)>-1|| isSpecialScene){
  24556. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano)
  24557. }else{
  24558. for(var j=0; j<this.model.chunks.length; j++){
  24559. this.model.chunks[j].visible = false; //这个会使floorlogo出现延迟
  24560. }
  24561. }
  24562. this.tagManager.updateVisible("panorama",i); //更新热点显示
  24563. //--end
  24564. var B = c ? null : A[f.transition.movementEasing];
  24565. this.nextPano = i,
  24566. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  24567. //y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  24568. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  24569. //xzw:
  24570. if(this.mode == u.PANORAMA){
  24571. //this.model.floorLogo.visible = true;
  24572. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  24573. this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  24574. this.model.floorLogos[1].visible = false;
  24575. }
  24576. for(var j=0; j<this.model.chunks.length; j++){
  24577. this.model.chunks[j].visible = true;
  24578. this.model.chunks[j].material.uniforms.progress && (this.model.chunks[j].material.uniforms.progress.value = 1);
  24579. }
  24580. //xzw----end
  24581. this.flying = !1,
  24582. this.currentPano !== i && this.currentPano.exit(),
  24583. i.enter(),
  24584. this.currentPano = i,
  24585. this.nextPano = null,
  24586. this.path.placeCpm(),
  24587. this.path.fadeOutCpm(f.path.fadeOutTime),
  24588. this.spider.draw(),
  24589. this.emit(w.FlyingEnded, i.position, L, i, D),
  24590. this.model.fadePanoMarkers(null,null,{player:this});//xzw 改了参数
  24591. C(e)
  24592. }
  24593. .bind(this), 0, B, "camFly", V.FlyToPano)
  24594. }
  24595. }
  24596. ,
  24597. n.prototype.flytoTag = function(tag, force) {//xzw 飞向热点 一般由列表点击触发
  24598. if(this.tagManager.activeTag && this.tagManager.activeTag != tag) {
  24599. this.tagManager.dismissActiveTag();
  24600. }
  24601. /* if(this.tagManager.activeTag && this.tagManager.activeTag != tag && this.tagManager.tagState == "examine"){
  24602. this.tagManager.dismissActiveTag(); console.log("dismissActiveTag")
  24603. } */
  24604. //setTimeout(function(){
  24605. this.tagManager.activateTag(tag, "examine");//"browse"
  24606. tag.updateBoardOrient = true;
  24607. tag.examine(this, force );
  24608. //}.bind(this),200)
  24609. }
  24610. n.prototype.updateMarkerDisplay = function(){ //xzw 更新marker显示
  24611. return;
  24612. for(var i in this.model.panos.index){//是邻近点就显示否则隐藏
  24613. var pano = this.model.panos.index[i];
  24614. var ma = pano.marker;
  24615. var op = f['panorama'].markerOpacity;
  24616. if(this.mode != u.PANORAMA){
  24617. y.start(v.property(ma.material, "opacity", 0), f.markerOpacityTransitionTime);
  24618. continue;
  24619. }
  24620. if(this.markspot && this.posGets.length == 1){ //正在采集热点 且只有一个位置 只能显示可以走的点
  24621. if(this.disablePanos.indexOf(pano)>-1){
  24622. ma.material.depthTest = true
  24623. if(ma.material.opacity>0)m.start(p.property(ma.material, "opacity", 0), 250)
  24624. }else{
  24625. ma.material.depthTest = false
  24626. if(ma.material.opacity<v)m.start(p.property(ma.material, "opacity", v), 250)
  24627. }
  24628. }else if(this.markspot && this.posGets.length == 2){ //正在采集热点 且有两个位置 只能显示两个位置
  24629. if(this.posGets.list.indexOf(i)>-1){
  24630. ma.material.depthTest = false
  24631. if(ma.material.opacity<v)m.start(p.property(ma.material, "opacity", v), 250)
  24632. }else{
  24633. ma.material.depthTest = true
  24634. if(ma.material.opacity>0)m.start(p.property(ma.material, "opacity", 0), 250)
  24635. }
  24636. }else{
  24637. if(this.currentPano.seeMarkers.indexOf(i)>-1){
  24638. ma.material.depthTest = false
  24639. if(ma.material.opacity<v)m.start(p.property(ma.material, "opacity", v), 250)
  24640. }else{
  24641. ma.material.depthTest = true
  24642. if(ma.material.opacity>0)m.start(p.property(ma.material, "opacity", 0), 250)
  24643. }
  24644. }
  24645. }
  24646. },
  24647. n.prototype.fastForwardActivePanoFlight = function(e) {
  24648. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  24649. y.adjustSpeed(V.FlyToPano, e),
  24650. y.adjustSpeed(V.LookTransition, e)
  24651. }
  24652. ,
  24653. n.prototype.flyToPanoClosestToMouse = function() {
  24654. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  24655. this.intersect && this.updateClosestPano(this.intersect)),
  24656. this.closestPano)
  24657. return this.flyToPano({
  24658. pano: this.closestPano
  24659. });
  24660. var e = this.getMouseDirection();
  24661. this.flyDirection(e) || this.flyToPano({
  24662. pano: this.currentPano
  24663. })
  24664. }
  24665. ,
  24666. n.prototype.flyLocalDirection = function(e) {
  24667. var t = this.getDirection(e)
  24668. , i = 1 === e.z ? .4 : .75
  24669. , n = 1 === Math.abs(e.x);
  24670. return this.flyDirection(t, i, n)
  24671. }
  24672. ,
  24673. n.prototype.flyDirection = function(e, t, i) {
  24674. if(this.tagManager.activeTag) this.tagManager.dismissActiveTag(); //xzw add 因为panochange处的被我去掉了
  24675. var n = $.Deferred();
  24676. this.history.invalidate();
  24677. var r = this.closestPanoInDirection(e, t, i);
  24678. return r ? this.flyToPano({
  24679. pano: r
  24680. }, n.resolve.bind(n, !0)) : (this.bump(e),
  24681. n.resolve(!1)),
  24682. n.promise()
  24683. }
  24684. ,
  24685. n.prototype.closestPanoInDirection = function(e, t, i) {
  24686. return this.rankedPanoInDirection(0, e, t, i)
  24687. }
  24688. ,
  24689. /* n.prototype.rankedPanoInDirection = function() {//MP
  24690. var e = {
  24691. pano: null,
  24692. candidates: []
  24693. };
  24694. return function(t, i, n, r) {
  24695. t || (t = 0),
  24696. n = void 0 !== n ? n : .75;
  24697. var o = r ? "angle" : "direction";
  24698. 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),
  24699. this.cachedPanoCandidates = e.candidates,
  24700. e.pano
  24701. }
  24702. }(), */
  24703. n.prototype.rankedPanoInDirection = function() {//xzw改
  24704. var e = {
  24705. pano: null,
  24706. candidates: []
  24707. };
  24708. return function(t, i, n, r) {
  24709. var o = r ? "angle" : "direction";
  24710. var list1 = [
  24711. s.filters.isPanoAligned(),
  24712. s.filters.inPanoDirection(this.position, i, n),
  24713. s.filters.not(this.currentPano)
  24714. ]
  24715. var list2 = [
  24716. s.scoreFunctions.distanceSquared(this.currentPano),
  24717. s.scoreFunctions[o](this.position, i)
  24718. ]
  24719. if(this.markspot && this.posGets.length == 1 ){//如果在snap热点的话
  24720. var f = function(disablePanos){
  24721. return function(o){
  24722. return disablePanos.indexOf(o)==-1;
  24723. }
  24724. }
  24725. list1.push( f(this.disablePanos) )
  24726. }else if(this.markspot && this.posGets.length == 2 ){
  24727. var f = function(panolist){
  24728. return function(o){
  24729. return panolist.indexOf(o.id)>-1;
  24730. }
  24731. }
  24732. list1.push( f(this.posGets.list) )
  24733. }else{
  24734. list1.push( s.filters.isNeighbourPanoTo(this.currentPano) );
  24735. }
  24736. t || (t = 0),
  24737. n = void 0 !== n ? n : .75;
  24738. return this.model.panos.findRankedByScore(t, list1, list2, e),
  24739. this.cachedPanoCandidates = e.candidates,
  24740. e.pano
  24741. }
  24742. }()
  24743. ,
  24744. n.prototype.bump = function(e) {
  24745. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  24746. 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;
  24747. if (s)
  24748. t = function() {
  24749. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  24750. }
  24751. .bind(this),
  24752. i = function() {
  24753. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  24754. }
  24755. .bind(this);
  24756. else {
  24757. var l = this.camera.position.clone()
  24758. , c = e.clone();
  24759. this.raycaster.set(l, c);
  24760. var h = this.model.floors.reduce(function(e, t) {
  24761. return e.concat(t.collider.children)
  24762. }, [])
  24763. , d = this.raycaster.intersectObjects(h)
  24764. , p = d.length > 0 ? d[0].distance / 25 : .04
  24765. , g = l.clone().add(c.multiplyScalar(p));
  24766. t = function() {
  24767. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  24768. }
  24769. .bind(this),
  24770. i = function() {
  24771. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  24772. }
  24773. .bind(this)
  24774. }
  24775. n = function() {
  24776. this.flying = !1
  24777. }
  24778. .bind(this),
  24779. this.flying = !0,
  24780. t()
  24781. }
  24782. }
  24783. ,
  24784. n.prototype.changeFloor = function(e) {
  24785. if (!this.is360View(this.mode, this.currentPano))
  24786. if (this.mode === u.PANORAMA) {
  24787. var t = this.history.reversePano(e);
  24788. t && t.isAligned() ? this.flyToPano({
  24789. pano: t
  24790. }) : this.changeFloorByScore(e)
  24791. } else
  24792. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  24793. }
  24794. ,
  24795. n.prototype.changeFloorByScore = function() {
  24796. var e = {
  24797. pano: null,
  24798. candidates: []
  24799. };
  24800. return function(t) {
  24801. var i = this.model.nextFloor(t);
  24802. 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),
  24803. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  24804. this.history.push(t, this.currentPano),
  24805. this.flyToPano({
  24806. pano: e.pano
  24807. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  24808. }
  24809. }(),
  24810. n.prototype.gotoFloor = function(e) {
  24811. var t = e - this.model.currentFloor.floorIndex;
  24812. this.changeFloor(t)
  24813. }
  24814. ,
  24815. n.prototype.getDirection = function(e) {
  24816. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  24817. e.applyQuaternion(this.camera.quaternion)
  24818. }
  24819. ,
  24820. n.prototype.setEntry = function(){//xzw 设置初始视角
  24821. if(this.mode != u.PANORAMA) return;
  24822. this.EntryInfo = [this.currentPano.id, this.quaternion.clone(), this.cameraControls.activeControl.lon, this.cameraControls.activeControl.lat];
  24823. }
  24824. ,
  24825. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  24826. if (o = o || $.Deferred(),
  24827. this.mode === u.TRANSITIONING)
  24828. return F.warn("should not be transitioning here"),
  24829. n && n(!1),
  24830. o.reject().promise();
  24831. var a = i || !1
  24832. , s = i ? i.position : this.position
  24833. , l = this.position.clone()
  24834. , c = this.currentPano;
  24835. if (F.debug("New pose in mode " + this.mode),
  24836. !e || (retryCallback = function() {
  24837. N.delayOneFrame(function() {
  24838. this.flyToSameMode(e, t, i, n, o)
  24839. }
  24840. .bind(this))
  24841. }
  24842. .bind(this),
  24843. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  24844. var h = function() {
  24845. this.emit(w.FlyingEnded, s, l, e, c),
  24846. n && n(!0)
  24847. }
  24848. .bind(this)
  24849. , d = f[this.mode]
  24850. , p = void 0 !== t ? t : d.transitionTime
  24851. , g = new r.Vector3
  24852. , C = new r.Vector3;
  24853. if (this.emit(w.FlyingStarted, s, l, e, c),
  24854. this.mode === u.PANORAMA)
  24855. F.warn("we should not be here for panorama views");
  24856. else if (this.mode === u.DOLLHOUSE)
  24857. if (a) {
  24858. var I = new r.Vector3(0,1,0);
  24859. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  24860. this.model.warpDestFloors(i.floorVisibility),
  24861. C.copy(i.position);
  24862. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  24863. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  24864. , _ = b.intersectObjects(this.model.colliders)
  24865. , T = 3;
  24866. _.length ? (g.copy(_[0].point),
  24867. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  24868. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  24869. var x = (new r.Matrix4).lookAt(C, g, I)
  24870. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  24871. , M = g.distanceTo(C)
  24872. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  24873. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  24874. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  24875. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  24876. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  24877. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  24878. this.path.burnsDir = Math.sign(L.y);
  24879. var D = new r.Euler(0,0,0,f.warp.eOrder)
  24880. , B = new r.Vector3;
  24881. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  24882. y.start(function(e, t) {
  24883. D.x = P.x + e * L.x,
  24884. D.y = P.y + e * L.y,
  24885. D.z = P.z + e * L.z;
  24886. var i = O + e * (M - O);
  24887. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  24888. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  24889. }
  24890. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  24891. y.start(function(e, t) {
  24892. this.cameraControls.controls[u.DOLLHOUSE].update(),
  24893. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  24894. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  24895. }
  24896. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  24897. } else
  24898. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  24899. else if (this.path.placeCpm(),
  24900. this.path.fadeInCpm(f.path.fadeInTime),
  24901. i) {
  24902. this.model.warpDestFloors(i.floorVisibility);
  24903. var U = this.cameraControls.cameras[u.FLOORPLAN]
  24904. , k = this.cameraControls.controls[u.FLOORPLAN]
  24905. , H = k.target.clone()
  24906. , G = i.position.clone().sub(H)
  24907. , z = U.position.clone().sub(k.target)
  24908. , W = z.length()
  24909. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  24910. , Y = Math.atan2(k.offset.x, k.offset.z)
  24911. , X = Math.atan2(j.x, j.z)
  24912. , Z = k.absoluteScale
  24913. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  24914. y.start(function(e, t) {
  24915. k.target.copy(G).multiplyScalar(e).add(H);
  24916. var i = Y + (X - Y) * e;
  24917. k.offset.x = W * Math.sin(i),
  24918. k.offset.z = W * Math.cos(i),
  24919. U.position.copy(k.target).add(k.offset),
  24920. k.absoluteScale = Z + e * (q - Z),
  24921. k.update(),
  24922. this.quaternion.copy(U.quaternion),
  24923. this.position.copy(U.position),
  24924. this.target.copy(k.target),
  24925. this.camera.projectionMatrix.copy(U.projectionMatrix)
  24926. }
  24927. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  24928. } else
  24929. F.info("flyToSameMode() funny floorplan view? skipping");
  24930. return y.setTimeout(function(e) {
  24931. this.mode = e,
  24932. h(),
  24933. o.resolve(!0)
  24934. }
  24935. .bind(this, this.mode), p, V.FlyToSameMode),
  24936. this.mode = u.TRANSITIONING,
  24937. o.promise()
  24938. }
  24939. }
  24940. ,
  24941. n.prototype.beforeChangeMode = function(from, to, toPano){ //xzw加 当模式转换前要执行的
  24942. if(from == u.PANORAMA){
  24943. editor.changeSnapState(false);
  24944. editor.changePosCancel();//这个是清除位置修改的操作,一定要在下面那个前执行
  24945. editor.clearCollect();
  24946. this.tagManager.updateVisible();//更新热点显示
  24947. this.model.floorLogos[0].visible = false;
  24948. this.model.floorLogos[1].visible = false;
  24949. }else if(from == u.FLOORPLAN){
  24950. //layer.menu.removeNotebox(false) //标签编辑框消失
  24951. }
  24952. if(to == u.PANORAMA){
  24953. this.model.floorLogos[0].position.copy(toPano.floorPosition.clone().sub(this.model.position));//改
  24954. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  24955. }
  24956. }
  24957. ,
  24958. n.prototype.afterChangeMode = function(from, to){//xzw加 当模式转换后要执行的
  24959. if(to == u.PANORAMA){
  24960. editor.changeSnapState(true);
  24961. this.model.floorLogos[0].visible = true;
  24962. this.model.floorLogos[0].material.uniforms.opacity.value = 0;
  24963. this.model.floorLogoShow(0,150);
  24964. this.model.fadePanoMarkers(null,null,{player:this})
  24965. //this.model.skybox.material.transparent = !1;//如果skybox透明,会让其中其他mesh的透明出问题
  24966. }else{
  24967. //this.model.skybox.material.transparent = !0;
  24968. }
  24969. }
  24970. ,
  24971. n.prototype.flyToNewMode = function(e, t) {
  24972. e = e || {};
  24973. var i = e.mode
  24974. , n = e.pano
  24975. , o = e.duration
  24976. , a = e.warpDest
  24977. , s = e.callback
  24978. , l = e.force
  24979. , c = e.quaternion;
  24980. if (t = t || $.Deferred(),
  24981. this.isWarping())
  24982. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  24983. s && s(!1),
  24984. t.reject("Cannot change mode during tour transition").promise();
  24985. if (this.mode === u.TRANSITIONING)
  24986. return s && s(!1),
  24987. t.reject("Cannot change mode during mode transition").promise();
  24988. if (i === this.mode)
  24989. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  24990. t.promise()) : (s && s(!1),
  24991. t.reject("Already in " + i + " mode").promise());
  24992. var h = a || !1;
  24993. F.debug("Switching mode to " + i);
  24994. var d = function() {
  24995. N.delayOneFrame(function() {
  24996. this.flyToNewMode(e, t)
  24997. }
  24998. .bind(this))
  24999. }
  25000. .bind(this);
  25001. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  25002. return t.promise();
  25003. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  25004. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  25005. this.model.waitForLoad(this.model, function() {
  25006. return this.model.meshTexturesLoaded;
  25007. }
  25008. .bind(this)),
  25009. this.model.loadMeshTextures().done(d),
  25010. t.promise();
  25011. this.history.invalidate(),
  25012. this.updateLastView();
  25013. var p = this.mode
  25014. , C = this.cameraControls.cameras[i];
  25015. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  25016. //xzw
  25017. this.modeTran = p + "-" + i;
  25018. this.beforeChangeMode(p, i, n);
  25019. //end
  25020. var I = void 0 !== o ? o : e.transitionTime;
  25021. this.emit(w.ModeChanging, p, i, n);
  25022. n && (this.currentPano = n);
  25023. this.switchCameraMode(i, c);
  25024. y.cancelById(V.LookTransition);
  25025. var _ = (new r.Vector3).copy(this.position);
  25026. if (i === u.PANORAMA)
  25027. this.emit(w.PanoChosen, n, n),
  25028. setTimeout(function() {
  25029. n.floor.enter(i)
  25030. }
  25031. .bind(this), I / 2),
  25032. this.path.fadeOutCpm(f.path.fadeOutTime);
  25033. else if (i === u.DOLLHOUSE) {
  25034. if (h && (this.model.stayPut = !0),
  25035. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  25036. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  25037. this.path.placeCpm(),
  25038. this.path.fadeInCpm(f.path.fadeInTime),
  25039. h) {
  25040. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  25041. _.set(15, 10, 15);
  25042. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  25043. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  25044. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  25045. P.length ? (T.copy(P[0].point),
  25046. _.copy(a.position),
  25047. 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),
  25048. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  25049. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  25050. _.add(this.model.position),
  25051. C.position.copy(_),
  25052. this.cameraControls.controls[u.DOLLHOUSE].update()
  25053. }
  25054. } else if (this.path.placeCpm(),
  25055. this.path.fadeInCpm(f.path.fadeInTime),
  25056. a) {
  25057. this.model.warpDestFloors(a.floorVisibility);
  25058. var O = this.cameraControls.cameras[u.FLOORPLAN]
  25059. , L = this.cameraControls.controls[u.FLOORPLAN]
  25060. , D = O.position.clone().sub(L.target)
  25061. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  25062. , U = Math.atan2(B.x, B.z);
  25063. L.target.copy(a.position);
  25064. var k = D.length();
  25065. L.offset.x = k * Math.sin(U),
  25066. L.offset.y = 0,
  25067. L.offset.z = k * Math.cos(U),
  25068. O.position.copy(L.target).add(L.offset);
  25069. L.target.clone().sub(C.position);
  25070. C.quaternion.copy(a.quaternion),
  25071. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  25072. L.absoluteScale = L.currentScale,
  25073. L.update()
  25074. } else
  25075. this.model.currentFloor.enter(i);
  25076. var H = this.currentPano
  25077. , G = this.position.clone();
  25078. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  25079. this.flying = !0,
  25080. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  25081. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  25082. C.controls.update()),
  25083. e.blackoutStyle = S.FADEIN,
  25084. I = f.show360Views.transitionTime,
  25085. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  25086. this.mode = i,
  25087. this.path && this.path.popOutCpm(),
  25088. e.blackoutStyle = S.END,
  25089. I = f.show360Views.transitionTime,
  25090. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  25091. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  25092. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  25093. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  25094. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  25095. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  25096. y.setTimeout(function() {
  25097. this.flying = !1,
  25098. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  25099. this.currentPano.enter(),
  25100. this.path.placeCpm(),
  25101. this.path.fadeOutCpm(f.path.fadeOutTime),
  25102. this.spider.draw()),
  25103. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  25104. this.mode = i,
  25105. this.afterChangeMode(p,i)//xzw
  25106. this.emit(w.FlyingEnded, _, G, this.currentPano, H),
  25107. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  25108. t.resolve())
  25109. }
  25110. .bind(this), I, V.FlyToNewMode),
  25111. this.mode = u.TRANSITIONING,
  25112. t.promise()
  25113. }
  25114. ,
  25115. n.prototype.fade360View = function(e, t, i) {
  25116. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  25117. $(this.domElement).fadeOut(.5 * e, function() {
  25118. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  25119. this.model.alpha = i.modelAlpha,
  25120. this.position.copy(t.position),
  25121. this.quaternion.copy(t.quaternion),
  25122. this.camera.projectionMatrix.copy(t.projectionMatrix),
  25123. $(this.domElement).fadeIn(.5 * e)
  25124. }
  25125. .bind(this))
  25126. }
  25127. ,
  25128. n.prototype.findDefaultViews = function() {
  25129. this.findDefaultView(this.lastInsideView, !0),
  25130. this.findDefaultView(this.last360View, !1)
  25131. }
  25132. ,
  25133. n.prototype.findDefaultView = function(e, t) {
  25134. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  25135. if (e.cameraMode !== u.PANORAMA)
  25136. return !1;
  25137. var i = r.get(e.panoId);
  25138. return i && i.isAligned() === t
  25139. });
  25140. o >= 0 ? (i = r.get(n[o].panoId),
  25141. e.update({
  25142. cameraMode: u.PANORAMA,
  25143. pano: i,
  25144. position: n[o].position,
  25145. quaternion: n[o].quaternion
  25146. })) : (o = r.list.findIndex(function(e) {
  25147. return e.isAligned() === t
  25148. }),
  25149. o >= 0 ? (i = r.list[o],
  25150. e.update({
  25151. cameraMode: u.PANORAMA,
  25152. pano: i,
  25153. position: i.position
  25154. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  25155. }
  25156. ,
  25157. n.prototype.updateLastView = function() {
  25158. if (this.mode === u.PANORAMA) {
  25159. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  25160. e.update({
  25161. pano: this.currentPano,
  25162. position: this.position,
  25163. quaternion: this.quaternion
  25164. })
  25165. }
  25166. }
  25167. ,
  25168. n.prototype.goToLastView = function(e, t) {
  25169. var i = $.Deferred()
  25170. , n = i.resolve.bind(i)
  25171. , r = i.reject.bind(i)
  25172. , o = e ? this.lastInsideView : this.last360View;
  25173. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  25174. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  25175. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  25176. mode: o.cameraMode,
  25177. pano: o.pano,
  25178. quaternion: o.quaternion,
  25179. callback: t
  25180. }).done(n).fail(r),
  25181. i.promise()
  25182. }
  25183. ,
  25184. n.prototype.fadeToView = function(e, t, i, n) {
  25185. var r = $.Deferred()
  25186. , o = r.resolve.bind(r)
  25187. , a = r.reject.bind(r);
  25188. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  25189. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  25190. a("Cannot go to illegal view"),
  25191. r.promise();
  25192. var s = (f[t.cameraMode],
  25193. function() {
  25194. $(this.domElement).fadeIn(.5 * i),
  25195. n && n(),
  25196. o()
  25197. }
  25198. .bind(this))
  25199. , l = e ? S.FADEIN : S.END;
  25200. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  25201. $(this.domElement).fadeOut(.5 * i, function() {
  25202. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0,{player:this}),//xzw改 加了后两个参数
  25203. t.cameraMode === u.PANORAMA ? this.flyToPano({
  25204. pano: t.pano,
  25205. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  25206. duration: 0
  25207. }, s) : this.flyToNewMode({
  25208. mode: t.cameraMode,
  25209. quaternion: t.quaternion,
  25210. duration: 0,
  25211. callback: s
  25212. })
  25213. }
  25214. .bind(this)),
  25215. r.promise()
  25216. }
  25217. ,
  25218. n.prototype.startWarp = function(e, t, i, n, r, o) {//开始蛇行 向导览点
  25219. //e:v.Show , t: m.Slow, i:black or walk, n,r,? o:fuc
  25220. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  25221. this.flying)
  25222. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  25223. o && o(),
  25224. !1;
  25225. null !== e && void 0 !== e || (e = b.Show),
  25226. this.history.invalidate(),
  25227. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType; //brushToWarpPano ???
  25228. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  25229. this.emit(w.WarpStarted, a, i, n, r);
  25230. n = n || S.MIDDLE;
  25231. this.path.warpToPano(i, n, r, function() {
  25232. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  25233. this.emit(w.WarpEnded, i),
  25234. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  25235. o && o()
  25236. }.bind(this));
  25237. e === b.Hide && this.path.discardPathObject();
  25238. return !0
  25239. }
  25240. ,
  25241. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  25242. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  25243. s && s(),
  25244. !1)
  25245. }
  25246. ,
  25247. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  25248. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  25249. a && a(),
  25250. !1)
  25251. }
  25252. ,
  25253. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  25254. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  25255. }
  25256. ,
  25257. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  25258. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  25259. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  25260. t && t(),
  25261. !1)
  25262. }
  25263. ,
  25264. n.prototype.aimTourCamera = function(e, t, i, n) {
  25265. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  25266. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  25267. }
  25268. ,
  25269. n.prototype.showPathToHeroLocation = function(e) {
  25270. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  25271. }
  25272. ,
  25273. n.prototype.tourInterlude = function(e, t) {
  25274. this.history.invalidate(),
  25275. this.path.discardSlow(),
  25276. this.path.waitNextStep(e, function() {
  25277. t && t()
  25278. }
  25279. .bind(this))
  25280. }
  25281. ,
  25282. n.prototype.stopInterlude = function() {
  25283. this.interruptAndFastForward(null, 0)
  25284. }
  25285. ,
  25286. n.prototype.interruptAndFastForward = function(e, t) {
  25287. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  25288. this.flying && this.emit(w.FlyingInterrupted),
  25289. this.path.interruptAndFastForward(e, t)
  25290. }
  25291. ,
  25292. n.prototype.setSize = function(e, t) {
  25293. var i = e / t;
  25294. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  25295. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  25296. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  25297. for (var r in this.cameraControls.cameras) {
  25298. var o = this.cameraControls.cameras[r];
  25299. o.fov = this.baseFov * (1 / this.zoomLevel),
  25300. o.updateAspect(i)
  25301. }
  25302. if(this.editor && this.editor.scroller){
  25303. for(var i in this.editor.scroller) //xzw add 滑动条更新offset
  25304. this.editor.scroller[i].getOffset(),
  25305. this.editor.scroller[i].moveKnot();
  25306. }
  25307. }
  25308. ,
  25309. n.prototype.toJSON = function() {
  25310. var e = {};
  25311. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  25312. e.camera_mode = u.toInt(this.mode),
  25313. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  25314. return e.hidden ? 0 : 1
  25315. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  25316. e) : e
  25317. }
  25318. ,
  25319. n.prototype.getCurrentNodePanos = function(e) {
  25320. this.model.panos.map;
  25321. if (e.length = 0,
  25322. this.path.nodes)
  25323. for (var t = 0; t < this.path.nodes.length; t++) {
  25324. var i = this.path.nodes[t];
  25325. e.push(this.model.panos.get(i))
  25326. }
  25327. }
  25328. ,
  25329. n.prototype.zoomIncrementally = function(e) {
  25330. var t = this.zoomLevel;
  25331. this.zoomTo(this.zoomLevel + e),
  25332. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  25333. }
  25334. ,
  25335. n.prototype.zoomInIncrementally = function(e) {
  25336. e = e || this.defaultZoomIncrement,
  25337. this.zoomIncrementally(e)
  25338. }
  25339. ,
  25340. n.prototype.zoomOutIncrementally = function(e) {
  25341. e = e || -this.defaultZoomIncrement,
  25342. this.zoomIncrementally(e)
  25343. }
  25344. ,
  25345. n.prototype.zoomBy = function(e) {
  25346. this.zoomTo(this.zoomLevel * e)
  25347. }
  25348. ,
  25349. n.prototype.zoomIn = function() {
  25350. this.zoomBy(1 + this.zoomSpeed)
  25351. }
  25352. ,
  25353. n.prototype.zoomOut = function() {
  25354. this.zoomBy(1 - this.zoomSpeed)
  25355. }
  25356. ,
  25357. n.prototype.zoomTo = function(e, t) {
  25358. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  25359. if (e < f.zoom.min && (e = f.zoom.min),
  25360. e > f.zoom.max && (e = f.zoom.max),
  25361. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  25362. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  25363. e === f.zoom.min && this.emit(O.ZoomMin)),
  25364. this.cameraControls.activeControl) {
  25365. var i = this.cameraControls.activeControl.camera;
  25366. this.zoomLevel = e,
  25367. i.fov = this.baseFov * (1 / this.zoomLevel),
  25368. i.updateProjectionMatrix(),
  25369. this.zoomFov = i.fov
  25370. }
  25371. }
  25372. }
  25373. ,
  25374. n.prototype.increaseZoomSpeed = function() {
  25375. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  25376. }
  25377. ,
  25378. n.prototype.decreaseZoomSpeed = function() {
  25379. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  25380. }
  25381. ,
  25382. n.prototype.clampZoomSpeed = function(e) {
  25383. return e < 0 ? 0 : e
  25384. }
  25385. ,
  25386. n.prototype.activatePersistentZooming = function(e) {
  25387. this.zooming = e ? 1 : -1
  25388. }
  25389. ,
  25390. n.prototype.deactivatePersistentZooming = function() {
  25391. this.zooming = 0
  25392. }
  25393. ,
  25394. n.prototype.zoomDefault = function() {
  25395. this.zoomTo(1, !0)
  25396. }
  25397. ,
  25398. n.prototype.smoothZoomToDefault = function(e, t) {
  25399. var i, n = this.zoomLevel, r = function(e) {
  25400. e > 1 && (e = 1),
  25401. i = n * (1 - e) + e,
  25402. this.zoomTo(i, !0)
  25403. }
  25404. .bind(this), o = function() {
  25405. this.zoomDefault(),
  25406. t && window.setTimeout(t, 50)
  25407. }
  25408. .bind(this);
  25409. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  25410. }
  25411. ,
  25412. n.prototype.updateZoomPano = function() {
  25413. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  25414. var e = this.currentPano;
  25415. if (e) {
  25416. var t = this.zoomLevel > f.zoom.activationThreshold
  25417. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  25418. , n = !i && !this.isWarping()
  25419. , r = t && n;
  25420. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  25421. this.panoRenderer.setZoomingActive(r, e, !0);
  25422. var o = function(e, t) {
  25423. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  25424. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  25425. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  25426. e.setZoomed(t)
  25427. }
  25428. .bind(this);
  25429. r && !e.zoomed ? (o(e, !0),
  25430. this.panoRenderer.enableUltraHighQualityMode(function() {
  25431. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  25432. r && o(e, !0)
  25433. }
  25434. .bind(this))) : !t && e.zoomed && o(e, !1)
  25435. }
  25436. }
  25437. }
  25438. ,
  25439. t.exports = n
  25440. }
  25441. ).call(this, "/js/player.js")
  25442. }
  25443. , {
  25444. "./constants": 8,
  25445. "./enum/AlignmentType": 17,
  25446. "./enum/BlackoutStyle": 18,
  25447. "./enum/ControlEvents": 21,
  25448. "./enum/Keys": 30,
  25449. "./enum/ModelManagerEvents": 33,
  25450. "./enum/PanoSizeClass": 36,
  25451. "./enum/PanoramaEvents": 37,
  25452. "./enum/PathDiscardMode": 38,
  25453. "./enum/PathDisplayMode": 39,
  25454. "./enum/PlayerEvents": 40,
  25455. "./enum/TagStates": 44,
  25456. "./enum/Vectors": 50,
  25457. "./enum/Viewmode": 51,
  25458. "./enum/WarpStyle": 52,
  25459. "./enum/ZoomEvents": 53,
  25460. "./exception/BasicException": 55,
  25461. "./model/ModelManager": 140,
  25462. "./objects/NSpider": 147,
  25463. "./objects/Panorama": 148,
  25464. "./objects/Reticule": 149,
  25465. "./objects/ShowPath": 151,
  25466. "./objects/Snapshot": 153,
  25467. "./objects/View": 154,
  25468. "./settings": 166,
  25469. "./shaders": 167,
  25470. "./tile/TileDownloader": 171,
  25471. "./tile/TilePrioritizer": 172,
  25472. "./util/ZoomStats": 179,
  25473. "./util/browser": 182,
  25474. "./util/camera": 183,
  25475. "./util/cameraLight": 184,
  25476. "./util/common": 185,
  25477. "./util/easing": 186,
  25478. "./util/history": 187,
  25479. "./util/lerp": 188,
  25480. "./util/logger": 189,
  25481. "./util/math": 190,
  25482. "./util/transitions": 195,
  25483. events: 202,
  25484. three: 217,
  25485. "Editor":"Editor",
  25486. "Hotspot":"Hotspot",
  25487. "dom":"dom"
  25488. }],
  25489. 156: [function(e, t, i) {//js/preloaders.js
  25490. (function(i) {
  25491. "use strict";
  25492. function n(e, t) {
  25493. this.model = e,
  25494. this.panos = e.panos,
  25495. this.player = t,
  25496. this.imagePanos = this.listImagePanos(),
  25497. this.retryMinimumTime = 1e4
  25498. }
  25499. var r = (e("three"),
  25500. e("./enum/Viewmode"))
  25501. , o = (e("./settings"),
  25502. e("./objects/Panorama"))
  25503. , a = e("./util/logger")
  25504. , s = new a(i);
  25505. n.prototype.start = function() {
  25506. this.loadNextPano(function(e) {
  25507. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  25508. setTimeout(function() {
  25509. this.start()
  25510. }
  25511. .bind(this), 1e3))
  25512. }
  25513. .bind(this))
  25514. }
  25515. ,
  25516. n.prototype.validLoadTarget = function(e) {
  25517. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  25518. }
  25519. ,
  25520. n.prototype.listImagePanos = function() {
  25521. var e = []
  25522. , t = this;
  25523. return this.model.images.forEach(function(i) {
  25524. if (i.metadata && i.metadata.scan_id) {
  25525. var n = t.model.panos.get(i.metadata.scan_id);
  25526. n && !n.isLoaded("high") && e.push(n)
  25527. }
  25528. }),
  25529. e
  25530. }
  25531. ,
  25532. n.prototype.nextNotLoadedImage = function() {
  25533. for (; this.imagePanos.length > 0; ) {
  25534. var e = this.imagePanos[0];
  25535. if (!e.isLoaded("high"))
  25536. return e;
  25537. this.imagePanos.shift()
  25538. }
  25539. return null
  25540. }
  25541. ,
  25542. n.prototype.loadNextPano = function(e) {
  25543. var t, i, n = this.model.waitQueue.filter(function(e) {
  25544. return e.object instanceof o
  25545. });
  25546. n.length > 0 ? (t = n[0].object,
  25547. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  25548. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  25549. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  25550. t = this.imagePanos[0],
  25551. 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())]),
  25552. t && s.debug("Normal pano selection: neighbor " + t.id)),
  25553. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  25554. s.debug("Preloading " + i + "-res pano " + t.id),
  25555. t.loadCube(i).done(e).fail(function() {
  25556. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  25557. e()
  25558. })) : e && e(null)
  25559. }
  25560. ,
  25561. t.exports = n
  25562. }
  25563. ).call(this, "/js/preloaders.js")
  25564. }
  25565. , {
  25566. "./enum/Viewmode": 51,
  25567. "./objects/Panorama": 148,
  25568. "./settings": 166,
  25569. "./util/logger": 189,
  25570. three: 217
  25571. }],
  25572. 157: [function(e, t, i) {//js/scene/QuickstartManager.js
  25573. (function(i) {
  25574. "use strict";
  25575. function n(e, t, i, n, r) {
  25576. this.qualityManager = e,
  25577. this.scene = t,
  25578. this.camera = i,
  25579. this.container = r,
  25580. this.controls = n,
  25581. this.controls.enabled = !0,
  25582. this.controls.locked = !0,
  25583. this.quickstartCamera = n.camera,
  25584. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $('#player').width() , $('#player').height()),
  25585. this.skybox = null
  25586. }
  25587. var r = e("three")
  25588. , o = e("../util/logger")
  25589. , a = e("../constants")
  25590. , s = (e("../util/transitions"),
  25591. e("../util/lerp"),
  25592. e("../util/easing"),
  25593. e("../enum/Vectors"))
  25594. , l = e("../enum/PanoSizeClass")
  25595. , c = (e("../materials/ModelTextureMaterial"),
  25596. e("../materials/CubemapMaterial"))
  25597. , h = (e("../cameras/PanoramaCamera"),
  25598. e("../controls/PanoramaControls"),
  25599. e("../tile/TileUtils"),
  25600. e("../util/camera"),
  25601. e("../util/cameraLight"))
  25602. , u = (e("../util/browser"),
  25603. e("../settings"),
  25604. e("../gui/helpManager"),
  25605. new o(i));
  25606. n.prototype.load = function(e) {
  25607. e.pano.shouldRedrawOnBaseLoaded = !0;
  25608. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  25609. this.controls.lookAt(r.add(this.quickstartCamera.position));
  25610. var a = this.qualityManager.getPanoSize(l.BASE)
  25611. , c = this.qualityManager.getPanoSize(l.STANDARD);
  25612. if (e.pano.tiled) {
  25613. u.warn("Loading startPano, TILED", e.pano.id);
  25614. var d = h.getHFOVForCamera(this.quickstartCamera, $('#player').width() , $('#player').height())
  25615. , p = this.quickstartCamera.fov;
  25616. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  25617. t = e.pano.loadTiledPano(c, r, {
  25618. hFov: d,
  25619. vFov: p
  25620. }, !1, !1, !0),
  25621. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  25622. } else
  25623. u.warn("Loading startPano", e.pano.id),
  25624. t = e.pano.loadCube("high");
  25625. return $.when(t).then(function() {
  25626. n.init(e.pano, e.quaternion),
  25627. e.pano.tiled ? i.done(function() {
  25628. e.pano.lockUntilRenderingComplete = !1,
  25629. this.controls.locked = !1
  25630. }
  25631. .bind(this)) : this.controls.locked = !1
  25632. }
  25633. .bind(this))
  25634. }
  25635. ,
  25636. n.prototype.init = function(e, t) {
  25637. u.info("Quickstart done loading, adding scene objects"),
  25638. e.lockUntilRenderingComplete = !0,
  25639. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  25640. side: r.BackSide
  25641. })),
  25642. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  25643. this.skybox.quaternion.copy(e.quaternion),
  25644. this.scene.add(this.skybox),
  25645. $(this.container).show()
  25646. }
  25647. ,
  25648. n.prototype.update = function(e) {
  25649. this.controls.update(e),
  25650. this.camera.copy(this.quickstartCamera)
  25651. }
  25652. ,
  25653. n.prototype.setSize = function(e, t) {
  25654. this.quickstartCamera.updateAspect(e / t)
  25655. }
  25656. ,
  25657. n.prototype.destroy = function() {
  25658. this.scene.remove(this.skybox)
  25659. }
  25660. ,
  25661. t.exports = n
  25662. }
  25663. ).call(this, "/js/scene/QuickstartManager.js")
  25664. }
  25665. , {
  25666. "../cameras/PanoramaCamera": 7,
  25667. "../constants": 8,
  25668. "../controls/PanoramaControls": 13,
  25669. "../enum/PanoSizeClass": 36,
  25670. "../enum/Vectors": 50,
  25671. "../gui/helpManager": 68,
  25672. "../materials/CubemapMaterial": 117,
  25673. "../materials/ModelTextureMaterial": 118,
  25674. "../settings": 166,
  25675. "../tile/TileUtils": 174,
  25676. "../util/browser": 182,
  25677. "../util/camera": 183,
  25678. "../util/cameraLight": 184,
  25679. "../util/easing": 186,
  25680. "../util/lerp": 188,
  25681. "../util/logger": 189,
  25682. "../util/transitions": 195,
  25683. three: 217
  25684. }],
  25685. 158: [function(e, t, i) {//"./scene/SceneRenderer"
  25686. "use strict";
  25687. function n(e, t, i) {
  25688. this.scene = e,
  25689. this.camera = t,
  25690. this.renderer = null,
  25691. this.effects = i,
  25692. this.animateCallback = null,
  25693. this.composer = null,
  25694. this.qualityManager = null,
  25695. e.renderWidth = 0,
  25696. e.renderHeight = 0,
  25697. this.updateClock = new r.Clock,
  25698. this.components = [],
  25699. this.updateListeners = [],
  25700. this.resizeListeners = [],
  25701. this.forceUpdateSize = !1,
  25702. this.started = !1,
  25703. this.textures = {},
  25704. this.suspendedObjects = []
  25705. }
  25706. var r = e("three")
  25707. , o = e("../shaders")
  25708. , a = e("../enum/SceneRendererEvents")
  25709. , s = e("../enum/GLTextureType")
  25710. , l = e("../enum/GLCubeFaces")
  25711. , c = e("../exception/BasicException")
  25712. , h = e("../exception/RendererCreationException")
  25713. , u = e("../settings")
  25714. , d = e("events").EventEmitter;
  25715. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  25716. n.prototype = Object.create(d.prototype),
  25717. n.prototype.addComponent = function(e) { //增加渲染成员
  25718. this.components.push(e),
  25719. e.update && this.updateListeners.push(e),
  25720. e.setSize && (this.resizeListeners.push(e),
  25721. this.forceUpdateSize = !0)
  25722. }
  25723. ,
  25724. n.prototype.removeComponent = function(e) {
  25725. var t = function(t) {
  25726. return t !== e
  25727. };
  25728. this.components = this.components.filter(t),
  25729. this.updateListeners = this.updateListeners.filter(t),
  25730. this.resizeListeners = this.resizeListeners.filter(t)
  25731. }
  25732. ,
  25733. n.prototype.start = function(e) {
  25734. if (this.started)
  25735. throw new c("Can't start SceneRenderer, already started");
  25736. this.createContext(e),
  25737. this.initComposer(),
  25738. this.started = !0,
  25739. (p = p.bind(this))()
  25740. }
  25741. ,
  25742. n.prototype.createContext = function(e) {
  25743. try {
  25744. this.renderer = new r.WebGLRenderer,
  25745. this.renderer.autoClear = !0,
  25746. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  25747. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  25748. this.emit(a.ContextCreated)
  25749. } catch (e) {
  25750. throw new h("Unable to create a WebGL rendering context")
  25751. }
  25752. u.profiling.enabled && this.overrideTextures(),
  25753. e.appendChild(this.renderer.domElement)
  25754. }
  25755. ,
  25756. n.prototype.overrideTextures = function() {
  25757. var e = this.renderer.context
  25758. , t = 0
  25759. , i = e.createTexture;
  25760. e.createTexture = function() {
  25761. var n = i.call(e);
  25762. return n.id = t++,
  25763. this.textures[n.id] = n,
  25764. n
  25765. }
  25766. .bind(this);
  25767. var n = e.texImage2D;
  25768. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  25769. var d, p = this.getTextureTypeFromTarget(e, t);
  25770. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  25771. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  25772. h = a,
  25773. u = l,
  25774. o = u.naturalWidth,
  25775. a = u.naturalHeight,
  25776. n.call(e, t, i, r, c, h, u));
  25777. var f = this.textures[d.id];
  25778. f.width = p === s.TextureCube ? 6 * o : o,
  25779. f.height = a
  25780. }
  25781. .bind(this);
  25782. var r = e.deleteTexture;
  25783. e.deleteTexture = function(t) {
  25784. delete this.textures[t.id],
  25785. r.call(e, t)
  25786. }
  25787. .bind(this)
  25788. }
  25789. ,
  25790. n.prototype.updateTextureMemory = function() {
  25791. var e = null;
  25792. return function() {
  25793. var t = 0;
  25794. for (var i in this.textures) {
  25795. var n = this.textures[i];
  25796. n.width && n.height && (t += n.width * n.height * 4)
  25797. }
  25798. t !== e && this.emit(a.MemoryUsageUpdated, t),
  25799. e = t
  25800. }
  25801. }(),
  25802. n.prototype.getTextureTypeFromTarget = function(e, t) {
  25803. switch (t) {
  25804. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  25805. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  25806. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  25807. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25808. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  25809. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25810. return s.TextureCube;
  25811. case e.TEXTURE_2D:
  25812. return s.Texture2D;
  25813. default:
  25814. return null
  25815. }
  25816. }
  25817. ,
  25818. n.prototype.initComposer = function() {
  25819. this.composer = new r.EffectComposer(this.renderer),
  25820. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  25821. this.composer.addPass(this.effects.hblurPass),
  25822. this.composer.addPass(this.effects.vblurPass)
  25823. }
  25824. ,
  25825. n.prototype.setSize = function(e, t, devicePixelRatio) {
  25826. this.renderWidth = e,
  25827. this.renderHeight = t,
  25828. this.effects.aspect = e / t,
  25829. /* this.renderer.setSize(e, t), -----MP */
  25830. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  25831. this.composer.setSize(e, t);
  25832. for (var i = 0; i < this.resizeListeners.length; i++)
  25833. this.resizeListeners[i].setSize(e, t)
  25834. }
  25835. ,
  25836. n.prototype.render = function() {
  25837. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  25838. }
  25839. ,
  25840. /* n.prototype.updateScreenSize = function() { //MP
  25841. (window.innerWidth !== this.renderWidth || window.innerHeight !== this.renderHeight || this.forceUpdateSize) && (this.setSize(window.innerWidth, window.innerHeight),
  25842. this.forceUpdateSize = !1)
  25843. } */
  25844. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  25845. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  25846. return function(o){
  25847. var render = false;
  25848. var ratio;
  25849. var w, h; //记录应当render的大小
  25850. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  25851. w = o.width, h = o.height, render = true, ratio=1;
  25852. }else{
  25853. w = $('#player').width();
  25854. h = $('#player').height();
  25855. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  25856. (w !== W || h !== H || this.forceUpdateSize) &&
  25857. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  25858. }
  25859. if(render){
  25860. this.setSize(w, h, ratio);
  25861. this.forceUpdateSize = !1
  25862. }
  25863. }
  25864. }()
  25865. ,
  25866. n.prototype.updateComponents = function() {
  25867. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25868. this.updateListeners[t].update(e)
  25869. }
  25870. ,
  25871. n.prototype.suspend = function() {
  25872. this.started = !1,
  25873. this.suspendedObjects = this.scene.children.map(function(e) {
  25874. return this.scene.remove(e),
  25875. e
  25876. }
  25877. .bind(this)),
  25878. this.render()
  25879. }
  25880. ,
  25881. n.prototype.resume = function() {
  25882. this.suspendedObjects.forEach(function(e) {
  25883. this.scene.add(e)
  25884. }
  25885. .bind(this)),
  25886. this.suspendedObjects = [],
  25887. this.started = !0,
  25888. p()
  25889. }
  25890. ;
  25891. var p = function(player) {
  25892. this.started && (window.requestAnimationFrame(p),
  25893. this.updateScreenSize(),
  25894. this.updateComponents(),
  25895. this.updateTextureMemory(),
  25896. this.render(),
  25897. // markspot && markspot.updateHotspot2dPos(),
  25898. this.emit(a.AfterRender)
  25899. )
  25900. };
  25901. n.prototype.getImageData = function() {
  25902. var e = document.createElement("canvas")
  25903. , t = e.getContext("2d");
  25904. return function(i, n, r) {
  25905. return e.width === n && e.height === r || (e.width = n,
  25906. e.height = r),
  25907. t.drawImage(i, 0, 0, n, r),
  25908. t.getImageData(0, 0, n, r)
  25909. }
  25910. }(),
  25911. n.prototype.initSizedTexture2D = function(e, t, i) {
  25912. var n = this.renderer
  25913. , o = n.context
  25914. , a = n.state
  25915. , s = new r.Texture(null);
  25916. s.flipY = !1,
  25917. i !== !0 && (i = !1),
  25918. s.generateMipmaps = i;
  25919. var l = n.paramThreeToGL(s.format)
  25920. , c = n.paramThreeToGL(s.type)
  25921. , h = n.properties.get(s)
  25922. , u = o.createTexture();
  25923. a.bindTexture(o.TEXTURE_2D, u),
  25924. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25925. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25926. s.wrapS = t,
  25927. s.wrapT = t;
  25928. var d = n.paramThreeToGL(t);
  25929. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25930. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25931. i ? (s.magFilter = r.LinearFilter,
  25932. s.minFilter = r.LinearMipMapLinearFilter,
  25933. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25934. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25935. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25936. s.minFilter = r.LinearFilter,
  25937. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25938. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25939. a.bindTexture(o.TEXTURE_2D, null),
  25940. h.__webglTexture = u,
  25941. s
  25942. }
  25943. ,
  25944. n.prototype.initSizedCubeMap = function(e, t) {
  25945. var i = this.renderer
  25946. , n = i.context
  25947. , o = i.state
  25948. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25949. a.flipY = !1,
  25950. a.generateMipmaps = t;
  25951. var s = i.paramThreeToGL(a.format)
  25952. , l = i.paramThreeToGL(a.type)
  25953. , c = i.properties.get(a)
  25954. , h = n.createTexture();
  25955. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25956. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25957. for (var u = 0; u < 6; u++)
  25958. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25959. return t ? (a.magFilter = r.LinearFilter,
  25960. a.minFilter = r.LinearMipMapLinearFilter,
  25961. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25962. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25963. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25964. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25965. a.minFilter = r.LinearFilter,
  25966. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25967. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25968. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25969. c.__image__webglTextureCube = h,
  25970. a
  25971. }
  25972. ,
  25973. n.prototype.deallocateCubeTexture = function(e) {
  25974. var t = this.renderer
  25975. , i = t.context
  25976. , n = t.properties.get(e);
  25977. i.deleteTexture(n.__image__webglTextureCube)
  25978. }
  25979. ,
  25980. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25981. var a = this.renderer
  25982. , s = a.context
  25983. , l = a.state
  25984. , c = a.properties.get(t);
  25985. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25986. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25987. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25988. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25989. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25990. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25991. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25992. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25993. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25994. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25995. l.bindTexture(s.TEXTURE_2D, null)
  25996. }
  25997. ,
  25998. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  25999. var s = this.renderer
  26000. , l = s.context
  26001. , c = s.state
  26002. , h = s.properties.get(t);
  26003. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  26004. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  26005. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  26006. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  26007. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  26008. }
  26009. ,
  26010. n.prototype.rebuildMipMaps2D = function(e) {
  26011. var t = this.renderer
  26012. , i = t.context
  26013. , n = t.state;
  26014. t.properties.get(e);
  26015. i.generateMipmap(i.TEXTURE_2D),
  26016. n.bindTexture(i.TEXTURE_2D, null)
  26017. }
  26018. ,
  26019. n.prototype.rebuildMipMaps3D = function(e) {
  26020. var t = this.renderer
  26021. , i = t.context
  26022. , n = t.state
  26023. , r = t.properties.get(e);
  26024. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  26025. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  26026. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  26027. }
  26028. ,
  26029. n.prototype.renderToCubeMap = function() {
  26030. var e = !1
  26031. , t = null
  26032. , i = null
  26033. , n = null
  26034. , a = null
  26035. , s = null
  26036. , l = 1;
  26037. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  26038. var _ = this.renderer;
  26039. _.context;
  26040. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  26041. i.position.z = 150,
  26042. t = new r.Scene,
  26043. t.add(i),
  26044. n = new r.ShaderMaterial({
  26045. uniforms: {
  26046. tDiffuse: {
  26047. type: "t",
  26048. value: null
  26049. },
  26050. alpha: {
  26051. type: "f",
  26052. value: 1
  26053. }
  26054. },
  26055. vertexShader: o.basicTextured.vertexShader,
  26056. fragmentShader: o.basicTextured.fragmentShader,
  26057. depthWrite: !1,
  26058. depthTest: !1,
  26059. side: r.DoubleSide
  26060. }),
  26061. a = new r.PlaneBufferGeometry(l,l),
  26062. s = new r.Mesh(a,n),
  26063. s.position.z = 0,
  26064. t.add(s),
  26065. e = !0);
  26066. var T = a.getAttribute("uv");
  26067. T.setDynamic(!0),
  26068. T.needsUpdate = !0;
  26069. var x = T.array
  26070. , S = p / u
  26071. , M = f / d
  26072. , R = g / u
  26073. , P = m / d;
  26074. x[0] = S,
  26075. x[1] = M + P,
  26076. x[2] = S + R,
  26077. x[3] = M + P,
  26078. x[4] = S,
  26079. x[5] = M,
  26080. x[6] = S + R,
  26081. x[7] = M;
  26082. var O = a.getAttribute("position");
  26083. O.setDynamic(!0),
  26084. O.needsUpdate = !0;
  26085. var L = O.array
  26086. , D = v / h.width - l / 2
  26087. , N = A / h.height - l / 2
  26088. , B = y / h.width
  26089. , F = C / h.height;
  26090. L[0] = D,
  26091. L[1] = N + F,
  26092. L[3] = D + B,
  26093. L[4] = N + F,
  26094. L[6] = D,
  26095. L[7] = N,
  26096. L[9] = D + B,
  26097. L[10] = N;
  26098. this.renderer.properties.get(c);
  26099. n.uniforms.tDiffuse.value = c,
  26100. n.blending = E || r.NoBlending,
  26101. n.transparent = !!b,
  26102. void 0 !== w && null !== w || (w = 1),
  26103. n.uniforms.alpha.value = w,
  26104. n.needUpdate = !0,
  26105. h.activeCubeFace = I,
  26106. h.viewport.set(0, 0, h.width, h.height);
  26107. var V = this.renderer.autoClear;
  26108. this.renderer.autoClear = !1,
  26109. this.renderer.render(t, i, h, !1),
  26110. this.renderer.autoClear = V
  26111. }
  26112. }(),
  26113. n.prototype.copyCubeMap = function() {
  26114. var e = !1
  26115. , t = null
  26116. , i = null
  26117. , a = null
  26118. , s = null
  26119. , l = null
  26120. , c = new r.Euler;
  26121. new r.Vector3;
  26122. return function(h, u, d, p, f, g, m, v, A) {
  26123. this.renderer;
  26124. if (!e) {
  26125. var y = 2;
  26126. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  26127. i.position.set(0, 0, 0),
  26128. t = new r.Scene,
  26129. t.add(i),
  26130. a = new r.ShaderMaterial({
  26131. uniforms: {
  26132. tDiffuse: {
  26133. type: "t",
  26134. value: null
  26135. },
  26136. alpha: {
  26137. type: "f",
  26138. value: 1
  26139. }
  26140. },
  26141. vertexShader: o.copyCubeMap.vertexShader,
  26142. fragmentShader: o.copyCubeMap.fragmentShader,
  26143. depthWrite: !1,
  26144. depthTest: !1,
  26145. side: r.DoubleSide
  26146. }),
  26147. s = new r.BoxGeometry(y,y,y),
  26148. l = new r.Mesh(s,a),
  26149. t.add(l),
  26150. e = !0
  26151. }
  26152. for (var C = 0; C < 6; C++)
  26153. n.getCubeOrientationForCubeFace(C, c),
  26154. l.rotation.copy(c),
  26155. l.matrixWorldNeedsUpdate = !0,
  26156. l.updateMatrixWorld(),
  26157. a.uniforms.tDiffuse.value = h,
  26158. a.blending = m || r.NoBlending,
  26159. a.transparent = !!v,
  26160. void 0 !== A && null !== A || (A = 1),
  26161. a.uniforms.alpha.value = A,
  26162. a.needUpdate = !0,
  26163. u.activeCubeFace = C,
  26164. u.viewport.set(0, 0, f, g),
  26165. this.renderer.render(t, i, u, !1)
  26166. }
  26167. }(),
  26168. n.getLookAtForCubeFace = function(e, t) {
  26169. switch (e) {
  26170. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26171. t.set(1, 0, 0);
  26172. break;
  26173. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26174. t.set(-1, 0, 0);
  26175. break;
  26176. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26177. t.set(0, 1, 0);
  26178. break;
  26179. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26180. t.set(0, -1, 0);
  26181. break;
  26182. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26183. t.set(0, 0, 1);
  26184. break;
  26185. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26186. t.set(0, 0, -1)
  26187. }
  26188. }
  26189. ,
  26190. n.getCubeOrientationForCubeFace = function(e, t) {
  26191. switch (e) {
  26192. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26193. t.set(0, -Math.PI / 2, 0);
  26194. break;
  26195. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26196. t.set(0, Math.PI / 2, 0);
  26197. break;
  26198. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26199. t.set(Math.PI / 2, Math.PI, 0);
  26200. break;
  26201. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26202. t.set(-Math.PI / 2, Math.PI, 0);
  26203. break;
  26204. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26205. t.set(0, -Math.PI, 0);
  26206. break;
  26207. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26208. t.set(0, 0, 0)
  26209. }
  26210. }
  26211. ,
  26212. t.exports = n
  26213. }
  26214. , {
  26215. "../enum/GLCubeFaces": 25,
  26216. "../enum/GLTextureType": 26,
  26217. "../enum/SceneRendererEvents": 43,
  26218. "../exception/BasicException": 55,
  26219. "../exception/RendererCreationException": 57,
  26220. "../settings": 166,
  26221. "../shaders": 167,
  26222. events: 202,
  26223. three: 217
  26224. }],
  26225. 159: [function(e, t, i) {//"./ApiHost"
  26226. "use strict";
  26227. function n(e) {
  26228. this.messenger = new a(e),
  26229. this.clientKey = null
  26230. }
  26231. var r = e("../util/ajax")
  26232. , o = e("./PostMessageType")
  26233. , a = e("./postmessage")
  26234. , s = e("./VersionInfo")
  26235. , l = e("events").EventEmitter
  26236. , c = window.location.origin + "/api/v1/user/";
  26237. n.prototype = Object.create(l.prototype),
  26238. n.prototype.bindEvents = function() {
  26239. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  26240. }
  26241. ,
  26242. n.prototype.waitForConnection = function() {
  26243. var e = new Promise(function(e, t) {
  26244. this.messenger.on(o.CONNECT, function(i) {
  26245. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  26246. }
  26247. .bind(this))
  26248. }
  26249. .bind(this));
  26250. return e
  26251. }
  26252. ,
  26253. n.prototype.onConnectionReceived = function(e) {
  26254. return this.messenger.setTarget(e.source, e.origin),
  26255. this.verifyConnection(e).then(function(t, i) {
  26256. this.messenger.send({
  26257. type: o.ACCEPT,
  26258. toId: e.fromId,
  26259. warning: i
  26260. }),
  26261. this.clientKey = t,
  26262. this.messenger.removeAllListeners(o.CONNECT),
  26263. this.bindEvents()
  26264. }
  26265. .bind(this), function(t) {
  26266. this.messenger.send({
  26267. type: o.REJECT,
  26268. toId: e.fromId,
  26269. reason: t
  26270. }),
  26271. this.messenger.setTarget()
  26272. }
  26273. .bind(this))
  26274. }
  26275. ,
  26276. n.prototype.verifyConnection = function(e) {
  26277. return new Promise(function(t, i) {
  26278. var n;
  26279. if (s.isDeprecated(e.sdkVersion))
  26280. n = "This version of the SDK is being deprecated. Please see http://www.port.com for more info";
  26281. else if (!s.isSupported(e.sdkVersion))
  26282. return i("This version of the SDK isn't supported. Get the latest version here: http://www.port.com");
  26283. var o = {
  26284. cache: !1,
  26285. headers: {
  26286. "X-port-Application-Key": e.applicationKey,
  26287. "X-port-Referrer": e.origin
  26288. }
  26289. };
  26290. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  26291. }
  26292. )
  26293. }
  26294. ,
  26295. n.prototype.onMessageReceived = function(e) {
  26296. if (this.validateClientApplicationKey(e.applicationKey)) {
  26297. var t = this;
  26298. e.onDone = function(i) {
  26299. i.toId = e.fromId,
  26300. i.uid = e.uid,
  26301. i.type = o.RESPONSE,
  26302. t.messenger.send(i)
  26303. }
  26304. ,
  26305. this.emit(o.ACTION, e)
  26306. }
  26307. }
  26308. ,
  26309. n.prototype.validateClientApplicationKey = function(e) {
  26310. return this.clientKey === e
  26311. }
  26312. ,
  26313. n.prototype.sendEvent = function(e, t) {
  26314. this.messenger.send({
  26315. type: o.EVENT,
  26316. eventType: e,
  26317. eventData: t
  26318. })
  26319. }
  26320. ,
  26321. t.exports = n
  26322. }
  26323. , {
  26324. "../util/ajax": 181,
  26325. "./PostMessageType": 160,
  26326. "./VersionInfo": 163,
  26327. "./postmessage": 165,
  26328. events: 202
  26329. }],
  26330. 160: [function(e, t, i) {//"./PostMessageType"
  26331. "use strict";
  26332. t.exports = Object.freeze({
  26333. CONNECT: "postmessage.connect",
  26334. ACCEPT: "postmessage.accept",
  26335. REJECT: "postmessage.reject",
  26336. ACTION: "postmessage.action",
  26337. RESPONSE: "postmessage.response",
  26338. EVENT: "postmessage.event"
  26339. })
  26340. }
  26341. , {}],
  26342. 161: [function(e, t, i) {//"../sdk/SdkEvents"
  26343. "use strict";
  26344. t.exports = Object.freeze({
  26345. MOVE: "sdk.move",
  26346. ENTER_PANO: "sdk.enterpano",
  26347. MODEL_LOADED: "sdk.modelloaded"
  26348. })
  26349. }
  26350. , {}],
  26351. 162: [function(e, t, i) {//"./TransitionStyles"
  26352. "use strict";
  26353. t.exports = Object.freeze({
  26354. FLY: "transition.fly",
  26355. FADEOUT: "transition.fade",
  26356. INSTANT: "transition.instant"
  26357. })
  26358. }
  26359. , {}],
  26360. 163: [function(e, t, i) {//"./VersionInfo"
  26361. "use strict";
  26362. t.exports = {
  26363. current: "1.0",
  26364. supported: ["1.0"],
  26365. deprecated: [],
  26366. isSupported: function(e) {
  26367. return this.supported.indexOf(e) !== -1
  26368. },
  26369. isDeprecated: function(e) {
  26370. return this.deprecated.indexOf(e) !== -1
  26371. },
  26372. isValid: function(e) {
  26373. return this.isSupported(e) || this.isDeprecated(e)
  26374. }
  26375. }
  26376. }
  26377. , {}],
  26378. 164: [function(e, t, i) {///js/sdk/automation.js
  26379. (function(i) {
  26380. "use strict";
  26381. function n(e, t, i) {
  26382. e && (e = e.toLowerCase().trim());
  26383. var n = new I.UP.clone
  26384. , r = Math.PI / 3
  26385. , o = Math.PI / 2;
  26386. switch (e) {
  26387. case "left":
  26388. i.copy(t),
  26389. i.applyAxisAngle(n, o);
  26390. break;
  26391. case "right":
  26392. i.copy(t),
  26393. i.applyAxisAngle(n, -o);
  26394. break;
  26395. case "forwardleft":
  26396. i.copy(t),
  26397. i.applyAxisAngle(n, r);
  26398. break;
  26399. case "forwardright":
  26400. i.copy(t),
  26401. i.applyAxisAngle(n, -r);
  26402. break;
  26403. case "forward":
  26404. default:
  26405. i.copy(t)
  26406. }
  26407. return i
  26408. }
  26409. function r(e, t) {
  26410. if (e) {
  26411. var i = {
  26412. pano: e,
  26413. lookAtPoint: null,
  26414. duration: null,
  26415. maxDistanceOverride: null,
  26416. skipWarpingCheck: !1
  26417. };
  26418. this.player.flyToPano(i, function() {
  26419. t && t({
  26420. success: !0,
  26421. message: "Transition complete."
  26422. })
  26423. })
  26424. } else
  26425. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  26426. t && t({
  26427. success: !1,
  26428. error: "Unable to find pano."
  26429. })
  26430. }
  26431. function o(e, t) {
  26432. var i = this.findRankedPano(e, t);
  26433. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  26434. null)
  26435. }
  26436. function a(e, t) {
  26437. var i = this.findRankedtag(e, t);
  26438. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  26439. null)
  26440. }
  26441. function s(e, t) {
  26442. t.copy(I.FORWARD),
  26443. e.getDirection(t)
  26444. }
  26445. function l(e) {
  26446. function t(e) {
  26447. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  26448. return {
  26449. x: c.Math.radToDeg(t._x),
  26450. y: c.Math.radToDeg(t._y),
  26451. z: c.Math.radToDeg(t._z)
  26452. }
  26453. }
  26454. var i = function(e) {
  26455. return e.alignmentType !== m.ALIGNED ? null : {
  26456. x: e.position.x,
  26457. y: e.position.y,
  26458. z: e.position.z
  26459. }
  26460. };
  26461. return {
  26462. panos: e.panos.list.map(function(n) {
  26463. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  26464. return {
  26465. uuid: n.id,
  26466. aligned: n.alignmentType === m.ALIGNED,
  26467. neighbourUUIDs: n.neighbourUUIDs.slice(),
  26468. position: i(n),
  26469. rotation: t(n),
  26470. thumbnail: r
  26471. }
  26472. })
  26473. }
  26474. }
  26475. var c = e("three")
  26476. , h = e("./ApiHost")
  26477. , u = e("../util/logger")
  26478. , d = e("../util/common")
  26479. , p = e("../util/math")
  26480. , f = e("../enum/ModelManagerEvents")
  26481. , g = e("./PostMessageType")
  26482. , m = e("../enum/AlignmentType")
  26483. , v = e("../enum/Direction")
  26484. , A = e("./TransitionStyles")
  26485. , y = e("../util/panorama")
  26486. , C = e("../enum/GLCubeFaces")
  26487. , I = e("../enum/Vectors")
  26488. , E = e("../enum/Viewmode")
  26489. , b = e("../enum/WarpStyle")
  26490. , w = (e("../enum/Keys"),
  26491. e("../enum/PlayerEvents"))
  26492. , _ = e("../sdk/SdkEvents")
  26493. , I = e("../enum/Vectors")
  26494. , T = e("../enum/ControlEvents")
  26495. , x = e("../enum/RenderLayers")
  26496. , S = (e("../constants"),
  26497. e("../settings"))
  26498. , M = e("../lib/jpeg_encoder")
  26499. , R = new u(i)
  26500. , P = function() {
  26501. var e = function e() {
  26502. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26503. e.player.getDirection(e.playerDirection),
  26504. e.projectVectors();
  26505. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  26506. if (e.angleTravelled += Math.abs(t),
  26507. e.angleTravelled >= Math.abs(e.angle)) {
  26508. if (e.active = !1,
  26509. e.onDone) {
  26510. var i = e.onDone;
  26511. i()
  26512. }
  26513. } else
  26514. e.lastFacingDirection.copy(e.playerDirection),
  26515. window.setTimeout(e, 4)
  26516. };
  26517. return e.active = !1,
  26518. e.angle = 0,
  26519. e.angleTravelled = 0,
  26520. e.playerDirection = new c.Vector3,
  26521. e.lastFacingDirection = new c.Vector3,
  26522. e.onDone = null,
  26523. e.player = null,
  26524. e.start = function(t, i, n, r) {
  26525. e.active = !0,
  26526. t && i && (i = 0),
  26527. e.angle = t || i,
  26528. e.xAngle = t,
  26529. e.yAngle = i,
  26530. e.angleTravelled = 0,
  26531. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26532. n.getDirection(e.playerDirection),
  26533. e.lastFacingDirection.copy(e.playerDirection),
  26534. e.projectVectors(),
  26535. e.onDone = r,
  26536. e.player = n,
  26537. e()
  26538. }
  26539. ,
  26540. e.projectVectors = function() {
  26541. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  26542. e.lastFacingDirection.projectOnPlane(I.UP))
  26543. }
  26544. ,
  26545. e
  26546. }()
  26547. , O = function() {
  26548. var e = new c.Vector3;
  26549. return function(t) {
  26550. t ? (e.copy(t.position),
  26551. e.add(t.discPosition),
  26552. p.projectPositionToCanvas(e, this.player.camera, e),
  26553. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  26554. }
  26555. }()
  26556. , L = function() {
  26557. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  26558. }
  26559. , D = function() {
  26560. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  26561. }
  26562. , N = function(e) {
  26563. var t = new c.Vector3;
  26564. return function(e) {
  26565. var i = this.player.getDirection();
  26566. t.copy(i);
  26567. var n = t.y;
  26568. t.y = 0,
  26569. t.normalize();
  26570. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  26571. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  26572. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  26573. 0;
  26574. this.player.mode === E.DOLLHOUSE && (r = -r);
  26575. var o = L.call(this) - .1
  26576. , a = D.call(this) + .1
  26577. , s = r + e;
  26578. s > o ? s = o : s < a && (s = a);
  26579. var l = s - r;
  26580. return e > 0 && l < .01 && (l = 0),
  26581. e < 0 && l > -.01 && (l = 0),
  26582. l
  26583. }
  26584. }()
  26585. , B = function() {
  26586. var e = new c.Euler;
  26587. return function(t) {
  26588. return e.setFromQuaternion(t.quaternion, "YXZ"),
  26589. {
  26590. position: {
  26591. x: t.position.x,
  26592. y: t.position.y,
  26593. z: t.position.z
  26594. },
  26595. rotation: {
  26596. x: c.Math.radToDeg(e.x),
  26597. y: c.Math.radToDeg(e.y),
  26598. z: 0
  26599. },
  26600. pano: t.currentPano ? t.currentPano.id : null,
  26601. mode: t.mode
  26602. }
  26603. }
  26604. }()
  26605. , F = null;
  26606. t.exports = {
  26607. init: function(e, t, i, n, r) {
  26608. V.init(e, t, i, r),
  26609. F = new Promise(function(e, t) {
  26610. i.on(w.Ready, function() {
  26611. e()
  26612. })
  26613. }
  26614. .bind(this));
  26615. var o = new h(window)
  26616. , a = o.waitForConnection();
  26617. a.then(function(e) {
  26618. o.on(g.ACTION, V.onMessageReceive.bind(V))
  26619. });
  26620. var s = function() {
  26621. var e = Date.now();
  26622. return function() {
  26623. if (!(Date.now() - e < 100)) {
  26624. var t = B(i);
  26625. o.sendEvent(_.MOVE, {
  26626. state: t
  26627. }),
  26628. e = Date.now()
  26629. }
  26630. }
  26631. }();
  26632. i.on(w.Move, s),
  26633. i.on(w.ViewChanged, s),
  26634. n.on(f.ActiveModelChanged, function(e) {
  26635. function t(e) {
  26636. var t, i = e.newPano.id;
  26637. e.oldPano && (t = e.oldPano.id),
  26638. i !== t && o.sendEvent(_.ENTER_PANO, {
  26639. oldPano: t,
  26640. newPano: i
  26641. })
  26642. }
  26643. var i = e.model
  26644. , n = e.oldModel;
  26645. V.model = i,
  26646. a.then(function() {
  26647. o.sendEvent(_.MODEL_LOADED, {
  26648. metadata: l(i)
  26649. })
  26650. }),
  26651. n && n.panos.forEach(function(e) {
  26652. e.removeEventListener("enter", t)
  26653. }),
  26654. i.panos.forEach(function(e) {
  26655. e.on("enter", t)
  26656. })
  26657. })
  26658. }
  26659. };
  26660. var V = {
  26661. director: null,
  26662. player: null,
  26663. controls: null,
  26664. sceneRenderer: null,
  26665. model: null,
  26666. init: function(e, t, i, n) {
  26667. this.director = e,
  26668. this.player = i,
  26669. this.controls = t,
  26670. this.sceneRenderer = n
  26671. },
  26672. handleToObject: {},
  26673. objectToHandle: {},
  26674. handleCount: 0,
  26675. onMessageReceive: function(e) {
  26676. if (e) {
  26677. var t = e.targetFunction
  26678. , i = e.params
  26679. , n = e.onDone;
  26680. t && this[t] && this[t](i, n)
  26681. }
  26682. },
  26683. waitForInit: function(e, t) {
  26684. F.then(t.bind({
  26685. success: !0,
  26686. message: "Init complete."
  26687. }))
  26688. },
  26689. moveToPano: function(e, t) {
  26690. var i = new c.Euler(0,0,0,"YXZ")
  26691. , n = new c.Quaternion;
  26692. return function(e, t) {
  26693. var r = e.pano
  26694. , o = e.rotation
  26695. , a = e.transition;
  26696. if (!this.model)
  26697. return t({
  26698. success: !1,
  26699. error: "The model has not been loaded yet"
  26700. });
  26701. var s = this.model.panos.get(r);
  26702. if (!s)
  26703. return t({
  26704. success: !1,
  26705. error: r + " does not exist in this model"
  26706. });
  26707. if (!o)
  26708. return t({
  26709. sucess: !1,
  26710. erorr: o + " is not a valid rotation"
  26711. });
  26712. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  26713. console.log(o.z);
  26714. var l = {
  26715. success: !0,
  26716. message: r
  26717. };
  26718. if (a === A.FADEOUT)
  26719. n.setFromEuler(i),
  26720. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  26721. else {
  26722. var h, u;
  26723. a === A.INSTANT && (h = 0,
  26724. u = 0);
  26725. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  26726. this.player.flyToPano({
  26727. pano: s,
  26728. lookAtPoint: d,
  26729. duration: h,
  26730. aimDuration: u
  26731. }, t.bind(this, l))
  26732. }
  26733. }
  26734. }(),
  26735. moveInDirection: function(e, t) {
  26736. var i = e.direction;
  26737. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  26738. void (t && t({
  26739. success: !1,
  26740. error: "Invalid direction."
  26741. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  26742. t(e ? {
  26743. success: !0,
  26744. message: "moved " + i
  26745. } : {
  26746. success: !1,
  26747. error: "Cannot move in direction: " + i
  26748. })
  26749. })
  26750. },
  26751. getPose: function(e, t) {
  26752. this.player.camera.position,
  26753. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  26754. return t({
  26755. success: !0,
  26756. message: B(this.player)
  26757. })
  26758. },
  26759. takeScreenShot: function() {
  26760. var e = new c.PerspectiveCamera
  26761. , t = new c.WebGLRenderTarget;
  26762. return function(i, n) {
  26763. if (!i.resolution)
  26764. return n({
  26765. success: !1,
  26766. error: "An invalid resolution was specified"
  26767. });
  26768. if (i.resolution.width === -1 || i.resolution.height === -1) {
  26769. var r = this.sceneRenderer.renderer.getSize();
  26770. i.resolution.width = r.width,
  26771. i.resolution.height = r.height
  26772. }
  26773. e.layers.set(x.DEFAULT),
  26774. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  26775. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  26776. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  26777. var o = i.resolution.width
  26778. , a = i.resolution.height
  26779. , s = o / a;
  26780. e.position.copy(this.sceneRenderer.camera.position),
  26781. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  26782. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  26783. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  26784. t.setSize(o, a),
  26785. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  26786. var l = new Uint8Array(o * a * 4);
  26787. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  26788. var c = M.encode({
  26789. data: l,
  26790. width: o,
  26791. height: a,
  26792. heading: 180,
  26793. pitch: 0
  26794. }, {
  26795. quality: 75,
  26796. flipY: !0
  26797. })
  26798. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  26799. n({
  26800. success: !0,
  26801. message: h
  26802. })
  26803. }
  26804. }(),
  26805. findRankedPano: function(e, t) {
  26806. var i = new c.Vector3
  26807. , r = new c.Vector3;
  26808. return function(e, t) {
  26809. s(this.player, r),
  26810. n(t, r, i);
  26811. var o = this.player.rankedPanoInDirection(e, i);
  26812. if (o) {
  26813. var a = this.objectToHandle[o.id];
  26814. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  26815. this.handleToObject[a] = o),
  26816. a
  26817. }
  26818. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  26819. -1
  26820. }
  26821. }(),
  26822. findRankedtag: function(e, t) {
  26823. var i = new c.Vector3
  26824. , r = new c.Vector3;
  26825. return function(e, t) {
  26826. s(this.player, r),
  26827. n(t, r, i);
  26828. var o = this.player.rankedtagInDirection(e, i);
  26829. if (o) {
  26830. var a = this.objectToHandle[o.sid];
  26831. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  26832. this.handleToObject[a] = o),
  26833. a
  26834. }
  26835. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  26836. -1
  26837. }
  26838. }(),
  26839. clickNearesttag: function(e) {
  26840. this.clickRankedtag(0, e)
  26841. },
  26842. clickRankedtag: function(e, t) {
  26843. var i = a.call(this, e, t);
  26844. i && O.call(this, i)
  26845. },
  26846. clickNearestPano: function(e, t) {
  26847. this.clickRankedPano(0, e, t)
  26848. },
  26849. clickRankedPano: function(e, t, i) {
  26850. var n = o.call(this, e, t);
  26851. n ? r.call(this, n, i) : i(null)
  26852. },
  26853. clickPano: function(e, t) {
  26854. var i = this.handleTable[e];
  26855. i ? r.call(this, i, t) : t(null)
  26856. },
  26857. rotateDirection: function() {
  26858. return function(e, t) {
  26859. var i = e.direction
  26860. , n = e.angle;
  26861. if (!P.active) {
  26862. var r = 0
  26863. , o = 0
  26864. , a = 0
  26865. , s = 0;
  26866. if (!n || isNaN(n))
  26867. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26868. void (t && t({
  26869. success: !1,
  26870. error: "Invalid rotation angle."
  26871. }));
  26872. if (this.player.mode === E.TRANSITIONING)
  26873. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26874. void (t && t({
  26875. success: !1,
  26876. error: "Cannot rotate while transitioning"
  26877. }));
  26878. if (i === v.RIGHT || i === v.LEFT)
  26879. i === v.RIGHT && (n = -n),
  26880. r = n > 0 ? -1 : 1,
  26881. a = n;
  26882. else {
  26883. if (i !== v.UP && i !== v.DOWN)
  26884. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26885. void (t && t({
  26886. success: !1,
  26887. error: "Invalid direction for rotation."
  26888. }));
  26889. if (this.player.mode === E.FLOORPLAN)
  26890. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26891. void (t && t({
  26892. success: !1,
  26893. error: "Cannot rotate " + i + " in floorplan mode"
  26894. }));
  26895. if (i === v.DOWN && (n = -n),
  26896. n = N.call(this, n),
  26897. 0 === n)
  26898. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26899. void (t && t({
  26900. success: !1,
  26901. error: "Already at maximum rotation in direction: " + i
  26902. }));
  26903. o = n > 0 ? 1 : -1,
  26904. s = n
  26905. }
  26906. var l = n;
  26907. n = c.Math.degToRad(n),
  26908. a = c.Math.degToRad(a),
  26909. s = c.Math.degToRad(s);
  26910. var h = this.controls.activeControl
  26911. , u = function() {
  26912. h.stopRotating(!0),
  26913. t && t({
  26914. success: !0,
  26915. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26916. })
  26917. };
  26918. h.startRotating(r, o),
  26919. P.start(a, s, this.player, u)
  26920. }
  26921. }
  26922. }(),
  26923. rotate: function() {
  26924. var e = new c.Vector3
  26925. , t = new c.Vector3;
  26926. return function(i, n) {
  26927. var r = i.xAngle
  26928. , o = i.yAngle;
  26929. if (!P.active) {
  26930. if (r = r || 0,
  26931. o = o || 0,
  26932. isNaN(r) || isNaN(o))
  26933. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26934. void (n && n({
  26935. success: !1,
  26936. error: "Invalid rotation angle."
  26937. }));
  26938. if (this.player.mode === E.TRANSITIONING)
  26939. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26940. void (n && n({
  26941. success: !1,
  26942. error: "Cannot rotate while transitioning"
  26943. }));
  26944. Math.abs(r) < .01 && (r = 0),
  26945. Math.abs(o) < .01 && (o = 0);
  26946. var a = o;
  26947. o = N.call(this, o),
  26948. r = -r;
  26949. var s = a > 0 ? "UP" : "DOWN";
  26950. if (!r && a && !o)
  26951. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26952. void (n && n({
  26953. success: !1,
  26954. error: "Already at maximum rotation in direction: " + s
  26955. }));
  26956. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26957. var l = o;
  26958. o = c.Math.degToRad(o),
  26959. r = c.Math.degToRad(r),
  26960. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26961. this.player.getDirection(e),
  26962. t.copy(e).applyAxisAngle(I.UP, r),
  26963. t.applyAxisAngle(I.RIGHT, o);
  26964. var h = (e.angleTo(t),
  26965. r > 0 ? -1 : r < 0 ? 1 : 0)
  26966. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26967. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26968. var d = this.controls.activeControl
  26969. , p = function() {
  26970. d.stopRotating(!0),
  26971. n && n({
  26972. success: !0,
  26973. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26974. })
  26975. };
  26976. d.startRotating(h, u),
  26977. P.start(r, o, this.player, p)
  26978. }
  26979. }
  26980. }(),
  26981. panCamera: function(e, t) {
  26982. function i(e) {
  26983. switch (r.removeAllListeners(T.AutoPanComplete),
  26984. r.removeAllListeners(T.AutoPanInterrupt),
  26985. r.removeAllListeners(T.AutoPanClamped),
  26986. e) {
  26987. case T.AutoPanInterrupt:
  26988. t({
  26989. success: !0,
  26990. message: "Camera panning interrupted."
  26991. });
  26992. break;
  26993. case T.AutoPanClamped:
  26994. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26995. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  26996. return void t({
  26997. success: !1,
  26998. error: "Already at edge of current model bounds."
  26999. });
  27000. var i = "The view point is outside the bounds for the current model. ";
  27001. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  27002. console.warn(i)
  27003. }
  27004. case T.AutoPanComplete:
  27005. t({
  27006. success: !0,
  27007. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  27008. })
  27009. }
  27010. }
  27011. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  27012. return t({
  27013. success: !1,
  27014. error: "Camera panning is not available in the current mode: " + this.player.mode
  27015. });
  27016. var n = e.position
  27017. , r = this.player.control;
  27018. r.setAutoPanPosition(n.x, n.z),
  27019. r.autoPan = !0;
  27020. var o = function(e, t) {
  27021. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  27022. };
  27023. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  27024. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  27025. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  27026. },
  27027. click: function(e, t) {
  27028. var i = e.x
  27029. , n = e.y
  27030. , r = e.percentage;
  27031. r === !0 && (i = i / 100 * $('#player').width(),
  27032. n = n / 100 * $('#player').height()),
  27033. this.player.handleInputStart(i, n),
  27034. this.player.updateIntersect(),
  27035. this.player.handleInputEnd(i, n)
  27036. },
  27037. mouseOver: function(e, t) {
  27038. var i = e.x
  27039. , n = e.y
  27040. , r = e.percentage;
  27041. r === !0 && (i = i / 100 * $('#player').width(),
  27042. n = n / 100 * $('#player').height()),
  27043. this.player.handleInputMove(i, n),
  27044. this.player.updateIntersect()
  27045. },
  27046. moveToMode: function(e, t) {
  27047. function i(e) {
  27048. t(e ? {
  27049. success: !1,
  27050. error: "Failed to load new mode: " + e
  27051. } : {
  27052. success: !0,
  27053. message: "Moved to new mode: " + n
  27054. })
  27055. }
  27056. var n = e.mode;
  27057. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  27058. i()
  27059. }, function(e) {
  27060. i(e)
  27061. }) : t({
  27062. success: !1,
  27063. error: "Invalid mode selection"
  27064. })
  27065. }
  27066. }
  27067. }
  27068. ).call(this, "/js/sdk/automation.js")
  27069. }
  27070. , {
  27071. "../constants": 8,
  27072. "../enum/AlignmentType": 17,
  27073. "../enum/ControlEvents": 21,
  27074. "../enum/Direction": 22,
  27075. "../enum/GLCubeFaces": 25,
  27076. "../enum/Keys": 30,
  27077. "../enum/ModelManagerEvents": 33,
  27078. "../enum/PlayerEvents": 40,
  27079. "../enum/RenderLayers": 41,
  27080. "../enum/Vectors": 50,
  27081. "../enum/Viewmode": 51,
  27082. "../enum/WarpStyle": 52,
  27083. "../lib/jpeg_encoder": 94,
  27084. "../sdk/SdkEvents": 161,
  27085. "../settings": 166,
  27086. "../util/common": 185,
  27087. "../util/logger": 189,
  27088. "../util/math": 190,
  27089. "../util/panorama": 191,
  27090. "./ApiHost": 159,
  27091. "./PostMessageType": 160,
  27092. "./TransitionStyles": 162,
  27093. three: 217
  27094. }],
  27095. 165: [function(e, t, i) {//"./postmessage"
  27096. "use strict";
  27097. function n(e) {
  27098. this.sourceWindow = e,
  27099. this.targetWindow = null,
  27100. this.targetOrigin = null,
  27101. this.id = Math.floor(1e5 * Math.random()),
  27102. this.bindEvents()
  27103. }
  27104. var r = e("./PostMessageType")
  27105. , o = e("events").EventEmitter;
  27106. n.prototype = Object.create(o.prototype),
  27107. n.prototype.bindEvents = function() {
  27108. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  27109. }
  27110. ,
  27111. n.prototype.setTarget = function(e, t) {
  27112. this.targetWindow = e,
  27113. this.targetOrigin = t
  27114. }
  27115. ,
  27116. n.prototype.onPostmessageReceived = function(e) {
  27117. var t = e.origin || e.originalEvent.origin
  27118. , i = e.source;
  27119. switch (e.data.type) {
  27120. case r.CONNECT:
  27121. break;
  27122. case r.RESPONSE:
  27123. if (this.id !== e.data.toId)
  27124. return;
  27125. default:
  27126. if (!this.validateMessageOrigin(t))
  27127. return
  27128. }
  27129. var n = e.data;
  27130. n.source = i,
  27131. n.origin = t,
  27132. n.timestamp = Date.now(),
  27133. this.emit(e.data.type, n)
  27134. }
  27135. ,
  27136. n.prototype.validateMessageOrigin = function(e) {
  27137. return "*" === this.targetOrigin || e === this.targetOrigin
  27138. }
  27139. ,
  27140. n.prototype.send = function(e) {
  27141. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  27142. this.targetWindow.postMessage(e, this.targetOrigin))
  27143. }
  27144. ,
  27145. t.exports = n
  27146. }
  27147. , {
  27148. "./PostMessageType": 160,
  27149. events: 202
  27150. }],
  27151. 166: [function(e, t, i) {//"./settings"
  27152. "use strict";
  27153. var n = e("three")
  27154. , r = e("./util/browser")
  27155. , o = e("./enum/Viewmode")
  27156. , a = e("./enum/VROption")
  27157. , s = e("./enum/Colors")
  27158. , l = e("./enum/WarpStyle")
  27159. , c = e("./util/easing")
  27160. , h = e("./util/common")
  27161. , u = e("./util/showcase")
  27162. , d = e("./constants")
  27163. , p = {
  27164. debug: window.location.href.substring(window.location.href.indexOf("?")+1).indexOf('debug')>-1, //xzw
  27165. version: "2.25.6-0-gd87e5b1",
  27166. languageTag: r.valueFromHash("lang", null),
  27167. pageTitle: "port 3D Showcase",
  27168. authorizationHeader: u.getAuthorizationHeader(),
  27169. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  27170. logLevel: r.valueFromHash("log", 2),
  27171. skyboxRadius: 2500,
  27172. modelBoundsPadding: 5,
  27173. showNeighbors: !1,
  27174. brand: r.valueFromHash("brand", !0),
  27175. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  27176. startHighlights: r.valueFromHash("hl", -1),
  27177. specialEdition: r.valueFromHash("bn", 0),
  27178. useWheel: r.valueFromHash("wh", !0),
  27179. crossOrigin: "anonymous",
  27180. fancierTransition: !1,
  27181. wireframe: !1,
  27182. skyboxWireframe: !1,
  27183. modelAlpha: 1,
  27184. highlightPanoSelection: !1,
  27185. showSweeps: !0,
  27186. showSkyboxes: !1,
  27187. showMesh: !0,
  27188. showFloors: !1,
  27189. showFloorDuration: 300,
  27190. showFloorDelay: 300,
  27191. hideFloorDuration: 300,
  27192. hideFloorDelay: 0,
  27193. reticuleOpacityTransitionTime: 250,
  27194. reticuleColor: s.newBlue,
  27195. markerOpacityTransitionTime: 500,
  27196. guiAnimationSpeed: 250,
  27197. highlightAnimationDuration: 500,
  27198. modelComponentLoadSpinnerDelay: 150,
  27199. captureErrors: !1,
  27200. maxMobileTextures: 6,
  27201. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  27202. startupFlyinDelay: 3e3,
  27203. dollhouseDefault: {
  27204. minDistance: 15,
  27205. maxDistance: 50,
  27206. minPolarAngle: n.Math.degToRad(10),
  27207. maxPolarAngle: n.Math.degToRad(90)
  27208. },
  27209. hideReticuleTimeout: 1e3,
  27210. analytics: {
  27211. inactivityThreshold: 30,
  27212. sessionTrackingRate: .15,
  27213. maxTrackedErrors: 20,
  27214. sessionDurationPingFrequency: 10,
  27215. sessionDurationTimeout: 15
  27216. },
  27217. flydown: {
  27218. movementEasing: "easeInOutQuad",
  27219. movementDelay: .001,
  27220. rotationEasing: "easeInOutQuad",
  27221. rotationDelay: .5,
  27222. modelTextureDelay: .75,
  27223. skyboxDelay: .75
  27224. },
  27225. transition: {
  27226. flySpeed: .01,
  27227. flyTime: 750,
  27228. flytimeMaxDistanceThreshold: 5,
  27229. flytimeDistanceMultiplier: 150,
  27230. aimTime: 1500,
  27231. aimSlowFactor: 1.5,
  27232. blur: .8,
  27233. movementEasing: "easeInOutQuad",
  27234. blendEasing: "easeInOutQuad",
  27235. fastForwardFactor: r.valueFromHash("mfis", 3)
  27236. },
  27237. show360Views: {
  27238. enabled: !0,
  27239. transitionTime: 1e3
  27240. },
  27241. quickstart: {
  27242. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  27243. animation: 1400,
  27244. showTextDelay: 500,
  27245. fadeOutDelay: 3e3,
  27246. fovChange: 10
  27247. },
  27248. appConfig: {
  27249. webvr_version: null,
  27250. segment_key: null,
  27251. embedly_key: null,
  27252. branch_key: null,
  27253. keen_write_key: null,
  27254. keen_project_id: null
  27255. },
  27256. vr: {
  27257. enabled: !0,
  27258. allowWebVR: !1,
  27259. option: r.valueFromHash("vr", a.CONTEXTUAL)
  27260. },
  27261. share: {
  27262. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  27263. },
  27264. input: {
  27265. longTapThreshold: 200,
  27266. moveToleranceNDC: .08,
  27267. touchMoveThreshold: 25
  27268. },
  27269. help: {
  27270. modalStayDuration: 600
  27271. },
  27272. immersive: {
  27273. timeToShowAgain: 1250,
  27274. uiStayDuration: 600
  27275. },
  27276. tourInteraction: {
  27277. disabled: "0" === r.valueFromHash("tourcta", null),
  27278. showPauseButton: 1e3,
  27279. showModal: 1500,
  27280. allowNextClick: 200,
  27281. largeModal: "1" === r.valueFromHash("tourcta", null),
  27282. smallModal: "2" === r.valueFromHash("tourcta", null)
  27283. },
  27284. labels: {
  27285. enabled: !1,
  27286. hideUntilStart: !0,
  27287. fadeInDuration: 250,
  27288. fadeInDelay: 250,
  27289. fadeOutDuration: 250,
  27290. fadeOutDelay: 0,
  27291. zoomHideThreshhold: {
  27292. mobile: r.isSmallScreen() ? .45 : .6,
  27293. desktop: 2
  27294. },
  27295. zoomTruncateThreshhold: {
  27296. mobile: r.isSmallScreen() ? .35 : .45,
  27297. desktop: .85
  27298. },
  27299. minLengthForTruncate: 16,
  27300. truncateLength: 12,
  27301. truncateSuffix: "..."
  27302. },
  27303. tags: {
  27304. enabled: r.valueFromHash("mt", 1),
  27305. startup: {
  27306. hideUntilStart: !0,
  27307. fadeInDuration: 500,
  27308. fadeInDelay: 100
  27309. },
  27310. visibility: {
  27311. anyDistance: !0,
  27312. visibleDistance: 8,
  27313. cameraClearance: .1,
  27314. alphaTestLevel: .05,
  27315. hideViaFloor: !0,
  27316. hideOffScreenDisc: !1,
  27317. hideOffScreenObject: !1
  27318. },
  27319. disc: {
  27320. opacity: 1,
  27321. disabledOpacity: .5,
  27322. scale: {
  27323. nearBound: 1.5,
  27324. farBound: 4.8,
  27325. linkFarBound: !1,
  27326. linkPercent: 40,
  27327. maxSize: 80,
  27328. minSize: 40,
  27329. baseViewportSize: 800,
  27330. responsiveness: 100
  27331. }
  27332. },
  27333. pole: {
  27334. enabled: !0,
  27335. height: .5,
  27336. width: 2,
  27337. opacity: .5,
  27338. color: "white"
  27339. },
  27340. navigate: {
  27341. nearestPano: !0,
  27342. lineOfSight: !0,
  27343. reactivate: !0,
  27344. aimAt: "disc",
  27345. tiltTolerance: 15, //xzw 改小点热点不容易超出屏幕
  27346. rotateSpeedFactor: .6
  27347. }
  27348. },
  27349. path: {
  27350. color: s.newBlue,
  27351. colorUp: s._desat(s.newBlue, .5),
  27352. colorDown: s._darken(s.newBlue, .35),
  27353. opacity: .5,
  27354. style: "ribbon",
  27355. height: .025,
  27356. ribbonWidth: .24,
  27357. outsideHeight: .5,
  27358. waypointRadius: .5,
  27359. waypointIndoorRadius: .24,
  27360. waypointPulse: 1e3,
  27361. typ: l.BLACK,
  27362. meshFree: r.valueFromHash("mf", 1),
  27363. mapGuides: r.valueFromHash("guides", !0),
  27364. fadeInTime: 400,
  27365. fadeOutTime: 300
  27366. },
  27367. warp: {
  27368. nearPanoDist: .1,
  27369. matchCam: !1,
  27370. blur: .33,
  27371. fastTime: 1500,
  27372. teleportTime: 1500,
  27373. outsideTime: 2e3,
  27374. lookAheadMax: .3,
  27375. lookAheadDist: 2.5,
  27376. softPushDist: .37,
  27377. softPushEnd: .3,
  27378. softBendAngle: 8,
  27379. softBendTilt: 4,
  27380. softBendEnd: .3,
  27381. doBurns: r.valueFromHash("kb", !0),
  27382. burnsAngle: 35,
  27383. minBurnsAngle: 35,
  27384. minDownAngle: -35,
  27385. maxTurnPerSec: 280,
  27386. maxAimPerSec: 35,
  27387. minRotation: 12,
  27388. maxAimRotation: 33.2,
  27389. turnFriction: .2,
  27390. flySpeed: .01,
  27391. minWarpTime: 1200,
  27392. warpInterruptionRedirectTime: 500,
  27393. tourStepDelay: r.valueFromHash("st", 0),
  27394. walkDelay: 0,
  27395. walkMaxDist: 50,
  27396. walkMinDist: .8,
  27397. walkSlideShowThreshhold: 3e3,
  27398. walkExtraPanosDistance: .4,
  27399. timePerMeter: 800,
  27400. motionLeadTime: 500,
  27401. movementEasing: "easeInOutQuad",
  27402. blendEasing: "easeInOutQuad",
  27403. showBunny: !1,
  27404. loop: r.valueFromHash("lp", !1),
  27405. auto: r.valueFromHash("ts", -1),
  27406. eOrder: "YXZ",
  27407. stepFactor: .25,
  27408. brakeStrength: 2,
  27409. minBrakeAngle: .1,
  27410. maxBrakeAngle: 1.8,
  27411. climbEffort: 4
  27412. },
  27413. rotationFriction: .05,
  27414. rotationAccelerationInside: 4.5,
  27415. rotationAccelerationOutside: .15,
  27416. rotationAfterMoveMultiplier: 40,
  27417. rotationAfterMoveHistoryCount: 5,
  27418. panFriction: .09,
  27419. panAccelerationOutside: 60,
  27420. onload: r.valueFromHash("onload", o.PANORAMA),
  27421. zoomNearLimit: .1,
  27422. zoomFarLimit: 10,
  27423. navigation: {
  27424. panoScores: !1,
  27425. mouseDirection: !0,
  27426. filterStrictness: .75,
  27427. angleFactor: -30,
  27428. directionFactor: 10,
  27429. distanceFactor: -1,
  27430. optionalityFactor: 3
  27431. },
  27432. sdkInit: !1,
  27433. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  27434. console: r.valueFromHash("console", !1),
  27435. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  27436. panoramaNeighbourMaxDistance: 5,
  27437. panoFloorClickRadius: .35,
  27438. showScreenshotLocations: !1,
  27439. showAxis: !1,
  27440. showNeighbourRaycasts: !1,
  27441. colorMarkerOnLoad: !1,
  27442. colorMarkerByFloor: !1,
  27443. tiling: {
  27444. panoPreRenderRepeatDelay: 2500,
  27445. panoPreRenderDelay: 500,
  27446. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  27447. tilingFlagNames: ["usetiles", "tiles"],
  27448. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  27449. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  27450. overlayStyle: r.valueFromHash("tileoverlay", 0),
  27451. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  27452. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  27453. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  27454. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  27455. customCompression: r.valueFromHash("tilecustcomp", 0),
  27456. mobileHighQualityOverride: !1,
  27457. allowUltraHighResolution: !1
  27458. },
  27459. zoom: {
  27460. enabled: !1,
  27461. forceOff: r.valueFromHash("nozoom", 0),
  27462. overridemax: r.valueFromHash("maxzoom", null),
  27463. overridemin: r.valueFromHash("minzoom", null),
  27464. max: d.highQualityMaxZoom,
  27465. min: 1,
  27466. transitionStyle: r.valueFromHash("zoomtrans", 1),
  27467. activationThreshold: 1.1,
  27468. restoreTime: 500
  27469. },
  27470. profiling: {
  27471. enabled: r.valueFromHash("mem", !1)
  27472. }
  27473. };
  27474. p = h.deepExtend(p, d, {
  27475. insideFOV: r.valueFromHash("fov", d.insideFOV),
  27476. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  27477. panorama: {
  27478. transitionTime: 1e3,
  27479. modelAlpha: 0,
  27480. modelAlphaDelay: p.flydown.modelTextureDelay,
  27481. modelAlphaLength: 1,
  27482. skyboxOpacity: 1,
  27483. skyboxOpacityDelay: p.flydown.skyboxDelay,
  27484. skyboxOpacityLength: .9,
  27485. fovLength: 1,
  27486. fovDelay: 0,
  27487. cameraMatrixDuration: .8,
  27488. cameraMatrixDelay: 0,
  27489. cameraMatrixEase: c.easeInCubic,
  27490. reticuleOpacity: 1,
  27491. markerOpacity: .3,
  27492. markerOpacityOnHover: 1
  27493. },
  27494. dollhouse: {
  27495. transitionTime: 1e3,
  27496. modelAlpha: 1,
  27497. modelAlphaDelay: 0,
  27498. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  27499. skyboxOpacity: 0,
  27500. skyboxOpacityDelay: 0,
  27501. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  27502. fovLength: 1,
  27503. fovDelay: 0,
  27504. cameraMatrixDuration: .8,
  27505. cameraMatrixDelay: .3,
  27506. cameraMatrixEase: c.easeInCubic,
  27507. reticuleOpacity: 1,
  27508. markerOpacity: 0,
  27509. markerOpacityOnHover: 0
  27510. },
  27511. floorplan: {
  27512. transitionTime: 1e3,
  27513. modelAlpha: 1,
  27514. modelAlphaDelay: 0,
  27515. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  27516. skyboxOpacity: 0,
  27517. skyboxOpacityDelay: 0,
  27518. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  27519. fovLength: 1,
  27520. fovDelay: 0,
  27521. cameraMatrixDuration: .5,
  27522. cameraMatrixDelay: 0,
  27523. cameraMatrixEase: c.easeOutCubic,
  27524. reticuleOpacity: 1,
  27525. markerOpacity: 0,
  27526. markerOpacityOnHover: 0,
  27527. cameraHeight: 50
  27528. },
  27529. transitioning: {
  27530. reticuleOpacity: 0,
  27531. markerOpacity: .3,
  27532. markerOpacityOnHover: 1
  27533. },
  27534. "floorplan-dollhouse": {
  27535. rotationDelay: 0,
  27536. rotationDuration: 1
  27537. },
  27538. "floorplan-panorama": {
  27539. rotationDelay: .5,
  27540. rotationDuration: 1
  27541. },
  27542. "dollhouse-panorama": {
  27543. rotationDelay: .5,
  27544. rotationDuration: 1
  27545. },
  27546. "dollhouse-floorplan": {
  27547. rotationDelay: 0,
  27548. rotationDuration: 1,
  27549. cameraMatrixDuration: 1.05,
  27550. cameraMatrixDelay: .5
  27551. },
  27552. "panorama-dollhouse": {
  27553. rotationDelay: 0,
  27554. rotationDuration: .5
  27555. },
  27556. "panorama-floorplan": {
  27557. transitionTime: 1500,
  27558. rotationDelay: 0,
  27559. rotationDuration: .5
  27560. }
  27561. }),
  27562. p.path.meshFree && (p.path.typ = l.WALK),
  27563. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  27564. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  27565. t.exports = p
  27566. }
  27567. , {
  27568. "./constants": 8,
  27569. "./enum/Colors": 19,
  27570. "./enum/VROption": 47,
  27571. "./enum/Viewmode": 51,
  27572. "./enum/WarpStyle": 52,
  27573. "./util/browser": 182,
  27574. "./util/common": 185,
  27575. "./util/easing": 186,
  27576. "./util/showcase": 193,
  27577. three: 217
  27578. }],
  27579. 167: [function(e, t, i) {//"../shaders"
  27580. "use strict";
  27581. var n = e("three")
  27582. , r = e("./settings")
  27583. , 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"
  27584. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  27585. t.exports = {
  27586. basicTextured: {
  27587. uniforms: {
  27588. tDiffuse: {
  27589. type: "t",
  27590. value: null
  27591. },
  27592. alpha: {
  27593. type: "f",
  27594. value: 1
  27595. }
  27596. },
  27597. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27598. 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}"
  27599. },
  27600. copyCubeMap: {
  27601. uniforms: {
  27602. tDiffuse: {
  27603. type: "t",
  27604. value: null
  27605. },
  27606. alpha: {
  27607. type: "f",
  27608. value: 1
  27609. }
  27610. },
  27611. 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}",
  27612. 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}"
  27613. },
  27614. cube: {
  27615. uniforms: {
  27616. map: {
  27617. type: "t",
  27618. value: null
  27619. },
  27620. opacity: {
  27621. type: "f",
  27622. value: 1
  27623. }
  27624. },
  27625. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  27626. 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"
  27627. },
  27628. model: {
  27629. uniforms: {
  27630. map: {
  27631. type: "t",
  27632. value: null
  27633. },
  27634. modelAlpha: {
  27635. type: "f",
  27636. value: r.modelAlpha
  27637. },
  27638. opacity: {
  27639. type: "f",
  27640. value: 1
  27641. },
  27642. progress: {
  27643. type: "f",
  27644. value: 0
  27645. },
  27646. blackout: {
  27647. type: "i",
  27648. value: 0
  27649. },
  27650. pano0Map: {
  27651. type: "t",
  27652. value: null
  27653. },
  27654. pano0Position: {
  27655. type: "v3",
  27656. value: new n.Vector3
  27657. },
  27658. pano0Matrix: {
  27659. type: "m4",
  27660. value: new n.Matrix4
  27661. },
  27662. pano1Map: {
  27663. type: "t",
  27664. value: null
  27665. },
  27666. pano1Position: {
  27667. type: "v3",
  27668. value: new n.Vector3
  27669. },
  27670. pano1Matrix: {
  27671. type: "m4",
  27672. value: new n.Matrix4
  27673. }
  27674. },
  27675. 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",
  27676. 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"
  27677. },
  27678. floorLogo: {//改
  27679. uniforms: {
  27680. map: {
  27681. type: "t",
  27682. value: null
  27683. },
  27684. opacity:{
  27685. type:"f",
  27686. value: 0
  27687. },
  27688. opaRadius:{//百分比
  27689. type:"f",
  27690. value: 0.2
  27691. }
  27692. },
  27693. vertexShader: "varying vec2 vUv;void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );}",
  27694. 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) );}"
  27695. },
  27696. modelOutside: {
  27697. uniforms: {
  27698. map: {
  27699. type: "t",
  27700. value: null
  27701. },
  27702. opacity: {
  27703. type: "f",
  27704. value: 1
  27705. }
  27706. },
  27707. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27708. 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"
  27709. },
  27710. ribbon: {
  27711. uniforms: {
  27712. map: {
  27713. type: "t",
  27714. value: null
  27715. },
  27716. opacity: {
  27717. type: "f",
  27718. value: 1
  27719. },
  27720. color: {
  27721. type: "c",
  27722. value: new n.Color(r.path.color)
  27723. }
  27724. },
  27725. 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",
  27726. 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"
  27727. },
  27728. waypoint: {
  27729. uniforms: {
  27730. map: {
  27731. type: "t",
  27732. value: null
  27733. },
  27734. opacity: {
  27735. type: "f",
  27736. value: 1
  27737. },
  27738. pulse: {
  27739. type: "f",
  27740. value: 1
  27741. },
  27742. nearFade: {
  27743. type: "v2",
  27744. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  27745. },
  27746. color: {
  27747. type: "c",
  27748. value: new n.Color(r.reticuleColor)
  27749. }
  27750. },
  27751. 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",
  27752. 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"
  27753. },
  27754. modelDebug: {
  27755. uniforms: {
  27756. map: {
  27757. type: "t",
  27758. value: null
  27759. },
  27760. modelAlpha: {
  27761. type: "f",
  27762. value: r.modelAlpha
  27763. },
  27764. depthmapRatio: {
  27765. type: "f",
  27766. value: 0
  27767. },
  27768. opacity: {
  27769. type: "f",
  27770. value: 1
  27771. },
  27772. progress: {
  27773. type: "f",
  27774. value: 0
  27775. },
  27776. considerOcclusion: {
  27777. type: "i",
  27778. value: r.fancierTransition
  27779. },
  27780. highlightPanoSelection: {
  27781. type: "i",
  27782. value: 0
  27783. },
  27784. useThirdPano: {
  27785. type: "i",
  27786. value: r.useThirdPano
  27787. },
  27788. pano0Map: {
  27789. type: "t",
  27790. value: null
  27791. },
  27792. pano0Depth: {
  27793. type: "t",
  27794. value: null
  27795. },
  27796. pano0Position: {
  27797. type: "v3",
  27798. value: new n.Vector3
  27799. },
  27800. pano0Matrix: {
  27801. type: "m4",
  27802. value: new n.Matrix4
  27803. },
  27804. pano0Weight: {
  27805. type: "f",
  27806. value: r.transition.pano0Weight
  27807. },
  27808. pano1Map: {
  27809. type: "t",
  27810. value: null
  27811. },
  27812. pano1Depth: {
  27813. type: "t",
  27814. value: null
  27815. },
  27816. pano1Position: {
  27817. type: "v3",
  27818. value: new n.Vector3
  27819. },
  27820. pano1Matrix: {
  27821. type: "m4",
  27822. value: new n.Matrix4
  27823. },
  27824. pano1Weight: {
  27825. type: "f",
  27826. value: r.transition.pano1Weight
  27827. },
  27828. pano2Map: {
  27829. type: "t",
  27830. value: null
  27831. },
  27832. pano2Depth: {
  27833. type: "t",
  27834. value: null
  27835. },
  27836. pano2Position: {
  27837. type: "v3",
  27838. value: new n.Vector3
  27839. },
  27840. pano2Matrix: {
  27841. type: "m4",
  27842. value: new n.Matrix4
  27843. },
  27844. pano2Weight: {
  27845. type: "f",
  27846. value: r.transition.pano2Weight
  27847. }
  27848. },
  27849. 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",
  27850. 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"
  27851. },
  27852. customDepth: {
  27853. uniforms: {
  27854. panoPosition: {
  27855. type: "v3",
  27856. value: new n.Vector3
  27857. }
  27858. },
  27859. 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",
  27860. 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"
  27861. },
  27862. skysphere: {
  27863. uniforms: {
  27864. radius: {
  27865. type: "f",
  27866. value: 0
  27867. }
  27868. },
  27869. 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",
  27870. 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"
  27871. },
  27872. tagDisc: {
  27873. uniforms: {
  27874. opacity: {
  27875. type: "f",
  27876. value: 1
  27877. },
  27878. color: {
  27879. type: "c",
  27880. value: new n.Color
  27881. },
  27882. bg: {
  27883. type: "t",
  27884. value: null
  27885. },
  27886. mask: {
  27887. type: "t",
  27888. value: null
  27889. }
  27890. },
  27891. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27892. 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"
  27893. }
  27894. }
  27895. }
  27896. , {
  27897. "./settings": 166,
  27898. three: 217
  27899. }],
  27900. 168: [function(e, t, i) {///js/showcase.js
  27901. (function(i) {
  27902. "use strict";
  27903. var n = e("three")
  27904. , r = (e("url"),
  27905. e("./util/ajax"))
  27906. , o = e("./settings")
  27907. , a = e("./util/logger")
  27908. , s = e("./util/math")
  27909. , l = e("./util/showcase")
  27910. , c = e("./objects/Panorama")
  27911. , h = new a(i)
  27912. , u = e("./model/Model")
  27913. , d = e("./shaders")
  27914. , p = e("./util/transitions")
  27915. , f = e("./objects/Chunk")
  27916. , g = e("./objects/Reticule")
  27917. , m = e("./objects/Skybox")
  27918. , v = e("./objects/Floor")
  27919. , A = e("./cameras/DollhouseCamera")
  27920. , y = e("./cameras/FloorplanCamera")
  27921. , C = e("./cameras/PanoramaCamera")
  27922. , I = e("./controls/DollhouseControls")
  27923. , E = e("./controls/FloorplanControls")
  27924. , b = e("./controls/PanoramaControls");
  27925. n.ImageUtils.crossOrigin = o.crossOrigin,
  27926. t.exports = {
  27927. shaders: d,
  27928. transitions: p,
  27929. Model: u,
  27930. Chunk: f,
  27931. Floor: v,
  27932. Skybox: m,
  27933. Reticule: g,
  27934. Panorama: c,
  27935. DollhouseCamera: A,
  27936. FloorplanCamera: y,
  27937. PanoramaCamera: C,
  27938. DollhouseControls: I,
  27939. FloorplanControls: E,
  27940. PanoramaControls: b,
  27941. getModel: function(e) {
  27942. if (!e.url)
  27943. throw 'getModel(): missing parameter "url"';
  27944. e.autoload = void 0 === e.autoload || e.autoload;
  27945. var t = l.parseSidUrl(e.url);
  27946. e.urlBase = t.urlBase,
  27947. e.urlModel = t.urlModel,
  27948. e.urlFiles = t.urlFiles;
  27949. var i = this._getPlatformError();
  27950. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27951. this._loadModel().then(this._buildModel.bind(this)))
  27952. },
  27953. _getPlatformError: function() {
  27954. 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"
  27955. },
  27956. _loadModel: function() {
  27957. return r.get(this.options.urlModel, {
  27958. responseType: "json",
  27959. prefetchFrom: "model",
  27960. auth: l.getAuthorizationHeader()
  27961. }).then(null, function() {
  27962. return h.warn("Model loading failed at initial metadata load"),
  27963. "loading-failed"
  27964. })
  27965. },
  27966. _buildModel: function(e) {
  27967. e = l.normalizeModeldata(e, s);
  27968. var t = new u(this.options,e);
  27969. return this.options.autoload ? t.load(!0) : $.when(t)
  27970. }
  27971. }
  27972. }
  27973. ).call(this, "/js/showcase.js")
  27974. }
  27975. , {
  27976. "./cameras/DollhouseCamera": 5,
  27977. "./cameras/FloorplanCamera": 6,
  27978. "./cameras/PanoramaCamera": 7,
  27979. "./controls/DollhouseControls": 10,
  27980. "./controls/FloorplanControls": 11,
  27981. "./controls/PanoramaControls": 13,
  27982. "./model/Model": 139,
  27983. "./objects/Chunk": 144,
  27984. "./objects/Floor": 146,
  27985. "./objects/Panorama": 148,
  27986. "./objects/Reticule": 149,
  27987. "./objects/Skybox": 152,
  27988. "./settings": 166,
  27989. "./shaders": 167,
  27990. "./util/ajax": 181,
  27991. "./util/logger": 189,
  27992. "./util/math": 190,
  27993. "./util/showcase": 193,
  27994. "./util/transitions": 195,
  27995. three: 217,
  27996. url: 208
  27997. }],
  27998. 169: [function(e, t, i) {//./tile/PanoRenderer
  27999. "use strict";
  28000. function n() {
  28001. var e = {
  28002. renderTarget: null,
  28003. inUse: !1,
  28004. size: -1,
  28005. pano: null
  28006. };
  28007. return e
  28008. }
  28009. function r(e) {
  28010. M.push(e)
  28011. }
  28012. function o(e) {
  28013. var t = n();
  28014. return t.inUse = !0,
  28015. t.size = e,
  28016. r(t),
  28017. t
  28018. }
  28019. function a(e) {
  28020. for (var t = 0; t < M.length; t++) {
  28021. var i = M[t];
  28022. if (!i.inUse && i.size === e)
  28023. return i.inUse = !0,
  28024. i
  28025. }
  28026. return null
  28027. }
  28028. function s(e) {
  28029. for (var t = 0; t < M.length; t++) {
  28030. var i = M[t];
  28031. if (i.renderTarget === e)
  28032. return i.inUse = !1,
  28033. !0
  28034. }
  28035. return !1
  28036. }
  28037. function l() {
  28038. this.tileDirectory = {},
  28039. this.activeRenderTargetDescriptors = {},
  28040. this.activePanos = [],
  28041. this.panoLODDescriptors = {},
  28042. this.panoDescriptors = {},
  28043. this.tileTrees = {},
  28044. this.sceneRenderer = null,
  28045. this.tileDownloader = null,
  28046. this.forceQueue = [],
  28047. this.uploadQueues = {},
  28048. this.uploadInterval = null,
  28049. this.uploadIntervalCancelled = !1,
  28050. this.usingTileOverlay = !1,
  28051. this.overlayTilesLoaded = !1,
  28052. this.overlayTileBase = null,
  28053. this.overlayTilesBasic = {},
  28054. this.overlayTilesEnhanced = {},
  28055. this.zoomRenderTarget = null,
  28056. this.zoomPano = null,
  28057. this.zoomingActive = !1,
  28058. this.zoomPanoId = null,
  28059. this.zoomPanoRenderingDisabled = !1,
  28060. this.direction = new h.Vector3,
  28061. this.initTime = -1,
  28062. this.maxBaseUploadsPerFrame = x,
  28063. this.maxNonBaseUploadsPerFrame = T
  28064. }
  28065. function c() {
  28066. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  28067. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  28068. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  28069. }
  28070. var h = e("three")
  28071. , u = e("../exception/BasicException")
  28072. , d = e("../settings")
  28073. , p = e("../enum/PanoSizeClass")
  28074. , f = (e("../objects/Panorama"),
  28075. e("../enum/PanoRendererEvents"))
  28076. , g = e("../enum/SceneRendererEvents")
  28077. , m = e("../enum/TileDownloaderEvents")
  28078. , v = e("../enum/Vectors")
  28079. , A = (e("../enum/GLCubeFaces"),
  28080. e("../objects/Panorama"),
  28081. e("./TileTree"))
  28082. , y = (e("./TileDownloader"),
  28083. e("./TilePrioritizer"))
  28084. , C = e("./TileUtils")
  28085. , p = e("../enum/PanoSizeClass")
  28086. , I = (e("../util/browser"),
  28087. e("../util/panorama"))
  28088. , E = e("events").EventEmitter
  28089. , b = !1
  28090. , w = d.tiling.uploadIntervalDelay
  28091. , _ = d.tiling.initialIntervalDelay
  28092. , T = d.tiling.maxNonBaseUploadsPerFrame
  28093. , x = d.tiling.maxBaseUploadsPerFrame
  28094. , S = {
  28095. Base: 0,
  28096. Remaining: 1
  28097. }
  28098. , M = [];
  28099. l.prototype = Object.create(E.prototype),
  28100. l.prototype.init = function(e, t, i) {
  28101. this.sceneRenderer = e,
  28102. this.tileDownloader = t,
  28103. this.qualityManager = i,
  28104. this.bindEvents(),
  28105. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  28106. this.initTime = performance.now()
  28107. }
  28108. ,
  28109. l.prototype.getActivePanoTextures = function(e) {
  28110. e = e || [];
  28111. for (var t = 0; t < M.length; t++) {
  28112. var i = M[t];
  28113. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  28114. }
  28115. }
  28116. ,
  28117. l.prototype.hasQueuedTiles = function() {
  28118. var e = this.peekNextFromUploadQueue();
  28119. return null !== e && void 0 !== e
  28120. }
  28121. ,
  28122. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  28123. return this.activeRenderTargetDescriptors[e]
  28124. }
  28125. ,
  28126. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  28127. this.activeRenderTargetDescriptors[e] = t
  28128. }
  28129. ,
  28130. l.prototype.loadOverlayTiles = function() {
  28131. if (0 !== d.tiling.overlayStyle) {
  28132. var e = 0
  28133. , t = function(t, n, r) {
  28134. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  28135. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  28136. e++,
  28137. e === i.length && (this.overlayTilesLoaded = !0)
  28138. }
  28139. .bind(this)
  28140. , 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)]];
  28141. i.forEach(function(e) {
  28142. this.tileDownloader.loadImage(e[0], 0, e[1])
  28143. }
  28144. .bind(this)),
  28145. this.usingTileOverlay = !0
  28146. } else
  28147. this.usingTileOverlay = !1
  28148. }
  28149. ,
  28150. l.prototype.bindEvents = function() {
  28151. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  28152. }
  28153. ,
  28154. l.prototype.setupZoomRenderTarget = function() {
  28155. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  28156. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  28157. return;
  28158. var e = this.zoomRenderTarget;
  28159. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  28160. e) {
  28161. var t = e.width
  28162. , i = this.zoomRenderTarget.width;
  28163. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  28164. e.texture.dispose(),
  28165. e.texture.loaded = !1,
  28166. e.texture.version = 0,
  28167. this.sceneRenderer.deallocateCubeTexture(e.texture),
  28168. e.texture = null
  28169. }
  28170. this.zoomPanoRenderingDisabled = !1
  28171. } else
  28172. this.zoomPanoRenderingDisabled = !0
  28173. }
  28174. ,
  28175. l.prototype.enableUltraHighQualityMode = function(e) {
  28176. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  28177. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  28178. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  28179. t && (this.qualityManager.enableUltraHighQualityMode(),
  28180. this.setupZoomRenderTarget(),
  28181. e())
  28182. }
  28183. .bind(this))
  28184. }
  28185. }
  28186. ,
  28187. l.prototype.activateTiledPano = function(e, t, i) {
  28188. i && this.clearAllQueuedUploads();
  28189. for (var n = 0; n < C.FACES_PER_PANO; n++)
  28190. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  28191. this.linkAllTilesAndNodes(e);
  28192. var r = this.getActiveRenderTargetDescriptor(e.id)
  28193. , l = t;
  28194. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  28195. !r || l !== r.size) {
  28196. if (r && s(r.renderTarget),
  28197. r = a(l),
  28198. !r) {
  28199. var c = this.initTiledPano(l, !1);
  28200. r = o(c.width),
  28201. r.renderTarget = c
  28202. }
  28203. r.pano = e,
  28204. this.resetPanoDescriptor(e.id),
  28205. this.resetPanoLODDescriptors(e.id),
  28206. this.resetRenderStatus(e.id, !0, !0)
  28207. }
  28208. this.setActiveRenderTargetDescriptor(e.id, r);
  28209. var h = i ? 0 : 1;
  28210. return this.updateActivePanos(e, h),
  28211. r.renderTarget
  28212. }
  28213. ,
  28214. l.prototype.deactivateTiledPano = function(e) {
  28215. var t = this.getActiveRenderTargetDescriptor(e.id);
  28216. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  28217. this.setActiveRenderTargetDescriptor(e.id, null);
  28218. var i = this.getUploadQueueForPano(e.id);
  28219. this.clearUploadQueue(i),
  28220. this.updateActivePanos()
  28221. }
  28222. ,
  28223. l.prototype.updateActivePanos = function() {
  28224. var e = [];
  28225. return function(t, i) {
  28226. e.length = 0;
  28227. for (var n = 0; n < this.activePanos.length; n++) {
  28228. t && e.length === i && e.push(t);
  28229. var r = this.activePanos[n]
  28230. , o = this.getActiveRenderTargetDescriptor(r.id);
  28231. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  28232. }
  28233. t && i >= e.length && e.push(t),
  28234. this.activePanos.length = 0,
  28235. this.activePanos.push.apply(this.activePanos, e)
  28236. }
  28237. }(),
  28238. l.prototype.getActivePanoCount = function() {
  28239. return this.activePanos.length
  28240. }
  28241. ,
  28242. l.prototype.resetRenderStatus = function(e, t, i, n) {
  28243. var r = null;
  28244. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  28245. for (var o = function(e, n, r, o) {
  28246. i && (n.tile.zoomUploaded = !1),
  28247. t && (n.tile.uploaded = !1)
  28248. }, a = 0; a < C.FACES_PER_PANO; a++) {
  28249. var s = this.getTileTree(e, a);
  28250. s.breadthFirst({
  28251. callback: o.bind(this, a),
  28252. minLevel: r
  28253. })
  28254. }
  28255. }
  28256. ,
  28257. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  28258. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  28259. t.tile.zoomUploaded = t.tile.uploaded,
  28260. t.zoomCovered = t.covered
  28261. }, n = 0; n < C.FACES_PER_PANO; n++) {
  28262. var r = this.getTileTree(e, n);
  28263. r.breadthFirst({
  28264. callback: i.bind(this, n),
  28265. maxLevel: t
  28266. })
  28267. }
  28268. }
  28269. ,
  28270. l.prototype.renderPanoTiles = function() {
  28271. var e = [];
  28272. return function(t, i, n, r) {
  28273. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  28274. i = i || this.direction || v.FORWARD;
  28275. var o = this.getActiveRenderTargetDescriptor(t);
  28276. if (!this.isRenderTargetDescriptorValid(o))
  28277. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  28278. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  28279. var s = this.getTileTree(t, a);
  28280. e.length = 0,
  28281. s.breadthFirst({
  28282. saveVisited: e
  28283. });
  28284. for (var l = 0; l < e.length; l++) {
  28285. var c = e[l];
  28286. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  28287. }
  28288. }
  28289. this.updateDirection(i)
  28290. }
  28291. }(),
  28292. l.prototype.isRenderTargetDescriptorValid = function(e) {
  28293. return e && e.renderTarget
  28294. }
  28295. ,
  28296. l.prototype.isPanoActive = function(e) {
  28297. var t = this.getActiveRenderTargetDescriptor(e);
  28298. return this.isRenderTargetDescriptorValid(t)
  28299. }
  28300. ,
  28301. l.prototype.isPanoZoomed = function(e) {
  28302. return this.zoomingActive && this.zoomPanoId === e
  28303. }
  28304. ,
  28305. l.prototype.initTileTree = function(e, t, i) {
  28306. var n = this.tileTrees[e];
  28307. n || (n = [],
  28308. this.tileTrees[e] = n);
  28309. var r = n[t];
  28310. if (!r) {
  28311. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  28312. r = new A(C.TILE_SIZE,o),
  28313. n[t] = r
  28314. }
  28315. }
  28316. ,
  28317. l.prototype.getTileTree = function(e, t) {
  28318. var i = this.tileTrees[e];
  28319. if (!i)
  28320. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  28321. var n = i[t];
  28322. if (!n)
  28323. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  28324. return n
  28325. }
  28326. ,
  28327. l.prototype.initTiledPano = function(e, t) {
  28328. var i = this.sceneRenderer.renderer
  28329. , n = (i.context,
  28330. new h.WebGLRenderTargetCube(e,e,{
  28331. stencilBuffer: !1
  28332. }))
  28333. , r = new h.CubeTexture([]);
  28334. n.texture = r,
  28335. r.image = [null, null, null, null, null, null],
  28336. r.flipY = !0,
  28337. t ? (r.generateMipmaps = !0,
  28338. r.magFilter = h.LinearFilter,
  28339. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  28340. r.magFilter = h.LinearFilter,
  28341. r.minFilter = h.LinearFilter),
  28342. r.format = h.RGBAFormat,
  28343. i.setRenderTarget(n),
  28344. i.setRenderTarget(null);
  28345. var o = i.properties.get(r);
  28346. return o.__image__webglTextureCube = o.__webglTexture,
  28347. n
  28348. }
  28349. ,
  28350. l.prototype.getUploadQueueForPano = function(e) {
  28351. var t = this.uploadQueues[e];
  28352. return t || (t = [],
  28353. this.uploadQueues[e] = t),
  28354. t
  28355. }
  28356. ,
  28357. l.prototype.isTileUploaded = function(e) {
  28358. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  28359. }
  28360. ,
  28361. l.prototype.setUploaded = function(e, t) {
  28362. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  28363. }
  28364. ,
  28365. l.prototype.queueTileUpload = function(e, t, i) {
  28366. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  28367. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  28368. var r = this.getUploadQueueForPano(e.panoId);
  28369. 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),
  28370. e.uploadQueued = !0,
  28371. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  28372. }
  28373. }
  28374. ,
  28375. l.prototype.shoulPushToFrontOfQueue = function(e) {
  28376. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  28377. }
  28378. ,
  28379. l.prototype.getTopUploadQueue = function() {
  28380. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  28381. for (var n = 0; n < this.activePanos.length; n++)
  28382. if (e = this.activePanos[n],
  28383. t = this.getUploadQueueForPano(e.id),
  28384. t.length > 0)
  28385. switch (i) {
  28386. case S.Base:
  28387. if (0 === t[0].level)
  28388. return t;
  28389. break;
  28390. case S.Remaining:
  28391. return t
  28392. }
  28393. return null
  28394. }
  28395. ,
  28396. l.prototype.getNextFromUploadQueue = function() {
  28397. var e = function(e) {
  28398. var t = e.shift();
  28399. return t.uploadQueued = !1,
  28400. t
  28401. };
  28402. return function() {
  28403. if (this.forceQueue.length > 0)
  28404. return e(this.forceQueue);
  28405. var t = this.getTopUploadQueue();
  28406. return t && t.length > 0 ? e(t) : null
  28407. }
  28408. }(),
  28409. l.prototype.peekNextFromUploadQueue = function() {
  28410. if (this.forceQueue.length > 0)
  28411. return this.forceQueue[0];
  28412. var e = this.getTopUploadQueue();
  28413. return e && e.length > 0 ? e[0] : null
  28414. }
  28415. ,
  28416. l.prototype.clearAllQueuedUploads = function() {
  28417. this.clearAllUploadQueues(null, 0)
  28418. }
  28419. ,
  28420. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  28421. this.clearAllUploadQueues(e, 0)
  28422. }
  28423. ,
  28424. l.prototype.clearAllUploadQueues = function(e, t) {
  28425. if (e)
  28426. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  28427. this.clearUploadQueue(this.forceQueue, t, e);
  28428. else {
  28429. for (var i = 0; i < this.activePanos.length; i++) {
  28430. var n = this.activePanos[i];
  28431. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  28432. }
  28433. this.clearUploadQueue(this.forceQueue, t)
  28434. }
  28435. }
  28436. ,
  28437. l.prototype.clearUploadQueue = function(e, t, i) {
  28438. void 0 !== t && null !== t || (t = 0);
  28439. for (var n = 0; n < e.length; ) {
  28440. var r = e[n];
  28441. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  28442. e.splice(n, 1)) : n++
  28443. }
  28444. }
  28445. ,
  28446. l.prototype.refreshUploadInterval = function() {
  28447. var e = null;
  28448. return function(t) {
  28449. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  28450. null !== t && void 0 !== t || (t = w),
  28451. b || (t = _),
  28452. this.uploadInterval = window.setTimeout(e, t),
  28453. this.uploadIntervalDelay = t)
  28454. }
  28455. }(),
  28456. l.prototype.update = function() {
  28457. var e = performance.now()
  28458. , t = 0;
  28459. return function() {
  28460. this.uploadIntervalCancelled = !0,
  28461. window.clearTimeout(this.uploadInterval),
  28462. this.uploadInterval = null;
  28463. var i = performance.now() - e;
  28464. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  28465. e = performance.now()),
  28466. t++
  28467. }
  28468. }(),
  28469. l.prototype.updateUploadQueue = function(e, t) {
  28470. e || (e = 1);
  28471. for (var i = 0, n = 0; ; ) {
  28472. if (n >= t || i >= e)
  28473. break;
  28474. var r = this.getNextFromUploadQueue();
  28475. if (!r)
  28476. break;
  28477. if (0 !== r.level ? i++ : n++,
  28478. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  28479. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  28480. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  28481. }
  28482. }
  28483. }
  28484. ,
  28485. l.prototype.updateDirection = function(e) {
  28486. if (e = e || this.direction) {
  28487. this.direction = e;
  28488. for (var t = 0; t < this.activePanos.length; t++) {
  28489. var i = this.activePanos[t]
  28490. , n = this.getUploadQueueForPano(i.id);
  28491. y.sortPanoTiles(n, i, this.direction)
  28492. }
  28493. }
  28494. }
  28495. ,
  28496. l.prototype.uploadTile = function() {
  28497. var e = {}
  28498. , t = (new h.Vector4,
  28499. d.tiling.overlayStyle);
  28500. return function(i, n) {
  28501. var r = i.panoId
  28502. , o = i.image
  28503. , a = i.tileSize
  28504. , s = i.panoSize
  28505. , l = i.tileIndex
  28506. , c = (i.faceTileIndex,
  28507. i.totalTiles)
  28508. , u = (i.face,
  28509. i.tileX)
  28510. , d = i.tileY
  28511. , p = !0
  28512. , g = !1
  28513. , m = (this.getPanoDescriptor(r),
  28514. this.getPanoLODDescriptor(r, s))
  28515. , v = this.getActiveRenderTargetDescriptor(r)
  28516. , A = v.renderTarget
  28517. , y = v.size;
  28518. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  28519. y = this.qualityManager.getMaxZoomPanoSize()),
  28520. this.isRenderTargetDescriptorValid(v) || (p = !1,
  28521. g = !1),
  28522. n || (this.anyUploaded(i.node) && (p = !1,
  28523. g = !0),
  28524. this.isTileUploaded(i) && (p = !1,
  28525. g = !1)),
  28526. p) {
  28527. var C = u * a
  28528. , I = d * a
  28529. , E = a / s * y
  28530. , b = C / s * y
  28531. , w = I / s * y;
  28532. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  28533. var _ = e[a];
  28534. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  28535. 1 === t || 2 === t) {
  28536. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  28537. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  28538. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  28539. } else
  28540. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  28541. m.uploadCount++,
  28542. this.emit(f.TileRenderSuccess, r, s, l, c),
  28543. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  28544. this.setUploaded(i, !0),
  28545. this.addCoverageForNode(i.node)
  28546. } else
  28547. this.setUploaded(i, !1);
  28548. return i.uploadAttempted || (m.uploadAttempts++,
  28549. this.emit(f.TileUploadAttempted, r, s, l, c)),
  28550. i.uploadAttempted = !0,
  28551. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  28552. g
  28553. }
  28554. }(),
  28555. l.prototype.linkTileAndNode = function(e, t) {
  28556. t.tile = e,
  28557. e.node = t
  28558. }
  28559. ,
  28560. l.prototype.linkAllTilesAndNodes = function(e) {
  28561. for (var t = function(t, i, n, r, o) {
  28562. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  28563. this.linkTileAndNode(a, n)
  28564. }, i = 0; i < C.FACES_PER_PANO; i++) {
  28565. var n = this.getTileTree(e.id, i);
  28566. n.breadthFirst({
  28567. callback: t.bind(this, n, i)
  28568. })
  28569. }
  28570. }
  28571. ,
  28572. l.prototype.anyUploaded = function(e) {
  28573. if (!e)
  28574. return !1;
  28575. if (e.tile && this.isTileUploaded(e.tile))
  28576. return !0;
  28577. if (e.children)
  28578. for (var t = 0; t < e.children.length; t++) {
  28579. var i = e.children[t];
  28580. if (this.anyUploaded(i))
  28581. return !0
  28582. }
  28583. return !1
  28584. }
  28585. ,
  28586. l.prototype.setNodeCovered = function(e, t) {
  28587. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  28588. }
  28589. ,
  28590. l.prototype.isNodeCovered = function(e) {
  28591. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  28592. }
  28593. ,
  28594. l.prototype.addCoverageForNode = function(e) {
  28595. if (this.setNodeCovered(e, !0),
  28596. e.parent && e.covered) {
  28597. var t = e.parent;
  28598. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  28599. }
  28600. }
  28601. ,
  28602. l.prototype.calcFullCoverage = function(e) {
  28603. var t = !1;
  28604. if (e.children)
  28605. for (var i = 0; i < e.children.length; i++) {
  28606. var n = e.children[i];
  28607. t = t || this.calcFullCoverage(n)
  28608. }
  28609. e.covered = e.tile.uploaded || t
  28610. }
  28611. ,
  28612. l.prototype.nodeSubcovered = function(e) {
  28613. if (!e.children)
  28614. return !1;
  28615. for (var t = 0; t < e.children.length; t++)
  28616. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  28617. return !1;
  28618. return !0
  28619. }
  28620. ,
  28621. l.prototype.resetPanoDescriptor = function(e) {
  28622. this.getPanoDescriptor(e)
  28623. }
  28624. ,
  28625. l.prototype.getPanoDescriptor = function(e) {
  28626. var t = this.panoDescriptors[e];
  28627. return t || (t = {},
  28628. this.panoDescriptors[e] = t),
  28629. t
  28630. }
  28631. ,
  28632. l.prototype.resetPanoLODDescriptors = function(e) {
  28633. var t = this.getPanoLODDescriptors(e);
  28634. for (var i in t)
  28635. if (t.hasOwnProperty(i)) {
  28636. var n = t[i];
  28637. n.uploadCount = 0,
  28638. n.uploadAttempts = 0
  28639. }
  28640. }
  28641. ,
  28642. l.prototype.getPanoLODDescriptor = function(e, t) {
  28643. var i = this.getPanoLODDescriptors(e)
  28644. , n = i[t];
  28645. return n || (n = {
  28646. uploadCount: 0,
  28647. uploadAttempts: 0
  28648. },
  28649. i[t] = n),
  28650. n
  28651. }
  28652. ,
  28653. l.prototype.getPanoLODDescriptors = function(e) {
  28654. var t = this.panoLODDescriptors[e];
  28655. return t || (t = {},
  28656. this.panoLODDescriptors[e] = t),
  28657. t
  28658. }
  28659. ,
  28660. l.prototype.onTileDownloaded = function(e) {
  28661. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  28662. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  28663. if (i.downloaded = !0,
  28664. i.image = e.image,
  28665. i.panoSize = e.panoSize,
  28666. i.tileX = e.tileX,
  28667. i.tileY = e.tileY,
  28668. i.totalTiles = e.totalTiles,
  28669. i.tileIndex = e.tileIndex,
  28670. i.faceTileIndex = e.faceTileIndex,
  28671. i.face = e.face,
  28672. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  28673. i.panoId = e.panoId,
  28674. i.tileSize = e.tileSize,
  28675. i.direction = (new h.Vector3).copy(e.direction),
  28676. i.node = null,
  28677. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  28678. this.isPanoActive(i.panoId)) {
  28679. var n = this.getTileTree(i.panoId, i.face)
  28680. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  28681. this.linkTileAndNode(i, r),
  28682. this.queueTileUpload(i, !0)
  28683. }
  28684. }
  28685. ,
  28686. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  28687. var r = this.tileDirectory[e];
  28688. r || (r = {},
  28689. this.tileDirectory[e] = r);
  28690. var o = 16384 * t + 1024 * i + n
  28691. , a = r[o];
  28692. return a || (a = {
  28693. downloaded: !1,
  28694. uploaded: !1,
  28695. zoomUploaded: !1
  28696. },
  28697. r[o] = a),
  28698. a._key = e + ":" + t + ":" + i + ":" + n,
  28699. a._tileKey = o,
  28700. a
  28701. }
  28702. ,
  28703. l.prototype.setZoomingActive = function(e, t, i) {
  28704. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  28705. this.zoomPanoId = t.id,
  28706. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  28707. }
  28708. ,
  28709. l.prototype.updateZoomedPanoFromBase = function(e) {
  28710. if (!this.zoomPanoRenderingDisabled) {
  28711. var t = this.getActiveRenderTargetDescriptor(e.id);
  28712. if (t && t.renderTarget) {
  28713. var i = this.qualityManager.getMaxZoomPanoSize()
  28714. , n = t.renderTarget
  28715. , r = t.size;
  28716. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  28717. this.copyBaseRenderStatusToZoomed(e.id)
  28718. }
  28719. }
  28720. }
  28721. ,
  28722. t.exports = l
  28723. }
  28724. , {
  28725. "../enum/GLCubeFaces": 25,
  28726. "../enum/PanoRendererEvents": 35,
  28727. "../enum/PanoSizeClass": 36,
  28728. "../enum/SceneRendererEvents": 43,
  28729. "../enum/TileDownloaderEvents": 45,
  28730. "../enum/Vectors": 50,
  28731. "../exception/BasicException": 55,
  28732. "../objects/Panorama": 148,
  28733. "../settings": 166,
  28734. "../util/browser": 182,
  28735. "../util/panorama": 191,
  28736. "./TileDownloader": 171,
  28737. "./TilePrioritizer": 172,
  28738. "./TileTree": 173,
  28739. "./TileUtils": 174,
  28740. events: 202,
  28741. three: 217
  28742. }],
  28743. 170: [function(e, t, i) {//tile/QualityManager.js
  28744. "use strict";
  28745. function n(e, t, i) {
  28746. this.maxNavPanoSize = -1,
  28747. this.maxZoomPanoSize = -1,
  28748. this.devicePixelDensity = e,
  28749. this.deviceScreenSize = t,
  28750. this.clientBandwidth = i,
  28751. this.panoSizeClassMap = {},
  28752. this.useHighResolutionPanos = !0,
  28753. this.useUltraHighResolutionPanos = !1,
  28754. this.modelHasUltraHighPanos = !1
  28755. }
  28756. var r = e("../enum/PanoSizeClass")
  28757. , o = e("../settings")
  28758. , a = e("../util/browser")
  28759. , s = e("../constants")
  28760. , l = e("../util/showcase")
  28761. , c = e("../enum/ModelManagerEvents");
  28762. n.prototype.init = function(e) {
  28763. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  28764. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  28765. this.highSize = this.getPanoSize(r.HIGH),
  28766. this.standardSize = this.getPanoSize(r.STANDARD),
  28767. this.baseSize = this.getPanoSize(r.BASE),
  28768. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  28769. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  28770. this.updateMaximums(),
  28771. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  28772. }
  28773. ,
  28774. n.prototype.updateFromModel = function(e) {
  28775. this.updateHighResolutionSettings(e),
  28776. this.updateUltraHighResolutionSettings(e)
  28777. }
  28778. ,
  28779. n.prototype.updateHighResolutionSettings = function(e) {
  28780. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  28781. this.updateMaximums()
  28782. }
  28783. ,
  28784. n.prototype.updateUltraHighResolutionSettings = function(e) {
  28785. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  28786. this.updateMaximums()
  28787. }
  28788. ,
  28789. n.prototype.enableUltraHighQualityMode = function() {
  28790. this.modelHasUltraHighPanos = !0,
  28791. this.updateUltraHighResolutionSettings(null)
  28792. }
  28793. ,
  28794. n.prototype.ultraHighQualityModeEnabled = function() {
  28795. return this.modelHasUltraHighPanos
  28796. }
  28797. ,
  28798. n.prototype.onModelChanged = function(e) {
  28799. this.updateFromModel(e.model),
  28800. this.updateMaximums()
  28801. }
  28802. ,
  28803. n.prototype.updateMaximums = function() {
  28804. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28805. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28806. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28807. }
  28808. ,
  28809. n.prototype.buildPanoSizeClassMap = function() {
  28810. this.panoSizeClassMap[r.BASE] = 512,
  28811. this.panoSizeClassMap[r.STANDARD] = 1024,
  28812. this.panoSizeClassMap[r.HIGH] = 2048,
  28813. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28814. }
  28815. ,
  28816. n.prototype.getPanoSize = function(e) {
  28817. return this.panoSizeClassMap[e]
  28818. }
  28819. ,
  28820. n.prototype.getMaxPossiblePanoSize = function() {
  28821. return this.getPanoSize(r.ULTRAHIGH)
  28822. }
  28823. ,
  28824. n.prototype.getMaxPanoSize = function() {
  28825. return this.maxZoomPanoSize
  28826. }
  28827. ,
  28828. n.prototype.getMaxNavPanoSize = function() {
  28829. return this.maxNavPanoSize
  28830. }
  28831. ,
  28832. n.prototype.getMaxZoomPanoSize = function() {
  28833. return this.maxZoomPanoSize
  28834. }
  28835. ,
  28836. n.prototype.detectMaxNavPanoSizeClass = function() {
  28837. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : window.innerHeight < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28838. }
  28839. ,
  28840. n.prototype.detectMaxNavPanoSize = function() {
  28841. var e = this.detectMaxNavPanoSizeClass();
  28842. return this.getPanoSize(e)
  28843. }
  28844. ,
  28845. n.prototype.detectMaxZoomPanoSize = function() {
  28846. 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)
  28847. }
  28848. ,
  28849. t.exports = n
  28850. }
  28851. , {
  28852. "../constants": 8,
  28853. "../enum/ModelManagerEvents": 33,
  28854. "../enum/PanoSizeClass": 36,
  28855. "../settings": 166,
  28856. "../util/browser": 182,
  28857. "../util/showcase": 193
  28858. }],
  28859. 171: [function(e, t, i) {///js/tile/TileDownloader.js
  28860. (function(i) {
  28861. "use strict";
  28862. function n(e) {
  28863. this.panos = null,
  28864. this.retryMinimumTime = 1e4,
  28865. this.urls = null,
  28866. this.panoLoadCallbacks = {},
  28867. this.downloadDescriptors = {},
  28868. this.priorityQueue = [],
  28869. this.forceQueue = [],
  28870. this.activeDownloads = [],
  28871. this.qualityManager = null,
  28872. this.tilePrioritizer = null,
  28873. this.refreshInterval = null,
  28874. this.processPriorityQueue = !1,
  28875. this.concurrentDownloads = e.concurrentDownloads || 1,
  28876. this.downloadTestResults = {}
  28877. }
  28878. var r = e("three")
  28879. , o = (e("../enum/Viewmode"),
  28880. e("../settings"))
  28881. , a = (e("../objects/Panorama"),
  28882. e("../util/logger"))
  28883. , s = (e("../enum/Vectors"),
  28884. e("../enum/PanoSizeClass"),
  28885. e("../enum/TileDownloaderEvents"))
  28886. , l = e("./TilePrioritizer")
  28887. , c = e("./TileUtils")
  28888. , h = (e("../enum/GLCubeFaces"),
  28889. e("../enum/DownloadStatus"))
  28890. , u = e("../util/panorama")
  28891. , d = e("../util/ajax")
  28892. , p = e("../ab")
  28893. , f = e("events").EventEmitter
  28894. , g = (new a(i),
  28895. Object.freeze({
  28896. Testing: 1,
  28897. Success: 2,
  28898. Fail: 3
  28899. }));
  28900. n.prototype = Object.create(f.prototype),
  28901. n.IDLE_REFRESH_DELAY = 500,
  28902. n.ACTIVE_REFRESH_DELAY = 16,
  28903. n.DOWNLOAD_RETRIES = 4,
  28904. n.prototype.init = function(e) {
  28905. this.qualityManager = e
  28906. }
  28907. ,
  28908. n.prototype.setUrls = function(e) {
  28909. this.urls = e
  28910. }
  28911. ,
  28912. n.prototype.setPanoData = function(e, t, i) {
  28913. this.panos = e,
  28914. this.imagePanos = t,
  28915. this.panoGroupId = i
  28916. }
  28917. ,
  28918. n.prototype.start = function() {
  28919. this.refreshUpdateInterval(0)
  28920. }
  28921. ,
  28922. n.prototype.stop = function() {
  28923. window.cancel(this.refreshInterval)
  28924. }
  28925. ,
  28926. n.prototype.refreshUpdateInterval = function(e) {
  28927. e || (e = 0),
  28928. this.refreshInterval = window.setTimeout(function() {
  28929. var e = this.update();
  28930. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28931. }
  28932. .bind(this), e)
  28933. }
  28934. ,
  28935. n.prototype.update = function() {
  28936. var e = this.forceQueue.length > 0;
  28937. return this.processQueueForDownloading(this.forceQueue),
  28938. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28939. this.priorityQueue.length > 0 && (e = !0),
  28940. this.processQueueForDownloading(this.priorityQueue)),
  28941. e
  28942. }
  28943. ,
  28944. n.prototype.forceQueueTilesForPano = function() {
  28945. var e = []
  28946. , t = [];
  28947. return function(i, n, r, o, a, s) {
  28948. e.length = 0;
  28949. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28950. var p = u[d];
  28951. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28952. }
  28953. if (r && e.length > 0) {
  28954. l.sortPanoTiles(e, i, r),
  28955. t.length = 0,
  28956. c.matchingTilesInDirection(i, n, r, o, a, t);
  28957. for (var f = 0, g = function(e) {
  28958. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28959. }; f < e.length; ) {
  28960. var m = e[f]
  28961. , v = t.findIndex(g);
  28962. v < 0 ? e.splice(f, 1) : f++
  28963. }
  28964. }
  28965. for (var A = 0; A < e.length; A++)
  28966. this.forceQueue.push(e[A]);
  28967. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28968. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28969. s && this.processQueueForDownloading(this.forceQueue, !0)
  28970. }
  28971. }(),
  28972. n.prototype.clearForceQueue = function() {
  28973. this.clearQueue(this.forceQueue)
  28974. }
  28975. ,
  28976. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28977. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28978. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28979. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28980. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28981. }
  28982. ,
  28983. n.prototype.clearQueue = function(e) {
  28984. this.setStatusForAllDescriptors(e, h.None),
  28985. e.length = 0
  28986. }
  28987. ,
  28988. n.prototype.clearFromQueue = function(e, t, i) {
  28989. for (var n = 0; n < e.length; n++) {
  28990. var r = e[n];
  28991. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28992. }
  28993. }
  28994. ,
  28995. n.prototype.setStatusForAllDescriptors = function(e, t) {
  28996. for (var i = 0; i < e.length; i++) {
  28997. var n = e[i];
  28998. n && (n.status = t)
  28999. }
  29000. }
  29001. ,
  29002. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  29003. for (var i = 0; i < e.length; i++) {
  29004. var n = e[i];
  29005. n && (n.status !== t ? n.status = t : e[i] = null)
  29006. }
  29007. }
  29008. ,
  29009. n.prototype.getTileDownloadDescriptors = function(e, t) {
  29010. var i = this.getAllTileDownloadDescriptorsForPano(e)
  29011. , n = i[t];
  29012. return n || (n = this.buildDownloadDescriptorArray(t),
  29013. i[t] = n,
  29014. this.initTileDownloadDescriptors(n, e, t)),
  29015. n
  29016. }
  29017. ,
  29018. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  29019. var t = this.downloadDescriptors[e.id];
  29020. return t || (t = {},
  29021. this.downloadDescriptors[e.id] = t),
  29022. t
  29023. }
  29024. ,
  29025. n.prototype.processQueueForDownloading = function(e, t) {
  29026. if (this.cleanupActiveDownloads(),
  29027. this.activeDownloads.length < this.concurrentDownloads || t)
  29028. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  29029. var o = e.shift();
  29030. o && (this.startDownload(o),
  29031. n++)
  29032. }
  29033. }
  29034. ,
  29035. n.prototype.testDownload = function(e, t, i) {
  29036. var n = this.downloadTestResults[e];
  29037. if (n)
  29038. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  29039. this.downloadTestResults[e] = g.Testing;
  29040. var r = this.panos.list[0]
  29041. , o = this.getTileUrl(r.id, e, t, 0)
  29042. , a = function(t) {
  29043. this.downloadTestResults[e] = g.Success,
  29044. i(!0)
  29045. }
  29046. .bind(this)
  29047. , s = function() {
  29048. this.downloadTestResults[e] = g.Fail,
  29049. i(!1)
  29050. }
  29051. .bind(this);
  29052. this.loadImage(o, 0, a, s)
  29053. }
  29054. ,
  29055. n.prototype.startDownload = function(e) {
  29056. e.status = h.Downloading;
  29057. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  29058. this.activeDownloads.push(e),
  29059. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  29060. }
  29061. ,
  29062. n.prototype.downloadFailed = function(e, t) {}
  29063. ,
  29064. n.prototype.downloadComplete = function(e, t) {
  29065. if (e.panoGroupId === this.panoGroupId) {
  29066. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  29067. e.status = h.Downloaded,
  29068. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  29069. var n = {
  29070. panoId: e.pano.id,
  29071. image: t,
  29072. tileSize: e.tileSize,
  29073. panoSize: e.panoSize,
  29074. tileIndex: e.tileIndex,
  29075. faceTileIndex: e.faceTileIndex,
  29076. totalTiles: e.totalTiles,
  29077. face: e.face,
  29078. tileX: e.tileX,
  29079. tileY: e.tileY,
  29080. direction: e.direction
  29081. };
  29082. e.image = t,
  29083. this.emit(s.TileDownloadSuccess, n),
  29084. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  29085. panoId: e.pano.id,
  29086. tileSize: e.tileSize,
  29087. panoSize: e.panoSize
  29088. },
  29089. this.emit(s.PanoDownloadComplete, n),
  29090. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  29091. }
  29092. }
  29093. ,
  29094. n.prototype.cleanupActiveDownloads = function() {
  29095. var e = [];
  29096. return function() {
  29097. e.length = 0;
  29098. for (var t = 0; t < this.activeDownloads.length; t++) {
  29099. var i = this.activeDownloads[t];
  29100. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  29101. }
  29102. this.activeDownloads.length = 0,
  29103. this.activeDownloads.push.apply(this.activeDownloads, e)
  29104. }
  29105. }(),
  29106. n.prototype.isPanoDownloaded = function(e, t) {
  29107. var i = this.getTileDownloadDescriptors(e, t);
  29108. if (i.length <= 0)
  29109. return !1;
  29110. for (var n = 0; n < i.length; n++) {
  29111. var r = i[n];
  29112. if (r.status !== h.Downloaded)
  29113. return !1
  29114. }
  29115. return !0
  29116. }
  29117. ,
  29118. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  29119. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  29120. this.panoLoadCallbacks[o] = {
  29121. onLoad: i,
  29122. onFail: n,
  29123. onProgress: r
  29124. }
  29125. }
  29126. ,
  29127. n.prototype.getPanoLoadCallbacks = function(e, t) {
  29128. var i = e.id + ":" + t;
  29129. return this.panoLoadCallbacks[i]
  29130. }
  29131. ,
  29132. n.prototype.buildDownloadDescriptorArray = function(e) {
  29133. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  29134. var r = this.buildDownloadDescriptor();
  29135. i.push(r)
  29136. }
  29137. return i
  29138. }
  29139. ,
  29140. n.prototype.buildDownloadDescriptor = function() {
  29141. var e = {
  29142. panoGroupId: null,
  29143. pano: null,
  29144. panoSize: -1,
  29145. tileSize: -1,
  29146. tileIndex: -1,
  29147. totalTiles: -1,
  29148. faceTileIndex: -1,
  29149. status: h.None,
  29150. url: null,
  29151. image: null,
  29152. direction: new r.Vector3,
  29153. face: -1,
  29154. cubeFace: -1,
  29155. tileX: -1,
  29156. tileY: -1
  29157. };
  29158. return e
  29159. }
  29160. ,
  29161. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  29162. for (var n = 0; n < e.length; n++) {
  29163. var r = e[n];
  29164. this.initTileDownloadDescriptor(r, t, i, n)
  29165. }
  29166. }
  29167. ,
  29168. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  29169. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  29170. e.face = c.getFaceForTile(i, n),
  29171. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  29172. e.panoGroupId = this.panoGroupId,
  29173. e.pano = t,
  29174. e.panoSize = i,
  29175. e.tileSize = r,
  29176. e.tileIndex = n,
  29177. e.totalTiles = c.getTileCountForSize(i),
  29178. e.status = h.None,
  29179. e.image = null,
  29180. c.getTileLocation(e.panoSize, e.tileIndex, e),
  29181. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  29182. }
  29183. ,
  29184. n.prototype.getTileUrl = function() {
  29185. var e = {
  29186. 256: "256",
  29187. 512: "512",
  29188. 1024: "1k",
  29189. 2048: "2k",
  29190. 4096: "4k"
  29191. }
  29192. , t = {
  29193. face: -1,
  29194. faceTileIndex: -1,
  29195. tileX: -1,
  29196. tileY: -1
  29197. };
  29198. return function(i, n, r, a) {
  29199. c.getTileLocation(n, a, t);
  29200. var s = Math.floor(n / r)
  29201. , l = s * s
  29202. , h = Math.floor(a / l)
  29203. , u = "";
  29204. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  29205. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  29206. return d = p.changeIfTileGenerating(d)
  29207. }
  29208. }(),
  29209. n.prototype.loadImage = function(e, t, i, n) {
  29210. d.getImage(e, t).then(function(e) {
  29211. i(e)
  29212. }).fail(n)
  29213. }
  29214. ,
  29215. t.exports = n
  29216. }
  29217. ).call(this, "/js/tile/TileDownloader.js")
  29218. }
  29219. , {
  29220. "../ab": 3,
  29221. "../enum/DownloadStatus": 24,
  29222. "../enum/GLCubeFaces": 25,
  29223. "../enum/PanoSizeClass": 36,
  29224. "../enum/TileDownloaderEvents": 45,
  29225. "../enum/Vectors": 50,
  29226. "../enum/Viewmode": 51,
  29227. "../objects/Panorama": 148,
  29228. "../settings": 166,
  29229. "../util/ajax": 181,
  29230. "../util/logger": 189,
  29231. "../util/panorama": 191,
  29232. "./TilePrioritizer": 172,
  29233. "./TileUtils": 174,
  29234. events: 202,
  29235. three: 217
  29236. }],
  29237. 172: [function(e, t, i) {///js/tile/TilePrioritizer.js
  29238. (function(i) {
  29239. "use strict";
  29240. function n(e, t, i, o, a) {
  29241. this.qualityManager = e,
  29242. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  29243. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  29244. this.baseSize = t,
  29245. this.standardSize = i,
  29246. this.highSize = o,
  29247. this.ultraHighSize = a,
  29248. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  29249. }
  29250. var r = e("three")
  29251. , o = (e("../enum/Viewmode"),
  29252. e("../settings"),
  29253. e("../settings"),
  29254. e("../objects/Panorama"))
  29255. , a = e("../util/logger")
  29256. , s = (e("../enum/Vectors"),
  29257. e("../enum/PanoSizeClass"),
  29258. e("../enum/ModelManagerEvents"),
  29259. e("../enum/GLCubeFaces"),
  29260. e("../enum/DownloadStatus"))
  29261. , l = (e("../util/browser"),
  29262. e("./TileUtils"))
  29263. , c = e("../util/math")
  29264. , h = (e("events").EventEmitter,
  29265. new a(i),
  29266. Object.freeze({
  29267. None: 0,
  29268. DirectionalFOV: 1
  29269. }));
  29270. n.PriorityCriteria = function(e, t, i, n, o) {
  29271. this.pano = e,
  29272. this.cameraPosition = (new r.Vector3).copy(t),
  29273. this.cameraDir = (new r.Vector3).copy(i),
  29274. this.panoSpaceDir = (new r.Vector3).copy(n),
  29275. this.upcomingPanos = o,
  29276. this.copy = function(e) {
  29277. this.pano = e.pano,
  29278. this.cameraPosition.copy(e.cameraPosition),
  29279. this.cameraDir.copy(e.cameraDir),
  29280. this.panoSpaceDir.copy(e.panoSpaceDir),
  29281. this.upcomingPanos = o
  29282. }
  29283. ,
  29284. this.zoomingActive = !1
  29285. }
  29286. ,
  29287. n.DIRECTIONAL_FOV = 180,
  29288. n.DIRECTIONAL_FOV_NARROW = 120,
  29289. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  29290. n.MAX_SCORED_PANOS_TOADD = 2,
  29291. n.MAX_UPCOMING_PANOS_TOADD = 3,
  29292. n.DIRECTION_SCORE_STRICTNESS = .75,
  29293. n.appendQueue = function(e, t) {
  29294. if (e && t)
  29295. for (var i = 0; i < t.length; i++)
  29296. e.push(t[i])
  29297. }
  29298. ,
  29299. n.prototype.updateCriteria = function(e, t, i, n) {
  29300. this.priorityCriteria.pano = e,
  29301. this.priorityCriteria.cameraPosition.copy(t),
  29302. this.priorityCriteria.cameraDir.copy(i),
  29303. this.priorityCriteria.upcomingPanos = n,
  29304. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  29305. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  29306. }
  29307. ,
  29308. n.prototype.filterAndPrioritize = function() {
  29309. var e = []
  29310. , t = []
  29311. , i = [];
  29312. return function(r, o, a) {
  29313. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  29314. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  29315. var s = this.baseSize
  29316. , l = this.standardSize
  29317. , c = this.highSize
  29318. , h = this.ultraHighSize;
  29319. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  29320. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  29321. i.length = 0,
  29322. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  29323. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  29324. n.appendQueue(r, i),
  29325. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  29326. i.length = 0,
  29327. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  29328. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  29329. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  29330. n.appendQueue(r, i),
  29331. i.length = 0,
  29332. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  29333. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  29334. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  29335. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  29336. n.appendQueue(r, i),
  29337. this.queueTilesForPanos(r, e, a, s)
  29338. }
  29339. }(),
  29340. n.prototype.canDownloadSize = function(e) {
  29341. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  29342. }
  29343. ,
  29344. n.prototype.populateNeighborPanos = function(e, t, i) {
  29345. i = i || [],
  29346. i.length = 0;
  29347. var n = t.getNeighbours(e);
  29348. for (var r in n)
  29349. if (n.hasOwnProperty(r)) {
  29350. var o = t.get(r);
  29351. i.push(o)
  29352. }
  29353. return i
  29354. }
  29355. ,
  29356. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  29357. i = i || [],
  29358. i.length = 0;
  29359. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  29360. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  29361. , c = t.sortByScore(s, l);
  29362. if (c)
  29363. for (var h = 0; h < c.length && h < a; h++) {
  29364. var u = c[h].pano;
  29365. i.push(u)
  29366. }
  29367. return i
  29368. }
  29369. ,
  29370. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  29371. for (var o = 0, a = 0; a < t.length; a++) {
  29372. var s = t[a]
  29373. , l = this.queueTilesForPano(e, i, s, n);
  29374. if (o += l > 0 ? 1 : 0,
  29375. r && o >= r)
  29376. break
  29377. }
  29378. return o
  29379. }
  29380. ,
  29381. n.prototype.queueTilesForPano = function() {
  29382. var e = {
  29383. filter: h.None
  29384. };
  29385. return function(t, i, n, r) {
  29386. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  29387. }
  29388. }(),
  29389. n.prototype.queueTilesForPanosInDirection = function() {
  29390. var e = new r.Vector3;
  29391. return function(t, i, n, r, o, a, s, l) {
  29392. for (var h = 0, u = 0; u < n.length; u++) {
  29393. var d = n[u];
  29394. e.copy(d.position),
  29395. e.sub(o),
  29396. e.normalize();
  29397. var p = Math.max(Math.min(a.dot(e), 1), -1)
  29398. , f = c.getFOVDotThreshold(s);
  29399. if (p >= f) {
  29400. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  29401. if (h += g > 0 ? 1 : 0,
  29402. l && h >= l)
  29403. break
  29404. }
  29405. }
  29406. return h
  29407. }
  29408. }(),
  29409. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  29410. for (var l = 0, c = 0; c < i.length; c++) {
  29411. var h = i[c]
  29412. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  29413. if (l += u > 0 ? 1 : 0,
  29414. s && l >= s)
  29415. break
  29416. }
  29417. return l
  29418. }
  29419. ,
  29420. n.prototype.queueTilesInDirectionForPano = function() {
  29421. var e = {
  29422. filter: h.DirectionalFOV,
  29423. direction: new r.Vector3,
  29424. fov: 60
  29425. }
  29426. , t = new r.Vector3;
  29427. return function(i, n, r, o, a, s, c) {
  29428. return t.copy(s),
  29429. l.getRelativeDirection(r.quaternion, t),
  29430. e.direction.copy(t),
  29431. e.fov = c,
  29432. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  29433. }
  29434. }(),
  29435. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  29436. var e = [];
  29437. return function(t, i, n, r, o) {
  29438. var a = i.getTileDownloadDescriptors(n, r);
  29439. e.length = 0,
  29440. this.filterTileDownloadDescriptors(n, a, e, o);
  29441. for (var s = 0, l = 0; l < e.length; l++) {
  29442. var c = e[l];
  29443. c && (t.push(c),
  29444. s++)
  29445. }
  29446. return s
  29447. }
  29448. }(),
  29449. n.prototype.filterTileDownloadDescriptors = function() {
  29450. new r.Vector3;
  29451. return function(e, t, i, n) {
  29452. var r, o;
  29453. switch (n.filter) {
  29454. case h.DirectionalFOV:
  29455. for (r = 0; r < t.length; r++)
  29456. o = t[r],
  29457. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  29458. break;
  29459. default:
  29460. for (r = 0; r < t.length; r++)
  29461. o = t[r],
  29462. i.push(o)
  29463. }
  29464. for (r = 0; r < i.length; r++)
  29465. o = i[r],
  29466. this.canIncludeDescriptor(o) || (i[r] = null)
  29467. }
  29468. }(),
  29469. n.prototype.canIncludeDescriptor = function(e) {
  29470. return e.status !== s.Downloading && e.status !== s.Downloaded
  29471. }
  29472. ,
  29473. n.prototype.canIncludePano = function(e, t) {
  29474. return !e.isLoaded(t)
  29475. }
  29476. ,
  29477. n.getFOVDotThreshold = function(e) {
  29478. return Math.cos(r.Math.degToRad(e / 2))
  29479. }
  29480. ;
  29481. var u = function() {
  29482. var e = function e(t, i) {
  29483. var n = e._panoSpaceDir
  29484. , r = e._fovThreshold
  29485. , o = e._fovThresholdNarrow
  29486. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  29487. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  29488. return t._dot = a,
  29489. i._dot = s,
  29490. 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)
  29491. };
  29492. return e._panoSpaceDir = new r.Vector3,
  29493. e._fovThreshold = -1,
  29494. e._fovThresholdNarrow = -1,
  29495. e
  29496. }();
  29497. n.sortPanoTiles = function(e, t, i) {
  29498. u._panoSpaceDir.copy(i),
  29499. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  29500. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  29501. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  29502. e.sort(u)
  29503. }
  29504. ,
  29505. n.insertSortedPanoTile = function(e, t, i, r) {
  29506. u._panoSpaceDir.copy(r),
  29507. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  29508. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  29509. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  29510. for (var o = -1, a = 0; a < e.length; a++) {
  29511. var s = u(t, e[a]);
  29512. if (s <= 0) {
  29513. o = a;
  29514. break
  29515. }
  29516. }
  29517. if (o === -1)
  29518. e[e.length] = t;
  29519. else {
  29520. for (var h = e.length; h > o; h--)
  29521. e[h] = e[h - 1];
  29522. e[o] = t
  29523. }
  29524. }
  29525. ,
  29526. n.prototype.setZoomingActive = function(e) {
  29527. e !== this.zoomingActive && (this.zoomingActive = e)
  29528. }
  29529. ,
  29530. t.exports = n
  29531. }
  29532. ).call(this, "/js/tile/TilePrioritizer.js")
  29533. }
  29534. , {
  29535. "../enum/DownloadStatus": 24,
  29536. "../enum/GLCubeFaces": 25,
  29537. "../enum/ModelManagerEvents": 33,
  29538. "../enum/PanoSizeClass": 36,
  29539. "../enum/Vectors": 50,
  29540. "../enum/Viewmode": 51,
  29541. "../objects/Panorama": 148,
  29542. "../settings": 166,
  29543. "../util/browser": 182,
  29544. "../util/logger": 189,
  29545. "../util/math": 190,
  29546. "./TileUtils": 174,
  29547. events: 202,
  29548. three: 217
  29549. }],
  29550. 173: [function(e, t, i) {//"./TileTree"
  29551. "use strict";
  29552. function n(e, t) {
  29553. this.levels = t,
  29554. this.tileSize = e,
  29555. this.root = null,
  29556. this.allNodes = [],
  29557. a(this)
  29558. }
  29559. function r(e, t) {
  29560. this.tree = e,
  29561. this.parent = t,
  29562. this.children = [],
  29563. this.id = ++u
  29564. }
  29565. function o(e, t, i, r, a, s, l, h) {
  29566. if (e) {
  29567. l = l || n.TraversalType.PreOrder;
  29568. var u = r * c + i;
  29569. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  29570. s && s.push(e)),
  29571. e.children && 0 !== e.children.length) {
  29572. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  29573. for (var g = 0; g < c; g++)
  29574. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  29575. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  29576. s && s.push(e))
  29577. }
  29578. }
  29579. }
  29580. function a(e) {
  29581. e.root = s(e, null, 0)
  29582. }
  29583. function s(e, t, i) {
  29584. if (i > e.levels)
  29585. return null;
  29586. var n = new r(e,t);
  29587. e.allNodes.push(n);
  29588. for (var o = 0; o < h; o++)
  29589. n.children[o] = s(e, n, i + 1);
  29590. return n
  29591. }
  29592. function l(e, t, i, n, r) {
  29593. if (!e)
  29594. return null;
  29595. if (0 === i)
  29596. return e;
  29597. if (!e.children || 0 === e.children.length)
  29598. return null;
  29599. var o = Math.pow(c, i)
  29600. , a = o / c
  29601. , s = n % a
  29602. , h = r % a
  29603. , u = Math.floor(r / a)
  29604. , d = Math.floor(n / a)
  29605. , p = u * c + d
  29606. , f = e.children[p];
  29607. return l(f, t + 1, i - 1, s, h)
  29608. }
  29609. var c = (e("three"),
  29610. e("./TileUtils"),
  29611. e("../objects/Panorama"),
  29612. e("../util/panorama"),
  29613. e("events").EventEmitter,
  29614. 2)
  29615. , h = c * c;
  29616. n.TraversalType = Object.freeze({
  29617. PreOrder: 0,
  29618. PostOrder: 1
  29619. });
  29620. var u = 0;
  29621. n.getLevelCountForSize = function(e, t) {
  29622. var i = 0;
  29623. for (t < e && (t = e); ; ) {
  29624. if (t /= c,
  29625. t < e)
  29626. break;
  29627. i++
  29628. }
  29629. return i
  29630. }
  29631. ,
  29632. n.getSizeForLevel = function(e, t) {
  29633. return Math.pow(c, t) * e
  29634. }
  29635. ,
  29636. n.prototype.getSubNode = function(e, t, i) {
  29637. (!t || e < this.tileSize) && (t = 0),
  29638. (!i || e < this.tileSize) && (i = 0),
  29639. e < this.tileSize && (e = this.tileSize);
  29640. var r = n.getLevelCountForSize(this.tileSize, e)
  29641. , o = l(this.root, 0, r, t, i);
  29642. return o
  29643. }
  29644. ,
  29645. n.prototype.breadthFirst = function(e) {
  29646. e = e || {};
  29647. var t = !!e.nullLevelEnd
  29648. , i = e.maxLevel
  29649. , n = e.minLevel
  29650. , r = e.callback
  29651. , o = e.saveVisited
  29652. , a = []
  29653. , s = {}
  29654. , l = 0
  29655. , c = 0;
  29656. for (a.push(this.root),
  29657. a.push(s); a.length > 0 && !(i && l > i); ) {
  29658. var h = a.shift();
  29659. if (h === s)
  29660. (!n || l >= n) && (r && t && r(null),
  29661. o && t && o.push(null)),
  29662. a.length > 0 && a.push(s),
  29663. l++,
  29664. c = 0;
  29665. else {
  29666. if (h.children)
  29667. for (var u = 0; u < h.children.length; u++) {
  29668. var d = h.children[u];
  29669. d && a.push(h.children[u])
  29670. }
  29671. var p = this.getFaceIndexFromNode(h);
  29672. (!n || l >= n) && (r && r(h, l, p),
  29673. o && o.push(h)),
  29674. c++
  29675. }
  29676. }
  29677. }
  29678. ,
  29679. n.prototype.getFaceIndexFromNode = function(e) {
  29680. if (!e)
  29681. return -1;
  29682. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  29683. var o = i.parent;
  29684. if (!o)
  29685. break;
  29686. for (var a = -1, s = 0; s < o.children.length; s++)
  29687. o.children[s] === i && (a = s);
  29688. var l = a % c
  29689. , h = Math.floor(a / c);
  29690. n = l * t + n,
  29691. r = h * t + r,
  29692. t *= c,
  29693. i = o
  29694. }
  29695. return r * t + n
  29696. }
  29697. ,
  29698. n.prototype.depthFirst = function(e, t, i) {
  29699. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  29700. }
  29701. ,
  29702. t.exports = n
  29703. }
  29704. , {
  29705. "../objects/Panorama": 148,
  29706. "../util/panorama": 191,
  29707. "./TileUtils": 174,
  29708. events: 202,
  29709. three: 217
  29710. }],
  29711. 174: [function(e, t, i) {//"../tile/TileUtils" or "./TileUtils"
  29712. "use strict";
  29713. var n = e("../enum/GLCubeFaces")
  29714. , r = e("../util/MathLight")
  29715. , o = {};
  29716. o.TILE_SIZE = 512,
  29717. o.FACES_PER_PANO = 6,
  29718. o.LocationOnTile = {
  29719. Center: 0,
  29720. UpperLeft: 1,
  29721. UpperRight: 2,
  29722. LowerRight: 3,
  29723. LowerLeft: 4
  29724. },
  29725. o.getTileVector = function() {
  29726. return function(e, t, i, a, s, l, c, h) {
  29727. l = l || o.LocationOnTile.Center;
  29728. var u = e / t
  29729. , d = a / u;
  29730. s = -s + (u - 1);
  29731. var p = s / u
  29732. , f = t / e
  29733. , g = 2 * f
  29734. , m = g / 2
  29735. , v = 2 * d - 1 + m
  29736. , A = 2 * p - 1 + m;
  29737. switch (l) {
  29738. case o.LocationOnTile.UpperLeft:
  29739. v -= m,
  29740. A += m,
  29741. v += c * g;
  29742. break;
  29743. case o.LocationOnTile.UpperRight:
  29744. v += m,
  29745. A += m,
  29746. A -= c * g;
  29747. break;
  29748. case o.LocationOnTile.LowerRight:
  29749. v += m,
  29750. A -= m,
  29751. v -= c * g;
  29752. break;
  29753. case o.LocationOnTile.LowerLeft:
  29754. v -= m,
  29755. A -= m,
  29756. A += c * g;
  29757. break;
  29758. case o.LocationOnTile.Center:
  29759. }
  29760. switch (i) {
  29761. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29762. r.setVector(h, -1, A, -v);
  29763. break;
  29764. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29765. r.setVector(h, 1, A, v);
  29766. break;
  29767. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29768. r.setVector(h, -v, 1, -A);
  29769. break;
  29770. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29771. r.setVector(h, -v, -1, A);
  29772. break;
  29773. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29774. r.setVector(h, -v, A, 1);
  29775. break;
  29776. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29777. r.setVector(h, v, A, -1)
  29778. }
  29779. r.normalize(h)
  29780. }
  29781. }(),
  29782. o.getFaceForTile = function(e, t) {
  29783. var i = o.TILE_SIZE;
  29784. e < o.TILE_SIZE && (i = e);
  29785. var n = Math.floor(e / i)
  29786. , r = n * n;
  29787. return Math.floor(t / r)
  29788. }
  29789. ,
  29790. o.getTileLocation = function(e, t, i) {
  29791. var n = o.TILE_SIZE;
  29792. e < o.TILE_SIZE && (n = e);
  29793. var r = o.getFaceForTile(e, t)
  29794. , a = Math.floor(e / n)
  29795. , s = a * a
  29796. , l = t - r * s;
  29797. i.tileX = l % a,
  29798. i.tileY = Math.floor(l / a),
  29799. i.face = r,
  29800. i.faceTileIndex = l
  29801. }
  29802. ,
  29803. o.getTileCountForSize = function(e) {
  29804. if (e <= o.TILE_SIZE)
  29805. return o.FACES_PER_PANO;
  29806. var t = Math.floor(e / o.TILE_SIZE)
  29807. , i = t * t
  29808. , n = i * o.FACES_PER_PANO;
  29809. return n
  29810. }
  29811. ,
  29812. o.getRelativeDirection = function() {
  29813. var e = new r.Matrix4
  29814. , t = new r.Quaternion;
  29815. return function(i, n) {
  29816. t.copy(i),
  29817. t.inverse(),
  29818. e.makeRotationFromQuaternion(t),
  29819. e.applyToVector3(n),
  29820. r.normalize(n)
  29821. }
  29822. }(),
  29823. o.matchingTilesInDirection = function() {
  29824. var e = new r.Vector3
  29825. , t = new r.Vector3(0,0,-1)
  29826. , i = new r.Quaternion
  29827. , n = function(e, t) {
  29828. e.push({
  29829. face: t.face,
  29830. faceTileIndex: t.faceTileIndex,
  29831. tileX: t.tileX,
  29832. tileY: t.tileY
  29833. })
  29834. }
  29835. , a = function() {
  29836. var e = {
  29837. face: -1,
  29838. faceTileIndex: -1,
  29839. tileX: -1,
  29840. tileY: -1
  29841. };
  29842. return function(t, i, r) {
  29843. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29844. o.getTileLocation(t, l, e),
  29845. i && !i(e) || (s++,
  29846. r && n(r, e));
  29847. return s
  29848. }
  29849. }();
  29850. return function(n, s, l, c, h, u) {
  29851. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29852. o.getTileCountForSize(s);
  29853. if (!c && !h)
  29854. return a(s, null, u);
  29855. var p = !!h;
  29856. if (h = h || c,
  29857. h = Math.max(0, Math.min(h, 360)),
  29858. c = Math.max(0, Math.min(c, 360)),
  29859. r.copyVector(l, e),
  29860. o.getRelativeDirection(n.quaternion, e),
  29861. p) {
  29862. i.setFromUnitVectors(e, t);
  29863. var f = function(e) {
  29864. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29865. };
  29866. return a(s, f, u)
  29867. }
  29868. var g = function(t) {
  29869. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29870. };
  29871. return a(s, g, u)
  29872. }
  29873. }(),
  29874. o.isTileWithinFrustum = function() {
  29875. var e = new r.Vector3
  29876. , t = 1e-5;
  29877. return function(i, n, a, s, l, c, h, u) {
  29878. 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++)
  29879. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29880. r.applyQuaternionToVector(c, e),
  29881. e.z >= -t)
  29882. I++;
  29883. else {
  29884. var w = -1 / e.z
  29885. , _ = e.x * w
  29886. , T = e.y * w;
  29887. T > d ? v++ : T < p && A++,
  29888. _ > f ? y++ : _ < g && C++,
  29889. E++
  29890. }
  29891. return A !== E && v !== E && y !== E && C !== E
  29892. }
  29893. }(),
  29894. o.isTileWithinFOV = function() {
  29895. var e = new r.Vector3
  29896. , t = new r.Vector3(0,1,0)
  29897. , i = new r.Vector3(1,0,0);
  29898. return function(n, a, s, l, c, h, u) {
  29899. var d = o.mapFaceToCubemapFace(s);
  29900. if (r.cross(h, t, i),
  29901. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29902. o.isWithinFOV(e, h, u, null))
  29903. return !0;
  29904. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29905. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29906. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29907. o.isWithinFOV(e, h, u, null))
  29908. return !0;
  29909. g += p
  29910. }
  29911. return !1
  29912. }
  29913. }(),
  29914. o.isWithinFOV = function() {
  29915. var e = new r.Vector3
  29916. , t = new r.Vector3;
  29917. return function(i, n, o, a) {
  29918. if (r.copyVector(i, t),
  29919. a) {
  29920. r.copyVector(a, e),
  29921. r.normalize(e);
  29922. var s = r.dot(e, i);
  29923. e.x *= s,
  29924. e.y *= s,
  29925. e.z *= s,
  29926. r.subVector(t, e)
  29927. }
  29928. var l = o / 2 * r.RADIANS_PER_DEGREE
  29929. , c = Math.cos(l)
  29930. , h = r.dot(t, n);
  29931. return h >= c
  29932. }
  29933. }(),
  29934. o.mapFaceToCubemapFace = function() {
  29935. var e = {
  29936. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29937. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29938. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29939. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29940. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29941. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29942. };
  29943. return function(t) {
  29944. return e[t]
  29945. }
  29946. }(),
  29947. t.exports = o
  29948. }
  29949. , {
  29950. "../enum/GLCubeFaces": 25,
  29951. "../util/MathLight": 176
  29952. }],
  29953. 175: [function(e, t, i) {///js/util/IndexedCollection.j
  29954. (function(i) {
  29955. "use strict";
  29956. function n() {
  29957. this.list = [],
  29958. this.index = {},
  29959. Object.defineProperty(this, "length", {
  29960. get: function() {
  29961. return this.list.length
  29962. }
  29963. })
  29964. }
  29965. var r = (e("./common"),
  29966. e("./logger"));
  29967. new r(i);
  29968. n.prototype.forEach = function(e) {
  29969. this.list.forEach(e)
  29970. }
  29971. ,
  29972. n.prototype.add = function(e) {
  29973. this.list.push(e),
  29974. this.index[this.getIndex(e)] = e
  29975. }
  29976. ,
  29977. n.prototype.getIndex = function(e) {
  29978. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29979. }
  29980. ,
  29981. n.prototype.extend = function(e) {
  29982. for (var t = 0; t < e.length; t++)
  29983. this.add(e[t])
  29984. }
  29985. ,
  29986. n.prototype.get = function(e) {
  29987. return this.index[e]
  29988. }
  29989. ,
  29990. n.prototype.first = function() {
  29991. return this.list[0]
  29992. }
  29993. ,
  29994. n.prototype.last = function() {
  29995. return this.list[this.list.length - 1]
  29996. }
  29997. ,
  29998. n.prototype.reIndex = function() {
  29999. this.index = {};
  30000. var e = this;
  30001. this.forEach(function(t) {
  30002. e.index[e.getIndex(t)] = t
  30003. })
  30004. }
  30005. ,
  30006. n.prototype.filter = function(e) {
  30007. var t = this.list.filter(e);
  30008. return this.reIndex(),
  30009. t
  30010. }
  30011. ,
  30012. n.prototype.reduce = function(e, t) {
  30013. return this.list.reduce(e, t)
  30014. }
  30015. ,
  30016. n.prototype.sort = function(e) {
  30017. return this.list.sort(e)
  30018. }
  30019. ,
  30020. n.prototype.indexOf = function(e) {
  30021. for (var t = 0; t < this.list.length; ++t)
  30022. if (this.list[t] === e)
  30023. return t;
  30024. return -1
  30025. }
  30026. ,
  30027. t.exports = n
  30028. }
  30029. ).call(this, "/js/util/IndexedCollection.js")
  30030. }
  30031. , {
  30032. "./common": 185,
  30033. "./logger": 189
  30034. }],
  30035. 176: [function(e, t, i) {//"../util/MathLight"
  30036. "use strict";
  30037. var n = e("../constants")
  30038. , r = {};
  30039. r.RADIANS_PER_DEGREE = Math.PI / 180,
  30040. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  30041. r.Vector3 = function(e, t, i) {
  30042. this.x = e || 0,
  30043. this.y = t || 0,
  30044. this.z = i || 0
  30045. }
  30046. ,
  30047. r.Matrix4 = function() {
  30048. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  30049. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  30050. }
  30051. ,
  30052. r.Matrix4.prototype = {
  30053. identity: function() {
  30054. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  30055. this
  30056. },
  30057. copy: function(e) {
  30058. return this.elements.set(e.elements),
  30059. this
  30060. },
  30061. applyToVector3: function(e) {
  30062. var t = e.x
  30063. , i = e.y
  30064. , n = e.z
  30065. , r = this.elements;
  30066. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  30067. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  30068. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  30069. this
  30070. },
  30071. getInverse: function(e, t) {
  30072. var i = this.elements
  30073. , n = e.elements
  30074. , r = n[0]
  30075. , o = n[1]
  30076. , a = n[2]
  30077. , s = n[3]
  30078. , l = n[4]
  30079. , c = n[5]
  30080. , h = n[6]
  30081. , u = n[7]
  30082. , d = n[8]
  30083. , p = n[9]
  30084. , f = n[10]
  30085. , g = n[11]
  30086. , m = n[12]
  30087. , v = n[13]
  30088. , A = n[14]
  30089. , y = n[15]
  30090. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  30091. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  30092. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  30093. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  30094. , w = r * C + o * I + a * E + s * b;
  30095. if (0 === w) {
  30096. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  30097. if (t)
  30098. throw new Error(_);
  30099. return console.warn(_),
  30100. this.identity()
  30101. }
  30102. var T = 1 / w;
  30103. return i[0] = C * T,
  30104. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  30105. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  30106. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  30107. i[4] = I * T,
  30108. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  30109. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  30110. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  30111. i[8] = E * T,
  30112. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  30113. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  30114. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  30115. i[12] = b * T,
  30116. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  30117. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  30118. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  30119. this
  30120. },
  30121. makeRotationFromQuaternion: function(e) {
  30122. var t = this.elements
  30123. , i = e.x
  30124. , n = e.y
  30125. , r = e.z
  30126. , o = e.w
  30127. , a = i + i
  30128. , s = n + n
  30129. , l = r + r
  30130. , c = i * a
  30131. , h = i * s
  30132. , u = i * l
  30133. , d = n * s
  30134. , p = n * l
  30135. , f = r * l
  30136. , g = o * a
  30137. , m = o * s
  30138. , v = o * l;
  30139. return t[0] = 1 - (d + f),
  30140. t[4] = h - v,
  30141. t[8] = u + m,
  30142. t[1] = h + v,
  30143. t[5] = 1 - (c + f),
  30144. t[9] = p - g,
  30145. t[2] = u - m,
  30146. t[6] = p + g,
  30147. t[10] = 1 - (c + d),
  30148. t[3] = 0,
  30149. t[7] = 0,
  30150. t[11] = 0,
  30151. t[12] = 0,
  30152. t[13] = 0,
  30153. t[14] = 0,
  30154. t[15] = 1,
  30155. this
  30156. }
  30157. },
  30158. r.Quaternion = function(e, t, i, n) {
  30159. this._x = e || 0,
  30160. this._y = t || 0,
  30161. this._z = i || 0,
  30162. this._w = void 0 !== n ? n : 1
  30163. }
  30164. ,
  30165. r.Quaternion.prototype = {
  30166. get x() {
  30167. return this._x
  30168. },
  30169. set x(e) {
  30170. this._x = e
  30171. },
  30172. get y() {
  30173. return this._y
  30174. },
  30175. set y(e) {
  30176. this._y = e
  30177. },
  30178. get z() {
  30179. return this._z
  30180. },
  30181. set z(e) {
  30182. this._z = e
  30183. },
  30184. get w() {
  30185. return this._w
  30186. },
  30187. set w(e) {
  30188. this._w = e
  30189. },
  30190. copy: function(e) {
  30191. this._x = e.x,
  30192. this._y = e.y,
  30193. this._z = e.z,
  30194. this._w = e.w
  30195. },
  30196. inverse: function() {
  30197. return this.conjugate().normalize()
  30198. },
  30199. conjugate: function() {
  30200. return this._x *= -1,
  30201. this._y *= -1,
  30202. this._z *= -1,
  30203. this
  30204. },
  30205. length: function() {
  30206. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  30207. },
  30208. normalize: function() {
  30209. var e = this.length();
  30210. return 0 === e ? (this._x = 0,
  30211. this._y = 0,
  30212. this._z = 0,
  30213. this._w = 1) : (e = 1 / e,
  30214. this._x = this._x * e,
  30215. this._y = this._y * e,
  30216. this._z = this._z * e,
  30217. this._w = this._w * e),
  30218. this
  30219. },
  30220. setFromAxisAngle: function(e, t) {
  30221. var i = t / 2
  30222. , n = Math.sin(i);
  30223. return this._x = e.x * n,
  30224. this._y = e.y * n,
  30225. this._z = e.z * n,
  30226. this._w = Math.cos(i),
  30227. this
  30228. },
  30229. setFromUnitVectors: function() {
  30230. var e, t, i = 1e-6;
  30231. return function(n, o) {
  30232. return void 0 === e && (e = new r.Vector3),
  30233. t = r.dot(n, o) + 1,
  30234. t < i ? (t = 0,
  30235. 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),
  30236. this._x = e.x,
  30237. this._y = e.y,
  30238. this._z = e.z,
  30239. this._w = t,
  30240. this.normalize()
  30241. }
  30242. }(),
  30243. multiply: function(e) {
  30244. return this.multiplyQuaternions(this, e)
  30245. },
  30246. premultiply: function(e) {
  30247. return this.multiplyQuaternions(e, this)
  30248. },
  30249. multiplyQuaternions: function(e, t) {
  30250. var i = e._x
  30251. , n = e._y
  30252. , r = e._z
  30253. , o = e._w
  30254. , a = t._x
  30255. , s = t._y
  30256. , l = t._z
  30257. , c = t._w;
  30258. return this._x = i * c + o * a + n * l - r * s,
  30259. this._y = n * c + o * s + r * a - i * l,
  30260. this._z = r * c + o * l + i * s - n * a,
  30261. this._w = o * c - i * a - n * s - r * l,
  30262. this
  30263. }
  30264. },
  30265. r.convertWorkshopVector = function(e) {
  30266. return new r.Vector3(-e.x,e.y,e.z)
  30267. }
  30268. ,
  30269. r.convertWorkshopQuaternion = function(e) {
  30270. 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))
  30271. }
  30272. ;
  30273. r.convertWorkshopOrthoZoom = function(e) {
  30274. return e === -1 ? -1 : e / 16 * ($('#player').width() / $('#player').height()) / n.workshopApsect
  30275. }
  30276. ,
  30277. r.convertWorkshopPanoramaQuaternion = function(e) {
  30278. 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))
  30279. }
  30280. ,
  30281. r.normalize = function(e) {
  30282. var t = e.x * e.x + e.y * e.y + e.z * e.z
  30283. , i = Math.sqrt(t);
  30284. e.x /= i,
  30285. e.y /= i,
  30286. e.z /= i
  30287. }
  30288. ,
  30289. r.dot = function(e, t) {
  30290. return e.x * t.x + e.y * t.y + e.z * t.z
  30291. }
  30292. ,
  30293. r.cross = function(e, t, i) {
  30294. var n = e.x
  30295. , r = e.y
  30296. , o = e.z;
  30297. i.x = r * t.z - o * t.y,
  30298. i.y = o * t.x - n * t.z,
  30299. i.z = n * t.y - r * t.x
  30300. }
  30301. ,
  30302. r.setVector = function(e, t, i, n) {
  30303. e.x = t,
  30304. e.y = i,
  30305. e.z = n
  30306. }
  30307. ,
  30308. r.copyVector = function(e, t) {
  30309. t.x = e.x,
  30310. t.y = e.y,
  30311. t.z = e.z
  30312. }
  30313. ,
  30314. r.addVector = function(e, t) {
  30315. e.x += t.x,
  30316. e.y += t.y,
  30317. e.z += t.z
  30318. }
  30319. ,
  30320. r.subVector = function(e, t) {
  30321. e.x -= t.x,
  30322. e.y -= t.y,
  30323. e.z -= t.z
  30324. }
  30325. ,
  30326. r.applyQuaternionToVector = function(e, t) {
  30327. var i = t.x
  30328. , n = t.y
  30329. , r = t.z
  30330. , o = e.x
  30331. , a = e.y
  30332. , s = e.z
  30333. , l = e.w
  30334. , c = l * i + a * r - s * n
  30335. , h = l * n + s * i - o * r
  30336. , u = l * r + o * n - a * i
  30337. , d = -o * i - a * n - s * r;
  30338. t.x = c * l + d * -o + h * -s - u * -a,
  30339. t.y = h * l + d * -a + u * -o - c * -s,
  30340. t.z = u * l + d * -s + c * -a - h * -o
  30341. }
  30342. ,
  30343. r.angleBetweenVectors = function(e, t) {
  30344. return Math.acos(r.dot(e, t))
  30345. }
  30346. ,
  30347. t.exports = r
  30348. }
  30349. , {
  30350. "../constants": 8
  30351. }],
  30352. 177: [function(e, t, i) {///js/util/ModelUrls.js
  30353. (function(i) {
  30354. "use strict";
  30355. function n(e) {
  30356. this.cache = null,
  30357. this.expires = 0
  30358. }
  30359. function r() {
  30360. this.baseUrl = null,
  30361. this.cache = null,
  30362. this.expires = 0
  30363. }
  30364. function o() {
  30365. this.baseUrl = null,
  30366. this.expires = 0
  30367. }
  30368. function a(e) {
  30369. this.initialLoadingPromise = null,
  30370. this.endpoint = e + "?type=3",
  30371. this.urlContainer = null,
  30372. this.authorizationHeader = h.getAuthorizationHeader(),
  30373. this.containerClasses = [o, r, n]
  30374. }
  30375. var s = e("./ajax")
  30376. , l = e("./logger")
  30377. , c = e("../constants")
  30378. , h = e("./showcase")
  30379. , u = (e("../ab"),
  30380. new l(i));
  30381. n.prototype = {
  30382. version: 1,
  30383. validate: function(e) {
  30384. return "catalog.json"in e && Object.keys(e).length > 0
  30385. },
  30386. update: function(e) {
  30387. return this.cache = e,
  30388. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  30389. $.when()
  30390. },
  30391. get: function(e) {
  30392. return this.cache[e]
  30393. }
  30394. },
  30395. r.prototype = {
  30396. version: 2,
  30397. validate: function(e) {
  30398. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  30399. },
  30400. update: function(e) {
  30401. return this.baseUrl = e["base.url"],
  30402. this.cache = e,
  30403. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  30404. $.when()
  30405. },
  30406. get: function(e) {
  30407. var t = this.cache[e];
  30408. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  30409. }
  30410. },
  30411. o.prototype = {
  30412. version: 3,
  30413. validate: function(e) {
  30414. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  30415. },
  30416. update: function(e) {
  30417. e.templates[0] = e.templates[0].replace("{{number}}",window.number);
  30418. return this.baseUrl = e.templates[0],
  30419. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  30420. $.when()
  30421. },
  30422. get: function(e) {
  30423. return this.baseUrl.replace("{{filename}}", e)
  30424. }
  30425. },
  30426. a.prototype = {
  30427. init: function() {
  30428. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  30429. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  30430. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  30431. this.refresh().done(function() {
  30432. u.debug("Refreshed")
  30433. }).fail(function() {
  30434. u.error("Failed url refresh, urls might go stale soon")
  30435. }))
  30436. }.bind(this), c.signedUrlCheckInterval),
  30437. this.initialLoadingPromise = this.refresh(),
  30438. this.initialLoadingPromise)
  30439. },
  30440. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  30441. e = e || {};
  30442. /*var t = void 0 === e.cache || e.cache;
  30443. return s.get( this.endpoint , { //file
  30444. responseType: "json",
  30445. prefetchFrom: t ? "files" : null,
  30446. cache: t,
  30447. auth: this.authorizationHeader
  30448. }).then(function(e) {
  30449. if (this.urlContainer && this.urlContainer.validate(e))
  30450. return this.urlContainer.update(e);
  30451. for (var i = 0; i < this.containerClasses.length; i++) {
  30452. var n = this.containerClasses[i]
  30453. , r = new n;
  30454. if (r.validate(e))
  30455. return u.info("Using urls version " + r.version),
  30456. this.urlContainer = r,
  30457. this.urlContainer.update(e)
  30458. }
  30459. return t ? this.refresh({
  30460. cache: !1
  30461. }) : $.Deferred().reject("missing-urls")
  30462. }
  30463. .bind(this), function(e) {
  30464. return "loading-failed"
  30465. }) */
  30466. return $.Deferred().resolve();
  30467. },
  30468. get: function(e) {
  30469. //return this.urlContainer.get(e)
  30470. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  30471. }
  30472. },
  30473. t.exports = a
  30474. }
  30475. ).call(this, "/js/util/ModelUrls.js")
  30476. }
  30477. , {
  30478. "../ab": 3,
  30479. "../constants": 8,
  30480. "./ajax": 181,
  30481. "./logger": 189,
  30482. "./showcase": 193
  30483. }],
  30484. 178: [function(e, t, i) {///js/util/PanoramaCollection.js
  30485. (function(i) {
  30486. "use strict";
  30487. function n() {
  30488. u.call(this),
  30489. this.neighbourMap = {},
  30490. this.map = null
  30491. }
  30492. var r = e("three")
  30493. , o = e("./common")
  30494. , a = e("../settings")
  30495. , s = e("../objects/Panorama")
  30496. , a = e("../settings")
  30497. , l = e("./aStar")
  30498. , c = e("./logger")
  30499. , h = new c(i)
  30500. , u = e("./IndexedCollection")
  30501. , d = e("./transitions");
  30502. o.inherit(n, u),
  30503. n.prototype.getIndex = function(e) {
  30504. return e.id
  30505. }
  30506. ,
  30507. n.prototype.find = function(e, t) {
  30508. var i = o.filterAll(this.list, e);
  30509. return 0 === i.length ? null : (t && t.forEach(function(e) {
  30510. i = o.stableSort(i, e)
  30511. }),
  30512. i[0])
  30513. }
  30514. ,
  30515. n.prototype.sortByScore = function(e, t, findByScore) {//xzw改
  30516. var i = o.filterAll(this.list, e);
  30517. return 0 === i.length ? null : (i = i.map(function(e) {
  30518. return {
  30519. pano: e,
  30520. score: t.reduce(function(t, i) {
  30521. return t + i(e)
  30522. }, 0)
  30523. }
  30524. }).sort(function(e, t) {
  30525. return t.score - e.score;
  30526. }),
  30527. findByScore ? i[0].pano : i //xzw sort返回整个array find返回第一个
  30528. )
  30529. }
  30530. ,
  30531. n.prototype.lowestByScore = function(e, t, i) {
  30532. return this.findRankedByScore(0, e, t, i)
  30533. }
  30534. ,
  30535. n.prototype.findRankedByScore = function(e, t, i, n) {
  30536. n && (n.candidates = null,
  30537. n.pano = null),
  30538. e || (e = 0);
  30539. var r = this.sortByScore(t, i);
  30540. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  30541. n.pano = r[e].pano),
  30542. r[e].pano)
  30543. }
  30544. ,
  30545. n.prototype.showPanoScores = function(e) {
  30546. this.list.forEach(function(e) {
  30547. e.removeTextSprite()
  30548. });
  30549. var t = 6344768;
  30550. e.forEach(function(e) {
  30551. e.pano.addTextSprite(e.score.toFixed(2), t),
  30552. t = 16428055
  30553. })
  30554. }
  30555. ,
  30556. n.prototype.isNeighbour = function(e, t) {
  30557. return this.neighbourMap[e.id][t.id]
  30558. }
  30559. ,
  30560. n.prototype.getNeighbours = function(e) {
  30561. return this.neighbourMap[e.id]
  30562. }
  30563. ,
  30564. n.prototype.setNeighbour = function(e, t, i) {
  30565. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  30566. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  30567. this.neighbourMap[e.id][e.id] = !0,
  30568. this.neighbourMap[t.id][t.id] = !0,
  30569. this.neighbourMap[e.id][t.id] = i,
  30570. this.neighbourMap[t.id][e.id] = i,
  30571. this.neighbourMap[e.id]
  30572. }
  30573. ,
  30574. n.prototype.findClosest = function(e, t) {
  30575. var i = [s.filters.isPanoAligned()];
  30576. return t && i.push(s.filters.inDirection(e, t, .75)),
  30577. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  30578. }
  30579. ,
  30580. n.prototype.dualNeighbors = function(e, t) {
  30581. var i, n = [];
  30582. for (i in this.neighbourMap[e.id])
  30583. this.neighbourMap[t.id][i] && n.push(i);
  30584. return n
  30585. }
  30586. ,
  30587. n.prototype.populate_path_graph = function() {
  30588. 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;
  30589. for (e = 0; e < this.list.length; e += 1) {
  30590. o = this.list[e],
  30591. s = {},
  30592. l = !1,
  30593. i = o.neighbourPanos || o.findNeighourPanos();
  30594. for (t in i)
  30595. if (i[t]) {
  30596. a = this.index[t],
  30597. p.copy(o.floorPosition),
  30598. p.sub(a.floorPosition);
  30599. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  30600. , v = (Math.abs(p.y) / Math.max(m, .01),
  30601. Math.max(0, Math.abs(p.y) - .2));
  30602. v > 0 ? (f += 1,
  30603. v = Math.pow(4 * v, 2),
  30604. m = Math.pow(m, 2),
  30605. n = Math.sqrt(v * v + m * m)) : (g += 1,
  30606. n = p.length()),
  30607. s[a.id] = n,
  30608. l = !0
  30609. }
  30610. l ? u[o.id] = s : d += 1
  30611. }
  30612. this.map = u,
  30613. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  30614. }
  30615. ,
  30616. n.prototype.aStarSearch = function(e, t) {
  30617. var i = Date.now()
  30618. , n = new l({
  30619. start: e,
  30620. isEnd: function(e) {
  30621. return e === t
  30622. },
  30623. neighbor: function(e) {
  30624. var t = e.neighbourPanos || e.findNeighourPanos()
  30625. , i = [];
  30626. for (var n in t)
  30627. i.push(this.index[n]);
  30628. return i
  30629. }
  30630. .bind(this),
  30631. distance: function(e, t) {
  30632. var i = this.map[e.id]
  30633. , n = i[t.id];
  30634. return n
  30635. }
  30636. .bind(this),
  30637. heuristic: function(e, t) {
  30638. return 1
  30639. }
  30640. .bind(this),
  30641. hash: function(e) {
  30642. return e.id
  30643. },
  30644. timeout: 5e3
  30645. });
  30646. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  30647. "success" !== n.status)
  30648. return h.debug("Did not find A* path from " + e + " to " + t),
  30649. null;
  30650. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  30651. var r = [];
  30652. return n.path.forEach(function(e) {
  30653. r.push(e.id)
  30654. }),
  30655. r
  30656. }
  30657. ,
  30658. n.prototype.includeNodesNearPath = function() {
  30659. var e = new r.Vector3
  30660. , t = new r.Vector3
  30661. , i = new r.Vector3
  30662. , n = new r.Vector3
  30663. , o = new r.Vector3
  30664. , a = new r.Vector3
  30665. , s = new r.Vector3
  30666. , l = new r.Vector3
  30667. , c = []
  30668. , h = new r.Vector3
  30669. , u = new r.Vector3;
  30670. return function(r, d) {
  30671. if (r)
  30672. for (var p = function(e, t, i) {
  30673. return o.copy(t).sub(e),
  30674. o.dot(i)
  30675. }, f = function(e, t) {
  30676. return p(h, e.position, i) - p(h, t.position, i)
  30677. }, g = 0; g < r.length - 1; ) {
  30678. var m = r[g]
  30679. , v = r[g + 1]
  30680. , A = this.index[m]
  30681. , y = this.index[v];
  30682. h.copy(A.position),
  30683. u.copy(y.position),
  30684. c.length = 0,
  30685. e.copy(u).sub(h),
  30686. i.copy(e).normalize();
  30687. for (var C = 0; C < this.list.length; C++) {
  30688. var I = this.list[C];
  30689. o.copy(I.position).sub(h);
  30690. var E = o.dot(i);
  30691. if (E > 0) {
  30692. s.copy(i),
  30693. s.multiplyScalar(E),
  30694. a.copy(o),
  30695. a.sub(s);
  30696. var b = a.length();
  30697. if (b < d) {
  30698. t.copy(e).negate(),
  30699. n.copy(t).normalize(),
  30700. l.copy(I.position).sub(u);
  30701. var w = l.dot(n);
  30702. w > 0 && c.push(I)
  30703. }
  30704. }
  30705. }
  30706. if (c.length > 0) {
  30707. c.sort(f);
  30708. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  30709. r[_] = r[_ - c.length];
  30710. for (var T = 0; T < c.length; T++)
  30711. r[T + g + 1] = c[T].id
  30712. }
  30713. g += c.length + 1
  30714. }
  30715. }
  30716. }(),
  30717. /* n.prototype.fadeMarkerOpacity = function(e, t) {//opacity dur
  30718. var i = void 0 === e ? a.panorama.markerOpacity : e
  30719. , n = this.list.findIndex(function(e) {//why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  30720. return e.marker
  30721. });
  30722. if (!(n < 0)) {
  30723. var r = this.list[n].marker.material.opacity;
  30724. if (r !== e) {
  30725. var o = i - r;
  30726. d.trigger({
  30727. func: function(e, t) {
  30728. var i = r + e * o;
  30729. this.forEach(function(e) {
  30730. e.marker && (e.marker.material.opacity = i)
  30731. })
  30732. }.bind(this),
  30733. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  30734. name: "_fpm"
  30735. })
  30736. }
  30737. }
  30738. } */
  30739. //xzw:
  30740. n.prototype.fadeMarkerOpacity = function(e, t, gr) {//opacity dur
  30741. var n = this.list.findIndex(function(e) {//why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  30742. return e.marker
  30743. });
  30744. if (n < 0) {console.log("marker findIndex<0"); return};
  30745. var group;
  30746. var tran = function(list,index){
  30747. var member = list.member.filter(function(m){
  30748. return m.marker.material.opacity != list.toOp;
  30749. })
  30750. d.trigger({
  30751. func: function(e, t) {//e:0-1
  30752. list.member.forEach(function(m) {
  30753. var o = m.marker.oldOpacity;
  30754. var i = o + e * (list.toOp - o);
  30755. m.marker && (m.marker.material.opacity = i)
  30756. })
  30757. }.bind(this),
  30758. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  30759. name: "_fpm_"+index
  30760. })
  30761. }
  30762. this.forEach(function(e) {//先记录旧的opacity
  30763. e.marker && (e.marker.oldOpacity = e.marker.material.opacity);
  30764. })
  30765. e = void 0 == e ? a.panorama.markerOpacity : e;
  30766. if(e>0 && gr){
  30767. group = gr;
  30768. }else{
  30769. group = [{
  30770. member: this.list,
  30771. toOp: e
  30772. }]
  30773. }
  30774. for(var i=0; i<group.length;i++){
  30775. tran(group[i],i)
  30776. }
  30777. }
  30778. t.exports = n
  30779. }
  30780. ).call(this, "/js/util/PanoramaCollection.js")
  30781. }
  30782. , {
  30783. "../objects/Panorama": 148,
  30784. "../settings": 166,
  30785. "./IndexedCollection": 175,
  30786. "./aStar": 180,
  30787. "./common": 185,
  30788. "./logger": 189,
  30789. "./transitions": 195,
  30790. three: 217
  30791. }],
  30792. 179: [function(e, t, i) {//"./util/ZoomStats"
  30793. "use strict";
  30794. function n() {
  30795. this.actionSequence = [],
  30796. this.actionSequenceInProgress = !1
  30797. }
  30798. function r(e, t, i, n) {
  30799. s.trackAlways("zoom_" + e, {
  30800. from: t,
  30801. to: i,
  30802. pano: n
  30803. })
  30804. }
  30805. function o(e, t) {
  30806. r("initial", 1, e, t)
  30807. }
  30808. function a(e, t, i) {
  30809. r("followup", e, t, i)
  30810. }
  30811. var s = e("../analytics");
  30812. n.prototype.reset = function(e) {
  30813. this.actionSequenceInProgress = !1,
  30814. this.actionSequence.length = 0
  30815. }
  30816. ,
  30817. n.prototype.addZoomAction = function() {
  30818. var e = null
  30819. , t = null
  30820. , i = !1
  30821. , n = function() {
  30822. if (e = null,
  30823. this.actionSequence.length > 0) {
  30824. var i = this.actionSequence[0].start
  30825. , n = this.actionSequence[this.actionSequence.length - 1].end;
  30826. 1 === i ? o(n, t) : a(i, n, t)
  30827. }
  30828. this.reset()
  30829. };
  30830. return function(r, o, a) {
  30831. if (r !== o) {
  30832. i || (n = n.bind(this),
  30833. i = !0),
  30834. e && (window.clearTimeout(e),
  30835. e = null),
  30836. a === t && this.actionSequenceInProgress || (this.reset(),
  30837. t = a),
  30838. this.actionSequenceInProgress = !0;
  30839. var s = {
  30840. start: r,
  30841. end: o
  30842. };
  30843. this.actionSequence.push(s),
  30844. e = window.setTimeout(n, 150)
  30845. }
  30846. }
  30847. }(),
  30848. t.exports = n
  30849. }
  30850. , {
  30851. "../analytics": 4
  30852. }],
  30853. 180: [function(e, t, i) {//"./aStar"
  30854. "use strict";
  30855. function n(e) {
  30856. void 0 === e.timeout && (e.timeout = 1 / 0);
  30857. var t = e.hash || o
  30858. , i = {
  30859. data: e.start,
  30860. g: 0,
  30861. h: e.heuristic(e.start)
  30862. }
  30863. , n = i;
  30864. i.f = i.h;
  30865. var h = new s
  30866. , u = new l(a)
  30867. , d = c();
  30868. u.push(i),
  30869. d.set(t(i.data), i);
  30870. for (var p = new Date; u.size(); ) {
  30871. if (new Date - p > e.timeout)
  30872. return {
  30873. status: "timeout",
  30874. cost: n.g,
  30875. path: r(n)
  30876. };
  30877. var f = u.pop();
  30878. if (d.delete(t(f.data)),
  30879. e.isEnd(f.data))
  30880. return {
  30881. status: "success",
  30882. cost: f.g,
  30883. path: r(f)
  30884. };
  30885. h.add(t(f.data));
  30886. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30887. var v = g[m];
  30888. if (!h.contains(t(v))) {
  30889. var A = f.g + e.distance(f.data, v)
  30890. , y = d.get(t(v))
  30891. , C = !1;
  30892. if (void 0 === y)
  30893. y = {
  30894. data: v
  30895. },
  30896. d.set(t(v), y);
  30897. else {
  30898. if (y.g < A)
  30899. continue;
  30900. C = !0
  30901. }
  30902. y.parent = f,
  30903. y.g = A,
  30904. y.h = e.heuristic(v),
  30905. y.f = A + y.h,
  30906. y.h < n.h && (n = y),
  30907. C ? u.heapify() : u.push(y)
  30908. }
  30909. }
  30910. }
  30911. return {
  30912. status: "noPath",
  30913. cost: n.g,
  30914. path: r(n)
  30915. }
  30916. }
  30917. function r(e) {
  30918. if (void 0 !== e.parent) {
  30919. var t = r(e.parent);
  30920. return t.push(e.data),
  30921. t
  30922. }
  30923. return [e.data]
  30924. }
  30925. function o(e) {
  30926. return e.toString()
  30927. }
  30928. function a(e, t) {
  30929. return e.f - t.f
  30930. }
  30931. var s = e("Set")
  30932. , l = e("heap")
  30933. , c = e("dict");
  30934. t.exports = n
  30935. }
  30936. , {
  30937. Set: 196,
  30938. dict: 210,
  30939. heap: 211
  30940. }],
  30941. 181: [function(e, t, i) {////js/util/ajax.js
  30942. (function(i) {
  30943. "use strict";
  30944. function n(e, t, i) {
  30945. var n = new XMLHttpRequest;
  30946. if (i && "withCredentials"in n)
  30947. n.open(e, t, i);
  30948. else if ("undefined" != typeof XDomainRequest)
  30949. n = new XDomainRequest,
  30950. n.open(e, t);
  30951. else {
  30952. if (i)
  30953. throw "Browser does not support CORS!";
  30954. n.open(e, t)
  30955. }
  30956. return n
  30957. }
  30958. function r(e, t, i) {
  30959. function o() {
  30960. u.warn("Retrying ", t),
  30961. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30962. }
  30963. function a(e, t) {
  30964. var i = e.response;
  30965. if ("json" === t && "object" != typeof i)
  30966. try {
  30967. i = JSON.parse(e.responseText)
  30968. } catch (e) {
  30969. return void c.reject({
  30970. error: "Failed parsing JSON"
  30971. })
  30972. }
  30973. else if ("image/jpeg" === t) {
  30974. var n = new Uint8Array(e.response)
  30975. , r = new Blob([n],{
  30976. type: "image/jpeg"
  30977. })
  30978. , o = URL.createObjectURL(r);
  30979. i = new Image,
  30980. i.src = o,
  30981. i.crossOrigin = "Anonymous",
  30982. i.onload = function() {
  30983. URL.revokeObjectURL(o)
  30984. }
  30985. }
  30986. return i
  30987. }
  30988. var s = n(e, t, !1);
  30989. if (i = i || {},
  30990. i.retries = void 0 !== i.retries ? i.retries : 0,
  30991. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30992. i.responseType)
  30993. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30994. s.responseType = i.responseType;
  30995. else {
  30996. if ("image/jpeg" !== i.responseType)
  30997. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  30998. s.responseType = "arraybuffer"
  30999. }
  31000. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  31001. i.auth && s.setRequestHeader("Authorization", i.auth),
  31002. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  31003. s.setRequestHeader("Content-Type", "application/json")),
  31004. "object" == typeof i.headers)
  31005. for (var l in i.headers)
  31006. s.setRequestHeader(l, i.headers[l]);
  31007. var c = $.Deferred();
  31008. return s.onreadystatechange = function(e) {
  31009. if (4 === this.readyState)
  31010. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  31011. i.retries++,
  31012. setTimeout(o, 1e3);
  31013. else if (200 === this.status) {
  31014. var t = a(this, i.responseType);
  31015. c.resolve(t)
  31016. } else
  31017. c.reject(this)
  31018. }
  31019. ,
  31020. s.onprogress = function(e) {
  31021. c.notify(e)
  31022. }
  31023. ,
  31024. s.send(i.data),
  31025. c.promise()
  31026. }
  31027. function o(e) {
  31028. return Object.keys(e).sort().map(function(t) {
  31029. return {
  31030. key: t,
  31031. value: e[t]
  31032. }
  31033. })
  31034. }
  31035. function a(e, t) {
  31036. var i = t.responseType || null
  31037. , n = t.auth || null
  31038. , r = t.prefetchFrom || null
  31039. , a = e + "__" + i + "__" + n + "__" + r;
  31040. return t.headers && o(t.headers).forEach(function(e) {
  31041. a += "__" + e.key + ":" + e.value
  31042. }),
  31043. a
  31044. }
  31045. function s(e, t) {
  31046. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  31047. }
  31048. function l(e, t, i) {
  31049. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  31050. }
  31051. var c = e("./logger")
  31052. , h = e("../ab")
  31053. , u = new c(i);
  31054. window.URL = window.URL || window.webkitURL,
  31055. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  31056. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  31057. /* setTimeout(function() { //?
  31058. window.MP_REQUEST_CACHE = null,
  31059. window.MP_PREFETCHED_MODELDATA = {}
  31060. }, 6e4),
  31061. window.onpageshow = function(e) {
  31062. e.persisted && (window.MP_REQUEST_CACHE = null,
  31063. window.MP_PREFETCHED_MODELDATA = {})
  31064. } */
  31065. ,
  31066. t.exports = {
  31067. get: function(e, t) {
  31068. t = t || {};
  31069. var i = void 0 === t.cache || t.cache;
  31070. if (i) {
  31071. var n = s(e, t);
  31072. if (n)
  31073. return n
  31074. }
  31075. var o;
  31076. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  31077. i && l(e, t, o),
  31078. o
  31079. },
  31080. post: function(e, t) {
  31081. return r("POST", e, t)
  31082. },
  31083. patch: function(e, t) {
  31084. return r("PATCH", e, t)
  31085. },
  31086. getImage: function(e, t) {
  31087. function i() {
  31088. u.warn("Retrying ", e),
  31089. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  31090. }
  31091. var n = $.Deferred()
  31092. , r = new Image
  31093. , o = this;
  31094. return e = h.changeIfImageOptimzing(e),
  31095. null !== t && void 0 !== t || (t = 3),
  31096. r.onerror = function() {
  31097. t > 0 ? setTimeout(i, 1e3) : n.reject()
  31098. }
  31099. ,
  31100. r.onload = function() {
  31101. n.resolve(r)
  31102. }
  31103. ,
  31104. r.crossOrigin = "anonymous",
  31105. r.src = e,
  31106. n
  31107. }
  31108. }
  31109. }
  31110. ).call(this, "/js/util/ajax.js")
  31111. }
  31112. , {
  31113. "../ab": 3,
  31114. "./logger": 189
  31115. }],
  31116. 182: [function(e, t, i) {//"./util/browser"
  31117. "use strict";
  31118. function n(e, t) {
  31119. var i = window.navigator.userAgent
  31120. , n = i.match(e);
  31121. return n = n ? n[1].split(t) : [],
  31122. {
  31123. major: parseInt(n[0]) || 0,
  31124. minor: parseInt(n[1]) || 0,
  31125. patch: parseInt(n[2]) || 0
  31126. }
  31127. }
  31128. var r = e("../exception/DeviceMismatchException");
  31129. t.exports = {
  31130. isFullscreen: function() {
  31131. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  31132. },
  31133. supportsFullscreen: function() {
  31134. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  31135. },
  31136. isPointerLocked: function() {
  31137. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  31138. },
  31139. requestFullscreen: function(e, t) {
  31140. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  31141. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  31142. },
  31143. requestPointerLock: function() {
  31144. var e;
  31145. if (document.fullscreenElement)
  31146. e = document.fullscreenElement();
  31147. else if (document.mozFullscreenElement)
  31148. e = document.mozFullscreenElement();
  31149. else if (document.mozFullScreenElement)
  31150. e = document.mozFullScreenElement();
  31151. else {
  31152. if (!document.webkitFullscreenElement)
  31153. return;
  31154. e = document.webkitFullscreenElement()
  31155. }
  31156. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  31157. e.requestPointerLock(),
  31158. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  31159. },
  31160. exitPointerLock: function() {
  31161. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  31162. document.exitPointerLock()
  31163. },
  31164. exitFullscreen: function() {
  31165. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  31166. },
  31167. details: function() {
  31168. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  31169. return e ? {
  31170. name: e[1],
  31171. version: parseInt(e[2]),
  31172. platform: navigator.platform
  31173. } : {}
  31174. },
  31175. is: function(e) {
  31176. return this.details() && this.details().name === e
  31177. },
  31178. inIframe: function() {
  31179. return window.parent !== window
  31180. },
  31181. aspectRatio: function() {
  31182. var e = $('#player').width() / $('#player').height();
  31183. return isFinite(e) ? e : 0
  31184. },
  31185. userAgent: function() {
  31186. return window.navigator.userAgent
  31187. },
  31188. isMobile: function() {
  31189. var e = navigator.userAgent || navigator.vendor || window.opera;
  31190. 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))
  31191. },
  31192. isLandscape: function() {
  31193. return this.isMobile && this.aspectRatio() > 1
  31194. },
  31195. isSmallScreen: function() {
  31196. var e = screen.width / window.devicePixelRatio;
  31197. return e < 240
  31198. },
  31199. detectIE: function() {
  31200. var e = window.navigator.userAgent
  31201. , t = e.indexOf("MSIE ");
  31202. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  31203. },
  31204. detectSafari: function() {
  31205. var e = window.navigator.userAgent
  31206. , t = e.indexOf("Safari");
  31207. return t !== -1 && !this.detectChrome()
  31208. },
  31209. detectFirefox: function() {
  31210. var e = window.navigator.userAgent;
  31211. return e.indexOf("Firefox") !== -1
  31212. },
  31213. detectChrome: function() {
  31214. var e = window.navigator.userAgent;
  31215. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  31216. },
  31217. detectOpera: function() {
  31218. var e = window.navigator.userAgent;
  31219. return e.indexOf("OPR") !== -1
  31220. },
  31221. detectIOS: function() {
  31222. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  31223. },
  31224. detectIPad: function() {
  31225. var e = window.navigator.userAgent
  31226. , t = /iPad/;
  31227. return t.test(e)
  31228. },
  31229. detectIPod: function() {
  31230. var e = window.navigator.userAgent
  31231. , t = /iPod/;
  31232. return t.test(e)
  31233. },
  31234. detectIPhone: function() {
  31235. var e = window.navigator.userAgent
  31236. , t = /iPhone/;
  31237. return t.test(e)
  31238. },
  31239. detectAndroid: function() {
  31240. var e = window.navigator.userAgent;
  31241. return e.indexOf("Android") !== -1
  31242. },
  31243. detectAndroidMobile: function() {
  31244. var e = window.navigator.userAgent;
  31245. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  31246. },
  31247. detectSamsungNative: function() {
  31248. var e = window.navigator.userAgent;
  31249. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  31250. },
  31251. detectSamsungS6: function() {
  31252. var e = window.navigator.userAgent;
  31253. return e.indexOf("SM-G92") !== -1
  31254. },
  31255. detectWebVR: function() {
  31256. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  31257. },
  31258. getVRDisplay: function() {
  31259. var e = $.Deferred();
  31260. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  31261. t.length >= 1 && e.resolve(t[0]),
  31262. e.reject(null)
  31263. }),
  31264. e) : e.reject(null)
  31265. },
  31266. iosVersion: function() {
  31267. if (!this.detectIOS())
  31268. throw new r("Did not detect an iDevice");
  31269. var e = /((?:\d+\_?){1,3}) like Mac OS/
  31270. , t = "_";
  31271. return n(e, t)
  31272. },
  31273. androidVersion: function() {
  31274. if (!this.detectAndroid())
  31275. throw new r("Did not detect an Android based device");
  31276. var e = /Android ((?:\d+\.?){1,3})/
  31277. , t = ".";
  31278. return n(e, t)
  31279. },
  31280. valueFromCookie: function(e, t) {
  31281. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  31282. if (!i)
  31283. return t;
  31284. var n = i[1];
  31285. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  31286. },
  31287. valueFromHash: function(e, t) {
  31288. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  31289. , n = i.exec(window.location.href);
  31290. if (!n)
  31291. return t;
  31292. var r = n[1];
  31293. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  31294. }
  31295. }
  31296. }
  31297. , {
  31298. "../exception/DeviceMismatchException": 56
  31299. }],
  31300. 183: [function(e, t, i) {///js/util/camera.js 初始化视角
  31301. (function(i) {
  31302. "use strict";
  31303. function n(e, t) {
  31304. var i = r(t);
  31305. if (Object.keys(i).length > 0)
  31306. return i;
  31307. if (e.heroImage) //这些之后都换了
  31308. i = o(e, t);
  31309. else if (e.data.camera_start) {
  31310. var n = e.data.camera_start;
  31311. try {
  31312. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  31313. i.position = n.camera.position,
  31314. i.quaternion = n.camera.quaternion,
  31315. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  31316. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  31317. d.debug("Using camera_start"),
  31318. d.debug("Modeldata pano: ", i.pano.quaternion),
  31319. d.debug("Camera start pano: ", n.pano.quaternion)),
  31320. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  31321. } catch (e) {
  31322. d.warn(e.message)
  31323. }
  31324. }
  31325. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  31326. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  31327. i.pano = t.findClosest(i.position),
  31328. i.quaternion = i.pano.quaternion),
  31329. 0 === Object.keys(i).length) {
  31330. var a = t.list[0];
  31331. a && (i.mode = h.PANORAMA,
  31332. i.pano = a,
  31333. i.position = a.position,
  31334. i.quaternion = a.quaternion,
  31335. d.info("Starting at 1st pano " + a.id))
  31336. }
  31337. return i.mode = i.mode || h.DOLLHOUSE,
  31338. i
  31339. }
  31340. function r(e) {
  31341. var t = c.valueFromHash("start", "")
  31342. , i = {};
  31343. if ("" !== t) {
  31344. d.debug("Start override found in parameters, trying to parse..."),
  31345. i = a(t) || {};
  31346. var n = c.valueFromHash("tag", null);
  31347. n && (i.tag = n),
  31348. i.panoId && (i.pano = e.get(i.panoId))
  31349. }
  31350. return i
  31351. }
  31352. function o(e, t) {
  31353. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  31354. return {};
  31355. var i = {}
  31356. , n = e.heroImage.metadata;
  31357. d.debug("Using start position from thumbnail image"),
  31358. i.position = n.camera_position,
  31359. i.quaternion = n.camera_quaternion;
  31360. try {
  31361. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  31362. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  31363. } catch (e) {
  31364. d.debug(e.message)
  31365. }
  31366. return i
  31367. }
  31368. function a(e) {
  31369. return s.deserialize(e)
  31370. }
  31371. var s = e("../controls/serializer")
  31372. , l = e("../util/math")
  31373. , c = e("./browser")
  31374. , h = e("../enum/Viewmode")
  31375. , u = e("../util/logger")
  31376. , d = new u(i);
  31377. t.exports = {
  31378. getStartCameraOptions: n
  31379. }
  31380. }
  31381. ).call(this, "/js/util/camera.js")
  31382. }
  31383. , {
  31384. "../controls/serializer": 14,
  31385. "../enum/Viewmode": 51,
  31386. "../util/logger": 189,
  31387. "../util/math": 190,
  31388. "./browser": 182
  31389. }],
  31390. 184: [function(e, t, i) {//"../util/cameraLight"
  31391. "use strict";
  31392. function n(e, t, i) {
  31393. return o(e.fov, t, i)
  31394. }
  31395. var r = e("./MathLight")
  31396. , o = function(e, t, i) {
  31397. var n = t
  31398. , o = i
  31399. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  31400. return a
  31401. }
  31402. , a = function(e, t, i) {
  31403. var n = t
  31404. , o = i
  31405. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  31406. return a
  31407. }
  31408. , s = function(e, t, i, n) {
  31409. var r = o(e, i, n);
  31410. return r > t ? a(t, i, n) : e
  31411. };
  31412. t.exports = {
  31413. clampVFOV: s,
  31414. getHFOVForCamera: n,
  31415. getHFOVFromVFOV: o,
  31416. getVFOVFromHFOV: a
  31417. }
  31418. }
  31419. , {
  31420. "./MathLight": 176
  31421. }],
  31422. 185: [function(e, t, i) {//"./util/common"
  31423. "use strict";
  31424. var n = e("three");
  31425. t.exports = {
  31426. delayOneFrame: function(e) {
  31427. window.setTimeout(e, 1)
  31428. },
  31429. normalizeUrl: function(e) {
  31430. return e.replace("https://", "http://")
  31431. },
  31432. domainFromUrl: function(e) {
  31433. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  31434. return t ? t[3] : e
  31435. },
  31436. average: function(e, t) {
  31437. if (0 === e.length)
  31438. return null;
  31439. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  31440. var o = t ? e[r][t] : e[r];
  31441. i += o,
  31442. n++
  31443. }
  31444. return i / n
  31445. },
  31446. countUnique: function(e) {
  31447. for (var t = {}, i = 0; i < e.length; i++)
  31448. t[e[i]] = 1 + (t[e[i]] || 0);
  31449. return Object.keys(t).length
  31450. },
  31451. averageVectors: function(e, t) {
  31452. var i = new n.Vector3;
  31453. if (0 === e.length)
  31454. return i;
  31455. for (var r = 0, o = 0; o < e.length; o++) {
  31456. var a = t ? e[o][t] : e[o];
  31457. i.add(a),
  31458. r++
  31459. }
  31460. return i.divideScalar(r)
  31461. },
  31462. equalLists: function(e, t) {
  31463. if (e.length !== t.length)
  31464. return !1;
  31465. for (var i = 0; i < e.length; i++)
  31466. if (e[i] !== t[i])
  31467. return !1;
  31468. return !0
  31469. },
  31470. lowerMedian: function(e, t) {
  31471. if (0 === e.length)
  31472. return null;
  31473. t = t || 2,
  31474. e.sort(function(e, t) {
  31475. return e - t
  31476. });
  31477. var i = Math.floor(e.length / t);
  31478. return e[i]
  31479. },
  31480. stableSort: function(e, t) {
  31481. return e.map(function(e, t) {
  31482. return {
  31483. value: e,
  31484. index: t
  31485. }
  31486. }).sort(function(e, i) {
  31487. var n = t(e.value, i.value);
  31488. return 0 !== n ? n : e.index - i.index
  31489. }).map(function(e) {
  31490. return e.value
  31491. })
  31492. },
  31493. filterAll: function(e, t) {
  31494. return e.filter(function(e) {
  31495. return t.every(function(t) {
  31496. return t(e)
  31497. })
  31498. })
  31499. },
  31500. formatDate: function(e) {
  31501. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  31502. },
  31503. formatDatetime: function(e) {
  31504. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  31505. },
  31506. randomString: function(e) {
  31507. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  31508. t += i.charAt(Math.floor(Math.random() * i.length));
  31509. return t
  31510. },
  31511. uint8ToBase64: function(e, t) {
  31512. t && "number" == typeof t || (t = 8192);
  31513. for (var i = [], n = 0; n < e.length; n += t)
  31514. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  31515. return btoa(i.join(""))
  31516. },
  31517. uuid4: function e(t) {
  31518. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  31519. },
  31520. nth: function(e) {
  31521. return e %= 10,
  31522. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  31523. },
  31524. extendObject: function(e, t) {
  31525. return Object.keys(t).forEach(function(i) {
  31526. e[i] = t[i]
  31527. }),
  31528. e
  31529. },
  31530. deepExtend: function e(t) {
  31531. t = t || {};
  31532. for (var i = 1; i < arguments.length; i++) {
  31533. var n = arguments[i];
  31534. if (n)
  31535. for (var r in n)
  31536. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  31537. }
  31538. return t
  31539. },
  31540. inherit: function(e, t) {
  31541. e.prototype = Object.create(t.prototype),
  31542. e.prototype.constructor = e
  31543. },
  31544. extend: function(e, t) {
  31545. for (var i in t.prototype)
  31546. e.prototype[i] = t.prototype[i]
  31547. }
  31548. },
  31549. Math.sign = function(e) {
  31550. return e < 0 ? -1 : 1
  31551. }
  31552. }
  31553. , {
  31554. three: 217
  31555. }],
  31556. 186: [function(e, t, i) {//"../util/easing"
  31557. "use strict";
  31558. var n = {};
  31559. n.linearTween = function(e, t, i, n) {
  31560. return i * e / n + t
  31561. }
  31562. ,
  31563. n.easeInQuad = function(e, t, i, n) {
  31564. return e /= n,
  31565. i * e * e + t
  31566. }
  31567. ,
  31568. n.easeOutQuad = function(e, t, i, n) {
  31569. return e /= n,
  31570. -i * e * (e - 2) + t
  31571. }
  31572. ,
  31573. n.easeInOutQuad = function(e, t, i, n) {
  31574. return e /= n / 2,
  31575. e < 1 ? i / 2 * e * e + t : (e--,
  31576. -i / 2 * (e * (e - 2) - 1) + t)
  31577. }
  31578. ,
  31579. n.easeInCubic = function(e, t, i, n) {
  31580. return e /= n,
  31581. i * e * e * e + t
  31582. }
  31583. ,
  31584. n.easeOutCubic = function(e, t, i, n) {
  31585. return e /= n,
  31586. e--,
  31587. i * (e * e * e + 1) + t
  31588. }
  31589. ,
  31590. n.easeInOutCubic = function(e, t, i, n) {
  31591. return e /= n / 2,
  31592. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  31593. i / 2 * (e * e * e + 2) + t)
  31594. }
  31595. ,
  31596. n.easeInQuart = function(e, t, i, n) {
  31597. return e /= n,
  31598. i * e * e * e * e + t
  31599. }
  31600. ,
  31601. n.easeOutQuart = function(e, t, i, n) {
  31602. return e /= n,
  31603. e--,
  31604. -i * (e * e * e * e - 1) + t
  31605. }
  31606. ,
  31607. n.easeInOutQuart = function(e, t, i, n) {
  31608. return e /= n / 2,
  31609. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  31610. -i / 2 * (e * e * e * e - 2) + t)
  31611. }
  31612. ,
  31613. n.easeInQuint = function(e, t, i, n) {
  31614. return e /= n,
  31615. i * e * e * e * e * e + t
  31616. }
  31617. ,
  31618. n.easeOutQuint = function(e, t, i, n) {
  31619. return e /= n,
  31620. e--,
  31621. i * (e * e * e * e * e + 1) + t
  31622. }
  31623. ,
  31624. n.easeInOutQuint = function(e, t, i, n) {
  31625. return e /= n / 2,
  31626. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  31627. i / 2 * (e * e * e * e * e + 2) + t)
  31628. }
  31629. ,
  31630. n.easeInSine = function(e, t, i, n) {
  31631. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  31632. }
  31633. ,
  31634. n.easeOutSine = function(e, t, i, n) {
  31635. return i * Math.sin(e / n * (Math.PI / 2)) + t
  31636. }
  31637. ,
  31638. n.easeInOutSine = function(e, t, i, n) {
  31639. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  31640. }
  31641. ,
  31642. n.easeInExpo = function(e, t, i, n) {
  31643. return i * Math.pow(2, 10 * (e / n - 1)) + t
  31644. }
  31645. ,
  31646. n.easeOutExpo = function(e, t, i, n) {
  31647. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  31648. }
  31649. ,
  31650. n.easeInOutExpo = function(e, t, i, n) {
  31651. return e /= n / 2,
  31652. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  31653. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  31654. }
  31655. ,
  31656. n.easeInCirc = function(e, t, i, n) {
  31657. return e /= n,
  31658. -i * (Math.sqrt(1 - e * e) - 1) + t
  31659. }
  31660. ,
  31661. n.easeOutCirc = function(e, t, i, n) {
  31662. return e /= n,
  31663. e--,
  31664. i * Math.sqrt(1 - e * e) + t
  31665. }
  31666. ,
  31667. n.easeInOutCirc = function(e, t, i, n) {
  31668. return e /= n / 2,
  31669. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  31670. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  31671. }
  31672. ,
  31673. n.easeInElastic = function(e, t, i, n) {
  31674. var r = 1.70158
  31675. , o = 0
  31676. , a = i;
  31677. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31678. a < Math.abs(i) ? (a = i,
  31679. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31680. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  31681. }
  31682. ,
  31683. n.easeOutElastic = function(e, t, i, n) {
  31684. var r = 1.70158
  31685. , o = 0
  31686. , a = i;
  31687. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31688. a < Math.abs(i) ? (a = i,
  31689. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31690. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  31691. }
  31692. ,
  31693. n.easeInOutElastic = function(e, t, i, n) {
  31694. var r = 1.70158
  31695. , o = 0
  31696. , a = i;
  31697. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  31698. a < Math.abs(i) ? (a = i,
  31699. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31700. 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)
  31701. }
  31702. ,
  31703. n.easeInBack = function(e, t, i, n, r) {
  31704. return void 0 === r && (r = 1.70158),
  31705. i * (e /= n) * e * ((r + 1) * e - r) + t
  31706. }
  31707. ,
  31708. n.easeOutBack = function(e, t, i, n, r) {
  31709. return void 0 === r && (r = 1.70158),
  31710. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  31711. }
  31712. ,
  31713. n.easeInOutBack = function(e, t, i, n, r) {
  31714. return void 0 === r && (r = 1.70158),
  31715. (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
  31716. }
  31717. ,
  31718. n.easeOutBounce = function(e, t, i, n) {
  31719. 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
  31720. }
  31721. ,
  31722. n.easeInBounce = function(e, t, i, r) {
  31723. return i - n.easeOutBounce(r - e, 0, i, r) + t
  31724. }
  31725. ,
  31726. n.easeInOutBounce = function(e, t, i, r) {
  31727. 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
  31728. }
  31729. ,
  31730. t.exports = n
  31731. }
  31732. , {}],
  31733. 187: [function(e, t, i) {//"./util/history"
  31734. "use strict";
  31735. function n() {
  31736. this.events = [],
  31737. this.valid = !1
  31738. }
  31739. var r = e("../enum/Joystick");
  31740. n.prototype.push = function(e, t) {
  31741. this.events.push({
  31742. direction: e,
  31743. pano: t
  31744. }),
  31745. this.valid = !0
  31746. }
  31747. ,
  31748. n.prototype.pop = function(e) {
  31749. var t = this.events.pop();
  31750. return this.events.length < 1 && (this.valid = !1),
  31751. t
  31752. }
  31753. ,
  31754. n.prototype.peek = function() {
  31755. return this.events.length ? this.events[this.events.length - 1] : {
  31756. direction: null,
  31757. pano: null
  31758. }
  31759. }
  31760. ,
  31761. n.prototype.invalidate = function() {
  31762. this.events = [],
  31763. this.valid = !1
  31764. }
  31765. ,
  31766. n.prototype.reversePano = function(e) {
  31767. if (!this.valid)
  31768. return null;
  31769. var t = this.peek();
  31770. return r.opposite(e) === t.direction ? (this.pop(),
  31771. t.pano) : null
  31772. }
  31773. ,
  31774. t.exports = n
  31775. }
  31776. , {
  31777. "../enum/Joystick": 29
  31778. }],
  31779. 188: [function(e, t, i) {//"./util/lerp"
  31780. "use strict";
  31781. t.exports = {
  31782. vector: function(e, t) {
  31783. var i = e.clone();
  31784. return t = t.clone(),
  31785. function(n) {
  31786. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31787. }
  31788. },
  31789. quaternion: function(e, t) {
  31790. var i = e.clone();
  31791. return function(n) {
  31792. e.copy(i).slerp(t, n)
  31793. }
  31794. },
  31795. property: function(e, t, i, n) {
  31796. var r = e[t];
  31797. return function(o) {
  31798. e[t] = r * (1 - o) + i * o,
  31799. n && n(e[t])
  31800. }
  31801. },
  31802. uniform: function(e, t, i) {
  31803. var n = e.material.uniforms[t].value;
  31804. return function(r) {
  31805. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31806. }
  31807. },
  31808. matrix4: function(e, t) {
  31809. var i = e.clone();
  31810. return function(n) {
  31811. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31812. r[s] = o[s] * (1 - n) + a[s] * n
  31813. }
  31814. },
  31815. allUniforms: function(e, t, i) {
  31816. var n = e.map(function(e) {
  31817. return this.uniform(e, t, i)
  31818. }
  31819. .bind(this));
  31820. return function(e) {
  31821. n.forEach(function(t) {
  31822. t(e)
  31823. })
  31824. }
  31825. }
  31826. }
  31827. }
  31828. , {}],
  31829. 189: [function(e, t, i) {//"./util/logger"
  31830. "use strict";
  31831. function n(e) {
  31832. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31833. if (n.consoleEnabled) {
  31834. var h = function(e) {
  31835. $("#debug-console").append("<p>" + e + "</p>"),
  31836. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31837. };
  31838. t = function(e) {
  31839. h(Array.prototype.slice.call(arguments).join(" "))
  31840. }
  31841. ,
  31842. i = function(e) {
  31843. h(Array.prototype.slice.call(arguments).join(" "))
  31844. }
  31845. ,
  31846. o = function(e) {
  31847. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31848. }
  31849. ,
  31850. a = function(e) {
  31851. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31852. }
  31853. } else
  31854. console.log ? (t = console.log,
  31855. i = console.info ? console.info : console.log,
  31856. o = console.warn ? console.warn : console.log,
  31857. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31858. ;
  31859. var u = function(e) {
  31860. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31861. }
  31862. , d = function(t, i) {
  31863. if (r) {
  31864. var o = Array.prototype.slice.call(t).join(" ");
  31865. r.captureMessage(o, {
  31866. level: i,
  31867. path: e,
  31868. timestamp: n.timestamp()
  31869. })
  31870. }
  31871. }
  31872. , p = function(t, i) {
  31873. if (r) {
  31874. var o = Array.prototype.slice.call(t).join(" ");
  31875. r.captureException(new Error(o), {
  31876. level: i,
  31877. path: e,
  31878. timestamp: n.timestamp()
  31879. })
  31880. }
  31881. };
  31882. return {
  31883. debug: function() {
  31884. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31885. },
  31886. info: function() {
  31887. n.level >= n.levels.info && i.apply(console, u(arguments))
  31888. },
  31889. warn: function() {
  31890. d(arguments, "warn"),
  31891. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31892. },
  31893. error: function() {
  31894. p(arguments, "error"),
  31895. n.level >= n.levels.error && a.apply(console, u(arguments))
  31896. },
  31897. v3str: function(e, t) {
  31898. var i = void 0 === t ? 2 : t;
  31899. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31900. },
  31901. eulstr: function(e, t) {
  31902. var i = void 0 === t ? 2 : t;
  31903. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31904. },
  31905. time: function(e) {
  31906. n.level >= n.levels.debug && (c[e] = Date.now())
  31907. },
  31908. timeEnd: function(e) {
  31909. if (n.level >= n.levels.debug) {
  31910. var t = c[e];
  31911. if (!t)
  31912. return;
  31913. var i = (Date.now() - t) / 1e3;
  31914. this.debug(e, i + "s")
  31915. }
  31916. }
  31917. }
  31918. }
  31919. var r = window.Raven;
  31920. n.timestamp = function() {
  31921. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31922. }
  31923. ,
  31924. n.levels = {
  31925. debug: 3,
  31926. info: 2,
  31927. warn: 1,
  31928. error: 0
  31929. },
  31930. n.level = n.levels.info,
  31931. t.exports = n
  31932. }
  31933. , {}],
  31934. 190: [function(e, t, i) {//"../util/math"
  31935. "use strict";
  31936. var n = e("three")
  31937. , r = e("../enum/GLCubeFaces")
  31938. , o = e("../constants");
  31939. t.exports = {
  31940. convertVisionVector: function(e) {
  31941. return new n.Vector3(e.x,e.z,-e.y)
  31942. },
  31943. convertVisionQuaternion: function(e) {
  31944. 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)))
  31945. },
  31946. convertWorkshopVector: function(e) {
  31947. return new n.Vector3(-e.x,e.y,e.z)
  31948. },
  31949. convertWorkshopQuaternion: function(e) {
  31950. 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))
  31951. },
  31952. convertWorkshopPanoramaQuaternion: function(e) {
  31953. 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)))
  31954. },
  31955. convertWorkshopOrthoZoom: function(e) {
  31956. return e === -1 ? -1 : e / 16 * ($('#player').width() / $('#player').height()) / o.workshopApsect
  31957. },
  31958. toPrecision: function(e, t) {
  31959. var i = Math.pow(10, t);
  31960. return Math.round(e * i) / i
  31961. },
  31962. isEmptyQuaternion: function(e) {
  31963. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31964. },
  31965. projectPositionToCanvas: function(e, t, i) {
  31966. i = i || new n.Vector3,
  31967. i.copy(e);
  31968. var r = .5 * $('#player').width()
  31969. , o = .5 * $('#player').height();
  31970. return i.project(t),
  31971. i.x = i.x * r + r,
  31972. i.y = -(i.y * o) + o,
  31973. i
  31974. },
  31975. convertScreenPositionToNDC: function(e, t, i) {
  31976. return i = i || new n.Vector2,
  31977. i.x = e / $('#player').width() * 2 - 1,
  31978. i.y = 2 * -(t / $('#player').height()) + 1,
  31979. i
  31980. },
  31981. constrainedTurn: function(e) {
  31982. var t = e % (2 * Math.PI);
  31983. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31984. },
  31985. getFOVDotThreshold: function(e) {
  31986. return Math.cos(n.Math.degToRad(e / 2))
  31987. },
  31988. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31989. switch (e) {
  31990. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31991. i.set(1, t.y, t.x);
  31992. break;
  31993. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31994. i.set(-1, t.y, -t.x);
  31995. break;
  31996. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31997. i.set(-t.x, 1, -t.y);
  31998. break;
  31999. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  32000. i.set(-t.x, -1, t.y);
  32001. break;
  32002. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  32003. i.set(-t.x, t.y, 1);
  32004. break;
  32005. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  32006. i.set(t.x, t.y, -1)
  32007. }
  32008. n && i.normalize()
  32009. }
  32010. }
  32011. }
  32012. , {
  32013. "../constants": 8,
  32014. "../enum/GLCubeFaces": 25,
  32015. three: 217
  32016. }],
  32017. 191: [function(e, t, i) {//"../util/panorama"
  32018. "use strict";
  32019. function n(e, t, i) {
  32020. return a.map(function(n, o) {
  32021. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  32022. }
  32023. .bind(this))
  32024. }
  32025. function r(e) {
  32026. return s[e]
  32027. }
  32028. var o = e("../enum/GLCubeFaces")
  32029. , a = [0, 1, 2, 3, 4, 5]
  32030. , s = {
  32031. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  32032. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  32033. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  32034. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  32035. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  32036. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  32037. };
  32038. t.exports = {
  32039. mapFaceToCubemapFace: r,
  32040. getCubemapUrls: n
  32041. }
  32042. }
  32043. , {
  32044. "../enum/GLCubeFaces": 25
  32045. }],
  32046. 192: [function(e, t, i) {//"./util/sentry"
  32047. "use strict";
  32048. t.exports = {
  32049. captureErrors: function(e, t, i) {
  32050. if ("Raven"in window) {
  32051. Raven.config(e, t).install(),
  32052. i && Raven.setTagsContext(i);
  32053. var n = console.warn
  32054. , r = console.error;
  32055. console.warn = function() {
  32056. var e = Array.prototype.slice.call(arguments);
  32057. Raven.captureMessage(e.join(" "), {
  32058. level: "warning"
  32059. }),
  32060. n.apply(console, e)
  32061. }
  32062. ,
  32063. console.error = function() {
  32064. var e = Array.prototype.slice.call(arguments);
  32065. Raven.captureException(new Error(e.join(" ")), {
  32066. level: "error"
  32067. }),
  32068. r.apply(console, e)
  32069. }
  32070. } else
  32071. console.error("Raven not found, not capturing errors.")
  32072. }
  32073. }
  32074. }
  32075. , {}],
  32076. 193: [function(e, t, i) {///js/util/showcase.js
  32077. (function(i) {
  32078. "use strict";
  32079. var n = e("./browser")
  32080. , r = e("../constants")
  32081. , o = e("url")
  32082. , a = e("./logger")
  32083. , s = new a(i)
  32084. , l = {
  32085. getAuthorizationHeader: function() {
  32086. var e = n.valueFromHash("auth");
  32087. if (e)
  32088. return e.replace(",", " ");
  32089. var t = n.valueFromCookie("token");
  32090. return t ? "Token " + t : null
  32091. },
  32092. parseSidUrl: function(e) {
  32093. var t, i;
  32094. if (e = e || "",
  32095. e.match(/^https?/)) {//改
  32096. var n = o.parse(e);
  32097. t = n.protocol + "//" + n.host,
  32098. i = e
  32099. } else //xzw 原先的不能用
  32100. //t = window.location.protocol + "//" + window.location.host, //MP
  32101. t = ""
  32102. //i = t + "/api/player/models/" + e; //MP
  32103. i = t + "data/" + e;
  32104. return {
  32105. urlBase: t ,
  32106. urlModel: i,
  32107. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  32108. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  32109. }
  32110. },
  32111. getModelIDFromQueryString: function() {
  32112. return n.valueFromHash("model") || n.valueFromHash("m")
  32113. },
  32114. normalizeModeldata: function(e, t) {
  32115. e = JSON.parse(JSON.stringify(e));
  32116. var i = null;
  32117. if (e.images.forEach(function(n) {
  32118. if (n.metadata && "string" == typeof n.metadata)
  32119. try {
  32120. n.metadata = JSON.parse(n.metadata)
  32121. } catch (e) {
  32122. s.warn("Unable to parse image metadata"),
  32123. n.metadata = null
  32124. }
  32125. else
  32126. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  32127. n.metadata && (n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  32128. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position)),
  32129. !i && e.icon && e.icon === n.sid && (i = n.metadata))
  32130. }),
  32131. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  32132. var n = {};
  32133. n.pano = {
  32134. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  32135. position: t.convertWorkshopVector(i.scan_position),
  32136. uuid: i.scan_id
  32137. },
  32138. n.camera = {
  32139. quaternion: i.camera_quaternion,
  32140. position: i.camera_position
  32141. },
  32142. e.startPano = n
  32143. }
  32144. return e
  32145. },
  32146. visionVersionToInt: function() {
  32147. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  32148. return function(t) {
  32149. if (!t)
  32150. throw new Error("Vision version is required");
  32151. var i = e.exec(t);
  32152. if (null === i)
  32153. throw new Error("String is not a vision version: " + t);
  32154. return parseInt(i[1])
  32155. }
  32156. }(),
  32157. modelDataPromisesTiles: function(e) {
  32158. if (e.vision_version)
  32159. try {
  32160. return l.visionVersionToInt(e.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  32161. } catch (t) {
  32162. s.warn("Invalid vision version: " + e.vision_version)
  32163. }
  32164. var t = e.created ? new Date(e.created) : null;
  32165. return t && t >= r.visionTilingStartDate
  32166. }
  32167. };
  32168. t.exports = l
  32169. }
  32170. ).call(this, "/js/util/showcase.js")
  32171. }
  32172. , {
  32173. "../constants": 8,
  32174. "./browser": 182,
  32175. "./logger": 189,
  32176. url: 208
  32177. }],
  32178. 194: [function(e, t, i) {//"../util/texture"
  32179. "use strict";
  32180. var n = e("../util/ajax")
  32181. , r = e("three")
  32182. , o = e("../settings")
  32183. , a = {};
  32184. t.exports = {
  32185. load: function(e, t, i) {
  32186. var s = a[e];
  32187. return s ? (t && setTimeout(function() {
  32188. t(s)
  32189. }, 1),
  32190. s) : (s = new r.Texture,
  32191. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  32192. s.magFilter = r.LinearFilter,
  32193. s.generateMipmaps = !1),
  32194. s.sourceFile = e,
  32195. a[e] = s,
  32196. n.getImage(e).then(function(e) {
  32197. s.image = e,
  32198. s.needsUpdate = !0,
  32199. t && t(s)
  32200. }).fail(i),
  32201. s)
  32202. },
  32203. loadBase64: function(e, t) {
  32204. t = t || "png";
  32205. var i = new r.Texture;
  32206. return i.image = document.createElement("img"),
  32207. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  32208. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  32209. i.magFilter = r.LinearFilter,
  32210. i.generateMipmaps = !1),
  32211. i.needsUpdate = !0,
  32212. i
  32213. },
  32214. isLoaded: function(e) {
  32215. return !!a[e]
  32216. }
  32217. }
  32218. }
  32219. , {
  32220. "../settings": 166,
  32221. "../util/ajax": 181,
  32222. three: 217
  32223. }],
  32224. 195: [function(e, t, i) {//"./util/transitions"
  32225. "use strict";
  32226. var n = e("./easing");
  32227. t.exports = {
  32228. globalDone: null,
  32229. funcs: [],
  32230. counter: 0,
  32231. uniqueID: 0,
  32232. start: function(e, t, i, r, o, a, s) {
  32233. return r = r || 0,
  32234. this.funcs.push({
  32235. func: e,
  32236. current: -r * Math.abs(t),
  32237. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  32238. done: i,
  32239. easing: o || n.linearTween,
  32240. cycling: t < 0,
  32241. running: !0,
  32242. debug: r < 0,
  32243. name: a || "T" + this.counter,
  32244. id: void 0 === s ? this.counter : s,
  32245. paused: !1
  32246. }),
  32247. e(0, 16),
  32248. this.counter += 1,
  32249. e
  32250. },
  32251. trigger: function(e) {
  32252. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  32253. , i = e.func || function() {}
  32254. , r = void 0 === e.duration ? 0 : e.duration;
  32255. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  32256. var o = e.done || null
  32257. , a = e.easing || n.linearTween
  32258. , s = e.name || "R" + this.counter
  32259. , l = void 0 === e.id ? this.counter : e.id;
  32260. return this.start(i, r, o, t, a, s, l)
  32261. },
  32262. setTimeout: function(e, t, i) {
  32263. var n = void 0 === i ? this.counter : i;
  32264. return this.trigger({
  32265. done: e,
  32266. duration: void 0 === t ? 0 : t,
  32267. name: "O" + this.counter,
  32268. id: n
  32269. })
  32270. },
  32271. pause: function() {
  32272. this.paused = !0
  32273. },
  32274. resume: function() {
  32275. this.paused = !1
  32276. },
  32277. update: function(e) {
  32278. this.funcs.forEach(function(t) {
  32279. if (!(t.paused || (t.current += 1e3 * e,
  32280. t.current < 0)))
  32281. if (t.current >= t.duration && !t.cycling) {
  32282. var i = t.easing(1, 0, 1, 1);
  32283. t.func(i, 1e3 * e),
  32284. t.done && t.done(),
  32285. t.running = !1
  32286. } else {
  32287. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  32288. , r = t.func(n, 1e3 * e) || !1;
  32289. r && (t.done && t.done(),
  32290. t.running = !1)
  32291. }
  32292. });
  32293. var t = this.funcs.length;
  32294. this.funcs = this.funcs.filter(function(e) {
  32295. return e.running
  32296. });
  32297. var i = this.funcs.length;
  32298. if (t > 0 && 0 === i && this.globalDone) {
  32299. var n = this.globalDone;
  32300. this.globalDone = null,
  32301. n()
  32302. }
  32303. },
  32304. adjustSpeed: function(e, t) {
  32305. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  32306. var r = i[n];
  32307. r.duration /= t,
  32308. r.current /= t
  32309. }
  32310. },
  32311. getById: function(e) {
  32312. return this.funcs.filter(function(t) {
  32313. return e === t.id
  32314. })
  32315. },
  32316. get: function(e) {
  32317. for (var t = 0; t < this.funcs.length; t += 1)
  32318. if (this.funcs[t].func === e)
  32319. return this.funcs[t];
  32320. return null
  32321. },
  32322. isRunning: function(e) {
  32323. var t = this.get(e);
  32324. return null !== t && t.running
  32325. },
  32326. countActive: function() {
  32327. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  32328. e += this.funcs[t].running;
  32329. return e
  32330. },
  32331. listActive: function() {
  32332. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  32333. this.funcs[t].running && e.push(this.funcs[t].name);
  32334. return e
  32335. },
  32336. done: function(e) {
  32337. this.globalDone = e
  32338. },
  32339. cancelById: function(e) {
  32340. var t = void 0 === e ? 0 : e;
  32341. this.funcs = this.funcs.filter(function(e) {
  32342. return e.id !== t
  32343. })
  32344. },
  32345. cancel: function(e) {
  32346. this.funcs = this.funcs.filter(function(t) {
  32347. return t.func !== e
  32348. })
  32349. },
  32350. getUniqueId: function() {
  32351. return this.uniqueID -= 1,
  32352. this.uniqueID
  32353. }
  32354. }
  32355. }
  32356. , {
  32357. "./easing": 186
  32358. }],
  32359. 196: [function(e, t, i) {//Set
  32360. function n(e) {
  32361. if (this.set = {},
  32362. this.infContains = function() {
  32363. return !0
  32364. }
  32365. ,
  32366. "object" == typeof e)
  32367. if (e instanceof Array)
  32368. for (var t = 0; t < e.length; t++)
  32369. this.set[e[t]] = !0;
  32370. else
  32371. this.set = e;
  32372. else if ("function" == typeof e)
  32373. this.infContains = e;
  32374. else if ("undefined" != typeof e)
  32375. throw new Error("set must be either an array or an object.")
  32376. }
  32377. t.exports = n,
  32378. n.prototype.contains = function(e) {
  32379. return !!this.set[e]
  32380. }
  32381. ,
  32382. n.prototype.has = n.prototype.contains,
  32383. n.prototype.add = function(e) {
  32384. if (1 == arguments.length)
  32385. this.set[e] = !0;
  32386. else
  32387. for (var t = 0; t < arguments.length; t++)
  32388. this.set[arguments[t]] = !0
  32389. }
  32390. ,
  32391. n.prototype.addAll = function(e) {
  32392. if ("object" != typeof e && !(e instanceof Array))
  32393. throw new Error("arr must be an array.");
  32394. for (var t = 0; t < e.length; t++)
  32395. this.add(e[t])
  32396. }
  32397. ,
  32398. n.prototype.remove = function(e) {
  32399. if (1 == arguments.length)
  32400. delete this.set[e];
  32401. else
  32402. for (var t = 0; t < arguments.length; t++)
  32403. delete this.set[arguments[t]]
  32404. }
  32405. ,
  32406. n.prototype.delete = n.prototype.remove,
  32407. n.prototype.clear = function() {
  32408. this.set = {}
  32409. }
  32410. ,
  32411. n.prototype.size = function() {
  32412. return Object.keys(this.set).length
  32413. }
  32414. ,
  32415. n.prototype.toString = function() {
  32416. return "{" + Object.keys(this.set).toString() + "}"
  32417. }
  32418. ,
  32419. n.prototype.toArray = function() {
  32420. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  32421. }
  32422. ,
  32423. n.prototype["*values"] = n.prototype.toArray
  32424. }
  32425. , {}],
  32426. 197: [function(e, t, i) {}//fs path ?
  32427. , {}],
  32428. 198: [function(e, t, i) {//buffer
  32429. (function(t) {
  32430. "use strict";
  32431. function n() {
  32432. try {
  32433. var e = new Uint8Array(1);
  32434. return e.__proto__ = {
  32435. __proto__: Uint8Array.prototype,
  32436. foo: function() {
  32437. return 42
  32438. }
  32439. },
  32440. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  32441. } catch (e) {
  32442. return !1
  32443. }
  32444. }
  32445. function r() {
  32446. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  32447. }
  32448. function o(e, t) {
  32449. if (r() < t)
  32450. throw new RangeError("Invalid typed array length");
  32451. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  32452. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  32453. e.length = t),
  32454. e
  32455. }
  32456. function a(e, t, i) {
  32457. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  32458. return new a(e,t,i);
  32459. if ("number" == typeof e) {
  32460. if ("string" == typeof t)
  32461. throw new Error("If encoding is specified then the first argument must be a string");
  32462. return h(this, e)
  32463. }
  32464. return s(this, e, t, i)
  32465. }
  32466. function s(e, t, i, n) {
  32467. if ("number" == typeof t)
  32468. throw new TypeError('"value" argument must not be a number');
  32469. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  32470. }
  32471. function l(e) {
  32472. if ("number" != typeof e)
  32473. throw new TypeError('"size" argument must be a number');
  32474. if (e < 0)
  32475. throw new RangeError('"size" argument must not be negative')
  32476. }
  32477. function c(e, t, i, n) {
  32478. return l(t),
  32479. 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)
  32480. }
  32481. function h(e, t) {
  32482. if (l(t),
  32483. e = o(e, t < 0 ? 0 : 0 | g(t)),
  32484. !a.TYPED_ARRAY_SUPPORT)
  32485. for (var i = 0; i < t; ++i)
  32486. e[i] = 0;
  32487. return e
  32488. }
  32489. function u(e, t, i) {
  32490. if ("string" == typeof i && "" !== i || (i = "utf8"),
  32491. !a.isEncoding(i))
  32492. throw new TypeError('"encoding" must be a valid string encoding');
  32493. var n = 0 | v(t, i);
  32494. e = o(e, n);
  32495. var r = e.write(t, i);
  32496. return r !== n && (e = e.slice(0, r)),
  32497. e
  32498. }
  32499. function d(e, t) {
  32500. var i = t.length < 0 ? 0 : 0 | g(t.length);
  32501. e = o(e, i);
  32502. for (var n = 0; n < i; n += 1)
  32503. e[n] = 255 & t[n];
  32504. return e
  32505. }
  32506. function p(e, t, i, n) {
  32507. if (t.byteLength,
  32508. i < 0 || t.byteLength < i)
  32509. throw new RangeError("'offset' is out of bounds");
  32510. if (t.byteLength < i + (n || 0))
  32511. throw new RangeError("'length' is out of bounds");
  32512. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  32513. a.TYPED_ARRAY_SUPPORT ? (e = t,
  32514. e.__proto__ = a.prototype) : e = d(e, t),
  32515. e
  32516. }
  32517. function f(e, t) {
  32518. if (a.isBuffer(t)) {
  32519. var i = 0 | g(t.length);
  32520. return e = o(e, i),
  32521. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  32522. e)
  32523. }
  32524. if (t) {
  32525. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  32526. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  32527. if ("Buffer" === t.type && $(t.data))
  32528. return d(e, t.data)
  32529. }
  32530. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  32531. }
  32532. function g(e) {
  32533. if (e >= r())
  32534. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  32535. return 0 | e
  32536. }
  32537. function m(e) {
  32538. return +e != e && (e = 0),
  32539. a.alloc(+e)
  32540. }
  32541. function v(e, t) {
  32542. if (a.isBuffer(e))
  32543. return e.length;
  32544. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  32545. return e.byteLength;
  32546. "string" != typeof e && (e = "" + e);
  32547. var i = e.length;
  32548. if (0 === i)
  32549. return 0;
  32550. for (var n = !1; ; )
  32551. switch (t) {
  32552. case "ascii":
  32553. case "latin1":
  32554. case "binary":
  32555. return i;
  32556. case "utf8":
  32557. case "utf-8":
  32558. case void 0:
  32559. return j(e).length;
  32560. case "ucs2":
  32561. case "ucs-2":
  32562. case "utf16le":
  32563. case "utf-16le":
  32564. return 2 * i;
  32565. case "hex":
  32566. return i >>> 1;
  32567. case "base64":
  32568. return Z(e).length;
  32569. default:
  32570. if (n)
  32571. return j(e).length;
  32572. t = ("" + t).toLowerCase(),
  32573. n = !0
  32574. }
  32575. }
  32576. function A(e, t, i) {
  32577. var n = !1;
  32578. if ((void 0 === t || t < 0) && (t = 0),
  32579. t > this.length)
  32580. return "";
  32581. if ((void 0 === i || i > this.length) && (i = this.length),
  32582. i <= 0)
  32583. return "";
  32584. if (i >>>= 0,
  32585. t >>>= 0,
  32586. i <= t)
  32587. return "";
  32588. for (e || (e = "utf8"); ; )
  32589. switch (e) {
  32590. case "hex":
  32591. return L(this, t, i);
  32592. case "utf8":
  32593. case "utf-8":
  32594. return M(this, t, i);
  32595. case "ascii":
  32596. return P(this, t, i);
  32597. case "latin1":
  32598. case "binary":
  32599. return O(this, t, i);
  32600. case "base64":
  32601. return S(this, t, i);
  32602. case "ucs2":
  32603. case "ucs-2":
  32604. case "utf16le":
  32605. case "utf-16le":
  32606. return D(this, t, i);
  32607. default:
  32608. if (n)
  32609. throw new TypeError("Unknown encoding: " + e);
  32610. e = (e + "").toLowerCase(),
  32611. n = !0
  32612. }
  32613. }
  32614. function y(e, t, i) {
  32615. var n = e[t];
  32616. e[t] = e[i],
  32617. e[i] = n
  32618. }
  32619. function C(e, t, i, n, r) {
  32620. if (0 === e.length)
  32621. return -1;
  32622. if ("string" == typeof i ? (n = i,
  32623. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  32624. i = +i,
  32625. isNaN(i) && (i = r ? 0 : e.length - 1),
  32626. i < 0 && (i = e.length + i),
  32627. i >= e.length) {
  32628. if (r)
  32629. return -1;
  32630. i = e.length - 1
  32631. } else if (i < 0) {
  32632. if (!r)
  32633. return -1;
  32634. i = 0
  32635. }
  32636. if ("string" == typeof t && (t = a.from(t, n)),
  32637. a.isBuffer(t))
  32638. return 0 === t.length ? -1 : I(e, t, i, n, r);
  32639. if ("number" == typeof t)
  32640. return t &= 255,
  32641. 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);
  32642. throw new TypeError("val must be string, number or Buffer")
  32643. }
  32644. function I(e, t, i, n, r) {
  32645. function o(e, t) {
  32646. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  32647. }
  32648. var a = 1
  32649. , s = e.length
  32650. , l = t.length;
  32651. if (void 0 !== n && (n = String(n).toLowerCase(),
  32652. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  32653. if (e.length < 2 || t.length < 2)
  32654. return -1;
  32655. a = 2,
  32656. s /= 2,
  32657. l /= 2,
  32658. i /= 2
  32659. }
  32660. var c;
  32661. if (r) {
  32662. var h = -1;
  32663. for (c = i; c < s; c++)
  32664. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32665. if (h === -1 && (h = c),
  32666. c - h + 1 === l)
  32667. return h * a
  32668. } else
  32669. h !== -1 && (c -= c - h),
  32670. h = -1
  32671. } else
  32672. for (i + l > s && (i = s - l),
  32673. c = i; c >= 0; c--) {
  32674. for (var u = !0, d = 0; d < l; d++)
  32675. if (o(e, c + d) !== o(t, d)) {
  32676. u = !1;
  32677. break
  32678. }
  32679. if (u)
  32680. return c
  32681. }
  32682. return -1
  32683. }
  32684. function E(e, t, i, n) {
  32685. i = Number(i) || 0;
  32686. var r = e.length - i;
  32687. n ? (n = Number(n),
  32688. n > r && (n = r)) : n = r;
  32689. var o = t.length;
  32690. if (o % 2 !== 0)
  32691. throw new TypeError("Invalid hex string");
  32692. n > o / 2 && (n = o / 2);
  32693. for (var a = 0; a < n; ++a) {
  32694. var s = parseInt(t.substr(2 * a, 2), 16);
  32695. if (isNaN(s))
  32696. return a;
  32697. e[i + a] = s
  32698. }
  32699. return a
  32700. }
  32701. function b(e, t, i, n) {
  32702. return q(j(t, e.length - i), e, i, n)
  32703. }
  32704. function w(e, t, i, n) {
  32705. return q(Y(t), e, i, n)
  32706. }
  32707. function _(e, t, i, n) {
  32708. return w(e, t, i, n)
  32709. }
  32710. function T(e, t, i, n) {
  32711. return q(Z(t), e, i, n)
  32712. }
  32713. function x(e, t, i, n) {
  32714. return q(X(t, e.length - i), e, i, n)
  32715. }
  32716. function S(e, t, i) {
  32717. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32718. }
  32719. function M(e, t, i) {
  32720. i = Math.min(e.length, i);
  32721. for (var n = [], r = t; r < i; ) {
  32722. var o = e[r]
  32723. , a = null
  32724. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32725. if (r + s <= i) {
  32726. var l, c, h, u;
  32727. switch (s) {
  32728. case 1:
  32729. o < 128 && (a = o);
  32730. break;
  32731. case 2:
  32732. l = e[r + 1],
  32733. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32734. u > 127 && (a = u));
  32735. break;
  32736. case 3:
  32737. l = e[r + 1],
  32738. c = e[r + 2],
  32739. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32740. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32741. break;
  32742. case 4:
  32743. l = e[r + 1],
  32744. c = e[r + 2],
  32745. h = e[r + 3],
  32746. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32747. u > 65535 && u < 1114112 && (a = u))
  32748. }
  32749. }
  32750. null === a ? (a = 65533,
  32751. s = 1) : a > 65535 && (a -= 65536,
  32752. n.push(a >>> 10 & 1023 | 55296),
  32753. a = 56320 | 1023 & a),
  32754. n.push(a),
  32755. r += s
  32756. }
  32757. return R(n)
  32758. }
  32759. function R(e) {
  32760. var t = e.length;
  32761. if (t <= ee)
  32762. return String.fromCharCode.apply(String, e);
  32763. for (var i = "", n = 0; n < t; )
  32764. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32765. return i
  32766. }
  32767. function P(e, t, i) {
  32768. var n = "";
  32769. i = Math.min(e.length, i);
  32770. for (var r = t; r < i; ++r)
  32771. n += String.fromCharCode(127 & e[r]);
  32772. return n
  32773. }
  32774. function O(e, t, i) {
  32775. var n = "";
  32776. i = Math.min(e.length, i);
  32777. for (var r = t; r < i; ++r)
  32778. n += String.fromCharCode(e[r]);
  32779. return n
  32780. }
  32781. function L(e, t, i) {
  32782. var n = e.length;
  32783. (!t || t < 0) && (t = 0),
  32784. (!i || i < 0 || i > n) && (i = n);
  32785. for (var r = "", o = t; o < i; ++o)
  32786. r += W(e[o]);
  32787. return r
  32788. }
  32789. function D(e, t, i) {
  32790. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32791. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32792. return r
  32793. }
  32794. function N(e, t, i) {
  32795. if (e % 1 !== 0 || e < 0)
  32796. throw new RangeError("offset is not uint");
  32797. if (e + t > i)
  32798. throw new RangeError("Trying to access beyond buffer length")
  32799. }
  32800. function B(e, t, i, n, r, o) {
  32801. if (!a.isBuffer(e))
  32802. throw new TypeError('"buffer" argument must be a Buffer instance');
  32803. if (t > r || t < o)
  32804. throw new RangeError('"value" argument is out of bounds');
  32805. if (i + n > e.length)
  32806. throw new RangeError("Index out of range")
  32807. }
  32808. function F(e, t, i, n) {
  32809. t < 0 && (t = 65535 + t + 1);
  32810. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32811. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32812. }
  32813. function V(e, t, i, n) {
  32814. t < 0 && (t = 4294967295 + t + 1);
  32815. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32816. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32817. }
  32818. function U(e, t, i, n, r, o) {
  32819. if (i + n > e.length)
  32820. throw new RangeError("Index out of range");
  32821. if (i < 0)
  32822. throw new RangeError("Index out of range")
  32823. }
  32824. function k(e, t, i, n, r) {
  32825. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32826. J.write(e, t, i, n, 23, 4),
  32827. i + 4
  32828. }
  32829. function H(e, t, i, n, r) {
  32830. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32831. J.write(e, t, i, n, 52, 8),
  32832. i + 8
  32833. }
  32834. function G(e) {
  32835. if (e = z(e).replace(te, ""),
  32836. e.length < 2)
  32837. return "";
  32838. for (; e.length % 4 !== 0; )
  32839. e += "=";
  32840. return e
  32841. }
  32842. function z(e) {
  32843. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32844. }
  32845. function W(e) {
  32846. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32847. }
  32848. function j(e, t) {
  32849. t = t || 1 / 0;
  32850. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32851. if (i = e.charCodeAt(a),
  32852. i > 55295 && i < 57344) {
  32853. if (!r) {
  32854. if (i > 56319) {
  32855. (t -= 3) > -1 && o.push(239, 191, 189);
  32856. continue
  32857. }
  32858. if (a + 1 === n) {
  32859. (t -= 3) > -1 && o.push(239, 191, 189);
  32860. continue
  32861. }
  32862. r = i;
  32863. continue
  32864. }
  32865. if (i < 56320) {
  32866. (t -= 3) > -1 && o.push(239, 191, 189),
  32867. r = i;
  32868. continue
  32869. }
  32870. i = (r - 55296 << 10 | i - 56320) + 65536
  32871. } else
  32872. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32873. if (r = null,
  32874. i < 128) {
  32875. if ((t -= 1) < 0)
  32876. break;
  32877. o.push(i)
  32878. } else if (i < 2048) {
  32879. if ((t -= 2) < 0)
  32880. break;
  32881. o.push(i >> 6 | 192, 63 & i | 128)
  32882. } else if (i < 65536) {
  32883. if ((t -= 3) < 0)
  32884. break;
  32885. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32886. } else {
  32887. if (!(i < 1114112))
  32888. throw new Error("Invalid code point");
  32889. if ((t -= 4) < 0)
  32890. break;
  32891. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32892. }
  32893. }
  32894. return o
  32895. }
  32896. function Y(e) {
  32897. for (var t = [], i = 0; i < e.length; ++i)
  32898. t.push(255 & e.charCodeAt(i));
  32899. return t
  32900. }
  32901. function X(e, t) {
  32902. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32903. i = e.charCodeAt(a),
  32904. n = i >> 8,
  32905. r = i % 256,
  32906. o.push(r),
  32907. o.push(n);
  32908. return o
  32909. }
  32910. function Z(e) {
  32911. return Q.toByteArray(G(e))
  32912. }
  32913. function q(e, t, i, n) {
  32914. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32915. t[r + i] = e[r];
  32916. return r
  32917. }
  32918. function K(e) {
  32919. return e !== e
  32920. }
  32921. var Q = e("base64-js")
  32922. , J = e("ieee754")
  32923. , $ = e("isarray");
  32924. i.Buffer = a,
  32925. i.SlowBuffer = m,
  32926. i.INSPECT_MAX_BYTES = 50,
  32927. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32928. i.kMaxLength = r(),
  32929. a.poolSize = 8192,
  32930. a._augment = function(e) {
  32931. return e.__proto__ = a.prototype,
  32932. e
  32933. }
  32934. ,
  32935. a.from = function(e, t, i) {
  32936. return s(null, e, t, i)
  32937. }
  32938. ,
  32939. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32940. a.__proto__ = Uint8Array,
  32941. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32942. value: null,
  32943. configurable: !0
  32944. })),
  32945. a.alloc = function(e, t, i) {
  32946. return c(null, e, t, i)
  32947. }
  32948. ,
  32949. a.allocUnsafe = function(e) {
  32950. return h(null, e)
  32951. }
  32952. ,
  32953. a.allocUnsafeSlow = function(e) {
  32954. return h(null, e)
  32955. }
  32956. ,
  32957. a.isBuffer = function(e) {
  32958. return !(null == e || !e._isBuffer)
  32959. }
  32960. ,
  32961. a.compare = function(e, t) {
  32962. if (!a.isBuffer(e) || !a.isBuffer(t))
  32963. throw new TypeError("Arguments must be Buffers");
  32964. if (e === t)
  32965. return 0;
  32966. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32967. if (e[r] !== t[r]) {
  32968. i = e[r],
  32969. n = t[r];
  32970. break
  32971. }
  32972. return i < n ? -1 : n < i ? 1 : 0
  32973. }
  32974. ,
  32975. a.isEncoding = function(e) {
  32976. switch (String(e).toLowerCase()) {
  32977. case "hex":
  32978. case "utf8":
  32979. case "utf-8":
  32980. case "ascii":
  32981. case "latin1":
  32982. case "binary":
  32983. case "base64":
  32984. case "ucs2":
  32985. case "ucs-2":
  32986. case "utf16le":
  32987. case "utf-16le":
  32988. return !0;
  32989. default:
  32990. return !1
  32991. }
  32992. }
  32993. ,
  32994. a.concat = function(e, t) {
  32995. if (!$(e))
  32996. throw new TypeError('"list" argument must be an Array of Buffers');
  32997. if (0 === e.length)
  32998. return a.alloc(0);
  32999. var i;
  33000. if (void 0 === t)
  33001. for (t = 0,
  33002. i = 0; i < e.length; ++i)
  33003. t += e[i].length;
  33004. var n = a.allocUnsafe(t)
  33005. , r = 0;
  33006. for (i = 0; i < e.length; ++i) {
  33007. var o = e[i];
  33008. if (!a.isBuffer(o))
  33009. throw new TypeError('"list" argument must be an Array of Buffers');
  33010. o.copy(n, r),
  33011. r += o.length
  33012. }
  33013. return n
  33014. }
  33015. ,
  33016. a.byteLength = v,
  33017. a.prototype._isBuffer = !0,
  33018. a.prototype.swap16 = function() {
  33019. var e = this.length;
  33020. if (e % 2 !== 0)
  33021. throw new RangeError("Buffer size must be a multiple of 16-bits");
  33022. for (var t = 0; t < e; t += 2)
  33023. y(this, t, t + 1);
  33024. return this
  33025. }
  33026. ,
  33027. a.prototype.swap32 = function() {
  33028. var e = this.length;
  33029. if (e % 4 !== 0)
  33030. throw new RangeError("Buffer size must be a multiple of 32-bits");
  33031. for (var t = 0; t < e; t += 4)
  33032. y(this, t, t + 3),
  33033. y(this, t + 1, t + 2);
  33034. return this
  33035. }
  33036. ,
  33037. a.prototype.swap64 = function() {
  33038. var e = this.length;
  33039. if (e % 8 !== 0)
  33040. throw new RangeError("Buffer size must be a multiple of 64-bits");
  33041. for (var t = 0; t < e; t += 8)
  33042. y(this, t, t + 7),
  33043. y(this, t + 1, t + 6),
  33044. y(this, t + 2, t + 5),
  33045. y(this, t + 3, t + 4);
  33046. return this
  33047. }
  33048. ,
  33049. a.prototype.toString = function() {
  33050. var e = 0 | this.length;
  33051. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  33052. }
  33053. ,
  33054. a.prototype.equals = function(e) {
  33055. if (!a.isBuffer(e))
  33056. throw new TypeError("Argument must be a Buffer");
  33057. return this === e || 0 === a.compare(this, e)
  33058. }
  33059. ,
  33060. a.prototype.inspect = function() {
  33061. var e = ""
  33062. , t = i.INSPECT_MAX_BYTES;
  33063. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  33064. this.length > t && (e += " ... ")),
  33065. "<Buffer " + e + ">"
  33066. }
  33067. ,
  33068. a.prototype.compare = function(e, t, i, n, r) {
  33069. if (!a.isBuffer(e))
  33070. throw new TypeError("Argument must be a Buffer");
  33071. if (void 0 === t && (t = 0),
  33072. void 0 === i && (i = e ? e.length : 0),
  33073. void 0 === n && (n = 0),
  33074. void 0 === r && (r = this.length),
  33075. t < 0 || i > e.length || n < 0 || r > this.length)
  33076. throw new RangeError("out of range index");
  33077. if (n >= r && t >= i)
  33078. return 0;
  33079. if (n >= r)
  33080. return -1;
  33081. if (t >= i)
  33082. return 1;
  33083. if (t >>>= 0,
  33084. i >>>= 0,
  33085. n >>>= 0,
  33086. r >>>= 0,
  33087. this === e)
  33088. return 0;
  33089. 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)
  33090. if (c[u] !== h[u]) {
  33091. o = c[u],
  33092. s = h[u];
  33093. break
  33094. }
  33095. return o < s ? -1 : s < o ? 1 : 0
  33096. }
  33097. ,
  33098. a.prototype.includes = function(e, t, i) {
  33099. return this.indexOf(e, t, i) !== -1
  33100. }
  33101. ,
  33102. a.prototype.indexOf = function(e, t, i) {
  33103. return C(this, e, t, i, !0)
  33104. }
  33105. ,
  33106. a.prototype.lastIndexOf = function(e, t, i) {
  33107. return C(this, e, t, i, !1)
  33108. }
  33109. ,
  33110. a.prototype.write = function(e, t, i, n) {
  33111. if (void 0 === t)
  33112. n = "utf8",
  33113. i = this.length,
  33114. t = 0;
  33115. else if (void 0 === i && "string" == typeof t)
  33116. n = t,
  33117. i = this.length,
  33118. t = 0;
  33119. else {
  33120. if (!isFinite(t))
  33121. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  33122. t |= 0,
  33123. isFinite(i) ? (i |= 0,
  33124. void 0 === n && (n = "utf8")) : (n = i,
  33125. i = void 0)
  33126. }
  33127. var r = this.length - t;
  33128. if ((void 0 === i || i > r) && (i = r),
  33129. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  33130. throw new RangeError("Attempt to write outside buffer bounds");
  33131. n || (n = "utf8");
  33132. for (var o = !1; ; )
  33133. switch (n) {
  33134. case "hex":
  33135. return E(this, e, t, i);
  33136. case "utf8":
  33137. case "utf-8":
  33138. return b(this, e, t, i);
  33139. case "ascii":
  33140. return w(this, e, t, i);
  33141. case "latin1":
  33142. case "binary":
  33143. return _(this, e, t, i);
  33144. case "base64":
  33145. return T(this, e, t, i);
  33146. case "ucs2":
  33147. case "ucs-2":
  33148. case "utf16le":
  33149. case "utf-16le":
  33150. return x(this, e, t, i);
  33151. default:
  33152. if (o)
  33153. throw new TypeError("Unknown encoding: " + n);
  33154. n = ("" + n).toLowerCase(),
  33155. o = !0
  33156. }
  33157. }
  33158. ,
  33159. a.prototype.toJSON = function() {
  33160. return {
  33161. type: "Buffer",
  33162. data: Array.prototype.slice.call(this._arr || this, 0)
  33163. }
  33164. }
  33165. ;
  33166. var ee = 4096;
  33167. a.prototype.slice = function(e, t) {
  33168. var i = this.length;
  33169. e = ~~e,
  33170. t = void 0 === t ? i : ~~t,
  33171. e < 0 ? (e += i,
  33172. e < 0 && (e = 0)) : e > i && (e = i),
  33173. t < 0 ? (t += i,
  33174. t < 0 && (t = 0)) : t > i && (t = i),
  33175. t < e && (t = e);
  33176. var n;
  33177. if (a.TYPED_ARRAY_SUPPORT)
  33178. n = this.subarray(e, t),
  33179. n.__proto__ = a.prototype;
  33180. else {
  33181. var r = t - e;
  33182. n = new a(r,void 0);
  33183. for (var o = 0; o < r; ++o)
  33184. n[o] = this[o + e]
  33185. }
  33186. return n
  33187. }
  33188. ,
  33189. a.prototype.readUIntLE = function(e, t, i) {
  33190. e |= 0,
  33191. t |= 0,
  33192. i || N(e, t, this.length);
  33193. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  33194. n += this[e + o] * r;
  33195. return n
  33196. }
  33197. ,
  33198. a.prototype.readUIntBE = function(e, t, i) {
  33199. e |= 0,
  33200. t |= 0,
  33201. i || N(e, t, this.length);
  33202. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  33203. n += this[e + --t] * r;
  33204. return n
  33205. }
  33206. ,
  33207. a.prototype.readUInt8 = function(e, t) {
  33208. return t || N(e, 1, this.length),
  33209. this[e]
  33210. }
  33211. ,
  33212. a.prototype.readUInt16LE = function(e, t) {
  33213. return t || N(e, 2, this.length),
  33214. this[e] | this[e + 1] << 8
  33215. }
  33216. ,
  33217. a.prototype.readUInt16BE = function(e, t) {
  33218. return t || N(e, 2, this.length),
  33219. this[e] << 8 | this[e + 1]
  33220. }
  33221. ,
  33222. a.prototype.readUInt32LE = function(e, t) {
  33223. return t || N(e, 4, this.length),
  33224. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  33225. }
  33226. ,
  33227. a.prototype.readUInt32BE = function(e, t) {
  33228. return t || N(e, 4, this.length),
  33229. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  33230. }
  33231. ,
  33232. a.prototype.readIntLE = function(e, t, i) {
  33233. e |= 0,
  33234. t |= 0,
  33235. i || N(e, t, this.length);
  33236. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  33237. n += this[e + o] * r;
  33238. return r *= 128,
  33239. n >= r && (n -= Math.pow(2, 8 * t)),
  33240. n
  33241. }
  33242. ,
  33243. a.prototype.readIntBE = function(e, t, i) {
  33244. e |= 0,
  33245. t |= 0,
  33246. i || N(e, t, this.length);
  33247. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  33248. o += this[e + --n] * r;
  33249. return r *= 128,
  33250. o >= r && (o -= Math.pow(2, 8 * t)),
  33251. o
  33252. }
  33253. ,
  33254. a.prototype.readInt8 = function(e, t) {
  33255. return t || N(e, 1, this.length),
  33256. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  33257. }
  33258. ,
  33259. a.prototype.readInt16LE = function(e, t) {
  33260. t || N(e, 2, this.length);
  33261. var i = this[e] | this[e + 1] << 8;
  33262. return 32768 & i ? 4294901760 | i : i
  33263. }
  33264. ,
  33265. a.prototype.readInt16BE = function(e, t) {
  33266. t || N(e, 2, this.length);
  33267. var i = this[e + 1] | this[e] << 8;
  33268. return 32768 & i ? 4294901760 | i : i
  33269. }
  33270. ,
  33271. a.prototype.readInt32LE = function(e, t) {
  33272. return t || N(e, 4, this.length),
  33273. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  33274. }
  33275. ,
  33276. a.prototype.readInt32BE = function(e, t) {
  33277. return t || N(e, 4, this.length),
  33278. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  33279. }
  33280. ,
  33281. a.prototype.readFloatLE = function(e, t) {
  33282. return t || N(e, 4, this.length),
  33283. J.read(this, e, !0, 23, 4)
  33284. }
  33285. ,
  33286. a.prototype.readFloatBE = function(e, t) {
  33287. return t || N(e, 4, this.length),
  33288. J.read(this, e, !1, 23, 4)
  33289. }
  33290. ,
  33291. a.prototype.readDoubleLE = function(e, t) {
  33292. return t || N(e, 8, this.length),
  33293. J.read(this, e, !0, 52, 8)
  33294. }
  33295. ,
  33296. a.prototype.readDoubleBE = function(e, t) {
  33297. return t || N(e, 8, this.length),
  33298. J.read(this, e, !1, 52, 8)
  33299. }
  33300. ,
  33301. a.prototype.writeUIntLE = function(e, t, i, n) {
  33302. if (e = +e,
  33303. t |= 0,
  33304. i |= 0,
  33305. !n) {
  33306. var r = Math.pow(2, 8 * i) - 1;
  33307. B(this, e, t, i, r, 0)
  33308. }
  33309. var o = 1
  33310. , a = 0;
  33311. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  33312. this[t + a] = e / o & 255;
  33313. return t + i
  33314. }
  33315. ,
  33316. a.prototype.writeUIntBE = function(e, t, i, n) {
  33317. if (e = +e,
  33318. t |= 0,
  33319. i |= 0,
  33320. !n) {
  33321. var r = Math.pow(2, 8 * i) - 1;
  33322. B(this, e, t, i, r, 0)
  33323. }
  33324. var o = i - 1
  33325. , a = 1;
  33326. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  33327. this[t + o] = e / a & 255;
  33328. return t + i
  33329. }
  33330. ,
  33331. a.prototype.writeUInt8 = function(e, t, i) {
  33332. return e = +e,
  33333. t |= 0,
  33334. i || B(this, e, t, 1, 255, 0),
  33335. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  33336. this[t] = 255 & e,
  33337. t + 1
  33338. }
  33339. ,
  33340. a.prototype.writeUInt16LE = function(e, t, i) {
  33341. return e = +e,
  33342. t |= 0,
  33343. i || B(this, e, t, 2, 65535, 0),
  33344. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33345. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  33346. t + 2
  33347. }
  33348. ,
  33349. a.prototype.writeUInt16BE = function(e, t, i) {
  33350. return e = +e,
  33351. t |= 0,
  33352. i || B(this, e, t, 2, 65535, 0),
  33353. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  33354. this[t + 1] = 255 & e) : F(this, e, t, !1),
  33355. t + 2
  33356. }
  33357. ,
  33358. a.prototype.writeUInt32LE = function(e, t, i) {
  33359. return e = +e,
  33360. t |= 0,
  33361. i || B(this, e, t, 4, 4294967295, 0),
  33362. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  33363. this[t + 2] = e >>> 16,
  33364. this[t + 1] = e >>> 8,
  33365. this[t] = 255 & e) : V(this, e, t, !0),
  33366. t + 4
  33367. }
  33368. ,
  33369. a.prototype.writeUInt32BE = function(e, t, i) {
  33370. return e = +e,
  33371. t |= 0,
  33372. i || B(this, e, t, 4, 4294967295, 0),
  33373. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33374. this[t + 1] = e >>> 16,
  33375. this[t + 2] = e >>> 8,
  33376. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33377. t + 4
  33378. }
  33379. ,
  33380. a.prototype.writeIntLE = function(e, t, i, n) {
  33381. if (e = +e,
  33382. t |= 0,
  33383. !n) {
  33384. var r = Math.pow(2, 8 * i - 1);
  33385. B(this, e, t, i, r - 1, -r)
  33386. }
  33387. var o = 0
  33388. , a = 1
  33389. , s = 0;
  33390. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  33391. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  33392. this[t + o] = (e / a >> 0) - s & 255;
  33393. return t + i
  33394. }
  33395. ,
  33396. a.prototype.writeIntBE = function(e, t, i, n) {
  33397. if (e = +e,
  33398. t |= 0,
  33399. !n) {
  33400. var r = Math.pow(2, 8 * i - 1);
  33401. B(this, e, t, i, r - 1, -r)
  33402. }
  33403. var o = i - 1
  33404. , a = 1
  33405. , s = 0;
  33406. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  33407. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  33408. this[t + o] = (e / a >> 0) - s & 255;
  33409. return t + i
  33410. }
  33411. ,
  33412. a.prototype.writeInt8 = function(e, t, i) {
  33413. return e = +e,
  33414. t |= 0,
  33415. i || B(this, e, t, 1, 127, -128),
  33416. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  33417. e < 0 && (e = 255 + e + 1),
  33418. this[t] = 255 & e,
  33419. t + 1
  33420. }
  33421. ,
  33422. a.prototype.writeInt16LE = function(e, t, i) {
  33423. return e = +e,
  33424. t |= 0,
  33425. i || B(this, e, t, 2, 32767, -32768),
  33426. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33427. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  33428. t + 2
  33429. }
  33430. ,
  33431. a.prototype.writeInt16BE = function(e, t, i) {
  33432. return e = +e,
  33433. t |= 0,
  33434. i || B(this, e, t, 2, 32767, -32768),
  33435. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  33436. this[t + 1] = 255 & e) : F(this, e, t, !1),
  33437. t + 2
  33438. }
  33439. ,
  33440. a.prototype.writeInt32LE = function(e, t, i) {
  33441. return e = +e,
  33442. t |= 0,
  33443. i || B(this, e, t, 4, 2147483647, -2147483648),
  33444. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33445. this[t + 1] = e >>> 8,
  33446. this[t + 2] = e >>> 16,
  33447. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  33448. t + 4
  33449. }
  33450. ,
  33451. a.prototype.writeInt32BE = function(e, t, i) {
  33452. return e = +e,
  33453. t |= 0,
  33454. i || B(this, e, t, 4, 2147483647, -2147483648),
  33455. e < 0 && (e = 4294967295 + e + 1),
  33456. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33457. this[t + 1] = e >>> 16,
  33458. this[t + 2] = e >>> 8,
  33459. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33460. t + 4
  33461. }
  33462. ,
  33463. a.prototype.writeFloatLE = function(e, t, i) {
  33464. return k(this, e, t, !0, i)
  33465. }
  33466. ,
  33467. a.prototype.writeFloatBE = function(e, t, i) {
  33468. return k(this, e, t, !1, i)
  33469. }
  33470. ,
  33471. a.prototype.writeDoubleLE = function(e, t, i) {
  33472. return H(this, e, t, !0, i)
  33473. }
  33474. ,
  33475. a.prototype.writeDoubleBE = function(e, t, i) {
  33476. return H(this, e, t, !1, i)
  33477. }
  33478. ,
  33479. a.prototype.copy = function(e, t, i, n) {
  33480. if (i || (i = 0),
  33481. n || 0 === n || (n = this.length),
  33482. t >= e.length && (t = e.length),
  33483. t || (t = 0),
  33484. n > 0 && n < i && (n = i),
  33485. n === i)
  33486. return 0;
  33487. if (0 === e.length || 0 === this.length)
  33488. return 0;
  33489. if (t < 0)
  33490. throw new RangeError("targetStart out of bounds");
  33491. if (i < 0 || i >= this.length)
  33492. throw new RangeError("sourceStart out of bounds");
  33493. if (n < 0)
  33494. throw new RangeError("sourceEnd out of bounds");
  33495. n > this.length && (n = this.length),
  33496. e.length - t < n - i && (n = e.length - t + i);
  33497. var r, o = n - i;
  33498. if (this === e && i < t && t < n)
  33499. for (r = o - 1; r >= 0; --r)
  33500. e[r + t] = this[r + i];
  33501. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  33502. for (r = 0; r < o; ++r)
  33503. e[r + t] = this[r + i];
  33504. else
  33505. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  33506. return o
  33507. }
  33508. ,
  33509. a.prototype.fill = function(e, t, i, n) {
  33510. if ("string" == typeof e) {
  33511. if ("string" == typeof t ? (n = t,
  33512. t = 0,
  33513. i = this.length) : "string" == typeof i && (n = i,
  33514. i = this.length),
  33515. 1 === e.length) {
  33516. var r = e.charCodeAt(0);
  33517. r < 256 && (e = r)
  33518. }
  33519. if (void 0 !== n && "string" != typeof n)
  33520. throw new TypeError("encoding must be a string");
  33521. if ("string" == typeof n && !a.isEncoding(n))
  33522. throw new TypeError("Unknown encoding: " + n)
  33523. } else
  33524. "number" == typeof e && (e &= 255);
  33525. if (t < 0 || this.length < t || this.length < i)
  33526. throw new RangeError("Out of range index");
  33527. if (i <= t)
  33528. return this;
  33529. t >>>= 0,
  33530. i = void 0 === i ? this.length : i >>> 0,
  33531. e || (e = 0);
  33532. var o;
  33533. if ("number" == typeof e)
  33534. for (o = t; o < i; ++o)
  33535. this[o] = e;
  33536. else {
  33537. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  33538. , l = s.length;
  33539. for (o = 0; o < i - t; ++o)
  33540. this[o + t] = s[o % l]
  33541. }
  33542. return this
  33543. }
  33544. ;
  33545. var te = /[^+\/0-9A-Za-z-_]/g
  33546. }
  33547. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33548. }
  33549. , {
  33550. "base64-js": 199,
  33551. ieee754: 200,
  33552. isarray: 201
  33553. }],
  33554. 199: [function(e, t, i) {//base64-js
  33555. "use strict";
  33556. function n(e) {
  33557. var t = e.length;
  33558. if (t % 4 > 0)
  33559. throw new Error("Invalid string. Length must be a multiple of 4");
  33560. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  33561. }
  33562. function r(e) {
  33563. return 3 * e.length / 4 - n(e)
  33564. }
  33565. function o(e) {
  33566. var t, i, r, o, a, s, l = e.length;
  33567. a = n(e),
  33568. s = new u(3 * l / 4 - a),
  33569. r = a > 0 ? l - 4 : l;
  33570. var c = 0;
  33571. for (t = 0,
  33572. i = 0; t < r; t += 4,
  33573. i += 3)
  33574. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  33575. s[c++] = o >> 16 & 255,
  33576. s[c++] = o >> 8 & 255,
  33577. s[c++] = 255 & o;
  33578. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  33579. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  33580. s[c++] = o >> 8 & 255,
  33581. s[c++] = 255 & o),
  33582. s
  33583. }
  33584. function a(e) {
  33585. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  33586. }
  33587. function s(e, t, i) {
  33588. for (var n, r = [], o = t; o < i; o += 3)
  33589. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  33590. r.push(a(n));
  33591. return r.join("")
  33592. }
  33593. function l(e) {
  33594. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  33595. o.push(s(e, l, l + a > h ? h : l + a));
  33596. return 1 === n ? (t = e[i - 1],
  33597. r += c[t >> 2],
  33598. r += c[t << 4 & 63],
  33599. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  33600. r += c[t >> 10],
  33601. r += c[t >> 4 & 63],
  33602. r += c[t << 2 & 63],
  33603. r += "="),
  33604. o.push(r),
  33605. o.join("")
  33606. }
  33607. i.byteLength = r,
  33608. i.toByteArray = o,
  33609. i.fromByteArray = l;
  33610. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  33611. c[p] = d[p],
  33612. h[d.charCodeAt(p)] = p;
  33613. h["-".charCodeAt(0)] = 62,
  33614. h["_".charCodeAt(0)] = 63
  33615. }
  33616. , {}],
  33617. 200: [function(e, t, i) {//ieee754
  33618. i.read = function(e, t, i, n, r) {
  33619. 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];
  33620. for (u += d,
  33621. o = p & (1 << -h) - 1,
  33622. p >>= -h,
  33623. h += s; h > 0; o = 256 * o + e[t + u],
  33624. u += d,
  33625. h -= 8)
  33626. ;
  33627. for (a = o & (1 << -h) - 1,
  33628. o >>= -h,
  33629. h += n; h > 0; a = 256 * a + e[t + u],
  33630. u += d,
  33631. h -= 8)
  33632. ;
  33633. if (0 === o)
  33634. o = 1 - c;
  33635. else {
  33636. if (o === l)
  33637. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  33638. a += Math.pow(2, n),
  33639. o -= c
  33640. }
  33641. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33642. }
  33643. ,
  33644. i.write = function(e, t, i, n, r, o) {
  33645. 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;
  33646. for (t = Math.abs(t),
  33647. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  33648. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  33649. t * (l = Math.pow(2, -a)) < 1 && (a--,
  33650. l *= 2),
  33651. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  33652. t * l >= 2 && (a++,
  33653. l /= 2),
  33654. a + u >= h ? (s = 0,
  33655. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  33656. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33657. a = 0)); r >= 8; e[i + p] = 255 & s,
  33658. p += f,
  33659. s /= 256,
  33660. r -= 8)
  33661. ;
  33662. for (a = a << r | s,
  33663. c += r; c > 0; e[i + p] = 255 & a,
  33664. p += f,
  33665. a /= 256,
  33666. c -= 8)
  33667. ;
  33668. e[i + p - f] |= 128 * g
  33669. }
  33670. }
  33671. , {}],
  33672. 201: [function(e, t, i) {//isarray
  33673. var n = {}.toString;
  33674. t.exports = Array.isArray || function(e) {
  33675. return "[object Array]" == n.call(e)
  33676. }
  33677. }
  33678. , {}],
  33679. 202: [function(e, t, i) {//events
  33680. function n() {
  33681. this._events = this._events || {},
  33682. this._maxListeners = this._maxListeners || void 0
  33683. }
  33684. function r(e) {
  33685. return "function" == typeof e
  33686. }
  33687. function o(e) {
  33688. return "number" == typeof e
  33689. }
  33690. function a(e) {
  33691. return "object" == typeof e && null !== e
  33692. }
  33693. function s(e) {
  33694. return void 0 === e
  33695. }
  33696. t.exports = n,
  33697. n.EventEmitter = n,
  33698. n.prototype._events = void 0,
  33699. n.prototype._maxListeners = void 0,
  33700. n.defaultMaxListeners = 10,
  33701. n.prototype.setMaxListeners = function(e) {
  33702. if (!o(e) || e < 0 || isNaN(e))
  33703. throw TypeError("n must be a positive number");
  33704. return this._maxListeners = e,
  33705. this
  33706. }
  33707. ,
  33708. n.prototype.emit = function(e) {
  33709. var t, i, n, o, l, c;
  33710. if (this._events || (this._events = {}),
  33711. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33712. if (t = arguments[1],
  33713. t instanceof Error)
  33714. throw t;
  33715. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33716. throw h.context = t,
  33717. h
  33718. }
  33719. if (i = this._events[e],
  33720. s(i))
  33721. return !1;
  33722. if (r(i))
  33723. switch (arguments.length) {
  33724. case 1:
  33725. i.call(this);
  33726. break;
  33727. case 2:
  33728. i.call(this, arguments[1]);
  33729. break;
  33730. case 3:
  33731. i.call(this, arguments[1], arguments[2]);
  33732. break;
  33733. default:
  33734. o = Array.prototype.slice.call(arguments, 1),
  33735. i.apply(this, o)
  33736. }
  33737. else if (a(i))
  33738. for (o = Array.prototype.slice.call(arguments, 1),
  33739. c = i.slice(),
  33740. n = c.length,
  33741. l = 0; l < n; l++)
  33742. c[l].apply(this, o);
  33743. return !0
  33744. }
  33745. ,
  33746. n.prototype.addListener = function(e, t) {
  33747. var i;
  33748. if (!r(t))
  33749. throw TypeError("listener must be a function");
  33750. return this._events || (this._events = {}),
  33751. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33752. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33753. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33754. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33755. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33756. "function" == typeof console.trace && console.trace())),
  33757. this
  33758. }
  33759. ,
  33760. n.prototype.on = n.prototype.addListener,
  33761. n.prototype.once = function(e, t) {
  33762. function i() {
  33763. this.removeListener(e, i),
  33764. n || (n = !0,
  33765. t.apply(this, arguments))
  33766. }
  33767. if (!r(t))
  33768. throw TypeError("listener must be a function");
  33769. var n = !1;
  33770. return i.listener = t,
  33771. this.on(e, i),
  33772. this
  33773. }
  33774. ,
  33775. n.prototype.removeListener = function(e, t) {
  33776. var i, n, o, s;
  33777. if (!r(t))
  33778. throw TypeError("listener must be a function");
  33779. if (!this._events || !this._events[e])
  33780. return this;
  33781. if (i = this._events[e],
  33782. o = i.length,
  33783. n = -1,
  33784. i === t || r(i.listener) && i.listener === t)
  33785. delete this._events[e],
  33786. this._events.removeListener && this.emit("removeListener", e, t);
  33787. else if (a(i)) {
  33788. for (s = o; s-- > 0; )
  33789. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33790. n = s;
  33791. break
  33792. }
  33793. if (n < 0)
  33794. return this;
  33795. 1 === i.length ? (i.length = 0,
  33796. delete this._events[e]) : i.splice(n, 1),
  33797. this._events.removeListener && this.emit("removeListener", e, t)
  33798. }
  33799. return this
  33800. }
  33801. ,
  33802. n.prototype.removeAllListeners = function(e) {
  33803. var t, i;
  33804. if (!this._events)
  33805. return this;
  33806. if (!this._events.removeListener)
  33807. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33808. this;
  33809. if (0 === arguments.length) {
  33810. for (t in this._events)
  33811. "removeListener" !== t && this.removeAllListeners(t);
  33812. return this.removeAllListeners("removeListener"),
  33813. this._events = {},
  33814. this
  33815. }
  33816. if (i = this._events[e],
  33817. r(i))
  33818. this.removeListener(e, i);
  33819. else if (i)
  33820. for (; i.length; )
  33821. this.removeListener(e, i[i.length - 1]);
  33822. return delete this._events[e],
  33823. this
  33824. }
  33825. ,
  33826. n.prototype.listeners = function(e) {
  33827. var t;
  33828. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33829. }
  33830. ,
  33831. n.prototype.listenerCount = function(e) {
  33832. if (this._events) {
  33833. var t = this._events[e];
  33834. if (r(t))
  33835. return 1;
  33836. if (t)
  33837. return t.length
  33838. }
  33839. return 0
  33840. }
  33841. ,
  33842. n.listenerCount = function(e, t) {
  33843. return e.listenerCount(t)
  33844. }
  33845. }
  33846. , {}],
  33847. 203: [function(e, t, i) {//_process
  33848. function n() {
  33849. throw new Error("setTimeout has not been defined")
  33850. }
  33851. function r() {
  33852. throw new Error("clearTimeout has not been defined")
  33853. }
  33854. function o(e) {
  33855. if (u === setTimeout)
  33856. return setTimeout(e, 0);
  33857. if ((u === n || !u) && setTimeout)
  33858. return u = setTimeout,
  33859. setTimeout(e, 0);
  33860. try {
  33861. return u(e, 0)
  33862. } catch (t) {
  33863. try {
  33864. return u.call(null, e, 0)
  33865. } catch (t) {
  33866. return u.call(this, e, 0)
  33867. }
  33868. }
  33869. }
  33870. function a(e) {
  33871. if (d === clearTimeout)
  33872. return clearTimeout(e);
  33873. if ((d === r || !d) && clearTimeout)
  33874. return d = clearTimeout,
  33875. clearTimeout(e);
  33876. try {
  33877. return d(e)
  33878. } catch (t) {
  33879. try {
  33880. return d.call(null, e)
  33881. } catch (t) {
  33882. return d.call(this, e)
  33883. }
  33884. }
  33885. }
  33886. function s() {
  33887. m && f && (m = !1,
  33888. f.length ? g = f.concat(g) : v = -1,
  33889. g.length && l())
  33890. }
  33891. function l() {
  33892. if (!m) {
  33893. var e = o(s);
  33894. m = !0;
  33895. for (var t = g.length; t; ) {
  33896. for (f = g,
  33897. g = []; ++v < t; )
  33898. f && f[v].run();
  33899. v = -1,
  33900. t = g.length
  33901. }
  33902. f = null,
  33903. m = !1,
  33904. a(e)
  33905. }
  33906. }
  33907. function c(e, t) {
  33908. this.fun = e,
  33909. this.array = t
  33910. }
  33911. function h() {}
  33912. var u, d, p = t.exports = {};
  33913. !function() {
  33914. try {
  33915. u = "function" == typeof setTimeout ? setTimeout : n
  33916. } catch (e) {
  33917. u = n
  33918. }
  33919. try {
  33920. d = "function" == typeof clearTimeout ? clearTimeout : r
  33921. } catch (e) {
  33922. d = r
  33923. }
  33924. }();
  33925. var f, g = [], m = !1, v = -1;
  33926. p.nextTick = function(e) {
  33927. var t = new Array(arguments.length - 1);
  33928. if (arguments.length > 1)
  33929. for (var i = 1; i < arguments.length; i++)
  33930. t[i - 1] = arguments[i];
  33931. g.push(new c(e,t)),
  33932. 1 !== g.length || m || o(l)
  33933. }
  33934. ,
  33935. c.prototype.run = function() {
  33936. this.fun.apply(null, this.array)
  33937. }
  33938. ,
  33939. p.title = "browser",
  33940. p.browser = !0,
  33941. p.env = {},
  33942. p.argv = [],
  33943. p.version = "",
  33944. p.versions = {},
  33945. p.on = h,
  33946. p.addListener = h,
  33947. p.once = h,
  33948. p.off = h,
  33949. p.removeListener = h,
  33950. p.removeAllListeners = h,
  33951. p.emit = h,
  33952. p.binding = function(e) {
  33953. throw new Error("process.binding is not supported")
  33954. }
  33955. ,
  33956. p.cwd = function() {
  33957. return "/"
  33958. }
  33959. ,
  33960. p.chdir = function(e) {
  33961. throw new Error("process.chdir is not supported")
  33962. }
  33963. ,
  33964. p.umask = function() {
  33965. return 0
  33966. }
  33967. }
  33968. , {}],
  33969. 204: [function(e, t, i) {//punycode
  33970. (function(e) {
  33971. !function(n) {
  33972. function r(e) {
  33973. throw new RangeError(L[e])
  33974. }
  33975. function o(e, t) {
  33976. for (var i = e.length, n = []; i--; )
  33977. n[i] = t(e[i]);
  33978. return n
  33979. }
  33980. function a(e, t) {
  33981. var i = e.split("@")
  33982. , n = "";
  33983. i.length > 1 && (n = i[0] + "@",
  33984. e = i[1]),
  33985. e = e.replace(O, ".");
  33986. var r = e.split(".")
  33987. , a = o(r, t).join(".");
  33988. return n + a
  33989. }
  33990. function s(e) {
  33991. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33992. t = e.charCodeAt(r++),
  33993. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33994. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33995. r--)) : n.push(t);
  33996. return n
  33997. }
  33998. function l(e) {
  33999. return o(e, function(e) {
  34000. var t = "";
  34001. return e > 65535 && (e -= 65536,
  34002. t += B(e >>> 10 & 1023 | 55296),
  34003. e = 56320 | 1023 & e),
  34004. t += B(e)
  34005. }).join("")
  34006. }
  34007. function c(e) {
  34008. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  34009. }
  34010. function h(e, t) {
  34011. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  34012. }
  34013. function u(e, t, i) {
  34014. var n = 0;
  34015. for (e = i ? N(e / T) : e >> 1,
  34016. e += N(e / t); e > D * w >> 1; n += E)
  34017. e = N(e / D);
  34018. return N(n + (D + 1) * e / (e + _))
  34019. }
  34020. function d(e) {
  34021. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  34022. for (i = e.lastIndexOf(M),
  34023. i < 0 && (i = 0),
  34024. n = 0; n < i; ++n)
  34025. e.charCodeAt(n) >= 128 && r("not-basic"),
  34026. g.push(e.charCodeAt(n));
  34027. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  34028. for (a = v,
  34029. s = 1,
  34030. h = E; o >= m && r("invalid-input"),
  34031. d = c(e.charCodeAt(o++)),
  34032. (d >= E || d > N((I - v) / s)) && r("overflow"),
  34033. v += d * s,
  34034. p = h <= y ? b : h >= y + w ? w : h - y,
  34035. !(d < p); h += E)
  34036. f = E - p,
  34037. s > N(I / f) && r("overflow"),
  34038. s *= f;
  34039. t = g.length + 1,
  34040. y = u(v - a, t, 0 == a),
  34041. N(v / t) > I - A && r("overflow"),
  34042. A += N(v / t),
  34043. v %= t,
  34044. g.splice(v++, 0, A)
  34045. }
  34046. return l(g)
  34047. }
  34048. function p(e) {
  34049. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  34050. for (e = s(e),
  34051. m = e.length,
  34052. t = S,
  34053. i = 0,
  34054. a = x,
  34055. l = 0; l < m; ++l)
  34056. g = e[l],
  34057. g < 128 && C.push(B(g));
  34058. for (n = o = C.length,
  34059. o && C.push(M); n < m; ) {
  34060. for (c = I,
  34061. l = 0; l < m; ++l)
  34062. g = e[l],
  34063. g >= t && g < c && (c = g);
  34064. for (v = n + 1,
  34065. c - t > N((I - i) / v) && r("overflow"),
  34066. i += (c - t) * v,
  34067. t = c,
  34068. l = 0; l < m; ++l)
  34069. if (g = e[l],
  34070. g < t && ++i > I && r("overflow"),
  34071. g == t) {
  34072. for (d = i,
  34073. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  34074. !(d < f); p += E)
  34075. y = d - f,
  34076. A = E - f,
  34077. C.push(B(h(f + y % A, 0))),
  34078. d = N(y / A);
  34079. C.push(B(h(d, 0))),
  34080. a = u(i, v, n == o),
  34081. i = 0,
  34082. ++n
  34083. }
  34084. ++i,
  34085. ++t
  34086. }
  34087. return C.join("")
  34088. }
  34089. function f(e) {
  34090. return a(e, function(e) {
  34091. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  34092. })
  34093. }
  34094. function g(e) {
  34095. return a(e, function(e) {
  34096. return P.test(e) ? "xn--" + p(e) : e
  34097. })
  34098. }
  34099. var m = "object" == typeof i && i && !i.nodeType && i
  34100. , v = "object" == typeof t && t && !t.nodeType && t
  34101. , A = "object" == typeof e && e;
  34102. A.global !== A && A.window !== A && A.self !== A || (n = A);
  34103. 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 = {
  34104. overflow: "Overflow: input needs wider integers to process",
  34105. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  34106. "invalid-input": "Invalid input"
  34107. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  34108. if (y = {
  34109. version: "1.4.1",
  34110. ucs2: {
  34111. decode: s,
  34112. encode: l
  34113. },
  34114. decode: d,
  34115. encode: p,
  34116. toASCII: g,
  34117. toUnicode: f
  34118. },
  34119. "function" == typeof define && "object" == typeof define.amd && define.amd)
  34120. define("punycode", function() {
  34121. return y
  34122. });
  34123. else if (m && v)
  34124. if (t.exports == m)
  34125. v.exports = y;
  34126. else
  34127. for (C in y)
  34128. y.hasOwnProperty(C) && (m[C] = y[C]);
  34129. else
  34130. n.punycode = y
  34131. }(this)
  34132. }
  34133. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  34134. }
  34135. , {}],
  34136. 205: [function(e, t, i) {//"./decode"
  34137. "use strict";
  34138. function n(e, t) {
  34139. return Object.prototype.hasOwnProperty.call(e, t)
  34140. }
  34141. t.exports = function(e, t, i, o) {
  34142. t = t || "&",
  34143. i = i || "=";
  34144. var a = {};
  34145. if ("string" != typeof e || 0 === e.length)
  34146. return a;
  34147. var s = /\+/g;
  34148. e = e.split(t);
  34149. var l = 1e3;
  34150. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  34151. var c = e.length;
  34152. l > 0 && c > l && (c = l);
  34153. for (var h = 0; h < c; ++h) {
  34154. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  34155. m >= 0 ? (u = g.substr(0, m),
  34156. d = g.substr(m + 1)) : (u = g,
  34157. d = ""),
  34158. p = decodeURIComponent(u),
  34159. f = decodeURIComponent(d),
  34160. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  34161. }
  34162. return a
  34163. }
  34164. ;
  34165. var r = Array.isArray || function(e) {
  34166. return "[object Array]" === Object.prototype.toString.call(e)
  34167. }
  34168. }
  34169. , {}],
  34170. 206: [function(e, t, i) {//"./encode"
  34171. "use strict";
  34172. function n(e, t) {
  34173. if (e.map)
  34174. return e.map(t);
  34175. for (var i = [], n = 0; n < e.length; n++)
  34176. i.push(t(e[n], n));
  34177. return i
  34178. }
  34179. var r = function(e) {
  34180. switch (typeof e) {
  34181. case "string":
  34182. return e;
  34183. case "boolean":
  34184. return e ? "true" : "false";
  34185. case "number":
  34186. return isFinite(e) ? e : "";
  34187. default:
  34188. return ""
  34189. }
  34190. };
  34191. t.exports = function(e, t, i, s) {
  34192. return t = t || "&",
  34193. i = i || "=",
  34194. null === e && (e = void 0),
  34195. "object" == typeof e ? n(a(e), function(a) {
  34196. var s = encodeURIComponent(r(a)) + i;
  34197. return o(e[a]) ? n(e[a], function(e) {
  34198. return s + encodeURIComponent(r(e))
  34199. }).join(t) : s + encodeURIComponent(r(e[a]))
  34200. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  34201. }
  34202. ;
  34203. var o = Array.isArray || function(e) {
  34204. return "[object Array]" === Object.prototype.toString.call(e)
  34205. }
  34206. , a = Object.keys || function(e) {
  34207. var t = [];
  34208. for (var i in e)
  34209. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  34210. return t
  34211. }
  34212. }
  34213. , {}],
  34214. 207: [function(e, t, i) {//querystring
  34215. "use strict";
  34216. i.decode = i.parse = e("./decode"),
  34217. i.encode = i.stringify = e("./encode")
  34218. }
  34219. , {
  34220. "./decode": 205,
  34221. "./encode": 206
  34222. }],
  34223. 208: [function(e, t, i) {//url
  34224. "use strict";
  34225. function n() {
  34226. this.protocol = null,
  34227. this.slashes = null,
  34228. this.auth = null,
  34229. this.host = null,
  34230. this.port = null,
  34231. this.hostname = null,
  34232. this.hash = null,
  34233. this.search = null,
  34234. this.query = null,
  34235. this.pathname = null,
  34236. this.path = null,
  34237. this.href = null
  34238. }
  34239. function r(e, t, i) {
  34240. if (e && c.isObject(e) && e instanceof n)
  34241. return e;
  34242. var r = new n;
  34243. return r.parse(e, t, i),
  34244. r
  34245. }
  34246. function o(e) {
  34247. return c.isString(e) && (e = r(e)),
  34248. e instanceof n ? e.format() : n.prototype.format.call(e)
  34249. }
  34250. function a(e, t) {
  34251. return r(e, !1, !0).resolve(t)
  34252. }
  34253. function s(e, t) {
  34254. return e ? r(e, !1, !0).resolveObject(t) : t
  34255. }
  34256. var l = e("punycode")
  34257. , c = e("./util");
  34258. i.parse = r,
  34259. i.resolve = a,
  34260. i.resolveObject = s,
  34261. i.format = o,
  34262. i.Url = n;
  34263. var h = /^([a-z0-9.+-]+:)/i
  34264. , u = /:[0-9]*$/
  34265. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  34266. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  34267. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  34268. , g = ["'"].concat(f)
  34269. , m = ["%", "/", "?", ";", "#"].concat(g)
  34270. , v = ["/", "?", "#"]
  34271. , A = 255
  34272. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  34273. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  34274. , I = {
  34275. javascript: !0,
  34276. "javascript:": !0
  34277. }
  34278. , E = {
  34279. javascript: !0,
  34280. "javascript:": !0
  34281. }
  34282. , b = {
  34283. http: !0,
  34284. https: !0,
  34285. ftp: !0,
  34286. gopher: !0,
  34287. file: !0,
  34288. "http:": !0,
  34289. "https:": !0,
  34290. "ftp:": !0,
  34291. "gopher:": !0,
  34292. "file:": !0
  34293. }
  34294. , w = e("querystring");
  34295. n.prototype.parse = function(e, t, i) {
  34296. if (!c.isString(e))
  34297. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  34298. var n = e.indexOf("?")
  34299. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  34300. , o = e.split(r)
  34301. , a = /\\/g;
  34302. o[0] = o[0].replace(a, "/"),
  34303. e = o.join(r);
  34304. var s = e;
  34305. if (s = s.trim(),
  34306. !i && 1 === e.split("#").length) {
  34307. var u = d.exec(s);
  34308. if (u)
  34309. return this.path = s,
  34310. this.href = s,
  34311. this.pathname = u[1],
  34312. u[2] ? (this.search = u[2],
  34313. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  34314. this.query = {}),
  34315. this
  34316. }
  34317. var p = h.exec(s);
  34318. if (p) {
  34319. p = p[0];
  34320. var f = p.toLowerCase();
  34321. this.protocol = f,
  34322. s = s.substr(p.length)
  34323. }
  34324. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  34325. var _ = "//" === s.substr(0, 2);
  34326. !_ || p && E[p] || (s = s.substr(2),
  34327. this.slashes = !0)
  34328. }
  34329. if (!E[p] && (_ || p && !b[p])) {
  34330. for (var T = -1, x = 0; x < v.length; x++) {
  34331. var S = s.indexOf(v[x]);
  34332. S !== -1 && (T === -1 || S < T) && (T = S)
  34333. }
  34334. var M, R;
  34335. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  34336. R !== -1 && (M = s.slice(0, R),
  34337. s = s.slice(R + 1),
  34338. this.auth = decodeURIComponent(M)),
  34339. T = -1;
  34340. for (var x = 0; x < m.length; x++) {
  34341. var S = s.indexOf(m[x]);
  34342. S !== -1 && (T === -1 || S < T) && (T = S)
  34343. }
  34344. T === -1 && (T = s.length),
  34345. this.host = s.slice(0, T),
  34346. s = s.slice(T),
  34347. this.parseHost(),
  34348. this.hostname = this.hostname || "";
  34349. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  34350. if (!P)
  34351. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  34352. var D = O[x];
  34353. if (D && !D.match(y)) {
  34354. for (var N = "", B = 0, F = D.length; B < F; B++)
  34355. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  34356. if (!N.match(y)) {
  34357. var V = O.slice(0, x)
  34358. , U = O.slice(x + 1)
  34359. , k = D.match(C);
  34360. k && (V.push(k[1]),
  34361. U.unshift(k[2])),
  34362. U.length && (s = "/" + U.join(".") + s),
  34363. this.hostname = V.join(".");
  34364. break
  34365. }
  34366. }
  34367. }
  34368. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  34369. P || (this.hostname = l.toASCII(this.hostname));
  34370. var H = this.port ? ":" + this.port : ""
  34371. , G = this.hostname || "";
  34372. this.host = G + H,
  34373. this.href += this.host,
  34374. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  34375. "/" !== s[0] && (s = "/" + s))
  34376. }
  34377. if (!I[f])
  34378. for (var x = 0, L = g.length; x < L; x++) {
  34379. var z = g[x];
  34380. if (s.indexOf(z) !== -1) {
  34381. var W = encodeURIComponent(z);
  34382. W === z && (W = escape(z)),
  34383. s = s.split(z).join(W)
  34384. }
  34385. }
  34386. var j = s.indexOf("#");
  34387. j !== -1 && (this.hash = s.substr(j),
  34388. s = s.slice(0, j));
  34389. var Y = s.indexOf("?");
  34390. if (Y !== -1 ? (this.search = s.substr(Y),
  34391. this.query = s.substr(Y + 1),
  34392. t && (this.query = w.parse(this.query)),
  34393. s = s.slice(0, Y)) : t && (this.search = "",
  34394. this.query = {}),
  34395. s && (this.pathname = s),
  34396. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  34397. this.pathname || this.search) {
  34398. var H = this.pathname || ""
  34399. , X = this.search || "";
  34400. this.path = H + X
  34401. }
  34402. return this.href = this.format(),
  34403. this
  34404. }
  34405. ,
  34406. n.prototype.format = function() {
  34407. var e = this.auth || "";
  34408. e && (e = encodeURIComponent(e),
  34409. e = e.replace(/%3A/i, ":"),
  34410. e += "@");
  34411. var t = this.protocol || ""
  34412. , i = this.pathname || ""
  34413. , n = this.hash || ""
  34414. , r = !1
  34415. , o = "";
  34416. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  34417. this.port && (r += ":" + this.port)),
  34418. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  34419. var a = this.search || o && "?" + o || "";
  34420. return t && ":" !== t.substr(-1) && (t += ":"),
  34421. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  34422. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  34423. n && "#" !== n.charAt(0) && (n = "#" + n),
  34424. a && "?" !== a.charAt(0) && (a = "?" + a),
  34425. i = i.replace(/[?#]/g, function(e) {
  34426. return encodeURIComponent(e)
  34427. }),
  34428. a = a.replace("#", "%23"),
  34429. t + r + i + a + n
  34430. }
  34431. ,
  34432. n.prototype.resolve = function(e) {
  34433. return this.resolveObject(r(e, !1, !0)).format()
  34434. }
  34435. ,
  34436. n.prototype.resolveObject = function(e) {
  34437. if (c.isString(e)) {
  34438. var t = new n;
  34439. t.parse(e, !1, !0),
  34440. e = t
  34441. }
  34442. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  34443. var a = r[o];
  34444. i[a] = this[a]
  34445. }
  34446. if (i.hash = e.hash,
  34447. "" === e.href)
  34448. return i.href = i.format(),
  34449. i;
  34450. if (e.slashes && !e.protocol) {
  34451. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  34452. var h = s[l];
  34453. "protocol" !== h && (i[h] = e[h])
  34454. }
  34455. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  34456. i.href = i.format(),
  34457. i
  34458. }
  34459. if (e.protocol && e.protocol !== i.protocol) {
  34460. if (!b[e.protocol]) {
  34461. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  34462. var p = u[d];
  34463. i[p] = e[p]
  34464. }
  34465. return i.href = i.format(),
  34466. i
  34467. }
  34468. if (i.protocol = e.protocol,
  34469. e.host || E[e.protocol])
  34470. i.pathname = e.pathname;
  34471. else {
  34472. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  34473. ;
  34474. e.host || (e.host = ""),
  34475. e.hostname || (e.hostname = ""),
  34476. "" !== f[0] && f.unshift(""),
  34477. f.length < 2 && f.unshift(""),
  34478. i.pathname = f.join("/")
  34479. }
  34480. if (i.search = e.search,
  34481. i.query = e.query,
  34482. i.host = e.host || "",
  34483. i.auth = e.auth,
  34484. i.hostname = e.hostname || e.host,
  34485. i.port = e.port,
  34486. i.pathname || i.search) {
  34487. var g = i.pathname || ""
  34488. , m = i.search || "";
  34489. i.path = g + m
  34490. }
  34491. return i.slashes = i.slashes || e.slashes,
  34492. i.href = i.format(),
  34493. i
  34494. }
  34495. var v = i.pathname && "/" === i.pathname.charAt(0)
  34496. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  34497. , y = A || v || i.host && e.pathname
  34498. , C = y
  34499. , I = i.pathname && i.pathname.split("/") || []
  34500. , f = e.pathname && e.pathname.split("/") || []
  34501. , w = i.protocol && !b[i.protocol];
  34502. if (w && (i.hostname = "",
  34503. i.port = null,
  34504. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  34505. i.host = "",
  34506. e.protocol && (e.hostname = null,
  34507. e.port = null,
  34508. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  34509. e.host = null),
  34510. y = y && ("" === f[0] || "" === I[0])),
  34511. A)
  34512. i.host = e.host || "" === e.host ? e.host : i.host,
  34513. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  34514. i.search = e.search,
  34515. i.query = e.query,
  34516. I = f;
  34517. else if (f.length)
  34518. I || (I = []),
  34519. I.pop(),
  34520. I = I.concat(f),
  34521. i.search = e.search,
  34522. i.query = e.query;
  34523. else if (!c.isNullOrUndefined(e.search)) {
  34524. if (w) {
  34525. i.hostname = i.host = I.shift();
  34526. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34527. _ && (i.auth = _.shift(),
  34528. i.host = i.hostname = _.shift())
  34529. }
  34530. return i.search = e.search,
  34531. i.query = e.query,
  34532. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34533. i.href = i.format(),
  34534. i
  34535. }
  34536. if (!I.length)
  34537. return i.pathname = null,
  34538. i.search ? i.path = "/" + i.search : i.path = null,
  34539. i.href = i.format(),
  34540. i;
  34541. 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--)
  34542. T = I[M],
  34543. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  34544. S++) : S && (I.splice(M, 1),
  34545. S--);
  34546. if (!y && !C)
  34547. for (; S--; S)
  34548. I.unshift("..");
  34549. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  34550. x && "/" !== I.join("/").substr(-1) && I.push("");
  34551. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  34552. if (w) {
  34553. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  34554. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34555. _ && (i.auth = _.shift(),
  34556. i.host = i.hostname = _.shift())
  34557. }
  34558. return y = y || i.host && I.length,
  34559. y && !R && I.unshift(""),
  34560. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  34561. i.path = null),
  34562. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34563. i.auth = e.auth || i.auth,
  34564. i.slashes = i.slashes || e.slashes,
  34565. i.href = i.format(),
  34566. i
  34567. }
  34568. ,
  34569. n.prototype.parseHost = function() {
  34570. var e = this.host
  34571. , t = u.exec(e);
  34572. t && (t = t[0],
  34573. ":" !== t && (this.port = t.substr(1)),
  34574. e = e.substr(0, e.length - t.length)),
  34575. e && (this.hostname = e)
  34576. }
  34577. }
  34578. , {
  34579. "./util": 209,
  34580. punycode: 204,
  34581. querystring: 207
  34582. }],
  34583. 209: [function(e, t, i) {//"./util"
  34584. "use strict";
  34585. t.exports = {
  34586. isString: function(e) {
  34587. return "string" == typeof e
  34588. },
  34589. isObject: function(e) {
  34590. return "object" == typeof e && null !== e
  34591. },
  34592. isNull: function(e) {
  34593. return null === e
  34594. },
  34595. isNullOrUndefined: function(e) {
  34596. return null == e
  34597. }
  34598. }
  34599. }
  34600. , {}],
  34601. 210: [function(e, t, i) {//dict
  34602. "use strict";
  34603. function n(e) {
  34604. return l + e
  34605. }
  34606. function r(e) {
  34607. return e.substring(l.length)
  34608. }
  34609. function o(e, t) {
  34610. for (var i in t)
  34611. Object.defineProperty(e, i, {
  34612. value: t[i],
  34613. configurable: !0,
  34614. writable: !0
  34615. })
  34616. }
  34617. function a(e) {
  34618. if ("string" != typeof e)
  34619. throw new TypeError("key must be a string.")
  34620. }
  34621. var s = Object.prototype.hasOwnProperty
  34622. , l = "~";
  34623. t.exports = function(e) {
  34624. var t = Object.create(null)
  34625. , i = 0
  34626. , l = {};
  34627. return o(l, {
  34628. get: function(e, i) {
  34629. a(e);
  34630. var r = n(e);
  34631. return r in t ? t[r] : i
  34632. },
  34633. set: function(e, r) {
  34634. a(e);
  34635. var o = n(e);
  34636. return o in t || ++i,
  34637. t[o] = r
  34638. },
  34639. has: function(e) {
  34640. return a(e),
  34641. n(e)in t
  34642. },
  34643. delete: function(e) {
  34644. a(e);
  34645. var r = n(e);
  34646. return r in t && (--i,
  34647. delete t[r],
  34648. !0)
  34649. },
  34650. clear: function() {
  34651. t = Object.create(null),
  34652. i = 0
  34653. },
  34654. forEach: function(e, i) {
  34655. if ("function" != typeof e)
  34656. throw new TypeError("`callback` must be a function");
  34657. for (var n in t)
  34658. if (s.call(t, n)) {
  34659. var o = r(n)
  34660. , a = t[n];
  34661. e.call(i, a, o, l)
  34662. }
  34663. }
  34664. }),
  34665. Object.defineProperty(l, "size", {
  34666. get: function() {
  34667. return i
  34668. },
  34669. configurable: !0
  34670. }),
  34671. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34672. l.set(t, e[t])
  34673. }),
  34674. l
  34675. }
  34676. }
  34677. , {}],
  34678. 211: [function(e, t, i) {//heap
  34679. t.exports = e("./lib/heap")
  34680. }
  34681. , {
  34682. "./lib/heap": 212
  34683. }],
  34684. 212: [function(e, t, i) {//"./lib/heap"
  34685. (function() {
  34686. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34687. r = Math.floor,
  34688. u = Math.min,
  34689. n = function(e, t) {
  34690. return e < t ? -1 : e > t ? 1 : 0
  34691. }
  34692. ,
  34693. h = function(e, t, i, o, a) {
  34694. var s;
  34695. if (null == i && (i = 0),
  34696. null == a && (a = n),
  34697. i < 0)
  34698. throw new Error("lo must be non-negative");
  34699. for (null == o && (o = e.length); i < o; )
  34700. s = r((i + o) / 2),
  34701. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34702. return [].splice.apply(e, [i, i - i].concat(t)),
  34703. t
  34704. }
  34705. ,
  34706. s = function(e, t, i) {
  34707. return null == i && (i = n),
  34708. e.push(t),
  34709. g(e, 0, e.length - 1, i)
  34710. }
  34711. ,
  34712. a = function(e, t) {
  34713. var i, r;
  34714. return null == t && (t = n),
  34715. i = e.pop(),
  34716. e.length ? (r = e[0],
  34717. e[0] = i,
  34718. m(e, 0, t)) : r = i,
  34719. r
  34720. }
  34721. ,
  34722. c = function(e, t, i) {
  34723. var r;
  34724. return null == i && (i = n),
  34725. r = e[0],
  34726. e[0] = t,
  34727. m(e, 0, i),
  34728. r
  34729. }
  34730. ,
  34731. l = function(e, t, i) {
  34732. var r;
  34733. return null == i && (i = n),
  34734. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34735. t = r[0],
  34736. e[0] = r[1],
  34737. m(e, 0, i)),
  34738. t
  34739. }
  34740. ,
  34741. o = function(e, t) {
  34742. var i, o, a, s, l, c;
  34743. for (null == t && (t = n),
  34744. s = function() {
  34745. c = [];
  34746. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34747. c.push(t);
  34748. return c
  34749. }
  34750. .apply(this).reverse(),
  34751. l = [],
  34752. o = 0,
  34753. a = s.length; o < a; o++)
  34754. i = s[o],
  34755. l.push(m(e, i, t));
  34756. return l
  34757. }
  34758. ,
  34759. f = function(e, t, i) {
  34760. var r;
  34761. if (null == i && (i = n),
  34762. r = e.indexOf(t),
  34763. r !== -1)
  34764. return g(e, 0, r, i),
  34765. m(e, r, i)
  34766. }
  34767. ,
  34768. d = function(e, t, i) {
  34769. var r, a, s, c, h;
  34770. if (null == i && (i = n),
  34771. a = e.slice(0, t),
  34772. !a.length)
  34773. return a;
  34774. for (o(a, i),
  34775. h = e.slice(t),
  34776. s = 0,
  34777. c = h.length; s < c; s++)
  34778. r = h[s],
  34779. l(a, r, i);
  34780. return a.sort(i).reverse()
  34781. }
  34782. ,
  34783. p = function(e, t, i) {
  34784. var r, s, l, c, d, p, f, g, m, v;
  34785. if (null == i && (i = n),
  34786. 10 * t <= e.length) {
  34787. if (c = e.slice(0, t).sort(i),
  34788. !c.length)
  34789. return c;
  34790. for (l = c[c.length - 1],
  34791. g = e.slice(t),
  34792. d = 0,
  34793. f = g.length; d < f; d++)
  34794. r = g[d],
  34795. i(r, l) < 0 && (h(c, r, 0, null, i),
  34796. c.pop(),
  34797. l = c[c.length - 1]);
  34798. return c
  34799. }
  34800. for (o(e, i),
  34801. v = [],
  34802. s = p = 0,
  34803. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34804. v.push(a(e, i));
  34805. return v
  34806. }
  34807. ,
  34808. g = function(e, t, i, r) {
  34809. var o, a, s;
  34810. for (null == r && (r = n),
  34811. o = e[i]; i > t && (s = i - 1 >> 1,
  34812. a = e[s],
  34813. r(o, a) < 0); )
  34814. e[i] = a,
  34815. i = s;
  34816. return e[i] = o
  34817. }
  34818. ,
  34819. m = function(e, t, i) {
  34820. var r, o, a, s, l;
  34821. for (null == i && (i = n),
  34822. o = e.length,
  34823. l = t,
  34824. a = e[t],
  34825. r = 2 * t + 1; r < o; )
  34826. s = r + 1,
  34827. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34828. e[t] = e[r],
  34829. t = r,
  34830. r = 2 * t + 1;
  34831. return e[t] = a,
  34832. g(e, l, t, i)
  34833. }
  34834. ,
  34835. e = function() {
  34836. function e(e) {
  34837. this.cmp = null != e ? e : n,
  34838. this.nodes = []
  34839. }
  34840. return e.push = s,
  34841. e.pop = a,
  34842. e.replace = c,
  34843. e.pushpop = l,
  34844. e.heapify = o,
  34845. e.updateItem = f,
  34846. e.nlargest = d,
  34847. e.nsmallest = p,
  34848. e.prototype.push = function(e) {
  34849. return s(this.nodes, e, this.cmp)
  34850. }
  34851. ,
  34852. e.prototype.pop = function() {
  34853. return a(this.nodes, this.cmp)
  34854. }
  34855. ,
  34856. e.prototype.peek = function() {
  34857. return this.nodes[0]
  34858. }
  34859. ,
  34860. e.prototype.contains = function(e) {
  34861. return this.nodes.indexOf(e) !== -1
  34862. }
  34863. ,
  34864. e.prototype.replace = function(e) {
  34865. return c(this.nodes, e, this.cmp)
  34866. }
  34867. ,
  34868. e.prototype.pushpop = function(e) {
  34869. return l(this.nodes, e, this.cmp)
  34870. }
  34871. ,
  34872. e.prototype.heapify = function() {
  34873. return o(this.nodes, this.cmp)
  34874. }
  34875. ,
  34876. e.prototype.updateItem = function(e) {
  34877. return f(this.nodes, e, this.cmp)
  34878. }
  34879. ,
  34880. e.prototype.clear = function() {
  34881. return this.nodes = []
  34882. }
  34883. ,
  34884. e.prototype.empty = function() {
  34885. return 0 === this.nodes.length
  34886. }
  34887. ,
  34888. e.prototype.size = function() {
  34889. return this.nodes.length
  34890. }
  34891. ,
  34892. e.prototype.clone = function() {
  34893. var t;
  34894. return t = new e,
  34895. t.nodes = this.nodes.slice(0),
  34896. t
  34897. }
  34898. ,
  34899. e.prototype.toArray = function() {
  34900. return this.nodes.slice(0)
  34901. }
  34902. ,
  34903. e.prototype.insert = e.prototype.push,
  34904. e.prototype.top = e.prototype.peek,
  34905. e.prototype.front = e.prototype.peek,
  34906. e.prototype.has = e.prototype.contains,
  34907. e.prototype.copy = e.prototype.clone,
  34908. e
  34909. }(),
  34910. function(e, n) {
  34911. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34912. }(this, function() {
  34913. return e
  34914. })
  34915. }
  34916. ).call(this)
  34917. }
  34918. , {}],
  34919. 213: [function(e, t, i) {//"promise-polyfill"
  34920. !function(e) {
  34921. function i() {}
  34922. function n(e, t) {
  34923. return function() {
  34924. e.apply(t, arguments)
  34925. }
  34926. }
  34927. function r(e) {
  34928. if ("object" != typeof this)
  34929. throw new TypeError("Promises must be constructed via new");
  34930. if ("function" != typeof e)
  34931. throw new TypeError("not a function");
  34932. this._state = 0,
  34933. this._handled = !1,
  34934. this._value = void 0,
  34935. this._deferreds = [],
  34936. h(e, this)
  34937. }
  34938. function o(e, t) {
  34939. for (; 3 === e._state; )
  34940. e = e._value;
  34941. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34942. void r._immediateFn(function() {
  34943. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34944. if (null === i)
  34945. return void (1 === e._state ? a : s)(t.promise, e._value);
  34946. var n;
  34947. try {
  34948. n = i(e._value)
  34949. } catch (e) {
  34950. return void s(t.promise, e)
  34951. }
  34952. a(t.promise, n)
  34953. }))
  34954. }
  34955. function a(e, t) {
  34956. try {
  34957. if (t === e)
  34958. throw new TypeError("A promise cannot be resolved with itself.");
  34959. if (t && ("object" == typeof t || "function" == typeof t)) {
  34960. var i = t.then;
  34961. if (t instanceof r)
  34962. return e._state = 3,
  34963. e._value = t,
  34964. void l(e);
  34965. if ("function" == typeof i)
  34966. return void h(n(i, t), e)
  34967. }
  34968. e._state = 1,
  34969. e._value = t,
  34970. l(e)
  34971. } catch (t) {
  34972. s(e, t)
  34973. }
  34974. }
  34975. function s(e, t) {
  34976. e._state = 2,
  34977. e._value = t,
  34978. l(e)
  34979. }
  34980. function l(e) {
  34981. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34982. e._handled || r._unhandledRejectionFn(e._value)
  34983. });
  34984. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34985. o(e, e._deferreds[t]);
  34986. e._deferreds = null
  34987. }
  34988. function c(e, t, i) {
  34989. this.onFulfilled = "function" == typeof e ? e : null,
  34990. this.onRejected = "function" == typeof t ? t : null,
  34991. this.promise = i
  34992. }
  34993. function h(e, t) {
  34994. var i = !1;
  34995. try {
  34996. e(function(e) {
  34997. i || (i = !0,
  34998. a(t, e))
  34999. }, function(e) {
  35000. i || (i = !0,
  35001. s(t, e))
  35002. })
  35003. } catch (e) {
  35004. if (i)
  35005. return;
  35006. i = !0,
  35007. s(t, e)
  35008. }
  35009. }
  35010. var u = setTimeout;
  35011. r.prototype.catch = function(e) {
  35012. return this.then(null, e)
  35013. }
  35014. ,
  35015. r.prototype.then = function(e, t) {
  35016. var n = new this.constructor(i);
  35017. return o(this, new c(e,t,n)),
  35018. n
  35019. }
  35020. ,
  35021. r.all = function(e) {
  35022. var t = Array.prototype.slice.call(e);
  35023. return new r(function(e, i) {
  35024. function n(o, a) {
  35025. try {
  35026. if (a && ("object" == typeof a || "function" == typeof a)) {
  35027. var s = a.then;
  35028. if ("function" == typeof s)
  35029. return void s.call(a, function(e) {
  35030. n(o, e)
  35031. }, i)
  35032. }
  35033. t[o] = a,
  35034. 0 === --r && e(t)
  35035. } catch (e) {
  35036. i(e)
  35037. }
  35038. }
  35039. if (0 === t.length)
  35040. return e([]);
  35041. for (var r = t.length, o = 0; o < t.length; o++)
  35042. n(o, t[o])
  35043. }
  35044. )
  35045. }
  35046. ,
  35047. r.resolve = function(e) {
  35048. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  35049. t(e)
  35050. }
  35051. )
  35052. }
  35053. ,
  35054. r.reject = function(e) {
  35055. return new r(function(t, i) {
  35056. i(e)
  35057. }
  35058. )
  35059. }
  35060. ,
  35061. r.race = function(e) {
  35062. return new r(function(t, i) {
  35063. for (var n = 0, r = e.length; n < r; n++)
  35064. e[n].then(t, i)
  35065. }
  35066. )
  35067. }
  35068. ,
  35069. r._immediateFn = "function" == typeof setImmediate && function(e) {
  35070. setImmediate(e)
  35071. }
  35072. || function(e) {
  35073. u(e, 0)
  35074. }
  35075. ,
  35076. r._unhandledRejectionFn = function(e) {
  35077. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  35078. }
  35079. ,
  35080. r._setImmediateFn = function(e) {
  35081. r._immediateFn = e
  35082. }
  35083. ,
  35084. r._setUnhandledRejectionFn = function(e) {
  35085. r._unhandledRejectionFn = e
  35086. }
  35087. ,
  35088. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  35089. }(this)
  35090. }
  35091. , {}],
  35092. 214: [function(e, t, i) {//protobufjs
  35093. (function(i) {
  35094. !function(i, n) {
  35095. "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)
  35096. }(this, function(t, n) {
  35097. "use strict";
  35098. var r = {};
  35099. return r.ByteBuffer = t,
  35100. r.Long = t.Long || null,
  35101. r.VERSION = "5.0.1",
  35102. r.WIRE_TYPES = {},
  35103. r.WIRE_TYPES.VARINT = 0,
  35104. r.WIRE_TYPES.BITS64 = 1,
  35105. r.WIRE_TYPES.LDELIM = 2,
  35106. r.WIRE_TYPES.STARTGROUP = 3,
  35107. r.WIRE_TYPES.ENDGROUP = 4,
  35108. r.WIRE_TYPES.BITS32 = 5,
  35109. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  35110. r.TYPES = {
  35111. int32: {
  35112. name: "int32",
  35113. wireType: r.WIRE_TYPES.VARINT,
  35114. defaultValue: 0
  35115. },
  35116. uint32: {
  35117. name: "uint32",
  35118. wireType: r.WIRE_TYPES.VARINT,
  35119. defaultValue: 0
  35120. },
  35121. sint32: {
  35122. name: "sint32",
  35123. wireType: r.WIRE_TYPES.VARINT,
  35124. defaultValue: 0
  35125. },
  35126. int64: {
  35127. name: "int64",
  35128. wireType: r.WIRE_TYPES.VARINT,
  35129. defaultValue: r.Long ? r.Long.ZERO : void 0
  35130. },
  35131. uint64: {
  35132. name: "uint64",
  35133. wireType: r.WIRE_TYPES.VARINT,
  35134. defaultValue: r.Long ? r.Long.UZERO : void 0
  35135. },
  35136. sint64: {
  35137. name: "sint64",
  35138. wireType: r.WIRE_TYPES.VARINT,
  35139. defaultValue: r.Long ? r.Long.ZERO : void 0
  35140. },
  35141. bool: {
  35142. name: "bool",
  35143. wireType: r.WIRE_TYPES.VARINT,
  35144. defaultValue: !1
  35145. },
  35146. double: {
  35147. name: "double",
  35148. wireType: r.WIRE_TYPES.BITS64,
  35149. defaultValue: 0
  35150. },
  35151. string: {
  35152. name: "string",
  35153. wireType: r.WIRE_TYPES.LDELIM,
  35154. defaultValue: ""
  35155. },
  35156. bytes: {
  35157. name: "bytes",
  35158. wireType: r.WIRE_TYPES.LDELIM,
  35159. defaultValue: null
  35160. },
  35161. fixed32: {
  35162. name: "fixed32",
  35163. wireType: r.WIRE_TYPES.BITS32,
  35164. defaultValue: 0
  35165. },
  35166. sfixed32: {
  35167. name: "sfixed32",
  35168. wireType: r.WIRE_TYPES.BITS32,
  35169. defaultValue: 0
  35170. },
  35171. fixed64: {
  35172. name: "fixed64",
  35173. wireType: r.WIRE_TYPES.BITS64,
  35174. defaultValue: r.Long ? r.Long.UZERO : void 0
  35175. },
  35176. sfixed64: {
  35177. name: "sfixed64",
  35178. wireType: r.WIRE_TYPES.BITS64,
  35179. defaultValue: r.Long ? r.Long.ZERO : void 0
  35180. },
  35181. float: {
  35182. name: "float",
  35183. wireType: r.WIRE_TYPES.BITS32,
  35184. defaultValue: 0
  35185. },
  35186. enum: {
  35187. name: "enum",
  35188. wireType: r.WIRE_TYPES.VARINT,
  35189. defaultValue: 0
  35190. },
  35191. message: {
  35192. name: "message",
  35193. wireType: r.WIRE_TYPES.LDELIM,
  35194. defaultValue: null
  35195. },
  35196. group: {
  35197. name: "group",
  35198. wireType: r.WIRE_TYPES.STARTGROUP,
  35199. defaultValue: null
  35200. }
  35201. },
  35202. 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],
  35203. r.ID_MIN = 1,
  35204. r.ID_MAX = 536870911,
  35205. r.convertFieldsToCamelCase = !1,
  35206. r.populateAccessors = !0,
  35207. r.populateDefaults = !0,
  35208. r.Util = function() {
  35209. var t = {};
  35210. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  35211. t.XHR = function() {
  35212. for (var e = [function() {
  35213. return new XMLHttpRequest
  35214. }
  35215. , function() {
  35216. return new ActiveXObject("Msxml2.XMLHTTP")
  35217. }
  35218. , function() {
  35219. return new ActiveXObject("Msxml3.XMLHTTP")
  35220. }
  35221. , function() {
  35222. return new ActiveXObject("Microsoft.XMLHTTP")
  35223. }
  35224. ], t = null, i = 0; i < e.length; i++) {
  35225. try {
  35226. t = e[i]()
  35227. } catch (e) {
  35228. continue
  35229. }
  35230. break
  35231. }
  35232. if (!t)
  35233. throw Error("XMLHttpRequest is not supported");
  35234. return t
  35235. }
  35236. ,
  35237. t.fetch = function(i, n) {
  35238. if (n && "function" != typeof n && (n = null),
  35239. t.IS_NODE) {
  35240. var r = e("fs");
  35241. if (n)
  35242. r.readFile(i, function(e, t) {
  35243. n(e ? null : "" + t)
  35244. });
  35245. else
  35246. try {
  35247. return r.readFileSync(i)
  35248. } catch (e) {
  35249. return null
  35250. }
  35251. } else {
  35252. var o = t.XHR();
  35253. if (o.open("GET", i, !!n),
  35254. o.setRequestHeader("Accept", "text/plain"),
  35255. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  35256. !n)
  35257. return o.send(null),
  35258. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  35259. if (o.onreadystatechange = function() {
  35260. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  35261. }
  35262. ,
  35263. 4 == o.readyState)
  35264. return;
  35265. o.send(null)
  35266. }
  35267. }
  35268. ,
  35269. t.toCamelCase = function(e) {
  35270. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  35271. return t.toUpperCase()
  35272. })
  35273. }
  35274. ,
  35275. t
  35276. }(),
  35277. r.Lang = {
  35278. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  35279. RULE: /^(?:required|optional|repeated|map)$/,
  35280. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  35281. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  35282. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  35283. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  35284. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  35285. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  35286. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  35287. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  35288. NUMBER_OCT: /^0[0-7]+$/,
  35289. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  35290. BOOL: /^(?:true|false)$/i,
  35291. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  35292. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  35293. WHITESPACE: /\s/,
  35294. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  35295. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  35296. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  35297. },
  35298. r.DotProto = function(e, t) {
  35299. function i(e, i) {
  35300. var n = -1
  35301. , r = 1;
  35302. if ("-" == e.charAt(0) && (r = -1,
  35303. e = e.substring(1)),
  35304. t.NUMBER_DEC.test(e))
  35305. n = parseInt(e);
  35306. else if (t.NUMBER_HEX.test(e))
  35307. n = parseInt(e.substring(2), 16);
  35308. else {
  35309. if (!t.NUMBER_OCT.test(e))
  35310. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  35311. n = parseInt(e.substring(1), 8)
  35312. }
  35313. if (n = r * n | 0,
  35314. !i && n < 0)
  35315. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  35316. return n
  35317. }
  35318. function n(e) {
  35319. var i = 1;
  35320. if ("-" == e.charAt(0) && (i = -1,
  35321. e = e.substring(1)),
  35322. t.NUMBER_DEC.test(e))
  35323. return i * parseInt(e, 10);
  35324. if (t.NUMBER_HEX.test(e))
  35325. return i * parseInt(e.substring(2), 16);
  35326. if (t.NUMBER_OCT.test(e))
  35327. return i * parseInt(e.substring(1), 8);
  35328. if ("inf" === e)
  35329. return i * (1 / 0);
  35330. if ("nan" === e)
  35331. return NaN;
  35332. if (t.NUMBER_FLT.test(e))
  35333. return i * parseFloat(e);
  35334. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  35335. }
  35336. function r(e, t, i) {
  35337. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  35338. e[t].push(i))
  35339. }
  35340. var o = {}
  35341. , a = function(e) {
  35342. this.source = e + "",
  35343. this.index = 0,
  35344. this.line = 1,
  35345. this.stack = [],
  35346. this._stringOpen = null
  35347. }
  35348. , s = a.prototype;
  35349. s._readString = function() {
  35350. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  35351. e.lastIndex = this.index - 1;
  35352. var i = e.exec(this.source);
  35353. if (!i)
  35354. throw Error("unterminated string");
  35355. return this.index = e.lastIndex,
  35356. this.stack.push(this._stringOpen),
  35357. this._stringOpen = null,
  35358. i[1]
  35359. }
  35360. ,
  35361. s.next = function() {
  35362. if (this.stack.length > 0)
  35363. return this.stack.shift();
  35364. if (this.index >= this.source.length)
  35365. return null;
  35366. if (null !== this._stringOpen)
  35367. return this._readString();
  35368. var e, i, n;
  35369. do {
  35370. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  35371. if ("\n" === n && ++this.line,
  35372. ++this.index === this.source.length)
  35373. return null;
  35374. if ("/" === this.source.charAt(this.index))
  35375. if (++this.index,
  35376. "/" === this.source.charAt(this.index)) {
  35377. for (; "\n" !== this.source.charAt(++this.index); )
  35378. if (this.index == this.source.length)
  35379. return null;
  35380. ++this.index,
  35381. ++this.line,
  35382. e = !0
  35383. } else {
  35384. if ("*" !== (n = this.source.charAt(this.index)))
  35385. return "/";
  35386. do {
  35387. if ("\n" === n && ++this.line,
  35388. ++this.index === this.source.length)
  35389. return null;
  35390. i = n,
  35391. n = this.source.charAt(this.index)
  35392. } while ("*" !== i || "/" !== n);++this.index,
  35393. e = !0
  35394. }
  35395. } while (e);if (this.index === this.source.length)
  35396. return null;
  35397. var r = this.index;
  35398. t.DELIM.lastIndex = 0;
  35399. var o = t.DELIM.test(this.source.charAt(r++));
  35400. if (!o)
  35401. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  35402. ++r;
  35403. var a = this.source.substring(this.index, this.index = r);
  35404. return '"' !== a && "'" !== a || (this._stringOpen = a),
  35405. a
  35406. }
  35407. ,
  35408. s.peek = function() {
  35409. if (0 === this.stack.length) {
  35410. var e = this.next();
  35411. if (null === e)
  35412. return null;
  35413. this.stack.push(e)
  35414. }
  35415. return this.stack[0]
  35416. }
  35417. ,
  35418. s.skip = function(e) {
  35419. var t = this.next();
  35420. if (t !== e)
  35421. throw Error("illegal '" + t + "', '" + e + "' expected")
  35422. }
  35423. ,
  35424. s.omit = function(e) {
  35425. return this.peek() === e && (this.next(),
  35426. !0)
  35427. }
  35428. ,
  35429. s.toString = function() {
  35430. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  35431. }
  35432. ,
  35433. o.Tokenizer = a;
  35434. var l = function(e) {
  35435. this.tn = new a(e),
  35436. this.proto3 = !1
  35437. }
  35438. , c = l.prototype;
  35439. return c.parse = function() {
  35440. var e, i, n = {
  35441. name: "[ROOT]",
  35442. package: null,
  35443. messages: [],
  35444. enums: [],
  35445. imports: [],
  35446. options: {},
  35447. services: []
  35448. }, r = !0;
  35449. try {
  35450. for (; e = this.tn.next(); )
  35451. switch (e) {
  35452. case "package":
  35453. if (!r || null !== n.package)
  35454. throw Error("unexpected 'package'");
  35455. if (e = this.tn.next(),
  35456. !t.TYPEREF.test(e))
  35457. throw Error("illegal package name: " + e);
  35458. this.tn.skip(";"),
  35459. n.package = e;
  35460. break;
  35461. case "import":
  35462. if (!r)
  35463. throw Error("unexpected 'import'");
  35464. e = this.tn.peek(),
  35465. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  35466. e = this._readString(),
  35467. this.tn.skip(";"),
  35468. i || n.imports.push(e);
  35469. break;
  35470. case "syntax":
  35471. if (!r)
  35472. throw Error("unexpected 'syntax'");
  35473. this.tn.skip("="),
  35474. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  35475. this.tn.skip(";");
  35476. break;
  35477. case "message":
  35478. this._parseMessage(n, null),
  35479. r = !1;
  35480. break;
  35481. case "enum":
  35482. this._parseEnum(n),
  35483. r = !1;
  35484. break;
  35485. case "option":
  35486. this._parseOption(n);
  35487. break;
  35488. case "service":
  35489. this._parseService(n);
  35490. break;
  35491. case "extend":
  35492. this._parseExtend(n);
  35493. break;
  35494. default:
  35495. throw Error("unexpected '" + e + "'")
  35496. }
  35497. } catch (e) {
  35498. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  35499. e
  35500. }
  35501. return delete n.name,
  35502. n
  35503. }
  35504. ,
  35505. l.parse = function(e) {
  35506. return new l(e).parse()
  35507. }
  35508. ,
  35509. c._readString = function() {
  35510. var e, t, i = "";
  35511. do {
  35512. if (t = this.tn.next(),
  35513. "'" !== t && '"' !== t)
  35514. throw Error("illegal string delimiter: " + t);
  35515. i += this.tn.next(),
  35516. this.tn.skip(t),
  35517. e = this.tn.peek()
  35518. } while ('"' === e || '"' === e);return i
  35519. }
  35520. ,
  35521. c._readValue = function(e) {
  35522. var i = this.tn.peek();
  35523. if ('"' === i || "'" === i)
  35524. return this._readString();
  35525. if (this.tn.next(),
  35526. t.NUMBER.test(i))
  35527. return n(i);
  35528. if (t.BOOL.test(i))
  35529. return "true" === i.toLowerCase();
  35530. if (e && t.TYPEREF.test(i))
  35531. return i;
  35532. throw Error("illegal value: " + i)
  35533. }
  35534. ,
  35535. c._parseOption = function(e, i) {
  35536. var n = this.tn.next()
  35537. , r = !1;
  35538. if ("(" === n && (r = !0,
  35539. n = this.tn.next()),
  35540. !t.TYPEREF.test(n))
  35541. throw Error("illegal option name: " + n);
  35542. var o = n;
  35543. r && (this.tn.skip(")"),
  35544. o = "(" + o + ")",
  35545. n = this.tn.peek(),
  35546. t.FQTYPEREF.test(n) && (o += n,
  35547. this.tn.next())),
  35548. this.tn.skip("="),
  35549. this._parseOptionValue(e, o),
  35550. i || this.tn.skip(";")
  35551. }
  35552. ,
  35553. c._parseOptionValue = function(e, i) {
  35554. var n = this.tn.peek();
  35555. if ("{" !== n)
  35556. r(e.options, i, this._readValue(!0));
  35557. else
  35558. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  35559. if (!t.NAME.test(n))
  35560. throw Error("illegal option name: " + i + "." + n);
  35561. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  35562. }
  35563. }
  35564. ,
  35565. c._parseService = function(e) {
  35566. var i = this.tn.next();
  35567. if (!t.NAME.test(i))
  35568. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  35569. var n = i
  35570. , r = {
  35571. name: n,
  35572. rpc: {},
  35573. options: {}
  35574. };
  35575. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35576. if ("option" === i)
  35577. this._parseOption(r);
  35578. else {
  35579. if ("rpc" !== i)
  35580. throw Error("illegal service token: " + i);
  35581. this._parseServiceRPC(r)
  35582. }
  35583. this.tn.omit(";"),
  35584. e.services.push(r)
  35585. }
  35586. ,
  35587. c._parseServiceRPC = function(e) {
  35588. var i = "rpc"
  35589. , n = this.tn.next();
  35590. if (!t.NAME.test(n))
  35591. throw Error("illegal rpc service method name: " + n);
  35592. var r = n
  35593. , o = {
  35594. request: null,
  35595. response: null,
  35596. request_stream: !1,
  35597. response_stream: !1,
  35598. options: {}
  35599. };
  35600. if (this.tn.skip("("),
  35601. n = this.tn.next(),
  35602. "stream" === n.toLowerCase() && (o.request_stream = !0,
  35603. n = this.tn.next()),
  35604. !t.TYPEREF.test(n))
  35605. throw Error("illegal rpc service request type: " + n);
  35606. if (o.request = n,
  35607. this.tn.skip(")"),
  35608. n = this.tn.next(),
  35609. "returns" !== n.toLowerCase())
  35610. throw Error("illegal rpc service request type delimiter: " + n);
  35611. if (this.tn.skip("("),
  35612. n = this.tn.next(),
  35613. "stream" === n.toLowerCase() && (o.response_stream = !0,
  35614. n = this.tn.next()),
  35615. o.response = n,
  35616. this.tn.skip(")"),
  35617. n = this.tn.peek(),
  35618. "{" === n) {
  35619. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  35620. if ("option" !== n)
  35621. throw Error("illegal rpc service token: " + n);
  35622. this._parseOption(o)
  35623. }
  35624. this.tn.omit(";")
  35625. } else
  35626. this.tn.skip(";");
  35627. "undefined" == typeof e[i] && (e[i] = {}),
  35628. e[i][r] = o
  35629. }
  35630. ,
  35631. c._parseMessage = function(e, n) {
  35632. var r = !!n
  35633. , o = this.tn.next()
  35634. , a = {
  35635. name: "",
  35636. fields: [],
  35637. enums: [],
  35638. messages: [],
  35639. options: {},
  35640. services: [],
  35641. oneofs: {}
  35642. };
  35643. if (!t.NAME.test(o))
  35644. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  35645. for (a.name = o,
  35646. r && (this.tn.skip("="),
  35647. n.id = i(this.tn.next()),
  35648. a.isGroup = !0),
  35649. o = this.tn.peek(),
  35650. "[" === o && n && this._parseFieldOptions(n),
  35651. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  35652. if (t.RULE.test(o))
  35653. this._parseMessageField(a, o);
  35654. else if ("oneof" === o)
  35655. this._parseMessageOneOf(a);
  35656. else if ("enum" === o)
  35657. this._parseEnum(a);
  35658. else if ("message" === o)
  35659. this._parseMessage(a);
  35660. else if ("option" === o)
  35661. this._parseOption(a);
  35662. else if ("service" === o)
  35663. this._parseService(a);
  35664. else if ("extensions" === o)
  35665. a.extensions = this._parseExtensionRanges();
  35666. else if ("reserved" === o)
  35667. this._parseIgnored();
  35668. else if ("extend" === o)
  35669. this._parseExtend(a);
  35670. else {
  35671. if (!t.TYPEREF.test(o))
  35672. throw Error("illegal message token: " + o);
  35673. if (!this.proto3)
  35674. throw Error("illegal field rule: " + o);
  35675. this._parseMessageField(a, "optional", o)
  35676. }
  35677. return this.tn.omit(";"),
  35678. e.messages.push(a),
  35679. a
  35680. }
  35681. ,
  35682. c._parseIgnored = function() {
  35683. for (; ";" !== this.tn.peek(); )
  35684. this.tn.next();
  35685. this.tn.skip(";")
  35686. }
  35687. ,
  35688. c._parseMessageField = function(e, n, r) {
  35689. if (!t.RULE.test(n))
  35690. throw Error("illegal message field rule: " + n);
  35691. var o, a = {
  35692. rule: n,
  35693. type: "",
  35694. name: "",
  35695. options: {},
  35696. id: 0
  35697. };
  35698. if ("map" === n) {
  35699. if (r)
  35700. throw Error("illegal type: " + r);
  35701. if (this.tn.skip("<"),
  35702. o = this.tn.next(),
  35703. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35704. throw Error("illegal message field type: " + o);
  35705. if (a.keytype = o,
  35706. this.tn.skip(","),
  35707. o = this.tn.next(),
  35708. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35709. throw Error("illegal message field: " + o);
  35710. if (a.type = o,
  35711. this.tn.skip(">"),
  35712. o = this.tn.next(),
  35713. !t.NAME.test(o))
  35714. throw Error("illegal message field name: " + o);
  35715. a.name = o,
  35716. this.tn.skip("="),
  35717. a.id = i(this.tn.next()),
  35718. o = this.tn.peek(),
  35719. "[" === o && this._parseFieldOptions(a),
  35720. this.tn.skip(";")
  35721. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35722. "group" === r) {
  35723. var s = this._parseMessage(e, a);
  35724. if (!/^[A-Z]/.test(s.name))
  35725. throw Error("illegal group name: " + s.name);
  35726. a.type = s.name,
  35727. a.name = s.name.toLowerCase(),
  35728. this.tn.omit(";")
  35729. } else {
  35730. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35731. throw Error("illegal message field type: " + r);
  35732. if (a.type = r,
  35733. o = this.tn.next(),
  35734. !t.NAME.test(o))
  35735. throw Error("illegal message field name: " + o);
  35736. a.name = o,
  35737. this.tn.skip("="),
  35738. a.id = i(this.tn.next()),
  35739. o = this.tn.peek(),
  35740. "[" === o && this._parseFieldOptions(a),
  35741. this.tn.skip(";")
  35742. }
  35743. return e.fields.push(a),
  35744. a
  35745. }
  35746. ,
  35747. c._parseMessageOneOf = function(e) {
  35748. var i = this.tn.next();
  35749. if (!t.NAME.test(i))
  35750. throw Error("illegal oneof name: " + i);
  35751. var n, r = i, o = [];
  35752. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35753. n = this._parseMessageField(e, "optional", i),
  35754. n.oneof = r,
  35755. o.push(n.id);
  35756. this.tn.omit(";"),
  35757. e.oneofs[r] = o
  35758. }
  35759. ,
  35760. c._parseFieldOptions = function(e) {
  35761. this.tn.skip("[");
  35762. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35763. i || this.tn.skip(","),
  35764. this._parseOption(e, !0),
  35765. i = !1;
  35766. this.tn.next()
  35767. }
  35768. ,
  35769. c._parseEnum = function(e) {
  35770. var n = {
  35771. name: "",
  35772. values: [],
  35773. options: {}
  35774. }
  35775. , r = this.tn.next();
  35776. if (!t.NAME.test(r))
  35777. throw Error("illegal name: " + r);
  35778. for (n.name = r,
  35779. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35780. if ("option" === r)
  35781. this._parseOption(n);
  35782. else {
  35783. if (!t.NAME.test(r))
  35784. throw Error("illegal name: " + r);
  35785. this.tn.skip("=");
  35786. var o = {
  35787. name: r,
  35788. id: i(this.tn.next(), !0)
  35789. };
  35790. r = this.tn.peek(),
  35791. "[" === r && this._parseFieldOptions({
  35792. options: {}
  35793. }),
  35794. this.tn.skip(";"),
  35795. n.values.push(o)
  35796. }
  35797. this.tn.omit(";"),
  35798. e.enums.push(n)
  35799. }
  35800. ,
  35801. c._parseExtensionRanges = function() {
  35802. var t, i, r, o = [];
  35803. do {
  35804. for (i = []; ; ) {
  35805. switch (t = this.tn.next()) {
  35806. case "min":
  35807. r = e.ID_MIN;
  35808. break;
  35809. case "max":
  35810. r = e.ID_MAX;
  35811. break;
  35812. default:
  35813. r = n(t)
  35814. }
  35815. if (i.push(r),
  35816. 2 === i.length)
  35817. break;
  35818. if ("to" !== this.tn.peek()) {
  35819. i.push(r);
  35820. break
  35821. }
  35822. this.tn.next()
  35823. }
  35824. o.push(i)
  35825. } while (this.tn.omit(","));return this.tn.skip(";"),
  35826. o
  35827. }
  35828. ,
  35829. c._parseExtend = function(e) {
  35830. var i = this.tn.next();
  35831. if (!t.TYPEREF.test(i))
  35832. throw Error("illegal extend reference: " + i);
  35833. var n = {
  35834. ref: i,
  35835. fields: []
  35836. };
  35837. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35838. if (t.RULE.test(i))
  35839. this._parseMessageField(n, i);
  35840. else {
  35841. if (!t.TYPEREF.test(i))
  35842. throw Error("illegal extend token: " + i);
  35843. if (!this.proto3)
  35844. throw Error("illegal field rule: " + i);
  35845. this._parseMessageField(n, "optional", i)
  35846. }
  35847. return this.tn.omit(";"),
  35848. e.messages.push(n),
  35849. n
  35850. }
  35851. ,
  35852. c.toString = function() {
  35853. return "Parser at line " + this.tn.line
  35854. }
  35855. ,
  35856. o.Parser = l,
  35857. o
  35858. }(r, r.Lang),
  35859. r.Reflect = function(e) {
  35860. function i(i) {
  35861. if ("string" == typeof i && (i = e.TYPES[i]),
  35862. "undefined" == typeof i.defaultValue)
  35863. throw Error("default value for type " + i.name + " is not supported");
  35864. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35865. }
  35866. function n(t, i) {
  35867. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35868. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35869. if ("string" == typeof t)
  35870. return e.Long.fromString(t, i || !1, 10);
  35871. if ("number" == typeof t)
  35872. return e.Long.fromNumber(t, i || !1);
  35873. throw Error("not convertible to Long")
  35874. }
  35875. function r(t, i) {
  35876. var n = i.readVarint32()
  35877. , o = 7 & n
  35878. , a = n >>> 3;
  35879. switch (o) {
  35880. case e.WIRE_TYPES.VARINT:
  35881. do
  35882. n = i.readUint8();
  35883. while (128 === (128 & n));break;
  35884. case e.WIRE_TYPES.BITS64:
  35885. i.offset += 8;
  35886. break;
  35887. case e.WIRE_TYPES.LDELIM:
  35888. n = i.readVarint32(),
  35889. i.offset += n;
  35890. break;
  35891. case e.WIRE_TYPES.STARTGROUP:
  35892. r(a, i);
  35893. break;
  35894. case e.WIRE_TYPES.ENDGROUP:
  35895. if (a === t)
  35896. return !1;
  35897. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35898. case e.WIRE_TYPES.BITS32:
  35899. i.offset += 4;
  35900. break;
  35901. default:
  35902. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35903. }
  35904. return !0
  35905. }
  35906. var o = {}
  35907. , a = function(e, t, i) {
  35908. this.builder = e,
  35909. this.parent = t,
  35910. this.name = i,
  35911. this.className
  35912. }
  35913. , s = a.prototype;
  35914. s.fqn = function() {
  35915. for (var e = this.name, t = this; ; ) {
  35916. if (t = t.parent,
  35917. null == t)
  35918. break;
  35919. e = t.name + "." + e
  35920. }
  35921. return e
  35922. }
  35923. ,
  35924. s.toString = function(e) {
  35925. return (e ? this.className + " " : "") + this.fqn()
  35926. }
  35927. ,
  35928. s.build = function() {
  35929. throw Error(this.toString(!0) + " cannot be built directly")
  35930. }
  35931. ,
  35932. o.T = a;
  35933. var l = function(e, t, i, n, r) {
  35934. a.call(this, e, t, i),
  35935. this.className = "Namespace",
  35936. this.children = [],
  35937. this.options = n || {},
  35938. this.syntax = r || "proto2"
  35939. }
  35940. , c = l.prototype = Object.create(a.prototype);
  35941. c.getChildren = function(e) {
  35942. if (e = e || null,
  35943. null == e)
  35944. return this.children.slice();
  35945. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35946. this.children[i]instanceof e && t.push(this.children[i]);
  35947. return t
  35948. }
  35949. ,
  35950. c.addChild = function(e) {
  35951. var t;
  35952. if (t = this.getChild(e.name))
  35953. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35954. t.name = t.originalName;
  35955. else {
  35956. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35957. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35958. e.name = e.originalName
  35959. }
  35960. this.children.push(e)
  35961. }
  35962. ,
  35963. c.getChild = function(e) {
  35964. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35965. if (this.children[i][t] === e)
  35966. return this.children[i];
  35967. return null
  35968. }
  35969. ,
  35970. c.resolve = function(e, t) {
  35971. var i = "string" == typeof e ? e.split(".") : e
  35972. , n = this
  35973. , r = 0;
  35974. if ("" === i[r]) {
  35975. for (; null !== n.parent; )
  35976. n = n.parent;
  35977. r++
  35978. }
  35979. var a;
  35980. do {
  35981. do {
  35982. if (!(n instanceof o.Namespace)) {
  35983. n = null;
  35984. break
  35985. }
  35986. if (a = n.getChild(i[r]),
  35987. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35988. n = null;
  35989. break
  35990. }
  35991. n = a,
  35992. r++
  35993. } while (r < i.length);if (null != n)
  35994. break;
  35995. if (null !== this.parent)
  35996. return this.parent.resolve(e, t)
  35997. } while (null != n);return n
  35998. }
  35999. ,
  36000. c.qn = function(e) {
  36001. var t = []
  36002. , i = e;
  36003. do
  36004. t.unshift(i.name),
  36005. i = i.parent;
  36006. while (null !== i);for (var n = 1; n <= t.length; n++) {
  36007. var r = t.slice(t.length - n);
  36008. if (e === this.resolve(r, e instanceof o.Namespace))
  36009. return r.join(".")
  36010. }
  36011. return e.fqn()
  36012. }
  36013. ,
  36014. c.build = function() {
  36015. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  36016. e = i[n],
  36017. e instanceof l && (t[e.name] = e.build());
  36018. return Object.defineProperty && Object.defineProperty(t, "$options", {
  36019. value: this.buildOpt()
  36020. }),
  36021. t
  36022. }
  36023. ,
  36024. c.buildOpt = function() {
  36025. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  36026. var r = t[i]
  36027. , o = this.options[t[i]];
  36028. e[r] = o
  36029. }
  36030. return e
  36031. }
  36032. ,
  36033. c.getOption = function(e) {
  36034. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  36035. }
  36036. ,
  36037. o.Namespace = l;
  36038. var h = function(t, i, n, r) {
  36039. if (this.type = t,
  36040. this.resolvedType = i,
  36041. this.isMapKey = n,
  36042. this.syntax = r,
  36043. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  36044. throw Error("Invalid map key type: " + t.name)
  36045. }
  36046. , u = h.prototype;
  36047. h.defaultFieldValue = i,
  36048. u.verifyValue = function(i) {
  36049. function r(e, t) {
  36050. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  36051. }
  36052. var o = this;
  36053. switch (this.type) {
  36054. case e.TYPES.int32:
  36055. case e.TYPES.sint32:
  36056. case e.TYPES.sfixed32:
  36057. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  36058. i > 4294967295 ? 0 | i : i;
  36059. case e.TYPES.uint32:
  36060. case e.TYPES.fixed32:
  36061. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  36062. i < 0 ? i >>> 0 : i;
  36063. case e.TYPES.int64:
  36064. case e.TYPES.sint64:
  36065. case e.TYPES.sfixed64:
  36066. if (e.Long)
  36067. try {
  36068. return n(i, !1)
  36069. } catch (e) {
  36070. r(typeof i, e.message)
  36071. }
  36072. else
  36073. r(typeof i, "requires Long.js");
  36074. case e.TYPES.uint64:
  36075. case e.TYPES.fixed64:
  36076. if (e.Long)
  36077. try {
  36078. return n(i, !0)
  36079. } catch (e) {
  36080. r(typeof i, e.message)
  36081. }
  36082. else
  36083. r(typeof i, "requires Long.js");
  36084. case e.TYPES.bool:
  36085. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  36086. i;
  36087. case e.TYPES.float:
  36088. case e.TYPES.double:
  36089. return "number" != typeof i && r(typeof i, "not a number"),
  36090. i;
  36091. case e.TYPES.string:
  36092. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  36093. "" + i;
  36094. case e.TYPES.bytes:
  36095. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  36096. case e.TYPES.enum:
  36097. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  36098. for (l = 0; l < a.length; l++) {
  36099. if (a[l].name == i)
  36100. return a[l].id;
  36101. if (a[l].id == i)
  36102. return a[l].id
  36103. }
  36104. if ("proto3" === this.syntax)
  36105. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  36106. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  36107. i;
  36108. r(i, "not a valid enum value");
  36109. case e.TYPES.group:
  36110. case e.TYPES.message:
  36111. if (i && "object" == typeof i || r(typeof i, "object expected"),
  36112. i instanceof this.resolvedType.clazz)
  36113. return i;
  36114. if (i instanceof e.Builder.Message) {
  36115. var s = {};
  36116. for (var l in i)
  36117. i.hasOwnProperty(l) && (s[l] = i[l]);
  36118. i = s
  36119. }
  36120. return new this.resolvedType.clazz(i)
  36121. }
  36122. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  36123. }
  36124. ,
  36125. u.calculateLength = function(i, n) {
  36126. if (null === n)
  36127. return 0;
  36128. var r;
  36129. switch (this.type) {
  36130. case e.TYPES.int32:
  36131. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  36132. case e.TYPES.uint32:
  36133. return t.calculateVarint32(n);
  36134. case e.TYPES.sint32:
  36135. return t.calculateVarint32(t.zigZagEncode32(n));
  36136. case e.TYPES.fixed32:
  36137. case e.TYPES.sfixed32:
  36138. case e.TYPES.float:
  36139. return 4;
  36140. case e.TYPES.int64:
  36141. case e.TYPES.uint64:
  36142. return t.calculateVarint64(n);
  36143. case e.TYPES.sint64:
  36144. return t.calculateVarint64(t.zigZagEncode64(n));
  36145. case e.TYPES.fixed64:
  36146. case e.TYPES.sfixed64:
  36147. return 8;
  36148. case e.TYPES.bool:
  36149. return 1;
  36150. case e.TYPES.enum:
  36151. return t.calculateVarint32(n);
  36152. case e.TYPES.double:
  36153. return 8;
  36154. case e.TYPES.string:
  36155. return r = t.calculateUTF8Bytes(n),
  36156. t.calculateVarint32(r) + r;
  36157. case e.TYPES.bytes:
  36158. if (n.remaining() < 0)
  36159. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  36160. return t.calculateVarint32(n.remaining()) + n.remaining();
  36161. case e.TYPES.message:
  36162. return r = this.resolvedType.calculate(n),
  36163. t.calculateVarint32(r) + r;
  36164. case e.TYPES.group:
  36165. return r = this.resolvedType.calculate(n),
  36166. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  36167. }
  36168. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  36169. }
  36170. ,
  36171. u.encodeValue = function(i, n, r) {
  36172. if (null === n)
  36173. return r;
  36174. switch (this.type) {
  36175. case e.TYPES.int32:
  36176. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  36177. break;
  36178. case e.TYPES.uint32:
  36179. r.writeVarint32(n);
  36180. break;
  36181. case e.TYPES.sint32:
  36182. r.writeVarint32ZigZag(n);
  36183. break;
  36184. case e.TYPES.fixed32:
  36185. r.writeUint32(n);
  36186. break;
  36187. case e.TYPES.sfixed32:
  36188. r.writeInt32(n);
  36189. break;
  36190. case e.TYPES.int64:
  36191. case e.TYPES.uint64:
  36192. r.writeVarint64(n);
  36193. break;
  36194. case e.TYPES.sint64:
  36195. r.writeVarint64ZigZag(n);
  36196. break;
  36197. case e.TYPES.fixed64:
  36198. r.writeUint64(n);
  36199. break;
  36200. case e.TYPES.sfixed64:
  36201. r.writeInt64(n);
  36202. break;
  36203. case e.TYPES.bool:
  36204. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  36205. break;
  36206. case e.TYPES.enum:
  36207. r.writeVarint32(n);
  36208. break;
  36209. case e.TYPES.float:
  36210. r.writeFloat32(n);
  36211. break;
  36212. case e.TYPES.double:
  36213. r.writeFloat64(n);
  36214. break;
  36215. case e.TYPES.string:
  36216. r.writeVString(n);
  36217. break;
  36218. case e.TYPES.bytes:
  36219. if (n.remaining() < 0)
  36220. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  36221. var o = n.offset;
  36222. r.writeVarint32(n.remaining()),
  36223. r.append(n),
  36224. n.offset = o;
  36225. break;
  36226. case e.TYPES.message:
  36227. var a = (new t).LE();
  36228. this.resolvedType.encode(n, a),
  36229. r.writeVarint32(a.offset),
  36230. r.append(a.flip());
  36231. break;
  36232. case e.TYPES.group:
  36233. this.resolvedType.encode(n, r),
  36234. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  36235. break;
  36236. default:
  36237. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  36238. }
  36239. return r
  36240. }
  36241. ,
  36242. u.decode = function(t, i, n) {
  36243. if (i != this.type.wireType)
  36244. throw Error("Unexpected wire type for element");
  36245. var r, o;
  36246. switch (this.type) {
  36247. case e.TYPES.int32:
  36248. return 0 | t.readVarint32();
  36249. case e.TYPES.uint32:
  36250. return t.readVarint32() >>> 0;
  36251. case e.TYPES.sint32:
  36252. return 0 | t.readVarint32ZigZag();
  36253. case e.TYPES.fixed32:
  36254. return t.readUint32() >>> 0;
  36255. case e.TYPES.sfixed32:
  36256. return 0 | t.readInt32();
  36257. case e.TYPES.int64:
  36258. return t.readVarint64();
  36259. case e.TYPES.uint64:
  36260. return t.readVarint64().toUnsigned();
  36261. case e.TYPES.sint64:
  36262. return t.readVarint64ZigZag();
  36263. case e.TYPES.fixed64:
  36264. return t.readUint64();
  36265. case e.TYPES.sfixed64:
  36266. return t.readInt64();
  36267. case e.TYPES.bool:
  36268. return !!t.readVarint32();
  36269. case e.TYPES.enum:
  36270. return t.readVarint32();
  36271. case e.TYPES.float:
  36272. return t.readFloat();
  36273. case e.TYPES.double:
  36274. return t.readDouble();
  36275. case e.TYPES.string:
  36276. return t.readVString();
  36277. case e.TYPES.bytes:
  36278. if (o = t.readVarint32(),
  36279. t.remaining() < o)
  36280. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  36281. return r = t.clone(),
  36282. r.limit = r.offset + o,
  36283. t.offset += o,
  36284. r;
  36285. case e.TYPES.message:
  36286. return o = t.readVarint32(),
  36287. this.resolvedType.decode(t, o);
  36288. case e.TYPES.group:
  36289. return this.resolvedType.decode(t, -1, n)
  36290. }
  36291. throw Error("[INTERNAL] Illegal decode type")
  36292. }
  36293. ,
  36294. u.valueFromString = function(i) {
  36295. if (!this.isMapKey)
  36296. throw Error("valueFromString() called on non-map-key element");
  36297. switch (this.type) {
  36298. case e.TYPES.int32:
  36299. case e.TYPES.sint32:
  36300. case e.TYPES.sfixed32:
  36301. case e.TYPES.uint32:
  36302. case e.TYPES.fixed32:
  36303. return this.verifyValue(parseInt(i));
  36304. case e.TYPES.int64:
  36305. case e.TYPES.sint64:
  36306. case e.TYPES.sfixed64:
  36307. case e.TYPES.uint64:
  36308. case e.TYPES.fixed64:
  36309. return this.verifyValue(i);
  36310. case e.TYPES.bool:
  36311. return "true" === i;
  36312. case e.TYPES.string:
  36313. return this.verifyValue(i);
  36314. case e.TYPES.bytes:
  36315. return t.fromBinary(i)
  36316. }
  36317. }
  36318. ,
  36319. u.valueToString = function(t) {
  36320. if (!this.isMapKey)
  36321. throw Error("valueToString() called on non-map-key element");
  36322. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  36323. }
  36324. ,
  36325. o.Element = h;
  36326. var d = function(e, t, i, n, r, o) {
  36327. l.call(this, e, t, i, n, o),
  36328. this.className = "Message",
  36329. this.extensions = void 0,
  36330. this.clazz = null,
  36331. this.isGroup = !!r,
  36332. this._fields = null,
  36333. this._fieldsById = null,
  36334. this._fieldsByName = null
  36335. }
  36336. , p = d.prototype = Object.create(l.prototype);
  36337. p.build = function(i) {
  36338. if (this.clazz && !i)
  36339. return this.clazz;
  36340. var n = function(e, i) {
  36341. function n(i, r, o, a) {
  36342. if (null === i || "object" != typeof i) {
  36343. if (a && a instanceof e.Reflect.Enum) {
  36344. var s = e.Reflect.Enum.getName(a.object, i);
  36345. if (null !== s)
  36346. return s
  36347. }
  36348. return i
  36349. }
  36350. if (t.isByteBuffer(i))
  36351. return r ? i.toBase64() : i.toBuffer();
  36352. if (e.Long.isLong(i))
  36353. return o ? i.toString() : e.Long.fromValue(i);
  36354. var l;
  36355. if (Array.isArray(i))
  36356. return l = [],
  36357. i.forEach(function(e, t) {
  36358. l[t] = n(e, r, o, a)
  36359. }),
  36360. l;
  36361. if (l = {},
  36362. i instanceof e.Map) {
  36363. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  36364. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  36365. return l
  36366. }
  36367. var u = i.$type
  36368. , d = void 0;
  36369. for (var p in i)
  36370. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  36371. return l
  36372. }
  36373. var r = i.getChildren(e.Reflect.Message.Field)
  36374. , o = i.getChildren(e.Reflect.Message.OneOf)
  36375. , a = function(n, s) {
  36376. e.Builder.Message.call(this);
  36377. for (var l = 0, c = o.length; l < c; ++l)
  36378. this[o[l].name] = null;
  36379. for (l = 0,
  36380. c = r.length; l < c; ++l) {
  36381. var h = r[l];
  36382. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  36383. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  36384. }
  36385. if (arguments.length > 0) {
  36386. var u;
  36387. 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)
  36388. for (l = 0,
  36389. c = arguments.length; l < c; ++l)
  36390. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  36391. else
  36392. this.$set(n)
  36393. }
  36394. }
  36395. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  36396. s.add = function(t, n, r) {
  36397. var o = i._fieldsByName[t];
  36398. if (!r) {
  36399. if (!o)
  36400. throw Error(this + "#" + t + " is undefined");
  36401. if (!(o instanceof e.Reflect.Message.Field))
  36402. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  36403. if (!o.repeated)
  36404. throw Error(this + "#" + t + " is not a repeated field");
  36405. n = o.verifyValue(n, !0)
  36406. }
  36407. return null === this[t] && (this[t] = []),
  36408. this[t].push(n),
  36409. this
  36410. }
  36411. ,
  36412. s.$add = s.add,
  36413. s.set = function(t, n, r) {
  36414. if (t && "object" == typeof t) {
  36415. r = n;
  36416. for (var o in t)
  36417. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  36418. return this
  36419. }
  36420. var a = i._fieldsByName[t];
  36421. if (r)
  36422. this[t] = n;
  36423. else {
  36424. if (!a)
  36425. throw Error(this + "#" + t + " is not a field: undefined");
  36426. if (!(a instanceof e.Reflect.Message.Field))
  36427. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  36428. this[a.name] = n = a.verifyValue(n)
  36429. }
  36430. if (a && a.oneof) {
  36431. var s = this[a.oneof.name];
  36432. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  36433. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  36434. }
  36435. return this
  36436. }
  36437. ,
  36438. s.$set = s.set,
  36439. s.get = function(t, n) {
  36440. if (n)
  36441. return this[t];
  36442. var r = i._fieldsByName[t];
  36443. if (!(r && r instanceof e.Reflect.Message.Field))
  36444. throw Error(this + "#" + t + " is not a field: undefined");
  36445. if (!(r instanceof e.Reflect.Message.Field))
  36446. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  36447. return this[r.name]
  36448. }
  36449. ,
  36450. s.$get = s.get;
  36451. for (var l = 0; l < r.length; l++) {
  36452. var c = r[l];
  36453. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  36454. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  36455. return e.toUpperCase().replace("_", "")
  36456. });
  36457. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  36458. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  36459. return "_" + e
  36460. })
  36461. , r = function(t, i) {
  36462. return this[e.name] = i ? t : e.verifyValue(t),
  36463. this
  36464. }
  36465. , o = function() {
  36466. return this[e.name]
  36467. };
  36468. null === i.getChild("set" + t) && (s["set" + t] = r),
  36469. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  36470. null === i.getChild("get" + t) && (s["get" + t] = o),
  36471. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  36472. }(c)
  36473. }
  36474. s.encode = function(e, n) {
  36475. "boolean" == typeof e && (n = e,
  36476. e = void 0);
  36477. var r = !1;
  36478. e || (e = new t,
  36479. r = !0);
  36480. var o = e.littleEndian;
  36481. try {
  36482. return i.encode(this, e.LE(), n),
  36483. (r ? e.flip() : e).LE(o)
  36484. } catch (t) {
  36485. throw e.LE(o),
  36486. t
  36487. }
  36488. }
  36489. ,
  36490. a.encode = function(e, t, i) {
  36491. return new a(e).encode(t, i)
  36492. }
  36493. ,
  36494. s.calculate = function() {
  36495. return i.calculate(this)
  36496. }
  36497. ,
  36498. s.encodeDelimited = function(e, n) {
  36499. var r = !1;
  36500. e || (e = new t,
  36501. r = !0);
  36502. var o = (new t).LE();
  36503. return i.encode(this, o, n).flip(),
  36504. e.writeVarint32(o.remaining()),
  36505. e.append(o),
  36506. r ? e.flip() : e
  36507. }
  36508. ,
  36509. s.encodeAB = function() {
  36510. try {
  36511. return this.encode().toArrayBuffer()
  36512. } catch (e) {
  36513. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  36514. e
  36515. }
  36516. }
  36517. ,
  36518. s.toArrayBuffer = s.encodeAB,
  36519. s.encodeNB = function() {
  36520. try {
  36521. return this.encode().toBuffer()
  36522. } catch (e) {
  36523. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  36524. e
  36525. }
  36526. }
  36527. ,
  36528. s.toBuffer = s.encodeNB,
  36529. s.encode64 = function() {
  36530. try {
  36531. return this.encode().toBase64()
  36532. } catch (e) {
  36533. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  36534. e
  36535. }
  36536. }
  36537. ,
  36538. s.toBase64 = s.encode64,
  36539. s.encodeHex = function() {
  36540. try {
  36541. return this.encode().toHex()
  36542. } catch (e) {
  36543. throw e.encoded && (e.encoded = e.encoded.toHex()),
  36544. e
  36545. }
  36546. }
  36547. ,
  36548. s.toHex = s.encodeHex,
  36549. s.toRaw = function(e, t) {
  36550. return n(this, !!e, !!t, this.$type)
  36551. }
  36552. ,
  36553. s.encodeJSON = function() {
  36554. return JSON.stringify(n(this, !0, !0, this.$type))
  36555. }
  36556. ,
  36557. a.decode = function(e, n, r) {
  36558. "string" == typeof n && (r = n,
  36559. n = -1),
  36560. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  36561. e = t.isByteBuffer(e) ? e : t.wrap(e);
  36562. var o = e.littleEndian;
  36563. try {
  36564. var a = i.decode(e.LE());
  36565. return e.LE(o),
  36566. a
  36567. } catch (t) {
  36568. throw e.LE(o),
  36569. t
  36570. }
  36571. }
  36572. ,
  36573. a.decodeDelimited = function(e, n) {
  36574. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  36575. e = t.isByteBuffer(e) ? e : t.wrap(e),
  36576. e.remaining() < 1)
  36577. return null;
  36578. var r = e.offset
  36579. , o = e.readVarint32();
  36580. if (e.remaining() < o)
  36581. return e.offset = r,
  36582. null;
  36583. try {
  36584. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  36585. return e.offset += o,
  36586. a
  36587. } catch (t) {
  36588. throw e.offset += o,
  36589. t
  36590. }
  36591. }
  36592. ,
  36593. a.decode64 = function(e) {
  36594. return a.decode(e, "base64")
  36595. }
  36596. ,
  36597. a.decodeHex = function(e) {
  36598. return a.decode(e, "hex")
  36599. }
  36600. ,
  36601. a.decodeJSON = function(e) {
  36602. return new a(JSON.parse(e))
  36603. }
  36604. ,
  36605. s.toString = function() {
  36606. return i.toString()
  36607. }
  36608. ;
  36609. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  36610. value: i.buildOpt()
  36611. }),
  36612. Object.defineProperty(s, "$options", {
  36613. value: a.$options
  36614. }),
  36615. Object.defineProperty(a, "$type", {
  36616. value: i
  36617. }),
  36618. Object.defineProperty(s, "$type", {
  36619. value: i
  36620. })),
  36621. a
  36622. }(e, this);
  36623. this._fields = [],
  36624. this._fieldsById = {},
  36625. this._fieldsByName = {};
  36626. for (var r, o = 0, a = this.children.length; o < a; o++)
  36627. if (r = this.children[o],
  36628. r instanceof A || r instanceof d || r instanceof E) {
  36629. if (n.hasOwnProperty(r.name))
  36630. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  36631. n[r.name] = r.build()
  36632. } else if (r instanceof d.Field)
  36633. r.build(),
  36634. this._fields.push(r),
  36635. this._fieldsById[r.id] = r,
  36636. this._fieldsByName[r.name] = r;
  36637. else if (!(r instanceof d.OneOf || r instanceof I))
  36638. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  36639. return this.clazz = n
  36640. }
  36641. ,
  36642. p.encode = function(e, t, i) {
  36643. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  36644. n = this._fields[a],
  36645. r = e[n.name],
  36646. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  36647. if (null !== o) {
  36648. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  36649. throw l.encoded = t,
  36650. l
  36651. }
  36652. return t
  36653. }
  36654. ,
  36655. p.calculate = function(e) {
  36656. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  36657. if (t = this._fields[r],
  36658. i = e[t.name],
  36659. t.required && null === i)
  36660. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  36661. n += t.calculate(i, e)
  36662. }
  36663. return n
  36664. }
  36665. ,
  36666. p.decode = function(t, i, n) {
  36667. i = "number" == typeof i ? i : -1;
  36668. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36669. if (o = t.readVarint32(),
  36670. a = 7 & o,
  36671. s = o >>> 3,
  36672. a === e.WIRE_TYPES.ENDGROUP) {
  36673. if (s !== n)
  36674. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36675. break
  36676. }
  36677. if (l = this._fieldsById[s]) {
  36678. if (l.repeated && !l.options.packed)
  36679. h[l.name].push(l.decode(a, t));
  36680. else if (l.map) {
  36681. var u = l.decode(a, t);
  36682. h[l.name].set(u[0], u[1])
  36683. } else if (h[l.name] = l.decode(a, t),
  36684. l.oneof) {
  36685. var d = h[l.oneof.name];
  36686. null !== d && d !== l.name && (h[d] = null),
  36687. h[l.oneof.name] = l.name
  36688. }
  36689. } else
  36690. switch (a) {
  36691. case e.WIRE_TYPES.VARINT:
  36692. t.readVarint32();
  36693. break;
  36694. case e.WIRE_TYPES.BITS32:
  36695. t.offset += 4;
  36696. break;
  36697. case e.WIRE_TYPES.BITS64:
  36698. t.offset += 8;
  36699. break;
  36700. case e.WIRE_TYPES.LDELIM:
  36701. var p = t.readVarint32();
  36702. t.offset += p;
  36703. break;
  36704. case e.WIRE_TYPES.STARTGROUP:
  36705. for (; r(s, t); )
  36706. ;
  36707. break;
  36708. default:
  36709. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36710. }
  36711. }
  36712. for (var f = 0, g = this._fields.length; f < g; ++f)
  36713. if (l = this._fields[f],
  36714. null === h[l.name])
  36715. if ("proto3" === this.syntax)
  36716. h[l.name] = l.defaultValue;
  36717. else {
  36718. if (l.required) {
  36719. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36720. throw m.decoded = h,
  36721. m
  36722. }
  36723. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36724. }
  36725. return h
  36726. }
  36727. ,
  36728. o.Message = d;
  36729. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36730. a.call(this, t, i, s),
  36731. this.className = "Message.Field",
  36732. this.required = "required" === n,
  36733. this.repeated = "repeated" === n,
  36734. this.map = "map" === n,
  36735. this.keyType = r || null,
  36736. this.type = o,
  36737. this.resolvedType = null,
  36738. this.id = l,
  36739. this.options = c || {},
  36740. this.defaultValue = null,
  36741. this.oneof = h || null,
  36742. this.syntax = u || "proto2",
  36743. this.originalName = this.name,
  36744. this.element = null,
  36745. this.keyElement = null,
  36746. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36747. }
  36748. , g = f.prototype = Object.create(a.prototype);
  36749. g.build = function() {
  36750. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36751. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36752. "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)
  36753. }
  36754. ,
  36755. g.verifyValue = function(t, i) {
  36756. function n(e, t) {
  36757. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36758. }
  36759. i = i || !1;
  36760. var r = this;
  36761. if (null === t)
  36762. return this.required && n(typeof t, "required"),
  36763. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36764. null;
  36765. var o;
  36766. if (this.repeated && !i) {
  36767. Array.isArray(t) || (t = [t]);
  36768. var a = [];
  36769. for (o = 0; o < t.length; o++)
  36770. a.push(this.element.verifyValue(t[o]));
  36771. return a
  36772. }
  36773. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36774. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36775. this.element.verifyValue(t))
  36776. }
  36777. ,
  36778. g.hasWirePresence = function(t, i) {
  36779. if ("proto3" !== this.syntax)
  36780. return null !== t;
  36781. if (this.oneof && i[this.oneof.name] === this.name)
  36782. return !0;
  36783. switch (this.type) {
  36784. case e.TYPES.int32:
  36785. case e.TYPES.sint32:
  36786. case e.TYPES.sfixed32:
  36787. case e.TYPES.uint32:
  36788. case e.TYPES.fixed32:
  36789. return 0 !== t;
  36790. case e.TYPES.int64:
  36791. case e.TYPES.sint64:
  36792. case e.TYPES.sfixed64:
  36793. case e.TYPES.uint64:
  36794. case e.TYPES.fixed64:
  36795. return 0 !== t.low || 0 !== t.high;
  36796. case e.TYPES.bool:
  36797. return t;
  36798. case e.TYPES.float:
  36799. case e.TYPES.double:
  36800. return 0 !== t;
  36801. case e.TYPES.string:
  36802. return t.length > 0;
  36803. case e.TYPES.bytes:
  36804. return t.remaining() > 0;
  36805. case e.TYPES.enum:
  36806. return 0 !== t;
  36807. case e.TYPES.message:
  36808. return null !== t;
  36809. default:
  36810. return !0
  36811. }
  36812. }
  36813. ,
  36814. g.encode = function(i, n, r) {
  36815. if (null === this.type || "object" != typeof this.type)
  36816. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36817. if (null === i || this.repeated && 0 == i.length)
  36818. return n;
  36819. try {
  36820. if (this.repeated) {
  36821. var o;
  36822. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36823. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36824. n.ensureCapacity(n.offset += 1);
  36825. var a = n.offset;
  36826. for (o = 0; o < i.length; o++)
  36827. this.element.encodeValue(this.id, i[o], n);
  36828. var s = n.offset - a
  36829. , l = t.calculateVarint32(s);
  36830. if (l > 1) {
  36831. var c = n.slice(a, n.offset);
  36832. a += l - 1,
  36833. n.offset = a,
  36834. n.append(c)
  36835. }
  36836. n.writeVarint32(s, a - l)
  36837. } else
  36838. for (o = 0; o < i.length; o++)
  36839. n.writeVarint32(this.id << 3 | this.type.wireType),
  36840. this.element.encodeValue(this.id, i[o], n)
  36841. } else
  36842. this.map ? i.forEach(function(i, r, o) {
  36843. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36844. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36845. n.writeVarint32(a),
  36846. n.writeVarint32(8 | this.keyType.wireType),
  36847. this.keyElement.encodeValue(1, r, n),
  36848. n.writeVarint32(16 | this.type.wireType),
  36849. this.element.encodeValue(2, i, n)
  36850. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36851. this.element.encodeValue(this.id, i, n))
  36852. } catch (e) {
  36853. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36854. }
  36855. return n
  36856. }
  36857. ,
  36858. g.calculate = function(i, n) {
  36859. if (i = this.verifyValue(i),
  36860. null === this.type || "object" != typeof this.type)
  36861. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36862. if (null === i || this.repeated && 0 == i.length)
  36863. return 0;
  36864. var r = 0;
  36865. try {
  36866. if (this.repeated) {
  36867. var o, a;
  36868. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36869. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36870. a = 0,
  36871. o = 0; o < i.length; o++)
  36872. a += this.element.calculateLength(this.id, i[o]);
  36873. r += t.calculateVarint32(a),
  36874. r += a
  36875. } else
  36876. for (o = 0; o < i.length; o++)
  36877. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36878. r += this.element.calculateLength(this.id, i[o])
  36879. } else
  36880. this.map ? i.forEach(function(i, n, o) {
  36881. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36882. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36883. r += t.calculateVarint32(a),
  36884. r += a
  36885. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36886. r += this.element.calculateLength(this.id, i))
  36887. } catch (e) {
  36888. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36889. }
  36890. return r
  36891. }
  36892. ,
  36893. g.decode = function(t, i, n) {
  36894. 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;
  36895. if (!a)
  36896. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36897. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36898. o = i.readVarint32(),
  36899. o = i.offset + o;
  36900. for (var s = []; i.offset < o; )
  36901. s.push(this.decode(this.type.wireType, i, !0));
  36902. return s
  36903. }
  36904. if (this.map) {
  36905. var l = h.defaultFieldValue(this.keyType);
  36906. if (r = h.defaultFieldValue(this.type),
  36907. o = i.readVarint32(),
  36908. i.remaining() < o)
  36909. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36910. var c = i.clone();
  36911. for (c.limit = c.offset + o,
  36912. i.offset += o; c.remaining() > 0; ) {
  36913. var u = c.readVarint32();
  36914. t = 7 & u;
  36915. var d = u >>> 3;
  36916. if (1 === d)
  36917. l = this.keyElement.decode(c, t, d);
  36918. else {
  36919. if (2 !== d)
  36920. throw Error("Unexpected tag in map field key/value submessage");
  36921. r = this.element.decode(c, t, d)
  36922. }
  36923. }
  36924. return [l, r]
  36925. }
  36926. return this.element.decode(i, t, this.id)
  36927. }
  36928. ,
  36929. o.Message.Field = f;
  36930. var m = function(e, t, i, n, r, o, a) {
  36931. f.call(this, e, t, i, null, n, r, o, a),
  36932. this.extension
  36933. };
  36934. m.prototype = Object.create(f.prototype),
  36935. o.Message.ExtensionField = m;
  36936. var v = function(e, t, i) {
  36937. a.call(this, e, t, i),
  36938. this.fields = []
  36939. };
  36940. o.Message.OneOf = v;
  36941. var A = function(e, t, i, n, r) {
  36942. l.call(this, e, t, i, n, r),
  36943. this.className = "Enum",
  36944. this.object = null
  36945. };
  36946. A.getName = function(e, t) {
  36947. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36948. if (e[i = n[r]] === t)
  36949. return i;
  36950. return null
  36951. }
  36952. ;
  36953. var y = A.prototype = Object.create(l.prototype);
  36954. y.build = function(t) {
  36955. if (this.object && !t)
  36956. return this.object;
  36957. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36958. i[n[r].name] = n[r].id;
  36959. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36960. value: this.buildOpt(),
  36961. enumerable: !1
  36962. }),
  36963. this.object = i
  36964. }
  36965. ,
  36966. o.Enum = A;
  36967. var C = function(e, t, i, n) {
  36968. a.call(this, e, t, i),
  36969. this.className = "Enum.Value",
  36970. this.id = n
  36971. };
  36972. C.prototype = Object.create(a.prototype),
  36973. o.Enum.Value = C;
  36974. var I = function(e, t, i, n) {
  36975. a.call(this, e, t, i),
  36976. this.field = n
  36977. };
  36978. I.prototype = Object.create(a.prototype),
  36979. o.Extension = I;
  36980. var E = function(e, t, i, n) {
  36981. l.call(this, e, t, i, n),
  36982. this.className = "Service",
  36983. this.clazz = null
  36984. }
  36985. , b = E.prototype = Object.create(l.prototype);
  36986. b.build = function(i) {
  36987. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36988. for (var n = function(t) {
  36989. e.Builder.Service.call(this),
  36990. this.rpcImpl = t || function(e, t, i) {
  36991. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36992. }
  36993. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36994. !function(e) {
  36995. r[e.name] = function(n, r) {
  36996. try {
  36997. try {
  36998. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36999. } catch (e) {
  37000. if (!(e instanceof TypeError))
  37001. throw e
  37002. }
  37003. if (null === n || "object" != typeof n)
  37004. throw Error("Illegal arguments");
  37005. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  37006. this.rpcImpl(e.fqn(), n, function(t, n) {
  37007. if (t)
  37008. return void r(t);
  37009. null === n && (n = "");
  37010. try {
  37011. n = e.resolvedResponseType.clazz.decode(n)
  37012. } catch (e) {}
  37013. 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))
  37014. })
  37015. } catch (e) {
  37016. setTimeout(r.bind(this, e), 0)
  37017. }
  37018. }
  37019. ,
  37020. n[e.name] = function(t, i, r) {
  37021. new n(t)[e.name](i, r)
  37022. }
  37023. ,
  37024. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  37025. value: e.buildOpt()
  37026. }),
  37027. Object.defineProperty(r[e.name], "$options", {
  37028. value: n[e.name].$options
  37029. }))
  37030. }(o[a]);
  37031. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  37032. value: i.buildOpt()
  37033. }),
  37034. Object.defineProperty(r, "$options", {
  37035. value: n.$options
  37036. }),
  37037. Object.defineProperty(n, "$type", {
  37038. value: i
  37039. }),
  37040. Object.defineProperty(r, "$type", {
  37041. value: i
  37042. })),
  37043. n
  37044. }(e, this)
  37045. }
  37046. ,
  37047. o.Service = E;
  37048. var w = function(e, t, i, n) {
  37049. a.call(this, e, t, i),
  37050. this.className = "Service.Method",
  37051. this.options = n || {}
  37052. }
  37053. , _ = w.prototype = Object.create(a.prototype);
  37054. _.buildOpt = c.buildOpt,
  37055. o.Service.Method = w;
  37056. var T = function(e, t, i, n, r, o, a, s) {
  37057. w.call(this, e, t, i, s),
  37058. this.className = "Service.RPCMethod",
  37059. this.requestName = n,
  37060. this.responseName = r,
  37061. this.requestStream = o,
  37062. this.responseStream = a,
  37063. this.resolvedRequestType = null,
  37064. this.resolvedResponseType = null
  37065. };
  37066. return T.prototype = Object.create(w.prototype),
  37067. o.Service.RPCMethod = T,
  37068. o
  37069. }(r),
  37070. r.Builder = function(t, i, n) {
  37071. function r(e) {
  37072. e.messages && e.messages.forEach(function(t) {
  37073. t.syntax = e.syntax,
  37074. r(t)
  37075. }),
  37076. e.enums && e.enums.forEach(function(t) {
  37077. t.syntax = e.syntax
  37078. })
  37079. }
  37080. var o = function(e) {
  37081. this.ns = new n.Namespace(this,null,""),
  37082. this.ptr = this.ns,
  37083. this.resolved = !1,
  37084. this.result = null,
  37085. this.files = {},
  37086. this.importRoot = null,
  37087. this.options = e || {}
  37088. }
  37089. , a = o.prototype;
  37090. return o.isMessage = function(e) {
  37091. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  37092. }
  37093. ,
  37094. o.isMessageField = function(e) {
  37095. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  37096. }
  37097. ,
  37098. o.isEnum = function(e) {
  37099. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  37100. }
  37101. ,
  37102. o.isService = function(e) {
  37103. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  37104. }
  37105. ,
  37106. o.isExtend = function(e) {
  37107. return "string" == typeof e.ref
  37108. }
  37109. ,
  37110. a.reset = function() {
  37111. return this.ptr = this.ns,
  37112. this
  37113. }
  37114. ,
  37115. a.define = function(e) {
  37116. if ("string" != typeof e || !i.TYPEREF.test(e))
  37117. throw Error("illegal namespace: " + e);
  37118. return e.split(".").forEach(function(e) {
  37119. var t = this.ptr.getChild(e);
  37120. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  37121. this.ptr = t
  37122. }, this),
  37123. this
  37124. }
  37125. ,
  37126. a.create = function(e) {
  37127. if (!e)
  37128. return this;
  37129. if (Array.isArray(e)) {
  37130. if (0 === e.length)
  37131. return this;
  37132. e = e.slice()
  37133. } else
  37134. e = [e];
  37135. for (var i = [e]; i.length > 0; ) {
  37136. if (e = i.pop(),
  37137. !Array.isArray(e))
  37138. throw Error("not a valid namespace: " + JSON.stringify(e));
  37139. for (; e.length > 0; ) {
  37140. var r = e.shift();
  37141. if (o.isMessage(r)) {
  37142. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  37143. , s = {};
  37144. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  37145. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  37146. }, this),
  37147. r.fields && r.fields.forEach(function(e) {
  37148. if (null !== a.getChild(0 | e.id))
  37149. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  37150. if (e.options && "object" != typeof e.options)
  37151. throw Error("illegal field options in " + a.name + "#" + e.name);
  37152. var t = null;
  37153. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  37154. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  37155. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  37156. t && t.fields.push(e),
  37157. a.addChild(e)
  37158. }, this);
  37159. var l = [];
  37160. if (r.enums && r.enums.forEach(function(e) {
  37161. l.push(e)
  37162. }),
  37163. r.messages && r.messages.forEach(function(e) {
  37164. l.push(e)
  37165. }),
  37166. r.services && r.services.forEach(function(e) {
  37167. l.push(e)
  37168. }),
  37169. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  37170. this.ptr.addChild(a),
  37171. l.length > 0) {
  37172. i.push(e),
  37173. e = l,
  37174. l = null,
  37175. this.ptr = a,
  37176. a = null;
  37177. continue
  37178. }
  37179. l = null
  37180. } else if (o.isEnum(r))
  37181. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  37182. r.values.forEach(function(e) {
  37183. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  37184. }, this),
  37185. this.ptr.addChild(a);
  37186. else if (o.isService(r))
  37187. a = new n.Service(this,this.ptr,r.name,r.options),
  37188. Object.keys(r.rpc).forEach(function(e) {
  37189. var t = r.rpc[e];
  37190. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  37191. }, this),
  37192. this.ptr.addChild(a);
  37193. else {
  37194. if (!o.isExtend(r))
  37195. throw Error("not a valid definition: " + JSON.stringify(r));
  37196. if (a = this.ptr.resolve(r.ref, !0))
  37197. r.fields.forEach(function(e) {
  37198. if (null !== a.getChild(0 | e.id))
  37199. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  37200. if (a.extensions) {
  37201. var i = !1;
  37202. if (a.extensions.forEach(function(t) {
  37203. e.id >= t[0] && e.id <= t[1] && (i = !0)
  37204. }),
  37205. !i)
  37206. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  37207. }
  37208. var r = e.name;
  37209. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  37210. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  37211. , s = new n.Extension(this,this.ptr,e.name,o);
  37212. o.extension = s,
  37213. this.ptr.addChild(s),
  37214. a.addChild(o)
  37215. }, this);
  37216. else if (!/\.?google\.protobuf\./.test(r.ref))
  37217. throw Error("extended message " + r.ref + " is not defined")
  37218. }
  37219. r = null,
  37220. a = null
  37221. }
  37222. e = null,
  37223. this.ptr = this.ptr.parent
  37224. }
  37225. return this.resolved = !1,
  37226. this.result = null,
  37227. this
  37228. }
  37229. ,
  37230. a.import = function(i, n) {
  37231. var o = "/";
  37232. if ("string" == typeof n) {
  37233. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  37234. this.files[n] === !0)
  37235. return this.reset();
  37236. this.files[n] = !0
  37237. } else if ("object" == typeof n) {
  37238. var a = n.root;
  37239. t.Util.IS_NODE && (a = e("path").resolve(a)),
  37240. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  37241. var s = a + o + n.file;
  37242. if (this.files[s] === !0)
  37243. return this.reset();
  37244. this.files[s] = !0
  37245. }
  37246. if (i.imports && i.imports.length > 0) {
  37247. var l, c = !1;
  37248. "object" == typeof n ? (this.importRoot = n.root,
  37249. c = !0,
  37250. l = this.importRoot,
  37251. n = n.file,
  37252. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  37253. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  37254. o = "\\") : l = "." : l = null;
  37255. for (var h = 0; h < i.imports.length; h++)
  37256. if ("string" == typeof i.imports[h]) {
  37257. if (!l)
  37258. throw Error("cannot determine import root");
  37259. var u = i.imports[h];
  37260. if ("google/protobuf/descriptor.proto" === u)
  37261. continue;
  37262. if (u = l + o + u,
  37263. this.files[u] === !0)
  37264. continue;
  37265. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  37266. var d = t.Util.fetch(u);
  37267. if (null === d)
  37268. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  37269. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  37270. } else
  37271. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  37272. return t + "_import" + h + "." + i
  37273. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  37274. c && (this.importRoot = null)
  37275. }
  37276. i.package && this.define(i.package),
  37277. i.syntax && r(i);
  37278. var p = this.ptr;
  37279. return i.options && Object.keys(i.options).forEach(function(e) {
  37280. p.options[e] = i.options[e]
  37281. }),
  37282. i.messages && (this.create(i.messages),
  37283. this.ptr = p),
  37284. i.enums && (this.create(i.enums),
  37285. this.ptr = p),
  37286. i.services && (this.create(i.services),
  37287. this.ptr = p),
  37288. i.extends && this.create(i.extends),
  37289. this.reset()
  37290. }
  37291. ,
  37292. a.resolveAll = function() {
  37293. var e;
  37294. if (null == this.ptr || "object" == typeof this.ptr.type)
  37295. return this;
  37296. if (this.ptr instanceof n.Namespace)
  37297. this.ptr.children.forEach(function(e) {
  37298. this.ptr = e,
  37299. this.resolveAll()
  37300. }, this);
  37301. else if (this.ptr instanceof n.Message.Field) {
  37302. if (i.TYPE.test(this.ptr.type))
  37303. this.ptr.type = t.TYPES[this.ptr.type];
  37304. else {
  37305. if (!i.TYPEREF.test(this.ptr.type))
  37306. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  37307. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  37308. !e)
  37309. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  37310. if (this.ptr.resolvedType = e,
  37311. e instanceof n.Enum) {
  37312. if (this.ptr.type = t.TYPES.enum,
  37313. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  37314. throw Error("proto3 message cannot reference proto2 enum")
  37315. } else {
  37316. if (!(e instanceof n.Message))
  37317. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  37318. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  37319. }
  37320. }
  37321. if (this.ptr.map) {
  37322. if (!i.TYPE.test(this.ptr.keyType))
  37323. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  37324. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  37325. }
  37326. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  37327. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  37328. throw Error("illegal service type in " + this.ptr.toString(!0));
  37329. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  37330. !(e && e instanceof t.Reflect.Message))
  37331. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  37332. if (this.ptr.resolvedRequestType = e,
  37333. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  37334. !(e && e instanceof t.Reflect.Message))
  37335. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  37336. this.ptr.resolvedResponseType = e
  37337. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  37338. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  37339. return this.reset()
  37340. }
  37341. ,
  37342. a.build = function(e) {
  37343. if (this.reset(),
  37344. this.resolved || (this.resolveAll(),
  37345. this.resolved = !0,
  37346. this.result = null),
  37347. null === this.result && (this.result = this.ns.build()),
  37348. !e)
  37349. return this.result;
  37350. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  37351. if (!i[t[n]]) {
  37352. i = null;
  37353. break
  37354. }
  37355. i = i[t[n]]
  37356. }
  37357. return i
  37358. }
  37359. ,
  37360. a.lookup = function(e, t) {
  37361. return e ? this.ns.resolve(e, t) : this.ns
  37362. }
  37363. ,
  37364. a.toString = function() {
  37365. return "Builder"
  37366. }
  37367. ,
  37368. o.Message = function() {}
  37369. ,
  37370. o.Enum = function() {}
  37371. ,
  37372. o.Service = function() {}
  37373. ,
  37374. o
  37375. }(r, r.Lang, r.Reflect),
  37376. r.Map = function(e, t) {
  37377. function i(e) {
  37378. var t = 0;
  37379. return {
  37380. next: function() {
  37381. return t < e.length ? {
  37382. done: !1,
  37383. value: e[t++]
  37384. } : {
  37385. done: !0
  37386. }
  37387. }
  37388. }
  37389. }
  37390. var n = function(e, i) {
  37391. if (!e.map)
  37392. throw Error("field is not a map");
  37393. if (this.field = e,
  37394. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  37395. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  37396. this.map = {},
  37397. Object.defineProperty(this, "size", {
  37398. get: function() {
  37399. return Object.keys(this.map).length
  37400. }
  37401. }),
  37402. i)
  37403. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  37404. var o = this.keyElem.valueFromString(n[r])
  37405. , a = this.valueElem.verifyValue(i[n[r]]);
  37406. this.map[this.keyElem.valueToString(o)] = {
  37407. key: o,
  37408. value: a
  37409. }
  37410. }
  37411. }
  37412. , r = n.prototype;
  37413. return r.clear = function() {
  37414. this.map = {}
  37415. }
  37416. ,
  37417. r.delete = function(e) {
  37418. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  37419. , i = t in this.map;
  37420. return delete this.map[t],
  37421. i
  37422. }
  37423. ,
  37424. r.entries = function() {
  37425. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  37426. t.push([(e = this.map[n[r]]).key, e.value]);
  37427. return i(t)
  37428. }
  37429. ,
  37430. r.keys = function() {
  37431. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37432. e.push(this.map[t[n]].key);
  37433. return i(e)
  37434. }
  37435. ,
  37436. r.values = function() {
  37437. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37438. e.push(this.map[t[n]].value);
  37439. return i(e)
  37440. }
  37441. ,
  37442. r.forEach = function(e, t) {
  37443. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  37444. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  37445. }
  37446. ,
  37447. r.set = function(e, t) {
  37448. var i = this.keyElem.verifyValue(e)
  37449. , n = this.valueElem.verifyValue(t);
  37450. return this.map[this.keyElem.valueToString(i)] = {
  37451. key: i,
  37452. value: n
  37453. },
  37454. this
  37455. }
  37456. ,
  37457. r.get = function(e) {
  37458. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37459. if (t in this.map)
  37460. return this.map[t].value
  37461. }
  37462. ,
  37463. r.has = function(e) {
  37464. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37465. return t in this.map
  37466. }
  37467. ,
  37468. n
  37469. }(r, r.Reflect),
  37470. r.loadProto = function(e, t, i) {
  37471. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37472. t = void 0),
  37473. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  37474. }
  37475. ,
  37476. r.protoFromString = r.loadProto,
  37477. r.loadProtoFile = function(e, t, i) {
  37478. if (t && "object" == typeof t ? (i = t,
  37479. t = null) : t && "function" == typeof t || (t = null),
  37480. t)
  37481. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37482. if (null === n)
  37483. return void t(Error("Failed to fetch file"));
  37484. try {
  37485. t(null, r.loadProto(n, i, e))
  37486. } catch (e) {
  37487. t(e)
  37488. }
  37489. });
  37490. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37491. return null === n ? null : r.loadProto(n, i, e)
  37492. }
  37493. ,
  37494. r.protoFromFile = r.loadProtoFile,
  37495. r.newBuilder = function(e) {
  37496. return e = e || {},
  37497. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  37498. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  37499. new r.Builder(e)
  37500. }
  37501. ,
  37502. r.loadJson = function(e, t, i) {
  37503. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37504. t = null),
  37505. t && "object" == typeof t || (t = r.newBuilder()),
  37506. "string" == typeof e && (e = JSON.parse(e)),
  37507. t.import(e, i),
  37508. t.resolveAll(),
  37509. t
  37510. }
  37511. ,
  37512. r.loadJsonFile = function(e, t, i) {
  37513. if (t && "object" == typeof t ? (i = t,
  37514. t = null) : t && "function" == typeof t || (t = null),
  37515. t)
  37516. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37517. if (null === n)
  37518. return void t(Error("Failed to fetch file"));
  37519. try {
  37520. t(null, r.loadJson(JSON.parse(n), i, e))
  37521. } catch (e) {
  37522. t(e)
  37523. }
  37524. });
  37525. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37526. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  37527. }
  37528. ,
  37529. r
  37530. })
  37531. }
  37532. ).call(this, e("_process"))
  37533. }
  37534. , {
  37535. _process: 203,
  37536. bytebuffer: 215,
  37537. fs: 197,
  37538. path: 197
  37539. }],
  37540. 215: [function(e, t, i) {//bytebuffer
  37541. !function(i, n) {
  37542. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  37543. var t;
  37544. try {
  37545. t = e("long")
  37546. } catch (e) {}
  37547. return n(t)
  37548. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  37549. }(this, function(e) {
  37550. "use strict";
  37551. function t(e) {
  37552. var t = 0;
  37553. return function() {
  37554. return t < e.length ? e.charCodeAt(t++) : null
  37555. }
  37556. }
  37557. function i() {
  37558. var e = []
  37559. , t = [];
  37560. return function() {
  37561. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  37562. e.length = 0),
  37563. void Array.prototype.push.apply(e, arguments))
  37564. }
  37565. }
  37566. function n(e, t, i, n, r) {
  37567. 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];
  37568. for (u += d,
  37569. o = p & (1 << -h) - 1,
  37570. p >>= -h,
  37571. h += s; h > 0; o = 256 * o + e[t + u],
  37572. u += d,
  37573. h -= 8)
  37574. ;
  37575. for (a = o & (1 << -h) - 1,
  37576. o >>= -h,
  37577. h += n; h > 0; a = 256 * a + e[t + u],
  37578. u += d,
  37579. h -= 8)
  37580. ;
  37581. if (0 === o)
  37582. o = 1 - c;
  37583. else {
  37584. if (o === l)
  37585. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  37586. a += Math.pow(2, n),
  37587. o -= c
  37588. }
  37589. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  37590. }
  37591. function r(e, t, i, n, r, o) {
  37592. 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;
  37593. for (t = Math.abs(t),
  37594. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  37595. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  37596. t * (l = Math.pow(2, -a)) < 1 && (a--,
  37597. l *= 2),
  37598. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  37599. t * l >= 2 && (a++,
  37600. l /= 2),
  37601. a + u >= h ? (s = 0,
  37602. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  37603. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  37604. a = 0)); r >= 8; e[i + p] = 255 & s,
  37605. p += f,
  37606. s /= 256,
  37607. r -= 8)
  37608. ;
  37609. for (a = a << r | s,
  37610. c += r; c > 0; e[i + p] = 255 & a,
  37611. p += f,
  37612. a /= 256,
  37613. c -= 8)
  37614. ;
  37615. e[i + p - f] |= 128 * g
  37616. }
  37617. var o = function(e, t, i) {
  37618. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  37619. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  37620. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  37621. !i) {
  37622. if (e |= 0,
  37623. e < 0)
  37624. throw RangeError("Illegal capacity");
  37625. t = !!t,
  37626. i = !!i
  37627. }
  37628. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  37629. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  37630. this.offset = 0,
  37631. this.markedOffset = -1,
  37632. this.limit = e,
  37633. this.littleEndian = t,
  37634. this.noAssert = i
  37635. };
  37636. o.VERSION = "5.0.1",
  37637. o.LITTLE_ENDIAN = !0,
  37638. o.BIG_ENDIAN = !1,
  37639. o.DEFAULT_CAPACITY = 16,
  37640. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  37641. o.DEFAULT_NOASSERT = !1,
  37642. o.Long = e || null;
  37643. var a = o.prototype;
  37644. a.__isByteBuffer__,
  37645. Object.defineProperty(a, "__isByteBuffer__", {
  37646. value: !0,
  37647. enumerable: !1,
  37648. configurable: !1
  37649. });
  37650. var s = new ArrayBuffer(0)
  37651. , l = String.fromCharCode;
  37652. o.accessor = function() {
  37653. return Uint8Array
  37654. }
  37655. ,
  37656. o.allocate = function(e, t, i) {
  37657. return new o(e,t,i)
  37658. }
  37659. ,
  37660. o.concat = function(e, t, i, n) {
  37661. "boolean" != typeof t && "string" == typeof t || (n = i,
  37662. i = t,
  37663. t = void 0);
  37664. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37665. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37666. r = e[s].limit - e[s].offset,
  37667. r > 0 && (a += r);
  37668. if (0 === a)
  37669. return new o(0,i,n);
  37670. var c, h = new o(a,i,n);
  37671. for (s = 0; s < l; )
  37672. c = e[s++],
  37673. r = c.limit - c.offset,
  37674. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37675. h.offset += r);
  37676. return h.limit = h.offset,
  37677. h.offset = 0,
  37678. h
  37679. }
  37680. ,
  37681. o.isByteBuffer = function(e) {
  37682. return (e && e.__isByteBuffer__) === !0
  37683. }
  37684. ,
  37685. o.type = function() {
  37686. return ArrayBuffer
  37687. }
  37688. ,
  37689. o.wrap = function(e, t, i, n) {
  37690. if ("string" != typeof t && (n = i,
  37691. i = t,
  37692. t = void 0),
  37693. "string" == typeof e)
  37694. switch ("undefined" == typeof t && (t = "utf8"),
  37695. t) {
  37696. case "base64":
  37697. return o.fromBase64(e, i);
  37698. case "hex":
  37699. return o.fromHex(e, i);
  37700. case "binary":
  37701. return o.fromBinary(e, i);
  37702. case "utf8":
  37703. return o.fromUTF8(e, i);
  37704. case "debug":
  37705. return o.fromDebug(e, i);
  37706. default:
  37707. throw Error("Unsupported encoding: " + t)
  37708. }
  37709. if (null === e || "object" != typeof e)
  37710. throw TypeError("Illegal buffer");
  37711. var r;
  37712. if (o.isByteBuffer(e))
  37713. return r = a.clone.call(e),
  37714. r.markedOffset = -1,
  37715. r;
  37716. if (e instanceof Uint8Array)
  37717. r = new o(0,i,n),
  37718. e.length > 0 && (r.buffer = e.buffer,
  37719. r.offset = e.byteOffset,
  37720. r.limit = e.byteOffset + e.byteLength,
  37721. r.view = new Uint8Array(e.buffer));
  37722. else if (e instanceof ArrayBuffer)
  37723. r = new o(0,i,n),
  37724. e.byteLength > 0 && (r.buffer = e,
  37725. r.offset = 0,
  37726. r.limit = e.byteLength,
  37727. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37728. else {
  37729. if ("[object Array]" !== Object.prototype.toString.call(e))
  37730. throw TypeError("Illegal buffer");
  37731. r = new o(e.length,i,n),
  37732. r.limit = e.length;
  37733. for (var s = 0; s < e.length; ++s)
  37734. r.view[s] = e[s]
  37735. }
  37736. return r
  37737. }
  37738. ,
  37739. a.writeBitSet = function(e, t) {
  37740. var i = "undefined" == typeof t;
  37741. if (i && (t = this.offset),
  37742. !this.noAssert) {
  37743. if (!(e instanceof Array))
  37744. throw TypeError("Illegal BitSet: Not an array");
  37745. if ("number" != typeof t || t % 1 !== 0)
  37746. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37747. if (t >>>= 0,
  37748. t < 0 || t + 0 > this.buffer.byteLength)
  37749. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37750. }
  37751. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37752. for (t += this.writeVarint32(o, t); a--; )
  37753. 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,
  37754. this.writeByte(n, t++);
  37755. if (s < o) {
  37756. var l = 0;
  37757. for (n = 0; s < o; )
  37758. n |= (1 & !!e[s++]) << l++;
  37759. this.writeByte(n, t++)
  37760. }
  37761. return i ? (this.offset = t,
  37762. this) : t - r
  37763. }
  37764. ,
  37765. a.readBitSet = function(e) {
  37766. var t = "undefined" == typeof e;
  37767. t && (e = this.offset);
  37768. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37769. for (e += n.length; o--; )
  37770. i = this.readByte(e++),
  37771. s[a++] = !!(1 & i),
  37772. s[a++] = !!(2 & i),
  37773. s[a++] = !!(4 & i),
  37774. s[a++] = !!(8 & i),
  37775. s[a++] = !!(16 & i),
  37776. s[a++] = !!(32 & i),
  37777. s[a++] = !!(64 & i),
  37778. s[a++] = !!(128 & i);
  37779. if (a < r) {
  37780. var l = 0;
  37781. for (i = this.readByte(e++); a < r; )
  37782. s[a++] = !!(i >> l++ & 1)
  37783. }
  37784. return t && (this.offset = e),
  37785. s
  37786. }
  37787. ,
  37788. a.readBytes = function(e, t) {
  37789. var i = "undefined" == typeof t;
  37790. if (i && (t = this.offset),
  37791. !this.noAssert) {
  37792. if ("number" != typeof t || t % 1 !== 0)
  37793. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37794. if (t >>>= 0,
  37795. t < 0 || t + e > this.buffer.byteLength)
  37796. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37797. }
  37798. var n = this.slice(t, t + e);
  37799. return i && (this.offset += e),
  37800. n
  37801. }
  37802. ,
  37803. a.writeBytes = a.append,
  37804. a.writeInt8 = function(e, t) {
  37805. var i = "undefined" == typeof t;
  37806. if (i && (t = this.offset),
  37807. !this.noAssert) {
  37808. if ("number" != typeof e || e % 1 !== 0)
  37809. throw TypeError("Illegal value: " + e + " (not an integer)");
  37810. if (e |= 0,
  37811. "number" != typeof t || t % 1 !== 0)
  37812. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37813. if (t >>>= 0,
  37814. t < 0 || t + 0 > this.buffer.byteLength)
  37815. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37816. }
  37817. t += 1;
  37818. var n = this.buffer.byteLength;
  37819. return t > n && this.resize((n *= 2) > t ? n : t),
  37820. t -= 1,
  37821. this.view[t] = e,
  37822. i && (this.offset += 1),
  37823. this
  37824. }
  37825. ,
  37826. a.writeByte = a.writeInt8,
  37827. a.readInt8 = function(e) {
  37828. var t = "undefined" == typeof e;
  37829. if (t && (e = this.offset),
  37830. !this.noAssert) {
  37831. if ("number" != typeof e || e % 1 !== 0)
  37832. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37833. if (e >>>= 0,
  37834. e < 0 || e + 1 > this.buffer.byteLength)
  37835. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37836. }
  37837. var i = this.view[e];
  37838. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37839. t && (this.offset += 1),
  37840. i
  37841. }
  37842. ,
  37843. a.readByte = a.readInt8,
  37844. a.writeUint8 = function(e, t) {
  37845. var i = "undefined" == typeof t;
  37846. if (i && (t = this.offset),
  37847. !this.noAssert) {
  37848. if ("number" != typeof e || e % 1 !== 0)
  37849. throw TypeError("Illegal value: " + e + " (not an integer)");
  37850. if (e >>>= 0,
  37851. "number" != typeof t || t % 1 !== 0)
  37852. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37853. if (t >>>= 0,
  37854. t < 0 || t + 0 > this.buffer.byteLength)
  37855. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37856. }
  37857. t += 1;
  37858. var n = this.buffer.byteLength;
  37859. return t > n && this.resize((n *= 2) > t ? n : t),
  37860. t -= 1,
  37861. this.view[t] = e,
  37862. i && (this.offset += 1),
  37863. this
  37864. }
  37865. ,
  37866. a.writeUInt8 = a.writeUint8,
  37867. a.readUint8 = function(e) {
  37868. var t = "undefined" == typeof e;
  37869. if (t && (e = this.offset),
  37870. !this.noAssert) {
  37871. if ("number" != typeof e || e % 1 !== 0)
  37872. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37873. if (e >>>= 0,
  37874. e < 0 || e + 1 > this.buffer.byteLength)
  37875. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37876. }
  37877. var i = this.view[e];
  37878. return t && (this.offset += 1),
  37879. i
  37880. }
  37881. ,
  37882. a.readUInt8 = a.readUint8,
  37883. a.writeInt16 = function(e, t) {
  37884. var i = "undefined" == typeof t;
  37885. if (i && (t = this.offset),
  37886. !this.noAssert) {
  37887. if ("number" != typeof e || e % 1 !== 0)
  37888. throw TypeError("Illegal value: " + e + " (not an integer)");
  37889. if (e |= 0,
  37890. "number" != typeof t || t % 1 !== 0)
  37891. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37892. if (t >>>= 0,
  37893. t < 0 || t + 0 > this.buffer.byteLength)
  37894. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37895. }
  37896. t += 2;
  37897. var n = this.buffer.byteLength;
  37898. return t > n && this.resize((n *= 2) > t ? n : t),
  37899. t -= 2,
  37900. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37901. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37902. this.view[t + 1] = 255 & e),
  37903. i && (this.offset += 2),
  37904. this
  37905. }
  37906. ,
  37907. a.writeShort = a.writeInt16,
  37908. a.readInt16 = function(e) {
  37909. var t = "undefined" == typeof e;
  37910. if (t && (e = this.offset),
  37911. !this.noAssert) {
  37912. if ("number" != typeof e || e % 1 !== 0)
  37913. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37914. if (e >>>= 0,
  37915. e < 0 || e + 2 > this.buffer.byteLength)
  37916. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37917. }
  37918. var i = 0;
  37919. return this.littleEndian ? (i = this.view[e],
  37920. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37921. i |= this.view[e + 1]),
  37922. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37923. t && (this.offset += 2),
  37924. i
  37925. }
  37926. ,
  37927. a.readShort = a.readInt16,
  37928. a.writeUint16 = function(e, t) {
  37929. var i = "undefined" == typeof t;
  37930. if (i && (t = this.offset),
  37931. !this.noAssert) {
  37932. if ("number" != typeof e || e % 1 !== 0)
  37933. throw TypeError("Illegal value: " + e + " (not an integer)");
  37934. if (e >>>= 0,
  37935. "number" != typeof t || t % 1 !== 0)
  37936. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37937. if (t >>>= 0,
  37938. t < 0 || t + 0 > this.buffer.byteLength)
  37939. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37940. }
  37941. t += 2;
  37942. var n = this.buffer.byteLength;
  37943. return t > n && this.resize((n *= 2) > t ? n : t),
  37944. t -= 2,
  37945. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37946. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37947. this.view[t + 1] = 255 & e),
  37948. i && (this.offset += 2),
  37949. this
  37950. }
  37951. ,
  37952. a.writeUInt16 = a.writeUint16,
  37953. a.readUint16 = function(e) {
  37954. var t = "undefined" == typeof e;
  37955. if (t && (e = this.offset),
  37956. !this.noAssert) {
  37957. if ("number" != typeof e || e % 1 !== 0)
  37958. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37959. if (e >>>= 0,
  37960. e < 0 || e + 2 > this.buffer.byteLength)
  37961. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37962. }
  37963. var i = 0;
  37964. return this.littleEndian ? (i = this.view[e],
  37965. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37966. i |= this.view[e + 1]),
  37967. t && (this.offset += 2),
  37968. i
  37969. }
  37970. ,
  37971. a.readUInt16 = a.readUint16,
  37972. a.writeInt32 = function(e, t) {
  37973. var i = "undefined" == typeof t;
  37974. if (i && (t = this.offset),
  37975. !this.noAssert) {
  37976. if ("number" != typeof e || e % 1 !== 0)
  37977. throw TypeError("Illegal value: " + e + " (not an integer)");
  37978. if (e |= 0,
  37979. "number" != typeof t || t % 1 !== 0)
  37980. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37981. if (t >>>= 0,
  37982. t < 0 || t + 0 > this.buffer.byteLength)
  37983. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37984. }
  37985. t += 4;
  37986. var n = this.buffer.byteLength;
  37987. return t > n && this.resize((n *= 2) > t ? n : t),
  37988. t -= 4,
  37989. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37990. this.view[t + 2] = e >>> 16 & 255,
  37991. this.view[t + 1] = e >>> 8 & 255,
  37992. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37993. this.view[t + 1] = e >>> 16 & 255,
  37994. this.view[t + 2] = e >>> 8 & 255,
  37995. this.view[t + 3] = 255 & e),
  37996. i && (this.offset += 4),
  37997. this
  37998. }
  37999. ,
  38000. a.writeInt = a.writeInt32,
  38001. a.readInt32 = function(e) {
  38002. var t = "undefined" == typeof e;
  38003. if (t && (e = this.offset),
  38004. !this.noAssert) {
  38005. if ("number" != typeof e || e % 1 !== 0)
  38006. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38007. if (e >>>= 0,
  38008. e < 0 || e + 4 > this.buffer.byteLength)
  38009. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38010. }
  38011. var i = 0;
  38012. return this.littleEndian ? (i = this.view[e + 2] << 16,
  38013. i |= this.view[e + 1] << 8,
  38014. i |= this.view[e],
  38015. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  38016. i |= this.view[e + 2] << 8,
  38017. i |= this.view[e + 3],
  38018. i += this.view[e] << 24 >>> 0),
  38019. i |= 0,
  38020. t && (this.offset += 4),
  38021. i
  38022. }
  38023. ,
  38024. a.readInt = a.readInt32,
  38025. a.writeUint32 = function(e, t) {
  38026. var i = "undefined" == typeof t;
  38027. if (i && (t = this.offset),
  38028. !this.noAssert) {
  38029. if ("number" != typeof e || e % 1 !== 0)
  38030. throw TypeError("Illegal value: " + e + " (not an integer)");
  38031. if (e >>>= 0,
  38032. "number" != typeof t || t % 1 !== 0)
  38033. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38034. if (t >>>= 0,
  38035. t < 0 || t + 0 > this.buffer.byteLength)
  38036. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  38037. }
  38038. t += 4;
  38039. var n = this.buffer.byteLength;
  38040. return t > n && this.resize((n *= 2) > t ? n : t),
  38041. t -= 4,
  38042. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  38043. this.view[t + 2] = e >>> 16 & 255,
  38044. this.view[t + 1] = e >>> 8 & 255,
  38045. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  38046. this.view[t + 1] = e >>> 16 & 255,
  38047. this.view[t + 2] = e >>> 8 & 255,
  38048. this.view[t + 3] = 255 & e),
  38049. i && (this.offset += 4),
  38050. this
  38051. }
  38052. ,
  38053. a.writeUInt32 = a.writeUint32,
  38054. a.readUint32 = function(e) {
  38055. var t = "undefined" == typeof e;
  38056. if (t && (e = this.offset),
  38057. !this.noAssert) {
  38058. if ("number" != typeof e || e % 1 !== 0)
  38059. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38060. if (e >>>= 0,
  38061. e < 0 || e + 4 > this.buffer.byteLength)
  38062. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38063. }
  38064. var i = 0;
  38065. return this.littleEndian ? (i = this.view[e + 2] << 16,
  38066. i |= this.view[e + 1] << 8,
  38067. i |= this.view[e],
  38068. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  38069. i |= this.view[e + 2] << 8,
  38070. i |= this.view[e + 3],
  38071. i += this.view[e] << 24 >>> 0),
  38072. t && (this.offset += 4),
  38073. i
  38074. }
  38075. ,
  38076. a.readUInt32 = a.readUint32,
  38077. e && (a.writeInt64 = function(t, i) {
  38078. var n = "undefined" == typeof i;
  38079. if (n && (i = this.offset),
  38080. !this.noAssert) {
  38081. if ("number" == typeof t)
  38082. t = e.fromNumber(t);
  38083. else if ("string" == typeof t)
  38084. t = e.fromString(t);
  38085. else if (!(t && t instanceof e))
  38086. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38087. if ("number" != typeof i || i % 1 !== 0)
  38088. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38089. if (i >>>= 0,
  38090. i < 0 || i + 0 > this.buffer.byteLength)
  38091. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38092. }
  38093. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  38094. i += 8;
  38095. var r = this.buffer.byteLength;
  38096. i > r && this.resize((r *= 2) > i ? r : i),
  38097. i -= 8;
  38098. var o = t.low
  38099. , a = t.high;
  38100. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  38101. this.view[i + 2] = o >>> 16 & 255,
  38102. this.view[i + 1] = o >>> 8 & 255,
  38103. this.view[i] = 255 & o,
  38104. i += 4,
  38105. this.view[i + 3] = a >>> 24 & 255,
  38106. this.view[i + 2] = a >>> 16 & 255,
  38107. this.view[i + 1] = a >>> 8 & 255,
  38108. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  38109. this.view[i + 1] = a >>> 16 & 255,
  38110. this.view[i + 2] = a >>> 8 & 255,
  38111. this.view[i + 3] = 255 & a,
  38112. i += 4,
  38113. this.view[i] = o >>> 24 & 255,
  38114. this.view[i + 1] = o >>> 16 & 255,
  38115. this.view[i + 2] = o >>> 8 & 255,
  38116. this.view[i + 3] = 255 & o),
  38117. n && (this.offset += 8),
  38118. this
  38119. }
  38120. ,
  38121. a.writeLong = a.writeInt64,
  38122. a.readInt64 = function(t) {
  38123. var i = "undefined" == typeof t;
  38124. if (i && (t = this.offset),
  38125. !this.noAssert) {
  38126. if ("number" != typeof t || t % 1 !== 0)
  38127. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38128. if (t >>>= 0,
  38129. t < 0 || t + 8 > this.buffer.byteLength)
  38130. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  38131. }
  38132. var n = 0
  38133. , r = 0;
  38134. this.littleEndian ? (n = this.view[t + 2] << 16,
  38135. n |= this.view[t + 1] << 8,
  38136. n |= this.view[t],
  38137. n += this.view[t + 3] << 24 >>> 0,
  38138. t += 4,
  38139. r = this.view[t + 2] << 16,
  38140. r |= this.view[t + 1] << 8,
  38141. r |= this.view[t],
  38142. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  38143. r |= this.view[t + 2] << 8,
  38144. r |= this.view[t + 3],
  38145. r += this.view[t] << 24 >>> 0,
  38146. t += 4,
  38147. n = this.view[t + 1] << 16,
  38148. n |= this.view[t + 2] << 8,
  38149. n |= this.view[t + 3],
  38150. n += this.view[t] << 24 >>> 0);
  38151. var o = new e(n,r,!1);
  38152. return i && (this.offset += 8),
  38153. o
  38154. }
  38155. ,
  38156. a.readLong = a.readInt64,
  38157. a.writeUint64 = function(t, i) {
  38158. var n = "undefined" == typeof i;
  38159. if (n && (i = this.offset),
  38160. !this.noAssert) {
  38161. if ("number" == typeof t)
  38162. t = e.fromNumber(t);
  38163. else if ("string" == typeof t)
  38164. t = e.fromString(t);
  38165. else if (!(t && t instanceof e))
  38166. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38167. if ("number" != typeof i || i % 1 !== 0)
  38168. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38169. if (i >>>= 0,
  38170. i < 0 || i + 0 > this.buffer.byteLength)
  38171. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38172. }
  38173. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  38174. i += 8;
  38175. var r = this.buffer.byteLength;
  38176. i > r && this.resize((r *= 2) > i ? r : i),
  38177. i -= 8;
  38178. var o = t.low
  38179. , a = t.high;
  38180. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  38181. this.view[i + 2] = o >>> 16 & 255,
  38182. this.view[i + 1] = o >>> 8 & 255,
  38183. this.view[i] = 255 & o,
  38184. i += 4,
  38185. this.view[i + 3] = a >>> 24 & 255,
  38186. this.view[i + 2] = a >>> 16 & 255,
  38187. this.view[i + 1] = a >>> 8 & 255,
  38188. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  38189. this.view[i + 1] = a >>> 16 & 255,
  38190. this.view[i + 2] = a >>> 8 & 255,
  38191. this.view[i + 3] = 255 & a,
  38192. i += 4,
  38193. this.view[i] = o >>> 24 & 255,
  38194. this.view[i + 1] = o >>> 16 & 255,
  38195. this.view[i + 2] = o >>> 8 & 255,
  38196. this.view[i + 3] = 255 & o),
  38197. n && (this.offset += 8),
  38198. this
  38199. }
  38200. ,
  38201. a.writeUInt64 = a.writeUint64,
  38202. a.readUint64 = function(t) {
  38203. var i = "undefined" == typeof t;
  38204. if (i && (t = this.offset),
  38205. !this.noAssert) {
  38206. if ("number" != typeof t || t % 1 !== 0)
  38207. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38208. if (t >>>= 0,
  38209. t < 0 || t + 8 > this.buffer.byteLength)
  38210. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  38211. }
  38212. var n = 0
  38213. , r = 0;
  38214. this.littleEndian ? (n = this.view[t + 2] << 16,
  38215. n |= this.view[t + 1] << 8,
  38216. n |= this.view[t],
  38217. n += this.view[t + 3] << 24 >>> 0,
  38218. t += 4,
  38219. r = this.view[t + 2] << 16,
  38220. r |= this.view[t + 1] << 8,
  38221. r |= this.view[t],
  38222. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  38223. r |= this.view[t + 2] << 8,
  38224. r |= this.view[t + 3],
  38225. r += this.view[t] << 24 >>> 0,
  38226. t += 4,
  38227. n = this.view[t + 1] << 16,
  38228. n |= this.view[t + 2] << 8,
  38229. n |= this.view[t + 3],
  38230. n += this.view[t] << 24 >>> 0);
  38231. var o = new e(n,r,!0);
  38232. return i && (this.offset += 8),
  38233. o
  38234. }
  38235. ,
  38236. a.readUInt64 = a.readUint64),
  38237. a.writeFloat32 = function(e, t) {
  38238. var i = "undefined" == typeof t;
  38239. if (i && (t = this.offset),
  38240. !this.noAssert) {
  38241. if ("number" != typeof e)
  38242. throw TypeError("Illegal value: " + e + " (not a number)");
  38243. if ("number" != typeof t || t % 1 !== 0)
  38244. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38245. if (t >>>= 0,
  38246. t < 0 || t + 0 > this.buffer.byteLength)
  38247. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  38248. }
  38249. t += 4;
  38250. var n = this.buffer.byteLength;
  38251. return t > n && this.resize((n *= 2) > t ? n : t),
  38252. t -= 4,
  38253. r(this.view, e, t, this.littleEndian, 23, 4),
  38254. i && (this.offset += 4),
  38255. this
  38256. }
  38257. ,
  38258. a.writeFloat = a.writeFloat32,
  38259. a.readFloat32 = function(e) {
  38260. var t = "undefined" == typeof e;
  38261. if (t && (e = this.offset),
  38262. !this.noAssert) {
  38263. if ("number" != typeof e || e % 1 !== 0)
  38264. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38265. if (e >>>= 0,
  38266. e < 0 || e + 4 > this.buffer.byteLength)
  38267. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38268. }
  38269. var i = n(this.view, e, this.littleEndian, 23, 4);
  38270. return t && (this.offset += 4),
  38271. i
  38272. }
  38273. ,
  38274. a.readFloat = a.readFloat32,
  38275. a.writeFloat64 = function(e, t) {
  38276. var i = "undefined" == typeof t;
  38277. if (i && (t = this.offset),
  38278. !this.noAssert) {
  38279. if ("number" != typeof e)
  38280. throw TypeError("Illegal value: " + e + " (not a number)");
  38281. if ("number" != typeof t || t % 1 !== 0)
  38282. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38283. if (t >>>= 0,
  38284. t < 0 || t + 0 > this.buffer.byteLength)
  38285. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  38286. }
  38287. t += 8;
  38288. var n = this.buffer.byteLength;
  38289. return t > n && this.resize((n *= 2) > t ? n : t),
  38290. t -= 8,
  38291. r(this.view, e, t, this.littleEndian, 52, 8),
  38292. i && (this.offset += 8),
  38293. this
  38294. }
  38295. ,
  38296. a.writeDouble = a.writeFloat64,
  38297. a.readFloat64 = function(e) {
  38298. var t = "undefined" == typeof e;
  38299. if (t && (e = this.offset),
  38300. !this.noAssert) {
  38301. if ("number" != typeof e || e % 1 !== 0)
  38302. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38303. if (e >>>= 0,
  38304. e < 0 || e + 8 > this.buffer.byteLength)
  38305. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  38306. }
  38307. var i = n(this.view, e, this.littleEndian, 52, 8);
  38308. return t && (this.offset += 8),
  38309. i
  38310. }
  38311. ,
  38312. a.readDouble = a.readFloat64,
  38313. o.MAX_VARINT32_BYTES = 5,
  38314. o.calculateVarint32 = function(e) {
  38315. return e >>>= 0,
  38316. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  38317. }
  38318. ,
  38319. o.zigZagEncode32 = function(e) {
  38320. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  38321. }
  38322. ,
  38323. o.zigZagDecode32 = function(e) {
  38324. return e >>> 1 ^ -(1 & e) | 0
  38325. }
  38326. ,
  38327. a.writeVarint32 = function(e, t) {
  38328. var i = "undefined" == typeof t;
  38329. if (i && (t = this.offset),
  38330. !this.noAssert) {
  38331. if ("number" != typeof e || e % 1 !== 0)
  38332. throw TypeError("Illegal value: " + e + " (not an integer)");
  38333. if (e |= 0,
  38334. "number" != typeof t || t % 1 !== 0)
  38335. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38336. if (t >>>= 0,
  38337. t < 0 || t + 0 > this.buffer.byteLength)
  38338. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  38339. }
  38340. var n, r = o.calculateVarint32(e);
  38341. t += r;
  38342. var a = this.buffer.byteLength;
  38343. for (t > a && this.resize((a *= 2) > t ? a : t),
  38344. t -= r,
  38345. e >>>= 0; e >= 128; )
  38346. n = 127 & e | 128,
  38347. this.view[t++] = n,
  38348. e >>>= 7;
  38349. return this.view[t++] = e,
  38350. i ? (this.offset = t,
  38351. this) : r
  38352. }
  38353. ,
  38354. a.writeVarint32ZigZag = function(e, t) {
  38355. return this.writeVarint32(o.zigZagEncode32(e), t)
  38356. }
  38357. ,
  38358. a.readVarint32 = function(e) {
  38359. var t = "undefined" == typeof e;
  38360. if (t && (e = this.offset),
  38361. !this.noAssert) {
  38362. if ("number" != typeof e || e % 1 !== 0)
  38363. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38364. if (e >>>= 0,
  38365. e < 0 || e + 1 > this.buffer.byteLength)
  38366. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38367. }
  38368. var i, n = 0, r = 0;
  38369. do {
  38370. if (!this.noAssert && e > this.limit) {
  38371. var o = Error("Truncated");
  38372. throw o.truncated = !0,
  38373. o
  38374. }
  38375. i = this.view[e++],
  38376. n < 5 && (r |= (127 & i) << 7 * n),
  38377. ++n
  38378. } while (0 !== (128 & i));return r |= 0,
  38379. t ? (this.offset = e,
  38380. r) : {
  38381. value: r,
  38382. length: n
  38383. }
  38384. }
  38385. ,
  38386. a.readVarint32ZigZag = function(e) {
  38387. var t = this.readVarint32(e);
  38388. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  38389. t
  38390. }
  38391. ,
  38392. e && (o.MAX_VARINT64_BYTES = 10,
  38393. o.calculateVarint64 = function(t) {
  38394. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  38395. var i = t.toInt() >>> 0
  38396. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  38397. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  38398. 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
  38399. }
  38400. ,
  38401. o.zigZagEncode64 = function(t) {
  38402. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38403. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  38404. }
  38405. ,
  38406. o.zigZagDecode64 = function(t) {
  38407. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38408. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  38409. }
  38410. ,
  38411. a.writeVarint64 = function(t, i) {
  38412. var n = "undefined" == typeof i;
  38413. if (n && (i = this.offset),
  38414. !this.noAssert) {
  38415. if ("number" == typeof t)
  38416. t = e.fromNumber(t);
  38417. else if ("string" == typeof t)
  38418. t = e.fromString(t);
  38419. else if (!(t && t instanceof e))
  38420. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38421. if ("number" != typeof i || i % 1 !== 0)
  38422. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38423. if (i >>>= 0,
  38424. i < 0 || i + 0 > this.buffer.byteLength)
  38425. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38426. }
  38427. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  38428. var r = o.calculateVarint64(t)
  38429. , a = t.toInt() >>> 0
  38430. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  38431. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  38432. i += r;
  38433. var c = this.buffer.byteLength;
  38434. switch (i > c && this.resize((c *= 2) > i ? c : i),
  38435. i -= r,
  38436. r) {
  38437. case 10:
  38438. this.view[i + 9] = l >>> 7 & 1;
  38439. case 9:
  38440. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  38441. case 8:
  38442. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  38443. case 7:
  38444. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  38445. case 6:
  38446. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  38447. case 5:
  38448. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  38449. case 4:
  38450. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  38451. case 3:
  38452. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  38453. case 2:
  38454. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  38455. case 1:
  38456. this.view[i] = 1 !== r ? 128 | a : 127 & a
  38457. }
  38458. return n ? (this.offset += r,
  38459. this) : r
  38460. }
  38461. ,
  38462. a.writeVarint64ZigZag = function(e, t) {
  38463. return this.writeVarint64(o.zigZagEncode64(e), t)
  38464. }
  38465. ,
  38466. a.readVarint64 = function(t) {
  38467. var i = "undefined" == typeof t;
  38468. if (i && (t = this.offset),
  38469. !this.noAssert) {
  38470. if ("number" != typeof t || t % 1 !== 0)
  38471. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38472. if (t >>>= 0,
  38473. t < 0 || t + 1 > this.buffer.byteLength)
  38474. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  38475. }
  38476. var n = t
  38477. , r = 0
  38478. , o = 0
  38479. , a = 0
  38480. , s = 0;
  38481. if (s = this.view[t++],
  38482. r = 127 & s,
  38483. 128 & s && (s = this.view[t++],
  38484. r |= (127 & s) << 7,
  38485. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38486. r |= (127 & s) << 14,
  38487. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38488. r |= (127 & s) << 21,
  38489. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38490. o = 127 & s,
  38491. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38492. o |= (127 & s) << 7,
  38493. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38494. o |= (127 & s) << 14,
  38495. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38496. o |= (127 & s) << 21,
  38497. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38498. a = 127 & s,
  38499. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38500. a |= (127 & s) << 7,
  38501. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  38502. throw Error("Buffer overrun");
  38503. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  38504. return i ? (this.offset = t,
  38505. l) : {
  38506. value: l,
  38507. length: t - n
  38508. }
  38509. }
  38510. ,
  38511. a.readVarint64ZigZag = function(t) {
  38512. var i = this.readVarint64(t);
  38513. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  38514. i
  38515. }
  38516. ),
  38517. a.writeCString = function(e, i) {
  38518. var n = "undefined" == typeof i;
  38519. n && (i = this.offset);
  38520. var r, o = e.length;
  38521. if (!this.noAssert) {
  38522. if ("string" != typeof e)
  38523. throw TypeError("Illegal str: Not a string");
  38524. for (r = 0; r < o; ++r)
  38525. if (0 === e.charCodeAt(r))
  38526. throw RangeError("Illegal str: Contains NULL-characters");
  38527. if ("number" != typeof i || i % 1 !== 0)
  38528. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38529. if (i >>>= 0,
  38530. i < 0 || i + 0 > this.buffer.byteLength)
  38531. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38532. }
  38533. o = h.calculateUTF16asUTF8(t(e))[1],
  38534. i += o + 1;
  38535. var a = this.buffer.byteLength;
  38536. return i > a && this.resize((a *= 2) > i ? a : i),
  38537. i -= o + 1,
  38538. h.encodeUTF16toUTF8(t(e), function(e) {
  38539. this.view[i++] = e
  38540. }
  38541. .bind(this)),
  38542. this.view[i++] = 0,
  38543. n ? (this.offset = i,
  38544. this) : o
  38545. }
  38546. ,
  38547. a.readCString = function(e) {
  38548. var t = "undefined" == typeof e;
  38549. if (t && (e = this.offset),
  38550. !this.noAssert) {
  38551. if ("number" != typeof e || e % 1 !== 0)
  38552. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38553. if (e >>>= 0,
  38554. e < 0 || e + 1 > this.buffer.byteLength)
  38555. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38556. }
  38557. var n, r = e, o = -1;
  38558. return h.decodeUTF8toUTF16(function() {
  38559. if (0 === o)
  38560. return null;
  38561. if (e >= this.limit)
  38562. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  38563. return o = this.view[e++],
  38564. 0 === o ? null : o
  38565. }
  38566. .bind(this), n = i(), !0),
  38567. t ? (this.offset = e,
  38568. n()) : {
  38569. string: n(),
  38570. length: e - r
  38571. }
  38572. }
  38573. ,
  38574. a.writeIString = function(e, i) {
  38575. var n = "undefined" == typeof i;
  38576. if (n && (i = this.offset),
  38577. !this.noAssert) {
  38578. if ("string" != typeof e)
  38579. throw TypeError("Illegal str: Not a string");
  38580. if ("number" != typeof i || i % 1 !== 0)
  38581. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38582. if (i >>>= 0,
  38583. i < 0 || i + 0 > this.buffer.byteLength)
  38584. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38585. }
  38586. var r, o = i;
  38587. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38588. i += 4 + r;
  38589. var a = this.buffer.byteLength;
  38590. if (i > a && this.resize((a *= 2) > i ? a : i),
  38591. i -= 4 + r,
  38592. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  38593. this.view[i + 2] = r >>> 16 & 255,
  38594. this.view[i + 1] = r >>> 8 & 255,
  38595. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  38596. this.view[i + 1] = r >>> 16 & 255,
  38597. this.view[i + 2] = r >>> 8 & 255,
  38598. this.view[i + 3] = 255 & r),
  38599. i += 4,
  38600. h.encodeUTF16toUTF8(t(e), function(e) {
  38601. this.view[i++] = e
  38602. }
  38603. .bind(this)),
  38604. i !== o + 4 + r)
  38605. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  38606. return n ? (this.offset = i,
  38607. this) : i - o
  38608. }
  38609. ,
  38610. a.readIString = function(e) {
  38611. var t = "undefined" == typeof e;
  38612. if (t && (e = this.offset),
  38613. !this.noAssert) {
  38614. if ("number" != typeof e || e % 1 !== 0)
  38615. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38616. if (e >>>= 0,
  38617. e < 0 || e + 4 > this.buffer.byteLength)
  38618. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38619. }
  38620. var i = e
  38621. , n = this.readUint32(e)
  38622. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  38623. return e += r.length,
  38624. t ? (this.offset = e,
  38625. r.string) : {
  38626. string: r.string,
  38627. length: e - i
  38628. }
  38629. }
  38630. ,
  38631. o.METRICS_CHARS = "c",
  38632. o.METRICS_BYTES = "b",
  38633. a.writeUTF8String = function(e, i) {
  38634. var n = "undefined" == typeof i;
  38635. if (n && (i = this.offset),
  38636. !this.noAssert) {
  38637. if ("number" != typeof i || i % 1 !== 0)
  38638. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38639. if (i >>>= 0,
  38640. i < 0 || i + 0 > this.buffer.byteLength)
  38641. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38642. }
  38643. var r, o = i;
  38644. r = h.calculateUTF16asUTF8(t(e))[1],
  38645. i += r;
  38646. var a = this.buffer.byteLength;
  38647. return i > a && this.resize((a *= 2) > i ? a : i),
  38648. i -= r,
  38649. h.encodeUTF16toUTF8(t(e), function(e) {
  38650. this.view[i++] = e
  38651. }
  38652. .bind(this)),
  38653. n ? (this.offset = i,
  38654. this) : i - o
  38655. }
  38656. ,
  38657. a.writeString = a.writeUTF8String,
  38658. o.calculateUTF8Chars = function(e) {
  38659. return h.calculateUTF16asUTF8(t(e))[0]
  38660. }
  38661. ,
  38662. o.calculateUTF8Bytes = function(e) {
  38663. return h.calculateUTF16asUTF8(t(e))[1]
  38664. }
  38665. ,
  38666. o.calculateString = o.calculateUTF8Bytes,
  38667. a.readUTF8String = function(e, t, n) {
  38668. "number" == typeof t && (n = t,
  38669. t = void 0);
  38670. var r = "undefined" == typeof n;
  38671. if (r && (n = this.offset),
  38672. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38673. !this.noAssert) {
  38674. if ("number" != typeof e || e % 1 !== 0)
  38675. throw TypeError("Illegal length: " + e + " (not an integer)");
  38676. if (e |= 0,
  38677. "number" != typeof n || n % 1 !== 0)
  38678. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38679. if (n >>>= 0,
  38680. n < 0 || n + 0 > this.buffer.byteLength)
  38681. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38682. }
  38683. var a, s = 0, l = n;
  38684. if (t === o.METRICS_CHARS) {
  38685. if (a = i(),
  38686. h.decodeUTF8(function() {
  38687. return s < e && n < this.limit ? this.view[n++] : null
  38688. }
  38689. .bind(this), function(e) {
  38690. ++s,
  38691. h.UTF8toUTF16(e, a)
  38692. }),
  38693. s !== e)
  38694. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38695. return r ? (this.offset = n,
  38696. a()) : {
  38697. string: a(),
  38698. length: n - l
  38699. }
  38700. }
  38701. if (t === o.METRICS_BYTES) {
  38702. if (!this.noAssert) {
  38703. if ("number" != typeof n || n % 1 !== 0)
  38704. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38705. if (n >>>= 0,
  38706. n < 0 || n + e > this.buffer.byteLength)
  38707. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38708. }
  38709. var c = n + e;
  38710. if (h.decodeUTF8toUTF16(function() {
  38711. return n < c ? this.view[n++] : null
  38712. }
  38713. .bind(this), a = i(), this.noAssert),
  38714. n !== c)
  38715. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38716. return r ? (this.offset = n,
  38717. a()) : {
  38718. string: a(),
  38719. length: n - l
  38720. }
  38721. }
  38722. throw TypeError("Unsupported metrics: " + t)
  38723. }
  38724. ,
  38725. a.readString = a.readUTF8String,
  38726. a.writeVString = function(e, i) {
  38727. var n = "undefined" == typeof i;
  38728. if (n && (i = this.offset),
  38729. !this.noAssert) {
  38730. if ("string" != typeof e)
  38731. throw TypeError("Illegal str: Not a string");
  38732. if ("number" != typeof i || i % 1 !== 0)
  38733. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38734. if (i >>>= 0,
  38735. i < 0 || i + 0 > this.buffer.byteLength)
  38736. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38737. }
  38738. var r, a, s = i;
  38739. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38740. a = o.calculateVarint32(r),
  38741. i += a + r;
  38742. var l = this.buffer.byteLength;
  38743. if (i > l && this.resize((l *= 2) > i ? l : i),
  38744. i -= a + r,
  38745. i += this.writeVarint32(r, i),
  38746. h.encodeUTF16toUTF8(t(e), function(e) {
  38747. this.view[i++] = e
  38748. }
  38749. .bind(this)),
  38750. i !== s + r + a)
  38751. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38752. return n ? (this.offset = i,
  38753. this) : i - s
  38754. }
  38755. ,
  38756. a.readVString = function(e) {
  38757. var t = "undefined" == typeof e;
  38758. if (t && (e = this.offset),
  38759. !this.noAssert) {
  38760. if ("number" != typeof e || e % 1 !== 0)
  38761. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38762. if (e >>>= 0,
  38763. e < 0 || e + 1 > this.buffer.byteLength)
  38764. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38765. }
  38766. var i = e
  38767. , n = this.readVarint32(e)
  38768. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38769. return e += r.length,
  38770. t ? (this.offset = e,
  38771. r.string) : {
  38772. string: r.string,
  38773. length: e - i
  38774. }
  38775. }
  38776. ,
  38777. a.append = function(e, t, i) {
  38778. "number" != typeof t && "string" == typeof t || (i = t,
  38779. t = void 0);
  38780. var n = "undefined" == typeof i;
  38781. if (n && (i = this.offset),
  38782. !this.noAssert) {
  38783. if ("number" != typeof i || i % 1 !== 0)
  38784. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38785. if (i >>>= 0,
  38786. i < 0 || i + 0 > this.buffer.byteLength)
  38787. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38788. }
  38789. e instanceof o || (e = o.wrap(e, t));
  38790. var r = e.limit - e.offset;
  38791. if (r <= 0)
  38792. return this;
  38793. i += r;
  38794. var a = this.buffer.byteLength;
  38795. return i > a && this.resize((a *= 2) > i ? a : i),
  38796. i -= r,
  38797. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38798. e.offset += r,
  38799. n && (this.offset += r),
  38800. this
  38801. }
  38802. ,
  38803. a.appendTo = function(e, t) {
  38804. return e.append(this, t),
  38805. this
  38806. }
  38807. ,
  38808. a.assert = function(e) {
  38809. return this.noAssert = !e,
  38810. this
  38811. }
  38812. ,
  38813. a.capacity = function() {
  38814. return this.buffer.byteLength
  38815. }
  38816. ,
  38817. a.clear = function() {
  38818. return this.offset = 0,
  38819. this.limit = this.buffer.byteLength,
  38820. this.markedOffset = -1,
  38821. this
  38822. }
  38823. ,
  38824. a.clone = function(e) {
  38825. var t = new o(0,this.littleEndian,this.noAssert);
  38826. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38827. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38828. t.view = this.view),
  38829. t.offset = this.offset,
  38830. t.markedOffset = this.markedOffset,
  38831. t.limit = this.limit,
  38832. t
  38833. }
  38834. ,
  38835. a.compact = function(e, t) {
  38836. if ("undefined" == typeof e && (e = this.offset),
  38837. "undefined" == typeof t && (t = this.limit),
  38838. !this.noAssert) {
  38839. if ("number" != typeof e || e % 1 !== 0)
  38840. throw TypeError("Illegal begin: Not an integer");
  38841. if (e >>>= 0,
  38842. "number" != typeof t || t % 1 !== 0)
  38843. throw TypeError("Illegal end: Not an integer");
  38844. if (t >>>= 0,
  38845. e < 0 || e > t || t > this.buffer.byteLength)
  38846. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38847. }
  38848. if (0 === e && t === this.buffer.byteLength)
  38849. return this;
  38850. var i = t - e;
  38851. if (0 === i)
  38852. return this.buffer = s,
  38853. this.view = null,
  38854. this.markedOffset >= 0 && (this.markedOffset -= e),
  38855. this.offset = 0,
  38856. this.limit = 0,
  38857. this;
  38858. var n = new ArrayBuffer(i)
  38859. , r = new Uint8Array(n);
  38860. return r.set(this.view.subarray(e, t)),
  38861. this.buffer = n,
  38862. this.view = r,
  38863. this.markedOffset >= 0 && (this.markedOffset -= e),
  38864. this.offset = 0,
  38865. this.limit = i,
  38866. this
  38867. }
  38868. ,
  38869. a.copy = function(e, t) {
  38870. if ("undefined" == typeof e && (e = this.offset),
  38871. "undefined" == typeof t && (t = this.limit),
  38872. !this.noAssert) {
  38873. if ("number" != typeof e || e % 1 !== 0)
  38874. throw TypeError("Illegal begin: Not an integer");
  38875. if (e >>>= 0,
  38876. "number" != typeof t || t % 1 !== 0)
  38877. throw TypeError("Illegal end: Not an integer");
  38878. if (t >>>= 0,
  38879. e < 0 || e > t || t > this.buffer.byteLength)
  38880. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38881. }
  38882. if (e === t)
  38883. return new o(0,this.littleEndian,this.noAssert);
  38884. var i = t - e
  38885. , n = new o(i,this.littleEndian,this.noAssert);
  38886. return n.offset = 0,
  38887. n.limit = i,
  38888. n.markedOffset >= 0 && (n.markedOffset -= e),
  38889. this.copyTo(n, 0, e, t),
  38890. n
  38891. }
  38892. ,
  38893. a.copyTo = function(e, t, i, n) {
  38894. var r, a;
  38895. if (!this.noAssert && !o.isByteBuffer(e))
  38896. throw TypeError("Illegal target: Not a ByteBuffer");
  38897. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38898. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38899. n = "undefined" == typeof n ? this.limit : 0 | n,
  38900. t < 0 || t > e.buffer.byteLength)
  38901. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38902. if (i < 0 || n > this.buffer.byteLength)
  38903. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38904. var s = n - i;
  38905. return 0 === s ? e : (e.ensureCapacity(t + s),
  38906. e.view.set(this.view.subarray(i, n), t),
  38907. r && (this.offset += s),
  38908. a && (e.offset += s),
  38909. this)
  38910. }
  38911. ,
  38912. a.ensureCapacity = function(e) {
  38913. var t = this.buffer.byteLength;
  38914. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38915. }
  38916. ,
  38917. a.fill = function(e, t, i) {
  38918. var n = "undefined" == typeof t;
  38919. if (n && (t = this.offset),
  38920. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38921. "undefined" == typeof t && (t = this.offset),
  38922. "undefined" == typeof i && (i = this.limit),
  38923. !this.noAssert) {
  38924. if ("number" != typeof e || e % 1 !== 0)
  38925. throw TypeError("Illegal value: " + e + " (not an integer)");
  38926. if (e |= 0,
  38927. "number" != typeof t || t % 1 !== 0)
  38928. throw TypeError("Illegal begin: Not an integer");
  38929. if (t >>>= 0,
  38930. "number" != typeof i || i % 1 !== 0)
  38931. throw TypeError("Illegal end: Not an integer");
  38932. if (i >>>= 0,
  38933. t < 0 || t > i || i > this.buffer.byteLength)
  38934. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38935. }
  38936. if (t >= i)
  38937. return this;
  38938. for (; t < i; )
  38939. this.view[t++] = e;
  38940. return n && (this.offset = t),
  38941. this
  38942. }
  38943. ,
  38944. a.flip = function() {
  38945. return this.limit = this.offset,
  38946. this.offset = 0,
  38947. this
  38948. }
  38949. ,
  38950. a.mark = function(e) {
  38951. if (e = "undefined" == typeof e ? this.offset : e,
  38952. !this.noAssert) {
  38953. if ("number" != typeof e || e % 1 !== 0)
  38954. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38955. if (e >>>= 0,
  38956. e < 0 || e + 0 > this.buffer.byteLength)
  38957. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38958. }
  38959. return this.markedOffset = e,
  38960. this
  38961. }
  38962. ,
  38963. a.order = function(e) {
  38964. if (!this.noAssert && "boolean" != typeof e)
  38965. throw TypeError("Illegal littleEndian: Not a boolean");
  38966. return this.littleEndian = !!e,
  38967. this
  38968. }
  38969. ,
  38970. a.LE = function(e) {
  38971. return this.littleEndian = "undefined" == typeof e || !!e,
  38972. this
  38973. }
  38974. ,
  38975. a.BE = function(e) {
  38976. return this.littleEndian = "undefined" != typeof e && !e,
  38977. this
  38978. }
  38979. ,
  38980. a.prepend = function(e, t, i) {
  38981. "number" != typeof t && "string" == typeof t || (i = t,
  38982. t = void 0);
  38983. var n = "undefined" == typeof i;
  38984. if (n && (i = this.offset),
  38985. !this.noAssert) {
  38986. if ("number" != typeof i || i % 1 !== 0)
  38987. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38988. if (i >>>= 0,
  38989. i < 0 || i + 0 > this.buffer.byteLength)
  38990. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38991. }
  38992. e instanceof o || (e = o.wrap(e, t));
  38993. var r = e.limit - e.offset;
  38994. if (r <= 0)
  38995. return this;
  38996. var a = r - i;
  38997. if (a > 0) {
  38998. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38999. , l = new Uint8Array(s);
  39000. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  39001. this.buffer = s,
  39002. this.view = l,
  39003. this.offset += a,
  39004. this.markedOffset >= 0 && (this.markedOffset += a),
  39005. this.limit += a,
  39006. i += a
  39007. } else {
  39008. new Uint8Array(this.buffer)
  39009. }
  39010. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  39011. e.offset = e.limit,
  39012. n && (this.offset -= r),
  39013. this
  39014. }
  39015. ,
  39016. a.prependTo = function(e, t) {
  39017. return e.prepend(this, t),
  39018. this
  39019. }
  39020. ,
  39021. a.printDebug = function(e) {
  39022. "function" != typeof e && (e = console.log.bind(console)),
  39023. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  39024. }
  39025. ,
  39026. a.remaining = function() {
  39027. return this.limit - this.offset
  39028. }
  39029. ,
  39030. a.reset = function() {
  39031. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  39032. this.markedOffset = -1) : this.offset = 0,
  39033. this
  39034. }
  39035. ,
  39036. a.resize = function(e) {
  39037. if (!this.noAssert) {
  39038. if ("number" != typeof e || e % 1 !== 0)
  39039. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  39040. if (e |= 0,
  39041. e < 0)
  39042. throw RangeError("Illegal capacity: 0 <= " + e)
  39043. }
  39044. if (this.buffer.byteLength < e) {
  39045. var t = new ArrayBuffer(e)
  39046. , i = new Uint8Array(t);
  39047. i.set(this.view),
  39048. this.buffer = t,
  39049. this.view = i
  39050. }
  39051. return this
  39052. }
  39053. ,
  39054. a.reverse = function(e, t) {
  39055. if ("undefined" == typeof e && (e = this.offset),
  39056. "undefined" == typeof t && (t = this.limit),
  39057. !this.noAssert) {
  39058. if ("number" != typeof e || e % 1 !== 0)
  39059. throw TypeError("Illegal begin: Not an integer");
  39060. if (e >>>= 0,
  39061. "number" != typeof t || t % 1 !== 0)
  39062. throw TypeError("Illegal end: Not an integer");
  39063. if (t >>>= 0,
  39064. e < 0 || e > t || t > this.buffer.byteLength)
  39065. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39066. }
  39067. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  39068. this)
  39069. }
  39070. ,
  39071. a.skip = function(e) {
  39072. if (!this.noAssert) {
  39073. if ("number" != typeof e || e % 1 !== 0)
  39074. throw TypeError("Illegal length: " + e + " (not an integer)");
  39075. e |= 0
  39076. }
  39077. var t = this.offset + e;
  39078. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  39079. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  39080. return this.offset = t,
  39081. this
  39082. }
  39083. ,
  39084. a.slice = function(e, t) {
  39085. if ("undefined" == typeof e && (e = this.offset),
  39086. "undefined" == typeof t && (t = this.limit),
  39087. !this.noAssert) {
  39088. if ("number" != typeof e || e % 1 !== 0)
  39089. throw TypeError("Illegal begin: Not an integer");
  39090. if (e >>>= 0,
  39091. "number" != typeof t || t % 1 !== 0)
  39092. throw TypeError("Illegal end: Not an integer");
  39093. if (t >>>= 0,
  39094. e < 0 || e > t || t > this.buffer.byteLength)
  39095. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39096. }
  39097. var i = this.clone();
  39098. return i.offset = e,
  39099. i.limit = t,
  39100. i
  39101. }
  39102. ,
  39103. a.toBuffer = function(e) {
  39104. var t = this.offset
  39105. , i = this.limit;
  39106. if (!this.noAssert) {
  39107. if ("number" != typeof t || t % 1 !== 0)
  39108. throw TypeError("Illegal offset: Not an integer");
  39109. if (t >>>= 0,
  39110. "number" != typeof i || i % 1 !== 0)
  39111. throw TypeError("Illegal limit: Not an integer");
  39112. if (i >>>= 0,
  39113. t < 0 || t > i || i > this.buffer.byteLength)
  39114. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  39115. }
  39116. if (!e && 0 === t && i === this.buffer.byteLength)
  39117. return this.buffer;
  39118. if (t === i)
  39119. return s;
  39120. var n = new ArrayBuffer(i - t);
  39121. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  39122. n
  39123. }
  39124. ,
  39125. a.toArrayBuffer = a.toBuffer,
  39126. a.toString = function(e, t, i) {
  39127. if ("undefined" == typeof e)
  39128. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  39129. switch ("number" == typeof e && (e = "utf8",
  39130. t = e,
  39131. i = t),
  39132. e) {
  39133. case "utf8":
  39134. return this.toUTF8(t, i);
  39135. case "base64":
  39136. return this.toBase64(t, i);
  39137. case "hex":
  39138. return this.toHex(t, i);
  39139. case "binary":
  39140. return this.toBinary(t, i);
  39141. case "debug":
  39142. return this.toDebug();
  39143. case "columns":
  39144. return this.toColumns();
  39145. default:
  39146. throw Error("Unsupported encoding: " + e)
  39147. }
  39148. }
  39149. ;
  39150. var c = function() {
  39151. 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)
  39152. i[t[n]] = n;
  39153. return e.encode = function(e, i) {
  39154. for (var n, r; null !== (n = e()); )
  39155. i(t[n >> 2 & 63]),
  39156. r = (3 & n) << 4,
  39157. null !== (n = e()) ? (r |= n >> 4 & 15,
  39158. i(t[63 & (r | n >> 4 & 15)]),
  39159. r = (15 & n) << 2,
  39160. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  39161. i(t[63 & n])) : (i(t[63 & r]),
  39162. i(61))) : (i(t[63 & r]),
  39163. i(61),
  39164. i(61))
  39165. }
  39166. ,
  39167. e.decode = function(e, t) {
  39168. function n(e) {
  39169. throw Error("Illegal character code: " + e)
  39170. }
  39171. for (var r, o, a; null !== (r = e()); )
  39172. if (o = i[r],
  39173. "undefined" == typeof o && n(r),
  39174. null !== (r = e()) && (a = i[r],
  39175. "undefined" == typeof a && n(r),
  39176. t(o << 2 >>> 0 | (48 & a) >> 4),
  39177. null !== (r = e()))) {
  39178. if (o = i[r],
  39179. "undefined" == typeof o) {
  39180. if (61 === r)
  39181. break;
  39182. n(r)
  39183. }
  39184. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  39185. null !== (r = e())) {
  39186. if (a = i[r],
  39187. "undefined" == typeof a) {
  39188. if (61 === r)
  39189. break;
  39190. n(r)
  39191. }
  39192. t((3 & o) << 6 >>> 0 | a)
  39193. }
  39194. }
  39195. }
  39196. ,
  39197. e.test = function(e) {
  39198. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  39199. }
  39200. ,
  39201. e
  39202. }();
  39203. a.toBase64 = function(e, t) {
  39204. if ("undefined" == typeof e && (e = this.offset),
  39205. "undefined" == typeof t && (t = this.limit),
  39206. e |= 0,
  39207. t |= 0,
  39208. e < 0 || t > this.capacity || e > t)
  39209. throw RangeError("begin, end");
  39210. var n;
  39211. return c.encode(function() {
  39212. return e < t ? this.view[e++] : null
  39213. }
  39214. .bind(this), n = i()),
  39215. n()
  39216. }
  39217. ,
  39218. o.fromBase64 = function(e, i) {
  39219. if ("string" != typeof e)
  39220. throw TypeError("str");
  39221. var n = new o(e.length / 4 * 3,i)
  39222. , r = 0;
  39223. return c.decode(t(e), function(e) {
  39224. n.view[r++] = e
  39225. }),
  39226. n.limit = r,
  39227. n
  39228. }
  39229. ,
  39230. o.btoa = function(e) {
  39231. return o.fromBinary(e).toBase64()
  39232. }
  39233. ,
  39234. o.atob = function(e) {
  39235. return o.fromBase64(e).toBinary()
  39236. }
  39237. ,
  39238. a.toBinary = function(e, t) {
  39239. if ("undefined" == typeof e && (e = this.offset),
  39240. "undefined" == typeof t && (t = this.limit),
  39241. e |= 0,
  39242. t |= 0,
  39243. e < 0 || t > this.capacity() || e > t)
  39244. throw RangeError("begin, end");
  39245. if (e === t)
  39246. return "";
  39247. for (var i = [], n = []; e < t; )
  39248. i.push(this.view[e++]),
  39249. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  39250. i = []);
  39251. return n.join("") + String.fromCharCode.apply(String, i)
  39252. }
  39253. ,
  39254. o.fromBinary = function(e, t) {
  39255. if ("string" != typeof e)
  39256. throw TypeError("str");
  39257. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  39258. if (i = e.charCodeAt(n),
  39259. i > 255)
  39260. throw RangeError("illegal char code: " + i);
  39261. a.view[n++] = i
  39262. }
  39263. return a.limit = r,
  39264. a
  39265. }
  39266. ,
  39267. a.toDebug = function(e) {
  39268. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  39269. if (i !== -1 && (t = this.view[i],
  39270. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  39271. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  39272. ++i,
  39273. e && i > 0 && i % 16 === 0 && i !== n) {
  39274. for (; r.length < 51; )
  39275. r += " ";
  39276. a += r + o + "\n",
  39277. r = o = ""
  39278. }
  39279. 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 ? " " : ""
  39280. }
  39281. if (e && " " !== r) {
  39282. for (; r.length < 51; )
  39283. r += " ";
  39284. a += r + o + "\n"
  39285. }
  39286. return e ? a : r
  39287. }
  39288. ,
  39289. o.fromDebug = function(e, t, i) {
  39290. 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; ) {
  39291. switch (n = e.charAt(l++)) {
  39292. case "!":
  39293. if (!i) {
  39294. if (u || d || p) {
  39295. f = !0;
  39296. break
  39297. }
  39298. u = d = p = !0
  39299. }
  39300. s.offset = s.markedOffset = s.limit = c,
  39301. h = !1;
  39302. break;
  39303. case "|":
  39304. if (!i) {
  39305. if (u || p) {
  39306. f = !0;
  39307. break
  39308. }
  39309. u = p = !0
  39310. }
  39311. s.offset = s.limit = c,
  39312. h = !1;
  39313. break;
  39314. case "[":
  39315. if (!i) {
  39316. if (u || d) {
  39317. f = !0;
  39318. break
  39319. }
  39320. u = d = !0
  39321. }
  39322. s.offset = s.markedOffset = c,
  39323. h = !1;
  39324. break;
  39325. case "<":
  39326. if (!i) {
  39327. if (u) {
  39328. f = !0;
  39329. break
  39330. }
  39331. u = !0
  39332. }
  39333. s.offset = c,
  39334. h = !1;
  39335. break;
  39336. case "]":
  39337. if (!i) {
  39338. if (p || d) {
  39339. f = !0;
  39340. break
  39341. }
  39342. p = d = !0
  39343. }
  39344. s.limit = s.markedOffset = c,
  39345. h = !1;
  39346. break;
  39347. case ">":
  39348. if (!i) {
  39349. if (p) {
  39350. f = !0;
  39351. break
  39352. }
  39353. p = !0
  39354. }
  39355. s.limit = c,
  39356. h = !1;
  39357. break;
  39358. case "'":
  39359. if (!i) {
  39360. if (d) {
  39361. f = !0;
  39362. break
  39363. }
  39364. d = !0
  39365. }
  39366. s.markedOffset = c,
  39367. h = !1;
  39368. break;
  39369. case " ":
  39370. h = !1;
  39371. break;
  39372. default:
  39373. if (!i && h) {
  39374. f = !0;
  39375. break
  39376. }
  39377. if (r = parseInt(n + e.charAt(l++), 16),
  39378. !i && (isNaN(r) || r < 0 || r > 255))
  39379. throw TypeError("Illegal str: Not a debug encoded string");
  39380. s.view[c++] = r,
  39381. h = !0
  39382. }
  39383. if (f)
  39384. throw TypeError("Illegal str: Invalid symbol at " + l)
  39385. }
  39386. if (!i) {
  39387. if (!u || !p)
  39388. throw TypeError("Illegal str: Missing offset or limit");
  39389. if (c < s.buffer.byteLength)
  39390. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  39391. }
  39392. return s
  39393. }
  39394. ,
  39395. a.toHex = function(e, t) {
  39396. if (e = "undefined" == typeof e ? this.offset : e,
  39397. t = "undefined" == typeof t ? this.limit : t,
  39398. !this.noAssert) {
  39399. if ("number" != typeof e || e % 1 !== 0)
  39400. throw TypeError("Illegal begin: Not an integer");
  39401. if (e >>>= 0,
  39402. "number" != typeof t || t % 1 !== 0)
  39403. throw TypeError("Illegal end: Not an integer");
  39404. if (t >>>= 0,
  39405. e < 0 || e > t || t > this.buffer.byteLength)
  39406. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39407. }
  39408. for (var i, n = new Array(t - e); e < t; )
  39409. i = this.view[e++],
  39410. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  39411. return n.join("")
  39412. }
  39413. ,
  39414. o.fromHex = function(e, t, i) {
  39415. if (!i) {
  39416. if ("string" != typeof e)
  39417. throw TypeError("Illegal str: Not a string");
  39418. if (e.length % 2 !== 0)
  39419. throw TypeError("Illegal str: Length not a multiple of 2")
  39420. }
  39421. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  39422. if (n = parseInt(e.substring(s, s + 2), 16),
  39423. !i && (!isFinite(n) || n < 0 || n > 255))
  39424. throw TypeError("Illegal str: Contains non-hex characters");
  39425. a.view[l++] = n
  39426. }
  39427. return a.limit = l,
  39428. a
  39429. }
  39430. ;
  39431. var h = function() {
  39432. var e = {};
  39433. return e.MAX_CODEPOINT = 1114111,
  39434. e.encodeUTF8 = function(e, t) {
  39435. var i = null;
  39436. for ("number" == typeof e && (i = e,
  39437. e = function() {
  39438. return null
  39439. }
  39440. ); null !== i || null !== (i = e()); )
  39441. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  39442. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  39443. t(i >> 6 & 63 | 128),
  39444. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  39445. t(i >> 12 & 63 | 128),
  39446. t(i >> 6 & 63 | 128),
  39447. t(63 & i | 128)),
  39448. i = null
  39449. }
  39450. ,
  39451. e.decodeUTF8 = function(e, t) {
  39452. for (var i, n, r, o, a = function(e) {
  39453. e = e.slice(0, e.indexOf(null));
  39454. var t = Error(e.toString());
  39455. throw t.name = "TruncatedError",
  39456. t.bytes = e,
  39457. t
  39458. }; null !== (i = e()); )
  39459. if (0 === (128 & i))
  39460. t(i);
  39461. else if (192 === (224 & i))
  39462. null === (n = e()) && a([i, n]),
  39463. t((31 & i) << 6 | 63 & n);
  39464. else if (224 === (240 & i))
  39465. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  39466. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  39467. else {
  39468. if (240 !== (248 & i))
  39469. throw RangeError("Illegal starting byte: " + i);
  39470. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  39471. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  39472. }
  39473. }
  39474. ,
  39475. e.UTF16toUTF8 = function(e, t) {
  39476. for (var i, n = null; ; ) {
  39477. if (null === (i = null !== n ? n : e()))
  39478. break;
  39479. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  39480. n = null) : t(i)
  39481. }
  39482. null !== n && t(n)
  39483. }
  39484. ,
  39485. e.UTF8toUTF16 = function(e, t) {
  39486. var i = null;
  39487. for ("number" == typeof e && (i = e,
  39488. e = function() {
  39489. return null
  39490. }
  39491. ); null !== i || null !== (i = e()); )
  39492. i <= 65535 ? t(i) : (i -= 65536,
  39493. t((i >> 10) + 55296),
  39494. t(i % 1024 + 56320)),
  39495. i = null
  39496. }
  39497. ,
  39498. e.encodeUTF16toUTF8 = function(t, i) {
  39499. e.UTF16toUTF8(t, function(t) {
  39500. e.encodeUTF8(t, i)
  39501. })
  39502. }
  39503. ,
  39504. e.decodeUTF8toUTF16 = function(t, i) {
  39505. e.decodeUTF8(t, function(t) {
  39506. e.UTF8toUTF16(t, i)
  39507. })
  39508. }
  39509. ,
  39510. e.calculateCodePoint = function(e) {
  39511. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39512. }
  39513. ,
  39514. e.calculateUTF8 = function(e) {
  39515. for (var t, i = 0; null !== (t = e()); )
  39516. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  39517. return i
  39518. }
  39519. ,
  39520. e.calculateUTF16asUTF8 = function(t) {
  39521. var i = 0
  39522. , n = 0;
  39523. return e.UTF16toUTF8(t, function(e) {
  39524. ++i,
  39525. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39526. }),
  39527. [i, n]
  39528. }
  39529. ,
  39530. e
  39531. }();
  39532. return a.toUTF8 = function(e, t) {
  39533. if ("undefined" == typeof e && (e = this.offset),
  39534. "undefined" == typeof t && (t = this.limit),
  39535. !this.noAssert) {
  39536. if ("number" != typeof e || e % 1 !== 0)
  39537. throw TypeError("Illegal begin: Not an integer");
  39538. if (e >>>= 0,
  39539. "number" != typeof t || t % 1 !== 0)
  39540. throw TypeError("Illegal end: Not an integer");
  39541. if (t >>>= 0,
  39542. e < 0 || e > t || t > this.buffer.byteLength)
  39543. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39544. }
  39545. var n;
  39546. try {
  39547. h.decodeUTF8toUTF16(function() {
  39548. return e < t ? this.view[e++] : null
  39549. }
  39550. .bind(this), n = i())
  39551. } catch (i) {
  39552. if (e !== t)
  39553. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  39554. }
  39555. return n()
  39556. }
  39557. ,
  39558. o.fromUTF8 = function(e, i, n) {
  39559. if (!n && "string" != typeof e)
  39560. throw TypeError("Illegal str: Not a string");
  39561. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  39562. , a = 0;
  39563. return h.encodeUTF16toUTF8(t(e), function(e) {
  39564. r.view[a++] = e
  39565. }),
  39566. r.limit = a,
  39567. r
  39568. }
  39569. ,
  39570. o
  39571. })
  39572. }
  39573. , {
  39574. long: 216
  39575. }],
  39576. 216: [function(e, t, i) {//long
  39577. !function(i, n) {
  39578. "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()
  39579. }(this, function() {
  39580. "use strict";
  39581. function e(e, t, i) {
  39582. this.low = 0 | e,
  39583. this.high = 0 | t,
  39584. this.unsigned = !!i
  39585. }
  39586. function t(e) {
  39587. return (e && e.__isLong__) === !0
  39588. }
  39589. function i(e, t) {
  39590. var i, n, o;
  39591. return t ? (e >>>= 0,
  39592. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  39593. o && (l[e] = i),
  39594. i)) : (e |= 0,
  39595. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  39596. o && (s[e] = i),
  39597. i))
  39598. }
  39599. function n(e, t) {
  39600. if (isNaN(e) || !isFinite(e))
  39601. return t ? m : g;
  39602. if (t) {
  39603. if (e < 0)
  39604. return m;
  39605. if (e >= d)
  39606. return I
  39607. } else {
  39608. if (e <= -p)
  39609. return E;
  39610. if (e + 1 >= p)
  39611. return C
  39612. }
  39613. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  39614. }
  39615. function r(t, i, n) {
  39616. return new e(t,i,n)
  39617. }
  39618. function o(e, t, i) {
  39619. if (0 === e.length)
  39620. throw Error("empty string");
  39621. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  39622. return g;
  39623. if ("number" == typeof t ? (i = t,
  39624. t = !1) : t = !!t,
  39625. i = i || 10,
  39626. i < 2 || 36 < i)
  39627. throw RangeError("radix");
  39628. var r;
  39629. if ((r = e.indexOf("-")) > 0)
  39630. throw Error("interior hyphen");
  39631. if (0 === r)
  39632. return o(e.substring(1), t, i).neg();
  39633. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  39634. var h = Math.min(8, e.length - l)
  39635. , u = parseInt(e.substring(l, l + h), i);
  39636. if (h < 8) {
  39637. var d = n(c(i, h));
  39638. s = s.mul(d).add(n(u))
  39639. } else
  39640. s = s.mul(a),
  39641. s = s.add(n(u))
  39642. }
  39643. return s.unsigned = t,
  39644. s
  39645. }
  39646. function a(t) {
  39647. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  39648. }
  39649. e.prototype.__isLong__,
  39650. Object.defineProperty(e.prototype, "__isLong__", {
  39651. value: !0,
  39652. enumerable: !1,
  39653. configurable: !1
  39654. }),
  39655. e.isLong = t;
  39656. var s = {}
  39657. , l = {};
  39658. e.fromInt = i,
  39659. e.fromNumber = n,
  39660. e.fromBits = r;
  39661. var c = Math.pow;
  39662. e.fromString = o,
  39663. e.fromValue = a;
  39664. var h = 1 << 24
  39665. , u = 4294967296
  39666. , d = 0x10000000000000000
  39667. , p = d / 2
  39668. , f = i(h)
  39669. , g = i(0);
  39670. e.ZERO = g;
  39671. var m = i(0, !0);
  39672. e.UZERO = m;
  39673. var v = i(1);
  39674. e.ONE = v;
  39675. var A = i(1, !0);
  39676. e.UONE = A;
  39677. var y = i(-1);
  39678. e.NEG_ONE = y;
  39679. var C = r(-1, 2147483647, !1);
  39680. e.MAX_VALUE = C;
  39681. var I = r(-1, -1, !0);
  39682. e.MAX_UNSIGNED_VALUE = I;
  39683. var E = r(0, -2147483648, !1);
  39684. e.MIN_VALUE = E;
  39685. var b = e.prototype;
  39686. return b.toInt = function() {
  39687. return this.unsigned ? this.low >>> 0 : this.low
  39688. }
  39689. ,
  39690. b.toNumber = function() {
  39691. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39692. }
  39693. ,
  39694. b.toString = function(e) {
  39695. if (e = e || 10,
  39696. e < 2 || 36 < e)
  39697. throw RangeError("radix");
  39698. if (this.isZero())
  39699. return "0";
  39700. if (this.isNegative()) {
  39701. if (this.eq(E)) {
  39702. var t = n(e)
  39703. , i = this.div(t)
  39704. , r = i.mul(t).sub(this);
  39705. return i.toString(e) + r.toInt().toString(e)
  39706. }
  39707. return "-" + this.neg().toString(e)
  39708. }
  39709. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39710. var l = a.div(o)
  39711. , h = a.sub(l.mul(o)).toInt() >>> 0
  39712. , u = h.toString(e);
  39713. if (a = l,
  39714. a.isZero())
  39715. return u + s;
  39716. for (; u.length < 6; )
  39717. u = "0" + u;
  39718. s = "" + u + s
  39719. }
  39720. }
  39721. ,
  39722. b.getHighBits = function() {
  39723. return this.high
  39724. }
  39725. ,
  39726. b.getHighBitsUnsigned = function() {
  39727. return this.high >>> 0
  39728. }
  39729. ,
  39730. b.getLowBits = function() {
  39731. return this.low
  39732. }
  39733. ,
  39734. b.getLowBitsUnsigned = function() {
  39735. return this.low >>> 0
  39736. }
  39737. ,
  39738. b.getNumBitsAbs = function() {
  39739. if (this.isNegative())
  39740. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39741. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39742. ;
  39743. return 0 != this.high ? t + 33 : t + 1
  39744. }
  39745. ,
  39746. b.isZero = function() {
  39747. return 0 === this.high && 0 === this.low
  39748. }
  39749. ,
  39750. b.isNegative = function() {
  39751. return !this.unsigned && this.high < 0
  39752. }
  39753. ,
  39754. b.isPositive = function() {
  39755. return this.unsigned || this.high >= 0
  39756. }
  39757. ,
  39758. b.isOdd = function() {
  39759. return 1 === (1 & this.low)
  39760. }
  39761. ,
  39762. b.isEven = function() {
  39763. return 0 === (1 & this.low)
  39764. }
  39765. ,
  39766. b.equals = function(e) {
  39767. return t(e) || (e = a(e)),
  39768. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39769. }
  39770. ,
  39771. b.eq = b.equals,
  39772. b.notEquals = function(e) {
  39773. return !this.eq(e)
  39774. }
  39775. ,
  39776. b.neq = b.notEquals,
  39777. b.lessThan = function(e) {
  39778. return this.comp(e) < 0
  39779. }
  39780. ,
  39781. b.lt = b.lessThan,
  39782. b.lessThanOrEqual = function(e) {
  39783. return this.comp(e) <= 0
  39784. }
  39785. ,
  39786. b.lte = b.lessThanOrEqual,
  39787. b.greaterThan = function(e) {
  39788. return this.comp(e) > 0
  39789. }
  39790. ,
  39791. b.gt = b.greaterThan,
  39792. b.greaterThanOrEqual = function(e) {
  39793. return this.comp(e) >= 0
  39794. }
  39795. ,
  39796. b.gte = b.greaterThanOrEqual,
  39797. b.compare = function(e) {
  39798. if (t(e) || (e = a(e)),
  39799. this.eq(e))
  39800. return 0;
  39801. var i = this.isNegative()
  39802. , n = e.isNegative();
  39803. 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
  39804. }
  39805. ,
  39806. b.comp = b.compare,
  39807. b.negate = function() {
  39808. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39809. }
  39810. ,
  39811. b.neg = b.negate,
  39812. b.add = function(e) {
  39813. t(e) || (e = a(e));
  39814. var i = this.high >>> 16
  39815. , n = 65535 & this.high
  39816. , o = this.low >>> 16
  39817. , s = 65535 & this.low
  39818. , l = e.high >>> 16
  39819. , c = 65535 & e.high
  39820. , h = e.low >>> 16
  39821. , u = 65535 & e.low
  39822. , d = 0
  39823. , p = 0
  39824. , f = 0
  39825. , g = 0;
  39826. return g += s + u,
  39827. f += g >>> 16,
  39828. g &= 65535,
  39829. f += o + h,
  39830. p += f >>> 16,
  39831. f &= 65535,
  39832. p += n + c,
  39833. d += p >>> 16,
  39834. p &= 65535,
  39835. d += i + l,
  39836. d &= 65535,
  39837. r(f << 16 | g, d << 16 | p, this.unsigned)
  39838. }
  39839. ,
  39840. b.subtract = function(e) {
  39841. return t(e) || (e = a(e)),
  39842. this.add(e.neg())
  39843. }
  39844. ,
  39845. b.sub = b.subtract,
  39846. b.multiply = function(e) {
  39847. if (this.isZero())
  39848. return g;
  39849. if (t(e) || (e = a(e)),
  39850. e.isZero())
  39851. return g;
  39852. if (this.eq(E))
  39853. return e.isOdd() ? E : g;
  39854. if (e.eq(E))
  39855. return this.isOdd() ? E : g;
  39856. if (this.isNegative())
  39857. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39858. if (e.isNegative())
  39859. return this.mul(e.neg()).neg();
  39860. if (this.lt(f) && e.lt(f))
  39861. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39862. var i = this.high >>> 16
  39863. , o = 65535 & this.high
  39864. , s = this.low >>> 16
  39865. , l = 65535 & this.low
  39866. , c = e.high >>> 16
  39867. , h = 65535 & e.high
  39868. , u = e.low >>> 16
  39869. , d = 65535 & e.low
  39870. , p = 0
  39871. , m = 0
  39872. , v = 0
  39873. , A = 0;
  39874. return A += l * d,
  39875. v += A >>> 16,
  39876. A &= 65535,
  39877. v += s * d,
  39878. m += v >>> 16,
  39879. v &= 65535,
  39880. v += l * u,
  39881. m += v >>> 16,
  39882. v &= 65535,
  39883. m += o * d,
  39884. p += m >>> 16,
  39885. m &= 65535,
  39886. m += s * u,
  39887. p += m >>> 16,
  39888. m &= 65535,
  39889. m += l * h,
  39890. p += m >>> 16,
  39891. m &= 65535,
  39892. p += i * d + o * u + s * h + l * c,
  39893. p &= 65535,
  39894. r(v << 16 | A, p << 16 | m, this.unsigned)
  39895. }
  39896. ,
  39897. b.mul = b.multiply,
  39898. b.divide = function(e) {
  39899. if (t(e) || (e = a(e)),
  39900. e.isZero())
  39901. throw Error("division by zero");
  39902. if (this.isZero())
  39903. return this.unsigned ? m : g;
  39904. var i, r, o;
  39905. if (this.unsigned) {
  39906. if (e.unsigned || (e = e.toUnsigned()),
  39907. e.gt(this))
  39908. return m;
  39909. if (e.gt(this.shru(1)))
  39910. return A;
  39911. o = m
  39912. } else {
  39913. if (this.eq(E)) {
  39914. if (e.eq(v) || e.eq(y))
  39915. return E;
  39916. if (e.eq(E))
  39917. return v;
  39918. var s = this.shr(1);
  39919. return i = s.div(e).shl(1),
  39920. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39921. o = i.add(r.div(e)))
  39922. }
  39923. if (e.eq(E))
  39924. return this.unsigned ? m : g;
  39925. if (this.isNegative())
  39926. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39927. if (e.isNegative())
  39928. return this.div(e.neg()).neg();
  39929. o = g
  39930. }
  39931. for (r = this; r.gte(e); ) {
  39932. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39933. 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); )
  39934. i -= h,
  39935. u = n(i, this.unsigned),
  39936. d = u.mul(e);
  39937. u.isZero() && (u = v),
  39938. o = o.add(u),
  39939. r = r.sub(d)
  39940. }
  39941. return o
  39942. }
  39943. ,
  39944. b.div = b.divide,
  39945. b.modulo = function(e) {
  39946. return t(e) || (e = a(e)),
  39947. this.sub(this.div(e).mul(e))
  39948. }
  39949. ,
  39950. b.mod = b.modulo,
  39951. b.not = function() {
  39952. return r(~this.low, ~this.high, this.unsigned)
  39953. }
  39954. ,
  39955. b.and = function(e) {
  39956. return t(e) || (e = a(e)),
  39957. r(this.low & e.low, this.high & e.high, this.unsigned)
  39958. }
  39959. ,
  39960. b.or = function(e) {
  39961. return t(e) || (e = a(e)),
  39962. r(this.low | e.low, this.high | e.high, this.unsigned)
  39963. }
  39964. ,
  39965. b.xor = function(e) {
  39966. return t(e) || (e = a(e)),
  39967. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39968. }
  39969. ,
  39970. b.shiftLeft = function(e) {
  39971. return t(e) && (e = e.toInt()),
  39972. 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)
  39973. }
  39974. ,
  39975. b.shl = b.shiftLeft,
  39976. b.shiftRight = function(e) {
  39977. return t(e) && (e = e.toInt()),
  39978. 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)
  39979. }
  39980. ,
  39981. b.shr = b.shiftRight,
  39982. b.shiftRightUnsigned = function(e) {
  39983. if (t(e) && (e = e.toInt()),
  39984. e &= 63,
  39985. 0 === e)
  39986. return this;
  39987. var i = this.high;
  39988. if (e < 32) {
  39989. var n = this.low;
  39990. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39991. }
  39992. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39993. }
  39994. ,
  39995. b.shru = b.shiftRightUnsigned,
  39996. b.toSigned = function() {
  39997. return this.unsigned ? r(this.low, this.high, !1) : this
  39998. }
  39999. ,
  40000. b.toUnsigned = function() {
  40001. return this.unsigned ? this : r(this.low, this.high, !0)
  40002. }
  40003. ,
  40004. b.toBytes = function(e) {
  40005. return e ? this.toBytesLE() : this.toBytesBE()
  40006. }
  40007. ,
  40008. b.toBytesLE = function() {
  40009. var e = this.high
  40010. , t = this.low;
  40011. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  40012. }
  40013. ,
  40014. b.toBytesBE = function() {
  40015. var e = this.high
  40016. , t = this.low;
  40017. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  40018. }
  40019. ,
  40020. e
  40021. })
  40022. }
  40023. , {}],
  40024. 217: [function(e, t, i) {//three.js
  40025. var n = {
  40026. REVISION: "75"
  40027. };
  40028. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  40029. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  40030. void 0 === Math.sign && (Math.sign = function(e) {
  40031. return e < 0 ? -1 : e > 0 ? 1 : +e
  40032. }
  40033. ),
  40034. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  40035. get: function() {
  40036. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  40037. }
  40038. }),
  40039. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  40040. writable: !0,
  40041. configurable: !0,
  40042. value: function(e) {
  40043. "use strict";
  40044. if (void 0 === e || null === e)
  40045. throw new TypeError("Cannot convert first argument to object");
  40046. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  40047. var r = arguments[i];
  40048. if (void 0 !== r && null !== r) {
  40049. r = Object(r);
  40050. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  40051. var l = o[a]
  40052. , c = Object.getOwnPropertyDescriptor(r, l);
  40053. void 0 !== c && c.enumerable && (t[l] = r[l])
  40054. }
  40055. }
  40056. }
  40057. return t
  40058. }
  40059. }),
  40060. n.MOUSE = {
  40061. LEFT: 0,
  40062. MIDDLE: 1,
  40063. RIGHT: 2
  40064. },
  40065. n.CullFaceNone = 0,
  40066. n.CullFaceBack = 1,
  40067. n.CullFaceFront = 2,
  40068. n.CullFaceFrontBack = 3,
  40069. n.FrontFaceDirectionCW = 0,
  40070. n.FrontFaceDirectionCCW = 1,
  40071. n.BasicShadowMap = 0,
  40072. n.PCFShadowMap = 1,
  40073. n.PCFSoftShadowMap = 2,
  40074. n.FrontSide = 0,
  40075. n.BackSide = 1,
  40076. n.DoubleSide = 2,
  40077. n.FlatShading = 1,
  40078. n.SmoothShading = 2,
  40079. n.NoColors = 0,
  40080. n.FaceColors = 1,
  40081. n.VertexColors = 2,
  40082. n.NoBlending = 0,
  40083. n.NormalBlending = 1,
  40084. n.AdditiveBlending = 2,
  40085. n.SubtractiveBlending = 3,
  40086. n.MultiplyBlending = 4,
  40087. n.CustomBlending = 5,
  40088. n.AddEquation = 100,
  40089. n.SubtractEquation = 101,
  40090. n.ReverseSubtractEquation = 102,
  40091. n.MinEquation = 103,
  40092. n.MaxEquation = 104,
  40093. n.ZeroFactor = 200,
  40094. n.OneFactor = 201,
  40095. n.SrcColorFactor = 202,
  40096. n.OneMinusSrcColorFactor = 203,
  40097. n.SrcAlphaFactor = 204,
  40098. n.OneMinusSrcAlphaFactor = 205,
  40099. n.DstAlphaFactor = 206,
  40100. n.OneMinusDstAlphaFactor = 207,
  40101. n.DstColorFactor = 208,
  40102. n.OneMinusDstColorFactor = 209,
  40103. n.SrcAlphaSaturateFactor = 210,
  40104. n.NeverDepth = 0,
  40105. n.AlwaysDepth = 1,
  40106. n.LessDepth = 2,
  40107. n.LessEqualDepth = 3,
  40108. n.EqualDepth = 4,
  40109. n.GreaterEqualDepth = 5,
  40110. n.GreaterDepth = 6,
  40111. n.NotEqualDepth = 7,
  40112. n.MultiplyOperation = 0,
  40113. n.MixOperation = 1,
  40114. n.AddOperation = 2,
  40115. n.NoToneMapping = 0,
  40116. n.LinearToneMapping = 1,
  40117. n.ReinhardToneMapping = 2,
  40118. n.Uncharted2ToneMapping = 3,
  40119. n.CineonToneMapping = 4,
  40120. n.UVMapping = 300,
  40121. n.CubeReflectionMapping = 301,
  40122. n.CubeRefractionMapping = 302,
  40123. n.EquirectangularReflectionMapping = 303,
  40124. n.EquirectangularRefractionMapping = 304,
  40125. n.SphericalReflectionMapping = 305,
  40126. n.CubeUVReflectionMapping = 306,
  40127. n.CubeUVRefractionMapping = 307,
  40128. n.RepeatWrapping = 1e3,
  40129. n.ClampToEdgeWrapping = 1001,
  40130. n.MirroredRepeatWrapping = 1002,
  40131. n.NearestFilter = 1003,
  40132. n.NearestMipMapNearestFilter = 1004,
  40133. n.NearestMipMapLinearFilter = 1005,
  40134. n.LinearFilter = 1006,
  40135. n.LinearMipMapNearestFilter = 1007,
  40136. n.LinearMipMapLinearFilter = 1008,
  40137. n.UnsignedByteType = 1009,
  40138. n.ByteType = 1010,
  40139. n.ShortType = 1011,
  40140. n.UnsignedShortType = 1012,
  40141. n.IntType = 1013,
  40142. n.UnsignedIntType = 1014,
  40143. n.FloatType = 1015,
  40144. n.HalfFloatType = 1025,
  40145. n.UnsignedShort4444Type = 1016,
  40146. n.UnsignedShort5551Type = 1017,
  40147. n.UnsignedShort565Type = 1018,
  40148. n.AlphaFormat = 1019,
  40149. n.RGBFormat = 1020,
  40150. n.RGBAFormat = 1021,
  40151. n.LuminanceFormat = 1022,
  40152. n.LuminanceAlphaFormat = 1023,
  40153. n.RGBEFormat = n.RGBAFormat,
  40154. n.RGB_S3TC_DXT1_Format = 2001,
  40155. n.RGBA_S3TC_DXT1_Format = 2002,
  40156. n.RGBA_S3TC_DXT3_Format = 2003,
  40157. n.RGBA_S3TC_DXT5_Format = 2004,
  40158. n.RGB_PVRTC_4BPPV1_Format = 2100,
  40159. n.RGB_PVRTC_2BPPV1_Format = 2101,
  40160. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  40161. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  40162. n.RGB_ETC1_Format = 2151,
  40163. n.LoopOnce = 2200,
  40164. n.LoopRepeat = 2201,
  40165. n.LoopPingPong = 2202,
  40166. n.InterpolateDiscrete = 2300,
  40167. n.InterpolateLinear = 2301,
  40168. n.InterpolateSmooth = 2302,
  40169. n.ZeroCurvatureEnding = 2400,
  40170. n.ZeroSlopeEnding = 2401,
  40171. n.WrapAroundEnding = 2402,
  40172. n.TrianglesDrawMode = 0,
  40173. n.TriangleStripDrawMode = 1,
  40174. n.TriangleFanDrawMode = 2,
  40175. n.LinearEncoding = 3e3,
  40176. n.sRGBEncoding = 3001,
  40177. n.GammaEncoding = 3007,
  40178. n.RGBEEncoding = 3002,
  40179. n.LogLuvEncoding = 3003,
  40180. n.RGBM7Encoding = 3004,
  40181. n.RGBM16Encoding = 3005,
  40182. n.RGBDEncoding = 3006,
  40183. n.Color = function(e) {
  40184. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  40185. }
  40186. ,
  40187. n.Color.prototype = {
  40188. constructor: n.Color,
  40189. r: 1,
  40190. g: 1,
  40191. b: 1,
  40192. set: function(e) {
  40193. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  40194. this
  40195. },
  40196. setScalar: function(e) {
  40197. this.r = e,
  40198. this.g = e,
  40199. this.b = e
  40200. },
  40201. setHex: function(e) {
  40202. return e = Math.floor(e),
  40203. this.r = (e >> 16 & 255) / 255,
  40204. this.g = (e >> 8 & 255) / 255,
  40205. this.b = (255 & e) / 255,
  40206. this
  40207. },
  40208. setRGB: function(e, t, i) {
  40209. return this.r = e,
  40210. this.g = t,
  40211. this.b = i,
  40212. this
  40213. },
  40214. setHSL: function() {
  40215. function e(e, t, i) {
  40216. return i < 0 && (i += 1),
  40217. i > 1 && (i -= 1),
  40218. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  40219. }
  40220. return function(t, i, r) {
  40221. if (t = n.Math.euclideanModulo(t, 1),
  40222. i = n.Math.clamp(i, 0, 1),
  40223. r = n.Math.clamp(r, 0, 1),
  40224. 0 === i)
  40225. this.r = this.g = this.b = r;
  40226. else {
  40227. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  40228. , a = 2 * r - o;
  40229. this.r = e(a, o, t + 1 / 3),
  40230. this.g = e(a, o, t),
  40231. this.b = e(a, o, t - 1 / 3)
  40232. }
  40233. return this
  40234. }
  40235. }(),
  40236. setStyle: function(e) {
  40237. function t(t) {
  40238. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  40239. }
  40240. var i;
  40241. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  40242. var r, o = i[1], a = i[2];
  40243. switch (o) {
  40244. case "rgb":
  40245. case "rgba":
  40246. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  40247. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  40248. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  40249. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  40250. t(r[5]),
  40251. this;
  40252. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  40253. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  40254. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  40255. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  40256. t(r[5]),
  40257. this;
  40258. break;
  40259. case "hsl":
  40260. case "hsla":
  40261. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  40262. var s = parseFloat(r[1]) / 360
  40263. , l = parseInt(r[2], 10) / 100
  40264. , c = parseInt(r[3], 10) / 100;
  40265. return t(r[5]),
  40266. this.setHSL(s, l, c)
  40267. }
  40268. }
  40269. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  40270. var h = i[1]
  40271. , u = h.length;
  40272. if (3 === u)
  40273. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  40274. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  40275. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  40276. this;
  40277. if (6 === u)
  40278. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  40279. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  40280. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  40281. this
  40282. }
  40283. if (e && e.length > 0) {
  40284. var h = n.ColorKeywords[e];
  40285. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  40286. }
  40287. return this
  40288. },
  40289. clone: function() {
  40290. return new this.constructor(this.r,this.g,this.b)
  40291. },
  40292. copy: function(e) {
  40293. return this.r = e.r,
  40294. this.g = e.g,
  40295. this.b = e.b,
  40296. this
  40297. },
  40298. copyGammaToLinear: function(e, t) {
  40299. return void 0 === t && (t = 2),
  40300. this.r = Math.pow(e.r, t),
  40301. this.g = Math.pow(e.g, t),
  40302. this.b = Math.pow(e.b, t),
  40303. this
  40304. },
  40305. copyLinearToGamma: function(e, t) {
  40306. void 0 === t && (t = 2);
  40307. var i = t > 0 ? 1 / t : 1;
  40308. return this.r = Math.pow(e.r, i),
  40309. this.g = Math.pow(e.g, i),
  40310. this.b = Math.pow(e.b, i),
  40311. this
  40312. },
  40313. convertGammaToLinear: function() {
  40314. var e = this.r
  40315. , t = this.g
  40316. , i = this.b;
  40317. return this.r = e * e,
  40318. this.g = t * t,
  40319. this.b = i * i,
  40320. this
  40321. },
  40322. convertLinearToGamma: function() {
  40323. return this.r = Math.sqrt(this.r),
  40324. this.g = Math.sqrt(this.g),
  40325. this.b = Math.sqrt(this.b),
  40326. this
  40327. },
  40328. getHex: function() {
  40329. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  40330. },
  40331. getHexString: function() {
  40332. return ("000000" + this.getHex().toString(16)).slice(-6)
  40333. },
  40334. getHSL: function(e) {
  40335. var t, i, n = e || {
  40336. h: 0,
  40337. s: 0,
  40338. l: 0
  40339. }, 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;
  40340. if (l === s)
  40341. t = 0,
  40342. i = 0;
  40343. else {
  40344. var h = s - l;
  40345. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  40346. s) {
  40347. case r:
  40348. t = (o - a) / h + (o < a ? 6 : 0);
  40349. break;
  40350. case o:
  40351. t = (a - r) / h + 2;
  40352. break;
  40353. case a:
  40354. t = (r - o) / h + 4
  40355. }
  40356. t /= 6
  40357. }
  40358. return n.h = t,
  40359. n.s = i,
  40360. n.l = c,
  40361. n
  40362. },
  40363. getStyle: function() {
  40364. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  40365. },
  40366. offsetHSL: function(e, t, i) {
  40367. var n = this.getHSL();
  40368. return n.h += e,
  40369. n.s += t,
  40370. n.l += i,
  40371. this.setHSL(n.h, n.s, n.l),
  40372. this
  40373. },
  40374. add: function(e) {
  40375. return this.r += e.r,
  40376. this.g += e.g,
  40377. this.b += e.b,
  40378. this
  40379. },
  40380. addColors: function(e, t) {
  40381. return this.r = e.r + t.r,
  40382. this.g = e.g + t.g,
  40383. this.b = e.b + t.b,
  40384. this
  40385. },
  40386. addScalar: function(e) {
  40387. return this.r += e,
  40388. this.g += e,
  40389. this.b += e,
  40390. this
  40391. },
  40392. multiply: function(e) {
  40393. return this.r *= e.r,
  40394. this.g *= e.g,
  40395. this.b *= e.b,
  40396. this
  40397. },
  40398. multiplyScalar: function(e) {
  40399. return this.r *= e,
  40400. this.g *= e,
  40401. this.b *= e,
  40402. this
  40403. },
  40404. lerp: function(e, t) {
  40405. return this.r += (e.r - this.r) * t,
  40406. this.g += (e.g - this.g) * t,
  40407. this.b += (e.b - this.b) * t,
  40408. this
  40409. },
  40410. equals: function(e) {
  40411. return e.r === this.r && e.g === this.g && e.b === this.b
  40412. },
  40413. fromArray: function(e, t) {
  40414. return void 0 === t && (t = 0),
  40415. this.r = e[t],
  40416. this.g = e[t + 1],
  40417. this.b = e[t + 2],
  40418. this
  40419. },
  40420. toArray: function(e, t) {
  40421. return void 0 === e && (e = []),
  40422. void 0 === t && (t = 0),
  40423. e[t] = this.r,
  40424. e[t + 1] = this.g,
  40425. e[t + 2] = this.b,
  40426. e
  40427. }
  40428. },
  40429. n.ColorKeywords = {
  40430. aliceblue: 15792383,
  40431. antiquewhite: 16444375,
  40432. aqua: 65535,
  40433. aquamarine: 8388564,
  40434. azure: 15794175,
  40435. beige: 16119260,
  40436. bisque: 16770244,
  40437. black: 0,
  40438. blanchedalmond: 16772045,
  40439. blue: 255,
  40440. blueviolet: 9055202,
  40441. brown: 10824234,
  40442. burlywood: 14596231,
  40443. cadetblue: 6266528,
  40444. chartreuse: 8388352,
  40445. chocolate: 13789470,
  40446. coral: 16744272,
  40447. cornflowerblue: 6591981,
  40448. cornsilk: 16775388,
  40449. crimson: 14423100,
  40450. cyan: 65535,
  40451. darkblue: 139,
  40452. darkcyan: 35723,
  40453. darkgoldenrod: 12092939,
  40454. darkgray: 11119017,
  40455. darkgreen: 25600,
  40456. darkgrey: 11119017,
  40457. darkkhaki: 12433259,
  40458. darkmagenta: 9109643,
  40459. darkolivegreen: 5597999,
  40460. darkorange: 16747520,
  40461. darkorchid: 10040012,
  40462. darkred: 9109504,
  40463. darksalmon: 15308410,
  40464. darkseagreen: 9419919,
  40465. darkslateblue: 4734347,
  40466. darkslategray: 3100495,
  40467. darkslategrey: 3100495,
  40468. darkturquoise: 52945,
  40469. darkviolet: 9699539,
  40470. deeppink: 16716947,
  40471. deepskyblue: 49151,
  40472. dimgray: 6908265,
  40473. dimgrey: 6908265,
  40474. dodgerblue: 2003199,
  40475. firebrick: 11674146,
  40476. floralwhite: 16775920,
  40477. forestgreen: 2263842,
  40478. fuchsia: 16711935,
  40479. gainsboro: 14474460,
  40480. ghostwhite: 16316671,
  40481. gold: 16766720,
  40482. goldenrod: 14329120,
  40483. gray: 8421504,
  40484. green: 32768,
  40485. greenyellow: 11403055,
  40486. grey: 8421504,
  40487. honeydew: 15794160,
  40488. hotpink: 16738740,
  40489. indianred: 13458524,
  40490. indigo: 4915330,
  40491. ivory: 16777200,
  40492. khaki: 15787660,
  40493. lavender: 15132410,
  40494. lavenderblush: 16773365,
  40495. lawngreen: 8190976,
  40496. lemonchiffon: 16775885,
  40497. lightblue: 11393254,
  40498. lightcoral: 15761536,
  40499. lightcyan: 14745599,
  40500. lightgoldenrodyellow: 16448210,
  40501. lightgray: 13882323,
  40502. lightgreen: 9498256,
  40503. lightgrey: 13882323,
  40504. lightpink: 16758465,
  40505. lightsalmon: 16752762,
  40506. lightseagreen: 2142890,
  40507. lightskyblue: 8900346,
  40508. lightslategray: 7833753,
  40509. lightslategrey: 7833753,
  40510. lightsteelblue: 11584734,
  40511. lightyellow: 16777184,
  40512. lime: 65280,
  40513. limegreen: 3329330,
  40514. linen: 16445670,
  40515. magenta: 16711935,
  40516. maroon: 8388608,
  40517. mediumaquamarine: 6737322,
  40518. mediumblue: 205,
  40519. mediumorchid: 12211667,
  40520. mediumpurple: 9662683,
  40521. mediumseagreen: 3978097,
  40522. mediumslateblue: 8087790,
  40523. mediumspringgreen: 64154,
  40524. mediumturquoise: 4772300,
  40525. mediumvioletred: 13047173,
  40526. midnightblue: 1644912,
  40527. mintcream: 16121850,
  40528. mistyrose: 16770273,
  40529. moccasin: 16770229,
  40530. navajowhite: 16768685,
  40531. navy: 128,
  40532. oldlace: 16643558,
  40533. olive: 8421376,
  40534. olivedrab: 7048739,
  40535. orange: 16753920,
  40536. orangered: 16729344,
  40537. orchid: 14315734,
  40538. palegoldenrod: 15657130,
  40539. palegreen: 10025880,
  40540. paleturquoise: 11529966,
  40541. palevioletred: 14381203,
  40542. papayawhip: 16773077,
  40543. peachpuff: 16767673,
  40544. peru: 13468991,
  40545. pink: 16761035,
  40546. plum: 14524637,
  40547. powderblue: 11591910,
  40548. purple: 8388736,
  40549. red: 16711680,
  40550. rosybrown: 12357519,
  40551. royalblue: 4286945,
  40552. saddlebrown: 9127187,
  40553. salmon: 16416882,
  40554. sandybrown: 16032864,
  40555. seagreen: 3050327,
  40556. seashell: 16774638,
  40557. sienna: 10506797,
  40558. silver: 12632256,
  40559. skyblue: 8900331,
  40560. slateblue: 6970061,
  40561. slategray: 7372944,
  40562. slategrey: 7372944,
  40563. snow: 16775930,
  40564. springgreen: 65407,
  40565. steelblue: 4620980,
  40566. tan: 13808780,
  40567. teal: 32896,
  40568. thistle: 14204888,
  40569. tomato: 16737095,
  40570. turquoise: 4251856,
  40571. violet: 15631086,
  40572. wheat: 16113331,
  40573. white: 16777215,
  40574. whitesmoke: 16119285,
  40575. yellow: 16776960,
  40576. yellowgreen: 10145074
  40577. },
  40578. n.Quaternion = function(e, t, i, n) {
  40579. this._x = e || 0,
  40580. this._y = t || 0,
  40581. this._z = i || 0,
  40582. this._w = void 0 !== n ? n : 1
  40583. }
  40584. ,
  40585. n.Quaternion.prototype = {
  40586. constructor: n.Quaternion,
  40587. get x() {
  40588. return this._x
  40589. },
  40590. set x(e) {
  40591. this._x = e,
  40592. this.onChangeCallback()
  40593. },
  40594. get y() {
  40595. return this._y
  40596. },
  40597. set y(e) {
  40598. this._y = e,
  40599. this.onChangeCallback()
  40600. },
  40601. get z() {
  40602. return this._z
  40603. },
  40604. set z(e) {
  40605. this._z = e,
  40606. this.onChangeCallback()
  40607. },
  40608. get w() {
  40609. return this._w
  40610. },
  40611. set w(e) {
  40612. this._w = e,
  40613. this.onChangeCallback()
  40614. },
  40615. set: function(e, t, i, n) {
  40616. return this._x = e,
  40617. this._y = t,
  40618. this._z = i,
  40619. this._w = n,
  40620. this.onChangeCallback(),
  40621. this
  40622. },
  40623. clone: function() {
  40624. return new this.constructor(this._x,this._y,this._z,this._w)
  40625. },
  40626. copy: function(e) {
  40627. return this._x = e.x,
  40628. this._y = e.y,
  40629. this._z = e.z,
  40630. this._w = e.w,
  40631. this.onChangeCallback(),
  40632. this
  40633. },
  40634. setFromEuler: function(e, t) {
  40635. if (e instanceof n.Euler == !1)
  40636. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  40637. var i = Math.cos(e._x / 2)
  40638. , r = Math.cos(e._y / 2)
  40639. , o = Math.cos(e._z / 2)
  40640. , a = Math.sin(e._x / 2)
  40641. , s = Math.sin(e._y / 2)
  40642. , l = Math.sin(e._z / 2)
  40643. , c = e.order;
  40644. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  40645. this._y = i * s * o - a * r * l,
  40646. this._z = i * r * l + a * s * o,
  40647. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  40648. this._y = i * s * o - a * r * l,
  40649. this._z = i * r * l - a * s * o,
  40650. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  40651. this._y = i * s * o + a * r * l,
  40652. this._z = i * r * l + a * s * o,
  40653. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  40654. this._y = i * s * o + a * r * l,
  40655. this._z = i * r * l - a * s * o,
  40656. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  40657. this._y = i * s * o + a * r * l,
  40658. this._z = i * r * l - a * s * o,
  40659. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  40660. this._y = i * s * o - a * r * l,
  40661. this._z = i * r * l + a * s * o,
  40662. this._w = i * r * o + a * s * l),
  40663. t !== !1 && this.onChangeCallback(),
  40664. this
  40665. },
  40666. setFromAxisAngle: function(e, t) {
  40667. var i = t / 2
  40668. , n = Math.sin(i);
  40669. return this._x = e.x * n,
  40670. this._y = e.y * n,
  40671. this._z = e.z * n,
  40672. this._w = Math.cos(i),
  40673. this.onChangeCallback(),
  40674. this
  40675. },
  40676. setFromRotationMatrix: function(e) {
  40677. 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;
  40678. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40679. this._w = .25 / t,
  40680. this._x = (h - l) * t,
  40681. this._y = (o - c) * t,
  40682. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40683. this._w = (h - l) / t,
  40684. this._x = .25 * t,
  40685. this._y = (r + a) / t,
  40686. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40687. this._w = (o - c) / t,
  40688. this._x = (r + a) / t,
  40689. this._y = .25 * t,
  40690. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40691. this._w = (a - r) / t,
  40692. this._x = (o + c) / t,
  40693. this._y = (l + h) / t,
  40694. this._z = .25 * t),
  40695. this.onChangeCallback(),
  40696. this
  40697. },
  40698. setFromUnitVectors: function() {
  40699. var e, t, i = 1e-6;
  40700. return function(r, o) {
  40701. return void 0 === e && (e = new n.Vector3),
  40702. t = r.dot(o) + 1,
  40703. t < i ? (t = 0,
  40704. 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),
  40705. this._x = e.x,
  40706. this._y = e.y,
  40707. this._z = e.z,
  40708. this._w = t,
  40709. this.normalize(),
  40710. this
  40711. }
  40712. }(),
  40713. inverse: function() {
  40714. return this.conjugate().normalize(),
  40715. this
  40716. },
  40717. conjugate: function() {
  40718. return this._x *= -1,
  40719. this._y *= -1,
  40720. this._z *= -1,
  40721. this.onChangeCallback(),
  40722. this
  40723. },
  40724. dot: function(e) {
  40725. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40726. },
  40727. lengthSq: function() {
  40728. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40729. },
  40730. length: function() {
  40731. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40732. },
  40733. normalize: function() {
  40734. var e = this.length();
  40735. return 0 === e ? (this._x = 0,
  40736. this._y = 0,
  40737. this._z = 0,
  40738. this._w = 1) : (e = 1 / e,
  40739. this._x = this._x * e,
  40740. this._y = this._y * e,
  40741. this._z = this._z * e,
  40742. this._w = this._w * e),
  40743. this.onChangeCallback(),
  40744. this
  40745. },
  40746. multiply: function(e, t) {
  40747. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40748. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40749. },
  40750. multiplyQuaternions: function(e, t) {
  40751. var i = e._x
  40752. , n = e._y
  40753. , r = e._z
  40754. , o = e._w
  40755. , a = t._x
  40756. , s = t._y
  40757. , l = t._z
  40758. , c = t._w;
  40759. return this._x = i * c + o * a + n * l - r * s,
  40760. this._y = n * c + o * s + r * a - i * l,
  40761. this._z = r * c + o * l + i * s - n * a,
  40762. this._w = o * c - i * a - n * s - r * l,
  40763. this.onChangeCallback(),
  40764. this
  40765. },
  40766. slerp: function(e, t) {
  40767. if (0 === t)
  40768. return this;
  40769. if (1 === t)
  40770. return this.copy(e);
  40771. var i = this._x
  40772. , n = this._y
  40773. , r = this._z
  40774. , o = this._w
  40775. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40776. if (a < 0 ? (this._w = -e._w,
  40777. this._x = -e._x,
  40778. this._y = -e._y,
  40779. this._z = -e._z,
  40780. a = -a) : this.copy(e),
  40781. a >= 1)
  40782. return this._w = o,
  40783. this._x = i,
  40784. this._y = n,
  40785. this._z = r,
  40786. this;
  40787. var s = Math.sqrt(1 - a * a);
  40788. if (Math.abs(s) < .001)
  40789. return this._w = .5 * (o + this._w),
  40790. this._x = .5 * (i + this._x),
  40791. this._y = .5 * (n + this._y),
  40792. this._z = .5 * (r + this._z),
  40793. this;
  40794. var l = Math.atan2(s, a)
  40795. , c = Math.sin((1 - t) * l) / s
  40796. , h = Math.sin(t * l) / s;
  40797. return this._w = o * c + this._w * h,
  40798. this._x = i * c + this._x * h,
  40799. this._y = n * c + this._y * h,
  40800. this._z = r * c + this._z * h,
  40801. this.onChangeCallback(),
  40802. this
  40803. },
  40804. equals: function(e) {
  40805. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40806. },
  40807. fromArray: function(e, t) {
  40808. return void 0 === t && (t = 0),
  40809. this._x = e[t],
  40810. this._y = e[t + 1],
  40811. this._z = e[t + 2],
  40812. this._w = e[t + 3],
  40813. this.onChangeCallback(),
  40814. this
  40815. },
  40816. toArray: function(e, t) {
  40817. return void 0 === e && (e = []),
  40818. void 0 === t && (t = 0),
  40819. e[t] = this._x,
  40820. e[t + 1] = this._y,
  40821. e[t + 2] = this._z,
  40822. e[t + 3] = this._w,
  40823. e
  40824. },
  40825. onChange: function(e) {
  40826. return this.onChangeCallback = e,
  40827. this
  40828. },
  40829. onChangeCallback: function() {}
  40830. },
  40831. Object.assign(n.Quaternion, {
  40832. slerp: function(e, t, i, n) {
  40833. return i.copy(e).slerp(t, n)
  40834. },
  40835. slerpFlat: function(e, t, i, n, r, o, a) {
  40836. var s = i[n + 0]
  40837. , l = i[n + 1]
  40838. , c = i[n + 2]
  40839. , h = i[n + 3]
  40840. , u = r[o + 0]
  40841. , d = r[o + 1]
  40842. , p = r[o + 2]
  40843. , f = r[o + 3];
  40844. if (h !== f || s !== u || l !== d || c !== p) {
  40845. var g = 1 - a
  40846. , m = s * u + l * d + c * p + h * f
  40847. , v = m >= 0 ? 1 : -1
  40848. , A = 1 - m * m;
  40849. if (A > Number.EPSILON) {
  40850. var y = Math.sqrt(A)
  40851. , C = Math.atan2(y, m * v);
  40852. g = Math.sin(g * C) / y,
  40853. a = Math.sin(a * C) / y
  40854. }
  40855. var I = a * v;
  40856. if (s = s * g + u * I,
  40857. l = l * g + d * I,
  40858. c = c * g + p * I,
  40859. h = h * g + f * I,
  40860. g === 1 - a) {
  40861. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40862. s *= E,
  40863. l *= E,
  40864. c *= E,
  40865. h *= E
  40866. }
  40867. }
  40868. e[t] = s,
  40869. e[t + 1] = l,
  40870. e[t + 2] = c,
  40871. e[t + 3] = h
  40872. }
  40873. }),
  40874. n.Vector2 = function(e, t) {
  40875. this.x = e || 0,
  40876. this.y = t || 0
  40877. }
  40878. ,
  40879. n.Vector2.prototype = {
  40880. constructor: n.Vector2,
  40881. get width() {
  40882. return this.x
  40883. },
  40884. set width(e) {
  40885. this.x = e
  40886. },
  40887. get height() {
  40888. return this.y
  40889. },
  40890. set height(e) {
  40891. this.y = e
  40892. },
  40893. set: function(e, t) {
  40894. return this.x = e,
  40895. this.y = t,
  40896. this
  40897. },
  40898. setScalar: function(e) {
  40899. return this.x = e,
  40900. this.y = e,
  40901. this
  40902. },
  40903. setX: function(e) {
  40904. return this.x = e,
  40905. this
  40906. },
  40907. setY: function(e) {
  40908. return this.y = e,
  40909. this
  40910. },
  40911. setComponent: function(e, t) {
  40912. switch (e) {
  40913. case 0:
  40914. this.x = t;
  40915. break;
  40916. case 1:
  40917. this.y = t;
  40918. break;
  40919. default:
  40920. throw new Error("index is out of range: " + e)
  40921. }
  40922. },
  40923. getComponent: function(e) {
  40924. switch (e) {
  40925. case 0:
  40926. return this.x;
  40927. case 1:
  40928. return this.y;
  40929. default:
  40930. throw new Error("index is out of range: " + e)
  40931. }
  40932. },
  40933. clone: function() {
  40934. return new this.constructor(this.x,this.y)
  40935. },
  40936. copy: function(e) {
  40937. return this.x = e.x,
  40938. this.y = e.y,
  40939. this
  40940. },
  40941. add: function(e, t) {
  40942. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40943. this.addVectors(e, t)) : (this.x += e.x,
  40944. this.y += e.y,
  40945. this)
  40946. },
  40947. addScalar: function(e) {
  40948. return this.x += e,
  40949. this.y += e,
  40950. this
  40951. },
  40952. addVectors: function(e, t) {
  40953. return this.x = e.x + t.x,
  40954. this.y = e.y + t.y,
  40955. this
  40956. },
  40957. addScaledVector: function(e, t) {
  40958. return this.x += e.x * t,
  40959. this.y += e.y * t,
  40960. this
  40961. },
  40962. sub: function(e, t) {
  40963. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40964. this.subVectors(e, t)) : (this.x -= e.x,
  40965. this.y -= e.y,
  40966. this)
  40967. },
  40968. subScalar: function(e) {
  40969. return this.x -= e,
  40970. this.y -= e,
  40971. this
  40972. },
  40973. subVectors: function(e, t) {
  40974. return this.x = e.x - t.x,
  40975. this.y = e.y - t.y,
  40976. this
  40977. },
  40978. multiply: function(e) {
  40979. return this.x *= e.x,
  40980. this.y *= e.y,
  40981. this
  40982. },
  40983. multiplyScalar: function(e) {
  40984. return isFinite(e) ? (this.x *= e,
  40985. this.y *= e) : (this.x = 0,
  40986. this.y = 0),
  40987. this
  40988. },
  40989. divide: function(e) {
  40990. return this.x /= e.x,
  40991. this.y /= e.y,
  40992. this
  40993. },
  40994. divideScalar: function(e) {
  40995. return this.multiplyScalar(1 / e)
  40996. },
  40997. min: function(e) {
  40998. return this.x = Math.min(this.x, e.x),
  40999. this.y = Math.min(this.y, e.y),
  41000. this
  41001. },
  41002. max: function(e) {
  41003. return this.x = Math.max(this.x, e.x),
  41004. this.y = Math.max(this.y, e.y),
  41005. this
  41006. },
  41007. clamp: function(e, t) {
  41008. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41009. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41010. this
  41011. },
  41012. clampScalar: function() {
  41013. var e, t;
  41014. return function(i, r) {
  41015. return void 0 === e && (e = new n.Vector2,
  41016. t = new n.Vector2),
  41017. e.set(i, i),
  41018. t.set(r, r),
  41019. this.clamp(e, t)
  41020. }
  41021. }(),
  41022. clampLength: function(e, t) {
  41023. var i = this.length();
  41024. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  41025. this
  41026. },
  41027. floor: function() {
  41028. return this.x = Math.floor(this.x),
  41029. this.y = Math.floor(this.y),
  41030. this
  41031. },
  41032. ceil: function() {
  41033. return this.x = Math.ceil(this.x),
  41034. this.y = Math.ceil(this.y),
  41035. this
  41036. },
  41037. round: function() {
  41038. return this.x = Math.round(this.x),
  41039. this.y = Math.round(this.y),
  41040. this
  41041. },
  41042. roundToZero: function() {
  41043. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41044. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41045. this
  41046. },
  41047. negate: function() {
  41048. return this.x = -this.x,
  41049. this.y = -this.y,
  41050. this
  41051. },
  41052. dot: function(e) {
  41053. return this.x * e.x + this.y * e.y
  41054. },
  41055. lengthSq: function() {
  41056. return this.x * this.x + this.y * this.y
  41057. },
  41058. length: function() {
  41059. return Math.sqrt(this.x * this.x + this.y * this.y)
  41060. },
  41061. lengthManhattan: function() {
  41062. return Math.abs(this.x) + Math.abs(this.y)
  41063. },
  41064. normalize: function() {
  41065. return this.divideScalar(this.length())
  41066. },
  41067. angle: function() {
  41068. var e = Math.atan2(this.y, this.x);
  41069. return e < 0 && (e += 2 * Math.PI),
  41070. e
  41071. },
  41072. distanceTo: function(e) {
  41073. return Math.sqrt(this.distanceToSquared(e))
  41074. },
  41075. distanceToSquared: function(e) {
  41076. var t = this.x - e.x
  41077. , i = this.y - e.y;
  41078. return t * t + i * i
  41079. },
  41080. setLength: function(e) {
  41081. return this.multiplyScalar(e / this.length())
  41082. },
  41083. lerp: function(e, t) {
  41084. return this.x += (e.x - this.x) * t,
  41085. this.y += (e.y - this.y) * t,
  41086. this
  41087. },
  41088. lerpVectors: function(e, t, i) {
  41089. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41090. this
  41091. },
  41092. equals: function(e) {
  41093. return e.x === this.x && e.y === this.y
  41094. },
  41095. fromArray: function(e, t) {
  41096. return void 0 === t && (t = 0),
  41097. this.x = e[t],
  41098. this.y = e[t + 1],
  41099. this
  41100. },
  41101. toArray: function(e, t) {
  41102. return void 0 === e && (e = []),
  41103. void 0 === t && (t = 0),
  41104. e[t] = this.x,
  41105. e[t + 1] = this.y,
  41106. e
  41107. },
  41108. fromAttribute: function(e, t, i) {
  41109. return void 0 === i && (i = 0),
  41110. t = t * e.itemSize + i,
  41111. this.x = e.array[t],
  41112. this.y = e.array[t + 1],
  41113. this
  41114. },
  41115. rotateAround: function(e, t) {
  41116. var i = Math.cos(t)
  41117. , n = Math.sin(t)
  41118. , r = this.x - e.x
  41119. , o = this.y - e.y;
  41120. return this.x = r * i - o * n + e.x,
  41121. this.y = r * n + o * i + e.y,
  41122. this
  41123. }
  41124. },
  41125. n.Vector3 = function(e, t, i) {
  41126. this.x = e || 0,
  41127. this.y = t || 0,
  41128. this.z = i || 0
  41129. }
  41130. ,
  41131. n.Vector3.prototype = {
  41132. constructor: n.Vector3,
  41133. set: function(e, t, i) {
  41134. return this.x = e,
  41135. this.y = t,
  41136. this.z = i,
  41137. this
  41138. },
  41139. setScalar: function(e) {
  41140. return this.x = e,
  41141. this.y = e,
  41142. this.z = e,
  41143. this
  41144. },
  41145. setX: function(e) {
  41146. return this.x = e,
  41147. this
  41148. },
  41149. setY: function(e) {
  41150. return this.y = e,
  41151. this
  41152. },
  41153. setZ: function(e) {
  41154. return this.z = e,
  41155. this
  41156. },
  41157. setComponent: function(e, t) {
  41158. switch (e) {
  41159. case 0:
  41160. this.x = t;
  41161. break;
  41162. case 1:
  41163. this.y = t;
  41164. break;
  41165. case 2:
  41166. this.z = t;
  41167. break;
  41168. default:
  41169. throw new Error("index is out of range: " + e)
  41170. }
  41171. },
  41172. getComponent: function(e) {
  41173. switch (e) {
  41174. case 0:
  41175. return this.x;
  41176. case 1:
  41177. return this.y;
  41178. case 2:
  41179. return this.z;
  41180. default:
  41181. throw new Error("index is out of range: " + e)
  41182. }
  41183. },
  41184. clone: function() {
  41185. return new this.constructor(this.x,this.y,this.z)
  41186. },
  41187. copy: function(e) {
  41188. return this.x = e.x,
  41189. this.y = e.y,
  41190. this.z = e.z,
  41191. this
  41192. },
  41193. add: function(e, t) {
  41194. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41195. this.addVectors(e, t)) : (this.x += e.x,
  41196. this.y += e.y,
  41197. this.z += e.z,
  41198. this)
  41199. },
  41200. addScalar: function(e) {
  41201. return this.x += e,
  41202. this.y += e,
  41203. this.z += e,
  41204. this
  41205. },
  41206. addVectors: function(e, t) {
  41207. return this.x = e.x + t.x,
  41208. this.y = e.y + t.y,
  41209. this.z = e.z + t.z,
  41210. this
  41211. },
  41212. addScaledVector: function(e, t) {
  41213. return this.x += e.x * t,
  41214. this.y += e.y * t,
  41215. this.z += e.z * t,
  41216. this
  41217. },
  41218. sub: function(e, t) {
  41219. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41220. this.subVectors(e, t)) : (this.x -= e.x,
  41221. this.y -= e.y,
  41222. this.z -= e.z,
  41223. this)
  41224. },
  41225. subScalar: function(e) {
  41226. return this.x -= e,
  41227. this.y -= e,
  41228. this.z -= e,
  41229. this
  41230. },
  41231. subVectors: function(e, t) {
  41232. return this.x = e.x - t.x,
  41233. this.y = e.y - t.y,
  41234. this.z = e.z - t.z,
  41235. this
  41236. },
  41237. multiply: function(e, t) {
  41238. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  41239. this.multiplyVectors(e, t)) : (this.x *= e.x,
  41240. this.y *= e.y,
  41241. this.z *= e.z,
  41242. this)
  41243. },
  41244. multiplyScalar: function(e) {
  41245. return isFinite(e) ? (this.x *= e,
  41246. this.y *= e,
  41247. this.z *= e) : (this.x = 0,
  41248. this.y = 0,
  41249. this.z = 0),
  41250. this
  41251. },
  41252. multiplyVectors: function(e, t) {
  41253. return this.x = e.x * t.x,
  41254. this.y = e.y * t.y,
  41255. this.z = e.z * t.z,
  41256. this
  41257. },
  41258. applyEuler: function() {
  41259. var e;
  41260. return function(t) {
  41261. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  41262. void 0 === e && (e = new n.Quaternion),
  41263. this.applyQuaternion(e.setFromEuler(t)),
  41264. this
  41265. }
  41266. }(),
  41267. applyAxisAngle: function() {
  41268. var e;
  41269. return function(t, i) {
  41270. return void 0 === e && (e = new n.Quaternion),
  41271. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  41272. this
  41273. }
  41274. }(),
  41275. applyMatrix3: function(e) {
  41276. var t = this.x
  41277. , i = this.y
  41278. , n = this.z
  41279. , r = e.elements;
  41280. return this.x = r[0] * t + r[3] * i + r[6] * n,
  41281. this.y = r[1] * t + r[4] * i + r[7] * n,
  41282. this.z = r[2] * t + r[5] * i + r[8] * n,
  41283. this
  41284. },
  41285. applyMatrix4: function(e) {
  41286. var t = this.x
  41287. , i = this.y
  41288. , n = this.z
  41289. , r = e.elements;
  41290. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  41291. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  41292. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  41293. this
  41294. },
  41295. applyProjection: function(e) {
  41296. var t = this.x
  41297. , i = this.y
  41298. , n = this.z
  41299. , r = e.elements
  41300. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  41301. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  41302. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  41303. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  41304. this
  41305. },
  41306. applyQuaternion: function(e) {
  41307. var t = this.x
  41308. , i = this.y
  41309. , n = this.z
  41310. , r = e.x
  41311. , o = e.y
  41312. , a = e.z
  41313. , s = e.w
  41314. , l = s * t + o * n - a * i
  41315. , c = s * i + a * t - r * n
  41316. , h = s * n + r * i - o * t
  41317. , u = -r * t - o * i - a * n;
  41318. return this.x = l * s + u * -r + c * -a - h * -o,
  41319. this.y = c * s + u * -o + h * -r - l * -a,
  41320. this.z = h * s + u * -a + l * -o - c * -r,
  41321. this
  41322. },
  41323. project: function() {
  41324. var e;
  41325. return function(t) {
  41326. return void 0 === e && (e = new n.Matrix4),
  41327. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  41328. this.applyProjection(e)
  41329. }
  41330. }(),
  41331. unproject: function() {
  41332. var e;
  41333. return function(t) {
  41334. return void 0 === e && (e = new n.Matrix4),
  41335. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  41336. this.applyProjection(e)
  41337. }
  41338. }(),
  41339. transformDirection: function(e) {
  41340. var t = this.x
  41341. , i = this.y
  41342. , n = this.z
  41343. , r = e.elements;
  41344. return this.x = r[0] * t + r[4] * i + r[8] * n,
  41345. this.y = r[1] * t + r[5] * i + r[9] * n,
  41346. this.z = r[2] * t + r[6] * i + r[10] * n,
  41347. this.normalize(),
  41348. this
  41349. },
  41350. divide: function(e) {
  41351. return this.x /= e.x,
  41352. this.y /= e.y,
  41353. this.z /= e.z,
  41354. this
  41355. },
  41356. divideScalar: function(e) {
  41357. return this.multiplyScalar(1 / e)
  41358. },
  41359. min: function(e) {
  41360. return this.x = Math.min(this.x, e.x),
  41361. this.y = Math.min(this.y, e.y),
  41362. this.z = Math.min(this.z, e.z),
  41363. this
  41364. },
  41365. max: function(e) {
  41366. return this.x = Math.max(this.x, e.x),
  41367. this.y = Math.max(this.y, e.y),
  41368. this.z = Math.max(this.z, e.z),
  41369. this
  41370. },
  41371. clamp: function(e, t) {
  41372. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41373. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41374. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41375. this
  41376. },
  41377. clampScalar: function() {
  41378. var e, t;
  41379. return function(i, r) {
  41380. return void 0 === e && (e = new n.Vector3,
  41381. t = new n.Vector3),
  41382. e.set(i, i, i),
  41383. t.set(r, r, r),
  41384. this.clamp(e, t)
  41385. }
  41386. }(),
  41387. clampLength: function(e, t) {
  41388. var i = this.length();
  41389. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  41390. this
  41391. },
  41392. floor: function() {
  41393. return this.x = Math.floor(this.x),
  41394. this.y = Math.floor(this.y),
  41395. this.z = Math.floor(this.z),
  41396. this
  41397. },
  41398. ceil: function() {
  41399. return this.x = Math.ceil(this.x),
  41400. this.y = Math.ceil(this.y),
  41401. this.z = Math.ceil(this.z),
  41402. this
  41403. },
  41404. round: function() {
  41405. return this.x = Math.round(this.x),
  41406. this.y = Math.round(this.y),
  41407. this.z = Math.round(this.z),
  41408. this
  41409. },
  41410. roundToZero: function() {
  41411. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41412. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41413. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41414. this
  41415. },
  41416. negate: function() {
  41417. return this.x = -this.x,
  41418. this.y = -this.y,
  41419. this.z = -this.z,
  41420. this
  41421. },
  41422. dot: function(e) {
  41423. return this.x * e.x + this.y * e.y + this.z * e.z
  41424. },
  41425. lengthSq: function() {
  41426. return this.x * this.x + this.y * this.y + this.z * this.z
  41427. },
  41428. length: function() {
  41429. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  41430. },
  41431. lengthManhattan: function() {
  41432. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  41433. },
  41434. normalize: function() {
  41435. return this.divideScalar(this.length())
  41436. },
  41437. setLength: function(e) {
  41438. return this.multiplyScalar(e / this.length())
  41439. },
  41440. lerp: function(e, t) {
  41441. return this.x += (e.x - this.x) * t,
  41442. this.y += (e.y - this.y) * t,
  41443. this.z += (e.z - this.z) * t,
  41444. this
  41445. },
  41446. lerpVectors: function(e, t, i) {
  41447. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41448. this
  41449. },
  41450. cross: function(e, t) {
  41451. if (void 0 !== t)
  41452. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  41453. this.crossVectors(e, t);
  41454. var i = this.x
  41455. , n = this.y
  41456. , r = this.z;
  41457. return this.x = n * e.z - r * e.y,
  41458. this.y = r * e.x - i * e.z,
  41459. this.z = i * e.y - n * e.x,
  41460. this
  41461. },
  41462. crossVectors: function(e, t) {
  41463. var i = e.x
  41464. , n = e.y
  41465. , r = e.z
  41466. , o = t.x
  41467. , a = t.y
  41468. , s = t.z;
  41469. return this.x = n * s - r * a,
  41470. this.y = r * o - i * s,
  41471. this.z = i * a - n * o,
  41472. this
  41473. },
  41474. projectOnVector: function() {
  41475. var e, t;
  41476. return function(i) {
  41477. return void 0 === e && (e = new n.Vector3),
  41478. e.copy(i).normalize(),
  41479. t = this.dot(e),
  41480. this.copy(e).multiplyScalar(t)
  41481. }
  41482. }(),
  41483. projectOnPlane: function() {
  41484. var e;
  41485. return function(t) {
  41486. return void 0 === e && (e = new n.Vector3),
  41487. e.copy(this).projectOnVector(t),
  41488. this.sub(e)
  41489. }
  41490. }(),
  41491. reflect: function() {
  41492. var e;
  41493. return function(t) {
  41494. return void 0 === e && (e = new n.Vector3),
  41495. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  41496. }
  41497. }(),
  41498. angleTo: function(e) {
  41499. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  41500. return Math.acos(n.Math.clamp(t, -1, 1))
  41501. },
  41502. distanceTo: function(e) {
  41503. return Math.sqrt(this.distanceToSquared(e))
  41504. },
  41505. distanceToSquared: function(e) {
  41506. var t = this.x - e.x
  41507. , i = this.y - e.y
  41508. , n = this.z - e.z;
  41509. return t * t + i * i + n * n
  41510. },
  41511. setFromSpherical: function(e) {
  41512. var t = Math.sin(e.phi) * e.radius;
  41513. return this.x = t * Math.sin(e.theta),
  41514. this.y = Math.cos(e.phi) * e.radius,
  41515. this.z = t * Math.cos(e.theta),
  41516. this
  41517. },
  41518. setFromMatrixPosition: function(e) {
  41519. return this.setFromMatrixColumn(e, 3)
  41520. },
  41521. setFromMatrixScale: function(e) {
  41522. var t = this.setFromMatrixColumn(e, 0).length()
  41523. , i = this.setFromMatrixColumn(e, 1).length()
  41524. , n = this.setFromMatrixColumn(e, 2).length();
  41525. return this.x = t,
  41526. this.y = i,
  41527. this.z = n,
  41528. this
  41529. },
  41530. setFromMatrixColumn: function(e, t) {
  41531. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  41532. e = arguments[1],
  41533. t = arguments[0]),
  41534. this.fromArray(e.elements, 4 * t)
  41535. },
  41536. equals: function(e) {
  41537. return e.x === this.x && e.y === this.y && e.z === this.z
  41538. },
  41539. fromArray: function(e, t) {
  41540. return void 0 === t && (t = 0),
  41541. this.x = e[t],
  41542. this.y = e[t + 1],
  41543. this.z = e[t + 2],
  41544. this
  41545. },
  41546. toArray: function(e, t) {
  41547. return void 0 === e && (e = []),
  41548. void 0 === t && (t = 0),
  41549. e[t] = this.x,
  41550. e[t + 1] = this.y,
  41551. e[t + 2] = this.z,
  41552. e
  41553. },
  41554. fromAttribute: function(e, t, i) {
  41555. return void 0 === i && (i = 0),
  41556. t = t * e.itemSize + i,
  41557. this.x = e.array[t],
  41558. this.y = e.array[t + 1],
  41559. this.z = e.array[t + 2],
  41560. this
  41561. }
  41562. },
  41563. n.Vector4 = function(e, t, i, n) {
  41564. this.x = e || 0,
  41565. this.y = t || 0,
  41566. this.z = i || 0,
  41567. this.w = void 0 !== n ? n : 1
  41568. }
  41569. ,
  41570. n.Vector4.prototype = {
  41571. constructor: n.Vector4,
  41572. set: function(e, t, i, n) {
  41573. return this.x = e,
  41574. this.y = t,
  41575. this.z = i,
  41576. this.w = n,
  41577. this
  41578. },
  41579. setScalar: function(e) {
  41580. return this.x = e,
  41581. this.y = e,
  41582. this.z = e,
  41583. this.w = e,
  41584. this
  41585. },
  41586. setX: function(e) {
  41587. return this.x = e,
  41588. this
  41589. },
  41590. setY: function(e) {
  41591. return this.y = e,
  41592. this
  41593. },
  41594. setZ: function(e) {
  41595. return this.z = e,
  41596. this
  41597. },
  41598. setW: function(e) {
  41599. return this.w = e,
  41600. this
  41601. },
  41602. setComponent: function(e, t) {
  41603. switch (e) {
  41604. case 0:
  41605. this.x = t;
  41606. break;
  41607. case 1:
  41608. this.y = t;
  41609. break;
  41610. case 2:
  41611. this.z = t;
  41612. break;
  41613. case 3:
  41614. this.w = t;
  41615. break;
  41616. default:
  41617. throw new Error("index is out of range: " + e)
  41618. }
  41619. },
  41620. getComponent: function(e) {
  41621. switch (e) {
  41622. case 0:
  41623. return this.x;
  41624. case 1:
  41625. return this.y;
  41626. case 2:
  41627. return this.z;
  41628. case 3:
  41629. return this.w;
  41630. default:
  41631. throw new Error("index is out of range: " + e)
  41632. }
  41633. },
  41634. clone: function() {
  41635. return new this.constructor(this.x,this.y,this.z,this.w)
  41636. },
  41637. copy: function(e) {
  41638. return this.x = e.x,
  41639. this.y = e.y,
  41640. this.z = e.z,
  41641. this.w = void 0 !== e.w ? e.w : 1,
  41642. this
  41643. },
  41644. add: function(e, t) {
  41645. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41646. this.addVectors(e, t)) : (this.x += e.x,
  41647. this.y += e.y,
  41648. this.z += e.z,
  41649. this.w += e.w,
  41650. this)
  41651. },
  41652. addScalar: function(e) {
  41653. return this.x += e,
  41654. this.y += e,
  41655. this.z += e,
  41656. this.w += e,
  41657. this
  41658. },
  41659. addVectors: function(e, t) {
  41660. return this.x = e.x + t.x,
  41661. this.y = e.y + t.y,
  41662. this.z = e.z + t.z,
  41663. this.w = e.w + t.w,
  41664. this
  41665. },
  41666. addScaledVector: function(e, t) {
  41667. return this.x += e.x * t,
  41668. this.y += e.y * t,
  41669. this.z += e.z * t,
  41670. this.w += e.w * t,
  41671. this
  41672. },
  41673. sub: function(e, t) {
  41674. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41675. this.subVectors(e, t)) : (this.x -= e.x,
  41676. this.y -= e.y,
  41677. this.z -= e.z,
  41678. this.w -= e.w,
  41679. this)
  41680. },
  41681. subScalar: function(e) {
  41682. return this.x -= e,
  41683. this.y -= e,
  41684. this.z -= e,
  41685. this.w -= e,
  41686. this
  41687. },
  41688. subVectors: function(e, t) {
  41689. return this.x = e.x - t.x,
  41690. this.y = e.y - t.y,
  41691. this.z = e.z - t.z,
  41692. this.w = e.w - t.w,
  41693. this
  41694. },
  41695. multiplyScalar: function(e) {
  41696. return isFinite(e) ? (this.x *= e,
  41697. this.y *= e,
  41698. this.z *= e,
  41699. this.w *= e) : (this.x = 0,
  41700. this.y = 0,
  41701. this.z = 0,
  41702. this.w = 0),
  41703. this
  41704. },
  41705. applyMatrix4: function(e) {
  41706. var t = this.x
  41707. , i = this.y
  41708. , n = this.z
  41709. , r = this.w
  41710. , o = e.elements;
  41711. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41712. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41713. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41714. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41715. this
  41716. },
  41717. divideScalar: function(e) {
  41718. return this.multiplyScalar(1 / e)
  41719. },
  41720. setAxisAngleFromQuaternion: function(e) {
  41721. this.w = 2 * Math.acos(e.w);
  41722. var t = Math.sqrt(1 - e.w * e.w);
  41723. return t < 1e-4 ? (this.x = 1,
  41724. this.y = 0,
  41725. this.z = 0) : (this.x = e.x / t,
  41726. this.y = e.y / t,
  41727. this.z = e.z / t),
  41728. this
  41729. },
  41730. setAxisAngleFromRotationMatrix: function(e) {
  41731. 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];
  41732. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41733. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41734. return this.set(1, 0, 0, 0),
  41735. this;
  41736. t = Math.PI;
  41737. var v = (l + 1) / 2
  41738. , A = (d + 1) / 2
  41739. , y = (m + 1) / 2
  41740. , C = (c + u) / 4
  41741. , I = (h + f) / 4
  41742. , E = (p + g) / 4;
  41743. return v > A && v > y ? v < o ? (i = 0,
  41744. n = .707106781,
  41745. r = .707106781) : (i = Math.sqrt(v),
  41746. n = C / i,
  41747. r = I / i) : A > y ? A < o ? (i = .707106781,
  41748. n = 0,
  41749. r = .707106781) : (n = Math.sqrt(A),
  41750. i = C / n,
  41751. r = E / n) : y < o ? (i = .707106781,
  41752. n = .707106781,
  41753. r = 0) : (r = Math.sqrt(y),
  41754. i = I / r,
  41755. n = E / r),
  41756. this.set(i, n, r, t),
  41757. this
  41758. }
  41759. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41760. return Math.abs(b) < .001 && (b = 1),
  41761. this.x = (g - p) / b,
  41762. this.y = (h - f) / b,
  41763. this.z = (u - c) / b,
  41764. this.w = Math.acos((l + d + m - 1) / 2),
  41765. this
  41766. },
  41767. min: function(e) {
  41768. return this.x = Math.min(this.x, e.x),
  41769. this.y = Math.min(this.y, e.y),
  41770. this.z = Math.min(this.z, e.z),
  41771. this.w = Math.min(this.w, e.w),
  41772. this
  41773. },
  41774. max: function(e) {
  41775. return this.x = Math.max(this.x, e.x),
  41776. this.y = Math.max(this.y, e.y),
  41777. this.z = Math.max(this.z, e.z),
  41778. this.w = Math.max(this.w, e.w),
  41779. this
  41780. },
  41781. clamp: function(e, t) {
  41782. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41783. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41784. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41785. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41786. this
  41787. },
  41788. clampScalar: function() {
  41789. var e, t;
  41790. return function(i, r) {
  41791. return void 0 === e && (e = new n.Vector4,
  41792. t = new n.Vector4),
  41793. e.set(i, i, i, i),
  41794. t.set(r, r, r, r),
  41795. this.clamp(e, t)
  41796. }
  41797. }(),
  41798. floor: function() {
  41799. return this.x = Math.floor(this.x),
  41800. this.y = Math.floor(this.y),
  41801. this.z = Math.floor(this.z),
  41802. this.w = Math.floor(this.w),
  41803. this
  41804. },
  41805. ceil: function() {
  41806. return this.x = Math.ceil(this.x),
  41807. this.y = Math.ceil(this.y),
  41808. this.z = Math.ceil(this.z),
  41809. this.w = Math.ceil(this.w),
  41810. this
  41811. },
  41812. round: function() {
  41813. return this.x = Math.round(this.x),
  41814. this.y = Math.round(this.y),
  41815. this.z = Math.round(this.z),
  41816. this.w = Math.round(this.w),
  41817. this
  41818. },
  41819. roundToZero: function() {
  41820. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41821. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41822. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41823. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41824. this
  41825. },
  41826. negate: function() {
  41827. return this.x = -this.x,
  41828. this.y = -this.y,
  41829. this.z = -this.z,
  41830. this.w = -this.w,
  41831. this
  41832. },
  41833. dot: function(e) {
  41834. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41835. },
  41836. lengthSq: function() {
  41837. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41838. },
  41839. length: function() {
  41840. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41841. },
  41842. lengthManhattan: function() {
  41843. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41844. },
  41845. normalize: function() {
  41846. return this.divideScalar(this.length())
  41847. },
  41848. setLength: function(e) {
  41849. return this.multiplyScalar(e / this.length())
  41850. },
  41851. lerp: function(e, t) {
  41852. return this.x += (e.x - this.x) * t,
  41853. this.y += (e.y - this.y) * t,
  41854. this.z += (e.z - this.z) * t,
  41855. this.w += (e.w - this.w) * t,
  41856. this
  41857. },
  41858. lerpVectors: function(e, t, i) {
  41859. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41860. this
  41861. },
  41862. equals: function(e) {
  41863. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41864. },
  41865. fromArray: function(e, t) {
  41866. return void 0 === t && (t = 0),
  41867. this.x = e[t],
  41868. this.y = e[t + 1],
  41869. this.z = e[t + 2],
  41870. this.w = e[t + 3],
  41871. this
  41872. },
  41873. toArray: function(e, t) {
  41874. return void 0 === e && (e = []),
  41875. void 0 === t && (t = 0),
  41876. e[t] = this.x,
  41877. e[t + 1] = this.y,
  41878. e[t + 2] = this.z,
  41879. e[t + 3] = this.w,
  41880. e
  41881. },
  41882. fromAttribute: function(e, t, i) {
  41883. return void 0 === i && (i = 0),
  41884. t = t * e.itemSize + i,
  41885. this.x = e.array[t],
  41886. this.y = e.array[t + 1],
  41887. this.z = e.array[t + 2],
  41888. this.w = e.array[t + 3],
  41889. this
  41890. }
  41891. },
  41892. n.Euler = function(e, t, i, r) {
  41893. this._x = e || 0,
  41894. this._y = t || 0,
  41895. this._z = i || 0,
  41896. this._order = r || n.Euler.DefaultOrder
  41897. }
  41898. ,
  41899. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41900. n.Euler.DefaultOrder = "XYZ",
  41901. n.Euler.prototype = {
  41902. constructor: n.Euler,
  41903. get x() {
  41904. return this._x
  41905. },
  41906. set x(e) {
  41907. this._x = e,
  41908. this.onChangeCallback()
  41909. },
  41910. get y() {
  41911. return this._y
  41912. },
  41913. set y(e) {
  41914. this._y = e,
  41915. this.onChangeCallback()
  41916. },
  41917. get z() {
  41918. return this._z
  41919. },
  41920. set z(e) {
  41921. this._z = e,
  41922. this.onChangeCallback()
  41923. },
  41924. get order() {
  41925. return this._order
  41926. },
  41927. set order(e) {
  41928. this._order = e,
  41929. this.onChangeCallback()
  41930. },
  41931. set: function(e, t, i, n) {
  41932. return this._x = e,
  41933. this._y = t,
  41934. this._z = i,
  41935. this._order = n || this._order,
  41936. this.onChangeCallback(),
  41937. this
  41938. },
  41939. clone: function() {
  41940. return new this.constructor(this._x,this._y,this._z,this._order)
  41941. },
  41942. copy: function(e) {
  41943. return this._x = e._x,
  41944. this._y = e._y,
  41945. this._z = e._z,
  41946. this._order = e._order,
  41947. this.onChangeCallback(),
  41948. this
  41949. },
  41950. setFromRotationMatrix: function(e, t, i) {
  41951. var r = n.Math.clamp
  41952. , o = e.elements
  41953. , a = o[0]
  41954. , s = o[4]
  41955. , l = o[8]
  41956. , c = o[1]
  41957. , h = o[5]
  41958. , u = o[9]
  41959. , d = o[2]
  41960. , p = o[6]
  41961. , f = o[10];
  41962. return t = t || this._order,
  41963. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41964. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41965. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41966. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41967. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41968. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41969. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41970. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41971. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41972. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41973. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41974. this._z = Math.atan2(c, a)) : (this._x = 0,
  41975. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41976. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41977. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41978. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41979. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41980. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41981. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41982. this._order = t,
  41983. i !== !1 && this.onChangeCallback(),
  41984. this
  41985. },
  41986. setFromQuaternion: function() {
  41987. var e;
  41988. return function(t, i, r) {
  41989. return void 0 === e && (e = new n.Matrix4),
  41990. e.makeRotationFromQuaternion(t),
  41991. this.setFromRotationMatrix(e, i, r),
  41992. this
  41993. }
  41994. }(),
  41995. setFromVector3: function(e, t) {
  41996. return this.set(e.x, e.y, e.z, t || this._order)
  41997. },
  41998. reorder: function() {
  41999. var e = new n.Quaternion;
  42000. return function(t) {
  42001. e.setFromEuler(this),
  42002. this.setFromQuaternion(e, t)
  42003. }
  42004. }(),
  42005. equals: function(e) {
  42006. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  42007. },
  42008. fromArray: function(e) {
  42009. return this._x = e[0],
  42010. this._y = e[1],
  42011. this._z = e[2],
  42012. void 0 !== e[3] && (this._order = e[3]),
  42013. this.onChangeCallback(),
  42014. this
  42015. },
  42016. toArray: function(e, t) {
  42017. return void 0 === e && (e = []),
  42018. void 0 === t && (t = 0),
  42019. e[t] = this._x,
  42020. e[t + 1] = this._y,
  42021. e[t + 2] = this._z,
  42022. e[t + 3] = this._order,
  42023. e
  42024. },
  42025. toVector3: function(e) {
  42026. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  42027. },
  42028. onChange: function(e) {
  42029. return this.onChangeCallback = e,
  42030. this
  42031. },
  42032. onChangeCallback: function() {}
  42033. },
  42034. n.Line3 = function(e, t) {
  42035. this.start = void 0 !== e ? e : new n.Vector3,
  42036. this.end = void 0 !== t ? t : new n.Vector3
  42037. }
  42038. ,
  42039. n.Line3.prototype = {
  42040. constructor: n.Line3,
  42041. set: function(e, t) {
  42042. return this.start.copy(e),
  42043. this.end.copy(t),
  42044. this
  42045. },
  42046. clone: function() {
  42047. return (new this.constructor).copy(this)
  42048. },
  42049. copy: function(e) {
  42050. return this.start.copy(e.start),
  42051. this.end.copy(e.end),
  42052. this
  42053. },
  42054. center: function(e) {
  42055. var t = e || new n.Vector3;
  42056. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  42057. },
  42058. delta: function(e) {
  42059. var t = e || new n.Vector3;
  42060. return t.subVectors(this.end, this.start)
  42061. },
  42062. distanceSq: function() {
  42063. return this.start.distanceToSquared(this.end)
  42064. },
  42065. distance: function() {
  42066. return this.start.distanceTo(this.end)
  42067. },
  42068. at: function(e, t) {
  42069. var i = t || new n.Vector3;
  42070. return this.delta(i).multiplyScalar(e).add(this.start)
  42071. },
  42072. closestPointToPointParameter: function() {
  42073. var e = new n.Vector3
  42074. , t = new n.Vector3;
  42075. return function(i, r) {
  42076. e.subVectors(i, this.start),
  42077. t.subVectors(this.end, this.start);
  42078. var o = t.dot(t)
  42079. , a = t.dot(e)
  42080. , s = a / o;
  42081. return r && (s = n.Math.clamp(s, 0, 1)),
  42082. s
  42083. }
  42084. }(),
  42085. closestPointToPoint: function(e, t, i) {
  42086. var r = this.closestPointToPointParameter(e, t)
  42087. , o = i || new n.Vector3;
  42088. return this.delta(o).multiplyScalar(r).add(this.start)
  42089. },
  42090. applyMatrix4: function(e) {
  42091. return this.start.applyMatrix4(e),
  42092. this.end.applyMatrix4(e),
  42093. this
  42094. },
  42095. equals: function(e) {
  42096. return e.start.equals(this.start) && e.end.equals(this.end)
  42097. }
  42098. },
  42099. n.Box2 = function(e, t) {
  42100. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  42101. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  42102. }
  42103. ,
  42104. n.Box2.prototype = {
  42105. constructor: n.Box2,
  42106. set: function(e, t) {
  42107. return this.min.copy(e),
  42108. this.max.copy(t),
  42109. this
  42110. },
  42111. setFromPoints: function(e) {
  42112. this.makeEmpty();
  42113. for (var t = 0, i = e.length; t < i; t++)
  42114. this.expandByPoint(e[t]);
  42115. return this
  42116. },
  42117. setFromCenterAndSize: function() {
  42118. var e = new n.Vector2;
  42119. return function(t, i) {
  42120. var n = e.copy(i).multiplyScalar(.5);
  42121. return this.min.copy(t).sub(n),
  42122. this.max.copy(t).add(n),
  42123. this
  42124. }
  42125. }(),
  42126. clone: function() {
  42127. return (new this.constructor).copy(this)
  42128. },
  42129. copy: function(e) {
  42130. return this.min.copy(e.min),
  42131. this.max.copy(e.max),
  42132. this
  42133. },
  42134. makeEmpty: function() {
  42135. return this.min.x = this.min.y = +(1 / 0),
  42136. this.max.x = this.max.y = -(1 / 0),
  42137. this
  42138. },
  42139. isEmpty: function() {
  42140. return this.max.x < this.min.x || this.max.y < this.min.y
  42141. },
  42142. center: function(e) {
  42143. var t = e || new n.Vector2;
  42144. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  42145. },
  42146. size: function(e) {
  42147. var t = e || new n.Vector2;
  42148. return t.subVectors(this.max, this.min)
  42149. },
  42150. expandByPoint: function(e) {
  42151. return this.min.min(e),
  42152. this.max.max(e),
  42153. this
  42154. },
  42155. expandByVector: function(e) {
  42156. return this.min.sub(e),
  42157. this.max.add(e),
  42158. this
  42159. },
  42160. expandByScalar: function(e) {
  42161. return this.min.addScalar(-e),
  42162. this.max.addScalar(e),
  42163. this
  42164. },
  42165. containsPoint: function(e) {
  42166. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  42167. },
  42168. containsBox: function(e) {
  42169. 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
  42170. },
  42171. getParameter: function(e, t) {
  42172. var i = t || new n.Vector2;
  42173. 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))
  42174. },
  42175. intersectsBox: function(e) {
  42176. 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)
  42177. },
  42178. clampPoint: function(e, t) {
  42179. var i = t || new n.Vector2;
  42180. return i.copy(e).clamp(this.min, this.max)
  42181. },
  42182. distanceToPoint: function() {
  42183. var e = new n.Vector2;
  42184. return function(t) {
  42185. var i = e.copy(t).clamp(this.min, this.max);
  42186. return i.sub(t).length()
  42187. }
  42188. }(),
  42189. intersect: function(e) {
  42190. return this.min.max(e.min),
  42191. this.max.min(e.max),
  42192. this
  42193. },
  42194. union: function(e) {
  42195. return this.min.min(e.min),
  42196. this.max.max(e.max),
  42197. this
  42198. },
  42199. translate: function(e) {
  42200. return this.min.add(e),
  42201. this.max.add(e),
  42202. this
  42203. },
  42204. equals: function(e) {
  42205. return e.min.equals(this.min) && e.max.equals(this.max)
  42206. }
  42207. },
  42208. n.Box3 = function(e, t) {
  42209. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  42210. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  42211. }
  42212. ,
  42213. n.Box3.prototype = {
  42214. constructor: n.Box3,
  42215. set: function(e, t) {
  42216. return this.min.copy(e),
  42217. this.max.copy(t),
  42218. this
  42219. },
  42220. setFromArray: function(e) {
  42221. this.makeEmpty();
  42222. 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) {
  42223. var c = e[s]
  42224. , h = e[s + 1]
  42225. , u = e[s + 2];
  42226. c < t && (t = c),
  42227. h < i && (i = h),
  42228. u < n && (n = u),
  42229. c > r && (r = c),
  42230. h > o && (o = h),
  42231. u > a && (a = u)
  42232. }
  42233. this.min.set(t, i, n),
  42234. this.max.set(r, o, a)
  42235. },
  42236. setFromPoints: function(e) {
  42237. this.makeEmpty();
  42238. for (var t = 0, i = e.length; t < i; t++)
  42239. this.expandByPoint(e[t]);
  42240. return this
  42241. },
  42242. setFromCenterAndSize: function() {
  42243. var e = new n.Vector3;
  42244. return function(t, i) {
  42245. var n = e.copy(i).multiplyScalar(.5);
  42246. return this.min.copy(t).sub(n),
  42247. this.max.copy(t).add(n),
  42248. this
  42249. }
  42250. }(),
  42251. setFromObject: function() {
  42252. var e;
  42253. return function(t) {
  42254. void 0 === e && (e = new n.Box3);
  42255. var i = this;
  42256. return this.makeEmpty(),
  42257. t.updateMatrixWorld(!0),
  42258. t.traverse(function(t) {
  42259. var n = t.geometry;
  42260. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  42261. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  42262. e.applyMatrix4(t.matrixWorld),
  42263. i.union(e)))
  42264. }),
  42265. this
  42266. }
  42267. }(),
  42268. clone: function() {
  42269. return (new this.constructor).copy(this)
  42270. },
  42271. copy: function(e) {
  42272. return this.min.copy(e.min),
  42273. this.max.copy(e.max),
  42274. this
  42275. },
  42276. makeEmpty: function() {
  42277. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  42278. this.max.x = this.max.y = this.max.z = -(1 / 0),
  42279. this
  42280. },
  42281. isEmpty: function() {
  42282. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  42283. },
  42284. center: function(e) {
  42285. var t = e || new n.Vector3;
  42286. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  42287. },
  42288. size: function(e) {
  42289. var t = e || new n.Vector3;
  42290. return t.subVectors(this.max, this.min)
  42291. },
  42292. expandByPoint: function(e) {
  42293. return this.min.min(e),
  42294. this.max.max(e),
  42295. this
  42296. },
  42297. expandByVector: function(e) {
  42298. return this.min.sub(e),
  42299. this.max.add(e),
  42300. this
  42301. },
  42302. expandByScalar: function(e) {
  42303. return this.min.addScalar(-e),
  42304. this.max.addScalar(e),
  42305. this
  42306. },
  42307. containsPoint: function(e) {
  42308. 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)
  42309. },
  42310. containsBox: function(e) {
  42311. 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
  42312. },
  42313. getParameter: function(e, t) {
  42314. var i = t || new n.Vector3;
  42315. 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))
  42316. },
  42317. intersectsBox: function(e) {
  42318. 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)
  42319. },
  42320. intersectsSphere: function() {
  42321. var e;
  42322. return function(t) {
  42323. return void 0 === e && (e = new n.Vector3),
  42324. this.clampPoint(t.center, e),
  42325. e.distanceToSquared(t.center) <= t.radius * t.radius
  42326. }
  42327. }(),
  42328. intersectsPlane: function(e) {
  42329. var t, i;
  42330. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  42331. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  42332. i = e.normal.x * this.min.x),
  42333. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  42334. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  42335. i += e.normal.y * this.min.y),
  42336. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  42337. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  42338. i += e.normal.z * this.min.z),
  42339. t <= e.constant && i >= e.constant
  42340. },
  42341. clampPoint: function(e, t) {
  42342. var i = t || new n.Vector3;
  42343. return i.copy(e).clamp(this.min, this.max)
  42344. },
  42345. distanceToPoint: function() {
  42346. var e = new n.Vector3;
  42347. return function(t) {
  42348. var i = e.copy(t).clamp(this.min, this.max);
  42349. return i.sub(t).length()
  42350. }
  42351. }(),
  42352. getBoundingSphere: function() {
  42353. var e = new n.Vector3;
  42354. return function(t) {
  42355. var i = t || new n.Sphere;
  42356. return i.center = this.center(),
  42357. i.radius = .5 * this.size(e).length(),
  42358. i
  42359. }
  42360. }(),
  42361. intersect: function(e) {
  42362. return this.min.max(e.min),
  42363. this.max.min(e.max),
  42364. this
  42365. },
  42366. union: function(e) {
  42367. return this.min.min(e.min),
  42368. this.max.max(e.max),
  42369. this
  42370. },
  42371. applyMatrix4: function() {
  42372. 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];
  42373. return function(t) {
  42374. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  42375. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  42376. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  42377. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  42378. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  42379. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  42380. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  42381. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  42382. this.makeEmpty(),
  42383. this.setFromPoints(e),
  42384. this
  42385. }
  42386. }(),
  42387. translate: function(e) {
  42388. return this.min.add(e),
  42389. this.max.add(e),
  42390. this
  42391. },
  42392. equals: function(e) {
  42393. return e.min.equals(this.min) && e.max.equals(this.max)
  42394. }
  42395. },
  42396. n.Matrix3 = function() {
  42397. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  42398. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  42399. }
  42400. ,
  42401. n.Matrix3.prototype = {
  42402. constructor: n.Matrix3,
  42403. set: function(e, t, i, n, r, o, a, s, l) {
  42404. var c = this.elements;
  42405. return c[0] = e,
  42406. c[1] = n,
  42407. c[2] = a,
  42408. c[3] = t,
  42409. c[4] = r,
  42410. c[5] = s,
  42411. c[6] = i,
  42412. c[7] = o,
  42413. c[8] = l,
  42414. this
  42415. },
  42416. identity: function() {
  42417. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  42418. this
  42419. },
  42420. clone: function() {
  42421. return (new this.constructor).fromArray(this.elements)
  42422. },
  42423. copy: function(e) {
  42424. var t = e.elements;
  42425. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  42426. this
  42427. },
  42428. setFromMatrix4: function(e) {
  42429. var t = e.elements;
  42430. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  42431. this
  42432. },
  42433. applyToVector3Array: function() {
  42434. var e;
  42435. return function(t, i, r) {
  42436. void 0 === e && (e = new n.Vector3),
  42437. void 0 === i && (i = 0),
  42438. void 0 === r && (r = t.length);
  42439. for (var o = 0, a = i; o < r; o += 3,
  42440. a += 3)
  42441. e.fromArray(t, a),
  42442. e.applyMatrix3(this),
  42443. e.toArray(t, a);
  42444. return t
  42445. }
  42446. }(),
  42447. applyToBuffer: function() {
  42448. var e;
  42449. return function(t, i, r) {
  42450. void 0 === e && (e = new n.Vector3),
  42451. void 0 === i && (i = 0),
  42452. void 0 === r && (r = t.length / t.itemSize);
  42453. for (var o = 0, a = i; o < r; o++,
  42454. a++)
  42455. e.x = t.getX(a),
  42456. e.y = t.getY(a),
  42457. e.z = t.getZ(a),
  42458. e.applyMatrix3(this),
  42459. t.setXYZ(e.x, e.y, e.z);
  42460. return t
  42461. }
  42462. }(),
  42463. multiplyScalar: function(e) {
  42464. var t = this.elements;
  42465. return t[0] *= e,
  42466. t[3] *= e,
  42467. t[6] *= e,
  42468. t[1] *= e,
  42469. t[4] *= e,
  42470. t[7] *= e,
  42471. t[2] *= e,
  42472. t[5] *= e,
  42473. t[8] *= e,
  42474. this
  42475. },
  42476. determinant: function() {
  42477. var e = this.elements
  42478. , t = e[0]
  42479. , i = e[1]
  42480. , n = e[2]
  42481. , r = e[3]
  42482. , o = e[4]
  42483. , a = e[5]
  42484. , s = e[6]
  42485. , l = e[7]
  42486. , c = e[8];
  42487. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  42488. },
  42489. getInverse: function(e, t) {
  42490. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  42491. var i = e.elements
  42492. , r = this.elements
  42493. , o = i[0]
  42494. , a = i[1]
  42495. , s = i[2]
  42496. , l = i[3]
  42497. , c = i[4]
  42498. , h = i[5]
  42499. , u = i[6]
  42500. , d = i[7]
  42501. , p = i[8]
  42502. , f = p * c - h * d
  42503. , g = h * u - p * l
  42504. , m = d * l - c * u
  42505. , v = o * f + a * g + s * m;
  42506. if (0 === v) {
  42507. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  42508. if (t)
  42509. throw new Error(A);
  42510. return console.warn(A),
  42511. this.identity()
  42512. }
  42513. return r[0] = f,
  42514. r[1] = s * d - p * a,
  42515. r[2] = h * a - s * c,
  42516. r[3] = g,
  42517. r[4] = p * o - s * u,
  42518. r[5] = s * l - h * o,
  42519. r[6] = m,
  42520. r[7] = a * u - d * o,
  42521. r[8] = c * o - a * l,
  42522. this.multiplyScalar(1 / v)
  42523. },
  42524. transpose: function() {
  42525. var e, t = this.elements;
  42526. return e = t[1],
  42527. t[1] = t[3],
  42528. t[3] = e,
  42529. e = t[2],
  42530. t[2] = t[6],
  42531. t[6] = e,
  42532. e = t[5],
  42533. t[5] = t[7],
  42534. t[7] = e,
  42535. this
  42536. },
  42537. flattenToArrayOffset: function(e, t) {
  42538. var i = this.elements;
  42539. return e[t] = i[0],
  42540. e[t + 1] = i[1],
  42541. e[t + 2] = i[2],
  42542. e[t + 3] = i[3],
  42543. e[t + 4] = i[4],
  42544. e[t + 5] = i[5],
  42545. e[t + 6] = i[6],
  42546. e[t + 7] = i[7],
  42547. e[t + 8] = i[8],
  42548. e
  42549. },
  42550. getNormalMatrix: function(e) {
  42551. return this.setFromMatrix4(e).getInverse(this).transpose()
  42552. },
  42553. transposeIntoArray: function(e) {
  42554. var t = this.elements;
  42555. return e[0] = t[0],
  42556. e[1] = t[3],
  42557. e[2] = t[6],
  42558. e[3] = t[1],
  42559. e[4] = t[4],
  42560. e[5] = t[7],
  42561. e[6] = t[2],
  42562. e[7] = t[5],
  42563. e[8] = t[8],
  42564. this
  42565. },
  42566. fromArray: function(e) {
  42567. return this.elements.set(e),
  42568. this
  42569. },
  42570. toArray: function() {
  42571. var e = this.elements;
  42572. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  42573. }
  42574. },
  42575. n.Matrix4 = function() {
  42576. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  42577. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  42578. }
  42579. ,
  42580. n.Matrix4.prototype = {
  42581. constructor: n.Matrix4,
  42582. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  42583. var m = this.elements;
  42584. return m[0] = e,
  42585. m[4] = t,
  42586. m[8] = i,
  42587. m[12] = n,
  42588. m[1] = r,
  42589. m[5] = o,
  42590. m[9] = a,
  42591. m[13] = s,
  42592. m[2] = l,
  42593. m[6] = c,
  42594. m[10] = h,
  42595. m[14] = u,
  42596. m[3] = d,
  42597. m[7] = p,
  42598. m[11] = f,
  42599. m[15] = g,
  42600. this
  42601. },
  42602. identity: function() {
  42603. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42604. this
  42605. },
  42606. clone: function() {
  42607. return (new n.Matrix4).fromArray(this.elements)
  42608. },
  42609. copy: function(e) {
  42610. return this.elements.set(e.elements),
  42611. this
  42612. },
  42613. copyPosition: function(e) {
  42614. var t = this.elements
  42615. , i = e.elements;
  42616. return t[12] = i[12],
  42617. t[13] = i[13],
  42618. t[14] = i[14],
  42619. this
  42620. },
  42621. extractBasis: function(e, t, i) {
  42622. return e.setFromMatrixColumn(this, 0),
  42623. t.setFromMatrixColumn(this, 1),
  42624. i.setFromMatrixColumn(this, 2),
  42625. this
  42626. },
  42627. makeBasis: function(e, t, i) {
  42628. 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),
  42629. this
  42630. },
  42631. extractRotation: function() {
  42632. var e;
  42633. return function(t) {
  42634. void 0 === e && (e = new n.Vector3);
  42635. var i = this.elements
  42636. , r = t.elements
  42637. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  42638. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  42639. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  42640. return i[0] = r[0] * o,
  42641. i[1] = r[1] * o,
  42642. i[2] = r[2] * o,
  42643. i[4] = r[4] * a,
  42644. i[5] = r[5] * a,
  42645. i[6] = r[6] * a,
  42646. i[8] = r[8] * s,
  42647. i[9] = r[9] * s,
  42648. i[10] = r[10] * s,
  42649. this
  42650. }
  42651. }(),
  42652. makeRotationFromEuler: function(e) {
  42653. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  42654. var t = this.elements
  42655. , i = e.x
  42656. , r = e.y
  42657. , o = e.z
  42658. , a = Math.cos(i)
  42659. , s = Math.sin(i)
  42660. , l = Math.cos(r)
  42661. , c = Math.sin(r)
  42662. , h = Math.cos(o)
  42663. , u = Math.sin(o);
  42664. if ("XYZ" === e.order) {
  42665. var d = a * h
  42666. , p = a * u
  42667. , f = s * h
  42668. , g = s * u;
  42669. t[0] = l * h,
  42670. t[4] = -l * u,
  42671. t[8] = c,
  42672. t[1] = p + f * c,
  42673. t[5] = d - g * c,
  42674. t[9] = -s * l,
  42675. t[2] = g - d * c,
  42676. t[6] = f + p * c,
  42677. t[10] = a * l
  42678. } else if ("YXZ" === e.order) {
  42679. var m = l * h
  42680. , v = l * u
  42681. , A = c * h
  42682. , y = c * u;
  42683. t[0] = m + y * s,
  42684. t[4] = A * s - v,
  42685. t[8] = a * c,
  42686. t[1] = a * u,
  42687. t[5] = a * h,
  42688. t[9] = -s,
  42689. t[2] = v * s - A,
  42690. t[6] = y + m * s,
  42691. t[10] = a * l
  42692. } else if ("ZXY" === e.order) {
  42693. var m = l * h
  42694. , v = l * u
  42695. , A = c * h
  42696. , y = c * u;
  42697. t[0] = m - y * s,
  42698. t[4] = -a * u,
  42699. t[8] = A + v * s,
  42700. t[1] = v + A * s,
  42701. t[5] = a * h,
  42702. t[9] = y - m * s,
  42703. t[2] = -a * c,
  42704. t[6] = s,
  42705. t[10] = a * l
  42706. } else if ("ZYX" === e.order) {
  42707. var d = a * h
  42708. , p = a * u
  42709. , f = s * h
  42710. , g = s * u;
  42711. t[0] = l * h,
  42712. t[4] = f * c - p,
  42713. t[8] = d * c + g,
  42714. t[1] = l * u,
  42715. t[5] = g * c + d,
  42716. t[9] = p * c - f,
  42717. t[2] = -c,
  42718. t[6] = s * l,
  42719. t[10] = a * l
  42720. } else if ("YZX" === e.order) {
  42721. var C = a * l
  42722. , I = a * c
  42723. , E = s * l
  42724. , b = s * c;
  42725. t[0] = l * h,
  42726. t[4] = b - C * u,
  42727. t[8] = E * u + I,
  42728. t[1] = u,
  42729. t[5] = a * h,
  42730. t[9] = -s * h,
  42731. t[2] = -c * h,
  42732. t[6] = I * u + E,
  42733. t[10] = C - b * u
  42734. } else if ("XZY" === e.order) {
  42735. var C = a * l
  42736. , I = a * c
  42737. , E = s * l
  42738. , b = s * c;
  42739. t[0] = l * h,
  42740. t[4] = -u,
  42741. t[8] = c * h,
  42742. t[1] = C * u + b,
  42743. t[5] = a * h,
  42744. t[9] = I * u - E,
  42745. t[2] = E * u - I,
  42746. t[6] = s * h,
  42747. t[10] = b * u + C
  42748. }
  42749. return t[3] = 0,
  42750. t[7] = 0,
  42751. t[11] = 0,
  42752. t[12] = 0,
  42753. t[13] = 0,
  42754. t[14] = 0,
  42755. t[15] = 1,
  42756. this
  42757. },
  42758. makeRotationFromQuaternion: function(e) {
  42759. var t = this.elements
  42760. , i = e.x
  42761. , n = e.y
  42762. , r = e.z
  42763. , o = e.w
  42764. , a = i + i
  42765. , s = n + n
  42766. , l = r + r
  42767. , c = i * a
  42768. , h = i * s
  42769. , u = i * l
  42770. , d = n * s
  42771. , p = n * l
  42772. , f = r * l
  42773. , g = o * a
  42774. , m = o * s
  42775. , v = o * l;
  42776. return t[0] = 1 - (d + f),
  42777. t[4] = h - v,
  42778. t[8] = u + m,
  42779. t[1] = h + v,
  42780. t[5] = 1 - (c + f),
  42781. t[9] = p - g,
  42782. t[2] = u - m,
  42783. t[6] = p + g,
  42784. t[10] = 1 - (c + d),
  42785. t[3] = 0,
  42786. t[7] = 0,
  42787. t[11] = 0,
  42788. t[12] = 0,
  42789. t[13] = 0,
  42790. t[14] = 0,
  42791. t[15] = 1,
  42792. this
  42793. },
  42794. lookAt: function() {
  42795. var e, t, i;
  42796. return function(r, o, a) {
  42797. void 0 === e && (e = new n.Vector3),
  42798. void 0 === t && (t = new n.Vector3),
  42799. void 0 === i && (i = new n.Vector3);
  42800. var s = this.elements;
  42801. return i.subVectors(r, o).normalize(),
  42802. 0 === i.lengthSq() && (i.z = 1),
  42803. e.crossVectors(a, i).normalize(),
  42804. 0 === e.lengthSq() && (i.x += 1e-4,
  42805. e.crossVectors(a, i).normalize()),
  42806. t.crossVectors(i, e),
  42807. s[0] = e.x,
  42808. s[4] = t.x,
  42809. s[8] = i.x,
  42810. s[1] = e.y,
  42811. s[5] = t.y,
  42812. s[9] = i.y,
  42813. s[2] = e.z,
  42814. s[6] = t.z,
  42815. s[10] = i.z,
  42816. this
  42817. }
  42818. }(),
  42819. multiply: function(e, t) {
  42820. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42821. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42822. },
  42823. multiplyMatrices: function(e, t) {
  42824. var i = e.elements
  42825. , n = t.elements
  42826. , r = this.elements
  42827. , o = i[0]
  42828. , a = i[4]
  42829. , s = i[8]
  42830. , l = i[12]
  42831. , c = i[1]
  42832. , h = i[5]
  42833. , u = i[9]
  42834. , d = i[13]
  42835. , p = i[2]
  42836. , f = i[6]
  42837. , g = i[10]
  42838. , m = i[14]
  42839. , v = i[3]
  42840. , A = i[7]
  42841. , y = i[11]
  42842. , C = i[15]
  42843. , I = n[0]
  42844. , E = n[4]
  42845. , b = n[8]
  42846. , w = n[12]
  42847. , _ = n[1]
  42848. , T = n[5]
  42849. , x = n[9]
  42850. , S = n[13]
  42851. , M = n[2]
  42852. , R = n[6]
  42853. , P = n[10]
  42854. , O = n[14]
  42855. , L = n[3]
  42856. , D = n[7]
  42857. , N = n[11]
  42858. , B = n[15];
  42859. return r[0] = o * I + a * _ + s * M + l * L,
  42860. r[4] = o * E + a * T + s * R + l * D,
  42861. r[8] = o * b + a * x + s * P + l * N,
  42862. r[12] = o * w + a * S + s * O + l * B,
  42863. r[1] = c * I + h * _ + u * M + d * L,
  42864. r[5] = c * E + h * T + u * R + d * D,
  42865. r[9] = c * b + h * x + u * P + d * N,
  42866. r[13] = c * w + h * S + u * O + d * B,
  42867. r[2] = p * I + f * _ + g * M + m * L,
  42868. r[6] = p * E + f * T + g * R + m * D,
  42869. r[10] = p * b + f * x + g * P + m * N,
  42870. r[14] = p * w + f * S + g * O + m * B,
  42871. r[3] = v * I + A * _ + y * M + C * L,
  42872. r[7] = v * E + A * T + y * R + C * D,
  42873. r[11] = v * b + A * x + y * P + C * N,
  42874. r[15] = v * w + A * S + y * O + C * B,
  42875. this
  42876. },
  42877. multiplyToArray: function(e, t, i) {
  42878. var n = this.elements;
  42879. return this.multiplyMatrices(e, t),
  42880. i[0] = n[0],
  42881. i[1] = n[1],
  42882. i[2] = n[2],
  42883. i[3] = n[3],
  42884. i[4] = n[4],
  42885. i[5] = n[5],
  42886. i[6] = n[6],
  42887. i[7] = n[7],
  42888. i[8] = n[8],
  42889. i[9] = n[9],
  42890. i[10] = n[10],
  42891. i[11] = n[11],
  42892. i[12] = n[12],
  42893. i[13] = n[13],
  42894. i[14] = n[14],
  42895. i[15] = n[15],
  42896. this
  42897. },
  42898. multiplyScalar: function(e) {
  42899. var t = this.elements;
  42900. return t[0] *= e,
  42901. t[4] *= e,
  42902. t[8] *= e,
  42903. t[12] *= e,
  42904. t[1] *= e,
  42905. t[5] *= e,
  42906. t[9] *= e,
  42907. t[13] *= e,
  42908. t[2] *= e,
  42909. t[6] *= e,
  42910. t[10] *= e,
  42911. t[14] *= e,
  42912. t[3] *= e,
  42913. t[7] *= e,
  42914. t[11] *= e,
  42915. t[15] *= e,
  42916. this
  42917. },
  42918. applyToVector3Array: function() {
  42919. var e;
  42920. return function(t, i, r) {
  42921. void 0 === e && (e = new n.Vector3),
  42922. void 0 === i && (i = 0),
  42923. void 0 === r && (r = t.length);
  42924. for (var o = 0, a = i; o < r; o += 3,
  42925. a += 3)
  42926. e.fromArray(t, a),
  42927. e.applyMatrix4(this),
  42928. e.toArray(t, a);
  42929. return t
  42930. }
  42931. }(),
  42932. applyToBuffer: function() {
  42933. var e;
  42934. return function(t, i, r) {
  42935. void 0 === e && (e = new n.Vector3),
  42936. void 0 === i && (i = 0),
  42937. void 0 === r && (r = t.length / t.itemSize);
  42938. for (var o = 0, a = i; o < r; o++,
  42939. a++)
  42940. e.x = t.getX(a),
  42941. e.y = t.getY(a),
  42942. e.z = t.getZ(a),
  42943. e.applyMatrix4(this),
  42944. t.setXYZ(e.x, e.y, e.z);
  42945. return t
  42946. }
  42947. }(),
  42948. determinant: function() {
  42949. var e = this.elements
  42950. , t = e[0]
  42951. , i = e[4]
  42952. , n = e[8]
  42953. , r = e[12]
  42954. , o = e[1]
  42955. , a = e[5]
  42956. , s = e[9]
  42957. , l = e[13]
  42958. , c = e[2]
  42959. , h = e[6]
  42960. , u = e[10]
  42961. , d = e[14]
  42962. , p = e[3]
  42963. , f = e[7]
  42964. , g = e[11]
  42965. , m = e[15];
  42966. 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)
  42967. },
  42968. transpose: function() {
  42969. var e, t = this.elements;
  42970. return e = t[1],
  42971. t[1] = t[4],
  42972. t[4] = e,
  42973. e = t[2],
  42974. t[2] = t[8],
  42975. t[8] = e,
  42976. e = t[6],
  42977. t[6] = t[9],
  42978. t[9] = e,
  42979. e = t[3],
  42980. t[3] = t[12],
  42981. t[12] = e,
  42982. e = t[7],
  42983. t[7] = t[13],
  42984. t[13] = e,
  42985. e = t[11],
  42986. t[11] = t[14],
  42987. t[14] = e,
  42988. this
  42989. },
  42990. flattenToArrayOffset: function(e, t) {
  42991. var i = this.elements;
  42992. return e[t] = i[0],
  42993. e[t + 1] = i[1],
  42994. e[t + 2] = i[2],
  42995. e[t + 3] = i[3],
  42996. e[t + 4] = i[4],
  42997. e[t + 5] = i[5],
  42998. e[t + 6] = i[6],
  42999. e[t + 7] = i[7],
  43000. e[t + 8] = i[8],
  43001. e[t + 9] = i[9],
  43002. e[t + 10] = i[10],
  43003. e[t + 11] = i[11],
  43004. e[t + 12] = i[12],
  43005. e[t + 13] = i[13],
  43006. e[t + 14] = i[14],
  43007. e[t + 15] = i[15],
  43008. e
  43009. },
  43010. getPosition: function() {
  43011. var e;
  43012. return function() {
  43013. return void 0 === e && (e = new n.Vector3),
  43014. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  43015. e.setFromMatrixColumn(this, 3)
  43016. }
  43017. }(),
  43018. setPosition: function(e) {
  43019. var t = this.elements;
  43020. return t[12] = e.x,
  43021. t[13] = e.y,
  43022. t[14] = e.z,
  43023. this
  43024. },
  43025. getInverse: function(e, t) {
  43026. var i = this.elements
  43027. , n = e.elements
  43028. , r = n[0]
  43029. , o = n[1]
  43030. , a = n[2]
  43031. , s = n[3]
  43032. , l = n[4]
  43033. , c = n[5]
  43034. , h = n[6]
  43035. , u = n[7]
  43036. , d = n[8]
  43037. , p = n[9]
  43038. , f = n[10]
  43039. , g = n[11]
  43040. , m = n[12]
  43041. , v = n[13]
  43042. , A = n[14]
  43043. , y = n[15]
  43044. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  43045. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  43046. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  43047. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  43048. , w = r * C + o * I + a * E + s * b;
  43049. if (0 === w) {
  43050. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  43051. if (t)
  43052. throw new Error(_);
  43053. return console.warn(_),
  43054. this.identity()
  43055. }
  43056. return i[0] = C,
  43057. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  43058. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  43059. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  43060. i[4] = I,
  43061. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  43062. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  43063. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  43064. i[8] = E,
  43065. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  43066. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  43067. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  43068. i[12] = b,
  43069. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  43070. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  43071. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  43072. this.multiplyScalar(1 / w)
  43073. },
  43074. scale: function(e) {
  43075. var t = this.elements
  43076. , i = e.x
  43077. , n = e.y
  43078. , r = e.z;
  43079. return t[0] *= i,
  43080. t[4] *= n,
  43081. t[8] *= r,
  43082. t[1] *= i,
  43083. t[5] *= n,
  43084. t[9] *= r,
  43085. t[2] *= i,
  43086. t[6] *= n,
  43087. t[10] *= r,
  43088. t[3] *= i,
  43089. t[7] *= n,
  43090. t[11] *= r,
  43091. this
  43092. },
  43093. getMaxScaleOnAxis: function() {
  43094. var e = this.elements
  43095. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  43096. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  43097. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  43098. return Math.sqrt(Math.max(t, i, n))
  43099. },
  43100. makeTranslation: function(e, t, i) {
  43101. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  43102. this
  43103. },
  43104. makeRotationX: function(e) {
  43105. var t = Math.cos(e)
  43106. , i = Math.sin(e);
  43107. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  43108. this
  43109. },
  43110. makeRotationY: function(e) {
  43111. var t = Math.cos(e)
  43112. , i = Math.sin(e);
  43113. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  43114. this
  43115. },
  43116. makeRotationZ: function(e) {
  43117. var t = Math.cos(e)
  43118. , i = Math.sin(e);
  43119. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  43120. this
  43121. },
  43122. makeRotationAxis: function(e, t) {
  43123. var i = Math.cos(t)
  43124. , n = Math.sin(t)
  43125. , r = 1 - i
  43126. , o = e.x
  43127. , a = e.y
  43128. , s = e.z
  43129. , l = r * o
  43130. , c = r * a;
  43131. 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),
  43132. this
  43133. },
  43134. makeScale: function(e, t, i) {
  43135. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  43136. this
  43137. },
  43138. compose: function(e, t, i) {
  43139. return this.makeRotationFromQuaternion(t),
  43140. this.scale(i),
  43141. this.setPosition(e),
  43142. this
  43143. },
  43144. decompose: function() {
  43145. var e, t;
  43146. return function(i, r, o) {
  43147. void 0 === e && (e = new n.Vector3),
  43148. void 0 === t && (t = new n.Matrix4);
  43149. var a = this.elements
  43150. , s = e.set(a[0], a[1], a[2]).length()
  43151. , l = e.set(a[4], a[5], a[6]).length()
  43152. , c = e.set(a[8], a[9], a[10]).length()
  43153. , h = this.determinant();
  43154. h < 0 && (s = -s),
  43155. i.x = a[12],
  43156. i.y = a[13],
  43157. i.z = a[14],
  43158. t.elements.set(this.elements);
  43159. var u = 1 / s
  43160. , d = 1 / l
  43161. , p = 1 / c;
  43162. return t.elements[0] *= u,
  43163. t.elements[1] *= u,
  43164. t.elements[2] *= u,
  43165. t.elements[4] *= d,
  43166. t.elements[5] *= d,
  43167. t.elements[6] *= d,
  43168. t.elements[8] *= p,
  43169. t.elements[9] *= p,
  43170. t.elements[10] *= p,
  43171. r.setFromRotationMatrix(t),
  43172. o.x = s,
  43173. o.y = l,
  43174. o.z = c,
  43175. this
  43176. }
  43177. }(),
  43178. makeFrustum: function(e, t, i, n, r, o) {
  43179. var a = this.elements
  43180. , s = 2 * r / (t - e)
  43181. , l = 2 * r / (n - i)
  43182. , c = (t + e) / (t - e)
  43183. , h = (n + i) / (n - i)
  43184. , u = -(o + r) / (o - r)
  43185. , d = -2 * o * r / (o - r);
  43186. return a[0] = s,
  43187. a[4] = 0,
  43188. a[8] = c,
  43189. a[12] = 0,
  43190. a[1] = 0,
  43191. a[5] = l,
  43192. a[9] = h,
  43193. a[13] = 0,
  43194. a[2] = 0,
  43195. a[6] = 0,
  43196. a[10] = u,
  43197. a[14] = d,
  43198. a[3] = 0,
  43199. a[7] = 0,
  43200. a[11] = -1,
  43201. a[15] = 0,
  43202. this
  43203. },
  43204. makePerspective: function(e, t, i, r) {
  43205. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  43206. , a = -o
  43207. , s = a * t
  43208. , l = o * t;
  43209. return this.makeFrustum(s, l, a, o, i, r)
  43210. },
  43211. makeOrthographic: function(e, t, i, n, r, o) {
  43212. var a = this.elements
  43213. , s = 1 / (t - e)
  43214. , l = 1 / (i - n)
  43215. , c = 1 / (o - r)
  43216. , h = (t + e) * s
  43217. , u = (i + n) * l
  43218. , d = (o + r) * c;
  43219. return a[0] = 2 * s,
  43220. a[4] = 0,
  43221. a[8] = 0,
  43222. a[12] = -h,
  43223. a[1] = 0,
  43224. a[5] = 2 * l,
  43225. a[9] = 0,
  43226. a[13] = -u,
  43227. a[2] = 0,
  43228. a[6] = 0,
  43229. a[10] = -2 * c,
  43230. a[14] = -d,
  43231. a[3] = 0,
  43232. a[7] = 0,
  43233. a[11] = 0,
  43234. a[15] = 1,
  43235. this
  43236. },
  43237. equals: function(e) {
  43238. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  43239. if (t[n] !== i[n])
  43240. return !1;
  43241. return !0
  43242. },
  43243. fromArray: function(e) {
  43244. return this.elements.set(e),
  43245. this
  43246. },
  43247. toArray: function() {
  43248. var e = this.elements;
  43249. 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]]
  43250. }
  43251. },
  43252. n.Ray = function(e, t) {
  43253. this.origin = void 0 !== e ? e : new n.Vector3,
  43254. this.direction = void 0 !== t ? t : new n.Vector3
  43255. }
  43256. ,
  43257. n.Ray.prototype = {
  43258. constructor: n.Ray,
  43259. set: function(e, t) {
  43260. return this.origin.copy(e),
  43261. this.direction.copy(t),
  43262. this
  43263. },
  43264. clone: function() {
  43265. return (new this.constructor).copy(this)
  43266. },
  43267. copy: function(e) {
  43268. return this.origin.copy(e.origin),
  43269. this.direction.copy(e.direction),
  43270. this
  43271. },
  43272. at: function(e, t) {
  43273. var i = t || new n.Vector3;
  43274. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  43275. },
  43276. lookAt: function(e) {
  43277. this.direction.copy(e).sub(this.origin).normalize()
  43278. },
  43279. recast: function() {
  43280. var e = new n.Vector3;
  43281. return function(t) {
  43282. return this.origin.copy(this.at(t, e)),
  43283. this
  43284. }
  43285. }(),
  43286. closestPointToPoint: function(e, t) {
  43287. var i = t || new n.Vector3;
  43288. i.subVectors(e, this.origin);
  43289. var r = i.dot(this.direction);
  43290. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  43291. },
  43292. distanceToPoint: function(e) {
  43293. return Math.sqrt(this.distanceSqToPoint(e))
  43294. },
  43295. distanceSqToPoint: function() {
  43296. var e = new n.Vector3;
  43297. return function(t) {
  43298. var i = e.subVectors(t, this.origin).dot(this.direction);
  43299. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  43300. e.distanceToSquared(t))
  43301. }
  43302. }(),
  43303. distanceSqToSegment: function() {
  43304. var e = new n.Vector3
  43305. , t = new n.Vector3
  43306. , i = new n.Vector3;
  43307. return function(n, r, o, a) {
  43308. e.copy(n).add(r).multiplyScalar(.5),
  43309. t.copy(r).sub(n).normalize(),
  43310. i.copy(this.origin).sub(e);
  43311. 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);
  43312. if (m > 0)
  43313. if (s = d * f - p,
  43314. l = d * p - f,
  43315. h = u * m,
  43316. s >= 0)
  43317. if (l >= -h)
  43318. if (l <= h) {
  43319. var v = 1 / m;
  43320. s *= v,
  43321. l *= v,
  43322. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  43323. } else
  43324. l = u,
  43325. s = Math.max(0, -(d * l + p)),
  43326. c = -s * s + l * (l + 2 * f) + g;
  43327. else
  43328. l = -u,
  43329. s = Math.max(0, -(d * l + p)),
  43330. c = -s * s + l * (l + 2 * f) + g;
  43331. else
  43332. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  43333. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  43334. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  43335. l = Math.min(Math.max(-u, -f), u),
  43336. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  43337. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  43338. c = -s * s + l * (l + 2 * f) + g);
  43339. else
  43340. l = d > 0 ? -u : u,
  43341. s = Math.max(0, -(d * l + p)),
  43342. c = -s * s + l * (l + 2 * f) + g;
  43343. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  43344. a && a.copy(t).multiplyScalar(l).add(e),
  43345. c
  43346. }
  43347. }(),
  43348. intersectSphere: function() {
  43349. var e = new n.Vector3;
  43350. return function(t, i) {
  43351. e.subVectors(t.center, this.origin);
  43352. var n = e.dot(this.direction)
  43353. , r = e.dot(e) - n * n
  43354. , o = t.radius * t.radius;
  43355. if (r > o)
  43356. return null;
  43357. var a = Math.sqrt(o - r)
  43358. , s = n - a
  43359. , l = n + a;
  43360. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  43361. }
  43362. }(),
  43363. intersectsSphere: function(e) {
  43364. return this.distanceToPoint(e.center) <= e.radius
  43365. },
  43366. distanceToPlane: function(e) {
  43367. var t = e.normal.dot(this.direction);
  43368. if (0 === t)
  43369. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  43370. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  43371. return i >= 0 ? i : null
  43372. },
  43373. intersectPlane: function(e, t) {
  43374. var i = this.distanceToPlane(e);
  43375. return null === i ? null : this.at(i, t)
  43376. },
  43377. intersectsPlane: function(e) {
  43378. var t = e.distanceToPoint(this.origin);
  43379. if (0 === t)
  43380. return !0;
  43381. var i = e.normal.dot(this.direction);
  43382. return i * t < 0
  43383. },
  43384. intersectBox: function(e, t) {
  43385. 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;
  43386. return l >= 0 ? (i = (e.min.x - u.x) * l,
  43387. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  43388. n = (e.min.x - u.x) * l),
  43389. c >= 0 ? (r = (e.min.y - u.y) * c,
  43390. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  43391. o = (e.min.y - u.y) * c),
  43392. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  43393. (o < n || n !== n) && (n = o),
  43394. h >= 0 ? (a = (e.min.z - u.z) * h,
  43395. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  43396. s = (e.min.z - u.z) * h),
  43397. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  43398. (s < n || n !== n) && (n = s),
  43399. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  43400. },
  43401. intersectsBox: function() {
  43402. var e = new n.Vector3;
  43403. return function(t) {
  43404. return null !== this.intersectBox(t, e)
  43405. }
  43406. }(),
  43407. intersectTriangle: function() {
  43408. var e = new n.Vector3
  43409. , t = new n.Vector3
  43410. , i = new n.Vector3
  43411. , r = new n.Vector3;
  43412. return function(n, o, a, s, l) {
  43413. t.subVectors(o, n),
  43414. i.subVectors(a, n),
  43415. r.crossVectors(t, i);
  43416. var c, h = this.direction.dot(r);
  43417. if (h > 0) {
  43418. if (s)
  43419. return null;
  43420. c = 1
  43421. } else {
  43422. if (!(h < 0))
  43423. return null;
  43424. c = -1,
  43425. h = -h
  43426. }
  43427. e.subVectors(this.origin, n);
  43428. var u = c * this.direction.dot(i.crossVectors(e, i));
  43429. if (u < 0)
  43430. return null;
  43431. var d = c * this.direction.dot(t.cross(e));
  43432. if (d < 0)
  43433. return null;
  43434. if (u + d > h)
  43435. return null;
  43436. var p = -c * e.dot(r);
  43437. return p < 0 ? null : this.at(p / h, l)
  43438. }
  43439. }(),
  43440. applyMatrix4: function(e) {
  43441. return this.direction.add(this.origin).applyMatrix4(e),
  43442. this.origin.applyMatrix4(e),
  43443. this.direction.sub(this.origin),
  43444. this.direction.normalize(),
  43445. this
  43446. },
  43447. equals: function(e) {
  43448. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  43449. }
  43450. },
  43451. n.Sphere = function(e, t) {
  43452. this.center = void 0 !== e ? e : new n.Vector3,
  43453. this.radius = void 0 !== t ? t : 0
  43454. }
  43455. ,
  43456. n.Sphere.prototype = {
  43457. constructor: n.Sphere,
  43458. set: function(e, t) {
  43459. return this.center.copy(e),
  43460. this.radius = t,
  43461. this
  43462. },
  43463. setFromPoints: function() {
  43464. var e = new n.Box3;
  43465. return function(t, i) {
  43466. var n = this.center;
  43467. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  43468. for (var r = 0, o = 0, a = t.length; o < a; o++)
  43469. r = Math.max(r, n.distanceToSquared(t[o]));
  43470. return this.radius = Math.sqrt(r),
  43471. this
  43472. }
  43473. }(),
  43474. clone: function() {
  43475. return (new this.constructor).copy(this)
  43476. },
  43477. copy: function(e) {
  43478. return this.center.copy(e.center),
  43479. this.radius = e.radius,
  43480. this
  43481. },
  43482. empty: function() {
  43483. return this.radius <= 0
  43484. },
  43485. containsPoint: function(e) {
  43486. return e.distanceToSquared(this.center) <= this.radius * this.radius
  43487. },
  43488. distanceToPoint: function(e) {
  43489. return e.distanceTo(this.center) - this.radius
  43490. },
  43491. intersectsSphere: function(e) {
  43492. var t = this.radius + e.radius;
  43493. return e.center.distanceToSquared(this.center) <= t * t
  43494. },
  43495. intersectsBox: function(e) {
  43496. return e.intersectsSphere(this)
  43497. },
  43498. intersectsPlane: function(e) {
  43499. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  43500. },
  43501. clampPoint: function(e, t) {
  43502. var i = this.center.distanceToSquared(e)
  43503. , r = t || new n.Vector3;
  43504. return r.copy(e),
  43505. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  43506. r.multiplyScalar(this.radius).add(this.center)),
  43507. r
  43508. },
  43509. getBoundingBox: function(e) {
  43510. var t = e || new n.Box3;
  43511. return t.set(this.center, this.center),
  43512. t.expandByScalar(this.radius),
  43513. t
  43514. },
  43515. applyMatrix4: function(e) {
  43516. return this.center.applyMatrix4(e),
  43517. this.radius = this.radius * e.getMaxScaleOnAxis(),
  43518. this
  43519. },
  43520. translate: function(e) {
  43521. return this.center.add(e),
  43522. this
  43523. },
  43524. equals: function(e) {
  43525. return e.center.equals(this.center) && e.radius === this.radius
  43526. }
  43527. },
  43528. n.Frustum = function(e, t, i, r, o, a) {
  43529. 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]
  43530. }
  43531. ,
  43532. n.Frustum.prototype = {
  43533. constructor: n.Frustum,
  43534. set: function(e, t, i, n, r, o) {
  43535. var a = this.planes;
  43536. return a[0].copy(e),
  43537. a[1].copy(t),
  43538. a[2].copy(i),
  43539. a[3].copy(n),
  43540. a[4].copy(r),
  43541. a[5].copy(o),
  43542. this
  43543. },
  43544. clone: function() {
  43545. return (new this.constructor).copy(this)
  43546. },
  43547. copy: function(e) {
  43548. for (var t = this.planes, i = 0; i < 6; i++)
  43549. t[i].copy(e.planes[i]);
  43550. return this
  43551. },
  43552. setFromMatrix: function(e) {
  43553. var t = this.planes
  43554. , i = e.elements
  43555. , n = i[0]
  43556. , r = i[1]
  43557. , o = i[2]
  43558. , a = i[3]
  43559. , s = i[4]
  43560. , l = i[5]
  43561. , c = i[6]
  43562. , h = i[7]
  43563. , u = i[8]
  43564. , d = i[9]
  43565. , p = i[10]
  43566. , f = i[11]
  43567. , g = i[12]
  43568. , m = i[13]
  43569. , v = i[14]
  43570. , A = i[15];
  43571. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  43572. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  43573. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  43574. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  43575. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  43576. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  43577. this
  43578. },
  43579. intersectsObject: function() {
  43580. var e = new n.Sphere;
  43581. return function(t) {
  43582. var i = t.geometry;
  43583. return null === i.boundingSphere && i.computeBoundingSphere(),
  43584. e.copy(i.boundingSphere),
  43585. e.applyMatrix4(t.matrixWorld),
  43586. this.intersectsSphere(e)
  43587. }
  43588. }(),
  43589. intersectsSphere: function(e) {
  43590. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  43591. var o = t[r].distanceToPoint(i);
  43592. if (o < n)
  43593. return !1
  43594. }
  43595. return !0
  43596. },
  43597. intersectsBox: function() {
  43598. var e = new n.Vector3
  43599. , t = new n.Vector3;
  43600. return function(i) {
  43601. for (var n = this.planes, r = 0; r < 6; r++) {
  43602. var o = n[r];
  43603. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  43604. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  43605. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  43606. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  43607. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  43608. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  43609. var a = o.distanceToPoint(e)
  43610. , s = o.distanceToPoint(t);
  43611. if (a < 0 && s < 0)
  43612. return !1
  43613. }
  43614. return !0
  43615. }
  43616. }(),
  43617. containsPoint: function(e) {
  43618. for (var t = this.planes, i = 0; i < 6; i++)
  43619. if (t[i].distanceToPoint(e) < 0)
  43620. return !1;
  43621. return !0
  43622. }
  43623. },
  43624. n.Plane = function(e, t) {
  43625. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  43626. this.constant = void 0 !== t ? t : 0
  43627. }
  43628. ,
  43629. n.Plane.prototype = {
  43630. constructor: n.Plane,
  43631. set: function(e, t) {
  43632. return this.normal.copy(e),
  43633. this.constant = t,
  43634. this
  43635. },
  43636. setComponents: function(e, t, i, n) {
  43637. return this.normal.set(e, t, i),
  43638. this.constant = n,
  43639. this
  43640. },
  43641. setFromNormalAndCoplanarPoint: function(e, t) {
  43642. return this.normal.copy(e),
  43643. this.constant = -t.dot(this.normal),
  43644. this
  43645. },
  43646. setFromCoplanarPoints: function() {
  43647. var e = new n.Vector3
  43648. , t = new n.Vector3;
  43649. return function(i, n, r) {
  43650. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  43651. return this.setFromNormalAndCoplanarPoint(o, i),
  43652. this
  43653. }
  43654. }(),
  43655. clone: function() {
  43656. return (new this.constructor).copy(this)
  43657. },
  43658. copy: function(e) {
  43659. return this.normal.copy(e.normal),
  43660. this.constant = e.constant,
  43661. this
  43662. },
  43663. normalize: function() {
  43664. var e = 1 / this.normal.length();
  43665. return this.normal.multiplyScalar(e),
  43666. this.constant *= e,
  43667. this
  43668. },
  43669. negate: function() {
  43670. return this.constant *= -1,
  43671. this.normal.negate(),
  43672. this
  43673. },
  43674. distanceToPoint: function(e) {
  43675. return this.normal.dot(e) + this.constant
  43676. },
  43677. distanceToSphere: function(e) {
  43678. return this.distanceToPoint(e.center) - e.radius
  43679. },
  43680. projectPoint: function(e, t) {
  43681. return this.orthoPoint(e, t).sub(e).negate()
  43682. },
  43683. orthoPoint: function(e, t) {
  43684. var i = this.distanceToPoint(e)
  43685. , r = t || new n.Vector3;
  43686. return r.copy(this.normal).multiplyScalar(i)
  43687. },
  43688. intersectLine: function() {
  43689. var e = new n.Vector3;
  43690. return function(t, i) {
  43691. var r = i || new n.Vector3
  43692. , o = t.delta(e)
  43693. , a = this.normal.dot(o);
  43694. if (0 !== a) {
  43695. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43696. if (!(s < 0 || s > 1))
  43697. return r.copy(o).multiplyScalar(s).add(t.start)
  43698. } else if (0 === this.distanceToPoint(t.start))
  43699. return r.copy(t.start)
  43700. }
  43701. }(),
  43702. intersectsLine: function(e) {
  43703. var t = this.distanceToPoint(e.start)
  43704. , i = this.distanceToPoint(e.end);
  43705. return t < 0 && i > 0 || i < 0 && t > 0
  43706. },
  43707. intersectsBox: function(e) {
  43708. return e.intersectsPlane(this)
  43709. },
  43710. intersectsSphere: function(e) {
  43711. return e.intersectsPlane(this)
  43712. },
  43713. coplanarPoint: function(e) {
  43714. var t = e || new n.Vector3;
  43715. return t.copy(this.normal).multiplyScalar(-this.constant)
  43716. },
  43717. applyMatrix4: function() {
  43718. var e = new n.Vector3
  43719. , t = new n.Vector3
  43720. , i = new n.Matrix3;
  43721. return function(n, r) {
  43722. var o = r || i.getNormalMatrix(n)
  43723. , a = e.copy(this.normal).applyMatrix3(o)
  43724. , s = this.coplanarPoint(t);
  43725. return s.applyMatrix4(n),
  43726. this.setFromNormalAndCoplanarPoint(a, s),
  43727. this
  43728. }
  43729. }(),
  43730. translate: function(e) {
  43731. return this.constant = this.constant - e.dot(this.normal),
  43732. this
  43733. },
  43734. equals: function(e) {
  43735. return e.normal.equals(this.normal) && e.constant === this.constant
  43736. }
  43737. },
  43738. n.Spherical = function(e, t, i) {
  43739. return this.radius = void 0 !== e ? e : 1,
  43740. this.phi = void 0 !== t ? t : 0,
  43741. this.theta = void 0 !== i ? i : 0,
  43742. this
  43743. }
  43744. ,
  43745. n.Spherical.prototype = {
  43746. constructor: n.Spherical,
  43747. set: function(e, t, i) {
  43748. this.radius = e,
  43749. this.phi = t,
  43750. this.theta = i
  43751. },
  43752. clone: function() {
  43753. return (new this.constructor).copy(this)
  43754. },
  43755. copy: function(e) {
  43756. return this.radius.copy(e.radius),
  43757. this.phi.copy(e.phi),
  43758. this.theta.copy(e.theta),
  43759. this
  43760. },
  43761. makeSafe: function() {
  43762. var e = 1e-6;
  43763. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43764. },
  43765. setFromVector3: function(e) {
  43766. return this.radius = e.length(),
  43767. 0 === this.radius ? (this.theta = 0,
  43768. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43769. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43770. this
  43771. }
  43772. },
  43773. n.Math = {
  43774. generateUUID: function() {
  43775. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43776. return function() {
  43777. for (var r = 0; r < 36; r++)
  43778. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43779. e = 15 & n,
  43780. n >>= 4,
  43781. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43782. return i.join("")
  43783. }
  43784. }(),
  43785. clamp: function(e, t, i) {
  43786. return Math.max(t, Math.min(i, e))
  43787. },
  43788. euclideanModulo: function(e, t) {
  43789. return (e % t + t) % t
  43790. },
  43791. mapLinear: function(e, t, i, n, r) {
  43792. return n + (e - t) * (r - n) / (i - t)
  43793. },
  43794. smoothstep: function(e, t, i) {
  43795. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43796. e * e * (3 - 2 * e))
  43797. },
  43798. smootherstep: function(e, t, i) {
  43799. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43800. e * e * e * (e * (6 * e - 15) + 10))
  43801. },
  43802. random16: function() {
  43803. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43804. Math.random()
  43805. },
  43806. randInt: function(e, t) {
  43807. return e + Math.floor(Math.random() * (t - e + 1))
  43808. },
  43809. randFloat: function(e, t) {
  43810. return e + Math.random() * (t - e)
  43811. },
  43812. randFloatSpread: function(e) {
  43813. return e * (.5 - Math.random())
  43814. },
  43815. degToRad: function() {
  43816. var e = Math.PI / 180;
  43817. return function(t) {
  43818. return t * e
  43819. }
  43820. }(),
  43821. radToDeg: function() {
  43822. var e = 180 / Math.PI;
  43823. return function(t) {
  43824. return t * e
  43825. }
  43826. }(),
  43827. isPowerOfTwo: function(e) {
  43828. return 0 === (e & e - 1) && 0 !== e
  43829. },
  43830. nearestPowerOfTwo: function(e) {
  43831. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43832. },
  43833. nextPowerOfTwo: function(e) {
  43834. return e--,
  43835. e |= e >> 1,
  43836. e |= e >> 2,
  43837. e |= e >> 4,
  43838. e |= e >> 8,
  43839. e |= e >> 16,
  43840. e++,
  43841. e
  43842. }
  43843. },
  43844. n.Spline = function(e) {
  43845. function t(e, t, i, n, r, o, a) {
  43846. var s = .5 * (i - e)
  43847. , l = .5 * (n - t);
  43848. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43849. }
  43850. this.points = e;
  43851. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43852. x: 0,
  43853. y: 0,
  43854. z: 0
  43855. };
  43856. this.initFromArray = function(e) {
  43857. this.points = [];
  43858. for (var t = 0; t < e.length; t++)
  43859. this.points[t] = {
  43860. x: e[t][0],
  43861. y: e[t][1],
  43862. z: e[t][2]
  43863. }
  43864. }
  43865. ,
  43866. this.getPoint = function(e) {
  43867. return i = (this.points.length - 1) * e,
  43868. r = Math.floor(i),
  43869. o = i - r,
  43870. d[0] = 0 === r ? r : r - 1,
  43871. d[1] = r,
  43872. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43873. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43874. l = this.points[d[0]],
  43875. c = this.points[d[1]],
  43876. h = this.points[d[2]],
  43877. u = this.points[d[3]],
  43878. a = o * o,
  43879. s = o * a,
  43880. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43881. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43882. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43883. p
  43884. }
  43885. ,
  43886. this.getControlPointsArray = function() {
  43887. var e, t, i = this.points.length, n = [];
  43888. for (e = 0; e < i; e++)
  43889. t = this.points[e],
  43890. n[e] = [t.x, t.y, t.z];
  43891. return n
  43892. }
  43893. ,
  43894. this.getLength = function(e) {
  43895. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43896. for (u[0] = 0,
  43897. e || (e = 100),
  43898. r = this.points.length * e,
  43899. c.copy(this.points[0]),
  43900. t = 1; t < r; t++)
  43901. i = t / r,
  43902. o = this.getPoint(i),
  43903. h.copy(o),
  43904. d += h.distanceTo(c),
  43905. c.copy(o),
  43906. a = (this.points.length - 1) * i,
  43907. s = Math.floor(a),
  43908. s !== l && (u[s] = d,
  43909. l = s);
  43910. return u[u.length] = d,
  43911. {
  43912. chunks: u,
  43913. total: d
  43914. }
  43915. }
  43916. ,
  43917. this.reparametrizeByArcLength = function(e) {
  43918. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43919. for (h.push(u.copy(this.points[0]).clone()),
  43920. t = 1; t < this.points.length; t++) {
  43921. for (s = d.chunks[t] - d.chunks[t - 1],
  43922. l = Math.ceil(e * s / d.total),
  43923. o = (t - 1) / (this.points.length - 1),
  43924. a = t / (this.points.length - 1),
  43925. i = 1; i < l - 1; i++)
  43926. r = o + i * (1 / l) * (a - o),
  43927. c = this.getPoint(r),
  43928. h.push(u.copy(c).clone());
  43929. h.push(u.copy(this.points[t]).clone())
  43930. }
  43931. this.points = h
  43932. }
  43933. }
  43934. ,
  43935. n.Triangle = function(e, t, i) {
  43936. this.a = void 0 !== e ? e : new n.Vector3,
  43937. this.b = void 0 !== t ? t : new n.Vector3,
  43938. this.c = void 0 !== i ? i : new n.Vector3
  43939. }
  43940. ,
  43941. n.Triangle.normal = function() {
  43942. var e = new n.Vector3;
  43943. return function(t, i, r, o) {
  43944. var a = o || new n.Vector3;
  43945. a.subVectors(r, i),
  43946. e.subVectors(t, i),
  43947. a.cross(e);
  43948. var s = a.lengthSq();
  43949. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43950. }
  43951. }(),
  43952. n.Triangle.barycoordFromPoint = function() {
  43953. var e = new n.Vector3
  43954. , t = new n.Vector3
  43955. , i = new n.Vector3;
  43956. return function(r, o, a, s, l) {
  43957. e.subVectors(s, o),
  43958. t.subVectors(a, o),
  43959. i.subVectors(r, o);
  43960. var c = e.dot(e)
  43961. , h = e.dot(t)
  43962. , u = e.dot(i)
  43963. , d = t.dot(t)
  43964. , p = t.dot(i)
  43965. , f = c * d - h * h
  43966. , g = l || new n.Vector3;
  43967. if (0 === f)
  43968. return g.set(-2, -1, -1);
  43969. var m = 1 / f
  43970. , v = (d * u - h * p) * m
  43971. , A = (c * p - h * u) * m;
  43972. return g.set(1 - v - A, A, v)
  43973. }
  43974. }(),
  43975. n.Triangle.containsPoint = function() {
  43976. var e = new n.Vector3;
  43977. return function(t, i, r, o) {
  43978. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43979. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43980. }
  43981. }(),
  43982. n.Triangle.prototype = {
  43983. constructor: n.Triangle,
  43984. set: function(e, t, i) {
  43985. return this.a.copy(e),
  43986. this.b.copy(t),
  43987. this.c.copy(i),
  43988. this
  43989. },
  43990. setFromPointsAndIndices: function(e, t, i, n) {
  43991. return this.a.copy(e[t]),
  43992. this.b.copy(e[i]),
  43993. this.c.copy(e[n]),
  43994. this
  43995. },
  43996. clone: function() {
  43997. return (new this.constructor).copy(this)
  43998. },
  43999. copy: function(e) {
  44000. return this.a.copy(e.a),
  44001. this.b.copy(e.b),
  44002. this.c.copy(e.c),
  44003. this
  44004. },
  44005. area: function() {
  44006. var e = new n.Vector3
  44007. , t = new n.Vector3;
  44008. return function() {
  44009. return e.subVectors(this.c, this.b),
  44010. t.subVectors(this.a, this.b),
  44011. .5 * e.cross(t).length()
  44012. }
  44013. }(),
  44014. midpoint: function(e) {
  44015. var t = e || new n.Vector3;
  44016. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  44017. },
  44018. normal: function(e) {
  44019. return n.Triangle.normal(this.a, this.b, this.c, e)
  44020. },
  44021. plane: function(e) {
  44022. var t = e || new n.Plane;
  44023. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  44024. },
  44025. barycoordFromPoint: function(e, t) {
  44026. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  44027. },
  44028. containsPoint: function(e) {
  44029. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  44030. },
  44031. equals: function(e) {
  44032. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  44033. }
  44034. },
  44035. n.Interpolant = function(e, t, i, n) {
  44036. this.parameterPositions = e,
  44037. this._cachedIndex = 0,
  44038. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  44039. this.sampleValues = t,
  44040. this.valueSize = i
  44041. }
  44042. ,
  44043. n.Interpolant.prototype = {
  44044. constructor: n.Interpolant,
  44045. evaluate: function(e) {
  44046. var t = this.parameterPositions
  44047. , i = this._cachedIndex
  44048. , n = t[i]
  44049. , r = t[i - 1];
  44050. e: {
  44051. t: {
  44052. var o;
  44053. i: {
  44054. n: if (!(e < n)) {
  44055. for (var a = i + 2; ; ) {
  44056. if (void 0 === n) {
  44057. if (e < r)
  44058. break n;
  44059. return i = t.length,
  44060. this._cachedIndex = i,
  44061. this.afterEnd_(i - 1, e, r)
  44062. }
  44063. if (i === a)
  44064. break;
  44065. if (r = n,
  44066. n = t[++i],
  44067. e < n)
  44068. break t
  44069. }
  44070. o = t.length;
  44071. break i
  44072. }
  44073. {
  44074. if (e >= r)
  44075. break e;
  44076. var s = t[1];
  44077. e < s && (i = 2,
  44078. r = s);
  44079. for (var a = i - 2; ; ) {
  44080. if (void 0 === r)
  44081. return this._cachedIndex = 0,
  44082. this.beforeStart_(0, e, n);
  44083. if (i === a)
  44084. break;
  44085. if (n = r,
  44086. r = t[--i - 1],
  44087. e >= r)
  44088. break t
  44089. }
  44090. o = i,
  44091. i = 0
  44092. }
  44093. }
  44094. for (; i < o; ) {
  44095. var l = i + o >>> 1;
  44096. e < t[l] ? o = l : i = l + 1
  44097. }
  44098. if (n = t[i],
  44099. r = t[i - 1],
  44100. void 0 === r)
  44101. return this._cachedIndex = 0,
  44102. this.beforeStart_(0, e, n);
  44103. if (void 0 === n)
  44104. return i = t.length,
  44105. this._cachedIndex = i,
  44106. this.afterEnd_(i - 1, r, e)
  44107. }
  44108. this._cachedIndex = i,
  44109. this.intervalChanged_(i, r, n)
  44110. }
  44111. return this.interpolate_(i, r, e, n)
  44112. },
  44113. settings: null,
  44114. DefaultSettings_: {},
  44115. getSettings_: function() {
  44116. return this.settings || this.DefaultSettings_
  44117. },
  44118. copySampleValue_: function(e) {
  44119. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  44120. t[o] = i[r + o];
  44121. return t
  44122. },
  44123. interpolate_: function(e, t, i, n) {
  44124. throw new Error("call to abstract method")
  44125. },
  44126. intervalChanged_: function(e, t, i) {}
  44127. },
  44128. Object.assign(n.Interpolant.prototype, {
  44129. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  44130. afterEnd_: n.Interpolant.prototype.copySampleValue_
  44131. }),
  44132. n.CubicInterpolant = function(e, t, i, r) {
  44133. n.Interpolant.call(this, e, t, i, r),
  44134. this._weightPrev = -0,
  44135. this._offsetPrev = -0,
  44136. this._weightNext = -0,
  44137. this._offsetNext = -0
  44138. }
  44139. ,
  44140. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  44141. constructor: n.CubicInterpolant,
  44142. DefaultSettings_: {
  44143. endingStart: n.ZeroCurvatureEnding,
  44144. endingEnd: n.ZeroCurvatureEnding
  44145. },
  44146. intervalChanged_: function(e, t, i) {
  44147. var r = this.parameterPositions
  44148. , o = e - 2
  44149. , a = e + 1
  44150. , s = r[o]
  44151. , l = r[a];
  44152. if (void 0 === s)
  44153. switch (this.getSettings_().endingStart) {
  44154. case n.ZeroSlopeEnding:
  44155. o = e,
  44156. s = 2 * t - i;
  44157. break;
  44158. case n.WrapAroundEnding:
  44159. o = r.length - 2,
  44160. s = t + r[o] - r[o + 1];
  44161. break;
  44162. default:
  44163. o = e,
  44164. s = i
  44165. }
  44166. if (void 0 === l)
  44167. switch (this.getSettings_().endingEnd) {
  44168. case n.ZeroSlopeEnding:
  44169. a = e,
  44170. l = 2 * i - t;
  44171. break;
  44172. case n.WrapAroundEnding:
  44173. a = 1,
  44174. l = i + r[1] - r[0];
  44175. break;
  44176. default:
  44177. a = e - 1,
  44178. l = t
  44179. }
  44180. var c = .5 * (i - t)
  44181. , h = this.valueSize;
  44182. this._weightPrev = c / (t - s),
  44183. this._weightNext = c / (l - i),
  44184. this._offsetPrev = o * h,
  44185. this._offsetNext = a * h
  44186. },
  44187. interpolate_: function(e, t, i, n) {
  44188. 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)
  44189. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  44190. return r
  44191. }
  44192. }),
  44193. n.DiscreteInterpolant = function(e, t, i, r) {
  44194. n.Interpolant.call(this, e, t, i, r)
  44195. }
  44196. ,
  44197. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  44198. constructor: n.DiscreteInterpolant,
  44199. interpolate_: function(e, t, i, n) {
  44200. return this.copySampleValue_(e - 1)
  44201. }
  44202. }),
  44203. n.LinearInterpolant = function(e, t, i, r) {
  44204. n.Interpolant.call(this, e, t, i, r)
  44205. }
  44206. ,
  44207. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  44208. constructor: n.LinearInterpolant,
  44209. interpolate_: function(e, t, i, n) {
  44210. 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)
  44211. r[u] = o[l + u] * h + o[s + u] * c;
  44212. return r
  44213. }
  44214. }),
  44215. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  44216. n.Interpolant.call(this, e, t, i, r)
  44217. }
  44218. ,
  44219. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  44220. constructor: n.QuaternionLinearInterpolant,
  44221. interpolate_: function(e, t, i, r) {
  44222. 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)
  44223. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  44224. return o
  44225. }
  44226. }),
  44227. n.Clock = function(e) {
  44228. this.autoStart = void 0 === e || e,
  44229. this.startTime = 0,
  44230. this.oldTime = 0,
  44231. this.elapsedTime = 0,
  44232. this.running = !1
  44233. }
  44234. ,
  44235. n.Clock.prototype = {
  44236. constructor: n.Clock,
  44237. start: function() {
  44238. this.startTime = performance.now(),
  44239. this.oldTime = this.startTime,
  44240. this.running = !0
  44241. },
  44242. stop: function() {
  44243. this.getElapsedTime(),
  44244. this.running = !1
  44245. },
  44246. getElapsedTime: function() {
  44247. return this.getDelta(),
  44248. this.elapsedTime
  44249. },
  44250. getDelta: function() {
  44251. var e = 0;
  44252. if (this.autoStart && !this.running && this.start(),
  44253. this.running) {
  44254. var t = performance.now();
  44255. e = .001 * (t - this.oldTime),
  44256. this.oldTime = t,
  44257. this.elapsedTime += e
  44258. }
  44259. return e
  44260. }
  44261. },
  44262. n.EventDispatcher = function() {}
  44263. ,
  44264. n.EventDispatcher.prototype = {
  44265. constructor: n.EventDispatcher,
  44266. apply: function(e) {
  44267. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  44268. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  44269. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  44270. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  44271. },
  44272. addEventListener: function(e, t) {
  44273. void 0 === this._listeners && (this._listeners = {});
  44274. var i = this._listeners;
  44275. void 0 === i[e] && (i[e] = []),
  44276. i[e].indexOf(t) === -1 && i[e].push(t)
  44277. },
  44278. hasEventListener: function(e, t) {
  44279. if (void 0 === this._listeners)
  44280. return !1;
  44281. var i = this._listeners;
  44282. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  44283. },
  44284. removeEventListener: function(e, t) {
  44285. if (void 0 !== this._listeners) {
  44286. var i = this._listeners
  44287. , n = i[e];
  44288. if (void 0 !== n) {
  44289. var r = n.indexOf(t);
  44290. r !== -1 && n.splice(r, 1)
  44291. }
  44292. }
  44293. },
  44294. dispatchEvent: function(e) {
  44295. if (void 0 !== this._listeners) {
  44296. var t = this._listeners
  44297. , i = t[e.type];
  44298. if (void 0 !== i) {
  44299. e.target = this;
  44300. for (var n = [], r = i.length, o = 0; o < r; o++)
  44301. n[o] = i[o];
  44302. for (var o = 0; o < r; o++)
  44303. n[o].call(this, e)
  44304. }
  44305. }
  44306. }
  44307. },
  44308. n.Layers = function() {
  44309. this.mask = 1
  44310. }
  44311. ,
  44312. n.Layers.prototype = {
  44313. constructor: n.Layers,
  44314. set: function(e) {
  44315. this.mask = 1 << e
  44316. },
  44317. enable: function(e) {
  44318. this.mask |= 1 << e
  44319. },
  44320. toggle: function(e) {
  44321. this.mask ^= 1 << e
  44322. },
  44323. disable: function(e) {
  44324. this.mask &= ~(1 << e)
  44325. },
  44326. test: function(e) {
  44327. return 0 !== (this.mask & e.mask)
  44328. }
  44329. },
  44330. function(e) {
  44331. function t(e, t) {
  44332. return e.distance - t.distance
  44333. }
  44334. function i(e, t, n, r) {
  44335. if (e.visible !== !1 && (e.raycast(t, n),
  44336. r === !0))
  44337. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  44338. i(o[a], t, n, !0)
  44339. }
  44340. e.Raycaster = function(t, i, n, r) {
  44341. this.ray = new e.Ray(t,i),
  44342. this.near = n || 0,
  44343. this.far = r || 1 / 0,
  44344. this.params = {
  44345. Mesh: {},
  44346. Line: {},
  44347. LOD: {},
  44348. Points: {
  44349. threshold: 1
  44350. },
  44351. Sprite: {}
  44352. },
  44353. Object.defineProperties(this.params, {
  44354. PointCloud: {
  44355. get: function() {
  44356. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  44357. this.Points
  44358. }
  44359. }
  44360. })
  44361. }
  44362. ,
  44363. e.Raycaster.prototype = {
  44364. constructor: e.Raycaster,
  44365. linePrecision: 1,
  44366. set: function(e, t) {
  44367. this.ray.set(e, t)
  44368. },
  44369. setFromCamera: function(t, i) {
  44370. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  44371. 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),
  44372. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  44373. },
  44374. intersectObject: function(e, n) {
  44375. var r = [];
  44376. return i(e, this, r, n),
  44377. r.sort(t),
  44378. r
  44379. },
  44380. intersectObjects: function(e, n) {
  44381. var r = [];
  44382. if (Array.isArray(e) === !1)
  44383. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  44384. r;
  44385. for (var o = 0, a = e.length; o < a; o++)
  44386. i(e[o], this, r, n);
  44387. return r.sort(t),
  44388. r
  44389. }
  44390. }
  44391. }(n),
  44392. n.Object3D = function() {
  44393. function e() {
  44394. o.setFromEuler(r, !1)
  44395. }
  44396. function t() {
  44397. r.setFromQuaternion(o, void 0, !1)
  44398. }
  44399. Object.defineProperty(this, "id", {
  44400. value: n.Object3DIdCount++
  44401. }),
  44402. this.uuid = n.Math.generateUUID(),
  44403. this.name = "",
  44404. this.type = "Object3D",
  44405. this.parent = null,
  44406. this.children = [],
  44407. this.up = n.Object3D.DefaultUp.clone();
  44408. var i = new n.Vector3
  44409. , r = new n.Euler
  44410. , o = new n.Quaternion
  44411. , a = new n.Vector3(1,1,1);
  44412. r.onChange(e),
  44413. o.onChange(t),
  44414. Object.defineProperties(this, {
  44415. position: {
  44416. enumerable: !0,
  44417. value: i
  44418. },
  44419. rotation: {
  44420. enumerable: !0,
  44421. value: r
  44422. },
  44423. quaternion: {
  44424. enumerable: !0,
  44425. value: o
  44426. },
  44427. scale: {
  44428. enumerable: !0,
  44429. value: a
  44430. },
  44431. modelViewMatrix: {
  44432. value: new n.Matrix4
  44433. },
  44434. normalMatrix: {
  44435. value: new n.Matrix3
  44436. }
  44437. }),
  44438. this.rotationAutoUpdate = !0,
  44439. this.matrix = new n.Matrix4,
  44440. this.matrixWorld = new n.Matrix4,
  44441. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  44442. this.matrixWorldNeedsUpdate = !1,
  44443. this.layers = new n.Layers,
  44444. this.visible = !0,
  44445. this.castShadow = !1,
  44446. this.receiveShadow = !1,
  44447. this.frustumCulled = !0,
  44448. this.renderOrder = 0,
  44449. this.userData = {}
  44450. }
  44451. ,
  44452. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  44453. n.Object3D.DefaultMatrixAutoUpdate = !0,
  44454. n.Object3D.prototype = {
  44455. constructor: n.Object3D,
  44456. applyMatrix: function(e) {
  44457. this.matrix.multiplyMatrices(e, this.matrix),
  44458. this.matrix.decompose(this.position, this.quaternion, this.scale)
  44459. },
  44460. setRotationFromAxisAngle: function(e, t) {
  44461. this.quaternion.setFromAxisAngle(e, t)
  44462. },
  44463. setRotationFromEuler: function(e) {
  44464. this.quaternion.setFromEuler(e, !0)
  44465. },
  44466. setRotationFromMatrix: function(e) {
  44467. this.quaternion.setFromRotationMatrix(e)
  44468. },
  44469. setRotationFromQuaternion: function(e) {
  44470. this.quaternion.copy(e)
  44471. },
  44472. rotateOnAxis: function() {
  44473. var e = new n.Quaternion;
  44474. return function(t, i) {
  44475. return e.setFromAxisAngle(t, i),
  44476. this.quaternion.multiply(e),
  44477. this
  44478. }
  44479. }(),
  44480. rotateX: function() {
  44481. var e = new n.Vector3(1,0,0);
  44482. return function(t) {
  44483. return this.rotateOnAxis(e, t)
  44484. }
  44485. }(),
  44486. rotateY: function() {
  44487. var e = new n.Vector3(0,1,0);
  44488. return function(t) {
  44489. return this.rotateOnAxis(e, t)
  44490. }
  44491. }(),
  44492. rotateZ: function() {
  44493. var e = new n.Vector3(0,0,1);
  44494. return function(t) {
  44495. return this.rotateOnAxis(e, t)
  44496. }
  44497. }(),
  44498. translateOnAxis: function() {
  44499. var e = new n.Vector3;
  44500. return function(t, i) {
  44501. return e.copy(t).applyQuaternion(this.quaternion),
  44502. this.position.add(e.multiplyScalar(i)),
  44503. this
  44504. }
  44505. }(),
  44506. translateX: function() {
  44507. var e = new n.Vector3(1,0,0);
  44508. return function(t) {
  44509. return this.translateOnAxis(e, t)
  44510. }
  44511. }(),
  44512. translateY: function() {
  44513. var e = new n.Vector3(0,1,0);
  44514. return function(t) {
  44515. return this.translateOnAxis(e, t)
  44516. }
  44517. }(),
  44518. translateZ: function() {
  44519. var e = new n.Vector3(0,0,1);
  44520. return function(t) {
  44521. return this.translateOnAxis(e, t)
  44522. }
  44523. }(),
  44524. localToWorld: function(e) {
  44525. return e.applyMatrix4(this.matrixWorld)
  44526. },
  44527. worldToLocal: function() {
  44528. var e = new n.Matrix4;
  44529. return function(t) {
  44530. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  44531. }
  44532. }(),
  44533. lookAt: function() {
  44534. var e = new n.Matrix4;
  44535. return function(t) {
  44536. e.lookAt(t, this.position, this.up),
  44537. this.quaternion.setFromRotationMatrix(e)
  44538. }
  44539. }(),
  44540. add: function(e) {
  44541. if (arguments.length > 1) {
  44542. for (var t = 0; t < arguments.length; t++)
  44543. this.add(arguments[t]);
  44544. return this
  44545. }
  44546. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  44547. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  44548. e.parent = this,
  44549. e.dispatchEvent({
  44550. type: "added"
  44551. }),
  44552. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  44553. this)
  44554. },
  44555. remove: function(e) {
  44556. if (arguments.length > 1)
  44557. for (var t = 0; t < arguments.length; t++)
  44558. this.remove(arguments[t]);
  44559. var i = this.children.indexOf(e);
  44560. i !== -1 && (e.parent = null,
  44561. e.dispatchEvent({
  44562. type: "removed"
  44563. }),
  44564. this.children.splice(i, 1))
  44565. },
  44566. getObjectById: function(e) {
  44567. return this.getObjectByProperty("id", e)
  44568. },
  44569. getObjectByName: function(e) {
  44570. return this.getObjectByProperty("name", e)
  44571. },
  44572. getObjectByProperty: function(e, t) {
  44573. if (this[e] === t)
  44574. return this;
  44575. for (var i = 0, n = this.children.length; i < n; i++) {
  44576. var r = this.children[i]
  44577. , o = r.getObjectByProperty(e, t);
  44578. if (void 0 !== o)
  44579. return o
  44580. }
  44581. },
  44582. getWorldPosition: function(e) {
  44583. var t = e || new n.Vector3;
  44584. return this.updateMatrixWorld(!0),
  44585. t.setFromMatrixPosition(this.matrixWorld)
  44586. },
  44587. getWorldQuaternion: function() {
  44588. var e = new n.Vector3
  44589. , t = new n.Vector3;
  44590. return function(i) {
  44591. var r = i || new n.Quaternion;
  44592. return this.updateMatrixWorld(!0),
  44593. this.matrixWorld.decompose(e, r, t),
  44594. r
  44595. }
  44596. }(),
  44597. getWorldRotation: function() {
  44598. var e = new n.Quaternion;
  44599. return function(t) {
  44600. var i = t || new n.Euler;
  44601. return this.getWorldQuaternion(e),
  44602. i.setFromQuaternion(e, this.rotation.order, !1)
  44603. }
  44604. }(),
  44605. getWorldScale: function() {
  44606. var e = new n.Vector3
  44607. , t = new n.Quaternion;
  44608. return function(i) {
  44609. var r = i || new n.Vector3;
  44610. return this.updateMatrixWorld(!0),
  44611. this.matrixWorld.decompose(e, t, r),
  44612. r
  44613. }
  44614. }(),
  44615. getWorldDirection: function() {
  44616. var e = new n.Quaternion;
  44617. return function(t) {
  44618. var i = t || new n.Vector3;
  44619. return this.getWorldQuaternion(e),
  44620. i.set(0, 0, 1).applyQuaternion(e)
  44621. }
  44622. }(),
  44623. raycast: function() {},
  44624. traverse: function(e) {
  44625. e(this);
  44626. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44627. t[i].traverse(e)
  44628. },
  44629. traverseVisible: function(e) {
  44630. if (this.visible !== !1) {
  44631. e(this);
  44632. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44633. t[i].traverseVisible(e)
  44634. }
  44635. },
  44636. traverseAncestors: function(e) {
  44637. var t = this.parent;
  44638. null !== t && (e(t),
  44639. t.traverseAncestors(e))
  44640. },
  44641. updateMatrix: function() {
  44642. this.matrix.compose(this.position, this.quaternion, this.scale),
  44643. this.matrixWorldNeedsUpdate = !0
  44644. },
  44645. updateMatrixWorld: function(e) {
  44646. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  44647. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  44648. this.matrixWorldNeedsUpdate = !1,
  44649. e = !0);
  44650. for (var t = 0, i = this.children.length; t < i; t++)
  44651. this.children[t].updateMatrixWorld(e)
  44652. },
  44653. toJSON: function(e) {
  44654. function t(e) {
  44655. var t = [];
  44656. for (var i in e) {
  44657. var n = e[i];
  44658. delete n.metadata,
  44659. t.push(n)
  44660. }
  44661. return t
  44662. }
  44663. var i = void 0 === e
  44664. , n = {};
  44665. i && (e = {
  44666. geometries: {},
  44667. materials: {},
  44668. textures: {},
  44669. images: {}
  44670. },
  44671. n.metadata = {
  44672. version: 4.4,
  44673. type: "Object",
  44674. generator: "Object3D.toJSON"
  44675. });
  44676. var r = {};
  44677. if (r.uuid = this.uuid,
  44678. r.type = this.type,
  44679. "" !== this.name && (r.name = this.name),
  44680. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44681. this.castShadow === !0 && (r.castShadow = !0),
  44682. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44683. this.visible === !1 && (r.visible = !1),
  44684. r.matrix = this.matrix.toArray(),
  44685. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44686. r.geometry = this.geometry.uuid),
  44687. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44688. r.material = this.material.uuid),
  44689. this.children.length > 0) {
  44690. r.children = [];
  44691. for (var o = 0; o < this.children.length; o++)
  44692. r.children.push(this.children[o].toJSON(e).object)
  44693. }
  44694. if (i) {
  44695. var a = t(e.geometries)
  44696. , s = t(e.materials)
  44697. , l = t(e.textures)
  44698. , c = t(e.images);
  44699. a.length > 0 && (n.geometries = a),
  44700. s.length > 0 && (n.materials = s),
  44701. l.length > 0 && (n.textures = l),
  44702. c.length > 0 && (n.images = c)
  44703. }
  44704. return n.object = r,
  44705. n
  44706. },
  44707. clone: function(e) {
  44708. return (new this.constructor).copy(this, e)
  44709. },
  44710. copy: function(e, t) {
  44711. if (void 0 === t && (t = !0),
  44712. this.name = e.name,
  44713. this.up.copy(e.up),
  44714. this.position.copy(e.position),
  44715. this.quaternion.copy(e.quaternion),
  44716. this.scale.copy(e.scale),
  44717. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44718. this.matrix.copy(e.matrix),
  44719. this.matrixWorld.copy(e.matrixWorld),
  44720. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44721. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44722. this.visible = e.visible,
  44723. this.castShadow = e.castShadow,
  44724. this.receiveShadow = e.receiveShadow,
  44725. this.frustumCulled = e.frustumCulled,
  44726. this.renderOrder = e.renderOrder,
  44727. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44728. t === !0)
  44729. for (var i = 0; i < e.children.length; i++) {
  44730. var n = e.children[i];
  44731. this.add(n.clone())
  44732. }
  44733. return this
  44734. }
  44735. },
  44736. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44737. n.Object3DIdCount = 0,
  44738. n.Face3 = function(e, t, i, r, o, a) {
  44739. this.a = e,
  44740. this.b = t,
  44741. this.c = i,
  44742. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44743. this.vertexNormals = Array.isArray(r) ? r : [],
  44744. this.color = o instanceof n.Color ? o : new n.Color,
  44745. this.vertexColors = Array.isArray(o) ? o : [],
  44746. this.materialIndex = void 0 !== a ? a : 0
  44747. }
  44748. ,
  44749. n.Face3.prototype = {
  44750. constructor: n.Face3,
  44751. clone: function() {
  44752. return (new this.constructor).copy(this)
  44753. },
  44754. copy: function(e) {
  44755. this.a = e.a,
  44756. this.b = e.b,
  44757. this.c = e.c,
  44758. this.normal.copy(e.normal),
  44759. this.color.copy(e.color),
  44760. this.materialIndex = e.materialIndex;
  44761. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44762. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44763. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44764. this.vertexColors[t] = e.vertexColors[t].clone();
  44765. return this
  44766. }
  44767. },
  44768. n.BufferAttribute = function(e, t) {
  44769. this.uuid = n.Math.generateUUID(),
  44770. this.array = e,
  44771. this.itemSize = t,
  44772. this.dynamic = !1,
  44773. this.updateRange = {
  44774. offset: 0,
  44775. count: -1
  44776. },
  44777. this.version = 0
  44778. }
  44779. ,
  44780. n.BufferAttribute.prototype = {
  44781. constructor: n.BufferAttribute,
  44782. get count() {
  44783. return this.array.length / this.itemSize
  44784. },
  44785. set needsUpdate(e) {
  44786. e === !0 && this.version++
  44787. },
  44788. setDynamic: function(e) {
  44789. return this.dynamic = e,
  44790. this
  44791. },
  44792. copy: function(e) {
  44793. return this.array = new e.array.constructor(e.array),
  44794. this.itemSize = e.itemSize,
  44795. this.dynamic = e.dynamic,
  44796. this
  44797. },
  44798. copyAt: function(e, t, i) {
  44799. e *= this.itemSize,
  44800. i *= t.itemSize;
  44801. for (var n = 0, r = this.itemSize; n < r; n++)
  44802. this.array[e + n] = t.array[i + n];
  44803. return this
  44804. },
  44805. copyArray: function(e) {
  44806. return this.array.set(e),
  44807. this
  44808. },
  44809. copyColorsArray: function(e) {
  44810. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44811. var a = e[r];
  44812. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44813. a = new n.Color),
  44814. t[i++] = a.r,
  44815. t[i++] = a.g,
  44816. t[i++] = a.b
  44817. }
  44818. return this
  44819. },
  44820. copyIndicesArray: function(e) {
  44821. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44822. var o = e[n];
  44823. t[i++] = o.a,
  44824. t[i++] = o.b,
  44825. t[i++] = o.c
  44826. }
  44827. return this
  44828. },
  44829. copyVector2sArray: function(e) {
  44830. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44831. var a = e[r];
  44832. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44833. a = new n.Vector2),
  44834. t[i++] = a.x,
  44835. t[i++] = a.y
  44836. }
  44837. return this
  44838. },
  44839. copyVector3sArray: function(e) {
  44840. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44841. var a = e[r];
  44842. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44843. a = new n.Vector3),
  44844. t[i++] = a.x,
  44845. t[i++] = a.y,
  44846. t[i++] = a.z
  44847. }
  44848. return this
  44849. },
  44850. copyVector4sArray: function(e) {
  44851. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44852. var a = e[r];
  44853. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  44854. a = new n.Vector4),
  44855. t[i++] = a.x,
  44856. t[i++] = a.y,
  44857. t[i++] = a.z,
  44858. t[i++] = a.w
  44859. }
  44860. return this
  44861. },
  44862. set: function(e, t) {
  44863. return void 0 === t && (t = 0),
  44864. this.array.set(e, t),
  44865. this
  44866. },
  44867. getX: function(e) {
  44868. return this.array[e * this.itemSize]
  44869. },
  44870. setX: function(e, t) {
  44871. return this.array[e * this.itemSize] = t,
  44872. this
  44873. },
  44874. getY: function(e) {
  44875. return this.array[e * this.itemSize + 1]
  44876. },
  44877. setY: function(e, t) {
  44878. return this.array[e * this.itemSize + 1] = t,
  44879. this
  44880. },
  44881. getZ: function(e) {
  44882. return this.array[e * this.itemSize + 2]
  44883. },
  44884. setZ: function(e, t) {
  44885. return this.array[e * this.itemSize + 2] = t,
  44886. this
  44887. },
  44888. getW: function(e) {
  44889. return this.array[e * this.itemSize + 3]
  44890. },
  44891. setW: function(e, t) {
  44892. return this.array[e * this.itemSize + 3] = t,
  44893. this
  44894. },
  44895. setXY: function(e, t, i) {
  44896. return e *= this.itemSize,
  44897. this.array[e + 0] = t,
  44898. this.array[e + 1] = i,
  44899. this
  44900. },
  44901. setXYZ: function(e, t, i, n) {
  44902. return e *= this.itemSize,
  44903. this.array[e + 0] = t,
  44904. this.array[e + 1] = i,
  44905. this.array[e + 2] = n,
  44906. this
  44907. },
  44908. setXYZW: function(e, t, i, n, r) {
  44909. return e *= this.itemSize,
  44910. this.array[e + 0] = t,
  44911. this.array[e + 1] = i,
  44912. this.array[e + 2] = n,
  44913. this.array[e + 3] = r,
  44914. this
  44915. },
  44916. clone: function() {
  44917. return (new this.constructor).copy(this)
  44918. }
  44919. },
  44920. n.Int8Attribute = function(e, t) {
  44921. return new n.BufferAttribute(new Int8Array(e),t)
  44922. }
  44923. ,
  44924. n.Uint8Attribute = function(e, t) {
  44925. return new n.BufferAttribute(new Uint8Array(e),t)
  44926. }
  44927. ,
  44928. n.Uint8ClampedAttribute = function(e, t) {
  44929. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44930. }
  44931. ,
  44932. n.Int16Attribute = function(e, t) {
  44933. return new n.BufferAttribute(new Int16Array(e),t)
  44934. }
  44935. ,
  44936. n.Uint16Attribute = function(e, t) {
  44937. return new n.BufferAttribute(new Uint16Array(e),t)
  44938. }
  44939. ;
  44940. n.Int32Attribute = function(e, t) {
  44941. return new n.BufferAttribute(new Int32Array(e),t)
  44942. }
  44943. ;
  44944. n.Uint32Attribute = function(e, t) {
  44945. return new n.BufferAttribute(new Uint32Array(e),t)
  44946. }
  44947. ,
  44948. n.Float32Attribute = function(e, t) {
  44949. return new n.BufferAttribute(new Float32Array(e),t)
  44950. }
  44951. ,
  44952. n.Float64Attribute = function(e, t) {
  44953. return new n.BufferAttribute(new Float64Array(e),t)
  44954. }
  44955. ,
  44956. n.DynamicBufferAttribute = function(e, t) {
  44957. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44958. new n.BufferAttribute(e,t).setDynamic(!0)
  44959. }
  44960. ,
  44961. n.InstancedBufferAttribute = function(e, t, i) {
  44962. n.BufferAttribute.call(this, e, t),
  44963. this.meshPerAttribute = i || 1
  44964. }
  44965. ,
  44966. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44967. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44968. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44969. return n.BufferAttribute.prototype.copy.call(this, e),
  44970. this.meshPerAttribute = e.meshPerAttribute,
  44971. this
  44972. }
  44973. ,
  44974. n.InterleavedBuffer = function(e, t) {
  44975. this.uuid = n.Math.generateUUID(),
  44976. this.array = e,
  44977. this.stride = t,
  44978. this.dynamic = !1,
  44979. this.updateRange = {
  44980. offset: 0,
  44981. count: -1
  44982. },
  44983. this.version = 0
  44984. }
  44985. ,
  44986. n.InterleavedBuffer.prototype = {
  44987. constructor: n.InterleavedBuffer,
  44988. get length() {
  44989. return this.array.length
  44990. },
  44991. get count() {
  44992. return this.array.length / this.stride
  44993. },
  44994. set needsUpdate(e) {
  44995. e === !0 && this.version++
  44996. },
  44997. setDynamic: function(e) {
  44998. return this.dynamic = e,
  44999. this
  45000. },
  45001. copy: function(e) {
  45002. return this.array = new e.array.constructor(e.array),
  45003. this.stride = e.stride,
  45004. this.dynamic = e.dynamic,
  45005. this
  45006. },
  45007. copyAt: function(e, t, i) {
  45008. e *= this.stride,
  45009. i *= t.stride;
  45010. for (var n = 0, r = this.stride; n < r; n++)
  45011. this.array[e + n] = t.array[i + n];
  45012. return this
  45013. },
  45014. set: function(e, t) {
  45015. return void 0 === t && (t = 0),
  45016. this.array.set(e, t),
  45017. this
  45018. },
  45019. clone: function() {
  45020. return (new this.constructor).copy(this)
  45021. }
  45022. },
  45023. n.InstancedInterleavedBuffer = function(e, t, i) {
  45024. n.InterleavedBuffer.call(this, e, t),
  45025. this.meshPerAttribute = i || 1
  45026. }
  45027. ,
  45028. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  45029. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  45030. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  45031. return n.InterleavedBuffer.prototype.copy.call(this, e),
  45032. this.meshPerAttribute = e.meshPerAttribute,
  45033. this
  45034. }
  45035. ,
  45036. n.InterleavedBufferAttribute = function(e, t, i) {
  45037. this.uuid = n.Math.generateUUID(),
  45038. this.data = e,
  45039. this.itemSize = t,
  45040. this.offset = i
  45041. }
  45042. ,
  45043. n.InterleavedBufferAttribute.prototype = {
  45044. constructor: n.InterleavedBufferAttribute,
  45045. get length() {
  45046. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  45047. this.array.length
  45048. },
  45049. get count() {
  45050. return this.data.count
  45051. },
  45052. setX: function(e, t) {
  45053. return this.data.array[e * this.data.stride + this.offset] = t,
  45054. this
  45055. },
  45056. setY: function(e, t) {
  45057. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  45058. this
  45059. },
  45060. setZ: function(e, t) {
  45061. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  45062. this
  45063. },
  45064. setW: function(e, t) {
  45065. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  45066. this
  45067. },
  45068. getX: function(e) {
  45069. return this.data.array[e * this.data.stride + this.offset]
  45070. },
  45071. getY: function(e) {
  45072. return this.data.array[e * this.data.stride + this.offset + 1]
  45073. },
  45074. getZ: function(e) {
  45075. return this.data.array[e * this.data.stride + this.offset + 2]
  45076. },
  45077. getW: function(e) {
  45078. return this.data.array[e * this.data.stride + this.offset + 3]
  45079. },
  45080. setXY: function(e, t, i) {
  45081. return e = e * this.data.stride + this.offset,
  45082. this.data.array[e + 0] = t,
  45083. this.data.array[e + 1] = i,
  45084. this
  45085. },
  45086. setXYZ: function(e, t, i, n) {
  45087. return e = e * this.data.stride + this.offset,
  45088. this.data.array[e + 0] = t,
  45089. this.data.array[e + 1] = i,
  45090. this.data.array[e + 2] = n,
  45091. this
  45092. },
  45093. setXYZW: function(e, t, i, n, r) {
  45094. return e = e * this.data.stride + this.offset,
  45095. this.data.array[e + 0] = t,
  45096. this.data.array[e + 1] = i,
  45097. this.data.array[e + 2] = n,
  45098. this.data.array[e + 3] = r,
  45099. this
  45100. }
  45101. },
  45102. n.Geometry = function() {
  45103. Object.defineProperty(this, "id", {
  45104. value: n.GeometryIdCount++
  45105. }),
  45106. this.uuid = n.Math.generateUUID(),
  45107. this.name = "",
  45108. this.type = "Geometry",
  45109. this.vertices = [],
  45110. this.colors = [],
  45111. this.faces = [],
  45112. this.faceVertexUvs = [[]],
  45113. this.morphTargets = [],
  45114. this.morphNormals = [],
  45115. this.skinWeights = [],
  45116. this.skinIndices = [],
  45117. this.lineDistances = [],
  45118. this.boundingBox = null,
  45119. this.boundingSphere = null,
  45120. this.verticesNeedUpdate = !1,
  45121. this.elementsNeedUpdate = !1,
  45122. this.uvsNeedUpdate = !1,
  45123. this.normalsNeedUpdate = !1,
  45124. this.colorsNeedUpdate = !1,
  45125. this.lineDistancesNeedUpdate = !1,
  45126. this.groupsNeedUpdate = !1
  45127. }
  45128. ,
  45129. n.Geometry.prototype = {
  45130. constructor: n.Geometry,
  45131. applyMatrix: function(e) {
  45132. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  45133. var o = this.vertices[i];
  45134. o.applyMatrix4(e)
  45135. }
  45136. for (var i = 0, r = this.faces.length; i < r; i++) {
  45137. var a = this.faces[i];
  45138. a.normal.applyMatrix3(t).normalize();
  45139. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  45140. a.vertexNormals[s].applyMatrix3(t).normalize()
  45141. }
  45142. return null !== this.boundingBox && this.computeBoundingBox(),
  45143. null !== this.boundingSphere && this.computeBoundingSphere(),
  45144. this.verticesNeedUpdate = !0,
  45145. this.normalsNeedUpdate = !0,
  45146. this
  45147. },
  45148. rotateX: function() {
  45149. var e;
  45150. return function(t) {
  45151. return void 0 === e && (e = new n.Matrix4),
  45152. e.makeRotationX(t),
  45153. this.applyMatrix(e),
  45154. this
  45155. }
  45156. }(),
  45157. rotateY: function() {
  45158. var e;
  45159. return function(t) {
  45160. return void 0 === e && (e = new n.Matrix4),
  45161. e.makeRotationY(t),
  45162. this.applyMatrix(e),
  45163. this
  45164. }
  45165. }(),
  45166. rotateZ: function() {
  45167. var e;
  45168. return function(t) {
  45169. return void 0 === e && (e = new n.Matrix4),
  45170. e.makeRotationZ(t),
  45171. this.applyMatrix(e),
  45172. this
  45173. }
  45174. }(),
  45175. translate: function() {
  45176. var e;
  45177. return function(t, i, r) {
  45178. return void 0 === e && (e = new n.Matrix4),
  45179. e.makeTranslation(t, i, r),
  45180. this.applyMatrix(e),
  45181. this
  45182. }
  45183. }(),
  45184. scale: function() {
  45185. var e;
  45186. return function(t, i, r) {
  45187. return void 0 === e && (e = new n.Matrix4),
  45188. e.makeScale(t, i, r),
  45189. this.applyMatrix(e),
  45190. this
  45191. }
  45192. }(),
  45193. lookAt: function() {
  45194. var e;
  45195. return function(t) {
  45196. void 0 === e && (e = new n.Object3D),
  45197. e.lookAt(t),
  45198. e.updateMatrix(),
  45199. this.applyMatrix(e.matrix)
  45200. }
  45201. }(),
  45202. fromBufferGeometry: function(e) {
  45203. function t(e, t, r, o) {
  45204. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  45205. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  45206. , g = new n.Face3(e,t,r,a,f,o);
  45207. i.faces.push(g),
  45208. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  45209. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  45210. }
  45211. var i = this
  45212. , r = null !== e.index ? e.index.array : void 0
  45213. , o = e.attributes
  45214. , a = o.position.array
  45215. , s = void 0 !== o.normal ? o.normal.array : void 0
  45216. , l = void 0 !== o.color ? o.color.array : void 0
  45217. , c = void 0 !== o.uv ? o.uv.array : void 0
  45218. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  45219. void 0 !== h && (this.faceVertexUvs[1] = []);
  45220. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  45221. g += 2)
  45222. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  45223. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  45224. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  45225. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  45226. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  45227. if (void 0 !== r) {
  45228. var m = e.groups;
  45229. if (m.length > 0)
  45230. for (var f = 0; f < m.length; f++)
  45231. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  45232. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  45233. else
  45234. for (var f = 0; f < r.length; f += 3)
  45235. t(r[f], r[f + 1], r[f + 2])
  45236. } else
  45237. for (var f = 0; f < a.length / 3; f += 3)
  45238. t(f, f + 1, f + 2);
  45239. return this.computeFaceNormals(),
  45240. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45241. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45242. this
  45243. },
  45244. center: function() {
  45245. this.computeBoundingBox();
  45246. var e = this.boundingBox.center().negate();
  45247. return this.translate(e.x, e.y, e.z),
  45248. e
  45249. },
  45250. normalize: function() {
  45251. this.computeBoundingSphere();
  45252. var e = this.boundingSphere.center
  45253. , t = this.boundingSphere.radius
  45254. , i = 0 === t ? 1 : 1 / t
  45255. , r = new n.Matrix4;
  45256. 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),
  45257. this.applyMatrix(r),
  45258. this
  45259. },
  45260. computeFaceNormals: function() {
  45261. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  45262. var o = this.faces[i]
  45263. , a = this.vertices[o.a]
  45264. , s = this.vertices[o.b]
  45265. , l = this.vertices[o.c];
  45266. e.subVectors(l, s),
  45267. t.subVectors(a, s),
  45268. e.cross(t),
  45269. e.normalize(),
  45270. o.normal.copy(e)
  45271. }
  45272. },
  45273. computeVertexNormals: function(e) {
  45274. void 0 === e && (e = !0);
  45275. var t, i, r, o, a, s;
  45276. for (s = new Array(this.vertices.length),
  45277. t = 0,
  45278. i = this.vertices.length; t < i; t++)
  45279. s[t] = new n.Vector3;
  45280. if (e) {
  45281. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  45282. for (r = 0,
  45283. o = this.faces.length; r < o; r++)
  45284. a = this.faces[r],
  45285. l = this.vertices[a.a],
  45286. c = this.vertices[a.b],
  45287. h = this.vertices[a.c],
  45288. u.subVectors(h, c),
  45289. d.subVectors(l, c),
  45290. u.cross(d),
  45291. s[a.a].add(u),
  45292. s[a.b].add(u),
  45293. s[a.c].add(u)
  45294. } else
  45295. for (r = 0,
  45296. o = this.faces.length; r < o; r++)
  45297. a = this.faces[r],
  45298. s[a.a].add(a.normal),
  45299. s[a.b].add(a.normal),
  45300. s[a.c].add(a.normal);
  45301. for (t = 0,
  45302. i = this.vertices.length; t < i; t++)
  45303. s[t].normalize();
  45304. for (r = 0,
  45305. o = this.faces.length; r < o; r++) {
  45306. a = this.faces[r];
  45307. var p = a.vertexNormals;
  45308. 3 === p.length ? (p[0].copy(s[a.a]),
  45309. p[1].copy(s[a.b]),
  45310. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  45311. p[1] = s[a.b].clone(),
  45312. p[2] = s[a.c].clone())
  45313. }
  45314. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  45315. },
  45316. computeMorphNormals: function() {
  45317. var e, t, i, r, o;
  45318. for (i = 0,
  45319. r = this.faces.length; i < r; i++)
  45320. for (o = this.faces[i],
  45321. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  45322. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  45323. e = 0,
  45324. t = o.vertexNormals.length; e < t; e++)
  45325. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  45326. var a = new n.Geometry;
  45327. for (a.faces = this.faces,
  45328. e = 0,
  45329. t = this.morphTargets.length; e < t; e++) {
  45330. if (!this.morphNormals[e]) {
  45331. this.morphNormals[e] = {},
  45332. this.morphNormals[e].faceNormals = [],
  45333. this.morphNormals[e].vertexNormals = [];
  45334. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  45335. for (i = 0,
  45336. r = this.faces.length; i < r; i++)
  45337. s = new n.Vector3,
  45338. l = {
  45339. a: new n.Vector3,
  45340. b: new n.Vector3,
  45341. c: new n.Vector3
  45342. },
  45343. c.push(s),
  45344. h.push(l)
  45345. }
  45346. var u = this.morphNormals[e];
  45347. a.vertices = this.morphTargets[e].vertices,
  45348. a.computeFaceNormals(),
  45349. a.computeVertexNormals();
  45350. var s, l;
  45351. for (i = 0,
  45352. r = this.faces.length; i < r; i++)
  45353. o = this.faces[i],
  45354. s = u.faceNormals[i],
  45355. l = u.vertexNormals[i],
  45356. s.copy(o.normal),
  45357. l.a.copy(o.vertexNormals[0]),
  45358. l.b.copy(o.vertexNormals[1]),
  45359. l.c.copy(o.vertexNormals[2])
  45360. }
  45361. for (i = 0,
  45362. r = this.faces.length; i < r; i++)
  45363. o = this.faces[i],
  45364. o.normal = o.__originalFaceNormal,
  45365. o.vertexNormals = o.__originalVertexNormals
  45366. },
  45367. computeTangents: function() {
  45368. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  45369. },
  45370. computeLineDistances: function() {
  45371. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  45372. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  45373. this.lineDistances[i] = e
  45374. },
  45375. computeBoundingBox: function() {
  45376. null === this.boundingBox && (this.boundingBox = new n.Box3),
  45377. this.boundingBox.setFromPoints(this.vertices)
  45378. },
  45379. computeBoundingSphere: function() {
  45380. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  45381. this.boundingSphere.setFromPoints(this.vertices)
  45382. },
  45383. merge: function(e, t, i) {
  45384. if (e instanceof n.Geometry == !1)
  45385. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  45386. 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];
  45387. void 0 === i && (i = 0),
  45388. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  45389. for (var d = 0, p = s.length; d < p; d++) {
  45390. var f = s[d]
  45391. , g = f.clone();
  45392. void 0 !== t && g.applyMatrix4(t),
  45393. a.push(g)
  45394. }
  45395. for (d = 0,
  45396. p = c.length; d < p; d++) {
  45397. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  45398. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  45399. m.normal.copy(y.normal),
  45400. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  45401. for (var E = 0, b = C.length; E < b; E++)
  45402. v = C[E].clone(),
  45403. void 0 !== r && v.applyMatrix3(r).normalize(),
  45404. m.vertexNormals.push(v);
  45405. m.color.copy(y.color);
  45406. for (var E = 0, b = I.length; E < b; E++)
  45407. A = I[E],
  45408. m.vertexColors.push(A.clone());
  45409. m.materialIndex = y.materialIndex + i,
  45410. l.push(m)
  45411. }
  45412. for (d = 0,
  45413. p = u.length; d < p; d++) {
  45414. var w = u[d]
  45415. , _ = [];
  45416. if (void 0 !== w) {
  45417. for (var E = 0, b = w.length; E < b; E++)
  45418. _.push(w[E].clone());
  45419. h.push(_)
  45420. }
  45421. }
  45422. },
  45423. mergeMesh: function(e) {
  45424. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  45425. void this.merge(e.geometry, e.matrix))
  45426. },
  45427. mergeVertices: function() {
  45428. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  45429. for (i = 0,
  45430. n = this.vertices.length; i < n; i++)
  45431. e = this.vertices[i],
  45432. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  45433. void 0 === l[t] ? (l[t] = i,
  45434. c.push(this.vertices[i]),
  45435. h[i] = c.length - 1) : h[i] = h[l[t]];
  45436. var p = [];
  45437. for (i = 0,
  45438. n = this.faces.length; i < n; i++) {
  45439. r = this.faces[i],
  45440. r.a = h[r.a],
  45441. r.b = h[r.b],
  45442. r.c = h[r.c],
  45443. o = [r.a, r.b, r.c];
  45444. for (var f = -1, g = 0; g < 3; g++)
  45445. if (o[g] === o[(g + 1) % 3]) {
  45446. f = g,
  45447. p.push(i);
  45448. break
  45449. }
  45450. }
  45451. for (i = p.length - 1; i >= 0; i--) {
  45452. var m = p[i];
  45453. for (this.faces.splice(m, 1),
  45454. a = 0,
  45455. s = this.faceVertexUvs.length; a < s; a++)
  45456. this.faceVertexUvs[a].splice(m, 1)
  45457. }
  45458. var v = this.vertices.length - c.length;
  45459. return this.vertices = c,
  45460. v
  45461. },
  45462. sortFacesByMaterialIndex: function() {
  45463. function e(e, t) {
  45464. return e.materialIndex - t.materialIndex
  45465. }
  45466. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  45467. t[n]._id = n;
  45468. t.sort(e);
  45469. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  45470. a && a.length === i && (r = []),
  45471. s && s.length === i && (o = []);
  45472. for (var n = 0; n < i; n++) {
  45473. var l = t[n]._id;
  45474. r && r.push(a[l]),
  45475. o && o.push(s[l])
  45476. }
  45477. r && (this.faceVertexUvs[0] = r),
  45478. o && (this.faceVertexUvs[1] = o)
  45479. },
  45480. toJSON: function() {
  45481. function e(e, t, i) {
  45482. return i ? e | 1 << t : e & ~(1 << t)
  45483. }
  45484. function t(e) {
  45485. var t = e.x.toString() + e.y.toString() + e.z.toString();
  45486. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  45487. u.push(e.x, e.y, e.z),
  45488. d[t])
  45489. }
  45490. function i(e) {
  45491. var t = e.r.toString() + e.g.toString() + e.b.toString();
  45492. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  45493. p.push(e.getHex()),
  45494. f[t])
  45495. }
  45496. function n(e) {
  45497. var t = e.x.toString() + e.y.toString();
  45498. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  45499. g.push(e.x, e.y),
  45500. m[t])
  45501. }
  45502. var r = {
  45503. metadata: {
  45504. version: 4.4,
  45505. type: "Geometry",
  45506. generator: "Geometry.toJSON"
  45507. }
  45508. };
  45509. if (r.uuid = this.uuid,
  45510. r.type = this.type,
  45511. "" !== this.name && (r.name = this.name),
  45512. void 0 !== this.parameters) {
  45513. var o = this.parameters;
  45514. for (var a in o)
  45515. void 0 !== o[a] && (r[a] = o[a]);
  45516. return r
  45517. }
  45518. for (var s = [], l = 0; l < this.vertices.length; l++) {
  45519. var c = this.vertices[l];
  45520. s.push(c.x, c.y, c.z)
  45521. }
  45522. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  45523. var v = this.faces[l]
  45524. , A = !0
  45525. , y = !1
  45526. , C = void 0 !== this.faceVertexUvs[0][l]
  45527. , I = v.normal.length() > 0
  45528. , E = v.vertexNormals.length > 0
  45529. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  45530. , w = v.vertexColors.length > 0
  45531. , _ = 0;
  45532. if (_ = e(_, 0, 0),
  45533. _ = e(_, 1, A),
  45534. _ = e(_, 2, y),
  45535. _ = e(_, 3, C),
  45536. _ = e(_, 4, I),
  45537. _ = e(_, 5, E),
  45538. _ = e(_, 6, b),
  45539. _ = e(_, 7, w),
  45540. h.push(_),
  45541. h.push(v.a, v.b, v.c),
  45542. h.push(v.materialIndex),
  45543. C) {
  45544. var T = this.faceVertexUvs[0][l];
  45545. h.push(n(T[0]), n(T[1]), n(T[2]))
  45546. }
  45547. if (I && h.push(t(v.normal)),
  45548. E) {
  45549. var x = v.vertexNormals;
  45550. h.push(t(x[0]), t(x[1]), t(x[2]))
  45551. }
  45552. if (b && h.push(i(v.color)),
  45553. w) {
  45554. var S = v.vertexColors;
  45555. h.push(i(S[0]), i(S[1]), i(S[2]))
  45556. }
  45557. }
  45558. return r.data = {},
  45559. r.data.vertices = s,
  45560. r.data.normals = u,
  45561. p.length > 0 && (r.data.colors = p),
  45562. g.length > 0 && (r.data.uvs = [g]),
  45563. r.data.faces = h,
  45564. r
  45565. },
  45566. clone: function() {
  45567. return (new n.Geometry).copy(this)
  45568. },
  45569. copy: function(e) {
  45570. this.vertices = [],
  45571. this.faces = [],
  45572. this.faceVertexUvs = [[]];
  45573. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  45574. this.vertices.push(t[i].clone());
  45575. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  45576. this.faces.push(r[i].clone());
  45577. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  45578. var o = e.faceVertexUvs[i];
  45579. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  45580. for (var a = 0, s = o.length; a < s; a++) {
  45581. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  45582. var d = l[h];
  45583. c.push(d.clone())
  45584. }
  45585. this.faceVertexUvs[i].push(c)
  45586. }
  45587. }
  45588. return this
  45589. },
  45590. dispose: function() {
  45591. this.dispatchEvent({
  45592. type: "dispose"
  45593. })
  45594. }
  45595. },
  45596. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  45597. n.GeometryIdCount = 0,
  45598. n.DirectGeometry = function() {
  45599. Object.defineProperty(this, "id", {
  45600. value: n.GeometryIdCount++
  45601. }),
  45602. this.uuid = n.Math.generateUUID(),
  45603. this.name = "",
  45604. this.type = "DirectGeometry",
  45605. this.indices = [],
  45606. this.vertices = [],
  45607. this.normals = [],
  45608. this.colors = [],
  45609. this.uvs = [],
  45610. this.uvs2 = [],
  45611. this.groups = [],
  45612. this.morphTargets = {},
  45613. this.skinWeights = [],
  45614. this.skinIndices = [],
  45615. this.boundingBox = null,
  45616. this.boundingSphere = null,
  45617. this.verticesNeedUpdate = !1,
  45618. this.normalsNeedUpdate = !1,
  45619. this.colorsNeedUpdate = !1,
  45620. this.uvsNeedUpdate = !1,
  45621. this.groupsNeedUpdate = !1
  45622. }
  45623. ,
  45624. n.DirectGeometry.prototype = {
  45625. constructor: n.DirectGeometry,
  45626. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  45627. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  45628. computeFaceNormals: function() {
  45629. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  45630. },
  45631. computeVertexNormals: function() {
  45632. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  45633. },
  45634. computeGroups: function(e) {
  45635. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  45636. var a = r[o];
  45637. a.materialIndex !== i && (i = a.materialIndex,
  45638. void 0 !== t && (t.count = 3 * o - t.start,
  45639. n.push(t)),
  45640. t = {
  45641. start: 3 * o,
  45642. materialIndex: i
  45643. })
  45644. }
  45645. void 0 !== t && (t.count = 3 * o - t.start,
  45646. n.push(t)),
  45647. this.groups = n
  45648. },
  45649. fromGeometry: function(e) {
  45650. 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;
  45651. if (c > 0) {
  45652. t = [];
  45653. for (var h = 0; h < c; h++)
  45654. t[h] = [];
  45655. this.morphTargets.position = t
  45656. }
  45657. var u, d = e.morphNormals, p = d.length;
  45658. if (p > 0) {
  45659. u = [];
  45660. for (var h = 0; h < p; h++)
  45661. u[h] = [];
  45662. this.morphTargets.normal = u
  45663. }
  45664. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45665. var A = i[h];
  45666. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45667. var y = A.vertexNormals;
  45668. if (3 === y.length)
  45669. this.normals.push(y[0], y[1], y[2]);
  45670. else {
  45671. var C = A.normal;
  45672. this.normals.push(C, C, C)
  45673. }
  45674. var I = A.vertexColors;
  45675. if (3 === I.length)
  45676. this.colors.push(I[0], I[1], I[2]);
  45677. else {
  45678. var E = A.color;
  45679. this.colors.push(E, E, E)
  45680. }
  45681. if (a === !0) {
  45682. var b = o[0][h];
  45683. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45684. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45685. }
  45686. if (s === !0) {
  45687. var b = o[1][h];
  45688. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45689. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45690. }
  45691. for (var w = 0; w < c; w++) {
  45692. var _ = l[w].vertices;
  45693. t[w].push(_[A.a], _[A.b], _[A.c])
  45694. }
  45695. for (var w = 0; w < p; w++) {
  45696. var T = d[w].vertexNormals[h];
  45697. u[w].push(T.a, T.b, T.c)
  45698. }
  45699. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45700. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45701. }
  45702. return this.computeGroups(e),
  45703. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45704. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45705. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45706. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45707. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45708. this
  45709. },
  45710. dispose: function() {
  45711. this.dispatchEvent({
  45712. type: "dispose"
  45713. })
  45714. }
  45715. },
  45716. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45717. n.BufferGeometry = function() {
  45718. Object.defineProperty(this, "id", {
  45719. value: n.GeometryIdCount++
  45720. }),
  45721. this.uuid = n.Math.generateUUID(),
  45722. this.name = "",
  45723. this.type = "BufferGeometry",
  45724. this.index = null,
  45725. this.attributes = {},
  45726. this.morphAttributes = {},
  45727. this.groups = [],
  45728. this.boundingBox = null,
  45729. this.boundingSphere = null,
  45730. this.drawRange = {
  45731. start: 0,
  45732. count: 1 / 0
  45733. }
  45734. }
  45735. ,
  45736. n.BufferGeometry.prototype = {
  45737. constructor: n.BufferGeometry,
  45738. getIndex: function() {
  45739. return this.index
  45740. },
  45741. setIndex: function(e) {
  45742. this.index = e
  45743. },
  45744. addAttribute: function(e, t) {
  45745. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45746. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45747. void this.setIndex(t)) : (this.attributes[e] = t,
  45748. this)
  45749. },
  45750. getAttribute: function(e) {
  45751. return this.attributes[e]
  45752. },
  45753. removeAttribute: function(e) {
  45754. return delete this.attributes[e],
  45755. this
  45756. },
  45757. addGroup: function(e, t, i) {
  45758. this.groups.push({
  45759. start: e,
  45760. count: t,
  45761. materialIndex: void 0 !== i ? i : 0
  45762. })
  45763. },
  45764. clearGroups: function() {
  45765. this.groups = []
  45766. },
  45767. setDrawRange: function(e, t) {
  45768. this.drawRange.start = e,
  45769. this.drawRange.count = t
  45770. },
  45771. applyMatrix: function(e) {
  45772. var t = this.attributes.position;
  45773. void 0 !== t && (e.applyToVector3Array(t.array),
  45774. t.needsUpdate = !0);
  45775. var i = this.attributes.normal;
  45776. if (void 0 !== i) {
  45777. var r = (new n.Matrix3).getNormalMatrix(e);
  45778. r.applyToVector3Array(i.array),
  45779. i.needsUpdate = !0
  45780. }
  45781. return null !== this.boundingBox && this.computeBoundingBox(),
  45782. null !== this.boundingSphere && this.computeBoundingSphere(),
  45783. this
  45784. },
  45785. rotateX: function() {
  45786. var e;
  45787. return function(t) {
  45788. return void 0 === e && (e = new n.Matrix4),
  45789. e.makeRotationX(t),
  45790. this.applyMatrix(e),
  45791. this
  45792. }
  45793. }(),
  45794. rotateY: function() {
  45795. var e;
  45796. return function(t) {
  45797. return void 0 === e && (e = new n.Matrix4),
  45798. e.makeRotationY(t),
  45799. this.applyMatrix(e),
  45800. this
  45801. }
  45802. }(),
  45803. rotateZ: function() {
  45804. var e;
  45805. return function(t) {
  45806. return void 0 === e && (e = new n.Matrix4),
  45807. e.makeRotationZ(t),
  45808. this.applyMatrix(e),
  45809. this
  45810. }
  45811. }(),
  45812. translate: function() {
  45813. var e;
  45814. return function(t, i, r) {
  45815. return void 0 === e && (e = new n.Matrix4),
  45816. e.makeTranslation(t, i, r),
  45817. this.applyMatrix(e),
  45818. this
  45819. }
  45820. }(),
  45821. scale: function() {
  45822. var e;
  45823. return function(t, i, r) {
  45824. return void 0 === e && (e = new n.Matrix4),
  45825. e.makeScale(t, i, r),
  45826. this.applyMatrix(e),
  45827. this
  45828. }
  45829. }(),
  45830. lookAt: function() {
  45831. var e;
  45832. return function(t) {
  45833. void 0 === e && (e = new n.Object3D),
  45834. e.lookAt(t),
  45835. e.updateMatrix(),
  45836. this.applyMatrix(e.matrix)
  45837. }
  45838. }(),
  45839. center: function() {
  45840. this.computeBoundingBox();
  45841. var e = this.boundingBox.center().negate();
  45842. return this.translate(e.x, e.y, e.z),
  45843. e
  45844. },
  45845. setFromObject: function(e) {
  45846. var t = e.geometry;
  45847. if (e instanceof n.Points || e instanceof n.Line) {
  45848. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45849. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45850. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45851. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45852. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45853. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45854. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45855. }
  45856. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45857. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45858. } else
  45859. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45860. return this
  45861. },
  45862. updateFromObject: function(e) {
  45863. var t = e.geometry;
  45864. if (e instanceof n.Mesh) {
  45865. var i = t.__directGeometry;
  45866. if (void 0 === i)
  45867. return this.fromGeometry(t);
  45868. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45869. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45870. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45871. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45872. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45873. t.verticesNeedUpdate = !1,
  45874. t.normalsNeedUpdate = !1,
  45875. t.colorsNeedUpdate = !1,
  45876. t.uvsNeedUpdate = !1,
  45877. t.groupsNeedUpdate = !1,
  45878. t = i
  45879. }
  45880. if (t.verticesNeedUpdate === !0) {
  45881. var r = this.attributes.position;
  45882. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45883. r.needsUpdate = !0),
  45884. t.verticesNeedUpdate = !1
  45885. }
  45886. if (t.normalsNeedUpdate === !0) {
  45887. var r = this.attributes.normal;
  45888. void 0 !== r && (r.copyVector3sArray(t.normals),
  45889. r.needsUpdate = !0),
  45890. t.normalsNeedUpdate = !1
  45891. }
  45892. if (t.colorsNeedUpdate === !0) {
  45893. var r = this.attributes.color;
  45894. void 0 !== r && (r.copyColorsArray(t.colors),
  45895. r.needsUpdate = !0),
  45896. t.colorsNeedUpdate = !1
  45897. }
  45898. if (t.uvsNeedUpdate) {
  45899. var r = this.attributes.uv;
  45900. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45901. r.needsUpdate = !0),
  45902. t.uvsNeedUpdate = !1
  45903. }
  45904. if (t.lineDistancesNeedUpdate) {
  45905. var r = this.attributes.lineDistance;
  45906. void 0 !== r && (r.copyArray(t.lineDistances),
  45907. r.needsUpdate = !0),
  45908. t.lineDistancesNeedUpdate = !1
  45909. }
  45910. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45911. this.groups = t.groups,
  45912. t.groupsNeedUpdate = !1),
  45913. this
  45914. },
  45915. fromGeometry: function(e) {
  45916. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45917. this.fromDirectGeometry(e.__directGeometry)
  45918. },
  45919. fromDirectGeometry: function(e) {
  45920. var t = new Float32Array(3 * e.vertices.length);
  45921. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45922. e.normals.length > 0) {
  45923. var i = new Float32Array(3 * e.normals.length);
  45924. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45925. }
  45926. if (e.colors.length > 0) {
  45927. var r = new Float32Array(3 * e.colors.length);
  45928. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45929. }
  45930. if (e.uvs.length > 0) {
  45931. var o = new Float32Array(2 * e.uvs.length);
  45932. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45933. }
  45934. if (e.uvs2.length > 0) {
  45935. var a = new Float32Array(2 * e.uvs2.length);
  45936. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45937. }
  45938. if (e.indices.length > 0) {
  45939. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45940. , l = new s(3 * e.indices.length);
  45941. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45942. }
  45943. this.groups = e.groups;
  45944. for (var c in e.morphTargets) {
  45945. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45946. var f = u[d]
  45947. , g = new n.Float32Attribute(3 * f.length,3);
  45948. h.push(g.copyVector3sArray(f))
  45949. }
  45950. this.morphAttributes[c] = h
  45951. }
  45952. if (e.skinIndices.length > 0) {
  45953. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45954. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45955. }
  45956. if (e.skinWeights.length > 0) {
  45957. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45958. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45959. }
  45960. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45961. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45962. this
  45963. },
  45964. computeBoundingBox: function() {
  45965. new n.Vector3;
  45966. return function() {
  45967. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45968. var e = this.attributes.position.array;
  45969. e && this.boundingBox.setFromArray(e),
  45970. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45971. this.boundingBox.max.set(0, 0, 0)),
  45972. (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)
  45973. }
  45974. }(),
  45975. computeBoundingSphere: function() {
  45976. var e = new n.Box3
  45977. , t = new n.Vector3;
  45978. return function() {
  45979. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45980. var i = this.attributes.position.array;
  45981. if (i) {
  45982. var r = this.boundingSphere.center;
  45983. e.setFromArray(i),
  45984. e.center(r);
  45985. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45986. t.fromArray(i, a),
  45987. o = Math.max(o, r.distanceToSquared(t));
  45988. this.boundingSphere.radius = Math.sqrt(o),
  45989. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45990. }
  45991. }
  45992. }(),
  45993. computeFaceNormals: function() {},
  45994. computeVertexNormals: function() {
  45995. var e = this.index
  45996. , t = this.attributes
  45997. , i = this.groups;
  45998. if (t.position) {
  45999. var r = t.position.array;
  46000. if (void 0 === t.normal)
  46001. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  46002. else
  46003. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  46004. o[a] = 0;
  46005. 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;
  46006. if (e) {
  46007. var v = e.array;
  46008. 0 === i.length && this.addGroup(0, v.length);
  46009. for (var A = 0, y = i.length; A < y; ++A)
  46010. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  46011. l = 3 * v[a + 0],
  46012. c = 3 * v[a + 1],
  46013. h = 3 * v[a + 2],
  46014. d.fromArray(r, l),
  46015. p.fromArray(r, c),
  46016. f.fromArray(r, h),
  46017. g.subVectors(f, p),
  46018. m.subVectors(d, p),
  46019. g.cross(m),
  46020. u[l] += g.x,
  46021. u[l + 1] += g.y,
  46022. u[l + 2] += g.z,
  46023. u[c] += g.x,
  46024. u[c + 1] += g.y,
  46025. u[c + 2] += g.z,
  46026. u[h] += g.x,
  46027. u[h + 1] += g.y,
  46028. u[h + 2] += g.z
  46029. } else
  46030. for (var a = 0, s = r.length; a < s; a += 9)
  46031. d.fromArray(r, a),
  46032. p.fromArray(r, a + 3),
  46033. f.fromArray(r, a + 6),
  46034. g.subVectors(f, p),
  46035. m.subVectors(d, p),
  46036. g.cross(m),
  46037. u[a] = g.x,
  46038. u[a + 1] = g.y,
  46039. u[a + 2] = g.z,
  46040. u[a + 3] = g.x,
  46041. u[a + 4] = g.y,
  46042. u[a + 5] = g.z,
  46043. u[a + 6] = g.x,
  46044. u[a + 7] = g.y,
  46045. u[a + 8] = g.z;
  46046. this.normalizeNormals(),
  46047. t.normal.needsUpdate = !0
  46048. }
  46049. },
  46050. merge: function(e, t) {
  46051. if (e instanceof n.BufferGeometry == !1)
  46052. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  46053. void 0 === t && (t = 0);
  46054. var i = this.attributes;
  46055. for (var r in i)
  46056. if (void 0 !== e.attributes[r])
  46057. 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++,
  46058. u++)
  46059. a[u] = l[h];
  46060. return this
  46061. },
  46062. normalizeNormals: function() {
  46063. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  46064. e = r[o],
  46065. t = r[o + 1],
  46066. i = r[o + 2],
  46067. n = 1 / Math.sqrt(e * e + t * t + i * i),
  46068. r[o] *= n,
  46069. r[o + 1] *= n,
  46070. r[o + 2] *= n
  46071. },
  46072. toNonIndexed: function() {
  46073. if (null === this.index)
  46074. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  46075. this;
  46076. var e = new n.BufferGeometry
  46077. , t = this.index.array
  46078. , i = this.attributes;
  46079. for (var r in i) {
  46080. 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++) {
  46081. c = t[u] * s;
  46082. for (var p = 0; p < s; p++)
  46083. l[h++] = a[c++]
  46084. }
  46085. e.addAttribute(r, new n.BufferAttribute(l,s))
  46086. }
  46087. return e
  46088. },
  46089. toJSON: function() {
  46090. var e = {
  46091. metadata: {
  46092. version: 4.4,
  46093. type: "BufferGeometry",
  46094. generator: "BufferGeometry.toJSON"
  46095. }
  46096. };
  46097. if (e.uuid = this.uuid,
  46098. e.type = this.type,
  46099. "" !== this.name && (e.name = this.name),
  46100. void 0 !== this.parameters) {
  46101. var t = this.parameters;
  46102. for (var i in t)
  46103. void 0 !== t[i] && (e[i] = t[i]);
  46104. return e
  46105. }
  46106. e.data = {
  46107. attributes: {}
  46108. };
  46109. var n = this.index;
  46110. if (null !== n) {
  46111. var r = Array.prototype.slice.call(n.array);
  46112. e.data.index = {
  46113. type: n.array.constructor.name,
  46114. array: r
  46115. }
  46116. }
  46117. var o = this.attributes;
  46118. for (var i in o) {
  46119. var a = o[i]
  46120. , r = Array.prototype.slice.call(a.array);
  46121. e.data.attributes[i] = {
  46122. itemSize: a.itemSize,
  46123. type: a.array.constructor.name,
  46124. array: r
  46125. }
  46126. }
  46127. var s = this.groups;
  46128. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  46129. var l = this.boundingSphere;
  46130. return null !== l && (e.data.boundingSphere = {
  46131. center: l.center.toArray(),
  46132. radius: l.radius
  46133. }),
  46134. e
  46135. },
  46136. clone: function() {
  46137. return (new n.BufferGeometry).copy(this)
  46138. },
  46139. copy: function(e) {
  46140. var t = e.index;
  46141. null !== t && this.setIndex(t.clone());
  46142. var i = e.attributes;
  46143. for (var n in i) {
  46144. var r = i[n];
  46145. this.addAttribute(n, r.clone())
  46146. }
  46147. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  46148. var l = o[a];
  46149. this.addGroup(l.start, l.count)
  46150. }
  46151. return this
  46152. },
  46153. dispose: function() {
  46154. this.dispatchEvent({
  46155. type: "dispose"
  46156. })
  46157. }
  46158. },
  46159. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  46160. n.BufferGeometry.MaxIndex = 65535,
  46161. n.InstancedBufferGeometry = function() {
  46162. n.BufferGeometry.call(this),
  46163. this.type = "InstancedBufferGeometry",
  46164. this.maxInstancedCount = void 0
  46165. }
  46166. ,
  46167. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  46168. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  46169. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  46170. this.groups.push({
  46171. start: e,
  46172. count: t,
  46173. instances: i
  46174. })
  46175. }
  46176. ,
  46177. n.InstancedBufferGeometry.prototype.copy = function(e) {
  46178. var t = e.index;
  46179. null !== t && this.setIndex(t.clone());
  46180. var i = e.attributes;
  46181. for (var n in i) {
  46182. var r = i[n];
  46183. this.addAttribute(n, r.clone())
  46184. }
  46185. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  46186. var l = o[a];
  46187. this.addGroup(l.start, l.count, l.instances)
  46188. }
  46189. return this
  46190. }
  46191. ,
  46192. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  46193. n.Uniform = function(e, t) {
  46194. this.type = e,
  46195. this.value = t,
  46196. this.dynamic = !1
  46197. }
  46198. ,
  46199. n.Uniform.prototype = {
  46200. constructor: n.Uniform,
  46201. onUpdate: function(e) {
  46202. return this.dynamic = !0,
  46203. this.onUpdateCallback = e,
  46204. this
  46205. }
  46206. },
  46207. n.AnimationClip = function(e, t, i) {
  46208. this.name = e || n.Math.generateUUID(),
  46209. this.tracks = i,
  46210. this.duration = void 0 !== t ? t : -1,
  46211. this.duration < 0 && this.resetDuration(),
  46212. this.trim(),
  46213. this.optimize()
  46214. }
  46215. ,
  46216. n.AnimationClip.prototype = {
  46217. constructor: n.AnimationClip,
  46218. resetDuration: function() {
  46219. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  46220. var r = this.tracks[i];
  46221. t = Math.max(t, r.times[r.times.length - 1])
  46222. }
  46223. this.duration = t
  46224. },
  46225. trim: function() {
  46226. for (var e = 0; e < this.tracks.length; e++)
  46227. this.tracks[e].trim(0, this.duration);
  46228. return this
  46229. },
  46230. optimize: function() {
  46231. for (var e = 0; e < this.tracks.length; e++)
  46232. this.tracks[e].optimize();
  46233. return this
  46234. }
  46235. },
  46236. Object.assign(n.AnimationClip, {
  46237. parse: function(e) {
  46238. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  46239. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  46240. return new n.AnimationClip(e.name,e.duration,t)
  46241. },
  46242. toJSON: function(e) {
  46243. for (var t = [], i = e.tracks, r = {
  46244. name: e.name,
  46245. duration: e.duration,
  46246. tracks: t
  46247. }, o = 0, a = i.length; o !== a; ++o)
  46248. t.push(n.KeyframeTrack.toJSON(i[o]));
  46249. return r
  46250. },
  46251. CreateFromMorphTargetSequence: function(e, t, i) {
  46252. for (var r = t.length, o = [], a = 0; a < r; a++) {
  46253. var s = []
  46254. , l = [];
  46255. s.push((a + r - 1) % r, a, (a + 1) % r),
  46256. l.push(0, 1, 0);
  46257. var c = n.AnimationUtils.getKeyframeOrder(s);
  46258. s = n.AnimationUtils.sortedArray(s, 1, c),
  46259. l = n.AnimationUtils.sortedArray(l, 1, c),
  46260. 0 === s[0] && (s.push(r),
  46261. l.push(l[0])),
  46262. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  46263. }
  46264. return new n.AnimationClip(e,-1,o)
  46265. },
  46266. findByName: function(e, t) {
  46267. for (var i = 0; i < e.length; i++)
  46268. if (e[i].name === t)
  46269. return e[i];
  46270. return null
  46271. },
  46272. CreateClipsFromMorphTargetSequences: function(e, t) {
  46273. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  46274. var s = e[o]
  46275. , l = s.name.match(r);
  46276. if (l && l.length > 1) {
  46277. var c = l[1]
  46278. , h = i[c];
  46279. h || (i[c] = h = []),
  46280. h.push(s)
  46281. }
  46282. }
  46283. var u = [];
  46284. for (var c in i)
  46285. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  46286. return u
  46287. },
  46288. parseAnimation: function(e, t, i) {
  46289. if (!e)
  46290. return console.error(" no animation in JSONLoader data"),
  46291. null;
  46292. for (var r = function(e, t, i, r, o) {
  46293. if (0 !== i.length) {
  46294. var a = []
  46295. , s = [];
  46296. n.AnimationUtils.flattenJSON(i, a, s, r),
  46297. 0 !== a.length && o.push(new e(t,a,s))
  46298. }
  46299. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  46300. var u = c[h].keys;
  46301. if (u && 0 != u.length)
  46302. if (u[0].morphTargets) {
  46303. for (var d = {}, p = 0; p < u.length; p++)
  46304. if (u[p].morphTargets)
  46305. for (var f = 0; f < u[p].morphTargets.length; f++)
  46306. d[u[p].morphTargets[f]] = -1;
  46307. for (var g in d) {
  46308. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  46309. var A = u[p];
  46310. m.push(A.time),
  46311. v.push(A.morphTarget === g ? 1 : 0)
  46312. }
  46313. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  46314. }
  46315. s = d.length * (l || 1)
  46316. } else {
  46317. var y = ".bones[" + t[h].name + "]";
  46318. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  46319. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  46320. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  46321. }
  46322. }
  46323. if (0 === o.length)
  46324. return null;
  46325. var C = new n.AnimationClip(a,s,o);
  46326. return C
  46327. }
  46328. }),
  46329. n.AnimationMixer = function(e) {
  46330. this._root = e,
  46331. this._initMemoryManager(),
  46332. this._accuIndex = 0,
  46333. this.time = 0,
  46334. this.timeScale = 1
  46335. }
  46336. ,
  46337. n.AnimationMixer.prototype = {
  46338. constructor: n.AnimationMixer,
  46339. clipAction: function(e, t) {
  46340. 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];
  46341. if (void 0 !== l) {
  46342. var c = l.actionByRoot[o];
  46343. if (void 0 !== c)
  46344. return c;
  46345. if (i = l.knownActions[0],
  46346. s = i._clip,
  46347. e !== a && e !== s)
  46348. throw new Error("Different clips with the same name detected!")
  46349. }
  46350. if (null === s)
  46351. return null;
  46352. var h = new n.AnimationMixer._Action(this,s,t);
  46353. return this._bindAction(h, i),
  46354. this._addInactiveAction(h, a, o),
  46355. h
  46356. },
  46357. existingAction: function(e, t) {
  46358. var i = t || this._root
  46359. , n = i.uuid
  46360. , r = "string" == typeof e ? e : e.name
  46361. , o = this._actionsByClip[r];
  46362. return void 0 !== o ? o.actionByRoot[n] || null : null
  46363. },
  46364. stopAllAction: function() {
  46365. var e = this._actions
  46366. , t = this._nActiveActions
  46367. , i = this._bindings
  46368. , n = this._nActiveBindings;
  46369. this._nActiveActions = 0,
  46370. this._nActiveBindings = 0;
  46371. for (var r = 0; r !== t; ++r)
  46372. e[r].reset();
  46373. for (var r = 0; r !== n; ++r)
  46374. i[r].useCount = 0;
  46375. return this
  46376. },
  46377. update: function(e) {
  46378. e *= this.timeScale;
  46379. 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) {
  46380. var s = t[a];
  46381. s.enabled && s._update(n, e, r, o)
  46382. }
  46383. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  46384. l[a].apply(o);
  46385. return this
  46386. },
  46387. getRoot: function() {
  46388. return this._root
  46389. },
  46390. uncacheClip: function(e) {
  46391. var t = this._actions
  46392. , i = e.name
  46393. , n = this._actionsByClip
  46394. , r = n[i];
  46395. if (void 0 !== r) {
  46396. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  46397. var l = o[a];
  46398. this._deactivateAction(l);
  46399. var c = l._cacheIndex
  46400. , h = t[t.length - 1];
  46401. l._cacheIndex = null,
  46402. l._byClipCacheIndex = null,
  46403. h._cacheIndex = c,
  46404. t[c] = h,
  46405. t.pop(),
  46406. this._removeInactiveBindingsForAction(l)
  46407. }
  46408. delete n[i]
  46409. }
  46410. },
  46411. uncacheRoot: function(e) {
  46412. var t = e.uuid
  46413. , i = this._actionsByClip;
  46414. for (var n in i) {
  46415. var r = i[n].actionByRoot
  46416. , o = r[t];
  46417. void 0 !== o && (this._deactivateAction(o),
  46418. this._removeInactiveAction(o))
  46419. }
  46420. var a = this._bindingsByRootAndName
  46421. , s = a[t];
  46422. if (void 0 !== s)
  46423. for (var l in s) {
  46424. var c = s[l];
  46425. c.restoreOriginalState(),
  46426. this._removeInactiveBinding(c)
  46427. }
  46428. },
  46429. uncacheAction: function(e, t) {
  46430. var i = this.existingAction(e, t);
  46431. null !== i && (this._deactivateAction(i),
  46432. this._removeInactiveAction(i))
  46433. }
  46434. },
  46435. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  46436. n.AnimationMixer._Action = function(e, t, i) {
  46437. this._mixer = e,
  46438. this._clip = t,
  46439. this._localRoot = i || null;
  46440. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  46441. endingStart: n.ZeroCurvatureEnding,
  46442. endingEnd: n.ZeroCurvatureEnding
  46443. }, l = 0; l !== o; ++l) {
  46444. var c = r[l].createInterpolant(null);
  46445. a[l] = c,
  46446. c.settings = s
  46447. }
  46448. this._interpolantSettings = s,
  46449. this._interpolants = a,
  46450. this._propertyBindings = new Array(o),
  46451. this._cacheIndex = null,
  46452. this._byClipCacheIndex = null,
  46453. this._timeScaleInterpolant = null,
  46454. this._weightInterpolant = null,
  46455. this.loop = n.LoopRepeat,
  46456. this._loopCount = -1,
  46457. this._startTime = null,
  46458. this.time = 0,
  46459. this.timeScale = 1,
  46460. this._effectiveTimeScale = 1,
  46461. this.weight = 1,
  46462. this._effectiveWeight = 1,
  46463. this.repetitions = 1 / 0,
  46464. this.paused = !1,
  46465. this.enabled = !0,
  46466. this.clampWhenFinished = !1,
  46467. this.zeroSlopeAtStart = !0,
  46468. this.zeroSlopeAtEnd = !0
  46469. }
  46470. ,
  46471. n.AnimationMixer._Action.prototype = {
  46472. constructor: n.AnimationMixer._Action,
  46473. play: function() {
  46474. return this._mixer._activateAction(this),
  46475. this
  46476. },
  46477. stop: function() {
  46478. return this._mixer._deactivateAction(this),
  46479. this.reset()
  46480. },
  46481. reset: function() {
  46482. return this.paused = !1,
  46483. this.enabled = !0,
  46484. this.time = 0,
  46485. this._loopCount = -1,
  46486. this._startTime = null,
  46487. this.stopFading().stopWarping()
  46488. },
  46489. isRunning: function() {
  46490. this._startTime;
  46491. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  46492. },
  46493. isScheduled: function() {
  46494. return this._mixer._isActiveAction(this)
  46495. },
  46496. startAt: function(e) {
  46497. return this._startTime = e,
  46498. this
  46499. },
  46500. setLoop: function(e, t) {
  46501. return this.loop = e,
  46502. this.repetitions = t,
  46503. this
  46504. },
  46505. setEffectiveWeight: function(e) {
  46506. return this.weight = e,
  46507. this._effectiveWeight = this.enabled ? e : 0,
  46508. this.stopFading()
  46509. },
  46510. getEffectiveWeight: function() {
  46511. return this._effectiveWeight
  46512. },
  46513. fadeIn: function(e) {
  46514. return this._scheduleFading(e, 0, 1)
  46515. },
  46516. fadeOut: function(e) {
  46517. return this._scheduleFading(e, 1, 0)
  46518. },
  46519. crossFadeFrom: function(e, t, i) {
  46520. this._mixer;
  46521. if (e.fadeOut(t),
  46522. this.fadeIn(t),
  46523. i) {
  46524. var n = this._clip.duration
  46525. , r = e._clip.duration
  46526. , o = r / n
  46527. , a = n / r;
  46528. e.warp(1, o, t),
  46529. this.warp(a, 1, t)
  46530. }
  46531. return this
  46532. },
  46533. crossFadeTo: function(e, t, i) {
  46534. return e.crossFadeFrom(this, t, i)
  46535. },
  46536. stopFading: function() {
  46537. var e = this._weightInterpolant;
  46538. return null !== e && (this._weightInterpolant = null,
  46539. this._mixer._takeBackControlInterpolant(e)),
  46540. this
  46541. },
  46542. setEffectiveTimeScale: function(e) {
  46543. return this.timeScale = e,
  46544. this._effectiveTimeScale = this.paused ? 0 : e,
  46545. this.stopWarping()
  46546. },
  46547. getEffectiveTimeScale: function() {
  46548. return this._effectiveTimeScale
  46549. },
  46550. setDuration: function(e) {
  46551. return this.timeScale = this._clip.duration / e,
  46552. this.stopWarping()
  46553. },
  46554. syncWith: function(e) {
  46555. return this.time = e.time,
  46556. this.timeScale = e.timeScale,
  46557. this.stopWarping()
  46558. },
  46559. halt: function(e) {
  46560. return this.warp(this._currentTimeScale, 0, e)
  46561. },
  46562. warp: function(e, t, i) {
  46563. var n = this._mixer
  46564. , r = n.time
  46565. , o = this._timeScaleInterpolant
  46566. , a = this.timeScale;
  46567. null === o && (o = n._lendControlInterpolant(),
  46568. this._timeScaleInterpolant = o);
  46569. var s = o.parameterPositions
  46570. , l = o.sampleValues;
  46571. return s[0] = r,
  46572. s[1] = r + i,
  46573. l[0] = e / a,
  46574. l[1] = t / a,
  46575. this
  46576. },
  46577. stopWarping: function() {
  46578. var e = this._timeScaleInterpolant;
  46579. return null !== e && (this._timeScaleInterpolant = null,
  46580. this._mixer._takeBackControlInterpolant(e)),
  46581. this
  46582. },
  46583. getMixer: function() {
  46584. return this._mixer
  46585. },
  46586. getClip: function() {
  46587. return this._clip
  46588. },
  46589. getRoot: function() {
  46590. return this._localRoot || this._mixer._root
  46591. },
  46592. _update: function(e, t, i, n) {
  46593. var r = this._startTime;
  46594. if (null !== r) {
  46595. var o = (e - r) * i;
  46596. if (o < 0 || 0 === i)
  46597. return;
  46598. this._startTime = null,
  46599. t = i * o
  46600. }
  46601. t *= this._updateTimeScale(e);
  46602. var a = this._updateTime(t)
  46603. , s = this._updateWeight(e);
  46604. if (s > 0)
  46605. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  46606. l[h].evaluate(a),
  46607. c[h].accumulate(n, s)
  46608. },
  46609. _updateWeight: function(e) {
  46610. var t = 0;
  46611. if (this.enabled) {
  46612. t = this.weight;
  46613. var i = this._weightInterpolant;
  46614. if (null !== i) {
  46615. var n = i.evaluate(e)[0];
  46616. t *= n,
  46617. e > i.parameterPositions[1] && (this.stopFading(),
  46618. 0 === n && (this.enabled = !1))
  46619. }
  46620. }
  46621. return this._effectiveWeight = t,
  46622. t
  46623. },
  46624. _updateTimeScale: function(e) {
  46625. var t = 0;
  46626. if (!this.paused) {
  46627. t = this.timeScale;
  46628. var i = this._timeScaleInterpolant;
  46629. if (null !== i) {
  46630. var n = i.evaluate(e)[0];
  46631. t *= n,
  46632. e > i.parameterPositions[1] && (this.stopWarping(),
  46633. 0 === t ? this.pause = !0 : this.timeScale = t)
  46634. }
  46635. }
  46636. return this._effectiveTimeScale = t,
  46637. t
  46638. },
  46639. _updateTime: function(e) {
  46640. var t = this.time + e;
  46641. if (0 === e)
  46642. return t;
  46643. var i = this._clip.duration
  46644. , r = this.loop
  46645. , o = this._loopCount
  46646. , a = !1;
  46647. switch (r) {
  46648. case n.LoopOnce:
  46649. if (o === -1 && (this.loopCount = 0,
  46650. this._setEndings(!0, !0, !1)),
  46651. t >= i)
  46652. t = i;
  46653. else {
  46654. if (!(t < 0))
  46655. break;
  46656. t = 0
  46657. }
  46658. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  46659. this._mixer.dispatchEvent({
  46660. type: "finished",
  46661. action: this,
  46662. direction: e < 0 ? -1 : 1
  46663. });
  46664. break;
  46665. case n.LoopPingPong:
  46666. a = !0;
  46667. case n.LoopRepeat:
  46668. if (o === -1 && (e > 0 ? (o = 0,
  46669. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46670. t >= i || t < 0) {
  46671. var s = Math.floor(t / i);
  46672. t -= i * s,
  46673. o += Math.abs(s);
  46674. var l = this.repetitions - o;
  46675. if (l < 0) {
  46676. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46677. t = e > 0 ? i : 0,
  46678. this._mixer.dispatchEvent({
  46679. type: "finished",
  46680. action: this,
  46681. direction: e > 0 ? 1 : -1
  46682. });
  46683. break
  46684. }
  46685. if (0 === l) {
  46686. var c = e < 0;
  46687. this._setEndings(c, !c, a)
  46688. } else
  46689. this._setEndings(!1, !1, a);
  46690. this._loopCount = o,
  46691. this._mixer.dispatchEvent({
  46692. type: "loop",
  46693. action: this,
  46694. loopDelta: s
  46695. })
  46696. }
  46697. if (r === n.LoopPingPong && 1 === (1 & o))
  46698. return this.time = t,
  46699. i - t
  46700. }
  46701. return this.time = t,
  46702. t
  46703. },
  46704. _setEndings: function(e, t, i) {
  46705. var r = this._interpolantSettings;
  46706. i ? (r.endingStart = n.ZeroSlopeEnding,
  46707. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46708. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46709. },
  46710. _scheduleFading: function(e, t, i) {
  46711. var n = this._mixer
  46712. , r = n.time
  46713. , o = this._weightInterpolant;
  46714. null === o && (o = n._lendControlInterpolant(),
  46715. this._weightInterpolant = o);
  46716. var a = o.parameterPositions
  46717. , s = o.sampleValues;
  46718. return a[0] = r,
  46719. s[0] = t,
  46720. a[1] = r + e,
  46721. s[1] = i,
  46722. this
  46723. }
  46724. },
  46725. Object.assign(n.AnimationMixer.prototype, {
  46726. _bindAction: function(e, t) {
  46727. var i = e._localRoot || this._root
  46728. , r = e._clip.tracks
  46729. , o = r.length
  46730. , a = e._propertyBindings
  46731. , s = e._interpolants
  46732. , l = i.uuid
  46733. , c = this._bindingsByRootAndName
  46734. , h = c[l];
  46735. void 0 === h && (h = {},
  46736. c[l] = h);
  46737. for (var u = 0; u !== o; ++u) {
  46738. var d = r[u]
  46739. , p = d.name
  46740. , f = h[p];
  46741. if (void 0 !== f)
  46742. a[u] = f;
  46743. else {
  46744. if (f = a[u],
  46745. void 0 !== f) {
  46746. null === f._cacheIndex && (++f.referenceCount,
  46747. this._addInactiveBinding(f, l, p));
  46748. continue
  46749. }
  46750. var g = t && t._propertyBindings[u].binding.parsedPath;
  46751. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46752. ++f.referenceCount,
  46753. this._addInactiveBinding(f, l, p),
  46754. a[u] = f
  46755. }
  46756. s[u].resultBuffer = f.buffer
  46757. }
  46758. },
  46759. _activateAction: function(e) {
  46760. if (!this._isActiveAction(e)) {
  46761. if (null === e._cacheIndex) {
  46762. var t = (e._localRoot || this._root).uuid
  46763. , i = e._clip.name
  46764. , n = this._actionsByClip[i];
  46765. this._bindAction(e, n && n.knownActions[0]),
  46766. this._addInactiveAction(e, i, t)
  46767. }
  46768. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46769. var s = r[o];
  46770. 0 === s.useCount++ && (this._lendBinding(s),
  46771. s.saveOriginalState())
  46772. }
  46773. this._lendAction(e)
  46774. }
  46775. },
  46776. _deactivateAction: function(e) {
  46777. if (this._isActiveAction(e)) {
  46778. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46779. var r = t[i];
  46780. 0 === --r.useCount && (r.restoreOriginalState(),
  46781. this._takeBackBinding(r))
  46782. }
  46783. this._takeBackAction(e)
  46784. }
  46785. },
  46786. _initMemoryManager: function() {
  46787. this._actions = [],
  46788. this._nActiveActions = 0,
  46789. this._actionsByClip = {},
  46790. this._bindings = [],
  46791. this._nActiveBindings = 0,
  46792. this._bindingsByRootAndName = {},
  46793. this._controlInterpolants = [],
  46794. this._nActiveControlInterpolants = 0;
  46795. var e = this;
  46796. this.stats = {
  46797. actions: {
  46798. get total() {
  46799. return e._actions.length
  46800. },
  46801. get inUse() {
  46802. return e._nActiveActions
  46803. }
  46804. },
  46805. bindings: {
  46806. get total() {
  46807. return e._bindings.length
  46808. },
  46809. get inUse() {
  46810. return e._nActiveBindings
  46811. }
  46812. },
  46813. controlInterpolants: {
  46814. get total() {
  46815. return e._controlInterpolants.length
  46816. },
  46817. get inUse() {
  46818. return e._nActiveControlInterpolants
  46819. }
  46820. }
  46821. }
  46822. },
  46823. _isActiveAction: function(e) {
  46824. var t = e._cacheIndex;
  46825. return null !== t && t < this._nActiveActions
  46826. },
  46827. _addInactiveAction: function(e, t, i) {
  46828. var n = this._actions
  46829. , r = this._actionsByClip
  46830. , o = r[t];
  46831. if (void 0 === o)
  46832. o = {
  46833. knownActions: [e],
  46834. actionByRoot: {}
  46835. },
  46836. e._byClipCacheIndex = 0,
  46837. r[t] = o;
  46838. else {
  46839. var a = o.knownActions;
  46840. e._byClipCacheIndex = a.length,
  46841. a.push(e)
  46842. }
  46843. e._cacheIndex = n.length,
  46844. n.push(e),
  46845. o.actionByRoot[i] = e
  46846. },
  46847. _removeInactiveAction: function(e) {
  46848. var t = this._actions
  46849. , i = t[t.length - 1]
  46850. , n = e._cacheIndex;
  46851. i._cacheIndex = n,
  46852. t[n] = i,
  46853. t.pop(),
  46854. e._cacheIndex = null;
  46855. var r = e._clip.name
  46856. , o = this._actionsByClip
  46857. , a = o[r]
  46858. , s = a.knownActions
  46859. , l = s[s.length - 1]
  46860. , c = e._byClipCacheIndex;
  46861. l._byClipCacheIndex = c,
  46862. s[c] = l,
  46863. s.pop(),
  46864. e._byClipCacheIndex = null;
  46865. var h = a.actionByRoot
  46866. , u = (t._localRoot || this._root).uuid;
  46867. delete h[u],
  46868. 0 === s.length && delete o[r],
  46869. this._removeInactiveBindingsForAction(e)
  46870. },
  46871. _removeInactiveBindingsForAction: function(e) {
  46872. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46873. var r = t[i];
  46874. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46875. }
  46876. },
  46877. _lendAction: function(e) {
  46878. var t = this._actions
  46879. , i = e._cacheIndex
  46880. , n = this._nActiveActions++
  46881. , r = t[n];
  46882. e._cacheIndex = n,
  46883. t[n] = e,
  46884. r._cacheIndex = i,
  46885. t[i] = r
  46886. },
  46887. _takeBackAction: function(e) {
  46888. var t = this._actions
  46889. , i = e._cacheIndex
  46890. , n = --this._nActiveActions
  46891. , r = t[n];
  46892. e._cacheIndex = n,
  46893. t[n] = e,
  46894. r._cacheIndex = i,
  46895. t[i] = r
  46896. },
  46897. _addInactiveBinding: function(e, t, i) {
  46898. var n = this._bindingsByRootAndName
  46899. , r = n[t]
  46900. , o = this._bindings;
  46901. void 0 === r && (r = {},
  46902. n[t] = r),
  46903. r[i] = e,
  46904. e._cacheIndex = o.length,
  46905. o.push(e)
  46906. },
  46907. _removeInactiveBinding: function(e) {
  46908. var t = this._bindings
  46909. , i = e.binding
  46910. , n = i.rootNode.uuid
  46911. , r = i.path
  46912. , o = this._bindingsByRootAndName
  46913. , a = o[n]
  46914. , s = t[t.length - 1]
  46915. , l = e._cacheIndex;
  46916. s._cacheIndex = l,
  46917. t[l] = s,
  46918. t.pop(),
  46919. delete a[r];
  46920. e: {
  46921. for (var c in a)
  46922. break e;
  46923. delete o[n]
  46924. }
  46925. },
  46926. _lendBinding: function(e) {
  46927. var t = this._bindings
  46928. , i = e._cacheIndex
  46929. , n = this._nActiveBindings++
  46930. , r = t[n];
  46931. e._cacheIndex = n,
  46932. t[n] = e,
  46933. r._cacheIndex = i,
  46934. t[i] = r
  46935. },
  46936. _takeBackBinding: function(e) {
  46937. var t = this._bindings
  46938. , i = e._cacheIndex
  46939. , n = --this._nActiveBindings
  46940. , r = t[n];
  46941. e._cacheIndex = n,
  46942. t[n] = e,
  46943. r._cacheIndex = i,
  46944. t[i] = r
  46945. },
  46946. _lendControlInterpolant: function() {
  46947. var e = this._controlInterpolants
  46948. , t = this._nActiveControlInterpolants++
  46949. , i = e[t];
  46950. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46951. i.__cacheIndex = t,
  46952. e[t] = i),
  46953. i
  46954. },
  46955. _takeBackControlInterpolant: function(e) {
  46956. var t = this._controlInterpolants
  46957. , i = e.__cacheIndex
  46958. , n = --this._nActiveControlInterpolants
  46959. , r = t[n];
  46960. e.__cacheIndex = n,
  46961. t[n] = e,
  46962. r.__cacheIndex = i,
  46963. t[i] = r
  46964. },
  46965. _controlInterpolantsResultBuffer: new Float32Array(1)
  46966. }),
  46967. n.AnimationObjectGroup = function(e) {
  46968. this.uuid = n.Math.generateUUID(),
  46969. this._objects = Array.prototype.slice.call(arguments),
  46970. this.nCachedObjects_ = 0;
  46971. var t = {};
  46972. this._indicesByUUID = t;
  46973. for (var i = 0, r = arguments.length; i !== r; ++i)
  46974. t[arguments[i].uuid] = i;
  46975. this._paths = [],
  46976. this._parsedPaths = [],
  46977. this._bindings = [],
  46978. this._bindingsIndicesByPath = {};
  46979. var o = this;
  46980. this.stats = {
  46981. objects: {
  46982. get total() {
  46983. return o._objects.length
  46984. },
  46985. get inUse() {
  46986. return this.total - o.nCachedObjects_
  46987. }
  46988. },
  46989. get bindingsPerObject() {
  46990. return o._bindings.length
  46991. }
  46992. }
  46993. }
  46994. ,
  46995. n.AnimationObjectGroup.prototype = {
  46996. constructor: n.AnimationObjectGroup,
  46997. add: function(e) {
  46998. 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) {
  46999. var d = arguments[h]
  47000. , p = d.uuid
  47001. , f = o[p];
  47002. if (void 0 === f) {
  47003. f = i++,
  47004. o[p] = f,
  47005. t.push(d);
  47006. for (var g = 0, m = c; g !== m; ++g)
  47007. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  47008. } else if (f < r) {
  47009. var v = t[f]
  47010. , A = --r
  47011. , y = t[A];
  47012. o[y.uuid] = f,
  47013. t[f] = y,
  47014. o[p] = A,
  47015. t[A] = d;
  47016. for (var g = 0, m = c; g !== m; ++g) {
  47017. var C = l[g]
  47018. , I = C[A]
  47019. , E = C[f];
  47020. C[f] = I,
  47021. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  47022. C[A] = E
  47023. }
  47024. } else
  47025. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  47026. }
  47027. this.nCachedObjects_ = r
  47028. },
  47029. remove: function(e) {
  47030. for (var t = this._objects, i = (t.length,
  47031. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  47032. var l = arguments[a]
  47033. , c = l.uuid
  47034. , h = n[c];
  47035. if (void 0 !== h && h >= i) {
  47036. var u = i++
  47037. , d = t[u];
  47038. n[d.uuid] = h,
  47039. t[h] = d,
  47040. n[c] = u,
  47041. t[u] = l;
  47042. for (var p = 0, f = o; p !== f; ++p) {
  47043. var g = r[p]
  47044. , m = g[u]
  47045. , v = g[h];
  47046. g[h] = m,
  47047. g[u] = v
  47048. }
  47049. }
  47050. }
  47051. this.nCachedObjects_ = i
  47052. },
  47053. uncache: function(e) {
  47054. 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) {
  47055. var c = arguments[s]
  47056. , h = c.uuid
  47057. , u = r[h];
  47058. if (void 0 !== u)
  47059. if (delete r[h],
  47060. u < n) {
  47061. var d = --n
  47062. , p = t[d]
  47063. , f = --i
  47064. , g = t[f];
  47065. r[p.uuid] = u,
  47066. t[u] = p,
  47067. r[g.uuid] = d,
  47068. t[d] = g,
  47069. t.pop();
  47070. for (var m = 0, v = a; m !== v; ++m) {
  47071. var A = o[m]
  47072. , y = A[d]
  47073. , C = A[f];
  47074. A[u] = y,
  47075. A[d] = C,
  47076. A.pop()
  47077. }
  47078. } else {
  47079. var f = --i
  47080. , g = t[f];
  47081. r[g.uuid] = u,
  47082. t[u] = g,
  47083. t.pop();
  47084. for (var m = 0, v = a; m !== v; ++m) {
  47085. var A = o[m];
  47086. A[u] = A[f],
  47087. A.pop()
  47088. }
  47089. }
  47090. }
  47091. this.nCachedObjects_ = n
  47092. },
  47093. subscribe_: function(e, t) {
  47094. var i = this._bindingsIndicesByPath
  47095. , r = i[e]
  47096. , o = this._bindings;
  47097. if (void 0 !== r)
  47098. return o[r];
  47099. var a = this._paths
  47100. , s = this._parsedPaths
  47101. , l = this._objects
  47102. , c = l.length
  47103. , h = this.nCachedObjects_
  47104. , u = new Array(c);
  47105. r = o.length,
  47106. i[e] = r,
  47107. a.push(e),
  47108. s.push(t),
  47109. o.push(u);
  47110. for (var d = h, p = l.length; d !== p; ++d) {
  47111. var f = l[d];
  47112. u[d] = new n.PropertyBinding(f,e,t)
  47113. }
  47114. return u
  47115. },
  47116. unsubscribe_: function(e) {
  47117. var t = this._bindingsIndicesByPath
  47118. , i = t[e];
  47119. if (void 0 !== i) {
  47120. var n = this._paths
  47121. , r = this._parsedPaths
  47122. , o = this._bindings
  47123. , a = o.length - 1
  47124. , s = o[a]
  47125. , l = e[a];
  47126. t[l] = i,
  47127. o[i] = s,
  47128. o.pop(),
  47129. r[i] = r[a],
  47130. r.pop(),
  47131. n[i] = n[a],
  47132. n.pop()
  47133. }
  47134. }
  47135. },
  47136. n.AnimationUtils = {
  47137. arraySlice: function(e, t, i) {
  47138. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  47139. },
  47140. convertArray: function(e, t, i) {
  47141. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  47142. },
  47143. isTypedArray: function(e) {
  47144. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  47145. },
  47146. getKeyframeOrder: function(e) {
  47147. function t(t, i) {
  47148. return e[t] - e[i]
  47149. }
  47150. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  47151. n[r] = r;
  47152. return n.sort(t),
  47153. n
  47154. },
  47155. sortedArray: function(e, t, i) {
  47156. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  47157. for (var s = i[o] * t, l = 0; l !== t; ++l)
  47158. r[a++] = e[s + l];
  47159. return r
  47160. },
  47161. flattenJSON: function(e, t, i, n) {
  47162. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  47163. o = e[r++];
  47164. if (void 0 !== o) {
  47165. var a = o[n];
  47166. if (void 0 !== a)
  47167. if (Array.isArray(a)) {
  47168. do
  47169. a = o[n],
  47170. void 0 !== a && (t.push(o.time),
  47171. i.push.apply(i, a)),
  47172. o = e[r++];
  47173. while (void 0 !== o)
  47174. } else if (void 0 !== a.toArray) {
  47175. do
  47176. a = o[n],
  47177. void 0 !== a && (t.push(o.time),
  47178. a.toArray(i, i.length)),
  47179. o = e[r++];
  47180. while (void 0 !== o)
  47181. } else
  47182. do
  47183. a = o[n],
  47184. void 0 !== a && (t.push(o.time),
  47185. i.push(a)),
  47186. o = e[r++];
  47187. while (void 0 !== o)
  47188. }
  47189. }
  47190. },
  47191. n.KeyframeTrack = function(e, t, i, r) {
  47192. if (void 0 === e)
  47193. throw new Error("track name is undefined");
  47194. if (void 0 === t || 0 === t.length)
  47195. throw new Error("no keyframes in track named " + e);
  47196. this.name = e,
  47197. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  47198. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  47199. this.setInterpolation(r || this.DefaultInterpolation),
  47200. this.validate(),
  47201. this.optimize()
  47202. }
  47203. ,
  47204. n.KeyframeTrack.prototype = {
  47205. constructor: n.KeyframeTrack,
  47206. TimeBufferType: Float32Array,
  47207. ValueBufferType: Float32Array,
  47208. DefaultInterpolation: n.InterpolateLinear,
  47209. InterpolantFactoryMethodDiscrete: function(e) {
  47210. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  47211. },
  47212. InterpolantFactoryMethodLinear: function(e) {
  47213. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47214. },
  47215. InterpolantFactoryMethodSmooth: function(e) {
  47216. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  47217. },
  47218. setInterpolation: function(e) {
  47219. var t = void 0;
  47220. switch (e) {
  47221. case n.InterpolateDiscrete:
  47222. t = this.InterpolantFactoryMethodDiscrete;
  47223. break;
  47224. case n.InterpolateLinear:
  47225. t = this.InterpolantFactoryMethodLinear;
  47226. break;
  47227. case n.InterpolateSmooth:
  47228. t = this.InterpolantFactoryMethodSmooth
  47229. }
  47230. if (void 0 === t) {
  47231. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  47232. if (void 0 === this.createInterpolant) {
  47233. if (e === this.DefaultInterpolation)
  47234. throw new Error(i);
  47235. this.setInterpolation(this.DefaultInterpolation)
  47236. }
  47237. return void console.warn(i)
  47238. }
  47239. this.createInterpolant = t
  47240. },
  47241. getInterpolation: function() {
  47242. switch (this.createInterpolant) {
  47243. case this.InterpolantFactoryMethodDiscrete:
  47244. return n.InterpolateDiscrete;
  47245. case this.InterpolantFactoryMethodLinear:
  47246. return n.InterpolateLinear;
  47247. case this.InterpolantFactoryMethodSmooth:
  47248. return n.InterpolateSmooth
  47249. }
  47250. },
  47251. getValueSize: function() {
  47252. return this.values.length / this.times.length
  47253. },
  47254. shift: function(e) {
  47255. if (0 !== e)
  47256. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  47257. t[i] += e;
  47258. return this
  47259. },
  47260. scale: function(e) {
  47261. if (1 !== e)
  47262. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  47263. t[i] *= e;
  47264. return this
  47265. },
  47266. trim: function(e, t) {
  47267. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  47268. ++o;
  47269. for (; a !== -1 && i[a] > t; )
  47270. --a;
  47271. if (++a,
  47272. 0 !== o || a !== r) {
  47273. o >= a && (a = Math.max(a, 1),
  47274. o = a - 1);
  47275. var s = this.getValueSize();
  47276. this.times = n.AnimationUtils.arraySlice(i, o, a),
  47277. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  47278. }
  47279. return this
  47280. },
  47281. validate: function() {
  47282. var e = !0
  47283. , t = this.getValueSize();
  47284. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  47285. e = !1);
  47286. var i = this.times
  47287. , r = this.values
  47288. , o = i.length;
  47289. 0 === o && (console.error("track is empty", this),
  47290. e = !1);
  47291. for (var a = null, s = 0; s !== o; s++) {
  47292. var l = i[s];
  47293. if ("number" == typeof l && isNaN(l)) {
  47294. console.error("time is not a valid number", this, s, l),
  47295. e = !1;
  47296. break
  47297. }
  47298. if (null !== a && a > l) {
  47299. console.error("out of order keys", this, s, l, a),
  47300. e = !1;
  47301. break
  47302. }
  47303. a = l
  47304. }
  47305. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  47306. for (var s = 0, c = r.length; s !== c; ++s) {
  47307. var h = r[s];
  47308. if (isNaN(h)) {
  47309. console.error("value is not a valid number", this, s, h),
  47310. e = !1;
  47311. break
  47312. }
  47313. }
  47314. return e
  47315. },
  47316. optimize: function() {
  47317. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  47318. var s = !1
  47319. , l = e[o]
  47320. , c = e[o + 1];
  47321. if (l !== c && (1 !== o || l !== l[0]))
  47322. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  47323. var f = t[h + p];
  47324. if (f !== t[u + p] || f !== t[d + p]) {
  47325. s = !0;
  47326. break
  47327. }
  47328. }
  47329. if (s) {
  47330. if (o !== r) {
  47331. e[r] = e[o];
  47332. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  47333. t[m + p] = t[g + p]
  47334. }
  47335. ++r
  47336. }
  47337. }
  47338. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  47339. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  47340. this
  47341. }
  47342. },
  47343. Object.assign(n.KeyframeTrack, {
  47344. parse: function(e) {
  47345. if (void 0 === e.type)
  47346. throw new Error("track type undefined, can not parse");
  47347. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  47348. if (void 0 === e.times) {
  47349. console.warn("legacy JSON format detected, converting");
  47350. var i = []
  47351. , r = [];
  47352. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  47353. e.times = i,
  47354. e.values = r
  47355. }
  47356. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  47357. },
  47358. toJSON: function(e) {
  47359. var t, i = e.constructor;
  47360. if (void 0 !== i.toJSON)
  47361. t = i.toJSON(e);
  47362. else {
  47363. t = {
  47364. name: e.name,
  47365. times: n.AnimationUtils.convertArray(e.times, Array),
  47366. values: n.AnimationUtils.convertArray(e.values, Array)
  47367. };
  47368. var r = e.getInterpolation();
  47369. r !== e.DefaultInterpolation && (t.interpolation = r)
  47370. }
  47371. return t.type = e.ValueTypeName,
  47372. t
  47373. },
  47374. _getTrackTypeForValueTypeName: function(e) {
  47375. switch (e.toLowerCase()) {
  47376. case "scalar":
  47377. case "double":
  47378. case "float":
  47379. case "number":
  47380. case "integer":
  47381. return n.NumberKeyframeTrack;
  47382. case "vector":
  47383. case "vector2":
  47384. case "vector3":
  47385. case "vector4":
  47386. return n.VectorKeyframeTrack;
  47387. case "color":
  47388. return n.ColorKeyframeTrack;
  47389. case "quaternion":
  47390. return n.QuaternionKeyframeTrack;
  47391. case "bool":
  47392. case "boolean":
  47393. return n.BooleanKeyframeTrack;
  47394. case "string":
  47395. return n.StringKeyframeTrack
  47396. }
  47397. throw new Error("Unsupported typeName: " + e)
  47398. }
  47399. }),
  47400. n.PropertyBinding = function(e, t, i) {
  47401. this.path = t,
  47402. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  47403. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  47404. this.rootNode = e
  47405. }
  47406. ,
  47407. n.PropertyBinding.prototype = {
  47408. constructor: n.PropertyBinding,
  47409. getValue: function(e, t) {
  47410. this.bind(),
  47411. this.getValue(e, t)
  47412. },
  47413. setValue: function(e, t) {
  47414. this.bind(),
  47415. this.setValue(e, t)
  47416. },
  47417. bind: function() {
  47418. var e = this.node
  47419. , t = this.parsedPath
  47420. , i = t.objectName
  47421. , r = t.propertyName
  47422. , o = t.propertyIndex;
  47423. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  47424. this.node = e),
  47425. this.getValue = this._getValue_unavailable,
  47426. this.setValue = this._setValue_unavailable,
  47427. !e)
  47428. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  47429. if (i) {
  47430. var a = t.objectIndex;
  47431. switch (i) {
  47432. case "materials":
  47433. if (!e.material)
  47434. return void console.error(" can not bind to material as node does not have a material", this);
  47435. if (!e.material.materials)
  47436. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  47437. e = e.material.materials;
  47438. break;
  47439. case "bones":
  47440. if (!e.skeleton)
  47441. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  47442. e = e.skeleton.bones;
  47443. for (var s = 0; s < e.length; s++)
  47444. if (e[s].name === a) {
  47445. a = s;
  47446. break
  47447. }
  47448. break;
  47449. default:
  47450. if (void 0 === e[i])
  47451. return void console.error(" can not bind to objectName of node, undefined", this);
  47452. e = e[i]
  47453. }
  47454. if (void 0 !== a) {
  47455. if (void 0 === e[a])
  47456. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  47457. e = e[a]
  47458. }
  47459. }
  47460. var l = e[r];
  47461. if (!l) {
  47462. var c = t.nodeName;
  47463. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  47464. }
  47465. var h = this.Versioning.None;
  47466. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  47467. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  47468. this.targetObject = e);
  47469. var u = this.BindingType.Direct;
  47470. if (void 0 !== o) {
  47471. if ("morphTargetInfluences" === r) {
  47472. if (!e.geometry)
  47473. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  47474. if (!e.geometry.morphTargets)
  47475. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  47476. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  47477. if (e.geometry.morphTargets[s].name === o) {
  47478. o = s;
  47479. break
  47480. }
  47481. }
  47482. u = this.BindingType.ArrayElement,
  47483. this.resolvedProperty = l,
  47484. this.propertyIndex = o
  47485. } else
  47486. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  47487. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  47488. this.resolvedProperty = l) : this.propertyName = r;
  47489. this.getValue = this.GetterByBindingType[u],
  47490. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  47491. },
  47492. unbind: function() {
  47493. this.node = null,
  47494. this.getValue = this._getValue_unbound,
  47495. this.setValue = this._setValue_unbound
  47496. }
  47497. },
  47498. Object.assign(n.PropertyBinding.prototype, {
  47499. _getValue_unavailable: function() {},
  47500. _setValue_unavailable: function() {},
  47501. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  47502. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  47503. BindingType: {
  47504. Direct: 0,
  47505. EntireArray: 1,
  47506. ArrayElement: 2,
  47507. HasFromToArray: 3
  47508. },
  47509. Versioning: {
  47510. None: 0,
  47511. NeedsUpdate: 1,
  47512. MatrixWorldNeedsUpdate: 2
  47513. },
  47514. GetterByBindingType: [function(e, t) {
  47515. e[t] = this.node[this.propertyName]
  47516. }
  47517. , function(e, t) {
  47518. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47519. e[t++] = i[n]
  47520. }
  47521. , function(e, t) {
  47522. e[t] = this.resolvedProperty[this.propertyIndex]
  47523. }
  47524. , function(e, t) {
  47525. this.resolvedProperty.toArray(e, t)
  47526. }
  47527. ],
  47528. SetterByBindingTypeAndVersioning: [[function(e, t) {
  47529. this.node[this.propertyName] = e[t]
  47530. }
  47531. , function(e, t) {
  47532. this.node[this.propertyName] = e[t],
  47533. this.targetObject.needsUpdate = !0
  47534. }
  47535. , function(e, t) {
  47536. this.node[this.propertyName] = e[t],
  47537. this.targetObject.matrixWorldNeedsUpdate = !0
  47538. }
  47539. ], [function(e, t) {
  47540. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47541. i[n] = e[t++]
  47542. }
  47543. , function(e, t) {
  47544. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47545. i[n] = e[t++];
  47546. this.targetObject.needsUpdate = !0
  47547. }
  47548. , function(e, t) {
  47549. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47550. i[n] = e[t++];
  47551. this.targetObject.matrixWorldNeedsUpdate = !0
  47552. }
  47553. ], [function(e, t) {
  47554. this.resolvedProperty[this.propertyIndex] = e[t]
  47555. }
  47556. , function(e, t) {
  47557. this.resolvedProperty[this.propertyIndex] = e[t],
  47558. this.targetObject.needsUpdate = !0
  47559. }
  47560. , function(e, t) {
  47561. this.resolvedProperty[this.propertyIndex] = e[t],
  47562. this.targetObject.matrixWorldNeedsUpdate = !0
  47563. }
  47564. ], [function(e, t) {
  47565. this.resolvedProperty.fromArray(e, t)
  47566. }
  47567. , function(e, t) {
  47568. this.resolvedProperty.fromArray(e, t),
  47569. this.targetObject.needsUpdate = !0
  47570. }
  47571. , function(e, t) {
  47572. this.resolvedProperty.fromArray(e, t),
  47573. this.targetObject.matrixWorldNeedsUpdate = !0
  47574. }
  47575. ]]
  47576. }),
  47577. n.PropertyBinding.Composite = function(e, t, i) {
  47578. var r = i || n.PropertyBinding.parseTrackName(t);
  47579. this._targetGroup = e,
  47580. this._bindings = e.subscribe_(t, r)
  47581. }
  47582. ,
  47583. n.PropertyBinding.Composite.prototype = {
  47584. constructor: n.PropertyBinding.Composite,
  47585. getValue: function(e, t) {
  47586. this.bind();
  47587. var i = this._targetGroup.nCachedObjects_
  47588. , n = this._bindings[i];
  47589. void 0 !== n && n.getValue(e, t)
  47590. },
  47591. setValue: function(e, t) {
  47592. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  47593. i[n].setValue(e, t)
  47594. },
  47595. bind: function() {
  47596. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47597. e[t].bind()
  47598. },
  47599. unbind: function() {
  47600. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47601. e[t].unbind()
  47602. }
  47603. },
  47604. n.PropertyBinding.create = function(e, t, i) {
  47605. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  47606. }
  47607. ,
  47608. n.PropertyBinding.parseTrackName = function(e) {
  47609. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  47610. , i = t.exec(e);
  47611. if (!i)
  47612. throw new Error("cannot parse trackName at all: " + e);
  47613. i.index === t.lastIndex && t.lastIndex++;
  47614. var n = {
  47615. nodeName: i[3],
  47616. objectName: i[5],
  47617. objectIndex: i[7],
  47618. propertyName: i[9],
  47619. propertyIndex: i[11]
  47620. };
  47621. if (null === n.propertyName || 0 === n.propertyName.length)
  47622. throw new Error("can not parse propertyName from trackName: " + e);
  47623. return n
  47624. }
  47625. ,
  47626. n.PropertyBinding.findNode = function(e, t) {
  47627. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  47628. return e;
  47629. if (e.skeleton) {
  47630. var i = function(e) {
  47631. for (var i = 0; i < e.bones.length; i++) {
  47632. var n = e.bones[i];
  47633. if (n.name === t)
  47634. return n
  47635. }
  47636. return null
  47637. }
  47638. , n = i(e.skeleton);
  47639. if (n)
  47640. return n
  47641. }
  47642. if (e.children) {
  47643. var r = function(e) {
  47644. for (var i = 0; i < e.length; i++) {
  47645. var n = e[i];
  47646. if (n.name === t || n.uuid === t)
  47647. return n;
  47648. var o = r(n.children);
  47649. if (o)
  47650. return o
  47651. }
  47652. return null
  47653. }
  47654. , o = r(e.children);
  47655. if (o)
  47656. return o
  47657. }
  47658. return null
  47659. }
  47660. ,
  47661. n.PropertyMixer = function(e, t, i) {
  47662. this.binding = e,
  47663. this.valueSize = i;
  47664. var n, r = Float64Array;
  47665. switch (t) {
  47666. case "quaternion":
  47667. n = this._slerp;
  47668. break;
  47669. case "string":
  47670. case "bool":
  47671. r = Array,
  47672. n = this._select;
  47673. break;
  47674. default:
  47675. n = this._lerp
  47676. }
  47677. this.buffer = new r(4 * i),
  47678. this._mixBufferRegion = n,
  47679. this.cumulativeWeight = 0,
  47680. this.useCount = 0,
  47681. this.referenceCount = 0
  47682. }
  47683. ,
  47684. n.PropertyMixer.prototype = {
  47685. constructor: n.PropertyMixer,
  47686. accumulate: function(e, t) {
  47687. var i = this.buffer
  47688. , n = this.valueSize
  47689. , r = e * n + n
  47690. , o = this.cumulativeWeight;
  47691. if (0 === o) {
  47692. for (var a = 0; a !== n; ++a)
  47693. i[r + a] = i[a];
  47694. o = t
  47695. } else {
  47696. o += t;
  47697. var s = t / o;
  47698. this._mixBufferRegion(i, r, 0, s, n)
  47699. }
  47700. this.cumulativeWeight = o
  47701. },
  47702. apply: function(e) {
  47703. var t = this.valueSize
  47704. , i = this.buffer
  47705. , n = e * t + t
  47706. , r = this.cumulativeWeight
  47707. , o = this.binding;
  47708. if (this.cumulativeWeight = 0,
  47709. r < 1) {
  47710. var a = 3 * t;
  47711. this._mixBufferRegion(i, n, a, 1 - r, t)
  47712. }
  47713. for (var s = t, l = t + t; s !== l; ++s)
  47714. if (i[s] !== i[s + t]) {
  47715. o.setValue(i, n);
  47716. break
  47717. }
  47718. },
  47719. saveOriginalState: function() {
  47720. var e = this.binding
  47721. , t = this.buffer
  47722. , i = this.valueSize
  47723. , n = 3 * i;
  47724. e.getValue(t, n);
  47725. for (var r = i, o = n; r !== o; ++r)
  47726. t[r] = t[n + r % i];
  47727. this.cumulativeWeight = 0
  47728. },
  47729. restoreOriginalState: function() {
  47730. var e = 3 * this.valueSize;
  47731. this.binding.setValue(this.buffer, e)
  47732. },
  47733. _select: function(e, t, i, n, r) {
  47734. if (n >= .5)
  47735. for (var o = 0; o !== r; ++o)
  47736. e[t + o] = e[i + o]
  47737. },
  47738. _slerp: function(e, t, i, r, o) {
  47739. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47740. },
  47741. _lerp: function(e, t, i, n, r) {
  47742. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47743. var s = t + a;
  47744. e[s] = e[s] * o + e[i + a] * n
  47745. }
  47746. }
  47747. },
  47748. n.BooleanKeyframeTrack = function(e, t, i) {
  47749. n.KeyframeTrack.call(this, e, t, i)
  47750. }
  47751. ,
  47752. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47753. constructor: n.BooleanKeyframeTrack,
  47754. ValueTypeName: "bool",
  47755. ValueBufferType: Array,
  47756. DefaultInterpolation: n.IntepolateDiscrete,
  47757. InterpolantFactoryMethodLinear: void 0,
  47758. InterpolantFactoryMethodSmooth: void 0
  47759. }),
  47760. n.NumberKeyframeTrack = function(e, t, i, r) {
  47761. n.KeyframeTrack.call(this, e, t, i, r)
  47762. }
  47763. ,
  47764. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47765. constructor: n.NumberKeyframeTrack,
  47766. ValueTypeName: "number"
  47767. }),
  47768. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47769. n.KeyframeTrack.call(this, e, t, i, r)
  47770. }
  47771. ,
  47772. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47773. constructor: n.QuaternionKeyframeTrack,
  47774. ValueTypeName: "quaternion",
  47775. DefaultInterpolation: n.InterpolateLinear,
  47776. InterpolantFactoryMethodLinear: function(e) {
  47777. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47778. },
  47779. InterpolantFactoryMethodSmooth: void 0
  47780. }),
  47781. n.StringKeyframeTrack = function(e, t, i, r) {
  47782. n.KeyframeTrack.call(this, e, t, i, r)
  47783. }
  47784. ,
  47785. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47786. constructor: n.StringKeyframeTrack,
  47787. ValueTypeName: "string",
  47788. ValueBufferType: Array,
  47789. DefaultInterpolation: n.IntepolateDiscrete,
  47790. InterpolantFactoryMethodLinear: void 0,
  47791. InterpolantFactoryMethodSmooth: void 0
  47792. }),
  47793. n.VectorKeyframeTrack = function(e, t, i, r) {
  47794. n.KeyframeTrack.call(this, e, t, i, r)
  47795. }
  47796. ,
  47797. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47798. constructor: n.VectorKeyframeTrack,
  47799. ValueTypeName: "vector"
  47800. }),
  47801. n.Audio = function(e) {
  47802. n.Object3D.call(this),
  47803. this.type = "Audio",
  47804. this.context = e.context,
  47805. this.source = this.context.createBufferSource(),
  47806. this.source.onended = this.onEnded.bind(this),
  47807. this.gain = this.context.createGain(),
  47808. this.gain.connect(e.getInput()),
  47809. this.autoplay = !1,
  47810. this.startTime = 0,
  47811. this.playbackRate = 1,
  47812. this.isPlaying = !1,
  47813. this.hasPlaybackControl = !0,
  47814. this.sourceType = "empty",
  47815. this.filter = null
  47816. }
  47817. ,
  47818. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47819. n.Audio.prototype.constructor = n.Audio,
  47820. n.Audio.prototype.getOutput = function() {
  47821. return this.gain
  47822. }
  47823. ,
  47824. n.Audio.prototype.load = function(e) {
  47825. var t = new n.AudioBuffer(this.context);
  47826. return t.load(e),
  47827. this.setBuffer(t),
  47828. this
  47829. }
  47830. ,
  47831. n.Audio.prototype.setNodeSource = function(e) {
  47832. return this.hasPlaybackControl = !1,
  47833. this.sourceType = "audioNode",
  47834. this.source = e,
  47835. this.connect(),
  47836. this
  47837. }
  47838. ,
  47839. n.Audio.prototype.setBuffer = function(e) {
  47840. var t = this;
  47841. return e.onReady(function(e) {
  47842. t.source.buffer = e,
  47843. t.sourceType = "buffer",
  47844. t.autoplay && t.play()
  47845. }),
  47846. this
  47847. }
  47848. ,
  47849. n.Audio.prototype.play = function() {
  47850. if (this.isPlaying === !0)
  47851. return void console.warn("THREE.Audio: Audio is already playing.");
  47852. if (this.hasPlaybackControl === !1)
  47853. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47854. var e = this.context.createBufferSource();
  47855. e.buffer = this.source.buffer,
  47856. e.loop = this.source.loop,
  47857. e.onended = this.source.onended,
  47858. e.start(0, this.startTime),
  47859. e.playbackRate.value = this.playbackRate,
  47860. this.isPlaying = !0,
  47861. this.source = e,
  47862. this.connect()
  47863. }
  47864. ,
  47865. n.Audio.prototype.pause = function() {
  47866. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47867. void (this.startTime = this.context.currentTime))
  47868. }
  47869. ,
  47870. n.Audio.prototype.stop = function() {
  47871. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47872. void (this.startTime = 0))
  47873. }
  47874. ,
  47875. n.Audio.prototype.connect = function() {
  47876. null !== this.filter ? (this.source.connect(this.filter),
  47877. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47878. }
  47879. ,
  47880. n.Audio.prototype.disconnect = function() {
  47881. null !== this.filter ? (this.source.disconnect(this.filter),
  47882. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47883. }
  47884. ,
  47885. n.Audio.prototype.getFilter = function() {
  47886. return this.filter
  47887. }
  47888. ,
  47889. n.Audio.prototype.setFilter = function(e) {
  47890. void 0 === e && (e = null),
  47891. this.isPlaying === !0 ? (this.disconnect(),
  47892. this.filter = e,
  47893. this.connect()) : this.filter = e
  47894. }
  47895. ,
  47896. n.Audio.prototype.setPlaybackRate = function(e) {
  47897. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47898. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47899. }
  47900. ,
  47901. n.Audio.prototype.getPlaybackRate = function() {
  47902. return this.playbackRate
  47903. }
  47904. ,
  47905. n.Audio.prototype.onEnded = function() {
  47906. this.isPlaying = !1
  47907. }
  47908. ,
  47909. n.Audio.prototype.setLoop = function(e) {
  47910. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47911. }
  47912. ,
  47913. n.Audio.prototype.getLoop = function() {
  47914. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47915. !1) : this.source.loop
  47916. }
  47917. ,
  47918. n.Audio.prototype.setVolume = function(e) {
  47919. this.gain.gain.value = e
  47920. }
  47921. ,
  47922. n.Audio.prototype.getVolume = function() {
  47923. return this.gain.gain.value
  47924. }
  47925. ,
  47926. n.AudioAnalyser = function(e, t) {
  47927. this.analyser = e.context.createAnalyser(),
  47928. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47929. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47930. e.getOutput().connect(this.analyser)
  47931. }
  47932. ,
  47933. n.AudioAnalyser.prototype = {
  47934. constructor: n.AudioAnalyser,
  47935. getData: function() {
  47936. return this.analyser.getByteFrequencyData(this.data),
  47937. this.data
  47938. }
  47939. },
  47940. n.AudioBuffer = function(e) {
  47941. this.context = e,
  47942. this.ready = !1,
  47943. this.readyCallbacks = []
  47944. }
  47945. ,
  47946. n.AudioBuffer.prototype.load = function(e) {
  47947. var t = this
  47948. , i = new XMLHttpRequest;
  47949. return i.open("GET", e, !0),
  47950. i.responseType = "arraybuffer",
  47951. i.onload = function(e) {
  47952. t.context.decodeAudioData(this.response, function(e) {
  47953. t.buffer = e,
  47954. t.ready = !0;
  47955. for (var i = 0; i < t.readyCallbacks.length; i++)
  47956. t.readyCallbacks[i](t.buffer);
  47957. t.readyCallbacks = []
  47958. })
  47959. }
  47960. ,
  47961. i.send(),
  47962. this
  47963. }
  47964. ,
  47965. n.AudioBuffer.prototype.onReady = function(e) {
  47966. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47967. }
  47968. ,
  47969. n.PositionalAudio = function(e) {
  47970. n.Audio.call(this, e),
  47971. this.panner = this.context.createPanner(),
  47972. this.panner.connect(this.gain)
  47973. }
  47974. ,
  47975. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47976. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47977. n.PositionalAudio.prototype.getOutput = function() {
  47978. return this.panner
  47979. }
  47980. ,
  47981. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47982. this.panner.refDistance = e
  47983. }
  47984. ,
  47985. n.PositionalAudio.prototype.getRefDistance = function() {
  47986. return this.panner.refDistance
  47987. }
  47988. ,
  47989. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47990. this.panner.rolloffFactor = e
  47991. }
  47992. ,
  47993. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47994. return this.panner.rolloffFactor
  47995. }
  47996. ,
  47997. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47998. this.panner.distanceModel = e
  47999. }
  48000. ,
  48001. n.PositionalAudio.prototype.getDistanceModel = function() {
  48002. return this.panner.distanceModel
  48003. }
  48004. ,
  48005. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  48006. this.panner.maxDistance = e
  48007. }
  48008. ,
  48009. n.PositionalAudio.prototype.getMaxDistance = function() {
  48010. return this.panner.maxDistance
  48011. }
  48012. ,
  48013. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  48014. var e = new n.Vector3;
  48015. return function(t) {
  48016. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  48017. e.setFromMatrixPosition(this.matrixWorld),
  48018. this.panner.setPosition(e.x, e.y, e.z)
  48019. }
  48020. }(),
  48021. n.AudioListener = function() {
  48022. n.Object3D.call(this),
  48023. this.type = "AudioListener",
  48024. this.context = new (window.AudioContext || window.webkitAudioContext),
  48025. this.gain = this.context.createGain(),
  48026. this.gain.connect(this.context.destination),
  48027. this.filter = null
  48028. }
  48029. ,
  48030. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  48031. n.AudioListener.prototype.constructor = n.AudioListener,
  48032. n.AudioListener.prototype.getInput = function() {
  48033. return this.gain
  48034. }
  48035. ,
  48036. n.AudioListener.prototype.removeFilter = function() {
  48037. null !== this.filter && (this.gain.disconnect(this.filter),
  48038. this.filter.disconnect(this.context.destination),
  48039. this.gain.connect(this.context.destination),
  48040. this.filter = null)
  48041. }
  48042. ,
  48043. n.AudioListener.prototype.setFilter = function(e) {
  48044. null !== this.filter ? (this.gain.disconnect(this.filter),
  48045. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  48046. this.filter = e,
  48047. this.gain.connect(this.filter),
  48048. this.filter.connect(this.context.destination)
  48049. }
  48050. ,
  48051. n.AudioListener.prototype.getFilter = function() {
  48052. return this.filter
  48053. }
  48054. ,
  48055. n.AudioListener.prototype.setMasterVolume = function(e) {
  48056. this.gain.gain.value = e
  48057. }
  48058. ,
  48059. n.AudioListener.prototype.getMasterVolume = function() {
  48060. return this.gain.gain.value
  48061. }
  48062. ,
  48063. n.AudioListener.prototype.updateMatrixWorld = function() {
  48064. var e = new n.Vector3
  48065. , t = new n.Quaternion
  48066. , i = new n.Vector3
  48067. , r = new n.Vector3;
  48068. return function(o) {
  48069. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  48070. var a = this.context.listener
  48071. , s = this.up;
  48072. this.matrixWorld.decompose(e, t, i),
  48073. r.set(0, 0, -1).applyQuaternion(t),
  48074. a.setPosition(e.x, e.y, e.z),
  48075. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  48076. }
  48077. }(),
  48078. n.Camera = function() {
  48079. n.Object3D.call(this),
  48080. this.type = "Camera",
  48081. this.matrixWorldInverse = new n.Matrix4,
  48082. this.projectionMatrix = new n.Matrix4
  48083. }
  48084. ,
  48085. n.Camera.prototype = Object.create(n.Object3D.prototype),
  48086. n.Camera.prototype.constructor = n.Camera,
  48087. n.Camera.prototype.getWorldDirection = function() {
  48088. var e = new n.Quaternion;
  48089. return function(t) {
  48090. var i = t || new n.Vector3;
  48091. return this.getWorldQuaternion(e),
  48092. i.set(0, 0, -1).applyQuaternion(e)
  48093. }
  48094. }(),
  48095. n.Camera.prototype.lookAt = function() {
  48096. var e = new n.Matrix4;
  48097. return function(t) {
  48098. e.lookAt(this.position, t, this.up),
  48099. this.quaternion.setFromRotationMatrix(e)
  48100. }
  48101. }(),
  48102. n.Camera.prototype.clone = function() {
  48103. return (new this.constructor).copy(this)
  48104. }
  48105. ,
  48106. n.Camera.prototype.copy = function(e) {
  48107. return n.Object3D.prototype.copy.call(this, e),
  48108. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  48109. this.projectionMatrix.copy(e.projectionMatrix),
  48110. this
  48111. }
  48112. ,
  48113. n.CubeCamera = function(e, t, i) {
  48114. n.Object3D.call(this),
  48115. this.type = "CubeCamera";
  48116. var r = 90
  48117. , o = 1
  48118. , a = new n.PerspectiveCamera(r,o,e,t);
  48119. a.up.set(0, -1, 0),
  48120. a.lookAt(new n.Vector3(1,0,0)),
  48121. this.add(a);
  48122. var s = new n.PerspectiveCamera(r,o,e,t);
  48123. s.up.set(0, -1, 0),
  48124. s.lookAt(new n.Vector3(-1,0,0)),
  48125. this.add(s);
  48126. var l = new n.PerspectiveCamera(r,o,e,t);
  48127. l.up.set(0, 0, 1),
  48128. l.lookAt(new n.Vector3(0,1,0)),
  48129. this.add(l);
  48130. var c = new n.PerspectiveCamera(r,o,e,t);
  48131. c.up.set(0, 0, -1),
  48132. c.lookAt(new n.Vector3(0,-1,0)),
  48133. this.add(c);
  48134. var h = new n.PerspectiveCamera(r,o,e,t);
  48135. h.up.set(0, -1, 0),
  48136. h.lookAt(new n.Vector3(0,0,1)),
  48137. this.add(h);
  48138. var u = new n.PerspectiveCamera(r,o,e,t);
  48139. u.up.set(0, -1, 0),
  48140. u.lookAt(new n.Vector3(0,0,-1)),
  48141. this.add(u);
  48142. var d = {
  48143. format: n.RGBFormat,
  48144. magFilter: n.LinearFilter,
  48145. minFilter: n.LinearFilter
  48146. };
  48147. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  48148. this.updateCubeMap = function(e, t) {
  48149. null === this.parent && this.updateMatrixWorld();
  48150. var i = this.renderTarget
  48151. , n = i.texture.generateMipmaps;
  48152. i.texture.generateMipmaps = !1,
  48153. i.activeCubeFace = 0,
  48154. e.render(t, a, i),
  48155. i.activeCubeFace = 1,
  48156. e.render(t, s, i),
  48157. i.activeCubeFace = 2,
  48158. e.render(t, l, i),
  48159. i.activeCubeFace = 3,
  48160. e.render(t, c, i),
  48161. i.activeCubeFace = 4,
  48162. e.render(t, h, i),
  48163. i.texture.generateMipmaps = n,
  48164. i.activeCubeFace = 5,
  48165. e.render(t, u, i),
  48166. e.setRenderTarget(null)
  48167. }
  48168. }
  48169. ,
  48170. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  48171. n.CubeCamera.prototype.constructor = n.CubeCamera,
  48172. n.OrthographicCamera = function(e, t, i, r, o, a) {
  48173. n.Camera.call(this),
  48174. this.type = "OrthographicCamera",
  48175. this.zoom = 1,
  48176. this.left = e,
  48177. this.right = t,
  48178. this.top = i,
  48179. this.bottom = r,
  48180. this.near = void 0 !== o ? o : .1,
  48181. this.far = void 0 !== a ? a : 2e3,
  48182. this.updateProjectionMatrix()
  48183. }
  48184. ,
  48185. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  48186. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  48187. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  48188. var e = (this.right - this.left) / (2 * this.zoom)
  48189. , t = (this.top - this.bottom) / (2 * this.zoom)
  48190. , i = (this.right + this.left) / 2
  48191. , n = (this.top + this.bottom) / 2;
  48192. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  48193. }
  48194. ,
  48195. n.OrthographicCamera.prototype.copy = function(e) {
  48196. return n.Camera.prototype.copy.call(this, e),
  48197. this.left = e.left,
  48198. this.right = e.right,
  48199. this.top = e.top,
  48200. this.bottom = e.bottom,
  48201. this.near = e.near,
  48202. this.far = e.far,
  48203. this.zoom = e.zoom,
  48204. this
  48205. }
  48206. ,
  48207. n.OrthographicCamera.prototype.toJSON = function(e) {
  48208. var t = n.Object3D.prototype.toJSON.call(this, e);
  48209. return t.object.zoom = this.zoom,
  48210. t.object.left = this.left,
  48211. t.object.right = this.right,
  48212. t.object.top = this.top,
  48213. t.object.bottom = this.bottom,
  48214. t.object.near = this.near,
  48215. t.object.far = this.far,
  48216. t
  48217. }
  48218. ,
  48219. n.PerspectiveCamera = function(e, t, i, r) {
  48220. n.Camera.call(this),
  48221. this.type = "PerspectiveCamera",
  48222. this.focalLength = 10,
  48223. this.zoom = 1,
  48224. this.fov = void 0 !== e ? e : 50,
  48225. this.aspect = void 0 !== t ? t : 1,
  48226. this.near = void 0 !== i ? i : .1,
  48227. this.far = void 0 !== r ? r : 2e3,
  48228. this.updateProjectionMatrix()
  48229. }
  48230. ,
  48231. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  48232. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  48233. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  48234. void 0 === t && (t = 24),
  48235. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  48236. this.updateProjectionMatrix()
  48237. }
  48238. ,
  48239. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  48240. this.fullWidth = e,
  48241. this.fullHeight = t,
  48242. this.x = i,
  48243. this.y = n,
  48244. this.width = r,
  48245. this.height = o,
  48246. this.updateProjectionMatrix()
  48247. }
  48248. ,
  48249. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  48250. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  48251. if (this.fullWidth) {
  48252. var t = this.fullWidth / this.fullHeight
  48253. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  48254. , r = -i
  48255. , o = t * r
  48256. , a = t * i
  48257. , s = Math.abs(a - o)
  48258. , l = Math.abs(i - r);
  48259. 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)
  48260. } else
  48261. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  48262. }
  48263. ,
  48264. n.PerspectiveCamera.prototype.copy = function(e) {
  48265. return n.Camera.prototype.copy.call(this, e),
  48266. this.focalLength = e.focalLength,
  48267. this.zoom = e.zoom,
  48268. this.fov = e.fov,
  48269. this.aspect = e.aspect,
  48270. this.near = e.near,
  48271. this.far = e.far,
  48272. this
  48273. }
  48274. ,
  48275. n.PerspectiveCamera.prototype.toJSON = function(e) {
  48276. var t = n.Object3D.prototype.toJSON.call(this, e);
  48277. return t.object.focalLength = this.focalLength,
  48278. t.object.zoom = this.zoom,
  48279. t.object.fov = this.fov,
  48280. t.object.aspect = this.aspect,
  48281. t.object.near = this.near,
  48282. t.object.far = this.far,
  48283. t
  48284. }
  48285. ,
  48286. n.StereoCamera = function() {
  48287. this.type = "StereoCamera",
  48288. this.aspect = 1,
  48289. this.cameraL = new n.PerspectiveCamera,
  48290. this.cameraL.layers.enable(1),
  48291. this.cameraL.matrixAutoUpdate = !1,
  48292. this.cameraR = new n.PerspectiveCamera,
  48293. this.cameraR.layers.enable(2),
  48294. this.cameraR.matrixAutoUpdate = !1
  48295. }
  48296. ,
  48297. n.StereoCamera.prototype = {
  48298. constructor: n.StereoCamera,
  48299. update: function() {
  48300. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  48301. return function(l) {
  48302. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  48303. if (c) {
  48304. e = l.focalLength,
  48305. t = l.fov,
  48306. i = l.aspect * this.aspect,
  48307. r = l.near,
  48308. o = l.far;
  48309. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  48310. s.elements[12] = -p,
  48311. a.elements[12] = p,
  48312. h = -g * i + f,
  48313. u = g * i + f,
  48314. d.elements[0] = 2 * r / (u - h),
  48315. d.elements[8] = (u + h) / (u - h),
  48316. this.cameraL.projectionMatrix.copy(d),
  48317. h = -g * i - f,
  48318. u = g * i - f,
  48319. d.elements[0] = 2 * r / (u - h),
  48320. d.elements[8] = (u + h) / (u - h),
  48321. this.cameraR.projectionMatrix.copy(d)
  48322. }
  48323. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  48324. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  48325. }
  48326. }()
  48327. },
  48328. n.Light = function(e, t) {
  48329. n.Object3D.call(this),
  48330. this.type = "Light",
  48331. this.color = new n.Color(e),
  48332. this.intensity = void 0 !== t ? t : 1,
  48333. this.receiveShadow = void 0
  48334. }
  48335. ,
  48336. n.Light.prototype = Object.create(n.Object3D.prototype),
  48337. n.Light.prototype.constructor = n.Light,
  48338. n.Light.prototype.copy = function(e) {
  48339. return n.Object3D.prototype.copy.call(this, e),
  48340. this.color.copy(e.color),
  48341. this.intensity = e.intensity,
  48342. this
  48343. }
  48344. ,
  48345. n.Light.prototype.toJSON = function(e) {
  48346. var t = n.Object3D.prototype.toJSON.call(this, e);
  48347. return t.object.color = this.color.getHex(),
  48348. t.object.intensity = this.intensity,
  48349. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  48350. void 0 !== this.distance && (t.object.distance = this.distance),
  48351. void 0 !== this.angle && (t.object.angle = this.angle),
  48352. void 0 !== this.decay && (t.object.decay = this.decay),
  48353. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  48354. t
  48355. }
  48356. ,
  48357. n.LightShadow = function(e) {
  48358. this.camera = e,
  48359. this.bias = 0,
  48360. this.radius = 1,
  48361. this.mapSize = new n.Vector2(512,512),
  48362. this.map = null,
  48363. this.matrix = new n.Matrix4
  48364. }
  48365. ,
  48366. n.LightShadow.prototype = {
  48367. constructor: n.LightShadow,
  48368. copy: function(e) {
  48369. return this.camera = e.camera.clone(),
  48370. this.bias = e.bias,
  48371. this.radius = e.radius,
  48372. this.mapSize.copy(e.mapSize),
  48373. this
  48374. },
  48375. clone: function() {
  48376. return (new this.constructor).copy(this)
  48377. }
  48378. },
  48379. n.AmbientLight = function(e, t) {
  48380. n.Light.call(this, e, t),
  48381. this.type = "AmbientLight",
  48382. this.castShadow = void 0
  48383. }
  48384. ,
  48385. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  48386. n.AmbientLight.prototype.constructor = n.AmbientLight,
  48387. n.DirectionalLight = function(e, t) {
  48388. n.Light.call(this, e, t),
  48389. this.type = "DirectionalLight",
  48390. this.position.set(0, 1, 0),
  48391. this.updateMatrix(),
  48392. this.target = new n.Object3D,
  48393. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  48394. }
  48395. ,
  48396. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  48397. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  48398. n.DirectionalLight.prototype.copy = function(e) {
  48399. return n.Light.prototype.copy.call(this, e),
  48400. this.target = e.target.clone(),
  48401. this.shadow = e.shadow.clone(),
  48402. this
  48403. }
  48404. ,
  48405. n.HemisphereLight = function(e, t, i) {
  48406. n.Light.call(this, e, i),
  48407. this.type = "HemisphereLight",
  48408. this.castShadow = void 0,
  48409. this.position.set(0, 1, 0),
  48410. this.updateMatrix(),
  48411. this.groundColor = new n.Color(t)
  48412. }
  48413. ,
  48414. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  48415. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  48416. n.HemisphereLight.prototype.copy = function(e) {
  48417. return n.Light.prototype.copy.call(this, e),
  48418. this.groundColor.copy(e.groundColor),
  48419. this
  48420. }
  48421. ,
  48422. n.PointLight = function(e, t, i, r) {
  48423. n.Light.call(this, e, t),
  48424. this.type = "PointLight",
  48425. this.distance = void 0 !== i ? i : 0,
  48426. this.decay = void 0 !== r ? r : 1,
  48427. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  48428. }
  48429. ,
  48430. n.PointLight.prototype = Object.create(n.Light.prototype),
  48431. n.PointLight.prototype.constructor = n.PointLight,
  48432. Object.defineProperty(n.PointLight.prototype, "power", {
  48433. get: function() {
  48434. return 4 * this.intensity * Math.PI
  48435. },
  48436. set: function(e) {
  48437. this.intensity = e / (4 * Math.PI)
  48438. }
  48439. }),
  48440. n.PointLight.prototype.copy = function(e) {
  48441. return n.Light.prototype.copy.call(this, e),
  48442. this.distance = e.distance,
  48443. this.decay = e.decay,
  48444. this.shadow = e.shadow.clone(),
  48445. this
  48446. }
  48447. ,
  48448. n.SpotLight = function(e, t, i, r, o, a) {
  48449. n.Light.call(this, e, t),
  48450. this.type = "SpotLight",
  48451. this.position.set(0, 1, 0),
  48452. this.updateMatrix(),
  48453. this.target = new n.Object3D,
  48454. this.distance = void 0 !== i ? i : 0,
  48455. this.angle = void 0 !== r ? r : Math.PI / 3,
  48456. this.penumbra = void 0 !== o ? o : 0,
  48457. this.decay = void 0 !== a ? a : 1,
  48458. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  48459. }
  48460. ,
  48461. n.SpotLight.prototype = Object.create(n.Light.prototype),
  48462. n.SpotLight.prototype.constructor = n.SpotLight,
  48463. Object.defineProperty(n.SpotLight.prototype, "power", {
  48464. get: function() {
  48465. return this.intensity * Math.PI
  48466. },
  48467. set: function(e) {
  48468. this.intensity = e / Math.PI
  48469. }
  48470. }),
  48471. n.SpotLight.prototype.copy = function(e) {
  48472. return n.Light.prototype.copy.call(this, e),
  48473. this.distance = e.distance,
  48474. this.angle = e.angle,
  48475. this.penumbra = e.penumbra,
  48476. this.decay = e.decay,
  48477. this.target = e.target.clone(),
  48478. this.shadow = e.shadow.clone(),
  48479. this
  48480. }
  48481. ,
  48482. n.Cache = {
  48483. enabled: !1,
  48484. files: {},
  48485. add: function(e, t) {
  48486. this.enabled !== !1 && (this.files[e] = t)
  48487. },
  48488. get: function(e) {
  48489. if (this.enabled !== !1)
  48490. return this.files[e]
  48491. },
  48492. remove: function(e) {
  48493. delete this.files[e]
  48494. },
  48495. clear: function() {
  48496. this.files = {}
  48497. }
  48498. },
  48499. n.Loader = function() {
  48500. this.onLoadStart = function() {}
  48501. ,
  48502. this.onLoadProgress = function() {}
  48503. ,
  48504. this.onLoadComplete = function() {}
  48505. }
  48506. ,
  48507. n.Loader.prototype = {
  48508. constructor: n.Loader,
  48509. crossOrigin: void 0,
  48510. extractUrlBase: function(e) {
  48511. var t = e.split("/");
  48512. return 1 === t.length ? "./" : (t.pop(),
  48513. t.join("/") + "/")
  48514. },
  48515. initMaterials: function(e, t, i) {
  48516. for (var n = [], r = 0; r < e.length; ++r)
  48517. n[r] = this.createMaterial(e[r], t, i);
  48518. return n
  48519. },
  48520. createMaterial: function() {
  48521. var e, t, i;
  48522. return function(r, o, a) {
  48523. function s(e, i, r, s, c) {
  48524. var h, u = o + e, d = n.Loader.Handlers.get(u);
  48525. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  48526. h = t.load(u)),
  48527. void 0 !== i && (h.repeat.fromArray(i),
  48528. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  48529. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  48530. void 0 !== r && h.offset.fromArray(r),
  48531. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  48532. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  48533. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  48534. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  48535. void 0 !== c && (h.anisotropy = c);
  48536. var p = n.Math.generateUUID();
  48537. return l[p] = h,
  48538. p
  48539. }
  48540. void 0 === e && (e = new n.Color),
  48541. void 0 === t && (t = new n.TextureLoader),
  48542. void 0 === i && (i = new n.MaterialLoader);
  48543. var l = {}
  48544. , c = {
  48545. uuid: n.Math.generateUUID(),
  48546. type: "MeshLambertMaterial"
  48547. };
  48548. for (var h in r) {
  48549. var u = r[h];
  48550. switch (h) {
  48551. case "DbgColor":
  48552. case "DbgIndex":
  48553. case "opticalDensity":
  48554. case "illumination":
  48555. break;
  48556. case "DbgName":
  48557. c.name = u;
  48558. break;
  48559. case "blending":
  48560. c.blending = n[u];
  48561. break;
  48562. case "colorAmbient":
  48563. case "mapAmbient":
  48564. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  48565. break;
  48566. case "colorDiffuse":
  48567. c.color = e.fromArray(u).getHex();
  48568. break;
  48569. case "colorSpecular":
  48570. c.specular = e.fromArray(u).getHex();
  48571. break;
  48572. case "colorEmissive":
  48573. c.emissive = e.fromArray(u).getHex();
  48574. break;
  48575. case "specularCoef":
  48576. c.shininess = u;
  48577. break;
  48578. case "shading":
  48579. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  48580. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  48581. break;
  48582. case "mapDiffuse":
  48583. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  48584. break;
  48585. case "mapDiffuseRepeat":
  48586. case "mapDiffuseOffset":
  48587. case "mapDiffuseWrap":
  48588. case "mapDiffuseAnisotropy":
  48589. break;
  48590. case "mapLight":
  48591. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  48592. break;
  48593. case "mapLightRepeat":
  48594. case "mapLightOffset":
  48595. case "mapLightWrap":
  48596. case "mapLightAnisotropy":
  48597. break;
  48598. case "mapAO":
  48599. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  48600. break;
  48601. case "mapAORepeat":
  48602. case "mapAOOffset":
  48603. case "mapAOWrap":
  48604. case "mapAOAnisotropy":
  48605. break;
  48606. case "mapBump":
  48607. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  48608. break;
  48609. case "mapBumpScale":
  48610. c.bumpScale = u;
  48611. break;
  48612. case "mapBumpRepeat":
  48613. case "mapBumpOffset":
  48614. case "mapBumpWrap":
  48615. case "mapBumpAnisotropy":
  48616. break;
  48617. case "mapNormal":
  48618. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  48619. break;
  48620. case "mapNormalFactor":
  48621. c.normalScale = [u, u];
  48622. break;
  48623. case "mapNormalRepeat":
  48624. case "mapNormalOffset":
  48625. case "mapNormalWrap":
  48626. case "mapNormalAnisotropy":
  48627. break;
  48628. case "mapSpecular":
  48629. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  48630. break;
  48631. case "mapSpecularRepeat":
  48632. case "mapSpecularOffset":
  48633. case "mapSpecularWrap":
  48634. case "mapSpecularAnisotropy":
  48635. break;
  48636. case "mapAlpha":
  48637. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  48638. break;
  48639. case "mapAlphaRepeat":
  48640. case "mapAlphaOffset":
  48641. case "mapAlphaWrap":
  48642. case "mapAlphaAnisotropy":
  48643. break;
  48644. case "flipSided":
  48645. c.side = n.BackSide;
  48646. break;
  48647. case "doubleSided":
  48648. c.side = n.DoubleSide;
  48649. break;
  48650. case "transparency":
  48651. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  48652. c.opacity = u;
  48653. break;
  48654. case "depthTest":
  48655. case "depthWrite":
  48656. case "colorWrite":
  48657. case "opacity":
  48658. case "reflectivity":
  48659. case "transparent":
  48660. case "visible":
  48661. case "wireframe":
  48662. c[h] = u;
  48663. break;
  48664. case "vertexColors":
  48665. u === !0 && (c.vertexColors = n.VertexColors),
  48666. "face" === u && (c.vertexColors = n.FaceColors);
  48667. break;
  48668. default:
  48669. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48670. }
  48671. }
  48672. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48673. "MeshPhongMaterial" !== c.type && delete c.specular,
  48674. c.opacity < 1 && (c.transparent = !0),
  48675. i.setTextures(l),
  48676. i.parse(c)
  48677. }
  48678. }()
  48679. },
  48680. n.Loader.Handlers = {
  48681. handlers: [],
  48682. add: function(e, t) {
  48683. this.handlers.push(e, t)
  48684. },
  48685. get: function(e) {
  48686. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48687. var r = t[i]
  48688. , o = t[i + 1];
  48689. if (r.test(e))
  48690. return o
  48691. }
  48692. return null
  48693. }
  48694. },
  48695. n.XHRLoader = function(e) {
  48696. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48697. }
  48698. ,
  48699. n.XHRLoader.prototype = {
  48700. constructor: n.XHRLoader,
  48701. load: function(e, t, i, r) {
  48702. void 0 !== this.path && (e = this.path + e);
  48703. var o = this
  48704. , a = n.Cache.get(e);
  48705. if (void 0 !== a)
  48706. return t && setTimeout(function() {
  48707. t(a)
  48708. }, 0),
  48709. a;
  48710. var s = new XMLHttpRequest;
  48711. return s.overrideMimeType("text/plain"),
  48712. s.open("GET", e, !0),
  48713. s.addEventListener("load", function(i) {
  48714. var a = i.target.response;
  48715. n.Cache.add(e, a),
  48716. 200 === this.status ? (t && t(a),
  48717. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48718. t && t(a),
  48719. o.manager.itemEnd(e)) : (r && r(i),
  48720. o.manager.itemError(e))
  48721. }, !1),
  48722. void 0 !== i && s.addEventListener("progress", function(e) {
  48723. i(e)
  48724. }, !1),
  48725. s.addEventListener("error", function(t) {
  48726. r && r(t),
  48727. o.manager.itemError(e)
  48728. }, !1),
  48729. void 0 !== this.responseType && (s.responseType = this.responseType),
  48730. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48731. s.send(null),
  48732. o.manager.itemStart(e),
  48733. s
  48734. },
  48735. setPath: function(e) {
  48736. this.path = e
  48737. },
  48738. setResponseType: function(e) {
  48739. this.responseType = e
  48740. },
  48741. setWithCredentials: function(e) {
  48742. this.withCredentials = e
  48743. }
  48744. },
  48745. n.FontLoader = function(e) {
  48746. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48747. }
  48748. ,
  48749. n.FontLoader.prototype = {
  48750. constructor: n.FontLoader,
  48751. load: function(e, t, i, r) {
  48752. var o = new n.XHRLoader(this.manager);
  48753. o.load(e, function(e) {
  48754. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48755. }, i, r)
  48756. }
  48757. },
  48758. n.ImageLoader = function(e) {
  48759. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48760. }
  48761. ,
  48762. n.ImageLoader.prototype = {
  48763. constructor: n.ImageLoader,
  48764. load: function(e, t, i, r) {
  48765. void 0 !== this.path && (e = this.path + e);
  48766. var o = this
  48767. , a = n.Cache.get(e);
  48768. if (void 0 !== a)
  48769. return o.manager.itemStart(e),
  48770. t ? setTimeout(function() {
  48771. t(a),
  48772. o.manager.itemEnd(e)
  48773. }, 0) : o.manager.itemEnd(e),
  48774. a;
  48775. var s = document.createElement("img");
  48776. return s.addEventListener("load", function(i) {
  48777. n.Cache.add(e, this),
  48778. t && t(this),
  48779. o.manager.itemEnd(e)
  48780. }, !1),
  48781. void 0 !== i && s.addEventListener("progress", function(e) {
  48782. i(e)
  48783. }, !1),
  48784. s.addEventListener("error", function(t) {
  48785. r && r(t),
  48786. o.manager.itemError(e)
  48787. }, !1),
  48788. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48789. o.manager.itemStart(e),
  48790. s.src = e,
  48791. s
  48792. },
  48793. setCrossOrigin: function(e) {
  48794. this.crossOrigin = e
  48795. },
  48796. setPath: function(e) {
  48797. this.path = e
  48798. }
  48799. },
  48800. n.JSONLoader = function(e) {
  48801. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48802. e = void 0),
  48803. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48804. this.withCredentials = !1
  48805. }
  48806. ,
  48807. n.JSONLoader.prototype = {
  48808. constructor: n.JSONLoader,
  48809. get statusDomElement() {
  48810. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48811. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48812. this._statusDomElement
  48813. },
  48814. load: function(e, t, i, r) {
  48815. var o = this
  48816. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48817. , s = new n.XHRLoader(this.manager);
  48818. s.setWithCredentials(this.withCredentials),
  48819. s.load(e, function(i) {
  48820. var n = JSON.parse(i)
  48821. , r = n.metadata;
  48822. if (void 0 !== r) {
  48823. var s = r.type;
  48824. if (void 0 !== s) {
  48825. if ("object" === s.toLowerCase())
  48826. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48827. if ("scene" === s.toLowerCase())
  48828. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48829. }
  48830. }
  48831. var l = o.parse(n, a);
  48832. t(l.geometry, l.materials)
  48833. }, i, r)
  48834. },
  48835. setTexturePath: function(e) {
  48836. this.texturePath = e
  48837. },
  48838. parse: function(e, t) {
  48839. function i(t) {
  48840. function i(e, t) {
  48841. return e & 1 << t
  48842. }
  48843. 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;
  48844. if (void 0 !== e.uvs) {
  48845. for (r = 0; r < e.uvs.length; r++)
  48846. e.uvs[r].length && B++;
  48847. for (r = 0; r < B; r++)
  48848. s.faceVertexUvs[r] = []
  48849. }
  48850. for (l = 0,
  48851. c = L.length; l < c; )
  48852. E = new n.Vector3,
  48853. E.x = L[l++] * t,
  48854. E.y = L[l++] * t,
  48855. E.z = L[l++] * t,
  48856. s.vertices.push(E);
  48857. for (l = 0,
  48858. c = O.length; l < c; )
  48859. if (f = O[l++],
  48860. g = i(f, 0),
  48861. m = i(f, 1),
  48862. v = i(f, 3),
  48863. A = i(f, 4),
  48864. y = i(f, 5),
  48865. C = i(f, 6),
  48866. I = i(f, 7),
  48867. g) {
  48868. if (w = new n.Face3,
  48869. w.a = O[l],
  48870. w.b = O[l + 1],
  48871. w.c = O[l + 3],
  48872. _ = new n.Face3,
  48873. _.a = O[l + 1],
  48874. _.b = O[l + 2],
  48875. _.c = O[l + 3],
  48876. l += 4,
  48877. m && (p = O[l++],
  48878. w.materialIndex = p,
  48879. _.materialIndex = p),
  48880. a = s.faces.length,
  48881. v)
  48882. for (r = 0; r < B; r++)
  48883. for (S = e.uvs[r],
  48884. s.faceVertexUvs[r][a] = [],
  48885. s.faceVertexUvs[r][a + 1] = [],
  48886. o = 0; o < 4; o++)
  48887. d = O[l++],
  48888. R = S[2 * d],
  48889. P = S[2 * d + 1],
  48890. M = new n.Vector2(R,P),
  48891. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48892. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48893. if (A && (u = 3 * O[l++],
  48894. w.normal.set(D[u++], D[u++], D[u]),
  48895. _.normal.copy(w.normal)),
  48896. y)
  48897. for (r = 0; r < 4; r++)
  48898. u = 3 * O[l++],
  48899. x = new n.Vector3(D[u++],D[u++],D[u]),
  48900. 2 !== r && w.vertexNormals.push(x),
  48901. 0 !== r && _.vertexNormals.push(x);
  48902. if (C && (h = O[l++],
  48903. T = N[h],
  48904. w.color.setHex(T),
  48905. _.color.setHex(T)),
  48906. I)
  48907. for (r = 0; r < 4; r++)
  48908. h = O[l++],
  48909. T = N[h],
  48910. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48911. 0 !== r && _.vertexColors.push(new n.Color(T));
  48912. s.faces.push(w),
  48913. s.faces.push(_)
  48914. } else {
  48915. if (b = new n.Face3,
  48916. b.a = O[l++],
  48917. b.b = O[l++],
  48918. b.c = O[l++],
  48919. m && (p = O[l++],
  48920. b.materialIndex = p),
  48921. a = s.faces.length,
  48922. v)
  48923. for (r = 0; r < B; r++)
  48924. for (S = e.uvs[r],
  48925. s.faceVertexUvs[r][a] = [],
  48926. o = 0; o < 3; o++)
  48927. d = O[l++],
  48928. R = S[2 * d],
  48929. P = S[2 * d + 1],
  48930. M = new n.Vector2(R,P),
  48931. s.faceVertexUvs[r][a].push(M);
  48932. if (A && (u = 3 * O[l++],
  48933. b.normal.set(D[u++], D[u++], D[u])),
  48934. y)
  48935. for (r = 0; r < 3; r++)
  48936. u = 3 * O[l++],
  48937. x = new n.Vector3(D[u++],D[u++],D[u]),
  48938. b.vertexNormals.push(x);
  48939. if (C && (h = O[l++],
  48940. b.color.setHex(N[h])),
  48941. I)
  48942. for (r = 0; r < 3; r++)
  48943. h = O[l++],
  48944. b.vertexColors.push(new n.Color(N[h]));
  48945. s.faces.push(b)
  48946. }
  48947. }
  48948. function r() {
  48949. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48950. if (e.skinWeights)
  48951. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48952. var o = e.skinWeights[i]
  48953. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48954. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48955. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48956. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48957. }
  48958. if (e.skinIndices)
  48959. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48960. var h = e.skinIndices[i]
  48961. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48962. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48963. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48964. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48965. }
  48966. s.bones = e.bones,
  48967. 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.")
  48968. }
  48969. function o(t) {
  48970. if (void 0 !== e.morphTargets)
  48971. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48972. s.morphTargets[i] = {},
  48973. s.morphTargets[i].name = e.morphTargets[i].name,
  48974. s.morphTargets[i].vertices = [];
  48975. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48976. var h = new n.Vector3;
  48977. h.x = a[l] * t,
  48978. h.y = a[l + 1] * t,
  48979. h.z = a[l + 2] * t,
  48980. o.push(h)
  48981. }
  48982. }
  48983. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48984. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48985. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48986. u[i].color.fromArray(d, 3 * i)
  48987. }
  48988. }
  48989. function a() {
  48990. var t = []
  48991. , i = [];
  48992. void 0 !== e.animation && i.push(e.animation),
  48993. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48994. for (var r = 0; r < i.length; r++) {
  48995. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48996. o && t.push(o)
  48997. }
  48998. if (s.morphTargets) {
  48999. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  49000. t = t.concat(a)
  49001. }
  49002. t.length > 0 && (s.animations = t)
  49003. }
  49004. var s = new n.Geometry
  49005. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  49006. if (i(l),
  49007. r(),
  49008. o(l),
  49009. a(),
  49010. s.computeFaceNormals(),
  49011. s.computeBoundingSphere(),
  49012. void 0 === e.materials || 0 === e.materials.length)
  49013. return {
  49014. geometry: s
  49015. };
  49016. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  49017. return {
  49018. geometry: s,
  49019. materials: c
  49020. }
  49021. }
  49022. },
  49023. n.LoadingManager = function(e, t, i) {
  49024. var n = this
  49025. , r = !1
  49026. , o = 0
  49027. , a = 0;
  49028. this.onStart = void 0,
  49029. this.onLoad = e,
  49030. this.onProgress = t,
  49031. this.onError = i,
  49032. this.itemStart = function(e) {
  49033. a++,
  49034. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  49035. r = !0
  49036. }
  49037. ,
  49038. this.itemEnd = function(e) {
  49039. o++,
  49040. void 0 !== n.onProgress && n.onProgress(e, o, a),
  49041. o === a && (r = !1,
  49042. void 0 !== n.onLoad && n.onLoad())
  49043. }
  49044. ,
  49045. this.itemError = function(e) {
  49046. void 0 !== n.onError && n.onError(e)
  49047. }
  49048. }
  49049. ,
  49050. n.DefaultLoadingManager = new n.LoadingManager,
  49051. n.BufferGeometryLoader = function(e) {
  49052. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49053. }
  49054. ,
  49055. n.BufferGeometryLoader.prototype = {
  49056. constructor: n.BufferGeometryLoader,
  49057. load: function(e, t, i, r) {
  49058. var o = this
  49059. , a = new n.XHRLoader(o.manager);
  49060. a.load(e, function(e) {
  49061. t(o.parse(JSON.parse(e)))
  49062. }, i, r)
  49063. },
  49064. parse: function(e) {
  49065. var t = new n.BufferGeometry
  49066. , i = e.data.index
  49067. , r = {
  49068. Int8Array: Int8Array,
  49069. Uint8Array: Uint8Array,
  49070. Uint8ClampedArray: Uint8ClampedArray,
  49071. Int16Array: Int16Array,
  49072. Uint16Array: Uint16Array,
  49073. Int32Array: Int32Array,
  49074. Uint32Array: Uint32Array,
  49075. Float32Array: Float32Array,
  49076. Float64Array: Float64Array
  49077. };
  49078. if (void 0 !== i) {
  49079. var o = new r[i.type](i.array);
  49080. t.setIndex(new n.BufferAttribute(o,1))
  49081. }
  49082. var a = e.data.attributes;
  49083. for (var s in a) {
  49084. var l = a[s]
  49085. , o = new r[l.type](l.array);
  49086. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  49087. }
  49088. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  49089. if (void 0 !== c)
  49090. for (var h = 0, u = c.length; h !== u; ++h) {
  49091. var d = c[h];
  49092. t.addGroup(d.start, d.count, d.materialIndex)
  49093. }
  49094. var p = e.data.boundingSphere;
  49095. if (void 0 !== p) {
  49096. var f = new n.Vector3;
  49097. void 0 !== p.center && f.fromArray(p.center),
  49098. t.boundingSphere = new n.Sphere(f,p.radius)
  49099. }
  49100. return t
  49101. }
  49102. },
  49103. n.MaterialLoader = function(e) {
  49104. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49105. this.textures = {}
  49106. }
  49107. ,
  49108. n.MaterialLoader.prototype = {
  49109. constructor: n.MaterialLoader,
  49110. load: function(e, t, i, r) {
  49111. var o = this
  49112. , a = new n.XHRLoader(o.manager);
  49113. a.load(e, function(e) {
  49114. t(o.parse(JSON.parse(e)))
  49115. }, i, r)
  49116. },
  49117. setTextures: function(e) {
  49118. this.textures = e
  49119. },
  49120. getTexture: function(e) {
  49121. var t = this.textures;
  49122. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  49123. t[e]
  49124. },
  49125. parse: function(e) {
  49126. var t = new n[e.type];
  49127. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  49128. void 0 !== e.name && (t.name = e.name),
  49129. void 0 !== e.color && t.color.setHex(e.color),
  49130. void 0 !== e.roughness && (t.roughness = e.roughness),
  49131. void 0 !== e.metalness && (t.metalness = e.metalness),
  49132. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  49133. void 0 !== e.specular && t.specular.setHex(e.specular),
  49134. void 0 !== e.shininess && (t.shininess = e.shininess),
  49135. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  49136. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  49137. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  49138. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  49139. void 0 !== e.shading && (t.shading = e.shading),
  49140. void 0 !== e.blending && (t.blending = e.blending),
  49141. void 0 !== e.side && (t.side = e.side),
  49142. void 0 !== e.opacity && (t.opacity = e.opacity),
  49143. void 0 !== e.transparent && (t.transparent = e.transparent),
  49144. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  49145. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  49146. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  49147. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  49148. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  49149. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  49150. void 0 !== e.size && (t.size = e.size),
  49151. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  49152. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  49153. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  49154. t.transparent = !0),
  49155. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  49156. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  49157. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  49158. void 0 !== e.normalScale) {
  49159. var i = e.normalScale;
  49160. Array.isArray(i) === !1 && (i = [i, i]),
  49161. t.normalScale = (new n.Vector2).fromArray(i)
  49162. }
  49163. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  49164. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  49165. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  49166. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  49167. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  49168. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  49169. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  49170. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  49171. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  49172. t.combine = n.MultiplyOperation),
  49173. e.reflectivity && (t.reflectivity = e.reflectivity),
  49174. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  49175. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  49176. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  49177. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  49178. void 0 !== e.materials)
  49179. for (var r = 0, o = e.materials.length; r < o; r++)
  49180. t.materials.push(this.parse(e.materials[r]));
  49181. return t
  49182. }
  49183. },
  49184. n.ObjectLoader = function(e) {
  49185. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49186. this.texturePath = ""
  49187. }
  49188. ,
  49189. n.ObjectLoader.prototype = {
  49190. constructor: n.ObjectLoader,
  49191. load: function(e, t, i, r) {
  49192. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  49193. var o = this
  49194. , a = new n.XHRLoader(o.manager);
  49195. a.load(e, function(e) {
  49196. o.parse(JSON.parse(e), t)
  49197. }, i, r)
  49198. },
  49199. setTexturePath: function(e) {
  49200. this.texturePath = e
  49201. },
  49202. setCrossOrigin: function(e) {
  49203. this.crossOrigin = e
  49204. },
  49205. parse: function(e, t) {
  49206. var i = this.parseGeometries(e.geometries)
  49207. , n = this.parseImages(e.images, function() {
  49208. void 0 !== t && t(a)
  49209. })
  49210. , r = this.parseTextures(e.textures, n)
  49211. , o = this.parseMaterials(e.materials, r)
  49212. , a = this.parseObject(e.object, i, o);
  49213. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  49214. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  49215. a
  49216. },
  49217. parseGeometries: function(e) {
  49218. var t = {};
  49219. if (void 0 !== e)
  49220. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  49221. var s, l = e[o];
  49222. switch (l.type) {
  49223. case "PlaneGeometry":
  49224. case "PlaneBufferGeometry":
  49225. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  49226. break;
  49227. case "BoxGeometry":
  49228. case "BoxBufferGeometry":
  49229. case "CubeGeometry":
  49230. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  49231. break;
  49232. case "CircleGeometry":
  49233. case "CircleBufferGeometry":
  49234. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  49235. break;
  49236. case "CylinderGeometry":
  49237. case "CylinderBufferGeometry":
  49238. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  49239. break;
  49240. case "SphereGeometry":
  49241. case "SphereBufferGeometry":
  49242. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  49243. break;
  49244. case "DodecahedronGeometry":
  49245. s = new n.DodecahedronGeometry(l.radius,l.detail);
  49246. break;
  49247. case "IcosahedronGeometry":
  49248. s = new n.IcosahedronGeometry(l.radius,l.detail);
  49249. break;
  49250. case "OctahedronGeometry":
  49251. s = new n.OctahedronGeometry(l.radius,l.detail);
  49252. break;
  49253. case "TetrahedronGeometry":
  49254. s = new n.TetrahedronGeometry(l.radius,l.detail);
  49255. break;
  49256. case "RingGeometry":
  49257. case "RingBufferGeometry":
  49258. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  49259. break;
  49260. case "TorusGeometry":
  49261. case "TorusBufferGeometry":
  49262. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  49263. break;
  49264. case "TorusKnotGeometry":
  49265. case "TorusKnotBufferGeometry":
  49266. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  49267. break;
  49268. case "LatheGeometry":
  49269. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  49270. break;
  49271. case "BufferGeometry":
  49272. s = r.parse(l);
  49273. break;
  49274. case "Geometry":
  49275. s = i.parse(l.data, this.texturePath).geometry;
  49276. break;
  49277. default:
  49278. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  49279. continue
  49280. }
  49281. s.uuid = l.uuid,
  49282. void 0 !== l.name && (s.name = l.name),
  49283. t[l.uuid] = s
  49284. }
  49285. return t
  49286. },
  49287. parseMaterials: function(e, t) {
  49288. var i = {};
  49289. if (void 0 !== e) {
  49290. var r = new n.MaterialLoader;
  49291. r.setTextures(t);
  49292. for (var o = 0, a = e.length; o < a; o++) {
  49293. var s = r.parse(e[o]);
  49294. i[s.uuid] = s
  49295. }
  49296. }
  49297. return i
  49298. },
  49299. parseAnimations: function(e) {
  49300. for (var t = [], i = 0; i < e.length; i++) {
  49301. var r = n.AnimationClip.parse(e[i]);
  49302. t.push(r)
  49303. }
  49304. return t
  49305. },
  49306. parseImages: function(e, t) {
  49307. function i(e) {
  49308. return r.manager.itemStart(e),
  49309. s.load(e, function() {
  49310. r.manager.itemEnd(e)
  49311. })
  49312. }
  49313. var r = this
  49314. , o = {};
  49315. if (void 0 !== e && e.length > 0) {
  49316. var a = new n.LoadingManager(t)
  49317. , s = new n.ImageLoader(a);
  49318. s.setCrossOrigin(this.crossOrigin);
  49319. for (var l = 0, c = e.length; l < c; l++) {
  49320. var h = e[l]
  49321. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  49322. o[h.uuid] = i(u)
  49323. }
  49324. }
  49325. return o
  49326. },
  49327. parseTextures: function(e, t) {
  49328. function i(e) {
  49329. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  49330. n[e])
  49331. }
  49332. var r = {};
  49333. if (void 0 !== e)
  49334. for (var o = 0, a = e.length; o < a; o++) {
  49335. var s = e[o];
  49336. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  49337. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  49338. var l = new n.Texture(t[s.image]);
  49339. l.needsUpdate = !0,
  49340. l.uuid = s.uuid,
  49341. void 0 !== s.name && (l.name = s.name),
  49342. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  49343. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  49344. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  49345. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  49346. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  49347. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  49348. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  49349. l.wrapT = i(s.wrap[1])),
  49350. r[s.uuid] = l
  49351. }
  49352. return r
  49353. },
  49354. parseObject: function() {
  49355. var e = new n.Matrix4;
  49356. return function(t, i, r) {
  49357. function o(e) {
  49358. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  49359. i[e]
  49360. }
  49361. function a(e) {
  49362. if (void 0 !== e)
  49363. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  49364. r[e]
  49365. }
  49366. var s;
  49367. switch (t.type) {
  49368. case "Scene":
  49369. s = new n.Scene;
  49370. break;
  49371. case "PerspectiveCamera":
  49372. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  49373. break;
  49374. case "OrthographicCamera":
  49375. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  49376. break;
  49377. case "AmbientLight":
  49378. s = new n.AmbientLight(t.color,t.intensity);
  49379. break;
  49380. case "DirectionalLight":
  49381. s = new n.DirectionalLight(t.color,t.intensity);
  49382. break;
  49383. case "PointLight":
  49384. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  49385. break;
  49386. case "SpotLight":
  49387. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  49388. break;
  49389. case "HemisphereLight":
  49390. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  49391. break;
  49392. case "Mesh":
  49393. var l = o(t.geometry)
  49394. , c = a(t.material);
  49395. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  49396. break;
  49397. case "LOD":
  49398. s = new n.LOD;
  49399. break;
  49400. case "Line":
  49401. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  49402. break;
  49403. case "PointCloud":
  49404. case "Points":
  49405. s = new n.Points(o(t.geometry),a(t.material));
  49406. break;
  49407. case "Sprite":
  49408. s = new n.Sprite(a(t.material));
  49409. break;
  49410. case "Group":
  49411. s = new n.Group;
  49412. break;
  49413. default:
  49414. s = new n.Object3D
  49415. }
  49416. if (s.uuid = t.uuid,
  49417. void 0 !== t.name && (s.name = t.name),
  49418. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  49419. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  49420. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  49421. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  49422. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  49423. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  49424. void 0 !== t.visible && (s.visible = t.visible),
  49425. void 0 !== t.userData && (s.userData = t.userData),
  49426. void 0 !== t.children)
  49427. for (var h in t.children)
  49428. s.add(this.parseObject(t.children[h], i, r));
  49429. if ("LOD" === t.type)
  49430. for (var u = t.levels, d = 0; d < u.length; d++) {
  49431. var p = u[d]
  49432. , h = s.getObjectByProperty("uuid", p.object);
  49433. void 0 !== h && s.addLevel(h, p.distance)
  49434. }
  49435. return s
  49436. }
  49437. }()
  49438. },
  49439. n.TextureLoader = function(e) {
  49440. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49441. }
  49442. ,
  49443. n.TextureLoader.prototype = {
  49444. constructor: n.TextureLoader,
  49445. load: function(e, t, i, r) {
  49446. var o = new n.Texture
  49447. , a = new n.ImageLoader(this.manager);
  49448. return a.setCrossOrigin(this.crossOrigin),
  49449. a.setPath(this.path),
  49450. a.load(e, function(e) {
  49451. o.image = e,
  49452. o.needsUpdate = !0,
  49453. void 0 !== t && t(o)
  49454. }, i, r),
  49455. o
  49456. },
  49457. setCrossOrigin: function(e) {
  49458. this.crossOrigin = e
  49459. },
  49460. setPath: function(e) {
  49461. this.path = e
  49462. }
  49463. },
  49464. n.CubeTextureLoader = function(e) {
  49465. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49466. }
  49467. ,
  49468. n.CubeTextureLoader.prototype = {
  49469. constructor: n.CubeTextureLoader,
  49470. load: function(e, t, i, r) {
  49471. function o(i) {
  49472. s.load(e[i], function(e) {
  49473. a.images[i] = e,
  49474. l++,
  49475. 6 === l && (a.needsUpdate = !0,
  49476. t && t(a))
  49477. }, void 0, r)
  49478. }
  49479. var a = new n.CubeTexture
  49480. , s = new n.ImageLoader(this.manager);
  49481. s.setCrossOrigin(this.crossOrigin),
  49482. s.setPath(this.path);
  49483. for (var l = 0, c = 0; c < e.length; ++c)
  49484. o(c);
  49485. return a
  49486. },
  49487. setCrossOrigin: function(e) {
  49488. this.crossOrigin = e
  49489. },
  49490. setPath: function(e) {
  49491. this.path = e
  49492. }
  49493. },
  49494. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  49495. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49496. this._parser = null
  49497. }
  49498. ,
  49499. n.BinaryTextureLoader.prototype = {
  49500. constructor: n.BinaryTextureLoader,
  49501. load: function(e, t, i, r) {
  49502. var o = this
  49503. , a = new n.DataTexture
  49504. , s = new n.XHRLoader(this.manager);
  49505. return s.setResponseType("arraybuffer"),
  49506. s.load(e, function(e) {
  49507. var i = o._parser(e);
  49508. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  49509. a.image.height = i.height,
  49510. a.image.data = i.data),
  49511. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  49512. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  49513. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  49514. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  49515. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  49516. void 0 !== i.format && (a.format = i.format),
  49517. void 0 !== i.type && (a.type = i.type),
  49518. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  49519. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  49520. a.needsUpdate = !0,
  49521. t && t(a, i))
  49522. }, i, r),
  49523. a
  49524. }
  49525. },
  49526. n.CompressedTextureLoader = function(e) {
  49527. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49528. this._parser = null
  49529. }
  49530. ;
  49531. n.CompressedTextureLoader.prototype = {
  49532. constructor: n.CompressedTextureLoader,
  49533. load: function(e, t, i, r) {
  49534. function o(o) {
  49535. c.load(e[o], function(e) {
  49536. var i = a._parser(e, !0);
  49537. s[o] = {
  49538. width: i.width,
  49539. height: i.height,
  49540. format: i.format,
  49541. mipmaps: i.mipmaps
  49542. },
  49543. h += 1,
  49544. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49545. l.format = i.format,
  49546. l.needsUpdate = !0,
  49547. t && t(l))
  49548. }, i, r)
  49549. }
  49550. var a = this
  49551. , s = []
  49552. , l = new n.CompressedTexture;
  49553. l.image = s;
  49554. var c = new n.XHRLoader(this.manager);
  49555. if (c.setPath(this.path),
  49556. c.setResponseType("arraybuffer"),
  49557. Array.isArray(e))
  49558. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  49559. o(u);
  49560. else
  49561. c.load(e, function(e) {
  49562. var i = a._parser(e, !0);
  49563. if (i.isCubemap)
  49564. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  49565. s[o] = {
  49566. mipmaps: []
  49567. };
  49568. for (var c = 0; c < i.mipmapCount; c++)
  49569. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  49570. s[o].format = i.format,
  49571. s[o].width = i.width,
  49572. s[o].height = i.height
  49573. }
  49574. else
  49575. l.image.width = i.width,
  49576. l.image.height = i.height,
  49577. l.mipmaps = i.mipmaps;
  49578. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49579. l.format = i.format,
  49580. l.needsUpdate = !0,
  49581. t && t(l)
  49582. }, i, r);
  49583. return l
  49584. },
  49585. setPath: function(e) {
  49586. this.path = e
  49587. }
  49588. };
  49589. n.Material = function() {
  49590. Object.defineProperty(this, "id", {
  49591. value: n.MaterialIdCount++
  49592. }),
  49593. this.uuid = n.Math.generateUUID(),
  49594. this.name = "",
  49595. this.type = "Material",
  49596. this.side = n.FrontSide,
  49597. this.opacity = 1,
  49598. this.transparent = !1,
  49599. this.blending = n.NormalBlending,
  49600. this.blendSrc = n.SrcAlphaFactor,
  49601. this.blendDst = n.OneMinusSrcAlphaFactor,
  49602. this.blendEquation = n.AddEquation,
  49603. this.blendSrcAlpha = null,
  49604. this.blendDstAlpha = null,
  49605. this.blendEquationAlpha = null,
  49606. this.depthFunc = n.LessEqualDepth,
  49607. this.depthTest = !0,
  49608. this.depthWrite = !0,
  49609. this.colorWrite = !0,
  49610. this.precision = null,
  49611. this.polygonOffset = !1,
  49612. this.polygonOffsetFactor = 0,
  49613. this.polygonOffsetUnits = 0,
  49614. this.alphaTest = 0,
  49615. this.premultipliedAlpha = !1,
  49616. this.overdraw = 0,
  49617. this.visible = !0,
  49618. this._needsUpdate = !0
  49619. }
  49620. ,
  49621. n.Material.prototype = {
  49622. constructor: n.Material,
  49623. get needsUpdate() {
  49624. return this._needsUpdate
  49625. },
  49626. set needsUpdate(e) {
  49627. e === !0 && this.update(),
  49628. this._needsUpdate = e
  49629. },
  49630. setValues: function(e) {
  49631. if (void 0 !== e)
  49632. for (var t in e) {
  49633. var i = e[t];
  49634. if (void 0 !== i) {
  49635. var r = this[t];
  49636. 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.")
  49637. } else
  49638. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  49639. }
  49640. },
  49641. toJSON: function(e) {
  49642. function t(e) {
  49643. var t = [];
  49644. for (var i in e) {
  49645. var n = e[i];
  49646. delete n.metadata,
  49647. t.push(n)
  49648. }
  49649. return t
  49650. }
  49651. var i = void 0 === e;
  49652. i && (e = {
  49653. textures: {},
  49654. images: {}
  49655. });
  49656. var r = {
  49657. metadata: {
  49658. version: 4.4,
  49659. type: "Material",
  49660. generator: "Material.toJSON"
  49661. }
  49662. };
  49663. if (r.uuid = this.uuid,
  49664. r.type = this.type,
  49665. "" !== this.name && (r.name = this.name),
  49666. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49667. .5 !== this.roughness && (r.roughness = this.roughness),
  49668. .5 !== this.metalness && (r.metalness = this.metalness),
  49669. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49670. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49671. void 0 !== this.shininess && (r.shininess = this.shininess),
  49672. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49673. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49674. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49675. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49676. r.bumpScale = this.bumpScale),
  49677. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49678. r.normalScale = this.normalScale.toArray()),
  49679. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49680. r.displacementScale = this.displacementScale,
  49681. r.displacementBias = this.displacementBias),
  49682. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49683. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49684. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49685. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49686. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49687. r.reflectivity = this.reflectivity),
  49688. void 0 !== this.size && (r.size = this.size),
  49689. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49690. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49691. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49692. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49693. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49694. this.opacity < 1 && (r.opacity = this.opacity),
  49695. this.transparent === !0 && (r.transparent = this.transparent),
  49696. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49697. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49698. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49699. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49700. i) {
  49701. var o = t(e.textures)
  49702. , a = t(e.images);
  49703. o.length > 0 && (r.textures = o),
  49704. a.length > 0 && (r.images = a)
  49705. }
  49706. return r
  49707. },
  49708. clone: function() {
  49709. return (new this.constructor).copy(this)
  49710. },
  49711. copy: function(e) {
  49712. return this.name = e.name,
  49713. this.side = e.side,
  49714. this.opacity = e.opacity,
  49715. this.transparent = e.transparent,
  49716. this.blending = e.blending,
  49717. this.blendSrc = e.blendSrc,
  49718. this.blendDst = e.blendDst,
  49719. this.blendEquation = e.blendEquation,
  49720. this.blendSrcAlpha = e.blendSrcAlpha,
  49721. this.blendDstAlpha = e.blendDstAlpha,
  49722. this.blendEquationAlpha = e.blendEquationAlpha,
  49723. this.depthFunc = e.depthFunc,
  49724. this.depthTest = e.depthTest,
  49725. this.depthWrite = e.depthWrite,
  49726. this.colorWrite = e.colorWrite,
  49727. this.precision = e.precision,
  49728. this.polygonOffset = e.polygonOffset,
  49729. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49730. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49731. this.alphaTest = e.alphaTest,
  49732. this.premultipliedAlpha = e.premultipliedAlpha,
  49733. this.overdraw = e.overdraw,
  49734. this.visible = e.visible,
  49735. this
  49736. },
  49737. update: function() {
  49738. this.dispatchEvent({
  49739. type: "update"
  49740. })
  49741. },
  49742. dispose: function() {
  49743. this.dispatchEvent({
  49744. type: "dispose"
  49745. })
  49746. }
  49747. },
  49748. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49749. n.MaterialIdCount = 0,
  49750. n.LineBasicMaterial = function(e) {
  49751. n.Material.call(this),
  49752. this.type = "LineBasicMaterial",
  49753. this.color = new n.Color(16777215),
  49754. this.linewidth = 1,
  49755. this.linecap = "round",
  49756. this.linejoin = "round",
  49757. this.blending = n.NormalBlending,
  49758. this.vertexColors = n.NoColors,
  49759. this.fog = !0,
  49760. this.setValues(e)
  49761. }
  49762. ,
  49763. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49764. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49765. n.LineBasicMaterial.prototype.copy = function(e) {
  49766. return n.Material.prototype.copy.call(this, e),
  49767. this.color.copy(e.color),
  49768. this.linewidth = e.linewidth,
  49769. this.linecap = e.linecap,
  49770. this.linejoin = e.linejoin,
  49771. this.vertexColors = e.vertexColors,
  49772. this.fog = e.fog,
  49773. this
  49774. }
  49775. ,
  49776. n.LineDashedMaterial = function(e) {
  49777. n.Material.call(this),
  49778. this.type = "LineDashedMaterial",
  49779. this.color = new n.Color(16777215),
  49780. this.linewidth = 1,
  49781. this.scale = 1,
  49782. this.dashSize = 3,
  49783. this.gapSize = 1,
  49784. this.blending = n.NormalBlending,
  49785. this.vertexColors = n.NoColors,
  49786. this.fog = !0,
  49787. this.setValues(e)
  49788. }
  49789. ,
  49790. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49791. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49792. n.LineDashedMaterial.prototype.copy = function(e) {
  49793. return n.Material.prototype.copy.call(this, e),
  49794. this.color.copy(e.color),
  49795. this.linewidth = e.linewidth,
  49796. this.scale = e.scale,
  49797. this.dashSize = e.dashSize,
  49798. this.gapSize = e.gapSize,
  49799. this.vertexColors = e.vertexColors,
  49800. this.fog = e.fog,
  49801. this
  49802. }
  49803. ,
  49804. n.MeshBasicMaterial = function(e) {
  49805. n.Material.call(this),
  49806. this.type = "MeshBasicMaterial",
  49807. this.color = new n.Color(16777215),
  49808. this.map = null,
  49809. this.aoMap = null,
  49810. this.aoMapIntensity = 1,
  49811. this.specularMap = null,
  49812. this.alphaMap = null,
  49813. this.envMap = null,
  49814. this.combine = n.MultiplyOperation,
  49815. this.reflectivity = 1,
  49816. this.refractionRatio = .98,
  49817. this.fog = !0,
  49818. this.shading = n.SmoothShading,
  49819. this.blending = n.NormalBlending,
  49820. this.wireframe = !1,
  49821. this.wireframeLinewidth = 1,
  49822. this.wireframeLinecap = "round",
  49823. this.wireframeLinejoin = "round",
  49824. this.vertexColors = n.NoColors,
  49825. this.skinning = !1,
  49826. this.morphTargets = !1,
  49827. this.setValues(e)
  49828. }
  49829. ,
  49830. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49831. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49832. n.MeshBasicMaterial.prototype.copy = function(e) {
  49833. return n.Material.prototype.copy.call(this, e),
  49834. this.color.copy(e.color),
  49835. this.map = e.map,
  49836. this.aoMap = e.aoMap,
  49837. this.aoMapIntensity = e.aoMapIntensity,
  49838. this.specularMap = e.specularMap,
  49839. this.alphaMap = e.alphaMap,
  49840. this.envMap = e.envMap,
  49841. this.combine = e.combine,
  49842. this.reflectivity = e.reflectivity,
  49843. this.refractionRatio = e.refractionRatio,
  49844. this.fog = e.fog,
  49845. this.shading = e.shading,
  49846. this.wireframe = e.wireframe,
  49847. this.wireframeLinewidth = e.wireframeLinewidth,
  49848. this.wireframeLinecap = e.wireframeLinecap,
  49849. this.wireframeLinejoin = e.wireframeLinejoin,
  49850. this.vertexColors = e.vertexColors,
  49851. this.skinning = e.skinning,
  49852. this.morphTargets = e.morphTargets,
  49853. this
  49854. }
  49855. ,
  49856. n.MeshLambertMaterial = function(e) {
  49857. n.Material.call(this),
  49858. this.type = "MeshLambertMaterial",
  49859. this.color = new n.Color(16777215),
  49860. this.map = null,
  49861. this.lightMap = null,
  49862. this.lightMapIntensity = 1,
  49863. this.aoMap = null,
  49864. this.aoMapIntensity = 1,
  49865. this.emissive = new n.Color(0),
  49866. this.emissiveIntensity = 1,
  49867. this.emissiveMap = null,
  49868. this.specularMap = null,
  49869. this.alphaMap = null,
  49870. this.envMap = null,
  49871. this.combine = n.MultiplyOperation,
  49872. this.reflectivity = 1,
  49873. this.refractionRatio = .98,
  49874. this.fog = !0,
  49875. this.blending = n.NormalBlending,
  49876. this.wireframe = !1,
  49877. this.wireframeLinewidth = 1,
  49878. this.wireframeLinecap = "round",
  49879. this.wireframeLinejoin = "round",
  49880. this.vertexColors = n.NoColors,
  49881. this.skinning = !1,
  49882. this.morphTargets = !1,
  49883. this.morphNormals = !1,
  49884. this.setValues(e)
  49885. }
  49886. ,
  49887. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49888. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49889. n.MeshLambertMaterial.prototype.copy = function(e) {
  49890. return n.Material.prototype.copy.call(this, e),
  49891. this.color.copy(e.color),
  49892. this.map = e.map,
  49893. this.lightMap = e.lightMap,
  49894. this.lightMapIntensity = e.lightMapIntensity,
  49895. this.aoMap = e.aoMap,
  49896. this.aoMapIntensity = e.aoMapIntensity,
  49897. this.emissive.copy(e.emissive),
  49898. this.emissiveMap = e.emissiveMap,
  49899. this.emissiveIntensity = e.emissiveIntensity,
  49900. this.specularMap = e.specularMap,
  49901. this.alphaMap = e.alphaMap,
  49902. this.envMap = e.envMap,
  49903. this.combine = e.combine,
  49904. this.reflectivity = e.reflectivity,
  49905. this.refractionRatio = e.refractionRatio,
  49906. this.fog = e.fog,
  49907. this.wireframe = e.wireframe,
  49908. this.wireframeLinewidth = e.wireframeLinewidth,
  49909. this.wireframeLinecap = e.wireframeLinecap,
  49910. this.wireframeLinejoin = e.wireframeLinejoin,
  49911. this.vertexColors = e.vertexColors,
  49912. this.skinning = e.skinning,
  49913. this.morphTargets = e.morphTargets,
  49914. this.morphNormals = e.morphNormals,
  49915. this
  49916. }
  49917. ,
  49918. n.MeshPhongMaterial = function(e) {
  49919. n.Material.call(this),
  49920. this.type = "MeshPhongMaterial",
  49921. this.color = new n.Color(16777215),
  49922. this.specular = new n.Color(1118481),
  49923. this.shininess = 30,
  49924. this.map = null,
  49925. this.lightMap = null,
  49926. this.lightMapIntensity = 1,
  49927. this.aoMap = null,
  49928. this.aoMapIntensity = 1,
  49929. this.emissive = new n.Color(0),
  49930. this.emissiveIntensity = 1,
  49931. this.emissiveMap = null,
  49932. this.bumpMap = null,
  49933. this.bumpScale = 1,
  49934. this.normalMap = null,
  49935. this.normalScale = new n.Vector2(1,1),
  49936. this.displacementMap = null,
  49937. this.displacementScale = 1,
  49938. this.displacementBias = 0,
  49939. this.specularMap = null,
  49940. this.alphaMap = null,
  49941. this.envMap = null,
  49942. this.combine = n.MultiplyOperation,
  49943. this.reflectivity = 1,
  49944. this.refractionRatio = .98,
  49945. this.fog = !0,
  49946. this.shading = n.SmoothShading,
  49947. this.blending = n.NormalBlending,
  49948. this.wireframe = !1,
  49949. this.wireframeLinewidth = 1,
  49950. this.wireframeLinecap = "round",
  49951. this.wireframeLinejoin = "round",
  49952. this.vertexColors = n.NoColors,
  49953. this.skinning = !1,
  49954. this.morphTargets = !1,
  49955. this.morphNormals = !1,
  49956. this.setValues(e)
  49957. }
  49958. ,
  49959. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49960. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49961. n.MeshPhongMaterial.prototype.copy = function(e) {
  49962. return n.Material.prototype.copy.call(this, e),
  49963. this.color.copy(e.color),
  49964. this.specular.copy(e.specular),
  49965. this.shininess = e.shininess,
  49966. this.map = e.map,
  49967. this.lightMap = e.lightMap,
  49968. this.lightMapIntensity = e.lightMapIntensity,
  49969. this.aoMap = e.aoMap,
  49970. this.aoMapIntensity = e.aoMapIntensity,
  49971. this.emissive.copy(e.emissive),
  49972. this.emissiveMap = e.emissiveMap,
  49973. this.emissiveIntensity = e.emissiveIntensity,
  49974. this.bumpMap = e.bumpMap,
  49975. this.bumpScale = e.bumpScale,
  49976. this.normalMap = e.normalMap,
  49977. this.normalScale.copy(e.normalScale),
  49978. this.displacementMap = e.displacementMap,
  49979. this.displacementScale = e.displacementScale,
  49980. this.displacementBias = e.displacementBias,
  49981. this.specularMap = e.specularMap,
  49982. this.alphaMap = e.alphaMap,
  49983. this.envMap = e.envMap,
  49984. this.combine = e.combine,
  49985. this.reflectivity = e.reflectivity,
  49986. this.refractionRatio = e.refractionRatio,
  49987. this.fog = e.fog,
  49988. this.shading = e.shading,
  49989. this.wireframe = e.wireframe,
  49990. this.wireframeLinewidth = e.wireframeLinewidth,
  49991. this.wireframeLinecap = e.wireframeLinecap,
  49992. this.wireframeLinejoin = e.wireframeLinejoin,
  49993. this.vertexColors = e.vertexColors,
  49994. this.skinning = e.skinning,
  49995. this.morphTargets = e.morphTargets,
  49996. this.morphNormals = e.morphNormals,
  49997. this
  49998. }
  49999. ,
  50000. n.MeshStandardMaterial = function(e) {
  50001. n.Material.call(this),
  50002. this.type = "MeshStandardMaterial",
  50003. this.color = new n.Color(16777215),
  50004. this.roughness = .5,
  50005. this.metalness = .5,
  50006. this.map = null,
  50007. this.lightMap = null,
  50008. this.lightMapIntensity = 1,
  50009. this.aoMap = null,
  50010. this.aoMapIntensity = 1,
  50011. this.emissive = new n.Color(0),
  50012. this.emissiveIntensity = 1,
  50013. this.emissiveMap = null,
  50014. this.bumpMap = null,
  50015. this.bumpScale = 1,
  50016. this.normalMap = null,
  50017. this.normalScale = new n.Vector2(1,1),
  50018. this.displacementMap = null,
  50019. this.displacementScale = 1,
  50020. this.displacementBias = 0,
  50021. this.roughnessMap = null,
  50022. this.metalnessMap = null,
  50023. this.alphaMap = null,
  50024. this.envMap = null,
  50025. this.envMapIntensity = 1,
  50026. this.refractionRatio = .98,
  50027. this.fog = !0,
  50028. this.shading = n.SmoothShading,
  50029. this.blending = n.NormalBlending,
  50030. this.wireframe = !1,
  50031. this.wireframeLinewidth = 1,
  50032. this.wireframeLinecap = "round",
  50033. this.wireframeLinejoin = "round",
  50034. this.vertexColors = n.NoColors,
  50035. this.skinning = !1,
  50036. this.morphTargets = !1,
  50037. this.morphNormals = !1,
  50038. this.setValues(e)
  50039. }
  50040. ,
  50041. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  50042. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  50043. n.MeshStandardMaterial.prototype.copy = function(e) {
  50044. return n.Material.prototype.copy.call(this, e),
  50045. this.color.copy(e.color),
  50046. this.roughness = e.roughness,
  50047. this.metalness = e.metalness,
  50048. this.map = e.map,
  50049. this.lightMap = e.lightMap,
  50050. this.lightMapIntensity = e.lightMapIntensity,
  50051. this.aoMap = e.aoMap,
  50052. this.aoMapIntensity = e.aoMapIntensity,
  50053. this.emissive.copy(e.emissive),
  50054. this.emissiveMap = e.emissiveMap,
  50055. this.emissiveIntensity = e.emissiveIntensity,
  50056. this.bumpMap = e.bumpMap,
  50057. this.bumpScale = e.bumpScale,
  50058. this.normalMap = e.normalMap,
  50059. this.normalScale.copy(e.normalScale),
  50060. this.displacementMap = e.displacementMap,
  50061. this.displacementScale = e.displacementScale,
  50062. this.displacementBias = e.displacementBias,
  50063. this.roughnessMap = e.roughnessMap,
  50064. this.metalnessMap = e.metalnessMap,
  50065. this.alphaMap = e.alphaMap,
  50066. this.envMap = e.envMap,
  50067. this.envMapIntensity = e.envMapIntensity,
  50068. this.refractionRatio = e.refractionRatio,
  50069. this.fog = e.fog,
  50070. this.shading = e.shading,
  50071. this.wireframe = e.wireframe,
  50072. this.wireframeLinewidth = e.wireframeLinewidth,
  50073. this.wireframeLinecap = e.wireframeLinecap,
  50074. this.wireframeLinejoin = e.wireframeLinejoin,
  50075. this.vertexColors = e.vertexColors,
  50076. this.skinning = e.skinning,
  50077. this.morphTargets = e.morphTargets,
  50078. this.morphNormals = e.morphNormals,
  50079. this
  50080. }
  50081. ,
  50082. n.MeshDepthMaterial = function(e) {
  50083. n.Material.call(this),
  50084. this.type = "MeshDepthMaterial",
  50085. this.morphTargets = !1,
  50086. this.wireframe = !1,
  50087. this.wireframeLinewidth = 1,
  50088. this.setValues(e)
  50089. }
  50090. ,
  50091. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  50092. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  50093. n.MeshDepthMaterial.prototype.copy = function(e) {
  50094. return n.Material.prototype.copy.call(this, e),
  50095. this.wireframe = e.wireframe,
  50096. this.wireframeLinewidth = e.wireframeLinewidth,
  50097. this
  50098. }
  50099. ,
  50100. n.MeshNormalMaterial = function(e) {
  50101. n.Material.call(this, e),
  50102. this.type = "MeshNormalMaterial",
  50103. this.wireframe = !1,
  50104. this.wireframeLinewidth = 1,
  50105. this.morphTargets = !1,
  50106. this.setValues(e)
  50107. }
  50108. ,
  50109. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  50110. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  50111. n.MeshNormalMaterial.prototype.copy = function(e) {
  50112. return n.Material.prototype.copy.call(this, e),
  50113. this.wireframe = e.wireframe,
  50114. this.wireframeLinewidth = e.wireframeLinewidth,
  50115. this
  50116. }
  50117. ,
  50118. n.MultiMaterial = function(e) {
  50119. this.uuid = n.Math.generateUUID(),
  50120. this.type = "MultiMaterial",
  50121. this.materials = e instanceof Array ? e : [],
  50122. this.visible = !0
  50123. }
  50124. ,
  50125. n.MultiMaterial.prototype = {
  50126. constructor: n.MultiMaterial,
  50127. toJSON: function(e) {
  50128. for (var t = {
  50129. metadata: {
  50130. version: 4.2,
  50131. type: "material",
  50132. generator: "MaterialExporter"
  50133. },
  50134. uuid: this.uuid,
  50135. type: this.type,
  50136. materials: []
  50137. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  50138. var o = i[n].toJSON(e);
  50139. delete o.metadata,
  50140. t.materials.push(o)
  50141. }
  50142. return t.visible = this.visible,
  50143. t
  50144. },
  50145. clone: function() {
  50146. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  50147. e.materials.push(this.materials[t].clone());
  50148. return e.visible = this.visible,
  50149. e
  50150. }
  50151. },
  50152. n.PointsMaterial = function(e) {
  50153. n.Material.call(this),
  50154. this.type = "PointsMaterial",
  50155. this.color = new n.Color(16777215),
  50156. this.map = null,
  50157. this.size = 1,
  50158. this.sizeAttenuation = !0,
  50159. this.blending = n.NormalBlending,
  50160. this.vertexColors = n.NoColors,
  50161. this.fog = !0,
  50162. this.setValues(e)
  50163. }
  50164. ,
  50165. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  50166. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  50167. n.PointsMaterial.prototype.copy = function(e) {
  50168. return n.Material.prototype.copy.call(this, e),
  50169. this.color.copy(e.color),
  50170. this.map = e.map,
  50171. this.size = e.size,
  50172. this.sizeAttenuation = e.sizeAttenuation,
  50173. this.vertexColors = e.vertexColors,
  50174. this.fog = e.fog,
  50175. this
  50176. }
  50177. ,
  50178. n.ShaderMaterial = function(e) {
  50179. n.Material.call(this),
  50180. this.type = "ShaderMaterial",
  50181. this.defines = {},
  50182. this.uniforms = {},
  50183. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  50184. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  50185. this.shading = n.SmoothShading,
  50186. this.linewidth = 1,
  50187. this.wireframe = !1,
  50188. this.wireframeLinewidth = 1,
  50189. this.fog = !1,
  50190. this.lights = !1,
  50191. this.vertexColors = n.NoColors,
  50192. this.skinning = !1,
  50193. this.morphTargets = !1,
  50194. this.morphNormals = !1,
  50195. this.extensions = {
  50196. derivatives: !1,
  50197. fragDepth: !1,
  50198. drawBuffers: !1,
  50199. shaderTextureLOD: !1
  50200. },
  50201. this.defaultAttributeValues = {
  50202. color: [1, 1, 1],
  50203. uv: [0, 0],
  50204. uv2: [0, 0]
  50205. },
  50206. this.index0AttributeName = void 0,
  50207. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  50208. this.setValues(e))
  50209. }
  50210. ,
  50211. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  50212. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  50213. n.ShaderMaterial.prototype.copy = function(e) {
  50214. return n.Material.prototype.copy.call(this, e),
  50215. this.fragmentShader = e.fragmentShader,
  50216. this.vertexShader = e.vertexShader,
  50217. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  50218. this.defines = e.defines,
  50219. this.shading = e.shading,
  50220. this.wireframe = e.wireframe,
  50221. this.wireframeLinewidth = e.wireframeLinewidth,
  50222. this.fog = e.fog,
  50223. this.lights = e.lights,
  50224. this.vertexColors = e.vertexColors,
  50225. this.skinning = e.skinning,
  50226. this.morphTargets = e.morphTargets,
  50227. this.morphNormals = e.morphNormals,
  50228. this.extensions = e.extensions,
  50229. this
  50230. }
  50231. ,
  50232. n.ShaderMaterial.prototype.toJSON = function(e) {
  50233. var t = n.Material.prototype.toJSON.call(this, e);
  50234. return t.uniforms = this.uniforms,
  50235. t.vertexShader = this.vertexShader,
  50236. t.fragmentShader = this.fragmentShader,
  50237. t
  50238. }
  50239. ,
  50240. n.RawShaderMaterial = function(e) {
  50241. n.ShaderMaterial.call(this, e),
  50242. this.type = "RawShaderMaterial"
  50243. }
  50244. ,
  50245. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  50246. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  50247. n.SpriteMaterial = function(e) {
  50248. n.Material.call(this),
  50249. this.type = "SpriteMaterial",
  50250. this.color = new n.Color(16777215),
  50251. this.map = null,
  50252. this.rotation = 0,
  50253. this.fog = !1,
  50254. this.setValues(e)
  50255. }
  50256. ,
  50257. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  50258. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  50259. n.SpriteMaterial.prototype.copy = function(e) {
  50260. return n.Material.prototype.copy.call(this, e),
  50261. this.color.copy(e.color),
  50262. this.map = e.map,
  50263. this.rotation = e.rotation,
  50264. this.fog = e.fog,
  50265. this
  50266. }
  50267. ,
  50268. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  50269. Object.defineProperty(this, "id", {
  50270. value: n.TextureIdCount++
  50271. }),
  50272. this.uuid = n.Math.generateUUID(),
  50273. this.name = "",
  50274. this.sourceFile = "",
  50275. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  50276. this.mipmaps = [],
  50277. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  50278. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  50279. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  50280. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  50281. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  50282. this.anisotropy = void 0 !== c ? c : 1,
  50283. this.format = void 0 !== s ? s : n.RGBAFormat,
  50284. this.type = void 0 !== l ? l : n.UnsignedByteType,
  50285. this.offset = new n.Vector2(0,0),
  50286. this.repeat = new n.Vector2(1,1),
  50287. this.generateMipmaps = !0,
  50288. this.premultiplyAlpha = !1,
  50289. this.flipY = !0,
  50290. this.unpackAlignment = 4,
  50291. this.encoding = n.LinearEncoding,
  50292. this.version = 0,
  50293. this.onUpdate = null
  50294. }
  50295. ,
  50296. n.Texture.DEFAULT_IMAGE = void 0,
  50297. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  50298. n.Texture.prototype = {
  50299. constructor: n.Texture,
  50300. set needsUpdate(e) {
  50301. e === !0 && this.version++
  50302. },
  50303. clone: function() {
  50304. return (new this.constructor).copy(this)
  50305. },
  50306. copy: function(e) {
  50307. return this.image = e.image,
  50308. this.mipmaps = e.mipmaps.slice(0),
  50309. this.mapping = e.mapping,
  50310. this.wrapS = e.wrapS,
  50311. this.wrapT = e.wrapT,
  50312. this.magFilter = e.magFilter,
  50313. this.minFilter = e.minFilter,
  50314. this.anisotropy = e.anisotropy,
  50315. this.format = e.format,
  50316. this.type = e.type,
  50317. this.offset.copy(e.offset),
  50318. this.repeat.copy(e.repeat),
  50319. this.generateMipmaps = e.generateMipmaps,
  50320. this.premultiplyAlpha = e.premultiplyAlpha,
  50321. this.flipY = e.flipY,
  50322. this.unpackAlignment = e.unpackAlignment,
  50323. this.encoding = e.encoding,
  50324. this
  50325. },
  50326. toJSON: function(e) {
  50327. function t(e) {
  50328. var t;
  50329. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  50330. t.width = e.width,
  50331. t.height = e.height,
  50332. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  50333. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  50334. }
  50335. if (void 0 !== e.textures[this.uuid])
  50336. return e.textures[this.uuid];
  50337. var i = {
  50338. metadata: {
  50339. version: 4.4,
  50340. type: "Texture",
  50341. generator: "Texture.toJSON"
  50342. },
  50343. uuid: this.uuid,
  50344. name: this.name,
  50345. mapping: this.mapping,
  50346. repeat: [this.repeat.x, this.repeat.y],
  50347. offset: [this.offset.x, this.offset.y],
  50348. wrap: [this.wrapS, this.wrapT],
  50349. minFilter: this.minFilter,
  50350. magFilter: this.magFilter,
  50351. anisotropy: this.anisotropy
  50352. };
  50353. if (void 0 !== this.image) {
  50354. var r = this.image;
  50355. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  50356. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  50357. uuid: r.uuid,
  50358. url: t(r)
  50359. }),
  50360. i.image = r.uuid
  50361. }
  50362. return e.textures[this.uuid] = i,
  50363. i
  50364. },
  50365. dispose: function() {
  50366. this.dispatchEvent({
  50367. type: "dispose"
  50368. })
  50369. },
  50370. transformUv: function(e) {
  50371. if (this.mapping === n.UVMapping) {
  50372. if (e.multiply(this.repeat),
  50373. e.add(this.offset),
  50374. e.x < 0 || e.x > 1)
  50375. switch (this.wrapS) {
  50376. case n.RepeatWrapping:
  50377. e.x = e.x - Math.floor(e.x);
  50378. break;
  50379. case n.ClampToEdgeWrapping:
  50380. e.x = e.x < 0 ? 0 : 1;
  50381. break;
  50382. case n.MirroredRepeatWrapping:
  50383. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  50384. }
  50385. if (e.y < 0 || e.y > 1)
  50386. switch (this.wrapT) {
  50387. case n.RepeatWrapping:
  50388. e.y = e.y - Math.floor(e.y);
  50389. break;
  50390. case n.ClampToEdgeWrapping:
  50391. e.y = e.y < 0 ? 0 : 1;
  50392. break;
  50393. case n.MirroredRepeatWrapping:
  50394. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  50395. }
  50396. this.flipY && (e.y = 1 - e.y)
  50397. }
  50398. }
  50399. },
  50400. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  50401. n.TextureIdCount = 0,
  50402. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  50403. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50404. this.needsUpdate = !0
  50405. }
  50406. ,
  50407. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  50408. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  50409. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  50410. e = void 0 !== e ? e : [],
  50411. t = void 0 !== t ? t : n.CubeReflectionMapping,
  50412. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50413. this.flipY = !1
  50414. }
  50415. ,
  50416. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  50417. n.CubeTexture.prototype.constructor = n.CubeTexture,
  50418. Object.defineProperty(n.CubeTexture.prototype, "images", {
  50419. get: function() {
  50420. return this.image
  50421. },
  50422. set: function(e) {
  50423. this.image = e
  50424. }
  50425. }),
  50426. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50427. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50428. this.image = {
  50429. width: t,
  50430. height: i
  50431. },
  50432. this.mipmaps = e,
  50433. this.flipY = !1,
  50434. this.generateMipmaps = !1
  50435. }
  50436. ,
  50437. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  50438. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  50439. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50440. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50441. this.image = {
  50442. data: e,
  50443. width: t,
  50444. height: i
  50445. },
  50446. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  50447. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  50448. this.flipY = !1,
  50449. this.generateMipmaps = !1
  50450. }
  50451. ,
  50452. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  50453. n.DataTexture.prototype.constructor = n.DataTexture,
  50454. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  50455. function h() {
  50456. requestAnimationFrame(h),
  50457. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  50458. }
  50459. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50460. this.generateMipmaps = !1;
  50461. var u = this;
  50462. h()
  50463. }
  50464. ,
  50465. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  50466. n.VideoTexture.prototype.constructor = n.VideoTexture,
  50467. n.Group = function() {
  50468. n.Object3D.call(this),
  50469. this.type = "Group"
  50470. }
  50471. ,
  50472. n.Group.prototype = Object.create(n.Object3D.prototype),
  50473. n.Group.prototype.constructor = n.Group,
  50474. n.Points = function(e, t) {
  50475. n.Object3D.call(this),
  50476. this.type = "Points",
  50477. this.geometry = void 0 !== e ? e : new n.Geometry,
  50478. this.material = void 0 !== t ? t : new n.PointsMaterial({
  50479. color: 16777215 * Math.random()
  50480. })
  50481. }
  50482. ,
  50483. n.Points.prototype = Object.create(n.Object3D.prototype),
  50484. n.Points.prototype.constructor = n.Points,
  50485. n.Points.prototype.raycast = function() {
  50486. var e = new n.Matrix4
  50487. , t = new n.Ray
  50488. , i = new n.Sphere;
  50489. return function(r, o) {
  50490. function a(e, i) {
  50491. var n = t.distanceSqToPoint(e);
  50492. if (n < d) {
  50493. var a = t.closestPointToPoint(e);
  50494. a.applyMatrix4(c);
  50495. var l = r.ray.origin.distanceTo(a);
  50496. if (l < r.near || l > r.far)
  50497. return;
  50498. o.push({
  50499. distance: l,
  50500. distanceToRay: Math.sqrt(n),
  50501. point: a.clone(),
  50502. index: i,
  50503. face: null,
  50504. object: s
  50505. })
  50506. }
  50507. }
  50508. var s = this
  50509. , l = this.geometry
  50510. , c = this.matrixWorld
  50511. , h = r.params.Points.threshold;
  50512. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50513. i.copy(l.boundingSphere),
  50514. i.applyMatrix4(c),
  50515. r.ray.intersectsSphere(i) !== !1) {
  50516. e.getInverse(c),
  50517. t.copy(r.ray).applyMatrix4(e);
  50518. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  50519. , d = u * u
  50520. , p = new n.Vector3;
  50521. if (l instanceof n.BufferGeometry) {
  50522. var f = l.index
  50523. , g = l.attributes
  50524. , m = g.position.array;
  50525. if (null !== f)
  50526. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  50527. var C = v[A];
  50528. p.fromArray(m, 3 * C),
  50529. a(p, C)
  50530. }
  50531. else
  50532. for (var A = 0, I = m.length / 3; A < I; A++)
  50533. p.fromArray(m, 3 * A),
  50534. a(p, A)
  50535. } else
  50536. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  50537. a(E[A], A)
  50538. }
  50539. }
  50540. }(),
  50541. n.Points.prototype.clone = function() {
  50542. return new this.constructor(this.geometry,this.material).copy(this)
  50543. }
  50544. ,
  50545. n.Line = function(e, t, i) {
  50546. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  50547. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  50548. this.type = "Line",
  50549. this.geometry = void 0 !== e ? e : new n.Geometry,
  50550. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  50551. color: 16777215 * Math.random()
  50552. })))
  50553. }
  50554. ,
  50555. n.Line.prototype = Object.create(n.Object3D.prototype),
  50556. n.Line.prototype.constructor = n.Line,
  50557. n.Line.prototype.raycast = function() {
  50558. var e = new n.Matrix4
  50559. , t = new n.Ray
  50560. , i = new n.Sphere;
  50561. return function(r, o) {
  50562. var a = r.linePrecision
  50563. , s = a * a
  50564. , l = this.geometry
  50565. , c = this.matrixWorld;
  50566. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50567. i.copy(l.boundingSphere),
  50568. i.applyMatrix4(c),
  50569. r.ray.intersectsSphere(i) !== !1) {
  50570. e.getInverse(c),
  50571. t.copy(r.ray).applyMatrix4(e);
  50572. var h = new n.Vector3
  50573. , u = new n.Vector3
  50574. , d = new n.Vector3
  50575. , p = new n.Vector3
  50576. , f = this instanceof n.LineSegments ? 2 : 1;
  50577. if (l instanceof n.BufferGeometry) {
  50578. var g = l.index
  50579. , m = l.attributes
  50580. , v = m.position.array;
  50581. if (null !== g)
  50582. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  50583. var I = A[y]
  50584. , E = A[y + 1];
  50585. h.fromArray(v, 3 * I),
  50586. u.fromArray(v, 3 * E);
  50587. var b = t.distanceSqToSegment(h, u, p, d);
  50588. if (!(b > s)) {
  50589. p.applyMatrix4(this.matrixWorld);
  50590. var w = r.ray.origin.distanceTo(p);
  50591. w < r.near || w > r.far || o.push({
  50592. distance: w,
  50593. point: d.clone().applyMatrix4(this.matrixWorld),
  50594. index: y,
  50595. face: null,
  50596. faceIndex: null,
  50597. object: this
  50598. })
  50599. }
  50600. }
  50601. else
  50602. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  50603. h.fromArray(v, 3 * y),
  50604. u.fromArray(v, 3 * y + 3);
  50605. var b = t.distanceSqToSegment(h, u, p, d);
  50606. if (!(b > s)) {
  50607. p.applyMatrix4(this.matrixWorld);
  50608. var w = r.ray.origin.distanceTo(p);
  50609. w < r.near || w > r.far || o.push({
  50610. distance: w,
  50611. point: d.clone().applyMatrix4(this.matrixWorld),
  50612. index: y,
  50613. face: null,
  50614. faceIndex: null,
  50615. object: this
  50616. })
  50617. }
  50618. }
  50619. } else if (l instanceof n.Geometry)
  50620. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  50621. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  50622. if (!(b > s)) {
  50623. p.applyMatrix4(this.matrixWorld);
  50624. var w = r.ray.origin.distanceTo(p);
  50625. w < r.near || w > r.far || o.push({
  50626. distance: w,
  50627. point: d.clone().applyMatrix4(this.matrixWorld),
  50628. index: y,
  50629. face: null,
  50630. faceIndex: null,
  50631. object: this
  50632. })
  50633. }
  50634. }
  50635. }
  50636. }
  50637. }(),
  50638. n.Line.prototype.clone = function() {
  50639. return new this.constructor(this.geometry,this.material).copy(this)
  50640. }
  50641. ,
  50642. n.LineStrip = 0,
  50643. n.LinePieces = 1,
  50644. n.LineSegments = function(e, t) {
  50645. n.Line.call(this, e, t),
  50646. this.type = "LineSegments"
  50647. }
  50648. ,
  50649. n.LineSegments.prototype = Object.create(n.Line.prototype),
  50650. n.LineSegments.prototype.constructor = n.LineSegments,
  50651. n.Mesh = function(e, t) {
  50652. n.Object3D.call(this),
  50653. this.type = "Mesh",
  50654. this.geometry = void 0 !== e ? e : new n.Geometry,
  50655. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  50656. color: 16777215 * Math.random()
  50657. }),
  50658. this.drawMode = n.TrianglesDrawMode,
  50659. this.updateMorphTargets()
  50660. }
  50661. ,
  50662. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50663. n.Mesh.prototype.constructor = n.Mesh,
  50664. n.Mesh.prototype.setDrawMode = function(e) {
  50665. this.drawMode = e
  50666. }
  50667. ,
  50668. n.Mesh.prototype.updateMorphTargets = function() {
  50669. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50670. this.morphTargetBase = -1,
  50671. this.morphTargetInfluences = [],
  50672. this.morphTargetDictionary = {};
  50673. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50674. this.morphTargetInfluences.push(0),
  50675. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50676. }
  50677. }
  50678. ,
  50679. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50680. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50681. 0)
  50682. }
  50683. ,
  50684. n.Mesh.prototype.raycast = function() {
  50685. function e(e, t, i, r, o, a, s) {
  50686. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50687. o.multiplyScalar(m.x),
  50688. a.multiplyScalar(m.y),
  50689. s.multiplyScalar(m.z),
  50690. o.add(a).add(s),
  50691. o.clone()
  50692. }
  50693. function t(e, t, i, r, o, a, s) {
  50694. var l, c = e.material;
  50695. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50696. null === l)
  50697. return null;
  50698. A.copy(s),
  50699. A.applyMatrix4(e.matrixWorld);
  50700. var h = t.ray.origin.distanceTo(A);
  50701. return h < t.near || h > t.far ? null : {
  50702. distance: h,
  50703. point: A.clone(),
  50704. object: e
  50705. }
  50706. }
  50707. function i(i, r, o, a, h, u, d, m) {
  50708. s.fromArray(a, 3 * u),
  50709. l.fromArray(a, 3 * d),
  50710. c.fromArray(a, 3 * m);
  50711. var A = t(i, r, o, s, l, c, v);
  50712. return A && (h && (p.fromArray(h, 2 * u),
  50713. f.fromArray(h, 2 * d),
  50714. g.fromArray(h, 2 * m),
  50715. A.uv = e(v, s, l, c, p, f, g)),
  50716. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50717. A.faceIndex = u),
  50718. A
  50719. }
  50720. var r = new n.Matrix4
  50721. , o = new n.Ray
  50722. , a = new n.Sphere
  50723. , s = new n.Vector3
  50724. , l = new n.Vector3
  50725. , c = new n.Vector3
  50726. , h = new n.Vector3
  50727. , u = new n.Vector3
  50728. , d = new n.Vector3
  50729. , p = new n.Vector2
  50730. , f = new n.Vector2
  50731. , g = new n.Vector2
  50732. , m = new n.Vector3
  50733. , v = new n.Vector3
  50734. , A = new n.Vector3;
  50735. return function(m, A) {
  50736. var y = this.geometry
  50737. , C = this.material
  50738. , I = this.matrixWorld;
  50739. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50740. a.copy(y.boundingSphere),
  50741. a.applyMatrix4(I),
  50742. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50743. o.copy(m.ray).applyMatrix4(r),
  50744. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50745. var E, b;
  50746. if (y instanceof n.BufferGeometry) {
  50747. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50748. if (void 0 !== S.uv && (E = S.uv.array),
  50749. null !== x)
  50750. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50751. w = R[P],
  50752. _ = R[P + 1],
  50753. T = R[P + 2],
  50754. b = i(this, m, o, M, E, w, _, T),
  50755. b && (b.faceIndex = Math.floor(P / 3),
  50756. A.push(b));
  50757. else
  50758. for (var P = 0, O = M.length; P < O; P += 9)
  50759. w = P / 3,
  50760. _ = w + 1,
  50761. T = w + 2,
  50762. b = i(this, m, o, M, E, w, _, T),
  50763. b && (b.index = w,
  50764. A.push(b))
  50765. } else if (y instanceof n.Geometry) {
  50766. 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];
  50767. k.length > 0 && (E = k);
  50768. for (var H = 0, G = U.length; H < G; H++) {
  50769. var z = U[H]
  50770. , W = B === !0 ? F[z.materialIndex] : C;
  50771. if (void 0 !== W) {
  50772. if (L = V[z.a],
  50773. D = V[z.b],
  50774. N = V[z.c],
  50775. W.morphTargets === !0) {
  50776. var j = y.morphTargets
  50777. , Y = this.morphTargetInfluences;
  50778. s.set(0, 0, 0),
  50779. l.set(0, 0, 0),
  50780. c.set(0, 0, 0);
  50781. for (var X = 0, Z = j.length; X < Z; X++) {
  50782. var q = Y[X];
  50783. if (0 !== q) {
  50784. var K = j[X].vertices;
  50785. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50786. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50787. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50788. }
  50789. }
  50790. s.add(L),
  50791. l.add(D),
  50792. c.add(N),
  50793. L = s,
  50794. D = l,
  50795. N = c
  50796. }
  50797. if (b = t(this, m, o, L, D, N, v)) {
  50798. if (E) {
  50799. var Q = E[H];
  50800. p.copy(Q[0]),
  50801. f.copy(Q[1]),
  50802. g.copy(Q[2]),
  50803. b.uv = e(v, L, D, N, p, f, g)
  50804. }
  50805. b.face = z,
  50806. b.faceIndex = H,
  50807. A.push(b)
  50808. }
  50809. }
  50810. }
  50811. }
  50812. }
  50813. }
  50814. }(),
  50815. n.Mesh.prototype.clone = function() {
  50816. return new this.constructor(this.geometry,this.material).copy(this)
  50817. }
  50818. ,
  50819. n.Bone = function(e) {
  50820. n.Object3D.call(this),
  50821. this.type = "Bone",
  50822. this.skin = e
  50823. }
  50824. ,
  50825. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50826. n.Bone.prototype.constructor = n.Bone,
  50827. n.Bone.prototype.copy = function(e) {
  50828. return n.Object3D.prototype.copy.call(this, e),
  50829. this.skin = e.skin,
  50830. this
  50831. }
  50832. ,
  50833. n.Skeleton = function(e, t, i) {
  50834. if (this.useVertexTexture = void 0 === i || i,
  50835. this.identityMatrix = new n.Matrix4,
  50836. e = e || [],
  50837. this.bones = e.slice(0),
  50838. this.useVertexTexture) {
  50839. var r = Math.sqrt(4 * this.bones.length);
  50840. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50841. r = Math.max(r, 4),
  50842. this.boneTextureWidth = r,
  50843. this.boneTextureHeight = r,
  50844. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50845. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50846. } else
  50847. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50848. if (void 0 === t)
  50849. this.calculateInverses();
  50850. else if (this.bones.length === t.length)
  50851. this.boneInverses = t.slice(0);
  50852. else {
  50853. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50854. this.boneInverses = [];
  50855. for (var o = 0, a = this.bones.length; o < a; o++)
  50856. this.boneInverses.push(new n.Matrix4)
  50857. }
  50858. }
  50859. ,
  50860. n.Skeleton.prototype.calculateInverses = function() {
  50861. this.boneInverses = [];
  50862. for (var e = 0, t = this.bones.length; e < t; e++) {
  50863. var i = new n.Matrix4;
  50864. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50865. this.boneInverses.push(i)
  50866. }
  50867. }
  50868. ,
  50869. n.Skeleton.prototype.pose = function() {
  50870. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50871. e = this.bones[t],
  50872. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50873. for (var t = 0, i = this.bones.length; t < i; t++)
  50874. e = this.bones[t],
  50875. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50876. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50877. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50878. }
  50879. ,
  50880. n.Skeleton.prototype.update = function() {
  50881. var e = new n.Matrix4;
  50882. return function() {
  50883. for (var t = 0, i = this.bones.length; t < i; t++) {
  50884. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50885. e.multiplyMatrices(n, this.boneInverses[t]),
  50886. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50887. }
  50888. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50889. }
  50890. }(),
  50891. n.Skeleton.prototype.clone = function() {
  50892. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50893. }
  50894. ,
  50895. n.SkinnedMesh = function(e, t, i) {
  50896. n.Mesh.call(this, e, t),
  50897. this.type = "SkinnedMesh",
  50898. this.bindMode = "attached",
  50899. this.bindMatrix = new n.Matrix4,
  50900. this.bindMatrixInverse = new n.Matrix4;
  50901. var r = [];
  50902. if (this.geometry && void 0 !== this.geometry.bones) {
  50903. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50904. a = this.geometry.bones[s],
  50905. o = new n.Bone(this),
  50906. r.push(o),
  50907. o.name = a.name,
  50908. o.position.fromArray(a.pos),
  50909. o.quaternion.fromArray(a.rotq),
  50910. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50911. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50912. a = this.geometry.bones[s],
  50913. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50914. }
  50915. this.normalizeSkinWeights(),
  50916. this.updateMatrixWorld(!0),
  50917. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50918. }
  50919. ,
  50920. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50921. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50922. n.SkinnedMesh.prototype.bind = function(e, t) {
  50923. this.skeleton = e,
  50924. void 0 === t && (this.updateMatrixWorld(!0),
  50925. this.skeleton.calculateInverses(),
  50926. t = this.matrixWorld),
  50927. this.bindMatrix.copy(t),
  50928. this.bindMatrixInverse.getInverse(t)
  50929. }
  50930. ,
  50931. n.SkinnedMesh.prototype.pose = function() {
  50932. this.skeleton.pose()
  50933. }
  50934. ,
  50935. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50936. if (this.geometry instanceof n.Geometry)
  50937. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50938. var t = this.geometry.skinWeights[e]
  50939. , i = 1 / t.lengthManhattan();
  50940. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50941. }
  50942. else if (this.geometry instanceof n.BufferGeometry)
  50943. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50944. r.x = o.getX(e),
  50945. r.y = o.getY(e),
  50946. r.z = o.getZ(e),
  50947. r.w = o.getW(e);
  50948. var i = 1 / r.lengthManhattan();
  50949. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50950. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50951. }
  50952. }
  50953. ,
  50954. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50955. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50956. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50957. }
  50958. ,
  50959. n.SkinnedMesh.prototype.clone = function() {
  50960. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50961. }
  50962. ,
  50963. n.LOD = function() {
  50964. n.Object3D.call(this),
  50965. this.type = "LOD",
  50966. Object.defineProperties(this, {
  50967. levels: {
  50968. enumerable: !0,
  50969. value: []
  50970. },
  50971. objects: {
  50972. get: function() {
  50973. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50974. this.levels
  50975. }
  50976. }
  50977. })
  50978. }
  50979. ,
  50980. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50981. n.LOD.prototype.constructor = n.LOD,
  50982. n.LOD.prototype.addLevel = function(e, t) {
  50983. void 0 === t && (t = 0),
  50984. t = Math.abs(t);
  50985. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50986. ;
  50987. i.splice(n, 0, {
  50988. distance: t,
  50989. object: e
  50990. }),
  50991. this.add(e)
  50992. }
  50993. ,
  50994. n.LOD.prototype.getObjectForDistance = function(e) {
  50995. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50996. ;
  50997. return t[i - 1].object
  50998. }
  50999. ,
  51000. n.LOD.prototype.raycast = function() {
  51001. var e = new n.Vector3;
  51002. return function(t, i) {
  51003. e.setFromMatrixPosition(this.matrixWorld);
  51004. var n = t.ray.origin.distanceTo(e);
  51005. this.getObjectForDistance(n).raycast(t, i)
  51006. }
  51007. }(),
  51008. n.LOD.prototype.update = function() {
  51009. var e = new n.Vector3
  51010. , t = new n.Vector3;
  51011. return function(i) {
  51012. var n = this.levels;
  51013. if (n.length > 1) {
  51014. e.setFromMatrixPosition(i.matrixWorld),
  51015. t.setFromMatrixPosition(this.matrixWorld);
  51016. var r = e.distanceTo(t);
  51017. n[0].object.visible = !0;
  51018. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  51019. n[o - 1].object.visible = !1,
  51020. n[o].object.visible = !0;
  51021. for (; o < a; o++)
  51022. n[o].object.visible = !1
  51023. }
  51024. }
  51025. }(),
  51026. n.LOD.prototype.copy = function(e) {
  51027. n.Object3D.prototype.copy.call(this, e, !1);
  51028. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  51029. var o = t[i];
  51030. this.addLevel(o.object.clone(), o.distance)
  51031. }
  51032. return this
  51033. }
  51034. ,
  51035. n.LOD.prototype.toJSON = function(e) {
  51036. var t = n.Object3D.prototype.toJSON.call(this, e);
  51037. t.object.levels = [];
  51038. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  51039. var a = i[r];
  51040. t.object.levels.push({
  51041. object: a.object.uuid,
  51042. distance: a.distance
  51043. })
  51044. }
  51045. return t
  51046. }
  51047. ,
  51048. n.Sprite = function() {
  51049. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  51050. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  51051. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  51052. , r = new n.BufferGeometry;
  51053. return r.setIndex(new n.BufferAttribute(e,1)),
  51054. r.addAttribute("position", new n.BufferAttribute(t,3)),
  51055. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  51056. function(e) {
  51057. n.Object3D.call(this),
  51058. this.type = "Sprite",
  51059. this.geometry = r,
  51060. this.material = void 0 !== e ? e : new n.SpriteMaterial
  51061. }
  51062. }(),
  51063. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  51064. n.Sprite.prototype.constructor = n.Sprite,
  51065. n.Sprite.prototype.raycast = function() {
  51066. var e = new n.Vector3;
  51067. return function(t, i) {
  51068. e.setFromMatrixPosition(this.matrixWorld);
  51069. var n = t.ray.distanceSqToPoint(e)
  51070. , r = this.scale.x * this.scale.y;
  51071. n > r || i.push({
  51072. distance: Math.sqrt(n),
  51073. point: this.position,
  51074. face: null,
  51075. object: this
  51076. })
  51077. }
  51078. }(),
  51079. n.Sprite.prototype.clone = function() {
  51080. return new this.constructor(this.material).copy(this)
  51081. }
  51082. ,
  51083. n.Particle = n.Sprite,
  51084. n.LensFlare = function(e, t, i, r, o) {
  51085. n.Object3D.call(this),
  51086. this.lensFlares = [],
  51087. this.positionScreen = new n.Vector3,
  51088. this.customUpdateCallback = void 0,
  51089. void 0 !== e && this.add(e, t, i, r, o)
  51090. }
  51091. ,
  51092. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  51093. n.LensFlare.prototype.constructor = n.LensFlare,
  51094. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  51095. void 0 === t && (t = -1),
  51096. void 0 === i && (i = 0),
  51097. void 0 === a && (a = 1),
  51098. void 0 === o && (o = new n.Color(16777215)),
  51099. void 0 === r && (r = n.NormalBlending),
  51100. i = Math.min(i, Math.max(0, i)),
  51101. this.lensFlares.push({
  51102. texture: e,
  51103. size: t,
  51104. distance: i,
  51105. x: 0,
  51106. y: 0,
  51107. z: 0,
  51108. scale: 1,
  51109. rotation: 0,
  51110. opacity: a,
  51111. color: o,
  51112. blending: r
  51113. })
  51114. }
  51115. ,
  51116. n.LensFlare.prototype.updateLensFlares = function() {
  51117. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  51118. for (e = 0; e < i; e++)
  51119. t = this.lensFlares[e],
  51120. t.x = this.positionScreen.x + n * t.distance,
  51121. t.y = this.positionScreen.y + r * t.distance,
  51122. t.wantedRotation = t.x * Math.PI * .25,
  51123. t.rotation += .25 * (t.wantedRotation - t.rotation)
  51124. }
  51125. ,
  51126. n.LensFlare.prototype.copy = function(e) {
  51127. n.Object3D.prototype.copy.call(this, e),
  51128. this.positionScreen.copy(e.positionScreen),
  51129. this.customUpdateCallback = e.customUpdateCallback;
  51130. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  51131. this.lensFlares.push(e.lensFlares[t]);
  51132. return this
  51133. }
  51134. ,
  51135. n.Scene = function() {
  51136. n.Object3D.call(this),
  51137. this.type = "Scene",
  51138. this.fog = null,
  51139. this.overrideMaterial = null,
  51140. this.autoUpdate = !0
  51141. }
  51142. ,
  51143. n.Scene.prototype = Object.create(n.Object3D.prototype),
  51144. n.Scene.prototype.constructor = n.Scene,
  51145. n.Scene.prototype.copy = function(e, t) {
  51146. return n.Object3D.prototype.copy.call(this, e, t),
  51147. null !== e.fog && (this.fog = e.fog.clone()),
  51148. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  51149. this.autoUpdate = e.autoUpdate,
  51150. this.matrixAutoUpdate = e.matrixAutoUpdate,
  51151. this
  51152. }
  51153. ,
  51154. n.Fog = function(e, t, i) {
  51155. this.name = "",
  51156. this.color = new n.Color(e),
  51157. this.near = void 0 !== t ? t : 1,
  51158. this.far = void 0 !== i ? i : 1e3
  51159. }
  51160. ,
  51161. n.Fog.prototype.clone = function() {
  51162. return new n.Fog(this.color.getHex(),this.near,this.far)
  51163. }
  51164. ,
  51165. n.FogExp2 = function(e, t) {
  51166. this.name = "",
  51167. this.color = new n.Color(e),
  51168. this.density = void 0 !== t ? t : 25e-5
  51169. }
  51170. ,
  51171. n.FogExp2.prototype.clone = function() {
  51172. return new n.FogExp2(this.color.getHex(),this.density)
  51173. }
  51174. ,
  51175. n.ShaderChunk = {},
  51176. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  51177. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  51178. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  51179. 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",
  51180. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  51181. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  51182. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  51183. 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",
  51184. 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",
  51185. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  51186. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  51187. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  51188. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  51189. 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",
  51190. 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",
  51191. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  51192. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  51193. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  51194. 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",
  51195. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  51196. 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",
  51197. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  51198. 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",
  51199. 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",
  51200. 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",
  51201. 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",
  51202. 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",
  51203. 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",
  51204. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  51205. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  51206. 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",
  51207. 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",
  51208. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  51209. 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",
  51210. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  51211. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  51212. 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",
  51213. 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",
  51214. 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",
  51215. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  51216. 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",
  51217. 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",
  51218. 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",
  51219. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  51220. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  51221. 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",
  51222. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  51223. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  51224. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  51225. 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",
  51226. 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";
  51227. 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";
  51228. 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",
  51229. 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",
  51230. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  51231. 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",
  51232. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  51233. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  51234. 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",
  51235. 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",
  51236. 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",
  51237. 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",
  51238. 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",
  51239. 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",
  51240. 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",
  51241. 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",
  51242. 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",
  51243. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  51244. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  51245. 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",
  51246. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  51247. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  51248. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  51249. 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",
  51250. 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",
  51251. 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",
  51252. 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",
  51253. n.UniformsUtils = {
  51254. merge: function(e) {
  51255. for (var t = {}, i = 0; i < e.length; i++) {
  51256. var n = this.clone(e[i]);
  51257. for (var r in n)
  51258. t[r] = n[r]
  51259. }
  51260. return t
  51261. },
  51262. clone: function(e) {
  51263. var t = {};
  51264. for (var i in e) {
  51265. t[i] = {};
  51266. for (var r in e[i]) {
  51267. var o = e[i][r];
  51268. 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
  51269. }
  51270. }
  51271. return t
  51272. }
  51273. },
  51274. n.UniformsLib = {
  51275. common: {
  51276. diffuse: {
  51277. type: "c",
  51278. value: new n.Color(15658734)
  51279. },
  51280. opacity: {
  51281. type: "f",
  51282. value: 1
  51283. },
  51284. map: {
  51285. type: "t",
  51286. value: null
  51287. },
  51288. offsetRepeat: {
  51289. type: "v4",
  51290. value: new n.Vector4(0,0,1,1)
  51291. },
  51292. specularMap: {
  51293. type: "t",
  51294. value: null
  51295. },
  51296. alphaMap: {
  51297. type: "t",
  51298. value: null
  51299. },
  51300. envMap: {
  51301. type: "t",
  51302. value: null
  51303. },
  51304. flipEnvMap: {
  51305. type: "f",
  51306. value: -1
  51307. },
  51308. reflectivity: {
  51309. type: "f",
  51310. value: 1
  51311. },
  51312. refractionRatio: {
  51313. type: "f",
  51314. value: .98
  51315. }
  51316. },
  51317. aomap: {
  51318. aoMap: {
  51319. type: "t",
  51320. value: null
  51321. },
  51322. aoMapIntensity: {
  51323. type: "f",
  51324. value: 1
  51325. }
  51326. },
  51327. lightmap: {
  51328. lightMap: {
  51329. type: "t",
  51330. value: null
  51331. },
  51332. lightMapIntensity: {
  51333. type: "f",
  51334. value: 1
  51335. }
  51336. },
  51337. emissivemap: {
  51338. emissiveMap: {
  51339. type: "t",
  51340. value: null
  51341. }
  51342. },
  51343. bumpmap: {
  51344. bumpMap: {
  51345. type: "t",
  51346. value: null
  51347. },
  51348. bumpScale: {
  51349. type: "f",
  51350. value: 1
  51351. }
  51352. },
  51353. normalmap: {
  51354. normalMap: {
  51355. type: "t",
  51356. value: null
  51357. },
  51358. normalScale: {
  51359. type: "v2",
  51360. value: new n.Vector2(1,1)
  51361. }
  51362. },
  51363. displacementmap: {
  51364. displacementMap: {
  51365. type: "t",
  51366. value: null
  51367. },
  51368. displacementScale: {
  51369. type: "f",
  51370. value: 1
  51371. },
  51372. displacementBias: {
  51373. type: "f",
  51374. value: 0
  51375. }
  51376. },
  51377. roughnessmap: {
  51378. roughnessMap: {
  51379. type: "t",
  51380. value: null
  51381. }
  51382. },
  51383. metalnessmap: {
  51384. metalnessMap: {
  51385. type: "t",
  51386. value: null
  51387. }
  51388. },
  51389. fog: {
  51390. fogDensity: {
  51391. type: "f",
  51392. value: 25e-5
  51393. },
  51394. fogNear: {
  51395. type: "f",
  51396. value: 1
  51397. },
  51398. fogFar: {
  51399. type: "f",
  51400. value: 2e3
  51401. },
  51402. fogColor: {
  51403. type: "c",
  51404. value: new n.Color(16777215)
  51405. }
  51406. },
  51407. lights: {
  51408. ambientLightColor: {
  51409. type: "fv",
  51410. value: []
  51411. },
  51412. directionalLights: {
  51413. type: "sa",
  51414. value: [],
  51415. properties: {
  51416. direction: {
  51417. type: "v3"
  51418. },
  51419. color: {
  51420. type: "c"
  51421. },
  51422. shadow: {
  51423. type: "i"
  51424. },
  51425. shadowBias: {
  51426. type: "f"
  51427. },
  51428. shadowRadius: {
  51429. type: "f"
  51430. },
  51431. shadowMapSize: {
  51432. type: "v2"
  51433. }
  51434. }
  51435. },
  51436. directionalShadowMap: {
  51437. type: "tv",
  51438. value: []
  51439. },
  51440. directionalShadowMatrix: {
  51441. type: "m4v",
  51442. value: []
  51443. },
  51444. spotLights: {
  51445. type: "sa",
  51446. value: [],
  51447. properties: {
  51448. color: {
  51449. type: "c"
  51450. },
  51451. position: {
  51452. type: "v3"
  51453. },
  51454. direction: {
  51455. type: "v3"
  51456. },
  51457. distance: {
  51458. type: "f"
  51459. },
  51460. coneCos: {
  51461. type: "f"
  51462. },
  51463. penumbraCos: {
  51464. type: "f"
  51465. },
  51466. decay: {
  51467. type: "f"
  51468. },
  51469. shadow: {
  51470. type: "i"
  51471. },
  51472. shadowBias: {
  51473. type: "f"
  51474. },
  51475. shadowRadius: {
  51476. type: "f"
  51477. },
  51478. shadowMapSize: {
  51479. type: "v2"
  51480. }
  51481. }
  51482. },
  51483. spotShadowMap: {
  51484. type: "tv",
  51485. value: []
  51486. },
  51487. spotShadowMatrix: {
  51488. type: "m4v",
  51489. value: []
  51490. },
  51491. pointLights: {
  51492. type: "sa",
  51493. value: [],
  51494. properties: {
  51495. color: {
  51496. type: "c"
  51497. },
  51498. position: {
  51499. type: "v3"
  51500. },
  51501. decay: {
  51502. type: "f"
  51503. },
  51504. distance: {
  51505. type: "f"
  51506. },
  51507. shadow: {
  51508. type: "i"
  51509. },
  51510. shadowBias: {
  51511. type: "f"
  51512. },
  51513. shadowRadius: {
  51514. type: "f"
  51515. },
  51516. shadowMapSize: {
  51517. type: "v2"
  51518. }
  51519. }
  51520. },
  51521. pointShadowMap: {
  51522. type: "tv",
  51523. value: []
  51524. },
  51525. pointShadowMatrix: {
  51526. type: "m4v",
  51527. value: []
  51528. },
  51529. hemisphereLights: {
  51530. type: "sa",
  51531. value: [],
  51532. properties: {
  51533. direction: {
  51534. type: "v3"
  51535. },
  51536. skyColor: {
  51537. type: "c"
  51538. },
  51539. groundColor: {
  51540. type: "c"
  51541. }
  51542. }
  51543. }
  51544. },
  51545. points: {
  51546. diffuse: {
  51547. type: "c",
  51548. value: new n.Color(15658734)
  51549. },
  51550. opacity: {
  51551. type: "f",
  51552. value: 1
  51553. },
  51554. size: {
  51555. type: "f",
  51556. value: 1
  51557. },
  51558. scale: {
  51559. type: "f",
  51560. value: 1
  51561. },
  51562. map: {
  51563. type: "t",
  51564. value: null
  51565. },
  51566. offsetRepeat: {
  51567. type: "v4",
  51568. value: new n.Vector4(0,0,1,1)
  51569. }
  51570. }
  51571. },
  51572. 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",
  51573. 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",
  51574. 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",
  51575. 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",
  51576. 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",
  51577. 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",
  51578. 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",
  51579. 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",
  51580. 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",
  51581. 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",
  51582. 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",
  51583. 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",
  51584. 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",
  51585. 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",
  51586. 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",
  51587. 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",
  51588. 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",
  51589. 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",
  51590. 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",
  51591. 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",
  51592. 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",
  51593. 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",
  51594. 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",
  51595. 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",
  51596. n.ShaderLib = {
  51597. basic: {
  51598. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  51599. vertexShader: n.ShaderChunk.meshbasic_vert,
  51600. fragmentShader: n.ShaderChunk.meshbasic_frag
  51601. },
  51602. lambert: {
  51603. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  51604. emissive: {
  51605. type: "c",
  51606. value: new n.Color(0)
  51607. }
  51608. }]),
  51609. vertexShader: n.ShaderChunk.meshlambert_vert,
  51610. fragmentShader: n.ShaderChunk.meshlambert_frag
  51611. },
  51612. phong: {
  51613. 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, {
  51614. emissive: {
  51615. type: "c",
  51616. value: new n.Color(0)
  51617. },
  51618. specular: {
  51619. type: "c",
  51620. value: new n.Color(1118481)
  51621. },
  51622. shininess: {
  51623. type: "f",
  51624. value: 30
  51625. }
  51626. }]),
  51627. vertexShader: n.ShaderChunk.meshphong_vert,
  51628. fragmentShader: n.ShaderChunk.meshphong_frag
  51629. },
  51630. standard: {
  51631. 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, {
  51632. emissive: {
  51633. type: "c",
  51634. value: new n.Color(0)
  51635. },
  51636. roughness: {
  51637. type: "f",
  51638. value: .5
  51639. },
  51640. metalness: {
  51641. type: "f",
  51642. value: 0
  51643. },
  51644. envMapIntensity: {
  51645. type: "f",
  51646. value: 1
  51647. }
  51648. }]),
  51649. vertexShader: n.ShaderChunk.meshstandard_vert,
  51650. fragmentShader: n.ShaderChunk.meshstandard_frag
  51651. },
  51652. points: {
  51653. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  51654. vertexShader: n.ShaderChunk.points_vert,
  51655. fragmentShader: n.ShaderChunk.points_frag
  51656. },
  51657. dashed: {
  51658. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  51659. scale: {
  51660. type: "f",
  51661. value: 1
  51662. },
  51663. dashSize: {
  51664. type: "f",
  51665. value: 1
  51666. },
  51667. totalSize: {
  51668. type: "f",
  51669. value: 2
  51670. }
  51671. }]),
  51672. vertexShader: n.ShaderChunk.linedashed_vert,
  51673. fragmentShader: n.ShaderChunk.linedashed_frag
  51674. },
  51675. depth: {
  51676. uniforms: {
  51677. mNear: {
  51678. type: "f",
  51679. value: 1
  51680. },
  51681. mFar: {
  51682. type: "f",
  51683. value: 2e3
  51684. },
  51685. opacity: {
  51686. type: "f",
  51687. value: 1
  51688. }
  51689. },
  51690. vertexShader: n.ShaderChunk.depth_vert,
  51691. fragmentShader: n.ShaderChunk.depth_frag
  51692. },
  51693. normal: {
  51694. uniforms: {
  51695. opacity: {
  51696. type: "f",
  51697. value: 1
  51698. }
  51699. },
  51700. vertexShader: n.ShaderChunk.normal_vert,
  51701. fragmentShader: n.ShaderChunk.normal_frag
  51702. },
  51703. cube: {
  51704. uniforms: {
  51705. tCube: {
  51706. type: "t",
  51707. value: null
  51708. },
  51709. tFlip: {
  51710. type: "f",
  51711. value: -1
  51712. }
  51713. },
  51714. vertexShader: n.ShaderChunk.cube_vert,
  51715. fragmentShader: n.ShaderChunk.cube_frag
  51716. },
  51717. equirect: {
  51718. uniforms: {
  51719. tEquirect: {
  51720. type: "t",
  51721. value: null
  51722. },
  51723. tFlip: {
  51724. type: "f",
  51725. value: -1
  51726. }
  51727. },
  51728. vertexShader: n.ShaderChunk.equirect_vert,
  51729. fragmentShader: n.ShaderChunk.equirect_frag
  51730. },
  51731. depthRGBA: {
  51732. uniforms: {},
  51733. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51734. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51735. },
  51736. distanceRGBA: {
  51737. uniforms: {
  51738. lightPos: {
  51739. type: "v3",
  51740. value: new n.Vector3(0,0,0)
  51741. }
  51742. },
  51743. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51744. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51745. }
  51746. },
  51747. n.WebGLRenderer = function(e) {
  51748. function t() {
  51749. return null === ye ? Oe : 1
  51750. }
  51751. function i(e, t, i, n) {
  51752. se === !0 && (e *= n,
  51753. t *= n,
  51754. i *= n),
  51755. Ye.clearColor(e, t, i, n)
  51756. }
  51757. function r() {
  51758. Ye.init(),
  51759. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51760. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51761. i(Se.r, Se.g, Se.b, Me)
  51762. }
  51763. function o() {
  51764. Ae = null,
  51765. be = null,
  51766. Ee = "",
  51767. Ie = -1,
  51768. Ye.reset()
  51769. }
  51770. function a(e) {
  51771. e.preventDefault(),
  51772. o(),
  51773. r(),
  51774. Xe.clear()
  51775. }
  51776. function s(e) {
  51777. var t = e.target;
  51778. t.removeEventListener("dispose", s),
  51779. h(t),
  51780. ke.textures--
  51781. }
  51782. function l(e) {
  51783. var t = e.target;
  51784. t.removeEventListener("dispose", l),
  51785. u(t),
  51786. ke.textures--
  51787. }
  51788. function c(e) {
  51789. var t = e.target;
  51790. t.removeEventListener("dispose", c),
  51791. d(t)
  51792. }
  51793. function h(e) {
  51794. var t = Xe.get(e);
  51795. if (e.image && t.__image__webglTextureCube)
  51796. Ge.deleteTexture(t.__image__webglTextureCube);
  51797. else {
  51798. if (void 0 === t.__webglInit)
  51799. return;
  51800. Ge.deleteTexture(t.__webglTexture)
  51801. }
  51802. Xe.delete(e)
  51803. }
  51804. function u(e) {
  51805. var t = Xe.get(e)
  51806. , i = Xe.get(e.texture);
  51807. if (e && void 0 !== i.__webglTexture) {
  51808. if (Ge.deleteTexture(i.__webglTexture),
  51809. e instanceof n.WebGLRenderTargetCube)
  51810. for (var r = 0; r < 6; r++)
  51811. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51812. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51813. else
  51814. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51815. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51816. Xe.delete(e.texture),
  51817. Xe.delete(e)
  51818. }
  51819. }
  51820. function d(e) {
  51821. p(e),
  51822. Xe.delete(e)
  51823. }
  51824. function p(e) {
  51825. var t = Xe.get(e).program;
  51826. e.program = void 0,
  51827. void 0 !== t && qe.releaseProgram(t)
  51828. }
  51829. function f(e, t, i, r) {
  51830. var o;
  51831. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51832. null === o))
  51833. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51834. void 0 === r && (r = 0),
  51835. Ye.initAttributes();
  51836. var a = i.attributes
  51837. , s = t.getAttributes()
  51838. , l = e.defaultAttributeValues;
  51839. for (var c in s) {
  51840. var h = s[c];
  51841. if (h >= 0) {
  51842. var u = a[c];
  51843. if (void 0 !== u) {
  51844. var d = u.itemSize
  51845. , p = Ze.getAttributeBuffer(u);
  51846. if (u instanceof n.InterleavedBufferAttribute) {
  51847. var f = u.data
  51848. , g = f.stride
  51849. , m = u.offset;
  51850. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51851. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51852. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51853. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51854. } else
  51855. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51856. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51857. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51858. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51859. } else if (void 0 !== l) {
  51860. var v = l[c];
  51861. if (void 0 !== v)
  51862. switch (v.length) {
  51863. case 2:
  51864. Ge.vertexAttrib2fv(h, v);
  51865. break;
  51866. case 3:
  51867. Ge.vertexAttrib3fv(h, v);
  51868. break;
  51869. case 4:
  51870. Ge.vertexAttrib4fv(h, v);
  51871. break;
  51872. default:
  51873. Ge.vertexAttrib1fv(h, v)
  51874. }
  51875. }
  51876. }
  51877. }
  51878. Ye.disableUnusedAttributes()
  51879. }
  51880. function g(e, t) {
  51881. return Math.abs(t[0]) - Math.abs(e[0])
  51882. }
  51883. function m(e, t) {
  51884. 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
  51885. }
  51886. function v(e, t) {
  51887. 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
  51888. }
  51889. function A(e, t, i, n, r) {
  51890. var o, a;
  51891. i.transparent ? (o = de,
  51892. a = ++pe) : (o = he,
  51893. a = ++ue);
  51894. var s = o[a];
  51895. void 0 !== s ? (s.id = e.id,
  51896. s.object = e,
  51897. s.geometry = t,
  51898. s.material = i,
  51899. s.z = Ve.z,
  51900. s.group = r) : (s = {
  51901. id: e.id,
  51902. object: e,
  51903. geometry: t,
  51904. material: i,
  51905. z: Ve.z,
  51906. group: r
  51907. },
  51908. o.push(s))
  51909. }
  51910. function y(e, t) {
  51911. if (e.visible !== !1) {
  51912. if (e.layers.test(t.layers))
  51913. if (e instanceof n.Light)
  51914. ce.push(e);
  51915. else if (e instanceof n.Sprite)
  51916. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51917. else if (e instanceof n.LensFlare)
  51918. me.push(e);
  51919. else if (e instanceof n.ImmediateRenderObject)
  51920. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51921. Ve.applyProjection(Fe)),
  51922. A(e, null, e.material, Ve.z, null);
  51923. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51924. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51925. var i = e.material;
  51926. if (i.visible === !0) {
  51927. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51928. Ve.applyProjection(Fe));
  51929. var r = Ze.update(e);
  51930. if (i instanceof n.MultiMaterial)
  51931. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51932. var c = o[s]
  51933. , h = a[c.materialIndex];
  51934. h.visible === !0 && A(e, r, h, Ve.z, c)
  51935. }
  51936. else
  51937. A(e, r, i, Ve.z, null)
  51938. }
  51939. }
  51940. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51941. y(u[s], t)
  51942. }
  51943. }
  51944. function C(e, t, i, r) {
  51945. for (var o = 0, a = e.length; o < a; o++) {
  51946. var s = e[o]
  51947. , l = s.object
  51948. , c = s.geometry
  51949. , h = void 0 === r ? s.material : r
  51950. , u = s.group;
  51951. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51952. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51953. l instanceof n.ImmediateRenderObject) {
  51954. E(h);
  51955. var d = w(t, i, h, l);
  51956. Ee = "",
  51957. l.render(function(e) {
  51958. ve.renderBufferImmediate(e, d, h)
  51959. })
  51960. } else
  51961. ve.renderBufferDirect(t, i, c, h, l, u)
  51962. }
  51963. }
  51964. function I(e, t, i) {
  51965. var r = Xe.get(e)
  51966. , o = qe.getParameters(e, Ue, t, i)
  51967. , a = qe.getProgramCode(e, o)
  51968. , s = r.program
  51969. , l = !0;
  51970. if (void 0 === s)
  51971. e.addEventListener("dispose", c);
  51972. else if (s.code !== a)
  51973. p(e);
  51974. else {
  51975. if (void 0 !== o.shaderID)
  51976. return;
  51977. l = !1
  51978. }
  51979. if (l) {
  51980. if (o.shaderID) {
  51981. var h = n.ShaderLib[o.shaderID];
  51982. r.__webglShader = {
  51983. name: e.type,
  51984. uniforms: n.UniformsUtils.clone(h.uniforms),
  51985. vertexShader: h.vertexShader,
  51986. fragmentShader: h.fragmentShader
  51987. }
  51988. } else
  51989. r.__webglShader = {
  51990. name: e.type,
  51991. uniforms: e.uniforms,
  51992. vertexShader: e.vertexShader,
  51993. fragmentShader: e.fragmentShader
  51994. };
  51995. e.__webglShader = r.__webglShader,
  51996. s = qe.acquireProgram(e, o, a),
  51997. r.program = s,
  51998. e.program = s
  51999. }
  52000. var u = s.getAttributes();
  52001. if (e.morphTargets) {
  52002. e.numSupportedMorphTargets = 0;
  52003. for (var d = 0; d < ve.maxMorphTargets; d++)
  52004. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  52005. }
  52006. if (e.morphNormals) {
  52007. e.numSupportedMorphNormals = 0;
  52008. for (var d = 0; d < ve.maxMorphNormals; d++)
  52009. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  52010. }
  52011. r.uniformsList = [];
  52012. var f = r.__webglShader.uniforms
  52013. , g = r.program.getUniforms();
  52014. for (var m in f) {
  52015. var v = g[m];
  52016. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  52017. }
  52018. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  52019. f.ambientLightColor.value = Ue.ambient,
  52020. f.directionalLights.value = Ue.directional,
  52021. f.spotLights.value = Ue.spot,
  52022. f.pointLights.value = Ue.point,
  52023. f.hemisphereLights.value = Ue.hemi,
  52024. f.directionalShadowMap.value = Ue.directionalShadowMap,
  52025. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  52026. f.spotShadowMap.value = Ue.spotShadowMap,
  52027. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  52028. f.pointShadowMap.value = Ue.pointShadowMap,
  52029. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  52030. r.hasDynamicUniforms = !1;
  52031. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  52032. var C = r.uniformsList[A][0];
  52033. if (C.dynamic === !0) {
  52034. r.hasDynamicUniforms = !0;
  52035. break
  52036. }
  52037. }
  52038. }
  52039. function E(e) {
  52040. b(e),
  52041. 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),
  52042. Ye.setDepthFunc(e.depthFunc),
  52043. Ye.setDepthTest(e.depthTest),
  52044. Ye.setDepthWrite(e.depthWrite),
  52045. Ye.setColorWrite(e.colorWrite),
  52046. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  52047. }
  52048. function b(e) {
  52049. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  52050. Ye.setFlipSided(e.side === n.BackSide)
  52051. }
  52052. function w(e, t, i, r) {
  52053. xe = 0;
  52054. var o = Xe.get(i);
  52055. void 0 === o.program && (i.needsUpdate = !0),
  52056. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  52057. i.needsUpdate && (I(i, t, r),
  52058. i.needsUpdate = !1);
  52059. var a = !1
  52060. , s = !1
  52061. , l = !1
  52062. , c = o.program
  52063. , h = c.getUniforms()
  52064. , u = o.__webglShader.uniforms;
  52065. if (c.id !== Ae && (Ge.useProgram(c.program),
  52066. Ae = c.id,
  52067. a = !0,
  52068. s = !0,
  52069. l = !0),
  52070. i.id !== Ie && (Ie = i.id,
  52071. s = !0),
  52072. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  52073. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  52074. e !== be && (be = e,
  52075. s = !0,
  52076. l = !0),
  52077. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  52078. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  52079. (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),
  52080. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  52081. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  52082. i.skinning)
  52083. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  52084. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  52085. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  52086. if (void 0 !== h.boneTexture) {
  52087. var d = B();
  52088. Ge.uniform1i(h.boneTexture, d),
  52089. ve.setTexture(r.skeleton.boneTexture, d)
  52090. }
  52091. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  52092. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  52093. } else
  52094. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  52095. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  52096. t && i.fog && R(u, t),
  52097. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  52098. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  52099. 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,
  52100. u.mFar.value = e.far,
  52101. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  52102. V(o.uniformsList)),
  52103. N(h, r),
  52104. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  52105. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  52106. c
  52107. }
  52108. function _(e, t, i) {
  52109. for (var n = [], r = 0, o = e.length; r < o; r++) {
  52110. var a = e[r][0]
  52111. , s = a.onUpdateCallback;
  52112. void 0 !== s && (s.bind(a)(t, i),
  52113. n.push(e[r]))
  52114. }
  52115. V(n)
  52116. }
  52117. function T(e, t) {
  52118. e.opacity.value = t.opacity,
  52119. e.diffuse.value = t.color,
  52120. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  52121. e.map.value = t.map,
  52122. e.specularMap.value = t.specularMap,
  52123. e.alphaMap.value = t.alphaMap,
  52124. t.aoMap && (e.aoMap.value = t.aoMap,
  52125. e.aoMapIntensity.value = t.aoMapIntensity);
  52126. var i;
  52127. 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),
  52128. void 0 !== i) {
  52129. i instanceof n.WebGLRenderTarget && (i = i.texture);
  52130. var r = i.offset
  52131. , o = i.repeat;
  52132. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  52133. }
  52134. e.envMap.value = t.envMap,
  52135. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  52136. e.reflectivity.value = t.reflectivity,
  52137. e.refractionRatio.value = t.refractionRatio
  52138. }
  52139. function x(e, t) {
  52140. e.diffuse.value = t.color,
  52141. e.opacity.value = t.opacity
  52142. }
  52143. function S(e, t) {
  52144. e.dashSize.value = t.dashSize,
  52145. e.totalSize.value = t.dashSize + t.gapSize,
  52146. e.scale.value = t.scale
  52147. }
  52148. function M(e, t) {
  52149. if (e.diffuse.value = t.color,
  52150. e.opacity.value = t.opacity,
  52151. e.size.value = t.size * Oe,
  52152. e.scale.value = te.clientHeight / 2,
  52153. e.map.value = t.map,
  52154. null !== t.map) {
  52155. var i = t.map.offset
  52156. , n = t.map.repeat;
  52157. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  52158. }
  52159. }
  52160. function R(e, t) {
  52161. e.fogColor.value = t.color,
  52162. t instanceof n.Fog ? (e.fogNear.value = t.near,
  52163. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  52164. }
  52165. function P(e, t) {
  52166. t.lightMap && (e.lightMap.value = t.lightMap,
  52167. e.lightMapIntensity.value = t.lightMapIntensity),
  52168. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  52169. }
  52170. function O(e, t) {
  52171. e.specular.value = t.specular,
  52172. e.shininess.value = Math.max(t.shininess, 1e-4),
  52173. t.lightMap && (e.lightMap.value = t.lightMap,
  52174. e.lightMapIntensity.value = t.lightMapIntensity),
  52175. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  52176. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  52177. e.bumpScale.value = t.bumpScale),
  52178. t.normalMap && (e.normalMap.value = t.normalMap,
  52179. e.normalScale.value.copy(t.normalScale)),
  52180. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  52181. e.displacementScale.value = t.displacementScale,
  52182. e.displacementBias.value = t.displacementBias)
  52183. }
  52184. function L(e, t) {
  52185. e.roughness.value = t.roughness,
  52186. e.metalness.value = t.metalness,
  52187. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  52188. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  52189. t.lightMap && (e.lightMap.value = t.lightMap,
  52190. e.lightMapIntensity.value = t.lightMapIntensity),
  52191. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  52192. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  52193. e.bumpScale.value = t.bumpScale),
  52194. t.normalMap && (e.normalMap.value = t.normalMap,
  52195. e.normalScale.value.copy(t.normalScale)),
  52196. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  52197. e.displacementScale.value = t.displacementScale,
  52198. e.displacementBias.value = t.displacementBias),
  52199. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  52200. }
  52201. function D(e, t) {
  52202. e.ambientLightColor.needsUpdate = t,
  52203. e.directionalLights.needsUpdate = t,
  52204. e.pointLights.needsUpdate = t,
  52205. e.spotLights.needsUpdate = t,
  52206. e.hemisphereLights.needsUpdate = t
  52207. }
  52208. function N(e, t) {
  52209. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  52210. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  52211. }
  52212. function B() {
  52213. var e = xe;
  52214. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  52215. xe += 1,
  52216. e
  52217. }
  52218. function F(e, t, i, r) {
  52219. var o, a;
  52220. if ("1i" === t)
  52221. Ge.uniform1i(i, r);
  52222. else if ("1f" === t)
  52223. Ge.uniform1f(i, r);
  52224. else if ("2f" === t)
  52225. Ge.uniform2f(i, r[0], r[1]);
  52226. else if ("3f" === t)
  52227. Ge.uniform3f(i, r[0], r[1], r[2]);
  52228. else if ("4f" === t)
  52229. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  52230. else if ("1iv" === t)
  52231. Ge.uniform1iv(i, r);
  52232. else if ("3iv" === t)
  52233. Ge.uniform3iv(i, r);
  52234. else if ("1fv" === t)
  52235. Ge.uniform1fv(i, r);
  52236. else if ("2fv" === t)
  52237. Ge.uniform2fv(i, r);
  52238. else if ("3fv" === t)
  52239. Ge.uniform3fv(i, r);
  52240. else if ("4fv" === t)
  52241. Ge.uniform4fv(i, r);
  52242. else if ("Matrix2fv" === t)
  52243. Ge.uniformMatrix2fv(i, !1, r);
  52244. else if ("Matrix3fv" === t)
  52245. Ge.uniformMatrix3fv(i, !1, r);
  52246. else if ("Matrix4fv" === t)
  52247. Ge.uniformMatrix4fv(i, !1, r);
  52248. else if ("i" === t)
  52249. Ge.uniform1i(i, r);
  52250. else if ("f" === t)
  52251. Ge.uniform1f(i, r);
  52252. else if ("v2" === t)
  52253. Ge.uniform2f(i, r.x, r.y);
  52254. else if ("v3" === t)
  52255. Ge.uniform3f(i, r.x, r.y, r.z);
  52256. else if ("v4" === t)
  52257. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  52258. else if ("c" === t)
  52259. Ge.uniform3f(i, r.r, r.g, r.b);
  52260. else if ("s" === t) {
  52261. var s = e.properties;
  52262. for (var l in s) {
  52263. var c = s[l]
  52264. , h = i[l]
  52265. , u = r[l];
  52266. F(c, c.type, h, u)
  52267. }
  52268. } else if ("sa" === t)
  52269. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  52270. for (var l in s) {
  52271. var c = s[l]
  52272. , h = i[d][l]
  52273. , u = r[d][l];
  52274. F(c, c.type, h, u)
  52275. }
  52276. else if ("iv1" === t)
  52277. Ge.uniform1iv(i, r);
  52278. else if ("iv" === t)
  52279. Ge.uniform3iv(i, r);
  52280. else if ("fv1" === t)
  52281. Ge.uniform1fv(i, r);
  52282. else if ("fv" === t)
  52283. Ge.uniform3fv(i, r);
  52284. else if ("v2v" === t) {
  52285. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  52286. for (var d = 0, f = 0, g = r.length; d < g; d++,
  52287. f += 2)
  52288. e._array[f + 0] = r[d].x,
  52289. e._array[f + 1] = r[d].y;
  52290. Ge.uniform2fv(i, e._array)
  52291. } else if ("v3v" === t) {
  52292. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  52293. for (var d = 0, m = 0, g = r.length; d < g; d++,
  52294. m += 3)
  52295. e._array[m + 0] = r[d].x,
  52296. e._array[m + 1] = r[d].y,
  52297. e._array[m + 2] = r[d].z;
  52298. Ge.uniform3fv(i, e._array)
  52299. } else if ("v4v" === t) {
  52300. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  52301. for (var d = 0, v = 0, g = r.length; d < g; d++,
  52302. v += 4)
  52303. e._array[v + 0] = r[d].x,
  52304. e._array[v + 1] = r[d].y,
  52305. e._array[v + 2] = r[d].z,
  52306. e._array[v + 3] = r[d].w;
  52307. Ge.uniform4fv(i, e._array)
  52308. } else if ("m2" === t)
  52309. Ge.uniformMatrix2fv(i, !1, r.elements);
  52310. else if ("m3" === t)
  52311. Ge.uniformMatrix3fv(i, !1, r.elements);
  52312. else if ("m3v" === t) {
  52313. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  52314. for (var d = 0, g = r.length; d < g; d++)
  52315. r[d].flattenToArrayOffset(e._array, 9 * d);
  52316. Ge.uniformMatrix3fv(i, !1, e._array)
  52317. } else if ("m4" === t)
  52318. Ge.uniformMatrix4fv(i, !1, r.elements);
  52319. else if ("m4v" === t) {
  52320. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  52321. for (var d = 0, g = r.length; d < g; d++)
  52322. r[d].flattenToArrayOffset(e._array, 16 * d);
  52323. Ge.uniformMatrix4fv(i, !1, e._array)
  52324. } else if ("t" === t) {
  52325. if (o = r,
  52326. a = B(),
  52327. Ge.uniform1i(i, a),
  52328. !o)
  52329. return;
  52330. 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)
  52331. } else if ("tv" === t) {
  52332. void 0 === e._array && (e._array = []);
  52333. for (var d = 0, g = e.value.length; d < g; d++)
  52334. e._array[d] = B();
  52335. Ge.uniform1iv(i, e._array);
  52336. for (var d = 0, g = e.value.length; d < g; d++)
  52337. o = e.value[d],
  52338. a = e._array[d],
  52339. 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))
  52340. } else
  52341. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  52342. }
  52343. function V(e) {
  52344. for (var t = 0, i = e.length; t < i; t++) {
  52345. var n = e[t][0];
  52346. if (n.needsUpdate !== !1) {
  52347. var r = n.type
  52348. , o = e[t][1]
  52349. , a = n.value;
  52350. F(n, r, o, a)
  52351. }
  52352. }
  52353. }
  52354. function U(e, t) {
  52355. 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;
  52356. for (Ue.shadowsPointLight = 0,
  52357. i = 0,
  52358. r = e.length; i < r; i++)
  52359. if (o = e[i],
  52360. a = o.color,
  52361. s = o.intensity,
  52362. l = o.distance,
  52363. o instanceof n.AmbientLight)
  52364. c += a.r * s,
  52365. h += a.g * s,
  52366. u += a.b * s;
  52367. else if (o instanceof n.DirectionalLight) {
  52368. var A = Ke.get(o);
  52369. A.color.copy(o.color).multiplyScalar(o.intensity),
  52370. A.direction.setFromMatrixPosition(o.matrixWorld),
  52371. Ve.setFromMatrixPosition(o.target.matrixWorld),
  52372. A.direction.sub(Ve),
  52373. A.direction.transformDirection(d),
  52374. A.shadow = o.castShadow,
  52375. o.castShadow && (A.shadowBias = o.shadow.bias,
  52376. A.shadowRadius = o.shadow.radius,
  52377. A.shadowMapSize = o.shadow.mapSize,
  52378. Ue.shadows[v++] = o),
  52379. Ue.directionalShadowMap[p] = o.shadow.map,
  52380. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  52381. Ue.directional[p++] = A
  52382. } else if (o instanceof n.SpotLight) {
  52383. var A = Ke.get(o);
  52384. A.position.setFromMatrixPosition(o.matrixWorld),
  52385. A.position.applyMatrix4(d),
  52386. A.color.copy(a).multiplyScalar(s),
  52387. A.distance = l,
  52388. A.direction.setFromMatrixPosition(o.matrixWorld),
  52389. Ve.setFromMatrixPosition(o.target.matrixWorld),
  52390. A.direction.sub(Ve),
  52391. A.direction.transformDirection(d),
  52392. A.coneCos = Math.cos(o.angle),
  52393. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  52394. A.decay = 0 === o.distance ? 0 : o.decay,
  52395. A.shadow = o.castShadow,
  52396. o.castShadow && (A.shadowBias = o.shadow.bias,
  52397. A.shadowRadius = o.shadow.radius,
  52398. A.shadowMapSize = o.shadow.mapSize,
  52399. Ue.shadows[v++] = o),
  52400. Ue.spotShadowMap[g] = o.shadow.map,
  52401. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  52402. Ue.spot[g++] = A
  52403. } else if (o instanceof n.PointLight) {
  52404. var A = Ke.get(o);
  52405. A.position.setFromMatrixPosition(o.matrixWorld),
  52406. A.position.applyMatrix4(d),
  52407. A.color.copy(o.color).multiplyScalar(o.intensity),
  52408. A.distance = o.distance,
  52409. A.decay = 0 === o.distance ? 0 : o.decay,
  52410. A.shadow = o.castShadow,
  52411. o.castShadow && (A.shadowBias = o.shadow.bias,
  52412. A.shadowRadius = o.shadow.radius,
  52413. A.shadowMapSize = o.shadow.mapSize,
  52414. Ue.shadows[v++] = o),
  52415. Ue.pointShadowMap[f] = o.shadow.map,
  52416. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  52417. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  52418. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  52419. Ue.point[f++] = A
  52420. } else if (o instanceof n.HemisphereLight) {
  52421. var A = Ke.get(o);
  52422. A.direction.setFromMatrixPosition(o.matrixWorld),
  52423. A.direction.transformDirection(d),
  52424. A.direction.normalize(),
  52425. A.skyColor.copy(o.color).multiplyScalar(s),
  52426. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  52427. Ue.hemi[m++] = A
  52428. }
  52429. Ue.ambient[0] = c,
  52430. Ue.ambient[1] = h,
  52431. Ue.ambient[2] = u,
  52432. Ue.directional.length = p,
  52433. Ue.spot.length = g,
  52434. Ue.point.length = f,
  52435. Ue.hemi.length = m,
  52436. Ue.shadows.length = v,
  52437. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  52438. }
  52439. function k(e, t, i) {
  52440. var r;
  52441. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  52442. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  52443. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  52444. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  52445. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  52446. 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),
  52447. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  52448. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  52449. 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)),
  52450. r = We.get("EXT_texture_filter_anisotropic")) {
  52451. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  52452. return;
  52453. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  52454. return;
  52455. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  52456. Xe.get(t).__currentAnisotropy = t.anisotropy)
  52457. }
  52458. }
  52459. function H(e, t, i) {
  52460. void 0 === e.__webglInit && (e.__webglInit = !0,
  52461. t.addEventListener("dispose", s),
  52462. e.__webglTexture = Ge.createTexture(),
  52463. ke.textures++),
  52464. Ye.activeTexture(Ge.TEXTURE0 + i),
  52465. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  52466. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  52467. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  52468. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  52469. var r = G(t.image, je.maxTextureSize);
  52470. W(t) && z(r) === !1 && (r = j(r));
  52471. var o = z(r)
  52472. , a = ee(t.format)
  52473. , l = ee(t.type);
  52474. k(Ge.TEXTURE_2D, t, o);
  52475. var c, h = t.mipmaps;
  52476. if (t instanceof n.DataTexture)
  52477. if (h.length > 0 && o) {
  52478. for (var u = 0, d = h.length; u < d; u++)
  52479. c = h[u],
  52480. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  52481. t.generateMipmaps = !1
  52482. } else
  52483. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  52484. else if (t instanceof n.CompressedTexture)
  52485. for (var u = 0, d = h.length; u < d; u++)
  52486. c = h[u],
  52487. 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);
  52488. else if (h.length > 0 && o) {
  52489. for (var u = 0, d = h.length; u < d; u++)
  52490. c = h[u],
  52491. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  52492. t.generateMipmaps = !1
  52493. } else
  52494. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  52495. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52496. e.__version = t.version,
  52497. t.onUpdate && t.onUpdate(t)
  52498. }
  52499. function G(e, t) {
  52500. if (e.width > t || e.height > t) {
  52501. var i = t / Math.max(e.width, e.height)
  52502. , n = document.createElement("canvas");
  52503. n.width = Math.floor(e.width * i),
  52504. n.height = Math.floor(e.height * i);
  52505. var r = n.getContext("2d");
  52506. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  52507. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  52508. n
  52509. }
  52510. return e
  52511. }
  52512. function z(e) {
  52513. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  52514. }
  52515. function W(e) {
  52516. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  52517. }
  52518. function j(e) {
  52519. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  52520. var t = document.createElement("canvas");
  52521. t.width = n.Math.nearestPowerOfTwo(e.width),
  52522. t.height = n.Math.nearestPowerOfTwo(e.height);
  52523. var i = t.getContext("2d");
  52524. return i.drawImage(e, 0, 0, t.width, t.height),
  52525. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  52526. t
  52527. }
  52528. return e
  52529. }
  52530. function Y(e, t) {
  52531. var i = Xe.get(e);
  52532. if (6 === e.image.length)
  52533. if (e.version > 0 && i.__version !== e.version) {
  52534. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  52535. i.__image__webglTextureCube = Ge.createTexture(),
  52536. ke.textures++),
  52537. Ye.activeTexture(Ge.TEXTURE0 + t),
  52538. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  52539. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  52540. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  52541. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  52542. var c = a[0]
  52543. , h = z(c)
  52544. , u = ee(e.format)
  52545. , d = ee(e.type);
  52546. k(Ge.TEXTURE_CUBE_MAP, e, h);
  52547. for (var l = 0; l < 6; l++)
  52548. if (r)
  52549. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  52550. p = f[g],
  52551. 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);
  52552. else
  52553. 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]);
  52554. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52555. i.__version = e.version,
  52556. e.onUpdate && e.onUpdate(e)
  52557. } else
  52558. Ye.activeTexture(Ge.TEXTURE0 + t),
  52559. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  52560. }
  52561. function X(e, t) {
  52562. Ye.activeTexture(Ge.TEXTURE0 + t),
  52563. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  52564. }
  52565. function Z(e, t, i, n) {
  52566. var r = ee(t.texture.format)
  52567. , o = ee(t.texture.type);
  52568. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  52569. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  52570. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  52571. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52572. }
  52573. function q(e, t) {
  52574. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  52575. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  52576. 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),
  52577. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  52578. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  52579. }
  52580. function K(e) {
  52581. var t = Xe.get(e)
  52582. , i = e instanceof n.WebGLRenderTargetCube;
  52583. if (i) {
  52584. t.__webglDepthbuffer = [];
  52585. for (var r = 0; r < 6; r++)
  52586. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  52587. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  52588. q(t.__webglDepthbuffer[r], e)
  52589. } else
  52590. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  52591. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  52592. q(t.__webglDepthbuffer, e);
  52593. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52594. }
  52595. function Q(e) {
  52596. var t = Xe.get(e)
  52597. , i = Xe.get(e.texture);
  52598. e.addEventListener("dispose", l),
  52599. i.__webglTexture = Ge.createTexture(),
  52600. ke.textures++;
  52601. var r = e instanceof n.WebGLRenderTargetCube
  52602. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  52603. if (r) {
  52604. t.__webglFramebuffer = [];
  52605. for (var a = 0; a < 6; a++)
  52606. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  52607. } else
  52608. t.__webglFramebuffer = Ge.createFramebuffer();
  52609. if (r) {
  52610. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  52611. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  52612. for (var a = 0; a < 6; a++)
  52613. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  52614. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52615. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  52616. } else
  52617. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  52618. k(Ge.TEXTURE_2D, e.texture, o),
  52619. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  52620. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52621. Ye.bindTexture(Ge.TEXTURE_2D, null);
  52622. e.depthBuffer && K(e)
  52623. }
  52624. function J(e) {
  52625. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  52626. , i = Xe.get(e.texture).__webglTexture;
  52627. Ye.bindTexture(t, i),
  52628. Ge.generateMipmap(t),
  52629. Ye.bindTexture(t, null)
  52630. }
  52631. function $(e) {
  52632. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  52633. }
  52634. function ee(e) {
  52635. var t;
  52636. if (e === n.RepeatWrapping)
  52637. return Ge.REPEAT;
  52638. if (e === n.ClampToEdgeWrapping)
  52639. return Ge.CLAMP_TO_EDGE;
  52640. if (e === n.MirroredRepeatWrapping)
  52641. return Ge.MIRRORED_REPEAT;
  52642. if (e === n.NearestFilter)
  52643. return Ge.NEAREST;
  52644. if (e === n.NearestMipMapNearestFilter)
  52645. return Ge.NEAREST_MIPMAP_NEAREST;
  52646. if (e === n.NearestMipMapLinearFilter)
  52647. return Ge.NEAREST_MIPMAP_LINEAR;
  52648. if (e === n.LinearFilter)
  52649. return Ge.LINEAR;
  52650. if (e === n.LinearMipMapNearestFilter)
  52651. return Ge.LINEAR_MIPMAP_NEAREST;
  52652. if (e === n.LinearMipMapLinearFilter)
  52653. return Ge.LINEAR_MIPMAP_LINEAR;
  52654. if (e === n.UnsignedByteType)
  52655. return Ge.UNSIGNED_BYTE;
  52656. if (e === n.UnsignedShort4444Type)
  52657. return Ge.UNSIGNED_SHORT_4_4_4_4;
  52658. if (e === n.UnsignedShort5551Type)
  52659. return Ge.UNSIGNED_SHORT_5_5_5_1;
  52660. if (e === n.UnsignedShort565Type)
  52661. return Ge.UNSIGNED_SHORT_5_6_5;
  52662. if (e === n.ByteType)
  52663. return Ge.BYTE;
  52664. if (e === n.ShortType)
  52665. return Ge.SHORT;
  52666. if (e === n.UnsignedShortType)
  52667. return Ge.UNSIGNED_SHORT;
  52668. if (e === n.IntType)
  52669. return Ge.INT;
  52670. if (e === n.UnsignedIntType)
  52671. return Ge.UNSIGNED_INT;
  52672. if (e === n.FloatType)
  52673. return Ge.FLOAT;
  52674. if (t = We.get("OES_texture_half_float"),
  52675. null !== t && e === n.HalfFloatType)
  52676. return t.HALF_FLOAT_OES;
  52677. if (e === n.AlphaFormat)
  52678. return Ge.ALPHA;
  52679. if (e === n.RGBFormat)
  52680. return Ge.RGB;
  52681. if (e === n.RGBAFormat)
  52682. return Ge.RGBA;
  52683. if (e === n.LuminanceFormat)
  52684. return Ge.LUMINANCE;
  52685. if (e === n.LuminanceAlphaFormat)
  52686. return Ge.LUMINANCE_ALPHA;
  52687. if (e === n.AddEquation)
  52688. return Ge.FUNC_ADD;
  52689. if (e === n.SubtractEquation)
  52690. return Ge.FUNC_SUBTRACT;
  52691. if (e === n.ReverseSubtractEquation)
  52692. return Ge.FUNC_REVERSE_SUBTRACT;
  52693. if (e === n.ZeroFactor)
  52694. return Ge.ZERO;
  52695. if (e === n.OneFactor)
  52696. return Ge.ONE;
  52697. if (e === n.SrcColorFactor)
  52698. return Ge.SRC_COLOR;
  52699. if (e === n.OneMinusSrcColorFactor)
  52700. return Ge.ONE_MINUS_SRC_COLOR;
  52701. if (e === n.SrcAlphaFactor)
  52702. return Ge.SRC_ALPHA;
  52703. if (e === n.OneMinusSrcAlphaFactor)
  52704. return Ge.ONE_MINUS_SRC_ALPHA;
  52705. if (e === n.DstAlphaFactor)
  52706. return Ge.DST_ALPHA;
  52707. if (e === n.OneMinusDstAlphaFactor)
  52708. return Ge.ONE_MINUS_DST_ALPHA;
  52709. if (e === n.DstColorFactor)
  52710. return Ge.DST_COLOR;
  52711. if (e === n.OneMinusDstColorFactor)
  52712. return Ge.ONE_MINUS_DST_COLOR;
  52713. if (e === n.SrcAlphaSaturateFactor)
  52714. return Ge.SRC_ALPHA_SATURATE;
  52715. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52716. null !== t) {
  52717. if (e === n.RGB_S3TC_DXT1_Format)
  52718. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52719. if (e === n.RGBA_S3TC_DXT1_Format)
  52720. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52721. if (e === n.RGBA_S3TC_DXT3_Format)
  52722. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52723. if (e === n.RGBA_S3TC_DXT5_Format)
  52724. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52725. }
  52726. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52727. null !== t) {
  52728. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52729. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52730. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52731. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52732. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52733. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52734. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52735. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52736. }
  52737. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52738. null !== t && e === n.RGB_ETC1_Format)
  52739. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52740. if (t = We.get("EXT_blend_minmax"),
  52741. null !== t) {
  52742. if (e === n.MinEquation)
  52743. return t.MIN_EXT;
  52744. if (e === n.MaxEquation)
  52745. return t.MAX_EXT
  52746. }
  52747. return 0
  52748. }
  52749. console.log("THREE.WebGLRenderer", n.REVISION),
  52750. e = e || {};
  52751. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52752. , ie = void 0 !== e.context ? e.context : null
  52753. , ne = void 0 !== e.alpha && e.alpha
  52754. , re = void 0 === e.depth || e.depth
  52755. , oe = void 0 === e.stencil || e.stencil
  52756. , ae = void 0 !== e.antialias && e.antialias
  52757. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52758. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52759. , ce = []
  52760. , he = []
  52761. , ue = -1
  52762. , de = []
  52763. , pe = -1
  52764. , fe = new Float32Array(8)
  52765. , ge = []
  52766. , me = [];
  52767. this.domElement = te,
  52768. this.context = null,
  52769. this.autoClear = !0,
  52770. this.autoClearColor = !0,
  52771. this.autoClearDepth = !0,
  52772. this.autoClearStencil = !0,
  52773. this.sortObjects = !0,
  52774. this.gammaFactor = 2,
  52775. this.gammaInput = !1,
  52776. this.gammaOutput = !1,
  52777. this.physicallyCorrectLights = !1,
  52778. this.toneMapping = n.LinearToneMapping,
  52779. this.toneMappingExposure = 1,
  52780. this.toneMappingWhitePoint = 1,
  52781. this.maxMorphTargets = 8,
  52782. this.maxMorphNormals = 4,
  52783. this.autoScaleCubemaps = !0;
  52784. var ve = this
  52785. , Ae = null
  52786. , ye = null
  52787. , Ce = null
  52788. , Ie = -1
  52789. , Ee = ""
  52790. , be = null
  52791. , we = new n.Vector4
  52792. , _e = null
  52793. , Te = new n.Vector4
  52794. , xe = 0
  52795. , Se = new n.Color(0)
  52796. , Me = 0
  52797. , Re = te.width
  52798. , Pe = te.height
  52799. , Oe = 1
  52800. , Le = new n.Vector4(0,0,Re,Pe)
  52801. , De = !1
  52802. , Ne = new n.Vector4(0,0,Re,Pe)
  52803. , Be = new n.Frustum
  52804. , Fe = new n.Matrix4
  52805. , Ve = new n.Vector3
  52806. , Ue = {
  52807. hash: "",
  52808. ambient: [0, 0, 0],
  52809. directional: [],
  52810. directionalShadowMap: [],
  52811. directionalShadowMatrix: [],
  52812. spot: [],
  52813. spotShadowMap: [],
  52814. spotShadowMatrix: [],
  52815. point: [],
  52816. pointShadowMap: [],
  52817. pointShadowMatrix: [],
  52818. hemi: [],
  52819. shadows: [],
  52820. shadowsPointLight: 0
  52821. }
  52822. , ke = {
  52823. geometries: 0,
  52824. textures: 0
  52825. }
  52826. , He = {
  52827. calls: 0,
  52828. vertices: 0,
  52829. faces: 0,
  52830. points: 0
  52831. };
  52832. this.info = {
  52833. render: He,
  52834. memory: ke,
  52835. programs: null
  52836. };
  52837. var Ge;
  52838. try {
  52839. var ze = {
  52840. alpha: ne,
  52841. depth: re,
  52842. stencil: oe,
  52843. antialias: ae,
  52844. premultipliedAlpha: se,
  52845. preserveDrawingBuffer: le
  52846. };
  52847. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52848. null === Ge)
  52849. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52850. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52851. return {
  52852. rangeMin: 1,
  52853. rangeMax: 1,
  52854. precision: 1
  52855. }
  52856. }
  52857. ),
  52858. te.addEventListener("webglcontextlost", a, !1)
  52859. } catch (e) {
  52860. console.error("THREE.WebGLRenderer: " + e)
  52861. }
  52862. var We = new n.WebGLExtensions(Ge);
  52863. We.get("OES_texture_float"),
  52864. We.get("OES_texture_float_linear"),
  52865. We.get("OES_texture_half_float"),
  52866. We.get("OES_texture_half_float_linear"),
  52867. We.get("OES_standard_derivatives"),
  52868. We.get("ANGLE_instanced_arrays"),
  52869. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52870. var je = new n.WebGLCapabilities(Ge,We,e)
  52871. , Ye = new n.WebGLState(Ge,We,ee)
  52872. , Xe = new n.WebGLProperties
  52873. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52874. , qe = new n.WebGLPrograms(this,je)
  52875. , Ke = new n.WebGLLights;
  52876. this.info.programs = qe.programs;
  52877. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52878. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52879. r(),
  52880. this.context = Ge,
  52881. this.capabilities = je,
  52882. this.extensions = We,
  52883. this.properties = Xe,
  52884. this.state = Ye;
  52885. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52886. this.shadowMap = $e;
  52887. var et = new n.SpritePlugin(this,ge)
  52888. , tt = new n.LensFlarePlugin(this,me);
  52889. this.getContext = function() {
  52890. return Ge
  52891. }
  52892. ,
  52893. this.getContextAttributes = function() {
  52894. return Ge.getContextAttributes()
  52895. }
  52896. ,
  52897. this.forceContextLoss = function() {
  52898. We.get("WEBGL_lose_context").loseContext()
  52899. }
  52900. ,
  52901. this.getMaxAnisotropy = function() {
  52902. var e;
  52903. return function() {
  52904. if (void 0 !== e)
  52905. return e;
  52906. var t = We.get("EXT_texture_filter_anisotropic");
  52907. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52908. }
  52909. }(),
  52910. this.getPrecision = function() {
  52911. return je.precision
  52912. }
  52913. ,
  52914. this.getPixelRatio = function() {
  52915. return Oe
  52916. }
  52917. ,
  52918. this.setPixelRatio = function(e) {
  52919. void 0 !== e && (Oe = e,
  52920. this.setSize(Ne.z, Ne.w, !1))
  52921. }
  52922. ,
  52923. this.getSize = function() {
  52924. return {
  52925. width: Re,
  52926. height: Pe
  52927. }
  52928. }
  52929. ,
  52930. this.setSize = function(e, t, i, devicePixelRatio) {
  52931. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52932. Re = e,
  52933. Pe = t,
  52934. te.width = e * Oe,
  52935. te.height = t * Oe,
  52936. i !== !1 && (te.style.width = e + "px",
  52937. te.style.height = t + "px"),
  52938. this.setViewport(0, 0, e, t)
  52939. }
  52940. ,
  52941. this.setViewport = function(e, t, i, n) {
  52942. Ye.viewport(Ne.set(e, t, i, n))
  52943. }
  52944. ,
  52945. this.setScissor = function(e, t, i, n) {
  52946. Ye.scissor(Le.set(e, t, i, n))
  52947. }
  52948. ,
  52949. this.setScissorTest = function(e) {
  52950. Ye.setScissorTest(De = e)
  52951. }
  52952. ,
  52953. this.getClearColor = function() {
  52954. return Se
  52955. }
  52956. ,
  52957. this.setClearColor = function(e, t) {
  52958. Se.set(e),
  52959. Me = void 0 !== t ? t : 1,
  52960. i(Se.r, Se.g, Se.b, Me)
  52961. }
  52962. ,
  52963. this.getClearAlpha = function() {
  52964. return Me
  52965. }
  52966. ,
  52967. this.setClearAlpha = function(e) {
  52968. Me = e,
  52969. i(Se.r, Se.g, Se.b, Me)
  52970. }
  52971. ,
  52972. this.clear = function(e, t, i) {
  52973. var n = 0;
  52974. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52975. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52976. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52977. Ge.clear(n)
  52978. }
  52979. ,
  52980. this.clearColor = function() {
  52981. this.clear(!0, !1, !1)
  52982. }
  52983. ,
  52984. this.clearDepth = function() {
  52985. this.clear(!1, !0, !1)
  52986. }
  52987. ,
  52988. this.clearStencil = function() {
  52989. this.clear(!1, !1, !0)
  52990. }
  52991. ,
  52992. this.clearTarget = function(e, t, i, n) {
  52993. this.setRenderTarget(e),
  52994. this.clear(t, i, n)
  52995. }
  52996. ,
  52997. this.resetGLState = o,
  52998. this.dispose = function() {
  52999. te.removeEventListener("webglcontextlost", a, !1)
  53000. }
  53001. ,
  53002. this.renderBufferImmediate = function(e, t, i) {
  53003. Ye.initAttributes();
  53004. var r = Xe.get(e);
  53005. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  53006. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  53007. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  53008. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  53009. var o = t.getAttributes();
  53010. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  53011. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  53012. Ye.enableAttribute(o.position),
  53013. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  53014. e.hasNormals) {
  53015. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  53016. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  53017. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  53018. var l = e.normalArray
  53019. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  53020. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  53021. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  53022. l[a + 0] = c,
  53023. l[a + 1] = h,
  53024. l[a + 2] = u,
  53025. l[a + 3] = c,
  53026. l[a + 4] = h,
  53027. l[a + 5] = u,
  53028. l[a + 6] = c,
  53029. l[a + 7] = h,
  53030. l[a + 8] = u
  53031. }
  53032. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  53033. Ye.enableAttribute(o.normal),
  53034. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  53035. }
  53036. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  53037. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  53038. Ye.enableAttribute(o.uv),
  53039. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  53040. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  53041. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  53042. Ye.enableAttribute(o.color),
  53043. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  53044. Ye.disableUnusedAttributes(),
  53045. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  53046. e.count = 0
  53047. }
  53048. ,
  53049. this.renderBufferDirect = function(e, i, r, o, a, s) {
  53050. E(o);
  53051. var l = w(e, i, o, a)
  53052. , c = !1
  53053. , h = r.id + "_" + l.id + "_" + o.wireframe;
  53054. h !== Ee && (Ee = h,
  53055. c = !0);
  53056. var u = a.morphTargetInfluences;
  53057. if (void 0 !== u) {
  53058. for (var d = [], p = 0, m = u.length; p < m; p++) {
  53059. var v = u[p];
  53060. d.push([v, p])
  53061. }
  53062. d.sort(g),
  53063. d.length > 8 && (d.length = 8);
  53064. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  53065. var v = d[p];
  53066. if (fe[p] = v[0],
  53067. 0 !== v[0]) {
  53068. var y = v[1];
  53069. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  53070. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  53071. } else
  53072. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  53073. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  53074. }
  53075. var C = l.getUniforms();
  53076. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  53077. c = !0
  53078. }
  53079. var y = r.index
  53080. , I = r.attributes.position;
  53081. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  53082. var b;
  53083. null !== y ? (b = Je,
  53084. b.setIndex(y)) : b = Qe,
  53085. c && (f(o, l, r),
  53086. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  53087. var _ = 0
  53088. , T = 1 / 0;
  53089. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  53090. var x = r.drawRange.start
  53091. , S = r.drawRange.count
  53092. , M = null !== s ? s.start : 0
  53093. , R = null !== s ? s.count : 1 / 0
  53094. , P = Math.max(_, x, M)
  53095. , O = Math.min(_ + T, x + S, M + R) - 1
  53096. , L = Math.max(0, O - P + 1);
  53097. if (a instanceof n.Mesh)
  53098. if (o.wireframe === !0)
  53099. Ye.setLineWidth(o.wireframeLinewidth * t()),
  53100. b.setMode(Ge.LINES);
  53101. else
  53102. switch (a.drawMode) {
  53103. case n.TrianglesDrawMode:
  53104. b.setMode(Ge.TRIANGLES);
  53105. break;
  53106. case n.TriangleStripDrawMode:
  53107. b.setMode(Ge.TRIANGLE_STRIP);
  53108. break;
  53109. case n.TriangleFanDrawMode:
  53110. b.setMode(Ge.TRIANGLE_FAN)
  53111. }
  53112. else if (a instanceof n.Line) {
  53113. var D = o.linewidth;
  53114. void 0 === D && (D = 1),
  53115. Ye.setLineWidth(D * t()),
  53116. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  53117. } else
  53118. a instanceof n.Points && b.setMode(Ge.POINTS);
  53119. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  53120. }
  53121. ,
  53122. this.render = function(e, t, i, r) {
  53123. if (t instanceof n.Camera == !1)
  53124. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  53125. var o = e.fog;
  53126. if (Ee = "",
  53127. Ie = -1,
  53128. be = null,
  53129. e.autoUpdate === !0 && e.updateMatrixWorld(),
  53130. null === t.parent && t.updateMatrixWorld(),
  53131. t.matrixWorldInverse.getInverse(t.matrixWorld),
  53132. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  53133. Be.setFromMatrix(Fe),
  53134. ce.length = 0,
  53135. ue = -1,
  53136. pe = -1,
  53137. ge.length = 0,
  53138. me.length = 0,
  53139. y(e, t),
  53140. he.length = ue + 1,
  53141. de.length = pe + 1,
  53142. ve.sortObjects === !0 && (he.sort(m),
  53143. de.sort(v)),
  53144. U(ce, t),
  53145. $e.render(e, t),
  53146. He.calls = 0,
  53147. He.vertices = 0,
  53148. He.faces = 0,
  53149. He.points = 0,
  53150. void 0 === i && (i = null),
  53151. this.setRenderTarget(i),
  53152. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  53153. e.overrideMaterial) {
  53154. var a = e.overrideMaterial;
  53155. C(he, t, o, a),
  53156. C(de, t, o, a)
  53157. } else
  53158. Ye.setBlending(n.NoBlending),
  53159. C(he, t, o),
  53160. C(de, t, o);
  53161. if (et.render(e, t),
  53162. tt.render(e, t, Te),
  53163. i) {
  53164. var s = i.texture;
  53165. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  53166. }
  53167. Ye.setDepthTest(!0),
  53168. Ye.setDepthWrite(!0),
  53169. Ye.setColorWrite(!0)
  53170. }
  53171. ,
  53172. this.setFaceCulling = function(e, t) {
  53173. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  53174. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  53175. Ye.enable(Ge.CULL_FACE))
  53176. }
  53177. ,
  53178. this.setTexture = function(e, t) {
  53179. var i = Xe.get(e);
  53180. if (e.version > 0 && i.__version !== e.version) {
  53181. var n = e.image;
  53182. 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)
  53183. }
  53184. Ye.activeTexture(Ge.TEXTURE0 + t),
  53185. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  53186. }
  53187. ,
  53188. this.getCurrentRenderTarget = function() {
  53189. return ye
  53190. }
  53191. ,
  53192. this.setRenderTarget = function(e) {
  53193. ye = e,
  53194. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  53195. var t, i = e instanceof n.WebGLRenderTargetCube;
  53196. if (e) {
  53197. var r = Xe.get(e);
  53198. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  53199. we.copy(e.scissor),
  53200. _e = e.scissorTest,
  53201. Te.copy(e.viewport)
  53202. } else
  53203. t = null,
  53204. we.copy(Le).multiplyScalar(Oe),
  53205. _e = De,
  53206. Te.copy(Ne).multiplyScalar(Oe);
  53207. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  53208. Ce = t),
  53209. Ye.scissor(we),
  53210. Ye.setScissorTest(_e),
  53211. Ye.viewport(Te),
  53212. i) {
  53213. var o = Xe.get(e.texture);
  53214. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  53215. }
  53216. }
  53217. ,
  53218. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  53219. if (e instanceof n.WebGLRenderTarget == !1)
  53220. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  53221. var s = Xe.get(e).__webglFramebuffer;
  53222. if (s) {
  53223. var l = !1;
  53224. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  53225. l = !0);
  53226. try {
  53227. var c = e.texture;
  53228. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  53229. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  53230. 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")))
  53231. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  53232. 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.")
  53233. } finally {
  53234. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  53235. }
  53236. }
  53237. }
  53238. }
  53239. ,
  53240. n.WebGLRenderTarget = function(e, t, i) {
  53241. this.uuid = n.Math.generateUUID(),
  53242. this.width = e,
  53243. this.height = t,
  53244. this.scissor = new n.Vector4(0,0,e,t),
  53245. this.scissorTest = !1,
  53246. this.viewport = new n.Vector4(0,0,e,t),
  53247. i = i || {},
  53248. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  53249. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  53250. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  53251. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  53252. }
  53253. ,
  53254. n.WebGLRenderTarget.prototype = {
  53255. constructor: n.WebGLRenderTarget,
  53256. setSize: function(e, t) {
  53257. this.width === e && this.height === t || (this.width = e,
  53258. this.height = t,
  53259. this.dispose()),
  53260. this.viewport.set(0, 0, e, t),
  53261. this.scissor.set(0, 0, e, t)
  53262. },
  53263. clone: function() {
  53264. return (new this.constructor).copy(this)
  53265. },
  53266. copy: function(e) {
  53267. return this.width = e.width,
  53268. this.height = e.height,
  53269. this.viewport.copy(e.viewport),
  53270. this.texture = e.texture.clone(),
  53271. this.depthBuffer = e.depthBuffer,
  53272. this.stencilBuffer = e.stencilBuffer,
  53273. this
  53274. },
  53275. dispose: function() {
  53276. this.dispatchEvent({
  53277. type: "dispose"
  53278. })
  53279. }
  53280. },
  53281. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  53282. n.WebGLRenderTargetCube = function(e, t, i) {
  53283. n.WebGLRenderTarget.call(this, e, t, i),
  53284. this.activeCubeFace = 0,
  53285. this.activeMipMapLevel = 0
  53286. }
  53287. ,
  53288. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  53289. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  53290. n.WebGLBufferRenderer = function(e, t, i) {
  53291. function r(e) {
  53292. s = e
  53293. }
  53294. function o(t, n) {
  53295. e.drawArrays(s, t, n),
  53296. i.calls++,
  53297. i.vertices += n,
  53298. s === e.TRIANGLES && (i.faces += n / 3)
  53299. }
  53300. function a(r) {
  53301. var o = t.get("ANGLE_instanced_arrays");
  53302. if (null === o)
  53303. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  53304. var a = r.attributes.position
  53305. , l = 0;
  53306. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  53307. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  53308. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  53309. i.calls++,
  53310. i.vertices += l * r.maxInstancedCount,
  53311. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  53312. }
  53313. var s;
  53314. this.setMode = r,
  53315. this.render = o,
  53316. this.renderInstances = a
  53317. }
  53318. ,
  53319. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  53320. function n(e) {
  53321. s = e
  53322. }
  53323. function r(i) {
  53324. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  53325. c = 4) : (l = e.UNSIGNED_SHORT,
  53326. c = 2)
  53327. }
  53328. function o(t, n) {
  53329. e.drawElements(s, n, l, t * c),
  53330. i.calls++,
  53331. i.vertices += n,
  53332. s === e.TRIANGLES && (i.faces += n / 3)
  53333. }
  53334. function a(n, r, o) {
  53335. var a = t.get("ANGLE_instanced_arrays");
  53336. 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),
  53337. i.calls++,
  53338. i.vertices += o * n.maxInstancedCount,
  53339. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  53340. }
  53341. var s, l, c;
  53342. this.setMode = n,
  53343. this.setIndex = r,
  53344. this.render = o,
  53345. this.renderInstances = a
  53346. }
  53347. ,
  53348. n.WebGLExtensions = function(e) {
  53349. var t = {};
  53350. this.get = function(i) {
  53351. if (void 0 !== t[i])
  53352. return t[i];
  53353. var n;
  53354. switch (i) {
  53355. case "EXT_texture_filter_anisotropic":
  53356. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  53357. break;
  53358. case "WEBGL_compressed_texture_s3tc":
  53359. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  53360. break;
  53361. case "WEBGL_compressed_texture_pvrtc":
  53362. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  53363. break;
  53364. case "WEBGL_compressed_texture_etc1":
  53365. n = e.getExtension("WEBGL_compressed_texture_etc1");
  53366. break;
  53367. default:
  53368. n = e.getExtension(i)
  53369. }
  53370. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  53371. t[i] = n,
  53372. n
  53373. }
  53374. }
  53375. ,
  53376. n.WebGLCapabilities = function(e, t, i) {
  53377. function n(t) {
  53378. if ("highp" === t) {
  53379. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  53380. return "highp";
  53381. t = "mediump"
  53382. }
  53383. 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"
  53384. }
  53385. this.getMaxPrecision = n,
  53386. this.precision = void 0 !== i.precision ? i.precision : "highp",
  53387. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  53388. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  53389. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  53390. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  53391. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  53392. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  53393. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  53394. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  53395. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  53396. this.vertexTextures = this.maxVertexTextures > 0,
  53397. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  53398. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  53399. var r = n(this.precision);
  53400. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  53401. this.precision = r),
  53402. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  53403. }
  53404. ,
  53405. n.WebGLGeometries = function(e, t, i) {
  53406. function r(e) {
  53407. var t = e.geometry;
  53408. if (void 0 !== h[t.id])
  53409. return h[t.id];
  53410. t.addEventListener("dispose", o);
  53411. var r;
  53412. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  53413. r = t._bufferGeometry),
  53414. h[t.id] = r,
  53415. i.memory.geometries++,
  53416. r
  53417. }
  53418. function o(e) {
  53419. var n = e.target
  53420. , r = h[n.id];
  53421. null !== r.index && s(r.index),
  53422. l(r.attributes),
  53423. n.removeEventListener("dispose", o),
  53424. delete h[n.id];
  53425. var a = t.get(n);
  53426. a.wireframe && s(a.wireframe),
  53427. t.delete(n);
  53428. var c = t.get(r);
  53429. c.wireframe && s(c.wireframe),
  53430. t.delete(r),
  53431. i.memory.geometries--
  53432. }
  53433. function a(e) {
  53434. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53435. }
  53436. function s(t) {
  53437. var i = a(t);
  53438. void 0 !== i && (e.deleteBuffer(i),
  53439. c(t))
  53440. }
  53441. function l(e) {
  53442. for (var t in e)
  53443. s(e[t])
  53444. }
  53445. function c(e) {
  53446. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  53447. }
  53448. var h = {};
  53449. this.get = r
  53450. }
  53451. ,
  53452. n.WebGLLights = function() {
  53453. var e = {};
  53454. this.get = function(t) {
  53455. if (void 0 !== e[t.id])
  53456. return e[t.id];
  53457. var i;
  53458. switch (t.type) {
  53459. case "DirectionalLight":
  53460. i = {
  53461. direction: new n.Vector3,
  53462. color: new n.Color,
  53463. shadow: !1,
  53464. shadowBias: 0,
  53465. shadowRadius: 1,
  53466. shadowMapSize: new n.Vector2
  53467. };
  53468. break;
  53469. case "SpotLight":
  53470. i = {
  53471. position: new n.Vector3,
  53472. direction: new n.Vector3,
  53473. color: new n.Color,
  53474. distance: 0,
  53475. coneCos: 0,
  53476. penumbraCos: 0,
  53477. decay: 0,
  53478. shadow: !1,
  53479. shadowBias: 0,
  53480. shadowRadius: 1,
  53481. shadowMapSize: new n.Vector2
  53482. };
  53483. break;
  53484. case "PointLight":
  53485. i = {
  53486. position: new n.Vector3,
  53487. color: new n.Color,
  53488. distance: 0,
  53489. decay: 0,
  53490. shadow: !1,
  53491. shadowBias: 0,
  53492. shadowRadius: 1,
  53493. shadowMapSize: new n.Vector2
  53494. };
  53495. break;
  53496. case "HemisphereLight":
  53497. i = {
  53498. direction: new n.Vector3,
  53499. skyColor: new n.Color,
  53500. groundColor: new n.Color
  53501. }
  53502. }
  53503. return e[t.id] = i,
  53504. i
  53505. }
  53506. }
  53507. ,
  53508. n.WebGLObjects = function(e, t, i) {
  53509. function r(t) {
  53510. var i = u.get(t);
  53511. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  53512. var r = i.index
  53513. , a = i.attributes;
  53514. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  53515. for (var s in a)
  53516. o(a[s], e.ARRAY_BUFFER);
  53517. var l = i.morphAttributes;
  53518. for (var s in l)
  53519. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  53520. o(c[h], e.ARRAY_BUFFER);
  53521. return i
  53522. }
  53523. function o(e, i) {
  53524. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  53525. , o = t.get(r);
  53526. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  53527. }
  53528. function a(t, i, n) {
  53529. t.__webglBuffer = e.createBuffer(),
  53530. e.bindBuffer(n, t.__webglBuffer);
  53531. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  53532. e.bufferData(n, i.array, r),
  53533. t.version = i.version
  53534. }
  53535. function s(t, i, n) {
  53536. e.bindBuffer(n, t.__webglBuffer),
  53537. 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)),
  53538. i.updateRange.count = 0),
  53539. t.version = i.version
  53540. }
  53541. function l(e) {
  53542. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53543. }
  53544. function c(i) {
  53545. var r = t.get(i);
  53546. if (void 0 !== r.wireframe)
  53547. return r.wireframe;
  53548. var a = []
  53549. , s = i.index
  53550. , l = i.attributes
  53551. , c = l.position;
  53552. if (null !== s)
  53553. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  53554. var g = d[p + 0]
  53555. , m = d[p + 1]
  53556. , v = d[p + 2];
  53557. h(u, g, m) && a.push(g, m),
  53558. h(u, m, v) && a.push(m, v),
  53559. h(u, v, g) && a.push(v, g)
  53560. }
  53561. else
  53562. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  53563. var g = p + 0
  53564. , m = p + 1
  53565. , v = p + 2;
  53566. a.push(g, m, m, v, v, g)
  53567. }
  53568. var A = c.count > 65535 ? Uint32Array : Uint16Array
  53569. , y = new n.BufferAttribute(new A(a),1);
  53570. return o(y, e.ELEMENT_ARRAY_BUFFER),
  53571. r.wireframe = y,
  53572. y
  53573. }
  53574. function h(e, t, i) {
  53575. if (t > i) {
  53576. var n = t;
  53577. t = i,
  53578. i = n
  53579. }
  53580. var r = e[t];
  53581. return void 0 === r ? (e[t] = [i],
  53582. !0) : r.indexOf(i) === -1 && (r.push(i),
  53583. !0)
  53584. }
  53585. var u = new n.WebGLGeometries(e,t,i);
  53586. this.getAttributeBuffer = l,
  53587. this.getWireframeAttribute = c,
  53588. this.update = r
  53589. }
  53590. ,
  53591. n.WebGLProgram = function() {
  53592. function e(e) {
  53593. switch (e) {
  53594. case n.LinearEncoding:
  53595. return ["Linear", "( value )"];
  53596. case n.sRGBEncoding:
  53597. return ["sRGB", "( value )"];
  53598. case n.RGBEEncoding:
  53599. return ["RGBE", "( value )"];
  53600. case n.RGBM7Encoding:
  53601. return ["RGBM", "( value, 7.0 )"];
  53602. case n.RGBM16Encoding:
  53603. return ["RGBM", "( value, 16.0 )"];
  53604. case n.RGBDEncoding:
  53605. return ["RGBD", "( value, 256.0 )"];
  53606. case n.GammaEncoding:
  53607. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  53608. default:
  53609. throw new Error("unsupported encoding: " + e)
  53610. }
  53611. }
  53612. function t(t, i) {
  53613. var n = e(i);
  53614. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  53615. }
  53616. function i(t, i) {
  53617. var n = e(i);
  53618. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  53619. }
  53620. function r(e, t) {
  53621. var i;
  53622. switch (t) {
  53623. case n.LinearToneMapping:
  53624. i = "Linear";
  53625. break;
  53626. case n.ReinhardToneMapping:
  53627. i = "Reinhard";
  53628. break;
  53629. case n.Uncharted2ToneMapping:
  53630. i = "Uncharted2";
  53631. break;
  53632. case n.CineonToneMapping:
  53633. i = "OptimizedCineon";
  53634. break;
  53635. default:
  53636. throw new Error("unsupported toneMapping: " + t)
  53637. }
  53638. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  53639. }
  53640. function o(e, t, i) {
  53641. e = e || {};
  53642. 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" : ""];
  53643. return n.filter(c).join("\n")
  53644. }
  53645. function a(e) {
  53646. var t = [];
  53647. for (var i in e) {
  53648. var n = e[i];
  53649. n !== !1 && t.push("#define " + i + " " + n)
  53650. }
  53651. return t.join("\n")
  53652. }
  53653. function s(e, t, i) {
  53654. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  53655. var a = e.getActiveUniform(t, o)
  53656. , s = a.name
  53657. , l = e.getUniformLocation(t, s)
  53658. , c = f.exec(s);
  53659. if (c) {
  53660. var h = c[1]
  53661. , u = c[2]
  53662. , d = n[h];
  53663. d || (d = n[h] = {}),
  53664. d[u] = l
  53665. } else if (c = g.exec(s)) {
  53666. var p = c[1]
  53667. , v = c[2]
  53668. , A = c[3]
  53669. , y = n[p];
  53670. y || (y = n[p] = []);
  53671. var C = y[v];
  53672. C || (C = y[v] = {}),
  53673. C[A] = l
  53674. } else if (c = m.exec(s)) {
  53675. var p = c[1];
  53676. n[p] = l
  53677. } else
  53678. n[s] = l
  53679. }
  53680. return n
  53681. }
  53682. function l(e, t, i) {
  53683. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53684. var a = e.getActiveAttrib(t, o)
  53685. , s = a.name;
  53686. n[s] = e.getAttribLocation(t, s)
  53687. }
  53688. return n
  53689. }
  53690. function c(e) {
  53691. return "" !== e
  53692. }
  53693. function h(e, t) {
  53694. 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)
  53695. }
  53696. function u(e) {
  53697. function t(e, t) {
  53698. var i = n.ShaderChunk[t];
  53699. if (void 0 === i)
  53700. throw new Error("Can not resolve #include <" + t + ">");
  53701. return u(i)
  53702. }
  53703. var i = /#include +<([\w\d.]+)>/g;
  53704. return e.replace(i, t)
  53705. }
  53706. function d(e) {
  53707. function t(e, t, i, n) {
  53708. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53709. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53710. return r
  53711. }
  53712. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53713. return e.replace(i, t)
  53714. }
  53715. var p = 0
  53716. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53717. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53718. , m = /^([\w\d_]+)\[0\]$/;
  53719. return function(e, f, g, m) {
  53720. var v = e.context
  53721. , A = g.extensions
  53722. , y = g.defines
  53723. , C = g.__webglShader.vertexShader
  53724. , I = g.__webglShader.fragmentShader
  53725. , E = "SHADOWMAP_TYPE_BASIC";
  53726. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53727. var b = "ENVMAP_TYPE_CUBE"
  53728. , w = "ENVMAP_MODE_REFLECTION"
  53729. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53730. if (m.envMap) {
  53731. switch (g.envMap.mapping) {
  53732. case n.CubeReflectionMapping:
  53733. case n.CubeRefractionMapping:
  53734. b = "ENVMAP_TYPE_CUBE";
  53735. break;
  53736. case n.CubeUVReflectionMapping:
  53737. case n.CubeUVRefractionMapping:
  53738. b = "ENVMAP_TYPE_CUBE_UV";
  53739. break;
  53740. case n.EquirectangularReflectionMapping:
  53741. case n.EquirectangularRefractionMapping:
  53742. b = "ENVMAP_TYPE_EQUIREC";
  53743. break;
  53744. case n.SphericalReflectionMapping:
  53745. b = "ENVMAP_TYPE_SPHERE"
  53746. }
  53747. switch (g.envMap.mapping) {
  53748. case n.CubeRefractionMapping:
  53749. case n.EquirectangularRefractionMapping:
  53750. w = "ENVMAP_MODE_REFRACTION"
  53751. }
  53752. switch (g.combine) {
  53753. case n.MultiplyOperation:
  53754. _ = "ENVMAP_BLENDING_MULTIPLY";
  53755. break;
  53756. case n.MixOperation:
  53757. _ = "ENVMAP_BLENDING_MIX";
  53758. break;
  53759. case n.AddOperation:
  53760. _ = "ENVMAP_BLENDING_ADD"
  53761. }
  53762. }
  53763. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53764. g instanceof n.RawShaderMaterial ? (T = "",
  53765. 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"),
  53766. 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")),
  53767. C = u(C, m),
  53768. C = h(C, m),
  53769. I = u(I, m),
  53770. I = h(I, m),
  53771. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53772. I = d(I));
  53773. var O = T + C
  53774. , L = x + I
  53775. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53776. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53777. v.attachShader(P, D),
  53778. v.attachShader(P, N),
  53779. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53780. v.linkProgram(P);
  53781. var B = v.getProgramInfoLog(P)
  53782. , F = v.getShaderInfoLog(D)
  53783. , V = v.getShaderInfoLog(N)
  53784. , U = !0
  53785. , k = !0;
  53786. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53787. 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),
  53788. k && (this.diagnostics = {
  53789. runnable: U,
  53790. material: g,
  53791. programLog: B,
  53792. vertexShader: {
  53793. log: F,
  53794. prefix: T
  53795. },
  53796. fragmentShader: {
  53797. log: V,
  53798. prefix: x
  53799. }
  53800. }),
  53801. v.deleteShader(D),
  53802. v.deleteShader(N);
  53803. var H;
  53804. this.getUniforms = function() {
  53805. return void 0 === H && (H = s(v, P)),
  53806. H
  53807. }
  53808. ;
  53809. var G;
  53810. return this.getAttributes = function() {
  53811. return void 0 === G && (G = l(v, P)),
  53812. G
  53813. }
  53814. ,
  53815. this.destroy = function() {
  53816. v.deleteProgram(P),
  53817. this.program = void 0
  53818. }
  53819. ,
  53820. Object.defineProperties(this, {
  53821. uniforms: {
  53822. get: function() {
  53823. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53824. this.getUniforms()
  53825. }
  53826. },
  53827. attributes: {
  53828. get: function() {
  53829. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53830. this.getAttributes()
  53831. }
  53832. }
  53833. }),
  53834. this.id = p++,
  53835. this.code = f,
  53836. this.usedTimes = 1,
  53837. this.program = P,
  53838. this.vertexShader = D,
  53839. this.fragmentShader = N,
  53840. this
  53841. }
  53842. }(),
  53843. n.WebGLPrograms = function(e, t) {
  53844. function i(e) {
  53845. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53846. return 1024;
  53847. var i = t.maxVertexUniforms
  53848. , r = Math.floor((i - 20) / 4)
  53849. , o = r;
  53850. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53851. 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)")),
  53852. o
  53853. }
  53854. function r(e, t) {
  53855. var i;
  53856. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53857. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53858. i
  53859. }
  53860. var o = []
  53861. , a = {
  53862. MeshDepthMaterial: "depth",
  53863. MeshNormalMaterial: "normal",
  53864. MeshBasicMaterial: "basic",
  53865. MeshLambertMaterial: "lambert",
  53866. MeshPhongMaterial: "phong",
  53867. MeshStandardMaterial: "standard",
  53868. LineBasicMaterial: "basic",
  53869. LineDashedMaterial: "dashed",
  53870. PointsMaterial: "points"
  53871. }
  53872. , 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"];
  53873. this.getParameters = function(o, s, l, c) {
  53874. var h = a[o.type]
  53875. , u = i(c)
  53876. , d = e.getPrecision();
  53877. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53878. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53879. var p = {
  53880. shaderID: h,
  53881. precision: d,
  53882. supportsVertexTextures: t.vertexTextures,
  53883. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53884. map: !!o.map,
  53885. mapEncoding: r(o.map, e.gammaInput),
  53886. envMap: !!o.envMap,
  53887. envMapMode: o.envMap && o.envMap.mapping,
  53888. envMapEncoding: r(o.envMap, e.gammaInput),
  53889. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53890. lightMap: !!o.lightMap,
  53891. aoMap: !!o.aoMap,
  53892. emissiveMap: !!o.emissiveMap,
  53893. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53894. bumpMap: !!o.bumpMap,
  53895. normalMap: !!o.normalMap,
  53896. displacementMap: !!o.displacementMap,
  53897. roughnessMap: !!o.roughnessMap,
  53898. metalnessMap: !!o.metalnessMap,
  53899. specularMap: !!o.specularMap,
  53900. alphaMap: !!o.alphaMap,
  53901. combine: o.combine,
  53902. vertexColors: o.vertexColors,
  53903. fog: l,
  53904. useFog: o.fog,
  53905. fogExp: l instanceof n.FogExp2,
  53906. flatShading: o.shading === n.FlatShading,
  53907. sizeAttenuation: o.sizeAttenuation,
  53908. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53909. skinning: o.skinning,
  53910. maxBones: u,
  53911. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53912. morphTargets: o.morphTargets,
  53913. morphNormals: o.morphNormals,
  53914. maxMorphTargets: e.maxMorphTargets,
  53915. maxMorphNormals: e.maxMorphNormals,
  53916. numDirLights: s.directional.length,
  53917. numPointLights: s.point.length,
  53918. numSpotLights: s.spot.length,
  53919. numHemiLights: s.hemi.length,
  53920. pointLightShadows: s.shadowsPointLight,
  53921. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53922. shadowMapType: e.shadowMap.type,
  53923. toneMapping: e.toneMapping,
  53924. physicallyCorrectLights: e.physicallyCorrectLights,
  53925. premultipliedAlpha: o.premultipliedAlpha,
  53926. alphaTest: o.alphaTest,
  53927. doubleSided: o.side === n.DoubleSide,
  53928. flipSided: o.side === n.BackSide
  53929. };
  53930. return p
  53931. }
  53932. ,
  53933. this.getProgramCode = function(e, t) {
  53934. var i = [];
  53935. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53936. i.push(e.vertexShader)),
  53937. void 0 !== e.defines)
  53938. for (var n in e.defines)
  53939. i.push(n),
  53940. i.push(e.defines[n]);
  53941. for (var r = 0; r < s.length; r++) {
  53942. var o = s[r];
  53943. i.push(o),
  53944. i.push(t[o])
  53945. }
  53946. return i.join()
  53947. }
  53948. ,
  53949. this.acquireProgram = function(t, i, r) {
  53950. for (var a, s = 0, l = o.length; s < l; s++) {
  53951. var c = o[s];
  53952. if (c.code === r) {
  53953. a = c,
  53954. ++a.usedTimes;
  53955. break
  53956. }
  53957. }
  53958. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53959. o.push(a)),
  53960. a
  53961. }
  53962. ,
  53963. this.releaseProgram = function(e) {
  53964. if (0 === --e.usedTimes) {
  53965. var t = o.indexOf(e);
  53966. o[t] = o[o.length - 1],
  53967. o.pop(),
  53968. e.destroy()
  53969. }
  53970. }
  53971. ,
  53972. this.programs = o
  53973. }
  53974. ,
  53975. n.WebGLProperties = function() {
  53976. var e = {};
  53977. this.get = function(t) {
  53978. var i = t.uuid
  53979. , n = e[i];
  53980. return void 0 === n && (n = {},
  53981. e[i] = n),
  53982. n
  53983. }
  53984. ,
  53985. this.delete = function(t) {
  53986. delete e[t.uuid]
  53987. }
  53988. ,
  53989. this.clear = function() {
  53990. e = {}
  53991. }
  53992. }
  53993. ,
  53994. n.WebGLShader = function() {
  53995. function e(e) {
  53996. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53997. t[i] = i + 1 + ": " + t[i];
  53998. return t.join("\n")
  53999. }
  54000. return function(t, i, n) {
  54001. var r = t.createShader(i);
  54002. return t.shaderSource(r, n),
  54003. t.compileShader(r),
  54004. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  54005. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  54006. r
  54007. }
  54008. }(),
  54009. n.WebGLShadowMap = function(e, t, i) {
  54010. function r(e, t, i, r) {
  54011. var o = e.geometry
  54012. , a = null
  54013. , s = v
  54014. , l = e.customDepthMaterial;
  54015. if (i && (s = A,
  54016. l = e.customDistanceMaterial),
  54017. l)
  54018. a = l;
  54019. else {
  54020. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  54021. , h = e instanceof n.SkinnedMesh && t.skinning
  54022. , u = 0;
  54023. c && (u |= f),
  54024. h && (u |= g),
  54025. a = s[u]
  54026. }
  54027. return a.visible = t.visible,
  54028. a.wireframe = t.wireframe,
  54029. a.wireframeLinewidth = t.wireframeLinewidth,
  54030. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  54031. a
  54032. }
  54033. function o(e, t, i) {
  54034. if (e.visible !== !1) {
  54035. 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)) {
  54036. var r = e.material;
  54037. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  54038. p.push(e))
  54039. }
  54040. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  54041. o(a[s], t, i)
  54042. }
  54043. }
  54044. 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) {
  54045. var x = 0 !== (T & f)
  54046. , S = 0 !== (T & g)
  54047. , M = new n.ShaderMaterial({
  54048. uniforms: b,
  54049. vertexShader: E.vertexShader,
  54050. fragmentShader: E.fragmentShader,
  54051. morphTargets: x,
  54052. skinning: S
  54053. });
  54054. v[T] = M;
  54055. var R = new n.ShaderMaterial({
  54056. defines: {
  54057. USE_SHADOWMAP: ""
  54058. },
  54059. uniforms: _,
  54060. vertexShader: w.vertexShader,
  54061. fragmentShader: w.fragmentShader,
  54062. morphTargets: x,
  54063. skinning: S
  54064. });
  54065. A[T] = R
  54066. }
  54067. var P = this;
  54068. this.enabled = !1,
  54069. this.autoUpdate = !0,
  54070. this.needsUpdate = !1,
  54071. this.type = n.PCFShadowMap,
  54072. this.cullFace = n.CullFaceFront,
  54073. this.render = function(f, g) {
  54074. var m, v, A = t.shadows;
  54075. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  54076. s.clearColor(1, 1, 1, 1),
  54077. s.disable(a.BLEND),
  54078. s.enable(a.CULL_FACE),
  54079. a.frontFace(a.CCW),
  54080. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  54081. s.setDepthTest(!0),
  54082. s.setScissorTest(!1);
  54083. for (var E = 0, b = A.length; E < b; E++) {
  54084. var w = A[E]
  54085. , _ = w.shadow
  54086. , T = _.camera;
  54087. if (h.copy(_.mapSize),
  54088. w instanceof n.PointLight) {
  54089. m = 6,
  54090. v = !0;
  54091. var x = h.x
  54092. , S = h.y;
  54093. I[0].set(2 * x, S, x, S),
  54094. I[1].set(0, S, x, S),
  54095. I[2].set(3 * x, S, x, S),
  54096. I[3].set(x, S, x, S),
  54097. I[4].set(3 * x, 0, x, S),
  54098. I[5].set(x, 0, x, S),
  54099. h.x *= 4,
  54100. h.y *= 2
  54101. } else
  54102. m = 1,
  54103. v = !1;
  54104. if (null === _.map) {
  54105. var M = {
  54106. minFilter: n.NearestFilter,
  54107. magFilter: n.NearestFilter,
  54108. format: n.RGBAFormat
  54109. };
  54110. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  54111. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  54112. T.updateProjectionMatrix()
  54113. }
  54114. var R = _.map
  54115. , O = _.matrix;
  54116. d.setFromMatrixPosition(w.matrixWorld),
  54117. T.position.copy(d),
  54118. e.setRenderTarget(R),
  54119. e.clear();
  54120. for (var L = 0; L < m; L++) {
  54121. if (v) {
  54122. u.copy(T.position),
  54123. u.add(y[L]),
  54124. T.up.copy(C[L]),
  54125. T.lookAt(u);
  54126. var D = I[L];
  54127. s.viewport(D)
  54128. } else
  54129. u.setFromMatrixPosition(w.target.matrixWorld),
  54130. T.lookAt(u);
  54131. T.updateMatrixWorld(),
  54132. T.matrixWorldInverse.getInverse(T.matrixWorld),
  54133. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  54134. O.multiply(T.projectionMatrix),
  54135. O.multiply(T.matrixWorldInverse),
  54136. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  54137. l.setFromMatrix(c),
  54138. p.length = 0,
  54139. o(f, g, T);
  54140. for (var N = 0, B = p.length; N < B; N++) {
  54141. var F = p[N]
  54142. , V = i.update(F)
  54143. , U = F.material;
  54144. if (U instanceof n.MultiMaterial)
  54145. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  54146. var W = k[G]
  54147. , j = H[W.materialIndex];
  54148. if (j.visible === !0) {
  54149. var Y = r(F, j, v, d);
  54150. e.renderBufferDirect(T, null, V, Y, F, W)
  54151. }
  54152. }
  54153. else {
  54154. var Y = r(F, U, v, d);
  54155. e.renderBufferDirect(T, null, V, Y, F, null)
  54156. }
  54157. }
  54158. }
  54159. }
  54160. var X = e.getClearColor()
  54161. , Z = e.getClearAlpha();
  54162. e.setClearColor(X, Z),
  54163. s.enable(a.BLEND),
  54164. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  54165. P.needsUpdate = !1
  54166. }
  54167. }
  54168. }
  54169. ,
  54170. n.WebGLState = function(e, t, i) {
  54171. var r = this
  54172. , o = new n.Vector4
  54173. , a = new Uint8Array(16)
  54174. , s = new Uint8Array(16)
  54175. , l = new Uint8Array(16)
  54176. , c = {}
  54177. , h = null
  54178. , u = null
  54179. , d = null
  54180. , p = null
  54181. , f = null
  54182. , g = null
  54183. , m = null
  54184. , v = null
  54185. , A = !1
  54186. , y = null
  54187. , C = null
  54188. , I = null
  54189. , E = null
  54190. , b = null
  54191. , w = null
  54192. , _ = null
  54193. , T = null
  54194. , x = null
  54195. , S = null
  54196. , M = null
  54197. , R = null
  54198. , P = null
  54199. , O = null
  54200. , L = null
  54201. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  54202. , N = void 0
  54203. , B = {}
  54204. , F = new n.Vector4
  54205. , V = null
  54206. , U = null
  54207. , k = new n.Vector4
  54208. , H = new n.Vector4
  54209. , G = e.createTexture();
  54210. e.bindTexture(e.TEXTURE_2D, G),
  54211. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  54212. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  54213. this.init = function() {
  54214. this.clearColor(0, 0, 0, 1),
  54215. this.clearDepth(1),
  54216. this.clearStencil(0),
  54217. this.enable(e.DEPTH_TEST),
  54218. e.depthFunc(e.LEQUAL),
  54219. e.frontFace(e.CCW),
  54220. e.cullFace(e.BACK),
  54221. this.enable(e.CULL_FACE),
  54222. this.enable(e.BLEND),
  54223. e.blendEquation(e.FUNC_ADD),
  54224. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  54225. }
  54226. ,
  54227. this.initAttributes = function() {
  54228. for (var e = 0, t = a.length; e < t; e++)
  54229. a[e] = 0
  54230. }
  54231. ,
  54232. this.enableAttribute = function(i) {
  54233. if (a[i] = 1,
  54234. 0 === s[i] && (e.enableVertexAttribArray(i),
  54235. s[i] = 1),
  54236. 0 !== l[i]) {
  54237. var n = t.get("ANGLE_instanced_arrays");
  54238. n.vertexAttribDivisorANGLE(i, 0),
  54239. l[i] = 0
  54240. }
  54241. }
  54242. ,
  54243. this.enableAttributeAndDivisor = function(t, i, n) {
  54244. a[t] = 1,
  54245. 0 === s[t] && (e.enableVertexAttribArray(t),
  54246. s[t] = 1),
  54247. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  54248. l[t] = i)
  54249. }
  54250. ,
  54251. this.disableUnusedAttributes = function() {
  54252. for (var t = 0, i = s.length; t < i; t++)
  54253. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  54254. s[t] = 0)
  54255. }
  54256. ,
  54257. this.enable = function(t) {
  54258. c[t] !== !0 && (e.enable(t),
  54259. c[t] = !0)
  54260. }
  54261. ,
  54262. this.disable = function(t) {
  54263. c[t] !== !1 && (e.disable(t),
  54264. c[t] = !1)
  54265. }
  54266. ,
  54267. this.getCompressedTextureFormats = function() {
  54268. if (null === h && (h = [],
  54269. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  54270. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  54271. h.push(i[n]);
  54272. return h
  54273. }
  54274. ,
  54275. this.setBlending = function(t, r, o, a, s, l, c, h) {
  54276. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  54277. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54278. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  54279. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54280. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  54281. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54282. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  54283. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54284. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54285. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  54286. u = t,
  54287. A = h),
  54288. t === n.CustomBlending ? (s = s || r,
  54289. l = l || o,
  54290. c = c || a,
  54291. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  54292. d = r,
  54293. g = s),
  54294. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  54295. p = o,
  54296. f = a,
  54297. m = l,
  54298. v = c)) : (d = null,
  54299. p = null,
  54300. f = null,
  54301. g = null,
  54302. m = null,
  54303. v = null)
  54304. }
  54305. ,
  54306. this.setDepthFunc = function(t) {
  54307. if (y !== t) {
  54308. if (t)
  54309. switch (t) {
  54310. case n.NeverDepth:
  54311. e.depthFunc(e.NEVER);
  54312. break;
  54313. case n.AlwaysDepth:
  54314. e.depthFunc(e.ALWAYS);
  54315. break;
  54316. case n.LessDepth:
  54317. e.depthFunc(e.LESS);
  54318. break;
  54319. case n.LessEqualDepth:
  54320. e.depthFunc(e.LEQUAL);
  54321. break;
  54322. case n.EqualDepth:
  54323. e.depthFunc(e.EQUAL);
  54324. break;
  54325. case n.GreaterEqualDepth:
  54326. e.depthFunc(e.GEQUAL);
  54327. break;
  54328. case n.GreaterDepth:
  54329. e.depthFunc(e.GREATER);
  54330. break;
  54331. case n.NotEqualDepth:
  54332. e.depthFunc(e.NOTEQUAL);
  54333. break;
  54334. default:
  54335. e.depthFunc(e.LEQUAL)
  54336. }
  54337. else
  54338. e.depthFunc(e.LEQUAL);
  54339. y = t
  54340. }
  54341. }
  54342. ,
  54343. this.setDepthTest = function(t) {
  54344. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  54345. }
  54346. ,
  54347. this.setDepthWrite = function(t) {
  54348. C !== t && (e.depthMask(t),
  54349. C = t)
  54350. }
  54351. ,
  54352. this.setColorWrite = function(t) {
  54353. I !== t && (e.colorMask(t, t, t, t),
  54354. I = t)
  54355. }
  54356. ,
  54357. this.setStencilFunc = function(t, i, n) {
  54358. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  54359. b = t,
  54360. w = i,
  54361. _ = n)
  54362. }
  54363. ,
  54364. this.setStencilOp = function(t, i, n) {
  54365. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  54366. T = t,
  54367. x = i,
  54368. S = n)
  54369. }
  54370. ,
  54371. this.setStencilTest = function(t) {
  54372. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  54373. }
  54374. ,
  54375. this.setStencilWrite = function(t) {
  54376. E !== t && (e.stencilMask(t),
  54377. E = t)
  54378. }
  54379. ,
  54380. this.setFlipSided = function(t) {
  54381. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  54382. M = t)
  54383. }
  54384. ,
  54385. this.setLineWidth = function(t) {
  54386. t !== R && (e.lineWidth(t),
  54387. R = t)
  54388. }
  54389. ,
  54390. this.setPolygonOffset = function(t, i, n) {
  54391. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  54392. !t || P === i && O === n || (e.polygonOffset(i, n),
  54393. P = i,
  54394. O = n)
  54395. }
  54396. ,
  54397. this.getScissorTest = function() {
  54398. return L
  54399. }
  54400. ,
  54401. this.setScissorTest = function(t) {
  54402. L = t,
  54403. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  54404. }
  54405. ,
  54406. this.activeTexture = function(t) {
  54407. void 0 === t && (t = e.TEXTURE0 + D - 1),
  54408. N !== t && (e.activeTexture(t),
  54409. N = t)
  54410. }
  54411. ,
  54412. this.bindTexture = function(t, i) {
  54413. void 0 === N && r.activeTexture();
  54414. var n = B[N];
  54415. void 0 === n && (n = {
  54416. type: void 0,
  54417. texture: void 0
  54418. },
  54419. B[N] = n),
  54420. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  54421. n.type = t,
  54422. n.texture = i)
  54423. }
  54424. ,
  54425. this.compressedTexImage2D = function() {
  54426. try {
  54427. e.compressedTexImage2D.apply(e, arguments)
  54428. } catch (e) {
  54429. console.error(e)
  54430. }
  54431. }
  54432. ,
  54433. this.texImage2D = function() {
  54434. try {
  54435. e.texImage2D.apply(e, arguments)
  54436. } catch (e) {
  54437. console.error(e)
  54438. }
  54439. }
  54440. ,
  54441. this.clearColor = function(t, i, n, r) {
  54442. o.set(t, i, n, r),
  54443. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  54444. F.copy(o))
  54445. }
  54446. ,
  54447. this.clearDepth = function(t) {
  54448. V !== t && (e.clearDepth(t),
  54449. V = t)
  54450. }
  54451. ,
  54452. this.clearStencil = function(t) {
  54453. U !== t && (e.clearStencil(t),
  54454. U = t)
  54455. }
  54456. ,
  54457. this.scissor = function(t) {
  54458. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  54459. k.copy(t))
  54460. }
  54461. ,
  54462. this.viewport = function(t) {
  54463. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  54464. H.copy(t))
  54465. }
  54466. ,
  54467. this.reset = function() {
  54468. for (var t = 0; t < s.length; t++)
  54469. 1 === s[t] && (e.disableVertexAttribArray(t),
  54470. s[t] = 0);
  54471. c = {},
  54472. h = null,
  54473. N = void 0,
  54474. B = {},
  54475. u = null,
  54476. I = null,
  54477. C = null,
  54478. E = null,
  54479. M = null
  54480. }
  54481. }
  54482. ,
  54483. n.LensFlarePlugin = function(e, t) {
  54484. function i() {
  54485. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  54486. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54487. o = p.createBuffer(),
  54488. a = p.createBuffer(),
  54489. p.bindBuffer(p.ARRAY_BUFFER, o),
  54490. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  54491. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54492. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  54493. u = p.createTexture(),
  54494. d = p.createTexture(),
  54495. f.bindTexture(p.TEXTURE_2D, u),
  54496. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  54497. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54498. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54499. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54500. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54501. f.bindTexture(p.TEXTURE_2D, d),
  54502. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  54503. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54504. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54505. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54506. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54507. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  54508. var i;
  54509. i = h ? {
  54510. 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"),
  54511. 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")
  54512. } : {
  54513. 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"),
  54514. 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")
  54515. },
  54516. s = r(i),
  54517. l = {
  54518. vertex: p.getAttribLocation(s, "position"),
  54519. uv: p.getAttribLocation(s, "uv")
  54520. },
  54521. c = {
  54522. renderType: p.getUniformLocation(s, "renderType"),
  54523. map: p.getUniformLocation(s, "map"),
  54524. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  54525. opacity: p.getUniformLocation(s, "opacity"),
  54526. color: p.getUniformLocation(s, "color"),
  54527. scale: p.getUniformLocation(s, "scale"),
  54528. rotation: p.getUniformLocation(s, "rotation"),
  54529. screenPosition: p.getUniformLocation(s, "screenPosition")
  54530. }
  54531. }
  54532. function r(t) {
  54533. var i = p.createProgram()
  54534. , n = p.createShader(p.FRAGMENT_SHADER)
  54535. , r = p.createShader(p.VERTEX_SHADER)
  54536. , o = "precision " + e.getPrecision() + " float;\n";
  54537. return p.shaderSource(n, o + t.fragmentShader),
  54538. p.shaderSource(r, o + t.vertexShader),
  54539. p.compileShader(n),
  54540. p.compileShader(r),
  54541. p.attachShader(i, n),
  54542. p.attachShader(i, r),
  54543. p.linkProgram(i),
  54544. i
  54545. }
  54546. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  54547. this.render = function(r, g, m) {
  54548. if (0 !== t.length) {
  54549. var v = new n.Vector3
  54550. , A = m.w / m.z
  54551. , y = .5 * m.z
  54552. , C = .5 * m.w
  54553. , I = 16 / m.w
  54554. , E = new n.Vector2(I * A,I)
  54555. , b = new n.Vector3(1,1,0)
  54556. , w = new n.Vector2(1,1);
  54557. void 0 === s && i(),
  54558. p.useProgram(s),
  54559. f.initAttributes(),
  54560. f.enableAttribute(l.vertex),
  54561. f.enableAttribute(l.uv),
  54562. f.disableUnusedAttributes(),
  54563. p.uniform1i(c.occlusionMap, 0),
  54564. p.uniform1i(c.map, 1),
  54565. p.bindBuffer(p.ARRAY_BUFFER, o),
  54566. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  54567. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  54568. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54569. f.disable(p.CULL_FACE),
  54570. f.setDepthWrite(!1);
  54571. for (var _ = 0, T = t.length; _ < T; _++) {
  54572. I = 16 / m.w,
  54573. E.set(I * A, I);
  54574. var x = t[_];
  54575. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  54576. v.applyMatrix4(g.matrixWorldInverse),
  54577. v.applyProjection(g.projectionMatrix),
  54578. b.copy(v),
  54579. w.x = b.x * y + y,
  54580. w.y = b.y * C + C,
  54581. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  54582. f.activeTexture(p.TEXTURE0),
  54583. f.bindTexture(p.TEXTURE_2D, null),
  54584. f.activeTexture(p.TEXTURE1),
  54585. f.bindTexture(p.TEXTURE_2D, u),
  54586. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54587. p.uniform1i(c.renderType, 0),
  54588. p.uniform2f(c.scale, E.x, E.y),
  54589. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54590. f.disable(p.BLEND),
  54591. f.enable(p.DEPTH_TEST),
  54592. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54593. f.activeTexture(p.TEXTURE0),
  54594. f.bindTexture(p.TEXTURE_2D, d),
  54595. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54596. p.uniform1i(c.renderType, 1),
  54597. f.disable(p.DEPTH_TEST),
  54598. f.activeTexture(p.TEXTURE1),
  54599. f.bindTexture(p.TEXTURE_2D, u),
  54600. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54601. x.positionScreen.copy(b),
  54602. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  54603. p.uniform1i(c.renderType, 2),
  54604. f.enable(p.BLEND);
  54605. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  54606. var R = x.lensFlares[S];
  54607. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  54608. b.y = R.y,
  54609. b.z = R.z,
  54610. I = R.size * R.scale / m.w,
  54611. E.x = I * A,
  54612. E.y = I,
  54613. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54614. p.uniform2f(c.scale, E.x, E.y),
  54615. p.uniform1f(c.rotation, R.rotation),
  54616. p.uniform1f(c.opacity, R.opacity),
  54617. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  54618. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  54619. e.setTexture(R.texture, 1),
  54620. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  54621. }
  54622. }
  54623. }
  54624. f.enable(p.CULL_FACE),
  54625. f.enable(p.DEPTH_TEST),
  54626. f.setDepthWrite(!0),
  54627. e.resetGLState()
  54628. }
  54629. }
  54630. }
  54631. ,
  54632. n.SpritePlugin = function(e, t) {
  54633. function i() {
  54634. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  54635. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54636. a = d.createBuffer(),
  54637. s = d.createBuffer(),
  54638. d.bindBuffer(d.ARRAY_BUFFER, a),
  54639. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  54640. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54641. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  54642. l = r(),
  54643. c = {
  54644. position: d.getAttribLocation(l, "position"),
  54645. uv: d.getAttribLocation(l, "uv")
  54646. },
  54647. h = {
  54648. uvOffset: d.getUniformLocation(l, "uvOffset"),
  54649. uvScale: d.getUniformLocation(l, "uvScale"),
  54650. rotation: d.getUniformLocation(l, "rotation"),
  54651. scale: d.getUniformLocation(l, "scale"),
  54652. color: d.getUniformLocation(l, "color"),
  54653. map: d.getUniformLocation(l, "map"),
  54654. opacity: d.getUniformLocation(l, "opacity"),
  54655. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  54656. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  54657. fogType: d.getUniformLocation(l, "fogType"),
  54658. fogDensity: d.getUniformLocation(l, "fogDensity"),
  54659. fogNear: d.getUniformLocation(l, "fogNear"),
  54660. fogFar: d.getUniformLocation(l, "fogFar"),
  54661. fogColor: d.getUniformLocation(l, "fogColor"),
  54662. alphaTest: d.getUniformLocation(l, "alphaTest")
  54663. };
  54664. var i = document.createElement("canvas");
  54665. i.width = 8,
  54666. i.height = 8;
  54667. var o = i.getContext("2d");
  54668. o.fillStyle = "white",
  54669. o.fillRect(0, 0, 8, 8),
  54670. u = new n.Texture(i),
  54671. u.needsUpdate = !0
  54672. }
  54673. function r() {
  54674. var t = d.createProgram()
  54675. , i = d.createShader(d.VERTEX_SHADER)
  54676. , n = d.createShader(d.FRAGMENT_SHADER);
  54677. 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")),
  54678. 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")),
  54679. d.compileShader(i),
  54680. d.compileShader(n),
  54681. d.attachShader(t, i),
  54682. d.attachShader(t, n),
  54683. d.linkProgram(t),
  54684. t
  54685. }
  54686. function o(e, t) {
  54687. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54688. }
  54689. 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;
  54690. this.render = function(r, v) {
  54691. if (0 !== t.length) {
  54692. void 0 === l && i(),
  54693. d.useProgram(l),
  54694. p.initAttributes(),
  54695. p.enableAttribute(c.position),
  54696. p.enableAttribute(c.uv),
  54697. p.disableUnusedAttributes(),
  54698. p.disable(d.CULL_FACE),
  54699. p.enable(d.BLEND),
  54700. d.bindBuffer(d.ARRAY_BUFFER, a),
  54701. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54702. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54703. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54704. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54705. p.activeTexture(d.TEXTURE0),
  54706. d.uniform1i(h.map, 0);
  54707. var A = 0
  54708. , y = 0
  54709. , C = r.fog;
  54710. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54711. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54712. d.uniform1f(h.fogFar, C.far),
  54713. d.uniform1i(h.fogType, 1),
  54714. A = 1,
  54715. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54716. d.uniform1i(h.fogType, 2),
  54717. A = 2,
  54718. y = 2)) : (d.uniform1i(h.fogType, 0),
  54719. A = 0,
  54720. y = 0);
  54721. for (var I = 0, E = t.length; I < E; I++) {
  54722. var b = t[I];
  54723. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54724. b.z = -b.modelViewMatrix.elements[14]
  54725. }
  54726. t.sort(o);
  54727. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54728. var b = t[I]
  54729. , _ = b.material;
  54730. d.uniform1f(h.alphaTest, _.alphaTest),
  54731. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54732. b.matrixWorld.decompose(f, g, m),
  54733. w[0] = m.x,
  54734. w[1] = m.y;
  54735. var T = 0;
  54736. r.fog && _.fog && (T = y),
  54737. A !== T && (d.uniform1i(h.fogType, T),
  54738. A = T),
  54739. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54740. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54741. d.uniform2f(h.uvScale, 1, 1)),
  54742. d.uniform1f(h.opacity, _.opacity),
  54743. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54744. d.uniform1f(h.rotation, _.rotation),
  54745. d.uniform2fv(h.scale, w),
  54746. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54747. p.setDepthTest(_.depthTest),
  54748. p.setDepthWrite(_.depthWrite),
  54749. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54750. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54751. }
  54752. p.enable(d.CULL_FACE),
  54753. e.resetGLState()
  54754. }
  54755. }
  54756. }
  54757. ,
  54758. Object.defineProperties(n.Box2.prototype, {
  54759. empty: {
  54760. value: function() {
  54761. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54762. this.isEmpty()
  54763. }
  54764. },
  54765. isIntersectionBox: {
  54766. value: function(e) {
  54767. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54768. this.intersectsBox(e)
  54769. }
  54770. }
  54771. }),
  54772. Object.defineProperties(n.Box3.prototype, {
  54773. empty: {
  54774. value: function() {
  54775. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54776. this.isEmpty()
  54777. }
  54778. },
  54779. isIntersectionBox: {
  54780. value: function(e) {
  54781. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54782. this.intersectsBox(e)
  54783. }
  54784. },
  54785. isIntersectionSphere: {
  54786. value: function(e) {
  54787. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54788. this.intersectsSphere(e)
  54789. }
  54790. }
  54791. }),
  54792. Object.defineProperties(n.Matrix3.prototype, {
  54793. multiplyVector3: {
  54794. value: function(e) {
  54795. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54796. e.applyMatrix3(this)
  54797. }
  54798. },
  54799. multiplyVector3Array: {
  54800. value: function(e) {
  54801. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54802. this.applyToVector3Array(e)
  54803. }
  54804. }
  54805. }),
  54806. Object.defineProperties(n.Matrix4.prototype, {
  54807. extractPosition: {
  54808. value: function(e) {
  54809. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54810. this.copyPosition(e)
  54811. }
  54812. },
  54813. setRotationFromQuaternion: {
  54814. value: function(e) {
  54815. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54816. this.makeRotationFromQuaternion(e)
  54817. }
  54818. },
  54819. multiplyVector3: {
  54820. value: function(e) {
  54821. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54822. e.applyProjection(this)
  54823. }
  54824. },
  54825. multiplyVector4: {
  54826. value: function(e) {
  54827. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54828. e.applyMatrix4(this)
  54829. }
  54830. },
  54831. multiplyVector3Array: {
  54832. value: function(e) {
  54833. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54834. this.applyToVector3Array(e)
  54835. }
  54836. },
  54837. rotateAxis: {
  54838. value: function(e) {
  54839. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54840. e.transformDirection(this)
  54841. }
  54842. },
  54843. crossVector: {
  54844. value: function(e) {
  54845. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54846. e.applyMatrix4(this)
  54847. }
  54848. },
  54849. translate: {
  54850. value: function(e) {
  54851. console.error("THREE.Matrix4: .translate() has been removed.")
  54852. }
  54853. },
  54854. rotateX: {
  54855. value: function(e) {
  54856. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54857. }
  54858. },
  54859. rotateY: {
  54860. value: function(e) {
  54861. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54862. }
  54863. },
  54864. rotateZ: {
  54865. value: function(e) {
  54866. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54867. }
  54868. },
  54869. rotateByAxis: {
  54870. value: function(e, t) {
  54871. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54872. }
  54873. }
  54874. }),
  54875. Object.defineProperties(n.Plane.prototype, {
  54876. isIntersectionLine: {
  54877. value: function(e) {
  54878. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54879. this.intersectsLine(e)
  54880. }
  54881. }
  54882. }),
  54883. Object.defineProperties(n.Quaternion.prototype, {
  54884. multiplyVector3: {
  54885. value: function(e) {
  54886. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54887. e.applyQuaternion(this)
  54888. }
  54889. }
  54890. }),
  54891. Object.defineProperties(n.Ray.prototype, {
  54892. isIntersectionBox: {
  54893. value: function(e) {
  54894. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54895. this.intersectsBox(e)
  54896. }
  54897. },
  54898. isIntersectionPlane: {
  54899. value: function(e) {
  54900. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54901. this.intersectsPlane(e)
  54902. }
  54903. },
  54904. isIntersectionSphere: {
  54905. value: function(e) {
  54906. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54907. this.intersectsSphere(e)
  54908. }
  54909. }
  54910. }),
  54911. Object.defineProperties(n.Vector3.prototype, {
  54912. setEulerFromRotationMatrix: {
  54913. value: function() {
  54914. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54915. }
  54916. },
  54917. setEulerFromQuaternion: {
  54918. value: function() {
  54919. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54920. }
  54921. },
  54922. getPositionFromMatrix: {
  54923. value: function(e) {
  54924. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54925. this.setFromMatrixPosition(e)
  54926. }
  54927. },
  54928. getScaleFromMatrix: {
  54929. value: function(e) {
  54930. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54931. this.setFromMatrixScale(e)
  54932. }
  54933. },
  54934. getColumnFromMatrix: {
  54935. value: function(e, t) {
  54936. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54937. this.setFromMatrixColumn(e, t)
  54938. }
  54939. }
  54940. }),
  54941. n.Face4 = function(e, t, i, r, o, a, s) {
  54942. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54943. new n.Face3(e,t,i,o,a,s)
  54944. }
  54945. ,
  54946. n.Vertex = function(e, t, i) {
  54947. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54948. new n.Vector3(e,t,i)
  54949. }
  54950. ,
  54951. Object.defineProperties(n.Object3D.prototype, {
  54952. eulerOrder: {
  54953. get: function() {
  54954. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54955. this.rotation.order
  54956. },
  54957. set: function(e) {
  54958. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54959. this.rotation.order = e
  54960. }
  54961. },
  54962. getChildByName: {
  54963. value: function(e) {
  54964. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54965. this.getObjectByName(e)
  54966. }
  54967. },
  54968. renderDepth: {
  54969. set: function(e) {
  54970. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54971. }
  54972. },
  54973. translate: {
  54974. value: function(e, t) {
  54975. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54976. this.translateOnAxis(t, e)
  54977. }
  54978. },
  54979. useQuaternion: {
  54980. get: function() {
  54981. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54982. },
  54983. set: function(e) {
  54984. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54985. }
  54986. }
  54987. }),
  54988. Object.defineProperties(n, {
  54989. PointCloud: {
  54990. value: function(e, t) {
  54991. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54992. new n.Points(e,t)
  54993. }
  54994. },
  54995. ParticleSystem: {
  54996. value: function(e, t) {
  54997. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54998. new n.Points(e,t)
  54999. }
  55000. }
  55001. }),
  55002. Object.defineProperties(n.Light.prototype, {
  55003. onlyShadow: {
  55004. set: function(e) {
  55005. console.warn("THREE.Light: .onlyShadow has been removed.")
  55006. }
  55007. },
  55008. shadowCameraFov: {
  55009. set: function(e) {
  55010. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  55011. this.shadow.camera.fov = e
  55012. }
  55013. },
  55014. shadowCameraLeft: {
  55015. set: function(e) {
  55016. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  55017. this.shadow.camera.left = e
  55018. }
  55019. },
  55020. shadowCameraRight: {
  55021. set: function(e) {
  55022. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  55023. this.shadow.camera.right = e
  55024. }
  55025. },
  55026. shadowCameraTop: {
  55027. set: function(e) {
  55028. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  55029. this.shadow.camera.top = e
  55030. }
  55031. },
  55032. shadowCameraBottom: {
  55033. set: function(e) {
  55034. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  55035. this.shadow.camera.bottom = e
  55036. }
  55037. },
  55038. shadowCameraNear: {
  55039. set: function(e) {
  55040. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  55041. this.shadow.camera.near = e
  55042. }
  55043. },
  55044. shadowCameraFar: {
  55045. set: function(e) {
  55046. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  55047. this.shadow.camera.far = e
  55048. }
  55049. },
  55050. shadowCameraVisible: {
  55051. set: function(e) {
  55052. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  55053. }
  55054. },
  55055. shadowBias: {
  55056. set: function(e) {
  55057. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  55058. this.shadow.bias = e
  55059. }
  55060. },
  55061. shadowDarkness: {
  55062. set: function(e) {
  55063. console.warn("THREE.Light: .shadowDarkness has been removed.")
  55064. }
  55065. },
  55066. shadowMapWidth: {
  55067. set: function(e) {
  55068. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  55069. this.shadow.mapSize.width = e
  55070. }
  55071. },
  55072. shadowMapHeight: {
  55073. set: function(e) {
  55074. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  55075. this.shadow.mapSize.height = e
  55076. }
  55077. }
  55078. }),
  55079. Object.defineProperties(n.BufferAttribute.prototype, {
  55080. length: {
  55081. get: function() {
  55082. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  55083. this.array.length
  55084. }
  55085. }
  55086. }),
  55087. Object.defineProperties(n.BufferGeometry.prototype, {
  55088. drawcalls: {
  55089. get: function() {
  55090. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  55091. this.groups
  55092. }
  55093. },
  55094. offsets: {
  55095. get: function() {
  55096. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  55097. this.groups
  55098. }
  55099. },
  55100. addIndex: {
  55101. value: function(e) {
  55102. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  55103. this.setIndex(e)
  55104. }
  55105. },
  55106. addDrawCall: {
  55107. value: function(e, t, i) {
  55108. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  55109. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  55110. this.addGroup(e, t)
  55111. }
  55112. },
  55113. clearDrawCalls: {
  55114. value: function() {
  55115. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  55116. this.clearGroups()
  55117. }
  55118. },
  55119. computeTangents: {
  55120. value: function() {
  55121. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  55122. }
  55123. },
  55124. computeOffsets: {
  55125. value: function() {
  55126. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  55127. }
  55128. }
  55129. }),
  55130. Object.defineProperties(n.Material.prototype, {
  55131. wrapAround: {
  55132. get: function() {
  55133. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  55134. },
  55135. set: function(e) {
  55136. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  55137. }
  55138. },
  55139. wrapRGB: {
  55140. get: function() {
  55141. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  55142. new n.Color
  55143. }
  55144. }
  55145. }),
  55146. Object.defineProperties(n, {
  55147. PointCloudMaterial: {
  55148. value: function(e) {
  55149. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  55150. new n.PointsMaterial(e)
  55151. }
  55152. },
  55153. ParticleBasicMaterial: {
  55154. value: function(e) {
  55155. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  55156. new n.PointsMaterial(e)
  55157. }
  55158. },
  55159. ParticleSystemMaterial: {
  55160. value: function(e) {
  55161. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  55162. new n.PointsMaterial(e)
  55163. }
  55164. }
  55165. }),
  55166. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  55167. metal: {
  55168. get: function() {
  55169. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  55170. !1
  55171. },
  55172. set: function(e) {
  55173. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  55174. }
  55175. }
  55176. }),
  55177. Object.defineProperties(n.ShaderMaterial.prototype, {
  55178. derivatives: {
  55179. get: function() {
  55180. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  55181. this.extensions.derivatives
  55182. },
  55183. set: function(e) {
  55184. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  55185. this.extensions.derivatives = e
  55186. }
  55187. }
  55188. }),
  55189. Object.defineProperties(n.WebGLRenderer.prototype, {
  55190. supportsFloatTextures: {
  55191. value: function() {
  55192. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  55193. this.extensions.get("OES_texture_float")
  55194. }
  55195. },
  55196. supportsHalfFloatTextures: {
  55197. value: function() {
  55198. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  55199. this.extensions.get("OES_texture_half_float")
  55200. }
  55201. },
  55202. supportsStandardDerivatives: {
  55203. value: function() {
  55204. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  55205. this.extensions.get("OES_standard_derivatives")
  55206. }
  55207. },
  55208. supportsCompressedTextureS3TC: {
  55209. value: function() {
  55210. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  55211. this.extensions.get("WEBGL_compressed_texture_s3tc")
  55212. }
  55213. },
  55214. supportsCompressedTexturePVRTC: {
  55215. value: function() {
  55216. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  55217. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  55218. }
  55219. },
  55220. supportsBlendMinMax: {
  55221. value: function() {
  55222. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  55223. this.extensions.get("EXT_blend_minmax")
  55224. }
  55225. },
  55226. supportsVertexTextures: {
  55227. value: function() {
  55228. return this.capabilities.vertexTextures
  55229. }
  55230. },
  55231. supportsInstancedArrays: {
  55232. value: function() {
  55233. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  55234. this.extensions.get("ANGLE_instanced_arrays")
  55235. }
  55236. },
  55237. enableScissorTest: {
  55238. value: function(e) {
  55239. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  55240. this.setScissorTest(e)
  55241. }
  55242. },
  55243. initMaterial: {
  55244. value: function() {
  55245. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  55246. }
  55247. },
  55248. addPrePlugin: {
  55249. value: function() {
  55250. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  55251. }
  55252. },
  55253. addPostPlugin: {
  55254. value: function() {
  55255. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  55256. }
  55257. },
  55258. updateShadowMap: {
  55259. value: function() {
  55260. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  55261. }
  55262. },
  55263. shadowMapEnabled: {
  55264. get: function() {
  55265. return this.shadowMap.enabled
  55266. },
  55267. set: function(e) {
  55268. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  55269. this.shadowMap.enabled = e
  55270. }
  55271. },
  55272. shadowMapType: {
  55273. get: function() {
  55274. return this.shadowMap.type
  55275. },
  55276. set: function(e) {
  55277. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  55278. this.shadowMap.type = e
  55279. }
  55280. },
  55281. shadowMapCullFace: {
  55282. get: function() {
  55283. return this.shadowMap.cullFace
  55284. },
  55285. set: function(e) {
  55286. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  55287. this.shadowMap.cullFace = e
  55288. }
  55289. }
  55290. }),
  55291. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  55292. wrapS: {
  55293. get: function() {
  55294. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  55295. this.texture.wrapS
  55296. },
  55297. set: function(e) {
  55298. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  55299. this.texture.wrapS = e
  55300. }
  55301. },
  55302. wrapT: {
  55303. get: function() {
  55304. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  55305. this.texture.wrapT
  55306. },
  55307. set: function(e) {
  55308. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  55309. this.texture.wrapT = e
  55310. }
  55311. },
  55312. magFilter: {
  55313. get: function() {
  55314. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  55315. this.texture.magFilter
  55316. },
  55317. set: function(e) {
  55318. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  55319. this.texture.magFilter = e
  55320. }
  55321. },
  55322. minFilter: {
  55323. get: function() {
  55324. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  55325. this.texture.minFilter
  55326. },
  55327. set: function(e) {
  55328. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  55329. this.texture.minFilter = e
  55330. }
  55331. },
  55332. anisotropy: {
  55333. get: function() {
  55334. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  55335. this.texture.anisotropy
  55336. },
  55337. set: function(e) {
  55338. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  55339. this.texture.anisotropy = e
  55340. }
  55341. },
  55342. offset: {
  55343. get: function() {
  55344. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  55345. this.texture.offset
  55346. },
  55347. set: function(e) {
  55348. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  55349. this.texture.offset = e
  55350. }
  55351. },
  55352. repeat: {
  55353. get: function() {
  55354. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  55355. this.texture.repeat
  55356. },
  55357. set: function(e) {
  55358. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  55359. this.texture.repeat = e
  55360. }
  55361. },
  55362. format: {
  55363. get: function() {
  55364. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  55365. this.texture.format
  55366. },
  55367. set: function(e) {
  55368. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  55369. this.texture.format = e
  55370. }
  55371. },
  55372. type: {
  55373. get: function() {
  55374. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  55375. this.texture.type
  55376. },
  55377. set: function(e) {
  55378. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  55379. this.texture.type = e
  55380. }
  55381. },
  55382. generateMipmaps: {
  55383. get: function() {
  55384. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55385. this.texture.generateMipmaps
  55386. },
  55387. set: function(e) {
  55388. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55389. this.texture.generateMipmaps = e
  55390. }
  55391. }
  55392. }),
  55393. n.GeometryUtils = {
  55394. merge: function(e, t, i) {
  55395. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  55396. var r;
  55397. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  55398. r = t.matrix,
  55399. t = t.geometry),
  55400. e.merge(t, r, i)
  55401. },
  55402. center: function(e) {
  55403. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  55404. e.center()
  55405. }
  55406. },
  55407. n.ImageUtils = {
  55408. crossOrigin: void 0,
  55409. loadTexture: function(e, t, i, r) {
  55410. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  55411. var o = new n.TextureLoader;
  55412. o.setCrossOrigin(this.crossOrigin);
  55413. var a = o.load(e, i, void 0, r);
  55414. return t && (a.mapping = t),
  55415. a
  55416. },
  55417. loadTextureCube: function(e, t, i, r) {
  55418. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  55419. var o = new n.CubeTextureLoader;
  55420. o.setCrossOrigin(this.crossOrigin);
  55421. var a = o.load(e, i, void 0, r);
  55422. return t && (a.mapping = t),
  55423. a
  55424. },
  55425. loadCompressedTexture: function() {
  55426. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  55427. },
  55428. loadCompressedTextureCube: function() {
  55429. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  55430. }
  55431. },
  55432. n.Projector = function() {
  55433. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  55434. this.projectVector = function(e, t) {
  55435. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  55436. e.project(t)
  55437. }
  55438. ,
  55439. this.unprojectVector = function(e, t) {
  55440. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  55441. e.unproject(t)
  55442. }
  55443. ,
  55444. this.pickingRay = function(e, t) {
  55445. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  55446. }
  55447. }
  55448. ,
  55449. n.CanvasRenderer = function() {
  55450. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  55451. this.domElement = document.createElement("canvas"),
  55452. this.clear = function() {}
  55453. ,
  55454. this.render = function() {}
  55455. ,
  55456. this.setClearColor = function() {}
  55457. ,
  55458. this.setSize = function() {}
  55459. }
  55460. ,
  55461. n.MeshFaceMaterial = n.MultiMaterial,
  55462. n.CurveUtils = {
  55463. tangentQuadraticBezier: function(e, t, i, n) {
  55464. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  55465. },
  55466. tangentCubicBezier: function(e, t, i, n, r) {
  55467. 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
  55468. },
  55469. tangentSpline: function(e, t, i, n, r) {
  55470. var o = 6 * e * e - 6 * e
  55471. , a = 3 * e * e - 4 * e + 1
  55472. , s = -6 * e * e + 6 * e
  55473. , l = 3 * e * e - 2 * e;
  55474. return o + a + s + l
  55475. },
  55476. interpolate: function(e, t, i, n, r) {
  55477. var o = .5 * (i - e)
  55478. , a = .5 * (n - t)
  55479. , s = r * r
  55480. , l = r * s;
  55481. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  55482. }
  55483. },
  55484. n.SceneUtils = {
  55485. createMultiMaterialObject: function(e, t) {
  55486. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  55487. i.add(new n.Mesh(e,t[r]));
  55488. return i
  55489. },
  55490. detach: function(e, t, i) {
  55491. e.applyMatrix(t.matrixWorld),
  55492. t.remove(e),
  55493. i.add(e)
  55494. },
  55495. attach: function(e, t, i) {
  55496. var r = new n.Matrix4;
  55497. r.getInverse(i.matrixWorld),
  55498. e.applyMatrix(r),
  55499. t.remove(e),
  55500. i.add(e)
  55501. }
  55502. },
  55503. n.ShapeUtils = {
  55504. area: function(e) {
  55505. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  55506. i += e[n].x * e[r].y - e[r].x * e[n].y;
  55507. return .5 * i
  55508. },
  55509. triangulate: function() {
  55510. function e(e, t, i, n, r, o) {
  55511. var a, s, l, c, h, u, d, p, f;
  55512. if (s = e[o[t]].x,
  55513. l = e[o[t]].y,
  55514. c = e[o[i]].x,
  55515. h = e[o[i]].y,
  55516. u = e[o[n]].x,
  55517. d = e[o[n]].y,
  55518. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  55519. return !1;
  55520. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  55521. for (g = u - c,
  55522. m = d - h,
  55523. v = s - u,
  55524. A = l - d,
  55525. y = c - s,
  55526. C = h - l,
  55527. a = 0; a < r; a++)
  55528. if (p = e[o[a]].x,
  55529. f = e[o[a]].y,
  55530. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  55531. E = f - l,
  55532. b = p - c,
  55533. w = f - h,
  55534. _ = p - u,
  55535. T = f - d,
  55536. M = g * w - m * b,
  55537. x = y * E - C * I,
  55538. S = v * T - A * _,
  55539. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  55540. return !1;
  55541. return !0
  55542. }
  55543. return function(t, i) {
  55544. var r = t.length;
  55545. if (r < 3)
  55546. return null;
  55547. var o, a, s, l = [], c = [], h = [];
  55548. if (n.ShapeUtils.area(t) > 0)
  55549. for (a = 0; a < r; a++)
  55550. c[a] = a;
  55551. else
  55552. for (a = 0; a < r; a++)
  55553. c[a] = r - 1 - a;
  55554. var u = r
  55555. , d = 2 * u;
  55556. for (a = u - 1; u > 2; ) {
  55557. if (d-- <= 0)
  55558. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  55559. i ? h : l;
  55560. if (o = a,
  55561. u <= o && (o = 0),
  55562. a = o + 1,
  55563. u <= a && (a = 0),
  55564. s = a + 1,
  55565. u <= s && (s = 0),
  55566. e(t, o, a, s, u, c)) {
  55567. var p, f, g, m, v;
  55568. for (p = c[o],
  55569. f = c[a],
  55570. g = c[s],
  55571. l.push([t[p], t[f], t[g]]),
  55572. h.push([c[o], c[a], c[s]]),
  55573. m = a,
  55574. v = a + 1; v < u; m++,
  55575. v++)
  55576. c[m] = c[v];
  55577. u--,
  55578. d = 2 * u
  55579. }
  55580. }
  55581. return i ? h : l
  55582. }
  55583. }(),
  55584. triangulateShape: function(e, t) {
  55585. function i(e, t, i) {
  55586. 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
  55587. }
  55588. function r(e, t, n, r, o) {
  55589. var a = t.x - e.x
  55590. , s = t.y - e.y
  55591. , l = r.x - n.x
  55592. , c = r.y - n.y
  55593. , h = e.x - n.x
  55594. , u = e.y - n.y
  55595. , d = s * l - a * c
  55596. , p = s * h - a * u;
  55597. if (Math.abs(d) > Number.EPSILON) {
  55598. var f;
  55599. if (d > 0) {
  55600. if (p < 0 || p > d)
  55601. return [];
  55602. if (f = c * h - l * u,
  55603. f < 0 || f > d)
  55604. return []
  55605. } else {
  55606. if (p > 0 || p < d)
  55607. return [];
  55608. if (f = c * h - l * u,
  55609. f > 0 || f < d)
  55610. return []
  55611. }
  55612. if (0 === f)
  55613. return !o || 0 !== p && p !== d ? [e] : [];
  55614. if (f === d)
  55615. return !o || 0 !== p && p !== d ? [t] : [];
  55616. if (0 === p)
  55617. return [n];
  55618. if (p === d)
  55619. return [r];
  55620. var g = f / d;
  55621. return [{
  55622. x: e.x + g * a,
  55623. y: e.y + g * s
  55624. }]
  55625. }
  55626. if (0 !== p || c * h !== l * u)
  55627. return [];
  55628. var m = 0 === a && 0 === s
  55629. , v = 0 === l && 0 === c;
  55630. if (m && v)
  55631. return e.x !== n.x || e.y !== n.y ? [] : [e];
  55632. if (m)
  55633. return i(n, r, e) ? [e] : [];
  55634. if (v)
  55635. return i(e, t, n) ? [n] : [];
  55636. var A, y, C, I, E, b, w, _;
  55637. return 0 !== a ? (e.x < t.x ? (A = e,
  55638. C = e.x,
  55639. y = t,
  55640. I = t.x) : (A = t,
  55641. C = t.x,
  55642. y = e,
  55643. I = e.x),
  55644. n.x < r.x ? (E = n,
  55645. w = n.x,
  55646. b = r,
  55647. _ = r.x) : (E = r,
  55648. w = r.x,
  55649. b = n,
  55650. _ = n.x)) : (e.y < t.y ? (A = e,
  55651. C = e.y,
  55652. y = t,
  55653. I = t.y) : (A = t,
  55654. C = t.y,
  55655. y = e,
  55656. I = e.y),
  55657. n.y < r.y ? (E = n,
  55658. w = n.y,
  55659. b = r,
  55660. _ = r.y) : (E = r,
  55661. w = r.y,
  55662. b = n,
  55663. _ = n.y)),
  55664. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55665. }
  55666. function o(e, t, i, n) {
  55667. var r = t.x - e.x
  55668. , o = t.y - e.y
  55669. , a = i.x - e.x
  55670. , s = i.y - e.y
  55671. , l = n.x - e.x
  55672. , c = n.y - e.y
  55673. , h = r * s - o * a
  55674. , u = r * c - o * l;
  55675. if (Math.abs(h) > Number.EPSILON) {
  55676. var d = l * s - c * a;
  55677. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55678. }
  55679. return u > 0
  55680. }
  55681. function a(e, t) {
  55682. function i(e, t) {
  55683. var i = A.length - 1
  55684. , n = e - 1;
  55685. n < 0 && (n = i);
  55686. var r = e + 1;
  55687. r > i && (r = 0);
  55688. var a = o(A[e], A[n], A[r], s[t]);
  55689. if (!a)
  55690. return !1;
  55691. var l = s.length - 1
  55692. , c = t - 1;
  55693. c < 0 && (c = l);
  55694. var h = t + 1;
  55695. return h > l && (h = 0),
  55696. a = o(s[t], s[c], s[h], A[e]),
  55697. !!a
  55698. }
  55699. function n(e, t) {
  55700. var i, n, o;
  55701. for (i = 0; i < A.length; i++)
  55702. if (n = i + 1,
  55703. n %= A.length,
  55704. o = r(e, t, A[i], A[n], !0),
  55705. o.length > 0)
  55706. return !0;
  55707. return !1
  55708. }
  55709. function a(e, i) {
  55710. var n, o, a, s, l;
  55711. for (n = 0; n < y.length; n++)
  55712. for (o = t[y[n]],
  55713. a = 0; a < o.length; a++)
  55714. if (s = a + 1,
  55715. s %= o.length,
  55716. l = r(e, i, o[a], o[s], !0),
  55717. l.length > 0)
  55718. return !0;
  55719. return !1
  55720. }
  55721. 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++)
  55722. y.push(I);
  55723. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55724. if (w--,
  55725. w < 0) {
  55726. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55727. break
  55728. }
  55729. for (c = b; c < A.length; c++) {
  55730. h = A[c],
  55731. l = -1;
  55732. for (var I = 0; I < y.length; I++)
  55733. if (d = y[I],
  55734. p = h.x + ":" + h.y + ":" + d,
  55735. void 0 === C[p]) {
  55736. s = t[d];
  55737. for (var _ = 0; _ < s.length; _++)
  55738. if (u = s[_],
  55739. i(c, _) && !n(h, u) && !a(h, u)) {
  55740. l = _,
  55741. y.splice(I, 1),
  55742. f = A.slice(0, c + 1),
  55743. g = A.slice(c),
  55744. m = s.slice(l),
  55745. v = s.slice(0, l + 1),
  55746. A = f.concat(m).concat(v).concat(g),
  55747. b = c;
  55748. break
  55749. }
  55750. if (l >= 0)
  55751. break;
  55752. C[p] = !0
  55753. }
  55754. if (l >= 0)
  55755. break
  55756. }
  55757. }
  55758. return A
  55759. }
  55760. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55761. Array.prototype.push.apply(f, t[g]);
  55762. for (s = 0,
  55763. l = f.length; s < l; s++)
  55764. u = f[s].x + ":" + f[s].y,
  55765. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55766. p[u] = s;
  55767. var v = a(e, t)
  55768. , A = n.ShapeUtils.triangulate(v, !1);
  55769. for (s = 0,
  55770. l = A.length; s < l; s++)
  55771. for (h = A[s],
  55772. c = 0; c < 3; c++)
  55773. u = h[c].x + ":" + h[c].y,
  55774. d = p[u],
  55775. void 0 !== d && (h[c] = d);
  55776. return A.concat()
  55777. },
  55778. isClockWise: function(e) {
  55779. return n.ShapeUtils.area(e) < 0
  55780. },
  55781. b2: function() {
  55782. function e(e, t) {
  55783. var i = 1 - e;
  55784. return i * i * t
  55785. }
  55786. function t(e, t) {
  55787. return 2 * (1 - e) * e * t
  55788. }
  55789. function i(e, t) {
  55790. return e * e * t
  55791. }
  55792. return function(n, r, o, a) {
  55793. return e(n, r) + t(n, o) + i(n, a)
  55794. }
  55795. }(),
  55796. b3: function() {
  55797. function e(e, t) {
  55798. var i = 1 - e;
  55799. return i * i * i * t
  55800. }
  55801. function t(e, t) {
  55802. var i = 1 - e;
  55803. return 3 * i * i * e * t
  55804. }
  55805. function i(e, t) {
  55806. var i = 1 - e;
  55807. return 3 * i * e * e * t
  55808. }
  55809. function n(e, t) {
  55810. return e * e * e * t
  55811. }
  55812. return function(r, o, a, s, l) {
  55813. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55814. }
  55815. }()
  55816. },
  55817. n.Curve = function() {}
  55818. ,
  55819. n.Curve.prototype = {
  55820. constructor: n.Curve,
  55821. getPoint: function(e) {
  55822. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55823. null
  55824. },
  55825. getPointAt: function(e) {
  55826. var t = this.getUtoTmapping(e);
  55827. return this.getPoint(t)
  55828. },
  55829. getPoints: function(e) {
  55830. e || (e = 5);
  55831. var t, i = [];
  55832. for (t = 0; t <= e; t++)
  55833. i.push(this.getPoint(t / e));
  55834. return i
  55835. },
  55836. getSpacedPoints: function(e) {
  55837. e || (e = 5);
  55838. var t, i = [];
  55839. for (t = 0; t <= e; t++)
  55840. i.push(this.getPointAt(t / e));
  55841. return i
  55842. },
  55843. getLength: function() {
  55844. var e = this.getLengths();
  55845. return e[e.length - 1]
  55846. },
  55847. getLengths: function(e) {
  55848. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55849. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55850. return this.cacheArcLengths;
  55851. this.needsUpdate = !1;
  55852. var t, i, n = [], r = this.getPoint(0), o = 0;
  55853. for (n.push(0),
  55854. i = 1; i <= e; i++)
  55855. t = this.getPoint(i / e),
  55856. o += t.distanceTo(r),
  55857. n.push(o),
  55858. r = t;
  55859. return this.cacheArcLengths = n,
  55860. n
  55861. },
  55862. updateArcLengths: function() {
  55863. this.needsUpdate = !0,
  55864. this.getLengths()
  55865. },
  55866. getUtoTmapping: function(e, t) {
  55867. var i, n = this.getLengths(), r = 0, o = n.length;
  55868. i = t ? t : e * n[o - 1];
  55869. for (var a, s = 0, l = o - 1; s <= l; )
  55870. if (r = Math.floor(s + (l - s) / 2),
  55871. a = n[r] - i,
  55872. a < 0)
  55873. s = r + 1;
  55874. else {
  55875. if (!(a > 0)) {
  55876. l = r;
  55877. break
  55878. }
  55879. l = r - 1
  55880. }
  55881. if (r = l,
  55882. n[r] === i) {
  55883. var c = r / (o - 1);
  55884. return c
  55885. }
  55886. var h = n[r]
  55887. , u = n[r + 1]
  55888. , d = u - h
  55889. , p = (i - h) / d
  55890. , c = (r + p) / (o - 1);
  55891. return c
  55892. },
  55893. getTangent: function(e) {
  55894. var t = 1e-4
  55895. , i = e - t
  55896. , n = e + t;
  55897. i < 0 && (i = 0),
  55898. n > 1 && (n = 1);
  55899. var r = this.getPoint(i)
  55900. , o = this.getPoint(n)
  55901. , a = o.clone().sub(r);
  55902. return a.normalize()
  55903. },
  55904. getTangentAt: function(e) {
  55905. var t = this.getUtoTmapping(e);
  55906. return this.getTangent(t)
  55907. }
  55908. },
  55909. n.Curve.create = function(e, t) {
  55910. return e.prototype = Object.create(n.Curve.prototype),
  55911. e.prototype.constructor = e,
  55912. e.prototype.getPoint = t,
  55913. e
  55914. }
  55915. ,
  55916. n.CurvePath = function() {
  55917. this.curves = [],
  55918. this.autoClose = !1
  55919. }
  55920. ,
  55921. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55922. n.CurvePath.prototype.constructor = n.CurvePath,
  55923. n.CurvePath.prototype.add = function(e) {
  55924. this.curves.push(e)
  55925. }
  55926. ,
  55927. n.CurvePath.prototype.closePath = function() {
  55928. var e = this.curves[0].getPoint(0)
  55929. , t = this.curves[this.curves.length - 1].getPoint(1);
  55930. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55931. }
  55932. ,
  55933. n.CurvePath.prototype.getPoint = function(e) {
  55934. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55935. if (i[n] >= t) {
  55936. var r = i[n] - t
  55937. , o = this.curves[n]
  55938. , a = 1 - r / o.getLength();
  55939. return o.getPointAt(a)
  55940. }
  55941. n++
  55942. }
  55943. return null
  55944. }
  55945. ,
  55946. n.CurvePath.prototype.getLength = function() {
  55947. var e = this.getCurveLengths();
  55948. return e[e.length - 1]
  55949. }
  55950. ,
  55951. n.CurvePath.prototype.getCurveLengths = function() {
  55952. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55953. return this.cacheLengths;
  55954. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55955. t += this.curves[i].getLength(),
  55956. e.push(t);
  55957. return this.cacheLengths = e,
  55958. e
  55959. }
  55960. ,
  55961. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55962. var t = this.getPoints(e);
  55963. return this.createGeometry(t)
  55964. }
  55965. ,
  55966. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55967. var t = this.getSpacedPoints(e);
  55968. return this.createGeometry(t)
  55969. }
  55970. ,
  55971. n.CurvePath.prototype.createGeometry = function(e) {
  55972. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55973. var o = e[i];
  55974. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55975. }
  55976. return t
  55977. }
  55978. ,
  55979. n.Font = function(e) {
  55980. this.data = e
  55981. }
  55982. ,
  55983. n.Font.prototype = {
  55984. constructor: n.Font,
  55985. generateShapes: function(e, t, i) {
  55986. function r(e) {
  55987. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55988. var c = o(i[l], n, r);
  55989. r += c.offset,
  55990. s.push(c.path)
  55991. }
  55992. return s
  55993. }
  55994. function o(e, t, r) {
  55995. var o = a.glyphs[e] || a.glyphs["?"];
  55996. if (o) {
  55997. 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;
  55998. if (o.o)
  55999. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  56000. var _ = E[b++];
  56001. switch (_) {
  56002. case "m":
  56003. s = E[b++] * t + r,
  56004. l = E[b++] * t,
  56005. A.moveTo(s, l);
  56006. break;
  56007. case "l":
  56008. s = E[b++] * t + r,
  56009. l = E[b++] * t,
  56010. A.lineTo(s, l);
  56011. break;
  56012. case "q":
  56013. if (c = E[b++] * t + r,
  56014. h = E[b++] * t,
  56015. p = E[b++] * t + r,
  56016. f = E[b++] * t,
  56017. A.quadraticCurveTo(p, f, c, h),
  56018. v = y[y.length - 1]) {
  56019. u = v.x,
  56020. d = v.y;
  56021. for (var T = 1; T <= i; T++) {
  56022. var x = T / i;
  56023. C(x, u, p, c),
  56024. C(x, d, f, h)
  56025. }
  56026. }
  56027. break;
  56028. case "b":
  56029. if (c = E[b++] * t + r,
  56030. h = E[b++] * t,
  56031. p = E[b++] * t + r,
  56032. f = E[b++] * t,
  56033. g = E[b++] * t + r,
  56034. m = E[b++] * t,
  56035. A.bezierCurveTo(p, f, g, m, c, h),
  56036. v = y[y.length - 1]) {
  56037. u = v.x,
  56038. d = v.y;
  56039. for (var T = 1; T <= i; T++) {
  56040. var x = T / i;
  56041. I(x, u, p, g, c),
  56042. I(x, d, f, m, h)
  56043. }
  56044. }
  56045. }
  56046. }
  56047. return {
  56048. offset: o.ha * t,
  56049. path: A
  56050. }
  56051. }
  56052. }
  56053. void 0 === t && (t = 100),
  56054. void 0 === i && (i = 4);
  56055. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  56056. Array.prototype.push.apply(l, s[c].toShapes());
  56057. return l
  56058. }
  56059. },
  56060. n.Path = function(e) {
  56061. n.CurvePath.call(this),
  56062. this.actions = [],
  56063. e && this.fromPoints(e)
  56064. }
  56065. ,
  56066. n.Path.prototype = Object.create(n.CurvePath.prototype),
  56067. n.Path.prototype.constructor = n.Path,
  56068. n.Path.prototype.fromPoints = function(e) {
  56069. this.moveTo(e[0].x, e[0].y);
  56070. for (var t = 1, i = e.length; t < i; t++)
  56071. this.lineTo(e[t].x, e[t].y)
  56072. }
  56073. ,
  56074. n.Path.prototype.moveTo = function(e, t) {
  56075. this.actions.push({
  56076. action: "moveTo",
  56077. args: [e, t]
  56078. })
  56079. }
  56080. ,
  56081. n.Path.prototype.lineTo = function(e, t) {
  56082. var i = this.actions[this.actions.length - 1].args
  56083. , r = i[i.length - 2]
  56084. , o = i[i.length - 1]
  56085. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  56086. this.curves.push(a),
  56087. this.actions.push({
  56088. action: "lineTo",
  56089. args: [e, t]
  56090. })
  56091. }
  56092. ,
  56093. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  56094. var o = this.actions[this.actions.length - 1].args
  56095. , a = o[o.length - 2]
  56096. , s = o[o.length - 1]
  56097. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  56098. this.curves.push(l),
  56099. this.actions.push({
  56100. action: "quadraticCurveTo",
  56101. args: [e, t, i, r]
  56102. })
  56103. }
  56104. ,
  56105. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  56106. var s = this.actions[this.actions.length - 1].args
  56107. , l = s[s.length - 2]
  56108. , c = s[s.length - 1]
  56109. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  56110. this.curves.push(h),
  56111. this.actions.push({
  56112. action: "bezierCurveTo",
  56113. args: [e, t, i, r, o, a]
  56114. })
  56115. }
  56116. ,
  56117. n.Path.prototype.splineThru = function(e) {
  56118. var t = Array.prototype.slice.call(arguments)
  56119. , i = this.actions[this.actions.length - 1].args
  56120. , r = i[i.length - 2]
  56121. , o = i[i.length - 1]
  56122. , a = [new n.Vector2(r,o)];
  56123. Array.prototype.push.apply(a, e);
  56124. var s = new n.SplineCurve(a);
  56125. this.curves.push(s),
  56126. this.actions.push({
  56127. action: "splineThru",
  56128. args: t
  56129. })
  56130. }
  56131. ,
  56132. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  56133. var a = this.actions[this.actions.length - 1].args
  56134. , s = a[a.length - 2]
  56135. , l = a[a.length - 1];
  56136. this.absarc(e + s, t + l, i, n, r, o)
  56137. }
  56138. ,
  56139. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  56140. this.absellipse(e, t, i, i, n, r, o)
  56141. }
  56142. ,
  56143. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  56144. var l = this.actions[this.actions.length - 1].args
  56145. , c = l[l.length - 2]
  56146. , h = l[l.length - 1];
  56147. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  56148. }
  56149. ,
  56150. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  56151. var c = [e, t, i, r, o, a, s, l || 0]
  56152. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  56153. this.curves.push(h);
  56154. var u = h.getPoint(1);
  56155. c.push(u.x),
  56156. c.push(u.y),
  56157. this.actions.push({
  56158. action: "ellipse",
  56159. args: c
  56160. })
  56161. }
  56162. ,
  56163. n.Path.prototype.getSpacedPoints = function(e) {
  56164. e || (e = 40);
  56165. for (var t = [], i = 0; i < e; i++)
  56166. t.push(this.getPoint(i / e));
  56167. return this.autoClose && t.push(t[0]),
  56168. t
  56169. }
  56170. ,
  56171. n.Path.prototype.getPoints = function(e) {
  56172. e = e || 12;
  56173. 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++) {
  56174. var A = this.actions[m]
  56175. , y = A.action
  56176. , C = A.args;
  56177. switch (y) {
  56178. case "moveTo":
  56179. g.push(new n.Vector2(C[0],C[1]));
  56180. break;
  56181. case "lineTo":
  56182. g.push(new n.Vector2(C[0],C[1]));
  56183. break;
  56184. case "quadraticCurveTo":
  56185. t = C[2],
  56186. i = C[3],
  56187. a = C[0],
  56188. s = C[1],
  56189. g.length > 0 ? (h = g[g.length - 1],
  56190. l = h.x,
  56191. c = h.y) : (h = this.actions[m - 1].args,
  56192. l = h[h.length - 2],
  56193. c = h[h.length - 1]);
  56194. for (var I = 1; I <= e; I++) {
  56195. var E = I / e;
  56196. u = p(E, l, a, t),
  56197. d = p(E, c, s, i),
  56198. g.push(new n.Vector2(u,d))
  56199. }
  56200. break;
  56201. case "bezierCurveTo":
  56202. t = C[4],
  56203. i = C[5],
  56204. a = C[0],
  56205. s = C[1],
  56206. r = C[2],
  56207. o = C[3],
  56208. g.length > 0 ? (h = g[g.length - 1],
  56209. l = h.x,
  56210. c = h.y) : (h = this.actions[m - 1].args,
  56211. l = h[h.length - 2],
  56212. c = h[h.length - 1]);
  56213. for (var I = 1; I <= e; I++) {
  56214. var E = I / e;
  56215. u = f(E, l, a, r, t),
  56216. d = f(E, c, s, o, i),
  56217. g.push(new n.Vector2(u,d))
  56218. }
  56219. break;
  56220. case "splineThru":
  56221. h = this.actions[m - 1].args;
  56222. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  56223. , w = [b]
  56224. , _ = e * C[0].length;
  56225. w = w.concat(C[0]);
  56226. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  56227. g.push(T.getPointAt(I / _));
  56228. break;
  56229. case "arc":
  56230. 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++) {
  56231. var E = I / N;
  56232. L || (E = 1 - E),
  56233. x = P + E * D,
  56234. u = S + R * Math.cos(x),
  56235. d = M + R * Math.sin(x),
  56236. g.push(new n.Vector2(u,d))
  56237. }
  56238. break;
  56239. case "ellipse":
  56240. 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;
  56241. 0 !== k && (B = Math.cos(k),
  56242. F = Math.sin(k));
  56243. for (var I = 1; I <= N; I++) {
  56244. var E = I / N;
  56245. if (L || (E = 1 - E),
  56246. x = P + E * D,
  56247. u = S + V * Math.cos(x),
  56248. d = M + U * Math.sin(x),
  56249. 0 !== k) {
  56250. var H = u
  56251. , G = d;
  56252. u = (H - S) * B - (G - M) * F + S,
  56253. d = (H - S) * F + (G - M) * B + M
  56254. }
  56255. g.push(new n.Vector2(u,d))
  56256. }
  56257. }
  56258. }
  56259. var z = g[g.length - 1];
  56260. 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),
  56261. this.autoClose && g.push(g[0]),
  56262. g
  56263. }
  56264. ,
  56265. n.Path.prototype.toShapes = function(e, t) {
  56266. function i(e) {
  56267. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  56268. var a = e[r]
  56269. , s = a.args
  56270. , l = a.action;
  56271. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  56272. i = new n.Path),
  56273. i[l].apply(i, s)
  56274. }
  56275. return 0 !== i.actions.length && t.push(i),
  56276. t
  56277. }
  56278. function r(e) {
  56279. for (var t = [], i = 0, r = e.length; i < r; i++) {
  56280. var o = e[i]
  56281. , a = new n.Shape;
  56282. a.actions = o.actions,
  56283. a.curves = o.curves,
  56284. t.push(a)
  56285. }
  56286. return t
  56287. }
  56288. function o(e, t) {
  56289. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  56290. var a = t[r]
  56291. , s = t[o]
  56292. , l = s.x - a.x
  56293. , c = s.y - a.y;
  56294. if (Math.abs(c) > Number.EPSILON) {
  56295. if (c < 0 && (a = t[o],
  56296. l = -l,
  56297. s = t[r],
  56298. c = -c),
  56299. e.y < a.y || e.y > s.y)
  56300. continue;
  56301. if (e.y === a.y) {
  56302. if (e.x === a.x)
  56303. return !0
  56304. } else {
  56305. var h = c * (e.x - a.x) - l * (e.y - a.y);
  56306. if (0 === h)
  56307. return !0;
  56308. if (h < 0)
  56309. continue;
  56310. n = !n
  56311. }
  56312. } else {
  56313. if (e.y !== a.y)
  56314. continue;
  56315. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  56316. return !0
  56317. }
  56318. }
  56319. return n
  56320. }
  56321. var a = n.ShapeUtils.isClockWise
  56322. , s = i(this.actions);
  56323. if (0 === s.length)
  56324. return [];
  56325. if (t === !0)
  56326. return r(s);
  56327. var l, c, h, u = [];
  56328. if (1 === s.length)
  56329. return c = s[0],
  56330. h = new n.Shape,
  56331. h.actions = c.actions,
  56332. h.curves = c.curves,
  56333. u.push(h),
  56334. u;
  56335. var d = !a(s[0].getPoints());
  56336. d = e ? !d : d;
  56337. var p, f = [], g = [], m = [], v = 0;
  56338. g[v] = void 0,
  56339. m[v] = [];
  56340. for (var A = 0, y = s.length; A < y; A++)
  56341. c = s[A],
  56342. p = c.getPoints(),
  56343. l = a(p),
  56344. l = e ? !l : l,
  56345. l ? (!d && g[v] && v++,
  56346. g[v] = {
  56347. s: new n.Shape,
  56348. p: p
  56349. },
  56350. g[v].s.actions = c.actions,
  56351. g[v].s.curves = c.curves,
  56352. d && v++,
  56353. m[v] = []) : m[v].push({
  56354. h: c,
  56355. p: p[0]
  56356. });
  56357. if (!g[0])
  56358. return r(s);
  56359. if (g.length > 1) {
  56360. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  56361. f[E] = [];
  56362. for (var E = 0, b = g.length; E < b; E++)
  56363. for (var w = m[E], _ = 0; _ < w.length; _++) {
  56364. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  56365. o(T.p, g[S].p) && (E !== S && I.push({
  56366. froms: E,
  56367. tos: S,
  56368. hole: _
  56369. }),
  56370. x ? (x = !1,
  56371. f[S].push(T)) : C = !0);
  56372. x && f[E].push(T)
  56373. }
  56374. I.length > 0 && (C || (m = f))
  56375. }
  56376. for (var M, A = 0, R = g.length; A < R; A++) {
  56377. h = g[A].s,
  56378. u.push(h),
  56379. M = m[A];
  56380. for (var P = 0, O = M.length; P < O; P++)
  56381. h.holes.push(M[P].h)
  56382. }
  56383. return u
  56384. }
  56385. ,
  56386. n.Shape = function() {
  56387. n.Path.apply(this, arguments),
  56388. this.holes = []
  56389. }
  56390. ,
  56391. n.Shape.prototype = Object.create(n.Path.prototype),
  56392. n.Shape.prototype.constructor = n.Shape,
  56393. n.Shape.prototype.extrude = function(e) {
  56394. return new n.ExtrudeGeometry(this,e)
  56395. }
  56396. ,
  56397. n.Shape.prototype.makeGeometry = function(e) {
  56398. return new n.ShapeGeometry(this,e)
  56399. }
  56400. ,
  56401. n.Shape.prototype.getPointsHoles = function(e) {
  56402. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  56403. t[i] = this.holes[i].getPoints(e);
  56404. return t
  56405. }
  56406. ,
  56407. n.Shape.prototype.extractAllPoints = function(e) {
  56408. return {
  56409. shape: this.getPoints(e),
  56410. holes: this.getPointsHoles(e)
  56411. }
  56412. }
  56413. ,
  56414. n.Shape.prototype.extractPoints = function(e) {
  56415. return this.extractAllPoints(e)
  56416. }
  56417. ,
  56418. n.LineCurve = function(e, t) {
  56419. this.v1 = e,
  56420. this.v2 = t
  56421. }
  56422. ,
  56423. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  56424. n.LineCurve.prototype.constructor = n.LineCurve,
  56425. n.LineCurve.prototype.getPoint = function(e) {
  56426. var t = this.v2.clone().sub(this.v1);
  56427. return t.multiplyScalar(e).add(this.v1),
  56428. t
  56429. }
  56430. ,
  56431. n.LineCurve.prototype.getPointAt = function(e) {
  56432. return this.getPoint(e)
  56433. }
  56434. ,
  56435. n.LineCurve.prototype.getTangent = function(e) {
  56436. var t = this.v2.clone().sub(this.v1);
  56437. return t.normalize()
  56438. }
  56439. ,
  56440. n.QuadraticBezierCurve = function(e, t, i) {
  56441. this.v0 = e,
  56442. this.v1 = t,
  56443. this.v2 = i
  56444. }
  56445. ,
  56446. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  56447. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  56448. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  56449. var t = n.ShapeUtils.b2;
  56450. 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))
  56451. }
  56452. ,
  56453. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  56454. var t = n.CurveUtils.tangentQuadraticBezier;
  56455. 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()
  56456. }
  56457. ,
  56458. n.CubicBezierCurve = function(e, t, i, n) {
  56459. this.v0 = e,
  56460. this.v1 = t,
  56461. this.v2 = i,
  56462. this.v3 = n
  56463. }
  56464. ,
  56465. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  56466. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  56467. n.CubicBezierCurve.prototype.getPoint = function(e) {
  56468. var t = n.ShapeUtils.b3;
  56469. 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))
  56470. }
  56471. ,
  56472. n.CubicBezierCurve.prototype.getTangent = function(e) {
  56473. var t = n.CurveUtils.tangentCubicBezier;
  56474. 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()
  56475. }
  56476. ,
  56477. n.SplineCurve = function(e) {
  56478. this.points = void 0 == e ? [] : e
  56479. }
  56480. ,
  56481. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  56482. n.SplineCurve.prototype.constructor = n.SplineCurve,
  56483. n.SplineCurve.prototype.getPoint = function(e) {
  56484. var t = this.points
  56485. , i = (t.length - 1) * e
  56486. , r = Math.floor(i)
  56487. , o = i - r
  56488. , a = t[0 === r ? r : r - 1]
  56489. , s = t[r]
  56490. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56491. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56492. , h = n.CurveUtils.interpolate;
  56493. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  56494. }
  56495. ,
  56496. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  56497. this.aX = e,
  56498. this.aY = t,
  56499. this.xRadius = i,
  56500. this.yRadius = n,
  56501. this.aStartAngle = r,
  56502. this.aEndAngle = o,
  56503. this.aClockwise = a,
  56504. this.aRotation = s || 0
  56505. }
  56506. ,
  56507. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  56508. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  56509. n.EllipseCurve.prototype.getPoint = function(e) {
  56510. var t = this.aEndAngle - this.aStartAngle;
  56511. t < 0 && (t += 2 * Math.PI),
  56512. t > 2 * Math.PI && (t -= 2 * Math.PI);
  56513. var i;
  56514. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  56515. var r = this.aX + this.xRadius * Math.cos(i)
  56516. , o = this.aY + this.yRadius * Math.sin(i);
  56517. if (0 !== this.aRotation) {
  56518. var a = Math.cos(this.aRotation)
  56519. , s = Math.sin(this.aRotation)
  56520. , l = r
  56521. , c = o;
  56522. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  56523. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  56524. }
  56525. return new n.Vector2(r,o)
  56526. }
  56527. ,
  56528. n.ArcCurve = function(e, t, i, r, o, a) {
  56529. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  56530. }
  56531. ,
  56532. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  56533. n.ArcCurve.prototype.constructor = n.ArcCurve,
  56534. n.LineCurve3 = n.Curve.create(function(e, t) {
  56535. this.v1 = e,
  56536. this.v2 = t
  56537. }, function(e) {
  56538. var t = new n.Vector3;
  56539. return t.subVectors(this.v2, this.v1),
  56540. t.multiplyScalar(e),
  56541. t.add(this.v1),
  56542. t
  56543. }),
  56544. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  56545. this.v0 = e,
  56546. this.v1 = t,
  56547. this.v2 = i
  56548. }, function(e) {
  56549. var t = n.ShapeUtils.b2;
  56550. 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))
  56551. }),
  56552. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  56553. this.v0 = e,
  56554. this.v1 = t,
  56555. this.v2 = i,
  56556. this.v3 = n
  56557. }, function(e) {
  56558. var t = n.ShapeUtils.b3;
  56559. 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))
  56560. }),
  56561. n.SplineCurve3 = n.Curve.create(function(e) {
  56562. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  56563. this.points = void 0 == e ? [] : e
  56564. }, function(e) {
  56565. var t = this.points
  56566. , i = (t.length - 1) * e
  56567. , r = Math.floor(i)
  56568. , o = i - r
  56569. , a = t[0 == r ? r : r - 1]
  56570. , s = t[r]
  56571. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56572. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56573. , h = n.CurveUtils.interpolate;
  56574. 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))
  56575. }),
  56576. n.CatmullRomCurve3 = function() {
  56577. function e() {}
  56578. var t = new n.Vector3
  56579. , i = new e
  56580. , r = new e
  56581. , o = new e;
  56582. return e.prototype.init = function(e, t, i, n) {
  56583. this.c0 = e,
  56584. this.c1 = i,
  56585. this.c2 = -3 * e + 3 * t - 2 * i - n,
  56586. this.c3 = 2 * e - 2 * t + i + n
  56587. }
  56588. ,
  56589. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  56590. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  56591. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  56592. s *= o,
  56593. l *= o,
  56594. this.init(t, i, s, l)
  56595. }
  56596. ,
  56597. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  56598. this.init(t, i, r * (i - e), r * (n - t))
  56599. }
  56600. ,
  56601. e.prototype.calc = function(e) {
  56602. var t = e * e
  56603. , i = t * e;
  56604. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  56605. }
  56606. ,
  56607. n.Curve.create(function(e) {
  56608. this.points = e || [],
  56609. this.closed = !1
  56610. }, function(e) {
  56611. var a, s, l, c, h = this.points;
  56612. c = h.length,
  56613. c < 2 && console.log("duh, you need at least 2 points"),
  56614. a = (c - (this.closed ? 0 : 1)) * e,
  56615. s = Math.floor(a),
  56616. l = a - s,
  56617. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  56618. l = 1);
  56619. var u, d, p, f;
  56620. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  56621. u = t),
  56622. d = h[s % c],
  56623. p = h[(s + 1) % c],
  56624. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  56625. f = t),
  56626. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  56627. var g = "chordal" === this.type ? .5 : .25
  56628. , m = Math.pow(u.distanceToSquared(d), g)
  56629. , v = Math.pow(d.distanceToSquared(p), g)
  56630. , A = Math.pow(p.distanceToSquared(f), g);
  56631. v < 1e-4 && (v = 1),
  56632. m < 1e-4 && (m = v),
  56633. A < 1e-4 && (A = v),
  56634. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  56635. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  56636. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  56637. } else if ("catmullrom" === this.type) {
  56638. var y = void 0 !== this.tension ? this.tension : .5;
  56639. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  56640. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  56641. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  56642. }
  56643. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  56644. return C
  56645. })
  56646. }(),
  56647. n.ClosedSplineCurve3 = function(e) {
  56648. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  56649. n.CatmullRomCurve3.call(this, e),
  56650. this.type = "catmullrom",
  56651. this.closed = !0
  56652. }
  56653. ,
  56654. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  56655. n.BoxGeometry = function(e, t, i, r, o, a) {
  56656. n.Geometry.call(this),
  56657. this.type = "BoxGeometry",
  56658. this.parameters = {
  56659. width: e,
  56660. height: t,
  56661. depth: i,
  56662. widthSegments: r,
  56663. heightSegments: o,
  56664. depthSegments: a
  56665. },
  56666. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56667. this.mergeVertices()
  56668. }
  56669. ,
  56670. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56671. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56672. n.CubeGeometry = n.BoxGeometry,
  56673. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56674. function s(e, t, i) {
  56675. var n = 0;
  56676. return n += e * t * 2,
  56677. n += e * i * 2,
  56678. n += i * t * 2,
  56679. 4 * n
  56680. }
  56681. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56682. 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++)
  56683. for (var L = O * b - _, D = 0; D < x; D++) {
  56684. var N = D * E - w;
  56685. P[e] = N * r,
  56686. P[t] = L * o,
  56687. P[i] = T,
  56688. p[m] = P.x,
  56689. p[m + 1] = P.y,
  56690. p[m + 2] = P.z,
  56691. P[e] = 0,
  56692. P[t] = 0,
  56693. P[i] = l > 0 ? 1 : -1,
  56694. f[m] = P.x,
  56695. f[m + 1] = P.y,
  56696. f[m + 2] = P.z,
  56697. g[v] = D / h,
  56698. g[v + 1] = 1 - O / u,
  56699. m += 3,
  56700. v += 2,
  56701. M += 1
  56702. }
  56703. for (O = 0; O < u; O++)
  56704. for (D = 0; D < h; D++) {
  56705. var B = y + D + x * O
  56706. , F = y + D + x * (O + 1)
  56707. , V = y + (D + 1) + x * (O + 1)
  56708. , U = y + (D + 1) + x * O;
  56709. d[A] = B,
  56710. d[A + 1] = F,
  56711. d[A + 2] = U,
  56712. d[A + 3] = F,
  56713. d[A + 4] = V,
  56714. d[A + 5] = U,
  56715. A += 6,
  56716. R += 6
  56717. }
  56718. c.addGroup(C, R, I),
  56719. C += R,
  56720. y += M
  56721. }
  56722. n.BufferGeometry.call(this),
  56723. this.type = "BoxBufferGeometry",
  56724. this.parameters = {
  56725. width: e,
  56726. height: t,
  56727. depth: i,
  56728. widthSegments: r,
  56729. heightSegments: o,
  56730. depthSegments: a
  56731. };
  56732. var c = this;
  56733. r = Math.floor(r) || 1,
  56734. o = Math.floor(o) || 1,
  56735. a = Math.floor(a) || 1;
  56736. var h = s(r, o, a)
  56737. , u = h / 4 * 6
  56738. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56739. , p = new Float32Array(3 * h)
  56740. , f = new Float32Array(3 * h)
  56741. , g = new Float32Array(2 * h)
  56742. , m = 0
  56743. , v = 0
  56744. , A = 0
  56745. , y = 0
  56746. , C = 0;
  56747. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56748. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56749. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56750. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56751. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56752. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56753. this.setIndex(new n.BufferAttribute(d,1)),
  56754. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56755. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56756. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56757. }
  56758. ,
  56759. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56760. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56761. n.CircleGeometry = function(e, t, i, r) {
  56762. n.Geometry.call(this),
  56763. this.type = "CircleGeometry",
  56764. this.parameters = {
  56765. radius: e,
  56766. segments: t,
  56767. thetaStart: i,
  56768. thetaLength: r
  56769. },
  56770. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56771. }
  56772. ,
  56773. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56774. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56775. n.CircleBufferGeometry = function(e, t, i, r) {
  56776. n.BufferGeometry.call(this),
  56777. this.type = "CircleBufferGeometry",
  56778. this.parameters = {
  56779. radius: e,
  56780. segments: t,
  56781. thetaStart: i,
  56782. thetaLength: r
  56783. },
  56784. e = e || 50,
  56785. t = void 0 !== t ? Math.max(3, t) : 8,
  56786. i = void 0 !== i ? i : 0,
  56787. r = void 0 !== r ? r : 2 * Math.PI;
  56788. var o = t + 2
  56789. , a = new Float32Array(3 * o)
  56790. , s = new Float32Array(3 * o)
  56791. , l = new Float32Array(2 * o);
  56792. s[2] = 1,
  56793. l[0] = .5,
  56794. l[1] = .5;
  56795. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56796. h += 3,
  56797. u += 2) {
  56798. var d = i + c / t * r;
  56799. a[h] = e * Math.cos(d),
  56800. a[h + 1] = e * Math.sin(d),
  56801. s[h + 2] = 1,
  56802. l[u] = (a[h] / e + 1) / 2,
  56803. l[u + 1] = (a[h + 1] / e + 1) / 2
  56804. }
  56805. for (var p = [], h = 1; h <= t; h++)
  56806. p.push(h, h + 1, 0);
  56807. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56808. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56809. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56810. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56811. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56812. }
  56813. ,
  56814. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56815. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56816. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56817. function c() {
  56818. var e = (r + 1) * (o + 1);
  56819. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56820. e
  56821. }
  56822. function h() {
  56823. var e = r * o * 2 * 3;
  56824. return a === !1 && (e += 2 * r * 3),
  56825. e
  56826. }
  56827. function u() {
  56828. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56829. for (c = 0; c <= o; c++) {
  56830. var p = []
  56831. , f = c / o
  56832. , b = f * (t - e) + e;
  56833. for (a = 0; a <= r; a++) {
  56834. var w = a / r;
  56835. u.x = b * Math.sin(w * l + s),
  56836. u.y = -f * i + E,
  56837. u.z = b * Math.cos(w * l + s),
  56838. m.setXYZ(y, u.x, u.y, u.z),
  56839. h.copy(u),
  56840. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56841. h.z = Math.cos(w * l + s)),
  56842. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56843. v.setXYZ(y, h.x, h.y, h.z),
  56844. A.setXY(y, w, 1 - f),
  56845. p.push(y),
  56846. y++
  56847. }
  56848. I.push(p)
  56849. }
  56850. for (a = 0; a < r; a++)
  56851. for (c = 0; c < o; c++) {
  56852. var _ = I[c][a]
  56853. , T = I[c + 1][a]
  56854. , x = I[c + 1][a + 1]
  56855. , S = I[c][a + 1];
  56856. g.setX(C, _),
  56857. C++,
  56858. g.setX(C, T),
  56859. C++,
  56860. g.setX(C, S),
  56861. C++,
  56862. g.setX(C, T),
  56863. C++,
  56864. g.setX(C, x),
  56865. C++,
  56866. g.setX(C, S),
  56867. C++
  56868. }
  56869. }
  56870. function d(i) {
  56871. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56872. for (a = y,
  56873. o = 1; o <= r; o++)
  56874. m.setXYZ(y, 0, E * p, 0),
  56875. v.setXYZ(y, 0, p, 0),
  56876. i === !0 ? (h.x = o / r,
  56877. h.y = 0) : (h.x = (o - 1) / r,
  56878. h.y = 1),
  56879. A.setXY(y, h.x, h.y),
  56880. y++;
  56881. for (c = y,
  56882. o = 0; o <= r; o++) {
  56883. var f = o / r;
  56884. u.x = d * Math.sin(f * l + s),
  56885. u.y = E * p,
  56886. u.z = d * Math.cos(f * l + s),
  56887. m.setXYZ(y, u.x, u.y, u.z),
  56888. v.setXYZ(y, 0, p, 0),
  56889. A.setXY(y, f, i === !0 ? 1 : 0),
  56890. y++
  56891. }
  56892. for (o = 0; o < r; o++) {
  56893. var I = a + o
  56894. , b = c + o;
  56895. i === !0 ? (g.setX(C, b),
  56896. C++,
  56897. g.setX(C, b + 1),
  56898. C++,
  56899. g.setX(C, I),
  56900. C++) : (g.setX(C, b + 1),
  56901. C++,
  56902. g.setX(C, b),
  56903. C++,
  56904. g.setX(C, I),
  56905. C++)
  56906. }
  56907. }
  56908. n.BufferGeometry.call(this),
  56909. this.type = "CylinderBufferGeometry",
  56910. this.parameters = {
  56911. radiusTop: e,
  56912. radiusBottom: t,
  56913. height: i,
  56914. radialSegments: r,
  56915. heightSegments: o,
  56916. openEnded: a,
  56917. thetaStart: s,
  56918. thetaLength: l
  56919. },
  56920. e = void 0 !== e ? e : 20,
  56921. t = void 0 !== t ? t : 20,
  56922. i = void 0 !== i ? i : 100,
  56923. r = Math.floor(r) || 8,
  56924. o = Math.floor(o) || 1,
  56925. a = void 0 !== a && a,
  56926. s = void 0 !== s ? s : 0,
  56927. l = void 0 !== l ? l : 2 * Math.PI;
  56928. var p = c()
  56929. , f = h()
  56930. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56931. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56932. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56933. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56934. , y = 0
  56935. , C = 0
  56936. , I = []
  56937. , E = i / 2;
  56938. u(),
  56939. a === !1 && (e > 0 && d(!0),
  56940. t > 0 && d(!1)),
  56941. this.setIndex(g),
  56942. this.addAttribute("position", m),
  56943. this.addAttribute("normal", v),
  56944. this.addAttribute("uv", A)
  56945. }
  56946. ,
  56947. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56948. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56949. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56950. n.Geometry.call(this),
  56951. this.type = "CylinderGeometry",
  56952. this.parameters = {
  56953. radiusTop: e,
  56954. radiusBottom: t,
  56955. height: i,
  56956. radialSegments: r,
  56957. heightSegments: o,
  56958. openEnded: a,
  56959. thetaStart: s,
  56960. thetaLength: l
  56961. },
  56962. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56963. this.mergeVertices()
  56964. }
  56965. ,
  56966. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56967. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56968. n.EdgesGeometry = function(e, t) {
  56969. function i(e, t) {
  56970. return e - t
  56971. }
  56972. n.BufferGeometry.call(this),
  56973. t = void 0 !== t ? t : 1;
  56974. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56975. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56976. r.fromBufferGeometry(e)) : r = e.clone(),
  56977. r.mergeVertices(),
  56978. r.computeFaceNormals();
  56979. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56980. for (var p = h[u], f = 0; f < 3; f++) {
  56981. a[0] = p[l[f]],
  56982. a[1] = p[l[(f + 1) % 3]],
  56983. a.sort(i);
  56984. var g = a.toString();
  56985. void 0 === s[g] ? s[g] = {
  56986. vert1: a[0],
  56987. vert2: a[1],
  56988. face1: u,
  56989. face2: void 0
  56990. } : s[g].face2 = u
  56991. }
  56992. var m = [];
  56993. for (var g in s) {
  56994. var v = s[g];
  56995. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56996. var A = c[v.vert1];
  56997. m.push(A.x),
  56998. m.push(A.y),
  56999. m.push(A.z),
  57000. A = c[v.vert2],
  57001. m.push(A.x),
  57002. m.push(A.y),
  57003. m.push(A.z)
  57004. }
  57005. }
  57006. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  57007. }
  57008. ,
  57009. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57010. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  57011. n.ExtrudeGeometry = function(e, t) {
  57012. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  57013. this.type = "ExtrudeGeometry",
  57014. e = Array.isArray(e) ? e : [e],
  57015. this.addShapeList(e, t),
  57016. void this.computeFaceNormals())
  57017. }
  57018. ;
  57019. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  57020. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  57021. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  57022. for (var i = e.length, n = 0; n < i; n++) {
  57023. var r = e[n];
  57024. this.addShape(r, t)
  57025. }
  57026. }
  57027. ,
  57028. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  57029. function i(e, t, i) {
  57030. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  57031. t.clone().multiplyScalar(i).add(e)
  57032. }
  57033. function r(e, t, i) {
  57034. 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;
  57035. if (Math.abs(d) > Number.EPSILON) {
  57036. var p = Math.sqrt(u)
  57037. , f = Math.sqrt(c * c + h * h)
  57038. , g = t.x - l / p
  57039. , m = t.y + s / p
  57040. , v = i.x - h / f
  57041. , A = i.y + c / f
  57042. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  57043. r = g + s * y - e.x,
  57044. o = m + l * y - e.y;
  57045. var C = r * r + o * o;
  57046. if (C <= 2)
  57047. return new n.Vector2(r,o);
  57048. a = Math.sqrt(C / 2)
  57049. } else {
  57050. var I = !1;
  57051. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  57052. I ? (r = -l,
  57053. o = s,
  57054. a = Math.sqrt(u)) : (r = s,
  57055. o = l,
  57056. a = Math.sqrt(u / 2))
  57057. }
  57058. return new n.Vector2(r / a,o / a)
  57059. }
  57060. function o() {
  57061. if (C) {
  57062. var e = 0
  57063. , t = z * e;
  57064. for (Y = 0; Y < W; Y++)
  57065. G = N[Y],
  57066. c(G[2] + t, G[1] + t, G[0] + t);
  57067. for (e = E + 2 * y,
  57068. t = z * e,
  57069. Y = 0; Y < W; Y++)
  57070. G = N[Y],
  57071. c(G[0] + t, G[1] + t, G[2] + t)
  57072. } else {
  57073. for (Y = 0; Y < W; Y++)
  57074. G = N[Y],
  57075. c(G[2], G[1], G[0]);
  57076. for (Y = 0; Y < W; Y++)
  57077. G = N[Y],
  57078. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  57079. }
  57080. }
  57081. function a() {
  57082. var e = 0;
  57083. for (s(B, e),
  57084. e += B.length,
  57085. x = 0,
  57086. S = L.length; x < S; x++)
  57087. T = L[x],
  57088. s(T, e),
  57089. e += T.length
  57090. }
  57091. function s(e, t) {
  57092. var i, n;
  57093. for (Y = e.length; --Y >= 0; ) {
  57094. i = Y,
  57095. n = Y - 1,
  57096. n < 0 && (n = e.length - 1);
  57097. var r = 0
  57098. , o = E + 2 * y;
  57099. for (r = 0; r < o; r++) {
  57100. var a = z * r
  57101. , s = z * (r + 1)
  57102. , l = t + i + a
  57103. , c = t + n + a
  57104. , u = t + n + s
  57105. , d = t + i + s;
  57106. h(l, c, u, d, e, r, o, i, n)
  57107. }
  57108. }
  57109. }
  57110. function l(e, t, i) {
  57111. M.vertices.push(new n.Vector3(e,t,i))
  57112. }
  57113. function c(e, t, i) {
  57114. e += R,
  57115. t += R,
  57116. i += R,
  57117. M.faces.push(new n.Face3(e,t,i,null,null,0));
  57118. var r = _.generateTopUV(M, e, t, i);
  57119. M.faceVertexUvs[0].push(r)
  57120. }
  57121. function h(e, t, i, r, o, a, s, l, c) {
  57122. e += R,
  57123. t += R,
  57124. i += R,
  57125. r += R,
  57126. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  57127. M.faces.push(new n.Face3(t,i,r,null,null,1));
  57128. var h = _.generateSideWallUV(M, e, t, i, r);
  57129. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  57130. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  57131. }
  57132. 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;
  57133. b && (u = b.getSpacedPoints(E),
  57134. w = !0,
  57135. C = !1,
  57136. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  57137. p = new n.Vector3,
  57138. f = new n.Vector3,
  57139. g = new n.Vector3),
  57140. C || (y = 0,
  57141. v = 0,
  57142. A = 0);
  57143. 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);
  57144. if (D) {
  57145. for (O = O.reverse(),
  57146. x = 0,
  57147. S = L.length; x < S; x++)
  57148. T = L[x],
  57149. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  57150. D = !1
  57151. }
  57152. var N = n.ShapeUtils.triangulateShape(O, L)
  57153. , B = O;
  57154. for (x = 0,
  57155. S = L.length; x < S; x++)
  57156. T = L[x],
  57157. O = O.concat(T);
  57158. 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++,
  57159. Z++,
  57160. q++)
  57161. Z === X && (Z = 0),
  57162. q === X && (q = 0),
  57163. j[Y] = r(B[Y], B[Z], B[q]);
  57164. var K, Q = [], J = j.concat();
  57165. for (x = 0,
  57166. S = L.length; x < S; x++) {
  57167. for (T = L[x],
  57168. K = [],
  57169. Y = 0,
  57170. X = T.length,
  57171. Z = X - 1,
  57172. q = Y + 1; Y < X; Y++,
  57173. Z++,
  57174. q++)
  57175. Z === X && (Z = 0),
  57176. q === X && (q = 0),
  57177. K[Y] = r(T[Y], T[Z], T[q]);
  57178. Q.push(K),
  57179. J = J.concat(K)
  57180. }
  57181. for (F = 0; F < y; F++) {
  57182. for (U = F / y,
  57183. k = v * (1 - U),
  57184. V = A * Math.sin(U * Math.PI / 2),
  57185. Y = 0,
  57186. X = B.length; Y < X; Y++)
  57187. H = i(B[Y], j[Y], V),
  57188. l(H.x, H.y, -k);
  57189. for (x = 0,
  57190. S = L.length; x < S; x++)
  57191. for (T = L[x],
  57192. K = Q[x],
  57193. Y = 0,
  57194. X = T.length; Y < X; Y++)
  57195. H = i(T[Y], K[Y], V),
  57196. l(H.x, H.y, -k)
  57197. }
  57198. for (V = A,
  57199. Y = 0; Y < z; Y++)
  57200. H = C ? i(O[Y], J[Y], V) : O[Y],
  57201. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  57202. p.copy(d.binormals[0]).multiplyScalar(H.y),
  57203. g.copy(u[0]).add(f).add(p),
  57204. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  57205. var $;
  57206. for ($ = 1; $ <= E; $++)
  57207. for (Y = 0; Y < z; Y++)
  57208. H = C ? i(O[Y], J[Y], V) : O[Y],
  57209. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  57210. p.copy(d.binormals[$]).multiplyScalar(H.y),
  57211. g.copy(u[$]).add(f).add(p),
  57212. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  57213. for (F = y - 1; F >= 0; F--) {
  57214. for (U = F / y,
  57215. k = v * (1 - U),
  57216. V = A * Math.sin(U * Math.PI / 2),
  57217. Y = 0,
  57218. X = B.length; Y < X; Y++)
  57219. H = i(B[Y], j[Y], V),
  57220. l(H.x, H.y, m + k);
  57221. for (x = 0,
  57222. S = L.length; x < S; x++)
  57223. for (T = L[x],
  57224. K = Q[x],
  57225. Y = 0,
  57226. X = T.length; Y < X; Y++)
  57227. H = i(T[Y], K[Y], V),
  57228. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  57229. }
  57230. o(),
  57231. a()
  57232. }
  57233. ,
  57234. n.ExtrudeGeometry.WorldUVGenerator = {
  57235. generateTopUV: function(e, t, i, r) {
  57236. var o = e.vertices
  57237. , a = o[t]
  57238. , s = o[i]
  57239. , l = o[r];
  57240. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  57241. },
  57242. generateSideWallUV: function(e, t, i, r, o) {
  57243. var a = e.vertices
  57244. , s = a[t]
  57245. , l = a[i]
  57246. , c = a[r]
  57247. , h = a[o];
  57248. 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)]
  57249. }
  57250. },
  57251. n.ShapeGeometry = function(e, t) {
  57252. n.Geometry.call(this),
  57253. this.type = "ShapeGeometry",
  57254. Array.isArray(e) === !1 && (e = [e]),
  57255. this.addShapeList(e, t),
  57256. this.computeFaceNormals()
  57257. }
  57258. ,
  57259. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  57260. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  57261. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  57262. for (var i = 0, n = e.length; i < n; i++)
  57263. this.addShape(e[i], t);
  57264. return this
  57265. }
  57266. ,
  57267. n.ShapeGeometry.prototype.addShape = function(e, t) {
  57268. void 0 === t && (t = {});
  57269. 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);
  57270. if (p) {
  57271. for (u = u.reverse(),
  57272. i = 0,
  57273. r = d.length; i < r; i++)
  57274. o = d[i],
  57275. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  57276. p = !1
  57277. }
  57278. var f = n.ShapeUtils.triangulateShape(u, d);
  57279. for (i = 0,
  57280. r = d.length; i < r; i++)
  57281. o = d[i],
  57282. u = u.concat(o);
  57283. var g, m, v = u.length, A = f.length;
  57284. for (i = 0; i < v; i++)
  57285. g = u[i],
  57286. this.vertices.push(new n.Vector3(g.x,g.y,0));
  57287. for (i = 0; i < A; i++) {
  57288. m = f[i];
  57289. var y = m[0] + c
  57290. , C = m[1] + c
  57291. , I = m[2] + c;
  57292. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  57293. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  57294. }
  57295. }
  57296. ,
  57297. n.LatheBufferGeometry = function(e, t, i, r) {
  57298. n.BufferGeometry.call(this),
  57299. this.type = "LatheBufferGeometry",
  57300. this.parameters = {
  57301. points: e,
  57302. segments: t,
  57303. phiStart: i,
  57304. phiLength: r
  57305. },
  57306. t = Math.floor(t) || 12,
  57307. i = i || 0,
  57308. r = r || 2 * Math.PI,
  57309. r = n.Math.clamp(r, 0, 2 * Math.PI);
  57310. 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),
  57311. 1 / t), m = new n.Vector3, v = new n.Vector2;
  57312. for (a = 0; a <= t; a++) {
  57313. var A = i + a * g * r
  57314. , y = Math.sin(A)
  57315. , C = Math.cos(A);
  57316. for (s = 0; s <= e.length - 1; s++)
  57317. m.x = e[s].x * y,
  57318. m.y = e[s].y,
  57319. m.z = e[s].x * C,
  57320. u.setXYZ(p, m.x, m.y, m.z),
  57321. v.x = a / t,
  57322. v.y = s / (e.length - 1),
  57323. d.setXY(p, v.x, v.y),
  57324. p++
  57325. }
  57326. for (a = 0; a < t; a++)
  57327. for (s = 0; s < e.length - 1; s++) {
  57328. o = s + a * e.length;
  57329. var I = o
  57330. , E = o + e.length
  57331. , b = o + e.length + 1
  57332. , w = o + 1;
  57333. h.setX(f, I),
  57334. f++,
  57335. h.setX(f, E),
  57336. f++,
  57337. h.setX(f, w),
  57338. f++,
  57339. h.setX(f, E),
  57340. f++,
  57341. h.setX(f, b),
  57342. f++,
  57343. h.setX(f, w),
  57344. f++
  57345. }
  57346. if (this.setIndex(h),
  57347. this.addAttribute("position", u),
  57348. this.addAttribute("uv", d),
  57349. this.computeVertexNormals(),
  57350. r === 2 * Math.PI) {
  57351. var _ = this.attributes.normal.array
  57352. , T = new n.Vector3
  57353. , x = new n.Vector3
  57354. , S = new n.Vector3;
  57355. for (o = t * e.length * 3,
  57356. a = 0,
  57357. s = 0; a < e.length; a++,
  57358. s += 3)
  57359. T.x = _[s + 0],
  57360. T.y = _[s + 1],
  57361. T.z = _[s + 2],
  57362. x.x = _[o + s + 0],
  57363. x.y = _[o + s + 1],
  57364. x.z = _[o + s + 2],
  57365. S.addVectors(T, x).normalize(),
  57366. _[s + 0] = _[o + s + 0] = S.x,
  57367. _[s + 1] = _[o + s + 1] = S.y,
  57368. _[s + 2] = _[o + s + 2] = S.z
  57369. }
  57370. }
  57371. ,
  57372. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57373. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  57374. n.LatheGeometry = function(e, t, i, r) {
  57375. n.Geometry.call(this),
  57376. this.type = "LatheGeometry",
  57377. this.parameters = {
  57378. points: e,
  57379. segments: t,
  57380. phiStart: i,
  57381. phiLength: r
  57382. },
  57383. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  57384. this.mergeVertices()
  57385. }
  57386. ,
  57387. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  57388. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  57389. n.PlaneGeometry = function(e, t, i, r) {
  57390. n.Geometry.call(this),
  57391. this.type = "PlaneGeometry",
  57392. this.parameters = {
  57393. width: e,
  57394. height: t,
  57395. widthSegments: i,
  57396. heightSegments: r
  57397. },
  57398. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  57399. }
  57400. ,
  57401. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  57402. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  57403. n.PlaneBufferGeometry = function(e, t, i, r) {
  57404. n.BufferGeometry.call(this),
  57405. this.type = "PlaneBufferGeometry",
  57406. this.parameters = {
  57407. width: e,
  57408. height: t,
  57409. widthSegments: i,
  57410. heightSegments: r
  57411. };
  57412. 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++)
  57413. for (var y = A * d - a, C = 0; C < c; C++) {
  57414. var I = C * u - o;
  57415. p[m] = I,
  57416. p[m + 1] = -y,
  57417. f[m + 2] = 1,
  57418. g[v] = C / s,
  57419. g[v + 1] = 1 - A / l,
  57420. m += 3,
  57421. v += 2
  57422. }
  57423. m = 0;
  57424. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  57425. for (var C = 0; C < s; C++) {
  57426. var b = C + c * A
  57427. , w = C + c * (A + 1)
  57428. , _ = C + 1 + c * (A + 1)
  57429. , T = C + 1 + c * A;
  57430. E[m] = b,
  57431. E[m + 1] = w,
  57432. E[m + 2] = T,
  57433. E[m + 3] = w,
  57434. E[m + 4] = _,
  57435. E[m + 5] = T,
  57436. m += 6
  57437. }
  57438. this.setIndex(new n.BufferAttribute(E,1)),
  57439. this.addAttribute("position", new n.BufferAttribute(p,3)),
  57440. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  57441. this.addAttribute("uv", new n.BufferAttribute(g,2))
  57442. }
  57443. ,
  57444. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57445. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  57446. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  57447. n.BufferGeometry.call(this),
  57448. this.type = "RingBufferGeometry",
  57449. this.parameters = {
  57450. innerRadius: e,
  57451. outerRadius: t,
  57452. thetaSegments: i,
  57453. phiSegments: r,
  57454. thetaStart: o,
  57455. thetaLength: a
  57456. },
  57457. e = e || 20,
  57458. t = t || 50,
  57459. o = void 0 !== o ? o : 0,
  57460. a = void 0 !== a ? a : 2 * Math.PI,
  57461. i = void 0 !== i ? Math.max(3, i) : 8,
  57462. r = void 0 !== r ? Math.max(1, r) : 1;
  57463. 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;
  57464. for (l = 0; l <= r; l++) {
  57465. for (c = 0; c <= i; c++)
  57466. s = o + c / i * a,
  57467. C.x = A * Math.cos(s),
  57468. C.y = A * Math.sin(s),
  57469. p.setXYZ(m, C.x, C.y, C.z),
  57470. f.setXYZ(m, 0, 0, 1),
  57471. I.x = (C.x / t + 1) / 2,
  57472. I.y = (C.y / t + 1) / 2,
  57473. g.setXY(m, I.x, I.y),
  57474. m++;
  57475. A += y
  57476. }
  57477. for (l = 0; l < r; l++) {
  57478. var E = l * (i + 1);
  57479. for (c = 0; c < i; c++) {
  57480. s = c + E;
  57481. var b = s
  57482. , w = s + i + 1
  57483. , _ = s + i + 2
  57484. , T = s + 1;
  57485. d.setX(v, b),
  57486. v++,
  57487. d.setX(v, w),
  57488. v++,
  57489. d.setX(v, _),
  57490. v++,
  57491. d.setX(v, b),
  57492. v++,
  57493. d.setX(v, _),
  57494. v++,
  57495. d.setX(v, T),
  57496. v++
  57497. }
  57498. }
  57499. this.setIndex(d),
  57500. this.addAttribute("position", p),
  57501. this.addAttribute("normal", f),
  57502. this.addAttribute("uv", g)
  57503. }
  57504. ,
  57505. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57506. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  57507. n.RingGeometry = function(e, t, i, r, o, a) {
  57508. n.Geometry.call(this),
  57509. this.type = "RingGeometry",
  57510. this.parameters = {
  57511. innerRadius: e,
  57512. outerRadius: t,
  57513. thetaSegments: i,
  57514. phiSegments: r,
  57515. thetaStart: o,
  57516. thetaLength: a
  57517. },
  57518. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  57519. }
  57520. ,
  57521. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  57522. n.RingGeometry.prototype.constructor = n.RingGeometry,
  57523. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  57524. n.Geometry.call(this),
  57525. this.type = "SphereGeometry",
  57526. this.parameters = {
  57527. radius: e,
  57528. widthSegments: t,
  57529. heightSegments: i,
  57530. phiStart: r,
  57531. phiLength: o,
  57532. thetaStart: a,
  57533. thetaLength: s
  57534. },
  57535. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  57536. }
  57537. ,
  57538. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  57539. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  57540. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  57541. n.BufferGeometry.call(this),
  57542. this.type = "SphereBufferGeometry",
  57543. this.parameters = {
  57544. radius: e,
  57545. widthSegments: t,
  57546. heightSegments: i,
  57547. phiStart: r,
  57548. phiLength: o,
  57549. thetaStart: a,
  57550. thetaLength: s
  57551. },
  57552. e = e || 50,
  57553. t = Math.max(3, Math.floor(t) || 8),
  57554. i = Math.max(2, Math.floor(i) || 6),
  57555. r = void 0 !== r ? r : 0,
  57556. o = void 0 !== o ? o : 2 * Math.PI,
  57557. a = void 0 !== a ? a : 0,
  57558. s = void 0 !== s ? s : Math.PI;
  57559. 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++) {
  57560. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  57561. var C = y / t
  57562. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  57563. , E = e * Math.cos(a + A * s)
  57564. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  57565. g.set(I, E, b).normalize(),
  57566. h.setXYZ(p, I, E, b),
  57567. u.setXYZ(p, g.x, g.y, g.z),
  57568. d.setXY(p, C, 1 - A),
  57569. v.push(p),
  57570. p++
  57571. }
  57572. f.push(v)
  57573. }
  57574. for (var w = [], m = 0; m < i; m++)
  57575. for (var y = 0; y < t; y++) {
  57576. var _ = f[m][y + 1]
  57577. , T = f[m][y]
  57578. , x = f[m + 1][y]
  57579. , S = f[m + 1][y + 1];
  57580. (0 !== m || a > 0) && w.push(_, T, S),
  57581. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  57582. }
  57583. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  57584. this.addAttribute("position", h),
  57585. this.addAttribute("normal", u),
  57586. this.addAttribute("uv", d),
  57587. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  57588. }
  57589. ,
  57590. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57591. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  57592. n.TextGeometry = function(e, t) {
  57593. t = t || {};
  57594. var i = t.font;
  57595. if (i instanceof n.Font == !1)
  57596. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  57597. new n.Geometry;
  57598. var r = i.generateShapes(e, t.size, t.curveSegments);
  57599. t.amount = void 0 !== t.height ? t.height : 50,
  57600. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  57601. void 0 === t.bevelSize && (t.bevelSize = 8),
  57602. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  57603. n.ExtrudeGeometry.call(this, r, t),
  57604. this.type = "TextGeometry"
  57605. }
  57606. ,
  57607. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  57608. n.TextGeometry.prototype.constructor = n.TextGeometry,
  57609. n.TorusBufferGeometry = function(e, t, i, r, o) {
  57610. n.BufferGeometry.call(this),
  57611. this.type = "TorusBufferGeometry",
  57612. this.parameters = {
  57613. radius: e,
  57614. tube: t,
  57615. radialSegments: i,
  57616. tubularSegments: r,
  57617. arc: o
  57618. },
  57619. e = e || 100,
  57620. t = t || 40,
  57621. i = Math.floor(i) || 8,
  57622. r = Math.floor(r) || 6,
  57623. o = o || 2 * Math.PI;
  57624. 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;
  57625. for (a = 0; a <= i; a++)
  57626. for (s = 0; s <= r; s++) {
  57627. var C = s / r * o
  57628. , I = a / i * Math.PI * 2;
  57629. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  57630. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  57631. A.z = t * Math.sin(I),
  57632. u[f] = A.x,
  57633. u[f + 1] = A.y,
  57634. u[f + 2] = A.z,
  57635. v.x = e * Math.cos(C),
  57636. v.y = e * Math.sin(C),
  57637. y.subVectors(A, v).normalize(),
  57638. d[f] = y.x,
  57639. d[f + 1] = y.y,
  57640. d[f + 2] = y.z,
  57641. p[g] = s / r,
  57642. p[g + 1] = a / i,
  57643. f += 3,
  57644. g += 2
  57645. }
  57646. for (a = 1; a <= i; a++)
  57647. for (s = 1; s <= r; s++) {
  57648. var E = (r + 1) * a + s - 1
  57649. , b = (r + 1) * (a - 1) + s - 1
  57650. , w = (r + 1) * (a - 1) + s
  57651. , _ = (r + 1) * a + s;
  57652. h[m] = E,
  57653. h[m + 1] = b,
  57654. h[m + 2] = _,
  57655. h[m + 3] = b,
  57656. h[m + 4] = w,
  57657. h[m + 5] = _,
  57658. m += 6
  57659. }
  57660. this.setIndex(new n.BufferAttribute(h,1)),
  57661. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57662. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57663. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57664. }
  57665. ,
  57666. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57667. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57668. n.TorusGeometry = function(e, t, i, r, o) {
  57669. n.Geometry.call(this),
  57670. this.type = "TorusGeometry",
  57671. this.parameters = {
  57672. radius: e,
  57673. tube: t,
  57674. radialSegments: i,
  57675. tubularSegments: r,
  57676. arc: o
  57677. },
  57678. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57679. }
  57680. ,
  57681. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57682. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57683. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57684. function s(e, t, i, n, r) {
  57685. var o = Math.cos(e)
  57686. , a = Math.sin(e)
  57687. , s = i / t * e
  57688. , l = Math.cos(s);
  57689. r.x = n * (2 + l) * .5 * o,
  57690. r.y = n * (2 + l) * a * .5,
  57691. r.z = n * Math.sin(s) * .5
  57692. }
  57693. n.BufferGeometry.call(this),
  57694. this.type = "TorusKnotBufferGeometry",
  57695. this.parameters = {
  57696. radius: e,
  57697. tube: t,
  57698. tubularSegments: i,
  57699. radialSegments: r,
  57700. p: o,
  57701. q: a
  57702. },
  57703. e = e || 100,
  57704. t = t || 40,
  57705. i = Math.floor(i) || 64,
  57706. r = Math.floor(r) || 8,
  57707. o = o || 2,
  57708. a = a || 3;
  57709. 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;
  57710. for (l = 0; l <= i; ++l) {
  57711. var T = l / i * o * Math.PI * 2;
  57712. for (s(T, o, a, e, I),
  57713. s(T + .01, o, a, e, E),
  57714. w.subVectors(E, I),
  57715. _.addVectors(E, I),
  57716. b.crossVectors(w, _),
  57717. _.crossVectors(b, w),
  57718. b.normalize(),
  57719. _.normalize(),
  57720. c = 0; c <= r; ++c) {
  57721. var x = c / r * Math.PI * 2
  57722. , S = -t * Math.cos(x)
  57723. , M = t * Math.sin(x);
  57724. A.x = I.x + (S * _.x + M * b.x),
  57725. A.y = I.y + (S * _.y + M * b.y),
  57726. A.z = I.z + (S * _.z + M * b.z),
  57727. p.setXYZ(m, A.x, A.y, A.z),
  57728. y.subVectors(A, I).normalize(),
  57729. f.setXYZ(m, y.x, y.y, y.z),
  57730. C.x = l / i,
  57731. C.y = c / r,
  57732. g.setXY(m, C.x, C.y),
  57733. m++
  57734. }
  57735. }
  57736. for (c = 1; c <= i; c++)
  57737. for (l = 1; l <= r; l++) {
  57738. var R = (r + 1) * (c - 1) + (l - 1)
  57739. , P = (r + 1) * c + (l - 1)
  57740. , O = (r + 1) * c + l
  57741. , L = (r + 1) * (c - 1) + l;
  57742. d.setX(v, R),
  57743. v++,
  57744. d.setX(v, P),
  57745. v++,
  57746. d.setX(v, L),
  57747. v++,
  57748. d.setX(v, P),
  57749. v++,
  57750. d.setX(v, O),
  57751. v++,
  57752. d.setX(v, L),
  57753. v++
  57754. }
  57755. this.setIndex(d),
  57756. this.addAttribute("position", p),
  57757. this.addAttribute("normal", f),
  57758. this.addAttribute("uv", g)
  57759. }
  57760. ,
  57761. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57762. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57763. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57764. n.Geometry.call(this),
  57765. this.type = "TorusKnotGeometry",
  57766. this.parameters = {
  57767. radius: e,
  57768. tube: t,
  57769. tubularSegments: i,
  57770. radialSegments: r,
  57771. p: o,
  57772. q: a
  57773. },
  57774. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57775. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57776. this.mergeVertices()
  57777. }
  57778. ,
  57779. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57780. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57781. n.TubeGeometry = function(e, t, i, r, o, a) {
  57782. function s(e, t, i) {
  57783. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57784. }
  57785. n.Geometry.call(this),
  57786. this.type = "TubeGeometry",
  57787. this.parameters = {
  57788. path: e,
  57789. segments: t,
  57790. radius: i,
  57791. radialSegments: r,
  57792. closed: o,
  57793. taper: a
  57794. },
  57795. t = t || 64,
  57796. i = i || 1,
  57797. r = r || 8,
  57798. o = o || !1,
  57799. a = a || n.TubeGeometry.NoTaper;
  57800. 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;
  57801. for (this.tangents = D,
  57802. this.normals = N,
  57803. this.binormals = B,
  57804. v = 0; v < P; v++)
  57805. for (M[v] = [],
  57806. u = v / (P - 1),
  57807. m = e.getPointAt(u),
  57808. l = D[v],
  57809. c = N[v],
  57810. h = B[v],
  57811. p = i * a(u),
  57812. A = 0; A < r; A++)
  57813. d = A / r * 2 * Math.PI,
  57814. f = -p * Math.cos(d),
  57815. g = p * Math.sin(d),
  57816. O.copy(m),
  57817. O.x += f * c.x + g * h.x,
  57818. O.y += f * c.y + g * h.y,
  57819. O.z += f * c.z + g * h.z,
  57820. M[v][A] = s(O.x, O.y, O.z);
  57821. for (v = 0; v < t; v++)
  57822. for (A = 0; A < r; A++)
  57823. y = o ? (v + 1) % t : v + 1,
  57824. C = (A + 1) % r,
  57825. I = M[v][A],
  57826. E = M[y][A],
  57827. b = M[y][C],
  57828. w = M[v][C],
  57829. _ = new n.Vector2(v / t,A / r),
  57830. T = new n.Vector2((v + 1) / t,A / r),
  57831. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57832. S = new n.Vector2(v / t,(A + 1) / r),
  57833. this.faces.push(new n.Face3(I,E,w)),
  57834. this.faceVertexUvs[0].push([_, T, S]),
  57835. this.faces.push(new n.Face3(E,b,w)),
  57836. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57837. this.computeFaceNormals(),
  57838. this.computeVertexNormals()
  57839. }
  57840. ,
  57841. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57842. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57843. n.TubeGeometry.NoTaper = function(e) {
  57844. return 1
  57845. }
  57846. ,
  57847. n.TubeGeometry.SinusoidalTaper = function(e) {
  57848. return Math.sin(Math.PI * e)
  57849. }
  57850. ,
  57851. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57852. function r() {
  57853. f[0] = new n.Vector3,
  57854. g[0] = new n.Vector3,
  57855. a = Number.MAX_VALUE,
  57856. s = Math.abs(p[0].x),
  57857. l = Math.abs(p[0].y),
  57858. c = Math.abs(p[0].z),
  57859. s <= a && (a = s,
  57860. d.set(1, 0, 0)),
  57861. l <= a && (a = l,
  57862. d.set(0, 1, 0)),
  57863. c <= a && d.set(0, 0, 1),
  57864. m.crossVectors(p[0], d).normalize(),
  57865. f[0].crossVectors(p[0], m),
  57866. g[0].crossVectors(p[0], f[0])
  57867. }
  57868. 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;
  57869. for (this.tangents = p,
  57870. this.normals = f,
  57871. this.binormals = g,
  57872. h = 0; h < A; h++)
  57873. u = h / (A - 1),
  57874. p[h] = e.getTangentAt(u),
  57875. p[h].normalize();
  57876. for (r(),
  57877. h = 1; h < A; h++)
  57878. f[h] = f[h - 1].clone(),
  57879. g[h] = g[h - 1].clone(),
  57880. m.crossVectors(p[h - 1], p[h]),
  57881. m.length() > Number.EPSILON && (m.normalize(),
  57882. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57883. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57884. g[h].crossVectors(p[h], f[h]);
  57885. if (i)
  57886. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57887. o /= A - 1,
  57888. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57889. h = 1; h < A; h++)
  57890. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57891. g[h].crossVectors(p[h], f[h])
  57892. }
  57893. ,
  57894. n.PolyhedronGeometry = function(e, t, i, r) {
  57895. function o(e) {
  57896. var t = e.normalize().clone();
  57897. t.index = u.vertices.push(t) - 1;
  57898. var i = l(e) / 2 / Math.PI + .5
  57899. , r = c(e) / Math.PI + .5;
  57900. return t.uv = new n.Vector2(i,1 - r),
  57901. t
  57902. }
  57903. function a(e, t, i, r) {
  57904. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57905. u.faces.push(o),
  57906. C.copy(e).add(t).add(i).divideScalar(3);
  57907. var a = l(C);
  57908. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57909. }
  57910. function s(e, t) {
  57911. 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++) {
  57912. l[h] = [];
  57913. 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++)
  57914. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57915. }
  57916. for (var h = 0; h < i; h++)
  57917. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57918. var m = Math.floor(g / 2);
  57919. 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)
  57920. }
  57921. }
  57922. function l(e) {
  57923. return Math.atan2(e.z, -e.x)
  57924. }
  57925. function c(e) {
  57926. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57927. }
  57928. function h(e, t, i) {
  57929. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57930. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57931. e.clone()
  57932. }
  57933. n.Geometry.call(this),
  57934. this.type = "PolyhedronGeometry",
  57935. this.parameters = {
  57936. vertices: e,
  57937. indices: t,
  57938. radius: i,
  57939. detail: r
  57940. },
  57941. i = i || 1,
  57942. r = r || 0;
  57943. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57944. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57945. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57946. m++) {
  57947. var v = f[t[d]]
  57948. , A = f[t[d + 1]]
  57949. , y = f[t[d + 2]];
  57950. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57951. }
  57952. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57953. s(g[d], r);
  57954. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57955. var I = this.faceVertexUvs[0][d]
  57956. , E = I[0].x
  57957. , b = I[1].x
  57958. , w = I[2].x
  57959. , _ = Math.max(E, b, w)
  57960. , T = Math.min(E, b, w);
  57961. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57962. b < .2 && (I[1].x += 1),
  57963. w < .2 && (I[2].x += 1))
  57964. }
  57965. for (var d = 0, p = this.vertices.length; d < p; d++)
  57966. this.vertices[d].multiplyScalar(i);
  57967. this.mergeVertices(),
  57968. this.computeFaceNormals(),
  57969. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57970. }
  57971. ,
  57972. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57973. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57974. n.DodecahedronGeometry = function(e, t) {
  57975. var i = (1 + Math.sqrt(5)) / 2
  57976. , r = 1 / i
  57977. , 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]
  57978. , 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];
  57979. n.PolyhedronGeometry.call(this, o, a, e, t),
  57980. this.type = "DodecahedronGeometry",
  57981. this.parameters = {
  57982. radius: e,
  57983. detail: t
  57984. }
  57985. }
  57986. ,
  57987. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57988. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57989. n.IcosahedronGeometry = function(e, t) {
  57990. var i = (1 + Math.sqrt(5)) / 2
  57991. , 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]
  57992. , 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];
  57993. n.PolyhedronGeometry.call(this, r, o, e, t),
  57994. this.type = "IcosahedronGeometry",
  57995. this.parameters = {
  57996. radius: e,
  57997. detail: t
  57998. }
  57999. }
  58000. ,
  58001. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  58002. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  58003. n.OctahedronGeometry = function(e, t) {
  58004. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  58005. , 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];
  58006. n.PolyhedronGeometry.call(this, i, r, e, t),
  58007. this.type = "OctahedronGeometry",
  58008. this.parameters = {
  58009. radius: e,
  58010. detail: t
  58011. }
  58012. }
  58013. ,
  58014. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  58015. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  58016. n.TetrahedronGeometry = function(e, t) {
  58017. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  58018. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  58019. n.PolyhedronGeometry.call(this, i, r, e, t),
  58020. this.type = "TetrahedronGeometry",
  58021. this.parameters = {
  58022. radius: e,
  58023. detail: t
  58024. }
  58025. }
  58026. ,
  58027. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  58028. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  58029. n.ParametricGeometry = function(e, t, i) {
  58030. n.Geometry.call(this),
  58031. this.type = "ParametricGeometry",
  58032. this.parameters = {
  58033. func: e,
  58034. slices: t,
  58035. stacks: i
  58036. };
  58037. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  58038. for (r = 0; r <= i; r++)
  58039. for (l = r / i,
  58040. o = 0; o <= t; o++)
  58041. s = o / t,
  58042. a = e(s, l),
  58043. c.push(a);
  58044. var p, f, g, m, v, A, y, C;
  58045. for (r = 0; r < i; r++)
  58046. for (o = 0; o < t; o++)
  58047. p = r * d + o,
  58048. f = r * d + o + 1,
  58049. g = (r + 1) * d + o + 1,
  58050. m = (r + 1) * d + o,
  58051. v = new n.Vector2(o / t,r / i),
  58052. A = new n.Vector2((o + 1) / t,r / i),
  58053. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  58054. C = new n.Vector2(o / t,(r + 1) / i),
  58055. h.push(new n.Face3(p,f,m)),
  58056. u.push([v, A, C]),
  58057. h.push(new n.Face3(f,g,m)),
  58058. u.push([A.clone(), y, C.clone()]);
  58059. this.computeFaceNormals(),
  58060. this.computeVertexNormals()
  58061. }
  58062. ,
  58063. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  58064. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  58065. n.WireframeGeometry = function(e) {
  58066. function t(e, t) {
  58067. return e - t
  58068. }
  58069. n.BufferGeometry.call(this);
  58070. var i = [0, 0]
  58071. , r = {}
  58072. , o = ["a", "b", "c"];
  58073. if (e instanceof n.Geometry) {
  58074. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  58075. for (var d = s[h], p = 0; p < 3; p++) {
  58076. i[0] = d[o[p]],
  58077. i[1] = d[o[(p + 1) % 3]],
  58078. i.sort(t);
  58079. var f = i.toString();
  58080. void 0 === r[f] && (c[2 * l] = i[0],
  58081. c[2 * l + 1] = i[1],
  58082. r[f] = !0,
  58083. l++)
  58084. }
  58085. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  58086. for (var p = 0; p < 2; p++) {
  58087. var m = a[c[2 * h + p]]
  58088. , v = 6 * h + 3 * p;
  58089. g[v + 0] = m.x,
  58090. g[v + 1] = m.y,
  58091. g[v + 2] = m.z
  58092. }
  58093. this.addAttribute("position", new n.BufferAttribute(g,3))
  58094. } else if (e instanceof n.BufferGeometry)
  58095. if (null !== e.index) {
  58096. var A = e.index.array
  58097. , a = e.attributes.position
  58098. , y = e.groups
  58099. , l = 0;
  58100. 0 === y.length && e.addGroup(0, A.length);
  58101. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  58102. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  58103. for (var p = 0; p < 3; p++) {
  58104. i[0] = A[h + p],
  58105. i[1] = A[h + (p + 1) % 3],
  58106. i.sort(t);
  58107. var f = i.toString();
  58108. void 0 === r[f] && (c[2 * l] = i[0],
  58109. c[2 * l + 1] = i[1],
  58110. r[f] = !0,
  58111. l++)
  58112. }
  58113. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  58114. for (var p = 0; p < 2; p++) {
  58115. var v = 6 * h + 3 * p
  58116. , T = c[2 * h + p];
  58117. g[v + 0] = a.getX(T),
  58118. g[v + 1] = a.getY(T),
  58119. g[v + 2] = a.getZ(T)
  58120. }
  58121. this.addAttribute("position", new n.BufferAttribute(g,3))
  58122. } else {
  58123. 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++)
  58124. for (var p = 0; p < 3; p++) {
  58125. var v = 18 * h + 6 * p
  58126. , S = 9 * h + 3 * p;
  58127. g[v + 0] = a[S],
  58128. g[v + 1] = a[S + 1],
  58129. g[v + 2] = a[S + 2];
  58130. var T = 9 * h + 3 * ((p + 1) % 3);
  58131. g[v + 3] = a[T],
  58132. g[v + 4] = a[T + 1],
  58133. g[v + 5] = a[T + 2]
  58134. }
  58135. this.addAttribute("position", new n.BufferAttribute(g,3))
  58136. }
  58137. }
  58138. ,
  58139. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  58140. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  58141. n.AxisHelper = function(e) {
  58142. e = e || 1;
  58143. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  58144. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  58145. , r = new n.BufferGeometry;
  58146. r.addAttribute("position", new n.BufferAttribute(t,3)),
  58147. r.addAttribute("color", new n.BufferAttribute(i,3));
  58148. var o = new n.LineBasicMaterial({
  58149. vertexColors: n.VertexColors
  58150. });
  58151. n.LineSegments.call(this, r, o)
  58152. }
  58153. ,
  58154. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  58155. n.AxisHelper.prototype.constructor = n.AxisHelper,
  58156. n.ArrowHelper = function() {
  58157. var e = new n.Geometry;
  58158. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  58159. var t = new n.CylinderGeometry(0,.5,1,5,1);
  58160. return t.translate(0, -.5, 0),
  58161. function(i, r, o, a, s, l) {
  58162. n.Object3D.call(this),
  58163. void 0 === a && (a = 16776960),
  58164. void 0 === o && (o = 1),
  58165. void 0 === s && (s = .2 * o),
  58166. void 0 === l && (l = .2 * s),
  58167. this.position.copy(r),
  58168. this.line = new n.Line(e,new n.LineBasicMaterial({
  58169. color: a
  58170. })),
  58171. this.line.matrixAutoUpdate = !1,
  58172. this.add(this.line),
  58173. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  58174. color: a
  58175. })),
  58176. this.cone.matrixAutoUpdate = !1,
  58177. this.add(this.cone),
  58178. this.setDirection(i),
  58179. this.setLength(o, s, l)
  58180. }
  58181. }(),
  58182. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  58183. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  58184. n.ArrowHelper.prototype.setDirection = function() {
  58185. var e, t = new n.Vector3;
  58186. return function(i) {
  58187. 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(),
  58188. e = Math.acos(i.y),
  58189. this.quaternion.setFromAxisAngle(t, e))
  58190. }
  58191. }(),
  58192. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  58193. void 0 === t && (t = .2 * e),
  58194. void 0 === i && (i = .2 * t),
  58195. this.line.scale.set(1, Math.max(0, e - t), 1),
  58196. this.line.updateMatrix(),
  58197. this.cone.scale.set(i, t, i),
  58198. this.cone.position.y = e,
  58199. this.cone.updateMatrix()
  58200. }
  58201. ,
  58202. n.ArrowHelper.prototype.setColor = function(e) {
  58203. this.line.material.color.set(e),
  58204. this.cone.material.color.set(e)
  58205. }
  58206. ,
  58207. n.BoxHelper = function(e) {
  58208. 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])
  58209. , i = new Float32Array(24)
  58210. , r = new n.BufferGeometry;
  58211. r.setIndex(new n.BufferAttribute(t,1)),
  58212. r.addAttribute("position", new n.BufferAttribute(i,3)),
  58213. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  58214. color: 16776960
  58215. })),
  58216. void 0 !== e && this.update(e)
  58217. }
  58218. ,
  58219. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  58220. n.BoxHelper.prototype.constructor = n.BoxHelper,
  58221. n.BoxHelper.prototype.update = function() {
  58222. var e = new n.Box3;
  58223. return function(t) {
  58224. if (e.setFromObject(t),
  58225. !e.isEmpty()) {
  58226. var i = e.min
  58227. , n = e.max
  58228. , r = this.geometry.attributes.position
  58229. , o = r.array;
  58230. o[0] = n.x,
  58231. o[1] = n.y,
  58232. o[2] = n.z,
  58233. o[3] = i.x,
  58234. o[4] = n.y,
  58235. o[5] = n.z,
  58236. o[6] = i.x,
  58237. o[7] = i.y,
  58238. o[8] = n.z,
  58239. o[9] = n.x,
  58240. o[10] = i.y,
  58241. o[11] = n.z,
  58242. o[12] = n.x,
  58243. o[13] = n.y,
  58244. o[14] = i.z,
  58245. o[15] = i.x,
  58246. o[16] = n.y,
  58247. o[17] = i.z,
  58248. o[18] = i.x,
  58249. o[19] = i.y,
  58250. o[20] = i.z,
  58251. o[21] = n.x,
  58252. o[22] = i.y,
  58253. o[23] = i.z,
  58254. r.needsUpdate = !0,
  58255. this.geometry.computeBoundingSphere()
  58256. }
  58257. }
  58258. }(),
  58259. n.BoundingBoxHelper = function(e, t) {
  58260. var i = void 0 !== t ? t : 8947848;
  58261. this.object = e,
  58262. this.box = new n.Box3,
  58263. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  58264. color: i,
  58265. wireframe: !0
  58266. }))
  58267. }
  58268. ,
  58269. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  58270. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  58271. n.BoundingBoxHelper.prototype.update = function() {
  58272. this.box.setFromObject(this.object),
  58273. this.box.size(this.scale),
  58274. this.box.center(this.position)
  58275. }
  58276. ,
  58277. n.CameraHelper = function(e) {
  58278. function t(e, t, n) {
  58279. i(e, n),
  58280. i(t, n)
  58281. }
  58282. function i(e, t) {
  58283. r.vertices.push(new n.Vector3),
  58284. r.colors.push(new n.Color(t)),
  58285. void 0 === a[e] && (a[e] = []),
  58286. a[e].push(r.vertices.length - 1)
  58287. }
  58288. var r = new n.Geometry
  58289. , o = new n.LineBasicMaterial({
  58290. color: 16777215,
  58291. vertexColors: n.FaceColors
  58292. })
  58293. , a = {}
  58294. , s = 16755200
  58295. , l = 16711680
  58296. , c = 43775
  58297. , h = 16777215
  58298. , u = 3355443;
  58299. t("n1", "n2", s),
  58300. t("n2", "n4", s),
  58301. t("n4", "n3", s),
  58302. t("n3", "n1", s),
  58303. t("f1", "f2", s),
  58304. t("f2", "f4", s),
  58305. t("f4", "f3", s),
  58306. t("f3", "f1", s),
  58307. t("n1", "f1", s),
  58308. t("n2", "f2", s),
  58309. t("n3", "f3", s),
  58310. t("n4", "f4", s),
  58311. t("p", "n1", l),
  58312. t("p", "n2", l),
  58313. t("p", "n3", l),
  58314. t("p", "n4", l),
  58315. t("u1", "u2", c),
  58316. t("u2", "u3", c),
  58317. t("u3", "u1", c),
  58318. t("c", "t", h),
  58319. t("p", "c", u),
  58320. t("cn1", "cn2", u),
  58321. t("cn3", "cn4", u),
  58322. t("cf1", "cf2", u),
  58323. t("cf3", "cf4", u),
  58324. n.LineSegments.call(this, r, o),
  58325. this.camera = e,
  58326. this.camera.updateProjectionMatrix(),
  58327. this.matrix = e.matrixWorld,
  58328. this.matrixAutoUpdate = !1,
  58329. this.pointMap = a,
  58330. this.update()
  58331. }
  58332. ,
  58333. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  58334. n.CameraHelper.prototype.constructor = n.CameraHelper,
  58335. n.CameraHelper.prototype.update = function() {
  58336. function e(e, n, a, s) {
  58337. r.set(n, a, s).unproject(o);
  58338. var l = i[e];
  58339. if (void 0 !== l)
  58340. for (var c = 0, h = l.length; c < h; c++)
  58341. t.vertices[l[c]].copy(r)
  58342. }
  58343. var t, i, r = new n.Vector3, o = new n.Camera;
  58344. return function() {
  58345. t = this.geometry,
  58346. i = this.pointMap;
  58347. var n = 1
  58348. , r = 1;
  58349. o.projectionMatrix.copy(this.camera.projectionMatrix),
  58350. e("c", 0, 0, -1),
  58351. e("t", 0, 0, 1),
  58352. e("n1", -n, -r, -1),
  58353. e("n2", n, -r, -1),
  58354. e("n3", -n, r, -1),
  58355. e("n4", n, r, -1),
  58356. e("f1", -n, -r, 1),
  58357. e("f2", n, -r, 1),
  58358. e("f3", -n, r, 1),
  58359. e("f4", n, r, 1),
  58360. e("u1", .7 * n, 1.1 * r, -1),
  58361. e("u2", .7 * -n, 1.1 * r, -1),
  58362. e("u3", 0, 2 * r, -1),
  58363. e("cf1", -n, 0, 1),
  58364. e("cf2", n, 0, 1),
  58365. e("cf3", 0, -r, 1),
  58366. e("cf4", 0, r, 1),
  58367. e("cn1", -n, 0, -1),
  58368. e("cn2", n, 0, -1),
  58369. e("cn3", 0, -r, -1),
  58370. e("cn4", 0, r, -1),
  58371. t.verticesNeedUpdate = !0
  58372. }
  58373. }(),
  58374. n.DirectionalLightHelper = function(e, t) {
  58375. n.Object3D.call(this),
  58376. this.light = e,
  58377. this.light.updateMatrixWorld(),
  58378. this.matrix = e.matrixWorld,
  58379. this.matrixAutoUpdate = !1,
  58380. t = t || 1;
  58381. var i = new n.Geometry;
  58382. 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));
  58383. var r = new n.LineBasicMaterial({
  58384. fog: !1
  58385. });
  58386. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58387. this.lightPlane = new n.Line(i,r),
  58388. this.add(this.lightPlane),
  58389. i = new n.Geometry,
  58390. i.vertices.push(new n.Vector3, new n.Vector3),
  58391. r = new n.LineBasicMaterial({
  58392. fog: !1
  58393. }),
  58394. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58395. this.targetLine = new n.Line(i,r),
  58396. this.add(this.targetLine),
  58397. this.update()
  58398. }
  58399. ,
  58400. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  58401. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  58402. n.DirectionalLightHelper.prototype.dispose = function() {
  58403. this.lightPlane.geometry.dispose(),
  58404. this.lightPlane.material.dispose(),
  58405. this.targetLine.geometry.dispose(),
  58406. this.targetLine.material.dispose()
  58407. }
  58408. ,
  58409. n.DirectionalLightHelper.prototype.update = function() {
  58410. var e = new n.Vector3
  58411. , t = new n.Vector3
  58412. , i = new n.Vector3;
  58413. return function() {
  58414. e.setFromMatrixPosition(this.light.matrixWorld),
  58415. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58416. i.subVectors(t, e),
  58417. this.lightPlane.lookAt(i),
  58418. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58419. this.targetLine.geometry.vertices[1].copy(i),
  58420. this.targetLine.geometry.verticesNeedUpdate = !0,
  58421. this.targetLine.material.color.copy(this.lightPlane.material.color)
  58422. }
  58423. }(),
  58424. n.EdgesHelper = function(e, t, i) {
  58425. var r = void 0 !== t ? t : 16777215;
  58426. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  58427. color: r
  58428. })),
  58429. this.matrix = e.matrixWorld,
  58430. this.matrixAutoUpdate = !1
  58431. }
  58432. ,
  58433. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  58434. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  58435. n.FaceNormalsHelper = function(e, t, i, r) {
  58436. this.object = e,
  58437. this.size = void 0 !== t ? t : 1;
  58438. var o = void 0 !== i ? i : 16776960
  58439. , a = void 0 !== r ? r : 1
  58440. , s = 0
  58441. , l = this.object.geometry;
  58442. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  58443. var c = new n.BufferGeometry
  58444. , h = new n.Float32Attribute(2 * s * 3,3);
  58445. c.addAttribute("position", h),
  58446. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58447. color: o,
  58448. linewidth: a
  58449. })),
  58450. this.matrixAutoUpdate = !1,
  58451. this.update()
  58452. }
  58453. ,
  58454. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58455. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  58456. n.FaceNormalsHelper.prototype.update = function() {
  58457. var e = new n.Vector3
  58458. , t = new n.Vector3
  58459. , i = new n.Matrix3;
  58460. return function() {
  58461. this.object.updateMatrixWorld(!0),
  58462. i.getNormalMatrix(this.object.matrixWorld);
  58463. 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++) {
  58464. var u = s[c]
  58465. , d = u.normal;
  58466. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  58467. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58468. r.setXYZ(l, e.x, e.y, e.z),
  58469. l += 1,
  58470. r.setXYZ(l, t.x, t.y, t.z),
  58471. l += 1
  58472. }
  58473. return r.needsUpdate = !0,
  58474. this
  58475. }
  58476. }(),
  58477. n.GridHelper = function(e, t) {
  58478. var i = new n.Geometry
  58479. , r = new n.LineBasicMaterial({
  58480. vertexColors: n.VertexColors
  58481. });
  58482. this.color1 = new n.Color(4473924),
  58483. this.color2 = new n.Color(8947848);
  58484. for (var o = -e; o <= e; o += t) {
  58485. 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));
  58486. var a = 0 === o ? this.color1 : this.color2;
  58487. i.colors.push(a, a, a, a)
  58488. }
  58489. n.LineSegments.call(this, i, r)
  58490. }
  58491. ,
  58492. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  58493. n.GridHelper.prototype.constructor = n.GridHelper,
  58494. n.GridHelper.prototype.setColors = function(e, t) {
  58495. this.color1.set(e),
  58496. this.color2.set(t),
  58497. this.geometry.colorsNeedUpdate = !0
  58498. }
  58499. ,
  58500. n.HemisphereLightHelper = function(e, t) {
  58501. n.Object3D.call(this),
  58502. this.light = e,
  58503. this.light.updateMatrixWorld(),
  58504. this.matrix = e.matrixWorld,
  58505. this.matrixAutoUpdate = !1,
  58506. this.colors = [new n.Color, new n.Color];
  58507. var i = new n.SphereGeometry(t,4,2);
  58508. i.rotateX(-Math.PI / 2);
  58509. for (var r = 0, o = 8; r < o; r++)
  58510. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  58511. var a = new n.MeshBasicMaterial({
  58512. vertexColors: n.FaceColors,
  58513. wireframe: !0
  58514. });
  58515. this.lightSphere = new n.Mesh(i,a),
  58516. this.add(this.lightSphere),
  58517. this.update()
  58518. }
  58519. ,
  58520. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  58521. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  58522. n.HemisphereLightHelper.prototype.dispose = function() {
  58523. this.lightSphere.geometry.dispose(),
  58524. this.lightSphere.material.dispose()
  58525. }
  58526. ,
  58527. n.HemisphereLightHelper.prototype.update = function() {
  58528. var e = new n.Vector3;
  58529. return function() {
  58530. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  58531. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  58532. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  58533. this.lightSphere.geometry.colorsNeedUpdate = !0
  58534. }
  58535. }(),
  58536. n.PointLightHelper = function(e, t) {
  58537. this.light = e,
  58538. this.light.updateMatrixWorld();
  58539. var i = new n.SphereGeometry(t,4,2)
  58540. , r = new n.MeshBasicMaterial({
  58541. wireframe: !0,
  58542. fog: !1
  58543. });
  58544. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58545. n.Mesh.call(this, i, r),
  58546. this.matrix = this.light.matrixWorld,
  58547. this.matrixAutoUpdate = !1
  58548. }
  58549. ,
  58550. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  58551. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  58552. n.PointLightHelper.prototype.dispose = function() {
  58553. this.geometry.dispose(),
  58554. this.material.dispose()
  58555. }
  58556. ,
  58557. n.PointLightHelper.prototype.update = function() {
  58558. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58559. }
  58560. ,
  58561. n.SkeletonHelper = function(e) {
  58562. this.bones = this.getBoneList(e);
  58563. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  58564. var r = this.bones[i];
  58565. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  58566. t.vertices.push(new n.Vector3),
  58567. t.colors.push(new n.Color(0,0,1)),
  58568. t.colors.push(new n.Color(0,1,0)))
  58569. }
  58570. t.dynamic = !0;
  58571. var o = new n.LineBasicMaterial({
  58572. vertexColors: n.VertexColors,
  58573. depthTest: !1,
  58574. depthWrite: !1,
  58575. transparent: !0
  58576. });
  58577. n.LineSegments.call(this, t, o),
  58578. this.root = e,
  58579. this.matrix = e.matrixWorld,
  58580. this.matrixAutoUpdate = !1,
  58581. this.update()
  58582. }
  58583. ,
  58584. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  58585. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  58586. n.SkeletonHelper.prototype.getBoneList = function(e) {
  58587. var t = [];
  58588. e instanceof n.Bone && t.push(e);
  58589. for (var i = 0; i < e.children.length; i++)
  58590. t.push.apply(t, this.getBoneList(e.children[i]));
  58591. return t
  58592. }
  58593. ,
  58594. n.SkeletonHelper.prototype.update = function() {
  58595. 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++) {
  58596. var a = this.bones[o];
  58597. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  58598. e.vertices[r].setFromMatrixPosition(i),
  58599. i.multiplyMatrices(t, a.parent.matrixWorld),
  58600. e.vertices[r + 1].setFromMatrixPosition(i),
  58601. r += 2)
  58602. }
  58603. e.verticesNeedUpdate = !0,
  58604. e.computeBoundingSphere()
  58605. }
  58606. ,
  58607. n.SpotLightHelper = function(e) {
  58608. n.Object3D.call(this),
  58609. this.light = e,
  58610. this.light.updateMatrixWorld(),
  58611. this.matrix = e.matrixWorld,
  58612. this.matrixAutoUpdate = !1;
  58613. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  58614. t.translate(0, -.5, 0),
  58615. t.rotateX(-Math.PI / 2);
  58616. var i = new n.MeshBasicMaterial({
  58617. wireframe: !0,
  58618. fog: !1
  58619. });
  58620. this.cone = new n.Mesh(t,i),
  58621. this.add(this.cone),
  58622. this.update()
  58623. }
  58624. ,
  58625. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  58626. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  58627. n.SpotLightHelper.prototype.dispose = function() {
  58628. this.cone.geometry.dispose(),
  58629. this.cone.material.dispose()
  58630. }
  58631. ,
  58632. n.SpotLightHelper.prototype.update = function() {
  58633. var e = new n.Vector3
  58634. , t = new n.Vector3;
  58635. return function() {
  58636. var i = this.light.distance ? this.light.distance : 1e4
  58637. , n = i * Math.tan(this.light.angle);
  58638. this.cone.scale.set(n, n, i),
  58639. e.setFromMatrixPosition(this.light.matrixWorld),
  58640. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58641. this.cone.lookAt(t.sub(e)),
  58642. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58643. }
  58644. }(),
  58645. n.VertexNormalsHelper = function(e, t, i, r) {
  58646. this.object = e,
  58647. this.size = void 0 !== t ? t : 1;
  58648. var o = void 0 !== i ? i : 16711680
  58649. , a = void 0 !== r ? r : 1
  58650. , s = 0
  58651. , l = this.object.geometry;
  58652. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  58653. var c = new n.BufferGeometry
  58654. , h = new n.Float32Attribute(2 * s * 3,3);
  58655. c.addAttribute("position", h),
  58656. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58657. color: o,
  58658. linewidth: a
  58659. })),
  58660. this.matrixAutoUpdate = !1,
  58661. this.update()
  58662. }
  58663. ,
  58664. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58665. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58666. n.VertexNormalsHelper.prototype.update = function() {
  58667. var e = new n.Vector3
  58668. , t = new n.Vector3
  58669. , i = new n.Matrix3;
  58670. return function() {
  58671. var r = ["a", "b", "c"];
  58672. this.object.updateMatrixWorld(!0),
  58673. i.getNormalMatrix(this.object.matrixWorld);
  58674. var o = this.object.matrixWorld
  58675. , a = this.geometry.attributes.position
  58676. , s = this.object.geometry;
  58677. if (s instanceof n.Geometry)
  58678. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58679. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58680. var m = l[p[r[f]]]
  58681. , v = p.vertexNormals[f];
  58682. e.copy(m).applyMatrix4(o),
  58683. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58684. a.setXYZ(h, e.x, e.y, e.z),
  58685. h += 1,
  58686. a.setXYZ(h, t.x, t.y, t.z),
  58687. h += 1
  58688. }
  58689. else if (s instanceof n.BufferGeometry)
  58690. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58691. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58692. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58693. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58694. a.setXYZ(h, e.x, e.y, e.z),
  58695. h += 1,
  58696. a.setXYZ(h, t.x, t.y, t.z),
  58697. h += 1;
  58698. return a.needsUpdate = !0,
  58699. this
  58700. }
  58701. }(),
  58702. n.WireframeHelper = function(e, t) {
  58703. var i = void 0 !== t ? t : 16777215;
  58704. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58705. color: i
  58706. })),
  58707. this.matrix = e.matrixWorld,
  58708. this.matrixAutoUpdate = !1
  58709. }
  58710. ,
  58711. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58712. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58713. n.ImmediateRenderObject = function(e) {
  58714. n.Object3D.call(this),
  58715. this.material = e,
  58716. this.render = function(e) {}
  58717. }
  58718. ,
  58719. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58720. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58721. n.MorphBlendMesh = function(e, t) {
  58722. n.Mesh.call(this, e, t),
  58723. this.animationsMap = {},
  58724. this.animationsList = [];
  58725. var i = this.geometry.morphTargets.length
  58726. , r = "__default"
  58727. , o = 0
  58728. , a = i - 1
  58729. , s = i / 1;
  58730. this.createAnimation(r, o, a, s),
  58731. this.setAnimationWeight(r, 1)
  58732. }
  58733. ,
  58734. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58735. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58736. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58737. var r = {
  58738. start: t,
  58739. end: i,
  58740. length: i - t + 1,
  58741. fps: n,
  58742. duration: (i - t) / n,
  58743. lastFrame: 0,
  58744. currentFrame: 0,
  58745. active: !1,
  58746. time: 0,
  58747. direction: 1,
  58748. weight: 1,
  58749. directionBackwards: !1,
  58750. mirroredLoop: !1
  58751. };
  58752. this.animationsMap[e] = r,
  58753. this.animationsList.push(r)
  58754. }
  58755. ,
  58756. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58757. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58758. var s = r.morphTargets[o]
  58759. , l = s.name.match(i);
  58760. if (l && l.length > 1) {
  58761. var c = l[1];
  58762. n[c] || (n[c] = {
  58763. start: 1 / 0,
  58764. end: -(1 / 0)
  58765. });
  58766. var h = n[c];
  58767. o < h.start && (h.start = o),
  58768. o > h.end && (h.end = o),
  58769. t || (t = c)
  58770. }
  58771. }
  58772. for (var c in n) {
  58773. var h = n[c];
  58774. this.createAnimation(c, h.start, h.end, e)
  58775. }
  58776. this.firstAnimation = t
  58777. }
  58778. ,
  58779. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58780. var t = this.animationsMap[e];
  58781. t && (t.direction = 1,
  58782. t.directionBackwards = !1)
  58783. }
  58784. ,
  58785. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58786. var t = this.animationsMap[e];
  58787. t && (t.direction = -1,
  58788. t.directionBackwards = !0)
  58789. }
  58790. ,
  58791. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58792. var i = this.animationsMap[e];
  58793. i && (i.fps = t,
  58794. i.duration = (i.end - i.start) / i.fps)
  58795. }
  58796. ,
  58797. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58798. var i = this.animationsMap[e];
  58799. i && (i.duration = t,
  58800. i.fps = (i.end - i.start) / i.duration)
  58801. }
  58802. ,
  58803. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58804. var i = this.animationsMap[e];
  58805. i && (i.weight = t)
  58806. }
  58807. ,
  58808. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58809. var i = this.animationsMap[e];
  58810. i && (i.time = t)
  58811. }
  58812. ,
  58813. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58814. var t = 0
  58815. , i = this.animationsMap[e];
  58816. return i && (t = i.time),
  58817. t
  58818. }
  58819. ,
  58820. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58821. var t = -1
  58822. , i = this.animationsMap[e];
  58823. return i && (t = i.duration),
  58824. t
  58825. }
  58826. ,
  58827. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58828. var t = this.animationsMap[e];
  58829. t ? (t.time = 0,
  58830. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58831. }
  58832. ,
  58833. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58834. var t = this.animationsMap[e];
  58835. t && (t.active = !1)
  58836. }
  58837. ,
  58838. n.MorphBlendMesh.prototype.update = function(e) {
  58839. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58840. var r = this.animationsList[t];
  58841. if (r.active) {
  58842. var o = r.duration / r.length;
  58843. r.time += r.direction * e,
  58844. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58845. r.time > r.duration && (r.time = r.duration,
  58846. r.directionBackwards = !0),
  58847. r.time < 0 && (r.time = 0,
  58848. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58849. r.time < 0 && (r.time += r.duration));
  58850. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58851. , s = r.weight;
  58852. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58853. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58854. this.morphTargetInfluences[a] = 0,
  58855. r.lastFrame = r.currentFrame,
  58856. r.currentFrame = a);
  58857. var l = r.time % o / o;
  58858. r.directionBackwards && (l = 1 - l),
  58859. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58860. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58861. }
  58862. }
  58863. }
  58864. ,
  58865. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58866. i.THREE = n) : this.THREE = n
  58867. }
  58868. , {}]
  58869. }, {}, [116]);